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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (75) hide show
  1. package/dist/cdn/dom.cjs +1 -1
  2. package/dist/cdn/dom.global.js +1 -1
  3. package/dist/cdn/dom.mjs +1 -1
  4. package/dist/index.cjs +1 -1
  5. package/dist/index.d.ts +7 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +9 -1
  8. package/dist/index.mjs +1 -1
  9. package/dist/lib/dom/dynamic-element.cjs +1 -1
  10. package/dist/lib/dom/dynamic-element.mjs +1 -1
  11. package/dist/lib/dom/hydration-state.cjs +1 -1
  12. package/dist/lib/dom/hydration-state.d.ts +2 -0
  13. package/dist/lib/dom/hydration-state.d.ts.map +1 -1
  14. package/dist/lib/dom/hydration-state.mjs +1 -1
  15. package/dist/lib/dom/hydration.cjs +1 -1
  16. package/dist/lib/dom/hydration.d.ts.map +1 -1
  17. package/dist/lib/dom/hydration.js +20 -1
  18. package/dist/lib/dom/hydration.mjs +1 -1
  19. package/dist/lib/dom/index.cjs +1 -1
  20. package/dist/lib/dom/index.mjs +1 -1
  21. package/dist/lib/dom/island.cjs +1 -1
  22. package/dist/lib/dom/island.mjs +1 -1
  23. package/dist/lib/dom/runtime.cjs +1 -1
  24. package/dist/lib/dom/runtime.d.ts +48 -0
  25. package/dist/lib/dom/runtime.d.ts.map +1 -1
  26. package/dist/lib/dom/runtime.js +100 -1
  27. package/dist/lib/dom/runtime.mjs +1 -1
  28. package/dist/lib/dom/server/host.cjs +1 -1
  29. package/dist/lib/dom/server/host.d.ts +4 -0
  30. package/dist/lib/dom/server/host.d.ts.map +1 -1
  31. package/dist/lib/dom/server/host.mjs +1 -1
  32. package/dist/lib/dom/server/index.cjs +1 -1
  33. package/dist/lib/dom/server/index.mjs +1 -1
  34. package/dist/lib/dom/server/nodes.cjs +1 -1
  35. package/dist/lib/dom/server/nodes.d.ts +15 -0
  36. package/dist/lib/dom/server/nodes.d.ts.map +1 -1
  37. package/dist/lib/dom/server/nodes.js +23 -0
  38. package/dist/lib/dom/server/nodes.mjs +1 -1
  39. package/dist/lib/dom/server/parse-template.cjs +1 -0
  40. package/dist/lib/dom/server/parse-template.d.ts +26 -0
  41. package/dist/lib/dom/server/parse-template.d.ts.map +1 -0
  42. package/dist/lib/dom/server/parse-template.js +154 -0
  43. package/dist/lib/dom/server/parse-template.mjs +1 -0
  44. package/dist/lib/dom/server/render.cjs +1 -1
  45. package/dist/lib/dom/server/render.d.ts.map +1 -1
  46. package/dist/lib/dom/server/render.js +4 -1
  47. package/dist/lib/dom/server/render.mjs +1 -1
  48. package/dist/lib/dom/server/serialize.cjs +1 -1
  49. package/dist/lib/dom/server/serialize.d.ts.map +1 -1
  50. package/dist/lib/dom/server/serialize.js +11 -1
  51. package/dist/lib/dom/server/serialize.mjs +1 -1
  52. package/dist/lib/dom/server-renderer.cjs +1 -1
  53. package/dist/lib/dom/server-renderer.mjs +1 -1
  54. package/dist/lib/dom/versions.cjs +1 -0
  55. package/dist/lib/dom/versions.d.ts +33 -0
  56. package/dist/lib/dom/versions.d.ts.map +1 -0
  57. package/dist/lib/dom/versions.js +57 -0
  58. package/dist/lib/dom/versions.mjs +1 -0
  59. package/dist/lib/flow/client-only.cjs +1 -1
  60. package/dist/lib/flow/client-only.mjs +1 -1
  61. package/dist/lib/flow/index-flow.cjs +1 -1
  62. package/dist/lib/flow/index-flow.mjs +1 -1
  63. package/dist/lib/flow/index.cjs +1 -1
  64. package/dist/lib/flow/index.mjs +1 -1
  65. package/dist/lib/flow/portal.cjs +1 -1
  66. package/dist/lib/flow/portal.mjs +1 -1
  67. package/dist/lib/index.cjs +1 -1
  68. package/dist/lib/index.mjs +1 -1
  69. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  70. package/dist/version.generated.cjs +1 -0
  71. package/dist/version.generated.d.ts +3 -0
  72. package/dist/version.generated.d.ts.map +1 -0
  73. package/dist/version.generated.js +3 -0
  74. package/dist/version.generated.mjs +1 -0
  75. package/package.json +4 -4
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- function gr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function xr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Tr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function br(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Er=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),_="http://www.w3.org/2000/svg";function _t(e){return e.localName.includes("-")}function de(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(_t(e)){e[t]=n;return}h(e,t,n,r)}var pe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Fe(e,t=document){return t.querySelector(e)}function Sr(e,t=document){return Array.from(t.querySelectorAll(e))}function vr(e,t){return e.closest(t)}function He(e,...t){e.classList.add(...t)}function Ve(e,...t){e.classList.remove(...t)}function We(e,...t){t.forEach(n=>e.classList.toggle(n))}function wr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ue(e,t){return e.getAttribute(t)}function Be(e,t){e.removeAttribute(t)}function ye(e,t){Object.assign(e.style,t)}function Ar(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Ke(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")ye(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else h(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ze(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ge(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Cr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Rr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Mr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Pr(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Lr(e,t=5e3){return new Promise((n,r)=>{let o=Fe(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Fe(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Or(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Dr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var It=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function kr(e){return typeof e=="object"&&e!==null&&e.$$typeof===It}function $t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function _r(e){if(typeof e!="function")return!1;try{let t=e();return $t(t)}catch{return!1}}function Ir(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function $r(e){return e instanceof Node}function qr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function jr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";function Hr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Vr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Wr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Ur(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Br(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Kr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function zr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Gr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ut(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Xr(e){return qt(e)?{type:"router",value:e}:Ft(e)?{type:"route",value:e}:jt(e)?{type:"routes",value:e}:Ht(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:Ut(e)?{type:"suspense",value:e}:Vt(e)?{type:"provider",value:e}:Wt(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Qe,createEffect as j,createRenderEffect as p,createRoot as Gt,onCleanup as R,readChildren as Xt}from"@fluixi/reactive/signal";var m=typeof document>"u";function P(e){m=e}var I=Symbol.for("fluixi.server-node"),me=null;function Xe(e){me=e}function $(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function L(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function he(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ge(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Je=null;function Ye(e){Je=e}function xe(){return Je}function Te(e,t){return u.active&&t.parentNode===e}function be(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Bt(){return u.active?u.cursor:null}function Kt(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function zt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function q(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&be(t)}function Jt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Yt(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 so(e){return Yt(Jt(e))}var ao=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Zt={};var Ze=new Map,X=new Set,ee=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!m)for(let t of e)X.has(t)||ee.has(t)||(X.add(t),document.addEventListener(t,Qt))}function Qt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ee(e,t,n){if(e[`$$${t}`]=n,ee.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}X.has(t)||te([t])}function J(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function lo(e){return!ee.has(e)}function co(e){return typeof e=="function"}function w(e,t=!1){if(m)return $().createText(e);if(u.active&&!t){let n=xe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ne(e,t=!1){if(m)return $().createElement(e,t);if(u.active){let n=xe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(_,e):document.createElement(e)}function et(e,t=!1){let n=Ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ze.set(e,r),r}function tt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function en(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?en(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function uo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function fo(e){if(x(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!b(t);)t=t();return t}var S=0,tn=200;function nn(e,t,n,r,o){let s=r,i=new Map;return p(()=>{let a;if(b(e)&&!x(e)){if(!i.has(e)){S++;try{let l=e();i.set(e,l)}finally{S--}}for(a=i.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(b(a)){if(!i.has(a)){let c=a;S++;try{let f=c();i.set(c,f)}finally{S--}}a=i.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!b(a))break}S++;try{s=Y(t,a,n,s,i),o(s)}finally{S--}})}function T(e,t,n,r){if(S>tn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){S++;try{o=Y(e,t,n,null)}finally{S--}return()=>o}let a=nn(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Y(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(G(t)){let i=w("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),C(e,r.slice(1),n)):g(e,i,n):r?e.replaceChild(i,r):g(e,i,n),t.then(a=>{i.parentNode===e&&Y(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=w(t);return g(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&ge(r))return r.data=t,r;let i=w(t);return r&&r.parentNode===e?e.replaceChild(i,r):Te(e,i)||g(e,i,n),i}if(L(t))return Te(e,t)?(be(t),t):Array.isArray(r)?(r.length===0?g(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):g(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];N(t,i,e,n,!0,o,l);let c=rn(e,a,i,n);for(let f of l){let d=T(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return Y(e,l,n,r)}}}return C(e,r,n)}function N(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!G(l)&&!x(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!x(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!G(c)&&!x(c)&&!b(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(x(c)){if(i){let d=w("",!0);t.push(d),i.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,o,s):N([f],t,n,r,o,s);continue}continue}Array.isArray(c)?N(c,t,n,r,o,s,i):N([c],t,n,r,o,s,i);continue}if(G(l)){let c=w("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(N([f],d,c.parentNode,void 0,!1,s),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){N(l,t,n,r,o,s,i);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?N(f,t,n,r,!1,s):N([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(w(c));continue}t.push(w(String(l)))}}}}function rn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let d=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)g(e,n[l++],d)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let d=t[--s].nextSibling;g(e,n[l++],t[a++].nextSibling),g(e,n[--i],d),t[s]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<i;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<i){let y=a,fe=1;for(;++y<s&&y<i&&!(!f.has(t[y])||f.get(t[y])!==d+fe);)fe++;if(fe>d-l){let kt=t[a];for(;l<d;)g(e,n[l++],kt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(g(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function O(e,t,n){n==null?delete e[t]:e[t]=n}function nt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function rt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function F(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function H(e,t,n){return typeof n!="function"?(O(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;O(e,t,r)})}function ot(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):p(()=>{let r=n();h(e,t,!!r)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>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(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function 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 r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function it(e){let{element:t,props:n,prevProps:r=Zt,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!he(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===_,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){k(c,t);continue}if(l==="use"){rt(t,c);continue}if(l.startsWith("on:")){a.push(nt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(H(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(F(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(ot(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>D(t,c()))):D(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>Z(t,c()))):Z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Q(t,c()))):Q(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&J(t,y),c&&Ee(t,y,c);continue}let d=pe.has(l)||!i&&l in t;typeof c=="function"?a.push(d?H(t,l,c):F(t,l,c,i)):a.push(p(()=>d?O(t,l,n[l]):h(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();J(t,c)}else pe.has(l)?O(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function re(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){k(o,e);continue}if(r!=="children"){if(r==="use"){rt(e,o);continue}if(r.startsWith("on:")){nt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){H(e,r.slice(5),o);continue}if(r.startsWith("attr:")){F(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ot(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(ee.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,X.has(s)||te([s]);continue}if(r==="class"||r==="className"){D(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>Z(e,o())):Z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Q(e,o())):Q(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});R(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});R(()=>{s()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});R(()=>{s()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=j(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{i()})}else{let s=!0;p(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=j(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();de(e,r,i,n)});R(()=>{s()})}else p(()=>de(e,r,t[r],n))}}}function st(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function po(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function k(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function at(e,t,n){let r=t||document.body,o=Xt(()=>e),s=[];return Qe(()=>{let i=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),R(()=>{s.forEach(a=>a())})}),null}function yo(e){return typeof e=="string"&&e.toLowerCase()===e}function lt(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 mo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function G(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ho(e){return typeof e=="function"&&e.length===0&&x(e)}function oe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return Gt(i=>{Qe(()=>{u.active||(t.textContent=""),T(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var on="__fx_dom_create_component__",M=globalThis[on]??={fn:null};function xo(e){M.fn=e}function To(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ie(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var bo=()=>M.fn!==null,ct=()=>M.fn!==null;function ut(){M.fn=null}var se,dt={getStore:()=>se,run(e,t){let n=se;se=e;try{return t()}finally{se=n}}},Ne=dt;function pt(e){Ne=e??dt}function V(e={}){e.locals||(e.locals=e.request?ve(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function W(e,t){return Ne.run(e,t)}function v(){return Ne.getStore()}function Se(){return v()?.event}function yt(){let e=Se();return e?(e.locals||(e.locals={}),e.locals):{}}var ft=new WeakMap;function ve(e){let t=ft.get(e);return t||(t={},ft.set(e,t)),t}import{setResourceIdSource as sn,setServerDataGetter as an}from"@fluixi/reactive/signal";var U="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var we;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(we!==void 0)return we;let t=null;if(typeof document<"u"){let n=document.getElementById(U)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return we=t}function Ae(){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 ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ce=typeof process<"u"&&process.env&&!1;function Re(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){Ae();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(ln.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ce&&t&&Re(`<${e}>`,t),null)}function un(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ae();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ce&&t&&Re(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function fn(e){Ae();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ce&&t&&Re(`marker <!--${e.slice(0,24)}-->`,t),null)}var mt=!1;function dn(){mt||(mt=!0,Ye({hydrateElement:cn,hydrateText:un,hydrateMarker:fn}))}function B(e,t,n){dn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=le(),o=n?.resourceNamespace,s=0;sn(()=>o?`${o}:r${s++}`:`r${s++}`),an(r?i=>i in r?{value:r[i]}:void 0:null);try{return oe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function pn(e){let{component:t,props:n={},name:r}=e,o=ne(Me),s=r??t.name??"Island";h(o,"name",s),h(o,"props",JSON.stringify(n??{}));let i=m?v():void 0;if(i){let a=i.nextIslandNamespace(s);T(o,()=>i.withResourceScope(a,()=>t(n)))}else T(o,()=>t(n));return o}var ht=!1;function yn(){if(ht||typeof document>"u")return;ht=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function mn(e){if(typeof document>"u")return;yn();let t=document.querySelectorAll(Me),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}B(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function hn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function gn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as xn}from"@fluixi/reactive/signal";function Xo(e,t={}){if(typeof e=="function")return ie(e,t);if(typeof e!="string"||e.length===0)return null;let n=lt(e);if(m)return $().createElement(e,n);let r=n?document.createElementNS(_,e):document.createElement(e);return re(r,t,n),Tn(r,t),r}function Tn(e,t){if(!t||t.children===void 0)return;let n=xn(()=>t.children),r=o=>{T(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as bn,createMemo as Pe,disposeScope as En,getOwner as Nn,runWithOwner as Sn,untrack as bt}from"@fluixi/reactive/signal";function gt(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function xt(e){return e!=null&&e!==!1}function Tt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function vn(e){let t=A(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0),o=Nn(),s=null,i=null,a=l=>{l!==i&&(s&&En(s),s=bn(o),i=l)};return Pe(()=>{let l=r();return a(l?"when":"fallback"),Sn(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!Tt(c)?typeof n=="function"?bt(()=>bt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as wn,keyArray as An}from"@fluixi/reactive/signal";function Cn(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return q(a),a};return e.by?An(t,e.by,(o,s)=>r(o,s),{fallback:n}):wn(t,(o,s)=>r(o,s),{fallback:n})}import{indexArray as Rn}from"@fluixi/reactive/signal";function Mn(e){let t=A(()=>e.each);return Rn(t,(n,r)=>{let o=e.children(n,r);return q(o),o},{fallback:()=>e.fallback??null})}import{mapArray as Bi,keyArray as Ki,indexArray as zi}from"@fluixi/reactive/signal";import{createMemo as Pn,createChildOwner as Ln,disposeScope as On,getOwner as Dn,runWithOwner as Et}from"@fluixi/reactive/signal";var Le=Symbol("match");function kn(e){return{[Le]:!0,when:A(()=>e.when),get children(){return e.children}}}function _n(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Dn(),r=null,o=-1,s=i=>{i!==o&&(r&&On(r),r=Ln(n),o=i)};return Pn(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Le]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Le]!==!0)continue;let f=l.when();if(xt(f))return s(i),Et(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),Et(r,()=>e.fallback??null)})}import{createMemo as In,createChildOwner as $n,disposeScope as qn,getOwner as jn,runWithOwner as Fn}from"@fluixi/reactive/signal";function Hn(e){let t=gt(e.component),{component:n,...r}=e,o=jn(),s=null,i;return In(()=>{let a=t();return a!==i&&(s&&qn(s),s=$n(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:Fn(s,()=>a(r))})}import{createRoot as Vn,onCleanup as Wn}from"@fluixi/reactive/signal";function Un(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Vn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),T(r,e.children)&&k(e.ref,r)}),Wn(()=>{n(),r.remove()}),null}import{createMemo as Bn,createSignal as Kn}from"@fluixi/reactive/signal";function Nt(e){if(m)return e.fallback??null;let t=u.active,[n,r]=Kn(!t);return t&&queueMicrotask(()=>r(!0)),Bn(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var zn=Nt;import{createMemo as Gn,createSignal as Xn}from"@fluixi/reactive/signal";function Jn(e){let[t,n]=Xn(null),r=()=>n(null);return Gn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}import{createMemo as Yn}from"@fluixi/reactive/signal";function Zn(e){return Yn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as Qn}from"@fluixi/reactive/signal";function er(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function tr(e){return Qn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${er(r)}: ${s}`)}return n.join("; ")})}var ke=1,_e=3,Ie=8,St;St=I;var K=class{constructor(){this[St]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},z=class e extends K{constructor(n){super();this.nodeType=_e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ce=class e extends K{constructor(n){super();this.nodeType=Ie;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Oe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},De=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},ue=class e extends K{constructor(n,r=!1){super();this.nodeType=ke;this.attributes=new Map;this.style=new Oe;this.classList=new De(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new z(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var nr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),wt=/&/g,rr=/</g,or=/>/g,ir=/"/g;function $e(e){return e.replace(wt,"&amp;").replace(rr,"&lt;").replace(or,"&gt;")}function vt(e){return e.replace(wt,"&amp;").replace(ir,"&quot;")}function sr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function ar(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${sr(n)}: ${r}`)}return t.join("; ")}function lr(e){let t="",n=ar(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${vt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${vt(o)}"`}return t}function E(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return $e(e);if(typeof e=="number")return $e(String(e));if(typeof e=="function")return E(e());if(Array.isArray(e))return e.map(E).join("");switch(e.nodeType){case _e:return $e(e.data??"");case Ie:return`<!--${e.data??""}-->`;case ke:{let t=e.localName,n=`<${t}${lr(e)}>`;if(nr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(E).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(E).join(""):""}import{createRoot as Mt}from"@fluixi/reactive/signal";import{setResourceTracker as cr,setResourceIdSource as ur,setResourceDataSink as fr,getOwner as dr,runWithOwner as At,flush as pr}from"@fluixi/reactive/signal";var Ct=!1;function Pt(){Ct||(Ct=!0,Xe({createElement:(e,t)=>new ue(e,t),createText:e=>new z(e),createComment:e=>new ce(e)}))}function Lt(e,t={}){let n=m;Pt(),P(!0);let r=V(t.event);try{return W(r,()=>Mt(o=>{try{let s=typeof e=="function"?e():e;return E(s)}finally{o()}}))}finally{P(n)}}var Rt=!1;function yr(){Rt||(Rt=!0,cr(e=>{v()?.pending.add(e)}),ur(()=>v()?.nextResourceId()??""),fr((e,t)=>{e&&v()?.data.set(e,t)}))}var qe=null;function Ot(e){qe=e}function je(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(qe)try{s=qe(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return`<script type="application/json" id="${U}">${n}<\/script>`}var mr=50;async function Dt(e,t={}){let n=m;Pt(),P(!0),yr();let r=V(t.event);try{return await W(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};Mt(f=>{i=f,s=dr(),o=typeof e=="function"?e():e});let a=()=>{try{At(s,()=>E(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<mr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await pr(),a()}let c=At(s,()=>E(o))+je(r);return i(),c})}finally{P(n)}}var hr={createComponent:ie,createElement:Ke,createNativeElement:ne,createTemplate:et,cloneTemplate:tt,createPortal:at,render:oe,hydrate:B,insert:T,appendChildren:Ge,removeChildren:ze,spread:it,applyProps:re,mergeProps:st,setProperty:O,setDynamicProperty:H,setAttribute:h,setDynamicAttribute:F,removeAttribute:Be,getAttribute:Ue,setClassName:D,addClass:He,removeClass:Ve,toggleClass:We,setStyles:ye,delegateEvents:te,addDelegatedEventListener:Ee,removeDelegatedEventListener:J,handleRef:k,resetIntegration:ut,isIntegrationInitialized:ct},Ms=hr;export{Nt as ClientOnly,Hn as Dynamic,Jn as ErrorBoundary,U as FX_DATA_ID,Cn as For,Mn as Index,pn as Island,pe as JSX_PROPERTIES,kn as Match,zn as NoSsr,Un as Portal,Nr as SVG_ELEMENTS,_ as SVG_NAMESPACE,vn as Show,_n as Switch,Er as VOID_ELEMENTS,He as addClass,Ee as addDelegatedEventListener,nt as addNativeEventListener,Ge as appendChildren,de as applyElementProp,re as applyProps,rt as applyUse,zr as asComponent,Kr as asContext,Ur as asOutlet,Br as asProvider,Wr as asRoute,Hr as asRouter,Vr as asRoutes,Gr as asSuspense,Bt as captureHydrationCursor,Xr as checkRenderType,Zn as classMap,C as cleanChildren,tt as cloneTemplate,vr as closest,ie as createComponent,Xo as createDynamicElement,Ke as createElement,ne as createNativeElement,at as createPortal,V as createRequestContext,et as createTemplate,Ms as default,Pr as delegate,te as delegateEvents,ae as escapeFxJson,mo as escapeHTML,uo as fnName,ao as generateID,Ue as getAttribute,jr as getGlobal,Tr as getLitEventName,yt as getLocals,Mr as getOffset,v as getRequestContext,Se as getRequestEvent,ve as getRequestLocals,le as getServerData,so as getStableElementId,Ar as getStyle,k as handleRef,wr as hasClass,hn as html,B as hydrate,q as hydrateAdvancePast,mn as hydrateIslands,zi as indexArray,To as initializeIntegration,T as insert,Y as insertExpression,bo as intergartionInitialized,ho as isAccessor,b as isComponent,Wt as isContext,_t as isCustomElement,$r as isDOMNode,lo as isDelegatedEvent,he as isDomElement,L as isDomNode,ge as isDomText,xr as isEventHandler,co as isFunction,ct as isIntegrationInitialized,Ir as isJSXTemplate,$t as isLitTemplateResult,yo as isNativeElement,Ht as isOutlet,G as isPromise,Vt as isProvider,kr as isReactElement,Ft as isRoute,qt as isRouter,jt as isRoutes,lt as isSVGElement,m as isServer,Ut as isSuspense,_r as isTemplateFactory,Cr as isVisible,fo as iterateFn,Ki as keyArray,en as makeArrayFlat,Bi as mapArray,st as mergeProps,Or as observeIntersection,Dr as observeResize,Fe as query,Sr as queryAll,xo as registerCreateComponent,qr as registerGlobal,Be as removeAttribute,ze as removeChildren,Ve as removeClass,J as removeDelegatedEventListener,oe as render,Lt as renderToString,Dt as renderToStringAsync,ut as resetIntegration,Kt as runHydrationAt,W as runWithRequestContext,zt as runWithoutHydration,Rr as scrollIntoView,E as serializeNode,je as serializeResourceData,h as setAttribute,Z as setClassList,D as setClassName,Ot as setDataRedactor,F as setDynamicAttribute,ot as setDynamicBoolAttribute,H as setDynamicProperty,O as setProperty,pt as setRequestStore,P as setServerMode,Q as setStyle,ye as setStyles,br as shouldSetAsProperty,po as splitProps,it as spread,tr as styleMap,gn as svg,gr as toAttributeName,We as toggleClass,Lr as waitForElement};
1
+ function $r(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Ir(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function qr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function jr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var Fr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Hr=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"]),U="http://www.w3.org/2000/svg";function Zt(e){return e.localName.includes("-")}function Se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(Zt(e)){e[t]=n;return}h(e,t,n,r)}var ve=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ze(e,t=document){return t.querySelector(e)}function Vr(e,t=document){return Array.from(t.querySelectorAll(e))}function Wr(e,t){return e.closest(t)}function Qe(e,...t){e.classList.add(...t)}function et(e,...t){e.classList.remove(...t)}function tt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Ur(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function nt(e,t){return e.getAttribute(t)}function rt(e,t){e.removeAttribute(t)}function Ae(e,t){Object.assign(e.style,t)}function Br(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ot(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")Ae(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else h(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function it(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function st(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Kr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function zr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Gr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Xr(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Jr(e,t=5e3){return new Promise((n,r)=>{let o=Ze(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Ze(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Yr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Zr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Qt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Qr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Qt}function en(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function eo(e){if(typeof e!="function")return!1;try{let t=e();return en(t)}catch{return!1}}function to(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function no(e){return e instanceof Node}function ro(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function oo(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as b}from"@fluixi/reactive/signal";var Ce="1.0.0-alpha.71";import{VERSION as tn}from"@fluixi/reactive";var x={dom:Ce,reactive:tn};function nn(e){x.core=e}function Re(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function Me(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.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 uo(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function fo(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function po(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function yo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function mo(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function go(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ho(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function xo(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function rn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function on(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function sn(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function an(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function cn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function w(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function un(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function To(e){return rn(e)?{type:"router",value:e}:sn(e)?{type:"route",value:e}:on(e)?{type:"routes",value:e}:an(e)?{type:"outlet",value:e}:w(e)?{type:"component",value:e}:un(e)?{type:"suspense",value:e}:ln(e)?{type:"provider",value:e}:cn(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as ft,createEffect as z,createRenderEffect as m,createRoot as pn,onCleanup as O,readChildren as yn}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var B=Symbol.for("fluixi.server-node"),Pe=null;function at(e){Pe=e}function $(){if(!Pe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Pe}function I(e){return e!=null&&e[B]===!0?!0:typeof Node<"u"&&e instanceof Node}function Oe(e){return e!=null&&e[B]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Le(e){return e!=null&&e[B]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},lt=null;function ct(e){lt=e}function ee(){return lt}function ke(e,t){return u.active&&t.parentNode===e}function De(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function fn(){return u.active?u.cursor:null}function te(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function dn(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function K(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&De(t)}function mn(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function gn(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Oo(e){return gn(mn(e))}var Lo=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),hn={};var ut=new Map,re=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!g)for(let t of e)re.has(t)||le.has(t)||(re.add(t),document.addEventListener(t,xn))}function xn(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function _e(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}re.has(t)||ce([t])}function oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function ko(e){return!le.has(e)}function Do(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=ee()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ue(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=ee()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(U,e):document.createElement(e)}function $e(e,t=!1){let n=ut.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ut.set(e,r),r}function dt(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=ee()?.hydrateStatic(t);if(o)return o}return Ie($e(e,r),r).firstChild}function pt(e,t){if(!u.active)return t();let n=te(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?te(e.nextSibling,()=>r(...o)):r(...o))}return n}function yt(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 mt(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ie(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Tn(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Tn(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function _o(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function $o(e){if(b(e)||w(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!b(t)&&!w(t);)t=t();return t}var A=0,bn=200;function En(e,t,n,r,o){let s=r,i=new Map;return m(()=>{let a;if(w(e)&&!b(e)){if(!i.has(e)){A++;try{let l=e();i.set(e,l)}finally{A--}}for(a=i.get(e);typeof a=="function"&&b(a);)a=a()}else for(a=e();typeof a=="function"&&b(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(w(a)){if(!i.has(a)){let c=a;A++;try{let f=c();i.set(c,f)}finally{A--}}a=i.get(a)}else if(b(a))a=a();else if(a=a(),typeof a!="function"||!b(a)&&!w(a))break}A++;try{s=ie(t,a,n,s,i),o(s)}finally{A--}})}function E(e,t,n,r){if(A>bn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=R("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){A++;try{o=ie(e,t,n,null)}finally{A--}return()=>o}let a=En(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ie(e,t,n,r,o){if(t==null||typeof t=="boolean")return P(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return P(e,r,n);if(ne(t)){let i=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),P(e,r.slice(1),n)):T(e,i,n):r?e.replaceChild(i,r):T(e,i,n),t.then(a=>{i.parentNode===e&&ie(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=R(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=P(e,r,n)}if(r&&Le(r))return r.data=t,r;let i=R(t);return r&&r.parentNode===e?e.replaceChild(i,r):ke(e,i)||T(e,i,n),i}if(I(t))return ke(e,t)?(De(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];v(t,i,e,n,!0,o,l);let c=Nn(e,a,i,n);for(let f of l){let d=E(e,f.sig,f.marker);O(()=>{P(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return ie(e,l,n,r)}}}return P(e,r,n)}function v(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!ne(l)&&!b(l)&&!w(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(w(l)&&!b(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!ne(c)&&!b(c)&&!w(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(b(c)){if(i){let d=R("",!0);t.push(d),i.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&b(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?v(f,t,n,r,o,s):v([f],t,n,r,o,s);continue}continue}Array.isArray(c)?v(c,t,n,r,o,s,i):v([c],t,n,r,o,s,i);continue}if(ne(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(v([f],d,c.parentNode,void 0,!1,s),d.length>0){c.parentNode.replaceChild(d[0],c);for(let p=1;p<d.length;p++)c.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){v(l,t,n,r,o,s,i);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?v(f,t,n,r,!1,s):v([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(R(c));continue}t.push(R(String(l)))}}}}function Nn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let d=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)T(e,n[l++],d)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let d=t[--s].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--i],d),t[s]=t[a-1]}else{if(!f){f=new Map;let p=l;for(;p<i;)f.set(n[p],p++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<i){let p=a,y=1;for(;++p<s&&p<i&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let Ne=t[a];for(;l<d;)T(e,n[l++],Ne)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function P(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function q(e,t,n){n==null?delete e[t]:e[t]=n}function gt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function ht(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function G(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function X(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;q(e,t,r)})}function xt(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):m(()=>{let r=n();h(e,t,!!r)})}function j(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>j(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function se(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function ae(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function Tt(e){let{element:t,props:n,prevProps:r=hn,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!Oe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===U,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){F(c,t);continue}if(l==="use"){ht(t,c);continue}if(l.startsWith("on:")){a.push(gt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(X(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(G(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(xt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>j(t,c()))):j(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>se(t,c()))):se(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ae(t,c()))):ae(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&oe(t,p),c&&_e(t,p,c);continue}let d=ve.has(l)||!i&&l in t;typeof c=="function"?a.push(d?X(t,l,c):G(t,l,c,i)):a.push(m(()=>d?q(t,l,n[l]):h(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();oe(t,c)}else ve.has(l)?q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function fe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){F(o,e);continue}if(r!=="children"){if(r==="use"){ht(e,o);continue}if(r.startsWith("on:")){gt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){X(e,r.slice(5),o);continue}if(r.startsWith("attr:")){G(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){xt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(le.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,re.has(s)||ce([s]);continue}if(r==="class"||r==="className"){j(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>se(e,o())):se(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ae(e,o())):ae(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=z(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});O(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=z(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});O(()=>{s()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=z(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});O(()=>{s()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=z(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});O(()=>{i()})}else{let s=!0;m(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=z(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();Se(e,r,i,n)});O(()=>{s()})}else m(()=>Se(e,r,t[r],n))}}}function bt(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Io(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function F(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Et(e,t,n){let r=t||document.body,o=yn(()=>e),s=[];return ft(()=>{let i=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),O(()=>{s.forEach(a=>a())})}),null}function qo(e){return typeof e=="string"&&e.toLowerCase()===e}function Nt(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 jo(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function ne(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Fo(e){return typeof e=="function"&&e.length===0&&b(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return pn(i=>{ft(()=>{u.active||(t.textContent=""),Re(t),Me(),E(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var wn="__fx_dom_create_component__",L=globalThis[wn]??={fn:null};function Vo(e){L.fn=e}function Wo(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function pe(e,t){return L.fn?L.fn(e,t):(()=>e(t))}var Uo=()=>L.fn!==null,wt=()=>L.fn!==null;function St(){L.fn=null}var ye,At={getStore:()=>ye,run(e,t){let n=ye;ye=e;try{return t()}finally{ye=n}}},qe=At;function Ct(e){qe=e??At}function J(e={}){e.locals||(e.locals=e.request?Fe(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function Y(e,t){return qe.run(e,t)}function C(){return qe.getStore()}function je(){return C()?.event}function Rt(){let e=je();return e?(e.locals||(e.locals={}),e.locals):{}}var vt=new WeakMap;function Fe(e){let t=vt.get(e);return t||(t={},vt.set(e,t)),t}import{setResourceIdSource as Sn,setServerDataGetter as vn}from"@fluixi/reactive/signal";var Z="__FX_DATA__";function me(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var He;function ge(){let e=globalThis.__FX_DATA__;if(e)return e;if(He!==void 0)return He;let t=null;if(typeof document<"u"){let n=document.getElementById(Z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return He=t}function he(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var An=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Cn(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(An.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Rn(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`<${e}> (static)`,t),null)}function Mn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}he();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Pn(e){he();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Mt=!1;function On(){Mt||(Mt=!0,ct({hydrateElement:Cn,hydrateText:Mn,hydrateMarker:Pn,hydrateStatic:Rn}))}function Q(e,t,n){On(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ge(),o=n?.resourceNamespace,s=0;Sn(()=>o?`${o}:r${s++}`:`r${s++}`),vn(r?i=>i in r?{value:r[i]}:void 0:null);try{return de(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ve="fluixi-island";function Ln(e){let{component:t,props:n={},name:r}=e,o=ue(Ve),s=r??t.name??"Island";h(o,"name",s),h(o,"props",JSON.stringify(n??{}));let i=g?C():void 0;if(i){let a=i.nextIslandNamespace(s);E(o,()=>i.withResourceScope(a,()=>t(n)))}else E(o,()=>t(n));return o}var Pt=!1;function kn(){if(Pt||typeof document>"u")return;Pt=!0;let e=document.createElement("style");e.textContent=`${Ve}{display:contents}`,document.head.appendChild(e)}function Dn(e){if(typeof document>"u")return;kn();let t=document.querySelectorAll(Ve),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Q(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function _n(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function $n(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as In}from"@fluixi/reactive/signal";function Ti(e,t={}){if(typeof e=="function")return pe(e,t);if(typeof e!="string"||e.length===0)return null;let n=Nt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(U,e):document.createElement(e);return fe(r,t,n),qn(r,t),r}function qn(e,t){if(!t||t.children===void 0)return;let n=In(()=>t.children),r=o=>{E(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as jn,createMemo as We,disposeScope as Fn,getOwner as Hn,runWithOwner as Vn,untrack as Dt}from"@fluixi/reactive/signal";function Ot(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Lt(e){return e!=null&&e!==!1}function kt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Wn(e){let t=M(()=>e.when),n=We(t,void 0),r=We(n,void 0),o=Hn(),s=null,i=null,a=l=>{l!==i&&(s&&Fn(s),s=jn(o),i=l)};return We(()=>{let l=r();return a(l?"when":"fallback"),Vn(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!kt(c)?typeof n=="function"?Dt(()=>Dt(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as Un,keyArray as Bn}from"@fluixi/reactive/signal";function Kn(e){let t=M(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return K(a),a};return e.by?Bn(t,e.by,(o,s)=>r(o,s),{fallback:n}):Un(t,(o,s)=>r(o,s),{fallback:n})}import{indexArray as zn}from"@fluixi/reactive/signal";function Gn(e){let t=M(()=>e.each);return zn(t,(n,r)=>{let o=e.children(n,r);return K(o),o},{fallback:()=>e.fallback??null})}import{mapArray as ms,keyArray as gs,indexArray as hs}from"@fluixi/reactive/signal";import{createMemo as Xn,createChildOwner as Jn,disposeScope as Yn,getOwner as Zn,runWithOwner as _t}from"@fluixi/reactive/signal";var Ue=Symbol("match");function Qn(e){return{[Ue]:!0,when:M(()=>e.when),get children(){return e.children}}}function er(e){let t=Array.isArray(e.children)?e.children:[e.children],n=Zn(),r=null,o=-1,s=i=>{i!==o&&(r&&Yn(r),r=Jn(n),o=i)};return Xn(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Ue]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ue]!==!0)continue;let f=l.when();if(Lt(f))return s(i),_t(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),_t(r,()=>e.fallback??null)})}import{createMemo as tr,createChildOwner as nr,disposeScope as rr,getOwner as or,runWithOwner as ir}from"@fluixi/reactive/signal";function sr(e){let t=Ot(e.component),{component:n,...r}=e,o=or(),s=null,i;return tr(()=>{let a=t();return a!==i&&(s&&rr(s),s=nr(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:ir(s,()=>a(r))})}import{createRoot as ar,onCleanup as lr}from"@fluixi/reactive/signal";function cr(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return ar(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),E(r,e.children)&&F(e.ref,r)}),lr(()=>{n(),r.remove()}),null}import{createMemo as ur,createSignal as fr}from"@fluixi/reactive/signal";function $t(e){if(g)return e.fallback??null;let t=u.active,[n,r]=fr(!t);return t&&queueMicrotask(()=>r(!0)),ur(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var dr=$t;import{createMemo as pr,createSignal as yr}from"@fluixi/reactive/signal";function mr(e){let[t,n]=yr(null),r=()=>n(null);return pr(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}import{createMemo as gr}from"@fluixi/reactive/signal";function hr(e){return gr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as xr}from"@fluixi/reactive/signal";function Tr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function br(e){return xr(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Tr(r)}: ${s}`)}return n.join("; ")})}var Ee=1,ze=3,Ge=8,It;It=B;var H=class{constructor(){this[It]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},k=class e extends H{constructor(n){super();this.nodeType=ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},be=class e extends H{constructor(n){super();this.nodeType=Ee;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},V=class e extends H{constructor(n){super();this.nodeType=Ge;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Be=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ke=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},D=class e extends H{constructor(n,r=!1){super();this.nodeType=Ee;this.attributes=new Map;this.style=new Be;this.classList=new Ke(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new k(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var Er=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),jt=/&/g,Ft=/</g,Ht=/>/g,Nr=/"/g;function Xe(e){return e.replace(jt,"&amp;").replace(Ft,"&lt;").replace(Ht,"&gt;")}function qt(e){return e.replace(jt,"&amp;").replace(Nr,"&quot;").replace(Ft,"&lt;").replace(Ht,"&gt;")}function wr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Sr(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${wr(n)}: ${r}`)}return t.join("; ")}function vr(e){let t="",n=Sr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${qt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${qt(o)}"`}return t}function S(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Xe(e);if(typeof e=="number")return Xe(String(e));if(typeof e=="function")return S(e());if(Array.isArray(e))return e.map(S).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ze:return Xe(e.data??"");case Ge:return`<!--${e.data??""}-->`;case Ee:{let t=e.localName,n=`<${t}${vr(e)}>`;if(Er.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(S).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(S).join(""):""}import{createRoot as zt}from"@fluixi/reactive/signal";import{setResourceTracker as Rr,setResourceIdSource as Mr,setResourceDataSink as Pr,getOwner as Or,runWithOwner as Ut,flush as Lr}from"@fluixi/reactive/signal";var Ar=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Cr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Vt(e){return e.replace(/&(#?\w+);/g,(t,n)=>Cr[n]??t)}var N=class extends Error{};function Wt(e,t=!1){let n=0,r=[],o=[],s=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new N(`unterminated comment at ${c}`);s(new V(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new N(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new N(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new N(`unclosed <${o[o.length-1].localName}>`);let i=r[0];if(r.length!==1||!(i instanceof D))throw new N(`expected exactly one root element, got ${r.length}`);return i;function a(c){c!==""&&s(new k(Vt(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new N(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new D(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let Ne=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let W=e.slice(Ne,y);if(W==="")throw new N(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new N(`attribute ${W} must have a double-quoted value`);let we=e.indexOf('"',y+2);if(we===-1)throw new N(`unterminated value for ${W}`);p.setAttribute(W,Vt(e.slice(y+2,we))),y=we+1}else p.setAttribute(W,"")}return s(p),Ar.has(d)||o.push(p),y}}var Bt=!1;function Gt(){Bt||(Bt=!0,at({createElement:(e,t)=>new D(e,t),createText:e=>new k(e),createRaw:e=>new be(e),parseTemplate:(e,t)=>Wt(e,t),createComment:e=>new V(e)}))}function Xt(e,t={}){let n=g;Gt(),_(!0);let r=J(t.event);try{return Y(r,()=>zt(o=>{try{let s=typeof e=="function"?e():e;return S(s)}finally{o()}}))}finally{_(n)}}var Kt=!1;function kr(){Kt||(Kt=!0,Rr(e=>{C()?.pending.add(e)}),Mr(()=>C()?.nextResourceId()??""),Pr((e,t)=>{e&&C()?.data.set(e,t)}))}var Je=null;function Jt(e){Je=e}function Ye(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(Je)try{s=Je(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=me(JSON.stringify(t));return`<script type="application/json" id="${Z}">${n}<\/script>`}var Dr=50;async function Yt(e,t={}){let n=g;Gt(),_(!0),kr();let r=J(t.event);try{return await Y(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};zt(f=>{i=f,s=Or(),o=typeof e=="function"?e():e});let a=()=>{try{Ut(s,()=>S(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Dr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Lr(),a()}let c=Ut(s,()=>S(o))+Ye(r);return i(),c})}finally{_(n)}}var _r={createComponent:pe,createElement:ot,createNativeElement:ue,createTemplate:$e,cloneTemplate:Ie,templateNode:dt,holeContent:mt,holeEnd:yt,holeScope:pt,createPortal:Et,render:de,hydrate:Q,insert:E,appendChildren:st,removeChildren:it,spread:Tt,applyProps:fe,mergeProps:bt,setProperty:q,setDynamicProperty:X,setAttribute:h,setDynamicAttribute:G,removeAttribute:rt,getAttribute:nt,setClassName:j,addClass:Qe,removeClass:et,toggleClass:tt,setStyles:Ae,delegateEvents:ce,addDelegatedEventListener:_e,removeDelegatedEventListener:oe,handleRef:F,resetIntegration:St,isIntegrationInitialized:wt},na=_r;export{$t as ClientOnly,sr as Dynamic,mr as ErrorBoundary,Z as FX_DATA_ID,Kn as For,Gn as Index,Ln as Island,ve as JSX_PROPERTIES,Qn as Match,dr as NoSsr,cr as Portal,Hr as SVG_ELEMENTS,U as SVG_NAMESPACE,Wn as Show,er as Switch,Ce as VERSION,Fr as VOID_ELEMENTS,Qe as addClass,_e as addDelegatedEventListener,gt as addNativeEventListener,st as appendChildren,Se as applyElementProp,fe as applyProps,ht as applyUse,ho as asComponent,go as asContext,yo as asOutlet,mo as asProvider,po as asRoute,uo as asRouter,fo as asRoutes,xo as asSuspense,fn as captureHydrationCursor,To as checkRenderType,hr as classMap,P as cleanChildren,Ie as cloneTemplate,Wr as closest,pe as createComponent,Ti as createDynamicElement,ot as createElement,ue as createNativeElement,Et as createPortal,J as createRequestContext,$e as createTemplate,na as default,Xr as delegate,ce as delegateEvents,me as escapeFxJson,jo as escapeHTML,_o as fnName,Lo as generateID,nt as getAttribute,oo as getGlobal,qr as getLitEventName,Rt as getLocals,Gr as getOffset,C as getRequestContext,je as getRequestEvent,Fe as getRequestLocals,ge as getServerData,Oo as getStableElementId,Br as getStyle,F as handleRef,Ur as hasClass,mt as holeContent,yt as holeEnd,pt as holeScope,_n as html,Q as hydrate,K as hydrateAdvancePast,Dn as hydrateIslands,hs as indexArray,Wo as initializeIntegration,E as insert,ie as insertExpression,Uo as intergartionInitialized,Fo as isAccessor,w as isComponent,cn as isContext,Zt as isCustomElement,no as isDOMNode,ko as isDelegatedEvent,Oe as isDomElement,I as isDomNode,Le as isDomText,Ir as isEventHandler,Do as isFunction,wt as isIntegrationInitialized,to as isJSXTemplate,en as isLitTemplateResult,qo as isNativeElement,an as isOutlet,ne as isPromise,ln as isProvider,Qr as isReactElement,sn as isRoute,rn as isRouter,on as isRoutes,Nt as isSVGElement,g as isServer,un as isSuspense,eo as isTemplateFactory,Kr as isVisible,$o as iterateFn,gs as keyArray,Tn as makeArrayFlat,ms as mapArray,bt as mergeProps,Yr as observeIntersection,Zr as observeResize,Ze as query,Vr as queryAll,nn as registerCoreVersion,Vo as registerCreateComponent,ro as registerGlobal,rt as removeAttribute,it as removeChildren,et as removeClass,oe as removeDelegatedEventListener,de as render,Xt as renderToString,Yt as renderToStringAsync,St as resetIntegration,te as runHydrationAt,Y as runWithRequestContext,dn as runWithoutHydration,zr as scrollIntoView,S as serializeNode,Ye as serializeResourceData,h as setAttribute,se as setClassList,j as setClassName,Jt as setDataRedactor,G as setDynamicAttribute,xt as setDynamicBoolAttribute,X as setDynamicProperty,q as setProperty,Ct as setRequestStore,_ as setServerMode,ae as setStyle,Ae as setStyles,jr as shouldSetAsProperty,Io as splitProps,Tt as spread,Re as stampVersions,br as styleMap,$n as svg,dt as templateNode,$r as toAttributeName,tt as toggleClass,x as versions,Jr as waitForElement,Me as warnOnVersionSkew};
@@ -1 +1 @@
1
- "use strict";var M=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},te=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z(t))!Q.call(e,s)&&s!==n&&M(e,s,{get:()=>t[s],enumerable:!(o=Y(t,s))||o.enumerable});return e};var ne=e=>te(M({},"__esModule",{value:!0}),e);var Ee={};ee(Ee,{createDynamicElement:()=>xe});module.exports=ne(Ee);var m=require("@fluixi/reactive/signal");var R="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function P(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(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 Te=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var d=require("@fluixi/reactive/signal");var S=typeof document>"u";var j=Symbol.for("fluixi.server-node"),_=null;function w(){if(!_)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _}function A(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},re=null;function $(){return re}function O(e,t){return b.active&&t.parentNode===e}function I(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var H=new Set,q=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!S)for(let t of e)H.has(t)||q.has(t)||(H.add(t),document.addEventListener(t,se))}function se(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(S)return w().createText(e);if(b.active&&!t){let n=$()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,fe=200;function ae(e,t,n,o,s){let a=o,r=new Map;return(0,d.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.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 f=0;for(;typeof i=="function"&&f++<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((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function D(e,t,n,o){if(x>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,null)}finally{x--}return()=>s}let i=ae(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){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(v(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(i=>{r.parentNode===e&&C(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 p(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&&F(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):O(e,r)||p(e,r,n),r}if(A(t))return O(e,t)?(I(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,s,f);let l=le(e,i,r,n);for(let u of f){let c=D(e,u.sig,u.marker);(0,d.onCleanup)(()=>{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 f=i.type(i.props||{});return C(e,f,n,o)}}}return T(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(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((0,m.isSignal)(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.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 y=1;y<c.length;y++)l.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;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 f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function le(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],c)}else if(r===f)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[f]===t[a-1]){let c=t[--a].nextSibling;p(e,n[f++],t[i++].nextSibling),p(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let y=f;for(;y<r;)u.set(n[y],y++)}let c=u.get(t[i]);if(c!=null)if(f<c&&c<r){let y=i,L=1;for(;++y<a&&y<r&&!(!u.has(t[y])||u.get(t[y])!==c+L);)L++;if(L>c-f){let J=t[i];for(;f<c;)p(e,n[f++],J)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(p(e,n[f++],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 p(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 ue(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ce(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function de(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):(0,d.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;N(e,t,s,o)})}function ye(e,t,n){return typeof n!="function"?(W(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;W(e,t,o)})}function pe(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let o=n();N(e,t,!!o)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>K(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).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 s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);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 s=n[o];s==null?e.style[o]="":e.style[o]=s}}function B(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){me(s,e);continue}if(o!=="children"){if(o==="use"){ce(e,s);continue}if(o.startsWith("on:")){ue(e,o.slice(3),s);continue}if(o.startsWith("prop:")){ye(e,o.slice(5),s);continue}if(o.startsWith("attr:")){de(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){pe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(q.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,H.has(a)||ie([a]);continue}if(o==="class"||o==="className"){K(e,s);continue}if(o==="classList"){typeof s=="function"?(0,d.createRenderEffect)(()=>V(e,s())):V(e,s);continue}if(o==="style"){typeof s=="function"?(0,d.createRenderEffect)(()=>k(e,s())):k(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,d.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,d.onCleanup)(()=>{r()})}else{let a=!0;(0,d.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();P(e,o,r,n)});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>P(e,o,t[o],n))}}}function me(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 G(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 v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ge="__fx_dom_create_component__",z=globalThis[ge]??={fn:null};function U(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var X=require("@fluixi/reactive/signal");function xe(e,t={}){if(typeof e=="function")return U(e,t);if(typeof e!="string"||e.length===0)return null;let n=G(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(R,e):document.createElement(e);return B(o,t,n),he(o,t),o}function he(e,t){if(!t||t.children===void 0)return;let n=(0,X.readChildren)(()=>t.children),o=s=>{D(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
1
+ "use strict";var R=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)R(e,n,{get:t[n],enumerable:!0})},te=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z(t))!Q.call(e,s)&&s!==n&&R(e,s,{get:()=>t[s],enumerable:!(o=Y(t,s))||o.enumerable});return e};var ne=e=>te(R({},"__esModule",{value:!0}),e);var Ee={};ee(Ee,{createDynamicElement:()=>xe});module.exports=ne(Ee);var m=require("@fluixi/reactive/signal");var M="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function P(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(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 Ne=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var d=require("@fluixi/reactive/signal");var S=typeof document>"u";var j=Symbol.for("fluixi.server-node"),_=null;function w(){if(!_)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _}function A(e){return e!=null&&e[j]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[j]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},re=null;function $(){return re}function O(e,t){return b.active&&t.parentNode===e}function I(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var H=new Set,q=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ie(e){if(!S)for(let t of e)H.has(t)||q.has(t)||(H.add(t),document.addEventListener(t,se))}function se(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(S)return w().createText(e);if(b.active&&!t){let n=$()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,fe=200;function ae(e,t,n,o,s){let a=o,r=new Map;return(0,d.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.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 f=0;for(;typeof i=="function"&&f++<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((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function D(e,t,n,o){if(x>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,null)}finally{x--}return()=>s}let i=ae(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){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(v(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&&C(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&&F(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):O(e,r)||y(e,r,n),r}if(A(t))return O(e,t)?(I(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]:[],f=[];g(t,r,e,n,!0,s,f);let l=le(e,i,r,n);for(let u of f){let c=D(e,u.sig,u.marker);(0,d.onCleanup)(()=>{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 f=i.type(i.props||{});return C(e,f,n,o)}}}return N(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(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((0,m.isSignal)(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.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 p=1;p<c.length;p++)l.parentNode?.insertBefore(c[p],c[p-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;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 f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function le(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)y(e,n[f++],c)}else if(r===f)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[f]===t[a-1]){let c=t[--a].nextSibling;y(e,n[f++],t[i++].nextSibling),y(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let p=f;for(;p<r;)u.set(n[p],p++)}let c=u.get(t[i]);if(c!=null)if(f<c&&c<r){let p=i,L=1;for(;++p<a&&p<r&&!(!u.has(t[p])||u.get(t[p])!==c+L);)L++;if(L>c-f){let J=t[i];for(;f<c;)y(e,n[f++],J)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(y(e,n[f++],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 k(e,t,n){n==null?delete e[t]:e[t]=n}function ue(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ce(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function de(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,d.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function pe(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function ye(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function K(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>K(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function W(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,r)}}}function V(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 s=n[o];s==null?e.style[o]="":e.style[o]=s}}function B(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){me(s,e);continue}if(o!=="children"){if(o==="use"){ce(e,s);continue}if(o.startsWith("on:")){ue(e,o.slice(3),s);continue}if(o.startsWith("prop:")){pe(e,o.slice(5),s);continue}if(o.startsWith("attr:")){de(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){ye(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(q.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,H.has(a)||ie([a]);continue}if(o==="class"||o==="className"){K(e,s);continue}if(o==="classList"){typeof s=="function"?(0,d.createRenderEffect)(()=>W(e,s())):W(e,s);continue}if(o==="style"){typeof s=="function"?(0,d.createRenderEffect)(()=>V(e,s())):V(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,d.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,d.onCleanup)(()=>{r()})}else{let a=!0;(0,d.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();P(e,o,r,n)});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>P(e,o,t[o],n))}}}function me(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 G(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 v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ge="__fx_dom_create_component__",z=globalThis[ge]??={fn:null};function U(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var X=require("@fluixi/reactive/signal");function xe(e,t={}){if(typeof e=="function")return U(e,t);if(typeof e!="string"||e.length===0)return null;let n=G(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(M,e):document.createElement(e);return B(o,t,n),he(o,t),o}function he(e,t){if(!t||t.children===void 0)return;let n=(0,X.readChildren)(()=>t.children),o=s=>{D(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
@@ -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}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 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 we,createEffect as A,createRenderEffect as p,createRoot as Ae,onCleanup as S,readChildren as ve}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 W(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=M(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=M(e,t,n,null)}finally{x--}return()=>f}let i=ne(r(t),e,n,f,s=>{f=s});return()=>(i?.(),f)}function M(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&&M(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&&$(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=oe(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 M(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 oe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let 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,R=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+R);)R++;if(R>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 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 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"?(N(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function fe(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;V(e,t,o)})}function ae(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):p(()=>{let o=n();N(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 k(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(()=>k(e,f())):k(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 Fe(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{Fe as createDynamicElement};
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 pe=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 y,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 y(()=>{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,null)}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)):p(e,r,n):o?e.replaceChild(r,o):p(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 p(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)||p(e,r,n),r}if(C(t))return H(e,t)?(k(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(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++)n[c].parentNode!==null&&n[c].parentNode!==e&&(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;)p(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;p(e,n[s++],t[i++].nextSibling),p(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;)p(e,n[s++],J)}else t[i].parentNode===e?e.replaceChild(n[s++],t[i++]):(p(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 p(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),()=>{}):y(()=>{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),()=>{}):y(()=>{let o=typeof n=="function"?n():n;W(e,t,o)})}function ae(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):y(()=>{let o=n();T(e,t,!!o)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>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(y(()=>{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"?y(()=>V(e,f())):V(e,f);continue}if(o==="style"){typeof f=="function"?y(()=>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 y(()=>{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 y(()=>{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;y(()=>{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 y(()=>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 +1 @@
1
- "use strict";var i=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)i(t,n,{get:e[n],enumerable:!0})},v=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!p.call(t,a)&&a!==n&&i(t,a,{get:()=>e[a],enumerable:!(o=s(e,a))||o.enumerable});return t};var y=t=>v(i({},"__esModule",{value:!0}),t);var h={};d(h,{ascendPast:()=>u,captureHydrationCursor:()=>g,getHydrationWalker:()=>x,hydrateAdvancePast:()=>T,hydration:()=>r,isAdopted:()=>N,registerHydrationWalker:()=>f,runHydrationAt:()=>k,runWithoutHydration:()=>H});module.exports=y(h);var r={active:!1,cursor:null,parents:[]},l=null;function f(t){l=t}function x(){return l}function N(t,e){return r.active&&e.parentNode===t}function u(t){let e=r.parents.lastIndexOf(t);e!==-1&&(r.parents.length=e),r.cursor=t.nextSibling}function g(){return r.active?r.cursor:null}function k(t,e){if(!t||t.parentNode==null)return e();let n=r.active,o=r.cursor,a=r.parents;r.active=!0,r.cursor=t,r.parents=[];try{return e()}finally{r.active=n,r.cursor=o,r.parents=a}}function H(t){if(!r.active)return t();let e=r.cursor,n=r.parents;r.active=!1,r.parents=[];try{return t()}finally{r.active=!0,r.cursor=e,r.parents=n}}function T(t){if(!r.active||t==null)return;let e=Array.isArray(t)?t[t.length-1]:t;e&&typeof e.nodeType=="number"&&u(e)}
1
+ "use strict";var l=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var c=Object.getOwnPropertyNames;var p=Object.prototype.hasOwnProperty;var d=(t,e)=>{for(var n in e)l(t,n,{get:e[n],enumerable:!0})},y=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let a of c(e))!p.call(t,a)&&a!==n&&l(t,a,{get:()=>e[a],enumerable:!(o=s(e,a))||o.enumerable});return t};var v=t=>y(l({},"__esModule",{value:!0}),t);var T={};d(T,{ascendPast:()=>u,captureHydrationCursor:()=>N,getHydrationWalker:()=>x,hydrateAdvancePast:()=>H,hydration:()=>r,isAdopted:()=>g,registerHydrationWalker:()=>f,runHydrationAt:()=>h,runWithoutHydration:()=>k});module.exports=v(T);var r={active:!1,cursor:null,parents:[]},i=null;function f(t){i=t}function x(){return i}function g(t,e){return r.active&&e.parentNode===t}function u(t){let e=r.parents.lastIndexOf(t);e!==-1&&(r.parents.length=e),r.cursor=t.nextSibling}function N(){return r.active?r.cursor:null}function h(t,e){if(!t||t.parentNode==null)return e();let n=r.active,o=r.cursor,a=r.parents;r.active=!0,r.cursor=t,r.parents=[];try{return e()}finally{r.active=n,r.cursor=o,r.parents=a}}function k(t){if(!r.active)return t();let e=r.cursor,n=r.parents;r.active=!1,r.parents=[];try{return t()}finally{r.active=!0,r.cursor=e,r.parents=n}}function H(t){if(!r.active||t==null)return;let e=Array.isArray(t)?t[t.length-1]:t;e&&typeof e.nodeType=="number"&&u(e)}
@@ -14,6 +14,8 @@ export interface HydrationWalker {
14
14
  hydrateElement(tag: string): Element | null;
15
15
  hydrateText(value: string): Text | null;
16
16
  hydrateMarker(value: string): Comment | null;
17
+ /** Adopt a static subtree whole, without descending into it. */
18
+ hydrateStatic(tag: string): Element | null;
17
19
  }
18
20
  export declare function registerHydrationWalker(walker: HydrationWalker): void;
19
21
  export declare function getHydrationWalker(): HydrationWalker | null;
@@ -1 +1 @@
1
- {"version":3,"file":"hydration-state.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,SAAS,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,EAAE,CAAA;CAI9E,CAAC;AAGF,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC9C;AAID,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAErE;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,GAAG,IAAI,CAEpD;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAerE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAarD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAM1D"}
1
+ {"version":3,"file":"hydration-state.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration-state.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAIH,eAAO,MAAM,SAAS,EAAE;IAAE,MAAM,EAAE,OAAO,CAAC;IAAC,MAAM,EAAE,IAAI,GAAG,IAAI,CAAC;IAAC,OAAO,EAAE,IAAI,EAAE,CAAA;CAI9E,CAAC;AAGF,MAAM,WAAW,eAAe;IAC9B,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC5C,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,IAAI,CAAC;IACxC,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;IAC7C,gEAAgE;IAChE,aAAa,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,GAAG,IAAI,CAAC;CAC5C;AAID,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,eAAe,GAAG,IAAI,CAErE;AAED,wBAAgB,kBAAkB,IAAI,eAAe,GAAG,IAAI,CAE3D;AAED,6EAA6E;AAC7E,wBAAgB,SAAS,CAAC,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,GAAG,OAAO,CAE3D;AAED;;;GAGG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,IAAI,CAI3C;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,IAAI,IAAI,GAAG,IAAI,CAEpD;AAED,2FAA2F;AAC3F,wBAAgB,cAAc,CAAC,CAAC,EAAE,MAAM,EAAE,IAAI,GAAG,IAAI,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAerE;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,CAAC,EAAE,EAAE,EAAE,MAAM,CAAC,GAAG,CAAC,CAarD;AAED;;;GAGG;AACH,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,CAM1D"}
@@ -1 +1 @@
1
- var t={active:!1,cursor:null,parents:[]},a=null;function u(r){a=r}function s(){return a}function c(r,e){return t.active&&e.parentNode===r}function l(r){let e=t.parents.lastIndexOf(r);e!==-1&&(t.parents.length=e),t.cursor=r.nextSibling}function p(){return t.active?t.cursor:null}function d(r,e){if(!r||r.parentNode==null)return e();let n=t.active,o=t.cursor,i=t.parents;t.active=!0,t.cursor=r,t.parents=[];try{return e()}finally{t.active=n,t.cursor=o,t.parents=i}}function v(r){if(!t.active)return r();let e=t.cursor,n=t.parents;t.active=!1,t.parents=[];try{return r()}finally{t.active=!0,t.cursor=e,t.parents=n}}function y(r){if(!t.active||r==null)return;let e=Array.isArray(r)?r[r.length-1]:r;e&&typeof e.nodeType=="number"&&l(e)}export{l as ascendPast,p as captureHydrationCursor,s as getHydrationWalker,y as hydrateAdvancePast,t as hydration,c as isAdopted,u as registerHydrationWalker,d as runHydrationAt,v as runWithoutHydration};
1
+ var t={active:!1,cursor:null,parents:[]},a=null;function u(r){a=r}function s(){return a}function c(r,e){return t.active&&e.parentNode===r}function i(r){let e=t.parents.lastIndexOf(r);e!==-1&&(t.parents.length=e),t.cursor=r.nextSibling}function p(){return t.active?t.cursor:null}function d(r,e){if(!r||r.parentNode==null)return e();let n=t.active,o=t.cursor,l=t.parents;t.active=!0,t.cursor=r,t.parents=[];try{return e()}finally{t.active=n,t.cursor=o,t.parents=l}}function y(r){if(!t.active)return r();let e=t.cursor,n=t.parents;t.active=!1,t.parents=[];try{return r()}finally{t.active=!0,t.cursor=e,t.parents=n}}function v(r){if(!t.active||r==null)return;let e=Array.isArray(r)?r[r.length-1]:r;e&&typeof e.nodeType=="number"&&i(e)}export{i as ascendPast,p as captureHydrationCursor,s as getHydrationWalker,v as hydrateAdvancePast,t as hydration,c as isAdopted,u as registerHydrationWalker,d as runHydrationAt,y as runWithoutHydration};
@@ -1 +1 @@
1
- "use strict";var v=Object.defineProperty;var J=Object.getOwnPropertyDescriptor;var G=Object.getOwnPropertyNames;var U=Object.prototype.hasOwnProperty;var z=(n,e)=>{for(var t in e)v(n,t,{get:e[t],enumerable:!0})},Y=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of G(e))!U.call(n,c)&&c!==t&&v(n,c,{get:()=>e[c],enumerable:!(i=J(e,c))||i.enumerable});return n};var Q=n=>Y(v({},"__esModule",{value:!0}),n);var ae={};z(ae,{hydrate:()=>ue});module.exports=Q(ae);var h=require("@fluixi/reactive/signal");function E(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var x=require("@fluixi/reactive/signal");var R=typeof document>"u";var $=Symbol.for("fluixi.server-node"),D=null;function O(){if(!D)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return D}function C(n){return n!=null&&n[$]===!0?!0:typeof Node<"u"&&n instanceof Node}function F(n){return n!=null&&n[$]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},H=null;function j(n){H=n}function W(){return H}function P(n,e){return a.active&&e.parentNode===n}function I(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function N(n,e=!1){if(R)return O().createText(n);if(a.active&&!e){let t=W()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,Z=200;function ee(n,e,t,i,c){let f=i,s=new Map;return(0,x.createRenderEffect)(()=>{let r;if(E(n)&&!(0,h.isSignal)(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(r=s.get(n);typeof r=="function"&&(0,h.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,h.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(E(r)){if(!s.has(r)){let u=r;m++;try{let l=u();s.set(u,l)}finally{m--}}r=s.get(r)}else if((0,h.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,h.isSignal)(r)&&!E(r))break}m++;try{f=S(e,r,t,f,s),c(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 c=i??null,f=o=>Array.isArray(o)&&o.some(u=>typeof u=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){m++;try{c=S(n,e,t,null)}finally{m--}return()=>c}let r=ee(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 b(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(n,i,t);if(T(e)){let s=N("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),b(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=N(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(n,i,t)}if(i&&F(i))return i.data=e,i;let s=N(e);return i&&i.parentNode===n?n.replaceChild(s,i):P(n,s)||p(n,s,t),s}if(C(e))return P(n,e)?(I(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),b(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,c,o);let u=ne(n,r,s,t);for(let l of o){let d=K(n,l.sig,l.marker);(0,x.onCleanup)(()=>{b(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}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 b(n,i,t)}function g(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"&&!T(o)&&!(0,h.isSignal)(o)&&!E(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(E(o)&&!(0,h.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!T(u)&&!(0,h.isSignal)(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((0,h.isSignal)(u)){if(s){let d=N("",!0);e.push(d),s.push({marker:d,sig:u});continue}let l=u();for(;typeof l=="function"&&(0,h.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?g(l,e,t,i,c,f):g([l],e,t,i,c,f);continue}continue}Array.isArray(u)?g(u,e,t,i,c,f,s):g([u],e,t,i,c,f,s);continue}if(T(o)){let u=N("",!0);e.push(u),o.then(l=>{if(u.parentNode){let d=[];if(g([l],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){g(o,e,t,i,c,f,s);continue}if(C(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let l=u.type(u.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 u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(N(u));continue}e.push(N(String(o)))}}}}function ne(n,e,t,i){for(let d=0;d<t.length;d++)t[d].parentNode!==null&&t[d].parentNode!==n&&(t=t.slice(),t[d]=t[d].cloneNode(!0));let c=t.length,f=e.length,s=c,r=0,o=0,u=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]:u;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,A=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+A);)A++;if(A>d-o){let q=e[r];for(;o<d;)p(n,t[o++],q)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function b(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){a.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 V(n,e,t){if(!e)throw new Error("Container element is required");let i,c,f=[];return(0,x.createRoot)(s=>{(0,x.batch)(()=>{a.active||(e.textContent=""),K(e,n)}),c=s}),()=>{c?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var w=require("@fluixi/reactive/signal");var te="__FX_DATA__";var _;function B(){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 L(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var oe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),M=typeof process<"u"&&process.env&&!1;function k(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 re(n){L();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(oe.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(M&&e&&k(`<${n}>`,e),null)}function ie(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}L();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(M&&e&&k(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function se(n){L();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(M&&e&&k(`marker <!--${n.slice(0,24)}-->`,e),null)}var X=!1;function fe(){X||(X=!0,j({hydrateElement:re,hydrateText:ie,hydrateMarker:se}))}function ue(n,e,t){fe(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=B(),c=t?.resourceNamespace,f=0;(0,w.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,w.setServerDataGetter)(i?s=>s in i?{value:i[s]}:void 0:null);try{return V(n,e)}finally{a.active=!1,a.cursor=null,a.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.71";var D=require("@fluixi/reactive"),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,null)}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++)t[d].parentNode!==null&&t[d].parentNode!==n&&(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,P=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+P);)P++;if(P>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 k(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&&k(`<${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&&k(`<${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&&k(`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&&k(`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
- {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAmIA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}
1
+ {"version":3,"file":"hydration.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/hydration.ts"],"names":[],"mappings":"AAsJA;;;;;GAKG;AACH,wBAAgB,OAAO,CAAC,CAAC,EACvB,OAAO,EAAE,CAAC,EACV,SAAS,EAAE,OAAO,EAClB,OAAO,CAAC,EAAE;IAAE,iBAAiB,CAAC,EAAE,MAAM,CAAA;CAAE,GACvC,MAAM,IAAI,CAwBZ"}
@@ -71,6 +71,25 @@ function hydrateElement(tag) {
71
71
  warnMismatch(`<${tag}>`, c);
72
72
  return null;
73
73
  }
74
+ /**
75
+ * Adopt a whole static subtree at the cursor without descending into it.
76
+ *
77
+ * A compiler-emitted template is inert by construction — the analysis only marks a
78
+ * subtree static when nothing inside it can change — so the server's markup for it is
79
+ * exactly the template. There is nothing in there to hydrate, and stepping through it
80
+ * element by element would only give the cursor more chances to desynchronise.
81
+ */
82
+ function hydrateStatic(tag) {
83
+ recoverCursor();
84
+ const c = hydration.cursor;
85
+ if (c && c.nodeType === 1 && c.tagName.toLowerCase() === tag.toLowerCase()) {
86
+ hydration.cursor = c.nextSibling;
87
+ return c;
88
+ }
89
+ if (DEV && c)
90
+ warnMismatch(`<${tag}> (static)`, c);
91
+ return null;
92
+ }
74
93
  /** Reuse the text node at the cursor (syncing its value) and advance. */
75
94
  function hydrateText(value) {
76
95
  if (value === '') {
@@ -119,7 +138,7 @@ function ensureWalker() {
119
138
  if (_walkerRegistered)
120
139
  return;
121
140
  _walkerRegistered = true;
122
- registerHydrationWalker({ hydrateElement, hydrateText, hydrateMarker });
141
+ registerHydrationWalker({ hydrateElement, hydrateText, hydrateMarker, hydrateStatic });
123
142
  }
124
143
  /**
125
144
  * Hydrate `element` over the server-rendered markup already in `container`: reuse the
@@ -1 +1 @@
1
- import{isSignal as h}from"@fluixi/reactive/signal";function N(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as B,createEffect as de,createRenderEffect as X,createRoot as q,onCleanup as J,readChildren as ye}from"@fluixi/reactive/signal";var M=typeof document>"u";var k=Symbol.for("fluixi.server-node"),L=null;function D(){if(!L)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return L}function w(n){return n!=null&&n[k]===!0?!0:typeof Node<"u"&&n instanceof Node}function R(n){return n!=null&&n[k]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var a={active:!1,cursor:null,parents:[]},$=null;function O(n){$=n}function F(){return $}function A(n,e){return a.active&&e.parentNode===n}function H(n){let e=a.parents.lastIndexOf(n);e!==-1&&(a.parents.length=e),a.cursor=n.nextSibling}function m(n,e=!1){if(M)return D().createText(n);if(a.active&&!e){let t=F()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var g=0,G=200;function U(n,e,t,i,d){let f=i,s=new Map;return X(()=>{let r;if(N(n)&&!h(n)){if(!s.has(n)){g++;try{let o=n();s.set(n,o)}finally{g--}}for(r=s.get(n);typeof r=="function"&&h(r);)r=r()}else for(r=n();typeof r=="function"&&h(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let u=r;g++;try{let l=u();s.set(u,l)}finally{g--}}r=s.get(r)}else if(h(r))r=r();else if(r=r(),typeof r!="function"||!h(r)&&!N(r))break}g++;try{f=T(e,r,t,f,s),d(f)}finally{g--}})}function j(n,e,t,i){if(g>G)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=m("",!0),n.appendChild(t));let d=i??null,f=o=>Array.isArray(o)&&o.some(u=>typeof u=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){g++;try{d=T(n,e,t,null)}finally{g--}return()=>d}let r=U(s(e),n,t,d,o=>{d=o});return()=>(r?.(),d)}function T(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(b(e)){let s=m("",!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&&T(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=m(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&&R(i))return i.data=e,i;let s=m(e);return i&&i.parentNode===n?n.replaceChild(s,i):A(n,s)||p(n,s,t),s}if(w(e))return A(n,e)?(H(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=[];x(e,s,n,t,!0,d,o);let u=z(n,r,s,t);for(let l of o){let c=j(n,l.sig,l.marker);J(()=>{E(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return u}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 T(n,o,t,i)}}}return E(n,i,t)}function x(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"&&!b(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let u;for(N(o)&&!h(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),u=f.get(o)):u=o();typeof u=="function"&&!b(u)&&!h(u)&&!N(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(h(u)){if(s){let c=m("",!0);e.push(c),s.push({marker:c,sig:u});continue}let l=u();for(;typeof l=="function"&&h(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?x(l,e,t,i,d,f):x([l],e,t,i,d,f);continue}continue}Array.isArray(u)?x(u,e,t,i,d,f,s):x([u],e,t,i,d,f,s);continue}if(b(o)){let u=m("",!0);e.push(u),o.then(l=>{if(u.parentNode){let c=[];if(x([l],c,u.parentNode,void 0,!1,f),c.length>0){u.parentNode.replaceChild(c[0],u);for(let y=1;y<c.length;y++)u.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){x(o,e,t,i,d,f,s);continue}if(w(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let u=o;if(typeof u.type=="function"){let l=u.type(u.props||{});Array.isArray(l)?x(l,e,t,i,!1,f):x([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let u=String(o);if(u.trim()===""&&u!==" ")continue;e.push(m(u));continue}e.push(m(String(o)))}}}}function z(n,e,t,i){for(let c=0;c<t.length;c++)t[c].parentNode!==null&&t[c].parentNode!==n&&(t=t.slice(),t[c]=t[c].cloneNode(!0));let d=t.length,f=e.length,s=d,r=0,o=0,u=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]:u;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,S=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+S);)S++;if(S>c-o){let V=e[r];for(;o<c;)p(n,t[o++],V)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],u),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){a.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function b(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function W(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return q(s=>{B(()=>{a.active||(e.textContent=""),j(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as Q,setServerDataGetter as Z}from"@fluixi/reactive/signal";var Y="__FX_DATA__";var v;function I(){let n=globalThis.__FX_DATA__;if(n)return n;if(v!==void 0)return v;let e=null;if(typeof document<"u"){let t=document.getElementById(Y)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return v=e}function C(){for(;;){for(;a.cursor&&a.cursor.nodeType===3&&a.cursor.data==="";)a.cursor=a.cursor.nextSibling;if(a.cursor!=null||!a.parents.length)return;a.cursor=a.parents.pop().nextSibling}}var ee=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),P=typeof process<"u"&&process.env&&!1;function _(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 ne(n){C();let e=a.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ee.has(n.toLowerCase())?a.cursor=e.nextSibling:(a.parents.push(e),a.cursor=e.firstChild),e):(P&&e&&_(`<${n}>`,e),null)}function te(n){if(n===""){let t=a.cursor;return t&&t.nodeType===3&&t.data!==""?(a.cursor=t.nextSibling,t.data="",t):null}C();let e=a.cursor;return e&&e.nodeType===3?(a.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(P&&e&&_(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function oe(n){C();let e=a.cursor;return e&&e.nodeType===8&&e.data===n?(a.cursor=e.nextSibling,e):(P&&e&&_(`marker <!--${n.slice(0,24)}-->`,e),null)}var K=!1;function re(){K||(K=!0,O({hydrateElement:ne,hydrateText:te,hydrateMarker:oe}))}function Se(n,e,t){re(),a.active=!0,a.cursor=e.firstChild,a.parents=[];let i=I(),d=t?.resourceNamespace,f=0;Q(()=>d?`${d}:r${f++}`:`r${f++}`),Z(i?s=>s in i?{value:i[s]}:void 0:null);try{return W(n,e)}finally{a.active=!1,a.cursor=null,a.parents=[]}}export{Se as hydrate};
1
+ import{isSignal as x}from"@fluixi/reactive/signal";var L="1.0.0-alpha.71";import{VERSION as U}from"@fluixi/reactive";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 k(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 P(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,null)}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):P(n,s)||p(n,s,t),s}if(k(e))return P(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(k(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++)t[c].parentNode!==null&&t[c].parentNode!==n&&(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};