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

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 (70) 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 +6 -1
  6. package/dist/index.d.ts.map +1 -1
  7. package/dist/index.js +6 -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 +95 -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/flow/client-only.cjs +1 -1
  55. package/dist/lib/flow/client-only.mjs +1 -1
  56. package/dist/lib/flow/index-flow.cjs +1 -1
  57. package/dist/lib/flow/index-flow.mjs +1 -1
  58. package/dist/lib/flow/index.cjs +1 -1
  59. package/dist/lib/flow/index.mjs +1 -1
  60. package/dist/lib/flow/portal.cjs +1 -1
  61. package/dist/lib/flow/portal.mjs +1 -1
  62. package/dist/lib/index.cjs +1 -1
  63. package/dist/lib/index.mjs +1 -1
  64. package/dist/tsconfig.lib.tsbuildinfo +1 -1
  65. package/dist/version.generated.cjs +1 -0
  66. package/dist/version.generated.d.ts +3 -0
  67. package/dist/version.generated.d.ts.map +1 -0
  68. package/dist/version.generated.js +3 -0
  69. package/dist/version.generated.mjs +1 -0
  70. package/package.json +4 -4
@@ -1 +1 @@
1
- "use strict";var G=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $e(t))!De.call(e,r)&&r!==n&&G(e,r,{get:()=>t[r],enumerable:!(o=Ie(t,r))||o.enumerable});return e};var He=e=>ke(G({},"__esModule",{value:!0}),e);var on={};Oe(on,{Island:()=>Pe,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Ke,SVG_NAMESPACE:()=>I,VOID_ELEMENTS:()=>Ve,addClass:()=>Je,addDelegatedEventListener:()=>Se,addNativeEventListener:()=>ne,appendChildren:()=>nt,applyElementProp:()=>$,applyProps:()=>It,applyUse:()=>oe,captureHydrationCursor:()=>Ee,cleanChildren:()=>T,cloneTemplate:()=>Ct,closest:()=>Ge,createComponent:()=>Kt,createElement:()=>et,createNativeElement:()=>te,createPortal:()=>Ot,createTemplate:()=>vt,delegate:()=>st,delegateEvents:()=>ee,escapeHTML:()=>jt,fnName:()=>At,generateID:()=>bt,getAttribute:()=>Ye,getGlobal:()=>gt,getLitEventName:()=>Fe,getOffset:()=>it,getStableElementId:()=>Et,getStyle:()=>Qe,handleRef:()=>ie,hasClass:()=>Ue,hydrate:()=>K,hydrateAdvancePast:()=>Te,hydrateIslands:()=>Me,initializeIntegration:()=>Vt,insert:()=>C,insertExpression:()=>R,intergartionInitialized:()=>Bt,isAccessor:()=>qt,isCustomElement:()=>de,isDOMNode:()=>yt,isDelegatedEvent:()=>wt,isDomElement:()=>O,isDomNode:()=>S,isDomText:()=>k,isEventHandler:()=>qe,isFunction:()=>St,isIntegrationInitialized:()=>Gt,isJSXTemplate:()=>pt,isLitTemplateResult:()=>ye,isNativeElement:()=>kt,isPromise:()=>A,isReactElement:()=>ct,isSVGElement:()=>Ht,isServer:()=>E,isTemplateFactory:()=>dt,isVisible:()=>ot,iterateFn:()=>Rt,makeArrayFlat:()=>ve,mergeProps:()=>$t,observeIntersection:()=>ft,observeResize:()=>ut,query:()=>J,queryAll:()=>Be,registerCreateComponent:()=>Wt,registerGlobal:()=>mt,removeAttribute:()=>Ze,removeChildren:()=>tt,removeClass:()=>Xe,removeDelegatedEventListener:()=>Q,render:()=>se,resetIntegration:()=>Jt,runHydrationAt:()=>be,runWithoutHydration:()=>Ne,scrollIntoView:()=>rt,setAttribute:()=>x,setClassList:()=>M,setClassName:()=>P,setDynamicAttribute:()=>j,setDynamicBoolAttribute:()=>re,setDynamicProperty:()=>q,setProperty:()=>L,setServerMode:()=>ge,setStyle:()=>_,setStyles:()=>pe,shouldSetAsProperty:()=>We,splitProps:()=>Dt,spread:()=>_t,toAttributeName:()=>je,toggleClass:()=>ze,waitForElement:()=>at});module.exports=He(on);function je(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function qe(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Fe(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function We(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var Ve=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ke=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"]),I="http://www.w3.org/2000/svg";function de(e){return e.localName.includes("-")}function $(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(de(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function J(e,t=document){return t.querySelector(e)}function Be(e,t=document){return Array.from(t.querySelectorAll(e))}function Ge(e,t){return e.closest(t)}function Je(e,...t){e.classList.add(...t)}function Xe(e,...t){e.classList.remove(...t)}function ze(e,...t){t.forEach(n=>e.classList.toggle(n))}function Ue(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ye(e,t){return e.getAttribute(t)}function Ze(e,t){e.removeAttribute(t)}function pe(e,t){Object.assign(e.style,t)}function Qe(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function et(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")pe(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function tt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function ot(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function rt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function it(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function st(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function at(e,t=5e3){return new Promise((n,o)=>{let r=J(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=J(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function ft(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ut(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var lt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ct(e){return typeof e=="object"&&e!==null&&e.$$typeof===lt}function ye(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function dt(e){if(typeof e!="function")return!1;try{let t=e();return ye(t)}catch{return!1}}function pt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function yt(e){return e instanceof Node}function mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function gt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function ge(e){E=e}var X=Symbol.for("fluixi.server-node"),me=null;function z(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function S(e){return e!=null&&e[X]===!0?!0:typeof Node<"u"&&e instanceof Node}function O(e){return e!=null&&e[X]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function k(e){return e!=null&&e[X]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},xe=null;function he(e){xe=e}function U(){return xe}function Y(e,t){return l.active&&t.parentNode===e}function Z(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ee(){return l.active?l.cursor:null}function be(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ne(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Te(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Z(t)}function xt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ht(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 Et(e){return ht(xt(e))}var bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Nt={};var we=new Map,H=new Set,F=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ee(e){if(!E)for(let t of e)H.has(t)||F.has(t)||(H.add(t),document.addEventListener(t,Tt))}function Tt(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 Se(e,t,n){if(e[`$$${t}`]=n,F.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}H.has(t)||ee([t])}function Q(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function wt(e){return!F.has(e)}function St(e){return typeof e=="function"}function w(e,t=!1){if(E)return z().createText(e);if(l.active&&!t){let n=U()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function te(e,t=!1){if(E)return z().createElement(e,t);if(l.active){let n=U()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(I,e):document.createElement(e)}function vt(e,t=!1){let n=we.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,we.set(e,o),o}function Ct(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function ve(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?ve(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function At(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Rt(e){if((0,m.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!h(t);)t=t();return t}var N=0,Lt=200;function Pt(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(h(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){N++;try{let a=e();s.set(e,a)}finally{N--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;N++;try{let d=u();s.set(u,d)}finally{N--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!h(i))break}N++;try{f=R(t,i,n,f,s),r(f)}finally{N--}})}function C(e,t,n,o){if(N>Lt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){N++;try{r=R(e,t,n,null)}finally{N--}return()=>r}let i=Pt(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function R(e,t,n,o,r){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(A(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&R(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return g(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&&k(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Y(e,s)||g(e,s,n),s}if(S(t))return Y(e,t)?(Z(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];b(t,s,e,n,!0,r,a);let u=Mt(e,i,s,n);for(let d of a){let p=C(e,d.sig,d.marker);(0,c.onCleanup)(()=>{T(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return R(e,a,n,o)}}}return T(e,o,n)}function b(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!A(a)&&!(0,m.isSignal)(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!A(u)&&!(0,m.isSignal)(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(s){let p=w("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?b(d,t,n,o,r,f):b([d],t,n,o,r,f);continue}continue}Array.isArray(u)?b(u,t,n,o,r,f,s):b([u],t,n,o,r,f,s);continue}if(A(a)){let u=w("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(b([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){b(a,t,n,o,r,f,s);continue}if(S(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?b(d,t,n,o,!1,f):b([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function Mt(e,t,n,o){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,B=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+B);)B++;if(B>p-a){let _e=t[i];for(;a<p;)g(e,n[a++],_e)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function 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 g(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function L(e,t,n){n==null?delete e[t]:e[t]=n}function ne(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function oe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function j(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function q(e,t,n){return typeof n!="function"?(L(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;L(e,t,o)})}function re(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function P(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>P(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function M(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function _(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function _t(e){let{element:t,props:n,prevProps:o=Nt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!O(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===I,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){ie(u,t);continue}if(a==="use"){oe(t,u);continue}if(a.startsWith("on:")){i.push(ne(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(q(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(j(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(re(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>P(t,u()))):P(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>M(t,u()))):M(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&Q(t,y),u&&Se(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?q(t,a,u):j(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?L(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();Q(t,u)}else D.has(a)?L(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function It(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ie(r,e);continue}if(o!=="children"){if(o==="use"){oe(e,r);continue}if(o.startsWith("on:")){ne(e,o.slice(3),r);continue}if(o.startsWith("prop:")){q(e,o.slice(5),r);continue}if(o.startsWith("attr:")){j(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){re(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(F.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,H.has(f)||ee([f]);continue}if(o==="class"||o==="className"){P(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>M(e,r())):M(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>_(e,r())):_(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();$(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>$(e,o,t[o],n))}}}function $t(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Dt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function ie(e,t){if(e){if(S(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 Ot(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):S(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function kt(e){return typeof e=="string"&&e.toLowerCase()===e}function Ht(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 jt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function qt(e){return typeof e=="function"&&e.length===0&&(0,m.isSignal)(e)}function se(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),C(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var Ft="__fx_dom_create_component__",v=globalThis[Ft]??={fn:null};function Wt(e){v.fn=e}function Vt(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function Kt(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var Bt=()=>v.fn!==null,Gt=()=>v.fn!==null;function Jt(){v.fn=null}var W,Xt={getStore:()=>W,run(e,t){let n=W;W=e;try{return t()}finally{W=n}}},zt=Xt;function Ce(){return zt.getStore()}var V=require("@fluixi/reactive/signal");var Ut="__FX_DATA__";var ae;function Ae(){let e=globalThis.__FX_DATA__;if(e)return e;if(ae!==void 0)return ae;let t=null;if(typeof document<"u"){let n=document.getElementById(Ut)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ae=t}function fe(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Yt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ue=typeof process<"u"&&process.env&&!1;function le(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Zt(e){fe();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Yt.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(ue&&t&&le(`<${e}>`,t),null)}function Qt(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}fe();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(ue&&t&&le(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function en(e){fe();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(ue&&t&&le(`marker <!--${e.slice(0,24)}-->`,t),null)}var Re=!1;function tn(){Re||(Re=!0,he({hydrateElement:Zt,hydrateText:Qt,hydrateMarker:en}))}function K(e,t,n){tn(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=Ae(),r=n?.resourceNamespace,f=0;(0,V.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,V.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return se(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ce="fluixi-island";function Pe(e){let{component:t,props:n={},name:o}=e,r=te(ce),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?Ce():void 0;if(s){let i=s.nextIslandNamespace(f);C(r,()=>s.withResourceScope(i,()=>t(n)))}else C(r,()=>t(n));return r}var Le=!1;function nn(){if(Le||typeof document>"u")return;Le=!0;let e=document.createElement("style");e.textContent=`${ce}{display:contents}`,document.head.appendChild(e)}function Me(e){if(typeof document>"u")return;nn();let t=document.querySelectorAll(ce),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}K(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
1
+ "use strict";var Z=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Oe=Object.getOwnPropertyNames;var ke=Object.prototype.hasOwnProperty;var He=(e,t)=>{for(var n in t)Z(e,n,{get:t[n],enumerable:!0})},je=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Oe(t))!ke.call(e,r)&&r!==n&&Z(e,r,{get:()=>t[r],enumerable:!(o=De(t,r))||o.enumerable});return e};var qe=e=>je(Z({},"__esModule",{value:!0}),e);var un={};He(un,{Island:()=>_e,JSX_PROPERTIES:()=>O,SVG_ELEMENTS:()=>Ge,SVG_NAMESPACE:()=>I,VOID_ELEMENTS:()=>Be,addClass:()=>ze,addDelegatedEventListener:()=>Se,addNativeEventListener:()=>se,appendChildren:()=>rt,applyElementProp:()=>D,applyProps:()=>kt,applyUse:()=>ae,captureHydrationCursor:()=>be,cleanChildren:()=>T,cloneTemplate:()=>Ce,closest:()=>Xe,createComponent:()=>Xt,createElement:()=>nt,createNativeElement:()=>ie,createPortal:()=>qt,createTemplate:()=>ve,delegate:()=>ft,delegateEvents:()=>re,escapeHTML:()=>Vt,fnName:()=>Mt,generateID:()=>Tt,getAttribute:()=>Qe,getGlobal:()=>ht,getLitEventName:()=>Ve,getOffset:()=>at,getStableElementId:()=>Nt,getStyle:()=>tt,handleRef:()=>ue,hasClass:()=>Ze,holeContent:()=>Pt,holeEnd:()=>Lt,holeScope:()=>Rt,hydrate:()=>U,hydrateAdvancePast:()=>Te,hydrateIslands:()=>$e,initializeIntegration:()=>Jt,insert:()=>C,insertExpression:()=>L,intergartionInitialized:()=>zt,isAccessor:()=>Kt,isCustomElement:()=>pe,isDOMNode:()=>mt,isDelegatedEvent:()=>vt,isDomElement:()=>H,isDomNode:()=>S,isDomText:()=>j,isEventHandler:()=>We,isFunction:()=>Ct,isIntegrationInitialized:()=>Ut,isJSXTemplate:()=>gt,isLitTemplateResult:()=>ge,isNativeElement:()=>Ft,isPromise:()=>R,isReactElement:()=>pt,isSVGElement:()=>Wt,isServer:()=>h,isTemplateFactory:()=>yt,isVisible:()=>it,iterateFn:()=>_t,makeArrayFlat:()=>Ae,mergeProps:()=>Ht,observeIntersection:()=>lt,observeResize:()=>ct,query:()=>Q,queryAll:()=>Je,registerCreateComponent:()=>Gt,registerGlobal:()=>xt,removeAttribute:()=>et,removeChildren:()=>ot,removeClass:()=>Ue,removeDelegatedEventListener:()=>oe,render:()=>le,resetIntegration:()=>Yt,runHydrationAt:()=>A,runWithoutHydration:()=>Ne,scrollIntoView:()=>st,setAttribute:()=>x,setClassList:()=>_,setClassName:()=>M,setDynamicAttribute:()=>W,setDynamicBoolAttribute:()=>fe,setDynamicProperty:()=>V,setProperty:()=>P,setServerMode:()=>xe,setStyle:()=>$,setStyles:()=>ye,shouldSetAsProperty:()=>Ke,splitProps:()=>jt,spread:()=>Ot,templateNode:()=>At,toAttributeName:()=>Fe,toggleClass:()=>Ye,waitForElement:()=>ut});module.exports=qe(un);function Fe(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function We(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Ve(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Ke(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var Be=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ge=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"]),I="http://www.w3.org/2000/svg";function pe(e){return e.localName.includes("-")}function D(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(pe(e)){e[t]=n;return}x(e,t,n,o)}var O=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Q(e,t=document){return t.querySelector(e)}function Je(e,t=document){return Array.from(t.querySelectorAll(e))}function Xe(e,t){return e.closest(t)}function ze(e,...t){e.classList.add(...t)}function Ue(e,...t){e.classList.remove(...t)}function Ye(e,...t){t.forEach(n=>e.classList.toggle(n))}function Ze(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Qe(e,t){return e.getAttribute(t)}function et(e,t){e.removeAttribute(t)}function ye(e,t){Object.assign(e.style,t)}function tt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function nt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")ye(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ot(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function rt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function it(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function st(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function at(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function ft(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function ut(e,t=5e3){return new Promise((n,o)=>{let r=Q(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=Q(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function lt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ct(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var dt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function pt(e){return typeof e=="object"&&e!==null&&e.$$typeof===dt}function ge(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function yt(e){if(typeof e!="function")return!1;try{let t=e();return ge(t)}catch{return!1}}function gt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function mt(e){return e instanceof Node}function xt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function ht(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var g=require("@fluixi/reactive/signal");function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var h=typeof document>"u";function xe(e){h=e}var ee=Symbol.for("fluixi.server-node"),me=null;function k(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function S(e){return e!=null&&e[ee]===!0?!0:typeof Node<"u"&&e instanceof Node}function H(e){return e!=null&&e[ee]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function j(e){return e!=null&&e[ee]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},he=null;function Ee(e){he=e}function q(){return he}function te(e,t){return l.active&&t.parentNode===e}function ne(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function be(){return l.active?l.cursor:null}function A(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ne(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Te(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&ne(t)}function Et(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function bt(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 Nt(e){return bt(Et(e))}var Tt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),wt={};var we=new Map,F=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function re(e){if(!h)for(let t of e)F.has(t)||K.has(t)||(F.add(t),document.addEventListener(t,St))}function St(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 Se(e,t,n){if(e[`$$${t}`]=n,K.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}F.has(t)||re([t])}function oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function vt(e){return!K.has(e)}function Ct(e){return typeof e=="function"}function w(e,t=!1){if(h)return k().createText(e);if(l.active&&!t){let n=q()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ie(e,t=!1){if(h)return k().createElement(e,t);if(l.active){let n=q()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(I,e):document.createElement(e)}function ve(e,t=!1){let n=we.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,we.set(e,o),o}function At(e,t,n=!1,o=!1){if(h){let r=k();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=q()?.hydrateStatic(t);if(r)return r}return Ce(ve(e,o),o).firstChild}function Rt(e,t){if(!l.active)return t();let n=A(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?A(e.nextSibling,()=>o(...r)):o(...r))}return n}function Lt(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 Pt(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ce(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ae(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ae(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Mt(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function _t(e){if((0,g.isSignal)(e)||E(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,g.isSignal)(t)&&!E(t);)t=t();return t}var N=0,$t=200;function It(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(E(e)&&!(0,g.isSignal)(e)){if(!s.has(e)){N++;try{let a=e();s.set(e,a)}finally{N--}}for(i=s.get(e);typeof i=="function"&&(0,g.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,g.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(E(i)){if(!s.has(i)){let u=i;N++;try{let d=u();s.set(u,d)}finally{N--}}i=s.get(i)}else if((0,g.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,g.isSignal)(i)&&!E(i))break}N++;try{f=L(t,i,n,f,s),r(f)}finally{N--}})}function C(e,t,n,o){if(N>$t)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){N++;try{r=L(e,t,n,null)}finally{N--}return()=>r}let i=It(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function L(e,t,n,o,r){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(R(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&L(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&j(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):te(e,s)||m(e,s,n),s}if(S(t))return te(e,t)?(ne(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];b(t,s,e,n,!0,r,a);let u=Dt(e,i,s,n);for(let d of a){let p=C(e,d.sig,d.marker);(0,c.onCleanup)(()=>{T(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return L(e,a,n,o)}}}return T(e,o,n)}function b(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!R(a)&&!(0,g.isSignal)(a)&&!E(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(E(a)&&!(0,g.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!R(u)&&!(0,g.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,g.isSignal)(u)){if(s){let p=w("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,g.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?b(d,t,n,o,r,f):b([d],t,n,o,r,f);continue}continue}Array.isArray(u)?b(u,t,n,o,r,f,s):b([u],t,n,o,r,f,s);continue}if(R(a)){let u=w("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(b([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){b(a,t,n,o,r,f,s);continue}if(S(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?b(d,t,n,o,!1,f):b([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function Dt(e,t,n,o){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,Y=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+Y);)Y++;if(Y>p-a){let Ie=t[i];for(;a<p;)m(e,n[a++],Ie)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function 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 m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function P(e,t,n){n==null?delete e[t]:e[t]=n}function se(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function ae(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function W(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function V(e,t,n){return typeof n!="function"?(P(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;P(e,t,o)})}function fe(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function M(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>M(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function _(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function $(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Ot(e){let{element:t,props:n,prevProps:o=wt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!H(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===I,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){ue(u,t);continue}if(a==="use"){ae(t,u);continue}if(a.startsWith("on:")){i.push(se(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(V(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(W(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(fe(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>M(t,u()))):M(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>$(t,u()))):$(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&oe(t,y),u&&Se(t,y,u);continue}let p=O.has(a)||!s&&a in t;typeof u=="function"?i.push(p?V(t,a,u):W(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?P(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();oe(t,u)}else O.has(a)?P(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function kt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ue(r,e);continue}if(o!=="children"){if(o==="use"){ae(e,r);continue}if(o.startsWith("on:")){se(e,o.slice(3),r);continue}if(o.startsWith("prop:")){V(e,o.slice(5),r);continue}if(o.startsWith("attr:")){W(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){fe(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(K.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,F.has(f)||re([f]);continue}if(o==="class"||o==="className"){M(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>_(e,r())):_(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>$(e,r())):$(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();D(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>D(e,o,t[o],n))}}}function Ht(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function jt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function ue(e,t){if(e){if(S(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 qt(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):S(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function Ft(e){return typeof e=="string"&&e.toLowerCase()===e}function Wt(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 Vt(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function R(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Kt(e){return typeof e=="function"&&e.length===0&&(0,g.isSignal)(e)}function le(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return(0,c.createRoot)(s=>{(0,c.batch)(()=>{l.active||(t.textContent=""),C(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var Bt="__fx_dom_create_component__",v=globalThis[Bt]??={fn:null};function Gt(e){v.fn=e}function Jt(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function Xt(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var zt=()=>v.fn!==null,Ut=()=>v.fn!==null;function Yt(){v.fn=null}var B,Zt={getStore:()=>B,run(e,t){let n=B;B=e;try{return t()}finally{B=n}}},Qt=Zt;function Re(){return Qt.getStore()}var G=require("@fluixi/reactive/signal");var en="__FX_DATA__";var ce;function Le(){let e=globalThis.__FX_DATA__;if(e)return e;if(ce!==void 0)return ce;let t=null;if(typeof document<"u"){let n=document.getElementById(en)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ce=t}function J(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var tn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),X=typeof process<"u"&&process.env&&!1;function z(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 nn(e){J();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(tn.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(X&&t&&z(`<${e}>`,t),null)}function on(e){J();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(X&&t&&z(`<${e}> (static)`,t),null)}function rn(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}J();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(X&&t&&z(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function sn(e){J();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(X&&t&&z(`marker <!--${e.slice(0,24)}-->`,t),null)}var Pe=!1;function an(){Pe||(Pe=!0,Ee({hydrateElement:nn,hydrateText:rn,hydrateMarker:sn,hydrateStatic:on}))}function U(e,t,n){an(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=Le(),r=n?.resourceNamespace,f=0;(0,G.setResourceIdSource)(()=>r?`${r}:r${f++}`:`r${f++}`),(0,G.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return le(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var de="fluixi-island";function _e(e){let{component:t,props:n={},name:o}=e,r=ie(de),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=h?Re():void 0;if(s){let i=s.nextIslandNamespace(f);C(r,()=>s.withResourceScope(i,()=>t(n)))}else C(r,()=>t(n));return r}var Me=!1;function fn(){if(Me||typeof document>"u")return;Me=!0;let e=document.createElement("style");e.textContent=`${de}{display:contents}`,document.head.appendChild(e)}function $e(e){if(typeof document>"u")return;fn();let t=document.querySelectorAll(de),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}U(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}
@@ -1 +1 @@
1
- function nt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ot(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function it(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var st=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),at=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),j="http://www.w3.org/2000/svg";function Te(e){return e.localName.includes("-")}function q(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Te(e)){e[t]=n;return}x(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function oe(e,t=document){return t.querySelector(e)}function ft(e,t=document){return Array.from(t.querySelectorAll(e))}function ut(e,t){return e.closest(t)}function lt(e,...t){e.classList.add(...t)}function ct(e,...t){e.classList.remove(...t)}function dt(e,...t){t.forEach(n=>e.classList.toggle(n))}function pt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function yt(e,t){return e.getAttribute(t)}function mt(e,t){e.removeAttribute(t)}function we(e,t){Object.assign(e.style,t)}function gt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function xt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")we(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ht(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Et(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function bt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Tt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function wt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function St(e,t=5e3){return new Promise((n,o)=>{let r=oe(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=oe(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function vt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Ct(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function At(e){return typeof e=="object"&&e!==null&&e.$$typeof===Se}function ve(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Rt(e){if(typeof e!="function")return!1;try{let t=e();return ve(t)}catch{return!1}}function Lt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Pt(e){return e instanceof Node}function Mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _t(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ue,createEffect as A,createRenderEffect as p,createRoot as Me,onCleanup as S,readChildren as _e}from"@fluixi/reactive/signal";var N=typeof document>"u";function Ce(e){N=e}var W=Symbol.for("fluixi.server-node"),re=null;function V(){if(!re)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return re}function C(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function K(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function B(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ie=null;function se(e){ie=e}function G(){return ie}function J(e,t){return l.active&&t.parentNode===e}function X(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function Re(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Le(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Pe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&X(t)}function Ie(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function $e(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 Kt(e){return $e(Ie(e))}var Bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),De={};var ae=new Map,P=new Set,O=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function le(e){if(!N)for(let t of e)P.has(t)||O.has(t)||(P.add(t),document.addEventListener(t,Oe))}function Oe(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 ke(e,t,n){if(e[`$$${t}`]=n,O.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}P.has(t)||le([t])}function fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Gt(e){return!O.has(e)}function Jt(e){return typeof e=="function"}function T(e,t=!1){if(N)return V().createText(e);if(l.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ce(e,t=!1){if(N)return V().createElement(e,t);if(l.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(j,e):document.createElement(e)}function Xt(e,t=!1){let n=ae.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ae.set(e,o),o}function zt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function He(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?He(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ut(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yt(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var b=0,je=200;function qe(e,t,n,o,r){let f=o,s=new Map;return p(()=>{let i;if(h(e)&&!g(e)){if(!s.has(e)){b++;try{let a=e();s.set(e,a)}finally{b--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;b++;try{let c=u();s.set(u,c)}finally{b--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!h(i))break}b++;try{f=M(t,i,n,f,s),r(f)}finally{b--}})}function R(e,t,n,o){if(b>je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){b++;try{r=M(e,t,n,null)}finally{b--}return()=>r}let i=qe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function M(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&M(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=T(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&B(o))return o.data=t,o;let s=T(t);return o&&o.parentNode===e?e.replaceChild(s,o):J(e,s)||m(e,s,n),s}if(C(t))return J(e,t)?(X(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];E(t,s,e,n,!0,r,a);let u=Fe(e,i,s,n);for(let c of a){let d=R(e,c.sig,c.marker);S(()=>{w(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return M(e,a,n,o)}}}return w(e,o,n)}function E(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!g(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=T("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,r,f):E([c],t,n,o,r,f);continue}continue}Array.isArray(u)?E(u,t,n,o,r,f,s):E([u],t,n,o,r,f,s);continue}if(L(a)){let u=T("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(E([c],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(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){E(a,t,n,o,r,f,s);continue}if(C(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?E(c,t,n,o,!1,f):E([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(T(u));continue}t.push(T(String(a)))}}}}function Fe(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let y=a;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let y=i,H=1;for(;++y<f&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+H);)H++;if(H>d-a){let Ne=t[i];for(;a<d;)m(e,n[a++],Ne)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function _(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function pe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function z(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):p(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function U(e,t,n){return typeof n!="function"?(_(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;_(e,t,o)})}function ye(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let o=n();x(e,t,!!o)})}function I(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>I(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(p(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function D(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Zt(e){let{element:t,props:n,prevProps:o=De,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!K(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===j,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){me(u,t);continue}if(a==="use"){pe(t,u);continue}if(a.startsWith("on:")){i.push(de(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(U(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(z(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ye(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(p(()=>I(t,u()))):I(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(p(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(p(()=>D(t,u()))):D(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();c&&fe(t,y),u&&ke(t,y,u);continue}let d=F.has(a)||!s&&a in t;typeof u=="function"?i.push(d?U(t,a,u):z(t,a,u,s)):i.push(p(()=>d?_(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();fe(t,u)}else F.has(a)?_(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Qt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){me(r,e);continue}if(o!=="children"){if(o==="use"){pe(e,r);continue}if(o.startsWith("on:")){de(e,o.slice(3),r);continue}if(o.startsWith("prop:")){U(e,o.slice(5),r);continue}if(o.startsWith("attr:")){z(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ye(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(O.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,P.has(f)||le([f]);continue}if(o==="class"||o==="className"){I(e,r);continue}if(o==="classList"){typeof r=="function"?p(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?p(()=>D(e,r())):D(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});S(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=A(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{s()})}else{let f=!0;p(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();q(e,o,s,n)});S(()=>{f()})}else p(()=>q(e,o,t[o],n))}}}function en(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function tn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function me(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 nn(e,t,n){let o=t||document.body,r=_e(()=>e),f=[];return ue(()=>{let s=p(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):C(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),S(()=>{f.forEach(i=>i())})}),null}function on(e){return typeof e=="string"&&e.toLowerCase()===e}function rn(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function sn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function an(e){return typeof e=="function"&&e.length===0&&g(e)}function ge(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return Me(s=>{ue(()=>{l.active||(t.textContent=""),R(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var We="__fx_dom_create_component__",v=globalThis[We]??={fn:null};function un(e){v.fn=e}function ln(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function cn(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var dn=()=>v.fn!==null,pn=()=>v.fn!==null;function yn(){v.fn=null}var k,Ve={getStore:()=>k,run(e,t){let n=k;k=e;try{return t()}finally{k=n}}},Ke=Ve;function xe(){return Ke.getStore()}import{setResourceIdSource as Ge,setServerDataGetter as Je}from"@fluixi/reactive/signal";var Be="__FX_DATA__";var Y;function he(){let e=globalThis.__FX_DATA__;if(e)return e;if(Y!==void 0)return Y;let t=null;if(typeof document<"u"){let n=document.getElementById(Be)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Y=t}function Z(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=typeof process<"u"&&process.env&&!1;function ee(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 ze(e){Z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Xe.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(Q&&t&&ee(`<${e}>`,t),null)}function Ue(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}Z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Q&&t&&ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ye(e){Z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(Q&&t&&ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ee=!1;function Ze(){Ee||(Ee=!0,se({hydrateElement:ze,hydrateText:Ue,hydrateMarker:Ye}))}function te(e,t,n){Ze(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=he(),r=n?.resourceNamespace,f=0;Ge(()=>r?`${r}:r${f++}`:`r${f++}`),Je(o?s=>s in o?{value:o[s]}:void 0:null);try{return ge(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ne="fluixi-island";function Qe(e){let{component:t,props:n={},name:o}=e,r=ce(ne),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=N?xe():void 0;if(s){let i=s.nextIslandNamespace(f);R(r,()=>s.withResourceScope(i,()=>t(n)))}else R(r,()=>t(n));return r}var be=!1;function et(){if(be||typeof document>"u")return;be=!0;let e=document.createElement("style");e.textContent=`${ne}{display:contents}`,document.head.appendChild(e)}function tt(e){if(typeof document>"u")return;et();let t=document.querySelectorAll(ne),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}te(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{Qe as Island,F as JSX_PROPERTIES,at as SVG_ELEMENTS,j as SVG_NAMESPACE,st as VOID_ELEMENTS,lt as addClass,ke as addDelegatedEventListener,de as addNativeEventListener,Et as appendChildren,q as applyElementProp,Qt as applyProps,pe as applyUse,Ae as captureHydrationCursor,w as cleanChildren,zt as cloneTemplate,ut as closest,cn as createComponent,xt as createElement,ce as createNativeElement,nn as createPortal,Xt as createTemplate,wt as delegate,le as delegateEvents,sn as escapeHTML,Ut as fnName,Bt as generateID,yt as getAttribute,_t as getGlobal,rt as getLitEventName,Tt as getOffset,Kt as getStableElementId,gt as getStyle,me as handleRef,pt as hasClass,te as hydrate,Pe as hydrateAdvancePast,tt as hydrateIslands,ln as initializeIntegration,R as insert,M as insertExpression,dn as intergartionInitialized,an as isAccessor,Te as isCustomElement,Pt as isDOMNode,Gt as isDelegatedEvent,K as isDomElement,C as isDomNode,B as isDomText,ot as isEventHandler,Jt as isFunction,pn as isIntegrationInitialized,Lt as isJSXTemplate,ve as isLitTemplateResult,on as isNativeElement,L as isPromise,At as isReactElement,rn as isSVGElement,N as isServer,Rt as isTemplateFactory,bt as isVisible,Yt as iterateFn,He as makeArrayFlat,en as mergeProps,vt as observeIntersection,Ct as observeResize,oe as query,ft as queryAll,un as registerCreateComponent,Mt as registerGlobal,mt as removeAttribute,ht as removeChildren,ct as removeClass,fe as removeDelegatedEventListener,ge as render,yn as resetIntegration,Re as runHydrationAt,Le as runWithoutHydration,Nt as scrollIntoView,x as setAttribute,$ as setClassList,I as setClassName,z as setDynamicAttribute,ye as setDynamicBoolAttribute,U as setDynamicProperty,_ as setProperty,Ce as setServerMode,D as setStyle,we as setStyles,it as shouldSetAsProperty,tn as splitProps,Zt as spread,nt as toAttributeName,dt as toggleClass,St as waitForElement};
1
+ function it(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function st(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function at(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function ft(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var ut=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),lt=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"]),B="http://www.w3.org/2000/svg";function we(e){return e.localName.includes("-")}function G(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(we(e)){e[t]=n;return}x(e,t,n,o)}var J=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function re(e,t=document){return t.querySelector(e)}function ct(e,t=document){return Array.from(t.querySelectorAll(e))}function dt(e,t){return e.closest(t)}function pt(e,...t){e.classList.add(...t)}function yt(e,...t){e.classList.remove(...t)}function gt(e,...t){t.forEach(n=>e.classList.toggle(n))}function mt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function xt(e,t){return e.getAttribute(t)}function ht(e,t){e.removeAttribute(t)}function Se(e,t){Object.assign(e.style,t)}function Et(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function bt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")Se(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function Nt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Tt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function wt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function St(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function vt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Ct(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function At(e,t=5e3){return new Promise((n,o)=>{let r=re(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=re(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Rt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Lt(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var ve=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Pt(e){return typeof e=="object"&&e!==null&&e.$$typeof===ve}function Ce(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Mt(e){if(typeof e!="function")return!1;try{let t=e();return Ce(t)}catch{return!1}}function _t(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function $t(e){return e instanceof Node}function It(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Dt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as m}from"@fluixi/reactive/signal";function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as le,createEffect as A,createRenderEffect as p,createRoot as Me,onCleanup as S,readChildren as _e}from"@fluixi/reactive/signal";var E=typeof document>"u";function Ae(e){E=e}var X=Symbol.for("fluixi.server-node"),ie=null;function L(){if(!ie)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return ie}function C(e){return e!=null&&e[X]===!0?!0:typeof Node<"u"&&e instanceof Node}function z(e){return e!=null&&e[X]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function U(e){return e!=null&&e[X]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},se=null;function ae(e){se=e}function P(){return se}function Y(e,t){return l.active&&t.parentNode===e}function Z(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Re(){return l.active?l.cursor:null}function M(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Le(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Pe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Z(t)}function $e(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Ie(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 Jt(e){return Ie($e(e))}var Xt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),De={};var fe=new Map,$=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!E)for(let t of e)$.has(t)||j.has(t)||($.add(t),document.addEventListener(t,Oe))}function Oe(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 ke(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}$.has(t)||ce([t])}function ue(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function zt(e){return!j.has(e)}function Ut(e){return typeof e=="function"}function T(e,t=!1){if(E)return L().createText(e);if(l.active&&!t){let n=P()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function de(e,t=!1){if(E)return L().createElement(e,t);if(l.active){let n=P()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(B,e):document.createElement(e)}function He(e,t=!1){let n=fe.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,fe.set(e,o),o}function Yt(e,t,n=!1,o=!1){if(E){let r=L();return n?r.parseTemplate(e,o):r.createRaw(e)}if(l.active){let r=P()?.hydrateStatic(t);if(r)return r}return je(He(e,o),o).firstChild}function Zt(e,t){if(!l.active)return t();let n=M(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...r)=>l.active?M(e.nextSibling,()=>o(...r)):o(...r))}return n}function Qt(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 en(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function je(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function qe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?qe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function tn(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function nn(e){if(m(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!h(t);)t=t();return t}var N=0,Fe=200;function We(e,t,n,o,r){let f=o,s=new Map;return p(()=>{let i;if(h(e)&&!m(e)){if(!s.has(e)){N++;try{let a=e();s.set(e,a)}finally{N--}}for(i=s.get(e);typeof i=="function"&&m(i);)i=i()}else for(i=e();typeof i=="function"&&m(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;N++;try{let c=u();s.set(u,c)}finally{N--}}i=s.get(i)}else if(m(i))i=i();else if(i=i(),typeof i!="function"||!m(i)&&!h(i))break}N++;try{f=I(t,i,n,f,s),r(f)}finally{N--}})}function R(e,t,n,o){if(N>Fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){N++;try{r=I(e,t,n,null)}finally{N--}return()=>r}let i=We(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function I(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(_(t)){let s=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&I(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=T(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&U(o))return o.data=t,o;let s=T(t);return o&&o.parentNode===e?e.replaceChild(s,o):Y(e,s)||g(e,s,n),s}if(C(t))return Y(e,t)?(Z(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];b(t,s,e,n,!0,r,a);let u=Ve(e,i,s,n);for(let c of a){let d=R(e,c.sig,c.marker);S(()=>{w(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return I(e,a,n,o)}}}return w(e,o,n)}function b(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!_(a)&&!m(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!m(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!_(u)&&!m(u)&&!h(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(m(u)){if(s){let d=T("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&m(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?b(c,t,n,o,r,f):b([c],t,n,o,r,f);continue}continue}Array.isArray(u)?b(u,t,n,o,r,f,s):b([u],t,n,o,r,f,s);continue}if(_(a)){let u=T("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(b([c],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(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){b(a,t,n,o,r,f,s);continue}if(C(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?b(c,t,n,o,!1,f):b([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(T(u));continue}t.push(T(String(a)))}}}}function Ve(e,t,n,o){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 r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let y=a;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let y=i,K=1;for(;++y<f&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+K);)K++;if(K>d-a){let Te=t[i];for(;a<d;)g(e,n[a++],Te)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function D(e,t,n){n==null?delete e[t]:e[t]=n}function pe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function ye(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function Q(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):p(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function ee(e,t,n){return typeof n!="function"?(D(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;D(e,t,o)})}function ge(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let o=n();x(e,t,!!o)})}function O(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>O(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function k(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(p(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function H(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function on(e){let{element:t,props:n,prevProps:o=De,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!z(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===B,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){me(u,t);continue}if(a==="use"){ye(t,u);continue}if(a.startsWith("on:")){i.push(pe(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(ee(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(Q(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ge(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(p(()=>O(t,u()))):O(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(p(()=>k(t,u()))):k(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(p(()=>H(t,u()))):H(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();c&&ue(t,y),u&&ke(t,y,u);continue}let d=J.has(a)||!s&&a in t;typeof u=="function"?i.push(d?ee(t,a,u):Q(t,a,u,s)):i.push(p(()=>d?D(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();ue(t,u)}else J.has(a)?D(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function rn(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){me(r,e);continue}if(o!=="children"){if(o==="use"){ye(e,r);continue}if(o.startsWith("on:")){pe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){ee(e,o.slice(5),r);continue}if(o.startsWith("attr:")){Q(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ge(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(j.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,$.has(f)||ce([f]);continue}if(o==="class"||o==="className"){O(e,r);continue}if(o==="classList"){typeof r=="function"?p(()=>k(e,r())):k(e,r);continue}if(o==="style"){typeof r=="function"?p(()=>H(e,r())):H(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});S(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=A(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{s()})}else{let f=!0;p(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();G(e,o,s,n)});S(()=>{f()})}else p(()=>G(e,o,t[o],n))}}}function sn(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function an(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function me(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 fn(e,t,n){let o=t||document.body,r=_e(()=>e),f=[];return le(()=>{let s=p(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):C(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),S(()=>{f.forEach(i=>i())})}),null}function un(e){return typeof e=="string"&&e.toLowerCase()===e}function ln(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 cn(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function _(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function dn(e){return typeof e=="function"&&e.length===0&&m(e)}function xe(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return Me(s=>{le(()=>{l.active||(t.textContent=""),R(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var Ke="__fx_dom_create_component__",v=globalThis[Ke]??={fn:null};function yn(e){v.fn=e}function gn(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function mn(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var xn=()=>v.fn!==null,hn=()=>v.fn!==null;function En(){v.fn=null}var q,Be={getStore:()=>q,run(e,t){let n=q;q=e;try{return t()}finally{q=n}}},Ge=Be;function he(){return Ge.getStore()}import{setResourceIdSource as Xe,setServerDataGetter as ze}from"@fluixi/reactive/signal";var Je="__FX_DATA__";var te;function Ee(){let e=globalThis.__FX_DATA__;if(e)return e;if(te!==void 0)return te;let t=null;if(typeof document<"u"){let n=document.getElementById(Je)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return te=t}function F(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Ue=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),W=typeof process<"u"&&process.env&&!1;function V(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 Ye(e){F();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Ue.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(W&&t&&V(`<${e}>`,t),null)}function Ze(e){F();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(l.cursor=t.nextSibling,t):(W&&t&&V(`<${e}> (static)`,t),null)}function Qe(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}F();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(W&&t&&V(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function et(e){F();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(W&&t&&V(`marker <!--${e.slice(0,24)}-->`,t),null)}var be=!1;function tt(){be||(be=!0,ae({hydrateElement:Ye,hydrateText:Qe,hydrateMarker:et,hydrateStatic:Ze}))}function ne(e,t,n){tt(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=Ee(),r=n?.resourceNamespace,f=0;Xe(()=>r?`${r}:r${f++}`:`r${f++}`),ze(o?s=>s in o?{value:o[s]}:void 0:null);try{return xe(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var oe="fluixi-island";function nt(e){let{component:t,props:n={},name:o}=e,r=de(oe),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=E?he():void 0;if(s){let i=s.nextIslandNamespace(f);R(r,()=>s.withResourceScope(i,()=>t(n)))}else R(r,()=>t(n));return r}var Ne=!1;function ot(){if(Ne||typeof document>"u")return;Ne=!0;let e=document.createElement("style");e.textContent=`${oe}{display:contents}`,document.head.appendChild(e)}function rt(e){if(typeof document>"u")return;ot();let t=document.querySelectorAll(oe),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}ne(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{nt as Island,J as JSX_PROPERTIES,lt as SVG_ELEMENTS,B as SVG_NAMESPACE,ut as VOID_ELEMENTS,pt as addClass,ke as addDelegatedEventListener,pe as addNativeEventListener,Tt as appendChildren,G as applyElementProp,rn as applyProps,ye as applyUse,Re as captureHydrationCursor,w as cleanChildren,je as cloneTemplate,dt as closest,mn as createComponent,bt as createElement,de as createNativeElement,fn as createPortal,He as createTemplate,Ct as delegate,ce as delegateEvents,cn as escapeHTML,tn as fnName,Xt as generateID,xt as getAttribute,Dt as getGlobal,at as getLitEventName,vt as getOffset,Jt as getStableElementId,Et as getStyle,me as handleRef,mt as hasClass,en as holeContent,Qt as holeEnd,Zt as holeScope,ne as hydrate,Pe as hydrateAdvancePast,rt as hydrateIslands,gn as initializeIntegration,R as insert,I as insertExpression,xn as intergartionInitialized,dn as isAccessor,we as isCustomElement,$t as isDOMNode,zt as isDelegatedEvent,z as isDomElement,C as isDomNode,U as isDomText,st as isEventHandler,Ut as isFunction,hn as isIntegrationInitialized,_t as isJSXTemplate,Ce as isLitTemplateResult,un as isNativeElement,_ as isPromise,Pt as isReactElement,ln as isSVGElement,E as isServer,Mt as isTemplateFactory,wt as isVisible,nn as iterateFn,qe as makeArrayFlat,sn as mergeProps,Rt as observeIntersection,Lt as observeResize,re as query,ct as queryAll,yn as registerCreateComponent,It as registerGlobal,ht as removeAttribute,Nt as removeChildren,yt as removeClass,ue as removeDelegatedEventListener,xe as render,En as resetIntegration,M as runHydrationAt,Le as runWithoutHydration,St as scrollIntoView,x as setAttribute,k as setClassList,O as setClassName,Q as setDynamicAttribute,ge as setDynamicBoolAttribute,ee as setDynamicProperty,D as setProperty,Ae as setServerMode,H as setStyle,Se as setStyles,ft as shouldSetAsProperty,an as splitProps,on as spread,Yt as templateNode,it as toAttributeName,gt as toggleClass,At as waitForElement};
@@ -1 +1 @@
1
- "use strict";var P=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var n in e)P(t,n,{get:e[n],enumerable:!0})},ie=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ne(e))!oe.call(t,u)&&u!==n&&P(t,u,{get:()=>e[u],enumerable:!(o=te(e,u))||o.enumerable});return t};var se=t=>ie(P({},"__esModule",{value:!0}),t);var Ne={};re(Ne,{Island:()=>he,hydrateIslands:()=>be});module.exports=se(Ne);var g=require("@fluixi/reactive/signal");var H="http://www.w3.org/2000/svg";function S(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var we=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}var m=require("@fluixi/reactive/signal");var T=typeof document>"u";var W=Symbol.for("fluixi.server-node"),F=null;function M(){if(!F)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return F}function _(t){return t!=null&&t[W]===!0?!0:typeof Node<"u"&&t instanceof Node}function V(t){return t!=null&&t[W]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},K=null;function B(t){K=t}function $(){return K}function O(t,e){return l.active&&e.parentNode===t}function G(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function E(t,e=!1){if(T)return M().createText(t);if(l.active&&!e){let n=$()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function J(t,e=!1){if(T)return M().createElement(t,e);if(l.active){let n=$()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(H,t):document.createElement(t)}var h=0,fe=200;function ae(t,e,n,o,u){let f=o,s=new Map;return(0,m.createRenderEffect)(()=>{let r;if(b(t)&&!(0,g.isSignal)(t)){if(!s.has(t)){h++;try{let i=t();s.set(t,i)}finally{h--}}for(r=s.get(t);typeof r=="function"&&(0,g.isSignal)(r);)r=r()}else for(r=t();typeof r=="function"&&(0,g.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(b(r)){if(!s.has(r)){let a=r;h++;try{let c=a();s.set(a,c)}finally{h--}}r=s.get(r)}else if((0,g.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,g.isSignal)(r)&&!b(r))break}h++;try{f=A(e,r,n,f,s),u(f)}finally{h--}})}function w(t,e,n,o){if(h>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),t.appendChild(n));let u=o??null,f=i=>Array.isArray(i)&&i.some(a=>typeof a=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!f(e)){h++;try{u=A(t,e,n,null)}finally{h--}return()=>u}let r=ae(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function A(t,e,n,o,u){if(e==null||typeof e=="boolean")return N(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return N(t,o,n);if(v(e)){let s=E("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),N(t,o.slice(1),n)):y(t,s,n):o?t.replaceChild(s,o):y(t,s,n),e.then(r=>{s.parentNode===t&&A(t,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(o)){if(o.length===0){let r=E(e);return y(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=N(t,o,n)}if(o&&V(o))return o.data=e,o;let s=E(e);return o&&o.parentNode===t?t.replaceChild(s,o):O(t,s)||y(t,s,n),s}if(_(e))return O(t,e)?(G(e),e):Array.isArray(o)?(o.length===0?y(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),N(t,o.slice(1),n)):y(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];x(e,s,t,n,!0,u,i);let a=ue(t,r,s,n);for(let c of i){let d=w(t,c.sig,c.marker);(0,m.onCleanup)(()=>{N(t,d()),c.marker.parentNode===t&&t.removeChild(c.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 i=r.type(r.props||{});return A(t,i,n,o)}}}return N(t,o,n)}function x(t,e,n,o,u=!0,f,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!v(i)&&!(0,g.isSignal)(i)&&!b(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let a;for(b(i)&&!(0,g.isSignal)(i)?(f||(f=new Map),f.has(i)||f.set(i,i()),a=f.get(i)):a=i();typeof a=="function"&&!v(a)&&!(0,g.isSignal)(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((0,g.isSignal)(a)){if(s){let d=E("",!0);e.push(d),s.push({marker:d,sig:a});continue}let c=a();for(;typeof c=="function"&&(0,g.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?x(c,e,n,o,u,f):x([c],e,n,o,u,f);continue}continue}Array.isArray(a)?x(a,e,n,o,u,f,s):x([a],e,n,o,u,f,s);continue}if(v(i)){let a=E("",!0);e.push(a),i.then(c=>{if(a.parentNode){let d=[];if(x([c],d,a.parentNode,void 0,!1,f),d.length>0){a.parentNode.replaceChild(d[0],a);for(let p=1;p<d.length;p++)a.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){x(i,e,n,o,u,f,s);continue}if(_(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let c=a.type(a.props||{});Array.isArray(c)?x(c,e,n,o,!1,f):x([c],e,n,o,!1,f);continue}}if(typeof i=="string"||typeof i=="number"){let a=String(i);if(a.trim()===""&&a!==" ")continue;e.push(E(a));continue}e.push(E(String(i)))}}}}function ue(t,e,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==t&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let u=n.length,f=e.length,s=u,r=0,i=0,a=f>0?e[f-1].nextSibling??void 0:o,c=null;for(;r<f||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;f>r&&s>i&&e[f-1]===n[s-1];)f--,s--;if(f===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:a;for(;i<s;)y(t,n[i++],d)}else if(s===i)for(;r<f;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[f-1]){let d=e[--f].nextSibling;y(t,n[i++],e[r++].nextSibling),y(t,n[--s],d),e[f]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,L=1;for(;++p<f&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+L);)L++;if(L>d-i){let ee=e[r];for(;i<d;)y(t,n[i++],ee)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(y(t,n[i++],a),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function N(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function v(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function X(t,e,n){if(!e)throw new Error("Container element is required");let o,u,f=[];return(0,m.createRoot)(s=>{(0,m.batch)(()=>{l.active||(e.textContent=""),w(e,t)}),u=s}),()=>{u?.(),o?.(),f.forEach(s=>s()),e.textContent=""}}var C,le={getStore:()=>C,run(t,e){let n=C;C=t;try{return e()}finally{C=n}}},ce=le;function z(){return ce.getStore()}var R=require("@fluixi/reactive/signal");var de="__FX_DATA__";var D;function U(){let t=globalThis.__FX_DATA__;if(t)return t;if(D!==void 0)return D;let e=null;if(typeof document<"u"){let n=document.getElementById(de)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return D=e}function k(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var pe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),I=typeof process<"u"&&process.env&&!1;function q(t,e){let n=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 ${t} 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 ye(t){k();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(pe.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(I&&e&&q(`<${t}>`,e),null)}function ge(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}k();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(I&&e&&q(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function me(t){k();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(I&&e&&q(`marker <!--${t.slice(0,24)}-->`,e),null)}var Y=!1;function xe(){Y||(Y=!0,B({hydrateElement:ye,hydrateText:ge,hydrateMarker:me}))}function Z(t,e,n){xe(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=U(),u=n?.resourceNamespace,f=0;(0,R.setResourceIdSource)(()=>u?`${u}:r${f++}`:`r${f++}`),(0,R.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return X(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var j="fluixi-island";function he(t){let{component:e,props:n={},name:o}=t,u=J(j),f=o??e.name??"Island";S(u,"name",f),S(u,"props",JSON.stringify(n??{}));let s=T?z():void 0;if(s){let r=s.nextIslandNamespace(f);w(u,()=>s.withResourceScope(r,()=>e(n)))}else w(u,()=>e(n));return u}var Q=!1;function Ee(){if(Q||typeof document>"u")return;Q=!0;let t=document.createElement("style");t.textContent=`${j}{display:contents}`,document.head.appendChild(t)}function be(t){if(typeof document>"u")return;Ee();let e=document.querySelectorAll(j),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",f=n.get(u)??0;n.set(u,f+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}Z(()=>s(r),o,{resourceNamespace:`${u}#${f}`})})}
1
+ "use strict";var $=Object.defineProperty;var te=Object.getOwnPropertyDescriptor;var ne=Object.getOwnPropertyNames;var oe=Object.prototype.hasOwnProperty;var re=(t,e)=>{for(var n in e)$(t,n,{get:e[n],enumerable:!0})},ie=(t,e,n,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let u of ne(e))!oe.call(t,u)&&u!==n&&$(t,u,{get:()=>e[u],enumerable:!(o=te(e,u))||o.enumerable});return t};var se=t=>ie($({},"__esModule",{value:!0}),t);var Te={};re(Te,{Island:()=>Ee,hydrateIslands:()=>Ne});module.exports=se(Te);var g=require("@fluixi/reactive/signal");var j="http://www.w3.org/2000/svg";function S(t,e,n,o=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function b(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}var m=require("@fluixi/reactive/signal");var T=typeof document>"u";var W=Symbol.for("fluixi.server-node"),F=null;function k(){if(!F)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return F}function O(t){return t!=null&&t[W]===!0?!0:typeof Node<"u"&&t instanceof Node}function V(t){return t!=null&&t[W]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},K=null;function B(t){K=t}function D(){return K}function I(t,e){return l.active&&e.parentNode===t}function G(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function E(t,e=!1){if(T)return k().createText(t);if(l.active&&!e){let n=D()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function J(t,e=!1){if(T)return k().createElement(t,e);if(l.active){let n=D()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(j,t):document.createElement(t)}var h=0,ae=200;function fe(t,e,n,o,u){let a=o,s=new Map;return(0,m.createRenderEffect)(()=>{let r;if(b(t)&&!(0,g.isSignal)(t)){if(!s.has(t)){h++;try{let i=t();s.set(t,i)}finally{h--}}for(r=s.get(t);typeof r=="function"&&(0,g.isSignal)(r);)r=r()}else for(r=t();typeof r=="function"&&(0,g.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(b(r)){if(!s.has(r)){let f=r;h++;try{let c=f();s.set(f,c)}finally{h--}}r=s.get(r)}else if((0,g.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,g.isSignal)(r)&&!b(r))break}h++;try{a=A(e,r,n,a,s),u(a)}finally{h--}})}function w(t,e,n,o){if(h>ae)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=E("",!0),t.appendChild(n));let u=o??null,a=i=>Array.isArray(i)&&i.some(f=>typeof f=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof e!="function"&&!a(e)){h++;try{u=A(t,e,n,null)}finally{h--}return()=>u}let r=fe(s(e),t,n,u,i=>{u=i});return()=>(r?.(),u)}function A(t,e,n,o,u){if(e==null||typeof e=="boolean")return N(t,o,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return N(t,o,n);if(v(e)){let s=E("",!0);return Array.isArray(o)?o.length>0?(t.replaceChild(s,o[0]),N(t,o.slice(1),n)):y(t,s,n):o?t.replaceChild(s,o):y(t,s,n),e.then(r=>{s.parentNode===t&&A(t,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(o)){if(o.length===0){let r=E(e);return y(t,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=e,o;o=N(t,o,n)}if(o&&V(o))return o.data=e,o;let s=E(e);return o&&o.parentNode===t?t.replaceChild(s,o):I(t,s)||y(t,s,n),s}if(O(e))return I(t,e)?(G(e),e):Array.isArray(o)?(o.length===0?y(t,e,n):o[0].parentNode===t?(t.replaceChild(e,o[0]),N(t,o.slice(1),n)):y(t,e,n),e):(o?o!==e&&(o.parentNode===t?t.replaceChild(e,o):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];x(e,s,t,n,!0,u,i);let f=ue(t,r,s,n);for(let c of i){let d=w(t,c.sig,c.marker);(0,m.onCleanup)(()=>{N(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="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 i=r.type(r.props||{});return A(t,i,n,o)}}}return N(t,o,n)}function x(t,e,n,o,u=!0,a,s){for(let r=0;r<t.length;r++){let i=t[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!v(i)&&!(0,g.isSignal)(i)&&!b(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let f;for(b(i)&&!(0,g.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),f=a.get(i)):f=i();typeof f=="function"&&!v(f)&&!(0,g.isSignal)(f)&&!b(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,g.isSignal)(f)){if(s){let d=E("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&(0,g.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?x(c,e,n,o,u,a):x([c],e,n,o,u,a);continue}continue}Array.isArray(f)?x(f,e,n,o,u,a,s):x([f],e,n,o,u,a,s);continue}if(v(i)){let f=E("",!0);e.push(f),i.then(c=>{if(f.parentNode){let d=[];if(x([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){x(i,e,n,o,u,a,s);continue}if(O(i)){e.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let f=i;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?x(c,e,n,o,!1,a):x([c],e,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let f=String(i);if(f.trim()===""&&f!==" ")continue;e.push(E(f));continue}e.push(E(String(i)))}}}}function ue(t,e,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==t&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let u=n.length,a=e.length,s=u,r=0,i=0,f=a>0?e[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(e[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&e[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<u?i?n[i-1].nextSibling??void 0:n[s-i]:f;for(;i<s;)y(t,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(e[r]))&&e[r].parentNode===t&&t.removeChild(e[r]),r++;else if(e[r]===n[s-1]&&n[i]===e[a-1]){let d=e[--a].nextSibling;y(t,n[i++],e[r++].nextSibling),y(t,n[--s],d),e[a]=e[r-1]}else{if(!c){c=new Map;let p=i;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[r]);if(d!=null)if(i<d&&d<s){let p=r,_=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+_);)_++;if(_>d-i){let ee=e[r];for(;i<d;)y(t,n[i++],ee)}else e[r].parentNode===t?t.replaceChild(n[i++],e[r++]):(y(t,n[i++],f),r++)}else r++;else e[r].parentNode===t&&t.removeChild(e[r]),r++}}return n}function N(t,e,n){if(e)if(Array.isArray(e))for(let o=0;o<e.length;o++)e[o].parentNode===t&&t.removeChild(e[o]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function v(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function X(t,e,n){if(!e)throw new Error("Container element is required");let o,u,a=[];return(0,m.createRoot)(s=>{(0,m.batch)(()=>{l.active||(e.textContent=""),w(e,t)}),u=s}),()=>{u?.(),o?.(),a.forEach(s=>s()),e.textContent=""}}var C,le={getStore:()=>C,run(t,e){let n=C;C=t;try{return e()}finally{C=n}}},ce=le;function z(){return ce.getStore()}var R=require("@fluixi/reactive/signal");var de="__FX_DATA__";var q;function U(){let t=globalThis.__FX_DATA__;if(t)return t;if(q!==void 0)return q;let e=null;if(typeof document<"u"){let n=document.getElementById(de)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return q=e}function L(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var pe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),P=typeof process<"u"&&process.env&&!1;function M(t,e){let n=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 ${t} 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 ye(t){L();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(pe.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(P&&e&&M(`<${t}>`,e),null)}function ge(t){L();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(l.cursor=e.nextSibling,e):(P&&e&&M(`<${t}> (static)`,e),null)}function me(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}L();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(P&&e&&M(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function xe(t){L();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(P&&e&&M(`marker <!--${t.slice(0,24)}-->`,e),null)}var Y=!1;function he(){Y||(Y=!0,B({hydrateElement:ye,hydrateText:me,hydrateMarker:xe,hydrateStatic:ge}))}function Z(t,e,n){he(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let o=U(),u=n?.resourceNamespace,a=0;(0,R.setResourceIdSource)(()=>u?`${u}:r${a++}`:`r${a++}`),(0,R.setServerDataGetter)(o?s=>s in o?{value:o[s]}:void 0:null);try{return X(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var H="fluixi-island";function Ee(t){let{component:e,props:n={},name:o}=t,u=J(H),a=o??e.name??"Island";S(u,"name",a),S(u,"props",JSON.stringify(n??{}));let s=T?z():void 0;if(s){let r=s.nextIslandNamespace(a);w(u,()=>s.withResourceScope(r,()=>e(n)))}else w(u,()=>e(n));return u}var Q=!1;function be(){if(Q||typeof document>"u")return;Q=!0;let t=document.createElement("style");t.textContent=`${H}{display:contents}`,document.head.appendChild(t)}function Ne(t){if(typeof document>"u")return;be();let e=document.querySelectorAll(H),n=new Map;e.forEach(o=>{let u=o.getAttribute("name")??"",a=n.get(u)??0;n.set(u,a+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let r={};try{r=JSON.parse(o.getAttribute("props")||"{}")}catch{}Z(()=>s(r),o,{resourceNamespace:`${u}#${a}`})})}
@@ -1 +1 @@
1
- import{isSignal as g}from"@fluixi/reactive/signal";var I="http://www.w3.org/2000/svg";function w(t,e,n,i=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var me=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}import{batch as Z,createEffect as Re,createRenderEffect as Q,createRoot as ee,onCleanup as te,readChildren as Le}from"@fluixi/reactive/signal";var N=typeof document>"u";var j=Symbol.for("fluixi.server-node"),q=null;function R(){if(!q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return q}function L(t){return t!=null&&t[j]===!0?!0:typeof Node<"u"&&t instanceof Node}function H(t){return t!=null&&t[j]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var l={active:!1,cursor:null,parents:[]},F=null;function W(t){F=t}function P(){return F}function M(t,e){return l.active&&e.parentNode===t}function V(t){let e=l.parents.lastIndexOf(t);e!==-1&&(l.parents.length=e),l.cursor=t.nextSibling}function h(t,e=!1){if(N)return R().createText(t);if(l.active&&!e){let n=P()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function K(t,e=!1){if(N)return R().createElement(t,e);if(l.active){let n=P()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(I,t):document.createElement(t)}var x=0,ne=200;function oe(t,e,n,i,u){let f=i,s=new Map;return Q(()=>{let o;if(E(t)&&!g(t)){if(!s.has(t)){x++;try{let r=t();s.set(t,r)}finally{x--}}for(o=s.get(t);typeof o=="function"&&g(o);)o=o()}else for(o=t();typeof o=="function"&&g(o);)o=o();{let r=0;for(;typeof o=="function"&&r++<50;)if(E(o)){if(!s.has(o)){let a=o;x++;try{let c=a();s.set(a,c)}finally{x--}}o=s.get(o)}else if(g(o))o=o();else if(o=o(),typeof o!="function"||!g(o)&&!E(o))break}x++;try{f=v(e,o,n,f,s),u(f)}finally{x--}})}function T(t,e,n,i){if(x>ne)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),t.appendChild(n));let u=i??null,f=r=>Array.isArray(r)&&r.some(a=>typeof a=="function"),s=r=>typeof r=="function"?r:()=>r;if(typeof e!="function"&&!f(e)){x++;try{u=v(t,e,n,null)}finally{x--}return()=>u}let o=oe(s(e),t,n,u,r=>{u=r});return()=>(o?.(),u)}function v(t,e,n,i,u){if(e==null||typeof e=="boolean")return b(t,i,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(t,i,n);if(S(e)){let s=h("",!0);return Array.isArray(i)?i.length>0?(t.replaceChild(s,i[0]),b(t,i.slice(1),n)):y(t,s,n):i?t.replaceChild(s,i):y(t,s,n),e.then(o=>{s.parentNode===t&&v(t,o,s.nextSibling,s)}).catch(o=>{console.error("Error resolving promise in insertExpression:",o)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let o=h(e);return y(t,o,n),o}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(t,i,n)}if(i&&H(i))return i.data=e,i;let s=h(e);return i&&i.parentNode===t?t.replaceChild(s,i):M(t,s)||y(t,s,n),s}if(L(e))return M(t,e)?(V(e),e):Array.isArray(i)?(i.length===0?y(t,e,n):i[0].parentNode===t?(t.replaceChild(e,i[0]),b(t,i.slice(1),n)):y(t,e,n),e):(i?i!==e&&(i.parentNode===t?t.replaceChild(e,i):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],o=Array.isArray(i)?i:i?[i]:[],r=[];m(e,s,t,n,!0,u,r);let a=re(t,o,s,n);for(let c of r){let d=T(t,c.sig,c.marker);te(()=>{b(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let o=s;if(typeof o.type=="function"){let r=o.type(o.props||{});return v(t,r,n,i)}}}return b(t,i,n)}function m(t,e,n,i,u=!0,f,s){for(let o=0;o<t.length;o++){let r=t[o];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!S(r)&&!g(r)&&!E(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let a;for(E(r)&&!g(r)?(f||(f=new Map),f.has(r)||f.set(r,r()),a=f.get(r)):a=r();typeof a=="function"&&!S(a)&&!g(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(g(a)){if(s){let d=h("",!0);e.push(d),s.push({marker:d,sig:a});continue}let c=a();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?m(c,e,n,i,u,f):m([c],e,n,i,u,f);continue}continue}Array.isArray(a)?m(a,e,n,i,u,f,s):m([a],e,n,i,u,f,s);continue}if(S(r)){let a=h("",!0);e.push(a),r.then(c=>{if(a.parentNode){let d=[];if(m([c],d,a.parentNode,void 0,!1,f),d.length>0){a.parentNode.replaceChild(d[0],a);for(let p=1;p<d.length;p++)a.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(r)){m(r,e,n,i,u,f,s);continue}if(L(r)){e.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let a=r;if(typeof a.type=="function"){let c=a.type(a.props||{});Array.isArray(c)?m(c,e,n,i,!1,f):m([c],e,n,i,!1,f);continue}}if(typeof r=="string"||typeof r=="number"){let a=String(r);if(a.trim()===""&&a!==" ")continue;e.push(h(a));continue}e.push(h(String(r)))}}}}function re(t,e,n,i){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==t&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let u=n.length,f=e.length,s=u,o=0,r=0,a=f>0?e[f-1].nextSibling??void 0:i,c=null;for(;o<f||r<s;){if(e[o]===n[r]){o++,r++;continue}for(;f>o&&s>r&&e[f-1]===n[s-1];)f--,s--;if(f===o){let d=s<u?r?n[r-1].nextSibling??void 0:n[s-r]:a;for(;r<s;)y(t,n[r++],d)}else if(s===r)for(;o<f;)(!c||!c.has(e[o]))&&e[o].parentNode===t&&t.removeChild(e[o]),o++;else if(e[o]===n[s-1]&&n[r]===e[f-1]){let d=e[--f].nextSibling;y(t,n[r++],e[o++].nextSibling),y(t,n[--s],d),e[f]=e[o-1]}else{if(!c){c=new Map;let p=r;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[o]);if(d!=null)if(r<d&&d<s){let p=o,C=1;for(;++p<f&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+C);)C++;if(C>d-r){let Y=e[o];for(;r<d;)y(t,n[r++],Y)}else e[o].parentNode===t?t.replaceChild(n[r++],e[o++]):(y(t,n[r++],a),o++)}else o++;else e[o].parentNode===t&&t.removeChild(e[o]),o++}}return n}function b(t,e,n){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===t&&t.removeChild(e[i]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){l.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function S(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function B(t,e,n){if(!e)throw new Error("Container element is required");let i,u,f=[];return ee(s=>{Z(()=>{l.active||(e.textContent=""),T(e,t)}),u=s}),()=>{u?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var A,ie={getStore:()=>A,run(t,e){let n=A;A=t;try{return e()}finally{A=n}}},se=ie;function G(){return se.getStore()}import{setResourceIdSource as ae,setServerDataGetter as ue}from"@fluixi/reactive/signal";var fe="__FX_DATA__";var _;function J(){let t=globalThis.__FX_DATA__;if(t)return t;if(_!==void 0)return _;let e=null;if(typeof document<"u"){let n=document.getElementById(fe)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return _=e}function $(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var le=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),O=typeof process<"u"&&process.env&&!1;function D(t,e){let n=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 ${t} 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 ce(t){$();let e=l.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(le.has(t.toLowerCase())?l.cursor=e.nextSibling:(l.parents.push(e),l.cursor=e.firstChild),e):(O&&e&&D(`<${t}>`,e),null)}function de(t){if(t===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}$();let e=l.cursor;return e&&e.nodeType===3?(l.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(O&&e&&D(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function pe(t){$();let e=l.cursor;return e&&e.nodeType===8&&e.data===t?(l.cursor=e.nextSibling,e):(O&&e&&D(`marker <!--${t.slice(0,24)}-->`,e),null)}var X=!1;function ye(){X||(X=!0,W({hydrateElement:ce,hydrateText:de,hydrateMarker:pe}))}function z(t,e,n){ye(),l.active=!0,l.cursor=e.firstChild,l.parents=[];let i=J(),u=n?.resourceNamespace,f=0;ae(()=>u?`${u}:r${f++}`:`r${f++}`),ue(i?s=>s in i?{value:i[s]}:void 0:null);try{return B(t,e)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var k="fluixi-island";function Ge(t){let{component:e,props:n={},name:i}=t,u=K(k),f=i??e.name??"Island";w(u,"name",f),w(u,"props",JSON.stringify(n??{}));let s=N?G():void 0;if(s){let o=s.nextIslandNamespace(f);T(u,()=>s.withResourceScope(o,()=>e(n)))}else T(u,()=>e(n));return u}var U=!1;function ge(){if(U||typeof document>"u")return;U=!0;let t=document.createElement("style");t.textContent=`${k}{display:contents}`,document.head.appendChild(t)}function Je(t){if(typeof document>"u")return;ge();let e=document.querySelectorAll(k),n=new Map;e.forEach(i=>{let u=i.getAttribute("name")??"",f=n.get(u)??0;n.set(u,f+1);let s=t[u];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${u}" has no component in the registry — left static.`);return}let o={};try{o=JSON.parse(i.getAttribute("props")||"{}")}catch{}z(()=>s(o),i,{resourceNamespace:`${u}#${f}`})})}export{Ge as Island,Je as hydrateIslands};
1
+ import{isSignal as g}from"@fluixi/reactive/signal";var I="http://www.w3.org/2000/svg";function w(t,e,n,i=!1){if(n==null||n===!1){t.removeAttribute(e);return}if(n===!0){t.setAttribute(e,"");return}if(typeof n=="object"){t.setAttribute(e,JSON.stringify(n));return}t.setAttribute(e,String(n))}var xe=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(t){return typeof t=="function"&&t[Symbol.for("fluixi-component")]===!0}import{batch as Z,createEffect as Pe,createRenderEffect as Q,createRoot as ee,onCleanup as te,readChildren as Me}from"@fluixi/reactive/signal";var N=typeof document>"u";var H=Symbol.for("fluixi.server-node"),q=null;function M(){if(!q)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return q}function _(t){return t!=null&&t[H]===!0?!0:typeof Node<"u"&&t instanceof Node}function j(t){return t!=null&&t[H]===!0?t.nodeType===3:typeof Text<"u"&&t instanceof Text}var u={active:!1,cursor:null,parents:[]},F=null;function W(t){F=t}function $(){return F}function k(t,e){return u.active&&e.parentNode===t}function V(t){let e=u.parents.lastIndexOf(t);e!==-1&&(u.parents.length=e),u.cursor=t.nextSibling}function h(t,e=!1){if(N)return M().createText(t);if(u.active&&!e){let n=$()?.hydrateText(t);if(n)return n}return document.createTextNode(t)}function K(t,e=!1){if(N)return M().createElement(t,e);if(u.active){let n=$()?.hydrateElement(t);if(n)return n}return e?document.createElementNS(I,t):document.createElement(t)}var x=0,ne=200;function oe(t,e,n,i,l){let a=i,s=new Map;return Q(()=>{let o;if(E(t)&&!g(t)){if(!s.has(t)){x++;try{let r=t();s.set(t,r)}finally{x--}}for(o=s.get(t);typeof o=="function"&&g(o);)o=o()}else for(o=t();typeof o=="function"&&g(o);)o=o();{let r=0;for(;typeof o=="function"&&r++<50;)if(E(o)){if(!s.has(o)){let f=o;x++;try{let c=f();s.set(f,c)}finally{x--}}o=s.get(o)}else if(g(o))o=o();else if(o=o(),typeof o!="function"||!g(o)&&!E(o))break}x++;try{a=v(e,o,n,a,s),l(a)}finally{x--}})}function T(t,e,n,i){if(x>ne)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),t.appendChild(n));let l=i??null,a=r=>Array.isArray(r)&&r.some(f=>typeof f=="function"),s=r=>typeof r=="function"?r:()=>r;if(typeof e!="function"&&!a(e)){x++;try{l=v(t,e,n,null)}finally{x--}return()=>l}let o=oe(s(e),t,n,l,r=>{l=r});return()=>(o?.(),l)}function v(t,e,n,i,l){if(e==null||typeof e=="boolean")return b(t,i,n);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return b(t,i,n);if(S(e)){let s=h("",!0);return Array.isArray(i)?i.length>0?(t.replaceChild(s,i[0]),b(t,i.slice(1),n)):y(t,s,n):i?t.replaceChild(s,i):y(t,s,n),e.then(o=>{s.parentNode===t&&v(t,o,s.nextSibling,s)}).catch(o=>{console.error("Error resolving promise in insertExpression:",o)}),s}let a=typeof e;if(a==="string"||a==="number"){if(a==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let o=h(e);return y(t,o,n),o}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=b(t,i,n)}if(i&&j(i))return i.data=e,i;let s=h(e);return i&&i.parentNode===t?t.replaceChild(s,i):k(t,s)||y(t,s,n),s}if(_(e))return k(t,e)?(V(e),e):Array.isArray(i)?(i.length===0?y(t,e,n):i[0].parentNode===t?(t.replaceChild(e,i[0]),b(t,i.slice(1),n)):y(t,e,n),e):(i?i!==e&&(i.parentNode===t?t.replaceChild(e,i):y(t,e,n)):y(t,e,n),e);if(Array.isArray(e)){let s=[],o=Array.isArray(i)?i:i?[i]:[],r=[];m(e,s,t,n,!0,l,r);let f=re(t,o,s,n);for(let c of r){let d=T(t,c.sig,c.marker);te(()=>{b(t,d()),c.marker.parentNode===t&&t.removeChild(c.marker)})}return f}if(a==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let o=s;if(typeof o.type=="function"){let r=o.type(o.props||{});return v(t,r,n,i)}}}return b(t,i,n)}function m(t,e,n,i,l=!0,a,s){for(let o=0;o<t.length;o++){let r=t[o];if(!(r==null||typeof r=="boolean")){for(;typeof r=="function"&&!S(r)&&!g(r)&&!E(r)&&(r=r(),!(r==null||typeof r=="boolean")););if(!(r==null||typeof r=="boolean")){if(typeof r=="function"){let f;for(E(r)&&!g(r)?(a||(a=new Map),a.has(r)||a.set(r,r()),f=a.get(r)):f=r();typeof f=="function"&&!S(f)&&!g(f)&&!E(f);)a||(a=new Map),a.has(f)||a.set(f,f()),f=a.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(g(f)){if(s){let d=h("",!0);e.push(d),s.push({marker:d,sig:f});continue}let c=f();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?m(c,e,n,i,l,a):m([c],e,n,i,l,a);continue}continue}Array.isArray(f)?m(f,e,n,i,l,a,s):m([f],e,n,i,l,a,s);continue}if(S(r)){let f=h("",!0);e.push(f),r.then(c=>{if(f.parentNode){let d=[];if(m([c],d,f.parentNode,void 0,!1,a),d.length>0){f.parentNode.replaceChild(d[0],f);for(let p=1;p<d.length;p++)f.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(r)){m(r,e,n,i,l,a,s);continue}if(_(r)){e.push(r);continue}if(typeof r=="object"&&r!==null&&"type"in r&&"props"in r){let f=r;if(typeof f.type=="function"){let c=f.type(f.props||{});Array.isArray(c)?m(c,e,n,i,!1,a):m([c],e,n,i,!1,a);continue}}if(typeof r=="string"||typeof r=="number"){let f=String(r);if(f.trim()===""&&f!==" ")continue;e.push(h(f));continue}e.push(h(String(r)))}}}}function re(t,e,n,i){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==t&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let l=n.length,a=e.length,s=l,o=0,r=0,f=a>0?e[a-1].nextSibling??void 0:i,c=null;for(;o<a||r<s;){if(e[o]===n[r]){o++,r++;continue}for(;a>o&&s>r&&e[a-1]===n[s-1];)a--,s--;if(a===o){let d=s<l?r?n[r-1].nextSibling??void 0:n[s-r]:f;for(;r<s;)y(t,n[r++],d)}else if(s===r)for(;o<a;)(!c||!c.has(e[o]))&&e[o].parentNode===t&&t.removeChild(e[o]),o++;else if(e[o]===n[s-1]&&n[r]===e[a-1]){let d=e[--a].nextSibling;y(t,n[r++],e[o++].nextSibling),y(t,n[--s],d),e[a]=e[o-1]}else{if(!c){c=new Map;let p=r;for(;p<s;)c.set(n[p],p++)}let d=c.get(e[o]);if(d!=null)if(r<d&&d<s){let p=o,P=1;for(;++p<a&&p<s&&!(!c.has(e[p])||c.get(e[p])!==d+P);)P++;if(P>d-r){let Y=e[o];for(;r<d;)y(t,n[r++],Y)}else e[o].parentNode===t?t.replaceChild(n[r++],e[o++]):(y(t,n[r++],f),o++)}else o++;else e[o].parentNode===t&&t.removeChild(e[o]),o++}}return n}function b(t,e,n){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===t&&t.removeChild(e[i]);else e.parentNode===t&&t.removeChild(e);return null}function y(t,e,n){u.active&&e.parentNode===t||(n&&n.parentNode===t?t.insertBefore(e,n):t.appendChild(e))}function S(t){return t!=null&&(typeof t=="object"||typeof t=="function")&&typeof t.then=="function"||t instanceof Promise}function B(t,e,n){if(!e)throw new Error("Container element is required");let i,l,a=[];return ee(s=>{Z(()=>{u.active||(e.textContent=""),T(e,t)}),l=s}),()=>{l?.(),i?.(),a.forEach(s=>s()),e.textContent=""}}var A,ie={getStore:()=>A,run(t,e){let n=A;A=t;try{return e()}finally{A=n}}},se=ie;function G(){return se.getStore()}import{setResourceIdSource as fe,setServerDataGetter as ue}from"@fluixi/reactive/signal";var ae="__FX_DATA__";var O;function J(){let t=globalThis.__FX_DATA__;if(t)return t;if(O!==void 0)return O;let e=null;if(typeof document<"u"){let n=document.getElementById(ae)?.textContent;if(n)try{e=JSON.parse(n)}catch{e=null}}return O=e}function C(){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 le=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),R=typeof process<"u"&&process.env&&!1;function L(t,e){let n=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 ${t} 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 ce(t){C();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(le.has(t.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(R&&e&&L(`<${t}>`,e),null)}function de(t){C();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===t.toLowerCase()?(u.cursor=e.nextSibling,e):(R&&e&&L(`<${t}> (static)`,e),null)}function pe(t){if(t===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}C();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==t&&(e.nodeValue=t),e):(R&&e&&L(`text ${JSON.stringify(t.slice(0,24))}`,e),null)}function ye(t){C();let e=u.cursor;return e&&e.nodeType===8&&e.data===t?(u.cursor=e.nextSibling,e):(R&&e&&L(`marker <!--${t.slice(0,24)}-->`,e),null)}var X=!1;function ge(){X||(X=!0,W({hydrateElement:ce,hydrateText:pe,hydrateMarker:ye,hydrateStatic:de}))}function z(t,e,n){ge(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=J(),l=n?.resourceNamespace,a=0;fe(()=>l?`${l}:r${a++}`:`r${a++}`),ue(i?s=>s in i?{value:i[s]}:void 0:null);try{return B(t,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var D="fluixi-island";function Xe(t){let{component:e,props:n={},name:i}=t,l=K(D),a=i??e.name??"Island";w(l,"name",a),w(l,"props",JSON.stringify(n??{}));let s=N?G():void 0;if(s){let o=s.nextIslandNamespace(a);T(l,()=>s.withResourceScope(o,()=>e(n)))}else T(l,()=>e(n));return l}var U=!1;function me(){if(U||typeof document>"u")return;U=!0;let t=document.createElement("style");t.textContent=`${D}{display:contents}`,document.head.appendChild(t)}function ze(t){if(typeof document>"u")return;me();let e=document.querySelectorAll(D),n=new Map;e.forEach(i=>{let l=i.getAttribute("name")??"",a=n.get(l)??0;n.set(l,a+1);let s=t[l];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${l}" has no component in the registry — left static.`);return}let o={};try{o=JSON.parse(i.getAttribute("props")||"{}")}catch{}z(()=>s(o),i,{resourceNamespace:`${l}#${a}`})})}export{Xe as Island,ze as hydrateIslands};
@@ -1 +1 @@
1
- "use strict";var _=Object.defineProperty;var re=Object.getOwnPropertyDescriptor;var se=Object.getOwnPropertyNames;var fe=Object.prototype.hasOwnProperty;var ae=(e,t)=>{for(var n in t)_(e,n,{get:t[n],enumerable:!0})},ue=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let f of se(t))!fe.call(e,f)&&f!==n&&_(e,f,{get:()=>t[f],enumerable:!(o=re(t,f))||o.enumerable});return e};var le=e=>ue(_({},"__esModule",{value:!0}),e);var We={};ae(We,{addDelegatedEventListener:()=>ne,addNativeEventListener:()=>X,applyProps:()=>Me,applyUse:()=>z,cleanChildren:()=>b,cloneTemplate:()=>we,createNativeElement:()=>Ne,createPortal:()=>He,createTemplate:()=>Te,delegateEvents:()=>q,escapeHTML:()=>_e,fnName:()=>Se,generateID:()=>he,getStableElementId:()=>ge,handleRef:()=>U,insert:()=>G,insertExpression:()=>A,isAccessor:()=>De,isDelegatedEvent:()=>Ee,isFunction:()=>be,isNativeElement:()=>je,isPromise:()=>S,isSVGElement:()=>$e,iterateFn:()=>Ae,makeArrayFlat:()=>oe,mergeProps:()=>Re,removeDelegatedEventListener:()=>B,render:()=>Fe,setClassList:()=>C,setClassName:()=>L,setDynamicAttribute:()=>O,setDynamicBoolAttribute:()=>J,setDynamicProperty:()=>H,setProperty:()=>v,setStyle:()=>P,splitProps:()=>Oe,spread:()=>Pe});module.exports=le(We);var p=require("@fluixi/reactive/signal");var D="http://www.w3.org/2000/svg";function ce(e){return e.localName.includes("-")}function F(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ce(e)){e[t]=n;return}T(e,t,n,o)}var W=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);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 ke=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var l=require("@fluixi/reactive/signal");var M=typeof document>"u";var I=Symbol.for("fluixi.server-node"),Y=null;function k(){if(!Y)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Y}function w(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function Z(e){return e!=null&&e[I]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Q(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var x={active:!1,cursor:null,parents:[]},de=null;function V(){return de}function K(e,t){return x.active&&t.parentNode===e}function ee(e){let t=x.parents.lastIndexOf(e);t!==-1&&(x.parents.length=t),x.cursor=e.nextSibling}function ye(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,f=e;for(;f=f.previousElementSibling;)f.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function pe(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 ge(e){return pe(ye(e))}var he=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xe={};var te=new Map,R=new Set,j=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function q(e){if(!M)for(let t of e)R.has(t)||j.has(t)||(R.add(t),document.addEventListener(t,me))}function me(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 ne(e,t,n){if(e[`$$${t}`]=n,j.has(t)){let o=`__fx_${t}`;if(!e[o]){let f=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,f),e[o]=f}return}R.has(t)||q([t])}function B(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Ee(e){return!j.has(e)}function be(e){return typeof e=="function"}function N(e,t=!1){if(M)return k().createText(e);if(x.active&&!t){let n=V()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Ne(e,t=!1){if(M)return k().createElement(e,t);if(x.active){let n=V()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(D,e):document.createElement(e)}function Te(e,t=!1){let n=te.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,te.set(e,o),o}function we(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function oe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?oe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Se(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ae(e){if((0,p.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,p.isSignal)(t)&&!h(t);)t=t();return t}var E=0,ve=200;function Le(e,t,n,o,f){let a=o,s=new Map;return(0,l.createRenderEffect)(()=>{let r;if(h(e)&&!(0,p.isSignal)(e)){if(!s.has(e)){E++;try{let i=e();s.set(e,i)}finally{E--}}for(r=s.get(e);typeof r=="function"&&(0,p.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,p.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!s.has(r)){let u=r;E++;try{let c=u();s.set(u,c)}finally{E--}}r=s.get(r)}else if((0,p.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,p.isSignal)(r)&&!h(r))break}E++;try{a=A(t,r,n,a,s),f(a)}finally{E--}})}function G(e,t,n,o){if(E>ve)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let f=o??null,a=i=>Array.isArray(i)&&i.some(u=>typeof u=="function"),s=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{f=A(e,t,n,null)}finally{E--}return()=>f}let r=Le(s(t),e,n,f,i=>{f=i});return()=>(r?.(),f)}function A(e,t,n,o,f){if(t==null||typeof t=="boolean")return b(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return b(e,o,n);if(S(t)){let s=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),b(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(r=>{s.parentNode===e&&A(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=b(e,o,n)}if(o&&Q(o))return o.data=t,o;let s=N(t);return o&&o.parentNode===e?e.replaceChild(s,o):K(e,s)||g(e,s,n),s}if(w(t))return K(e,t)?(ee(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),b(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,s,e,n,!0,f,i);let u=Ce(e,r,s,n);for(let c of i){let d=G(e,c.sig,c.marker);(0,l.onCleanup)(()=>{b(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let i=r.type(r.props||{});return A(e,i,n,o)}}}return b(e,o,n)}function m(e,t,n,o,f=!0,a,s){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!S(i)&&!(0,p.isSignal)(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let u;for(h(i)&&!(0,p.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),u=a.get(i)):u=i();typeof u=="function"&&!S(u)&&!(0,p.isSignal)(u)&&!h(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,p.isSignal)(u)){if(s){let d=N("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&(0,p.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?m(c,t,n,o,f,a):m([c],t,n,o,f,a);continue}continue}Array.isArray(u)?m(u,t,n,o,f,a,s):m([u],t,n,o,f,a,s);continue}if(S(i)){let u=N("",!0);t.push(u),i.then(c=>{if(u.parentNode){let d=[];if(m([c],d,u.parentNode,void 0,!1,a),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(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){m(i,t,n,o,f,a,s);continue}if(w(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let u=i;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?m(c,t,n,o,!1,a):m([c],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let u=String(i);if(u.trim()===""&&u!==" ")continue;t.push(N(u));continue}t.push(N(String(i)))}}}}function Ce(e,t,n,o){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 f=n.length,a=t.length,s=f,r=0,i=0,u=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<s;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&s>i&&t[a-1]===n[s-1];)a--,s--;if(a===r){let d=s<f?i?n[i-1].nextSibling??void 0:n[s-i]:u;for(;i<s;)g(e,n[i++],d)}else if(s===i)for(;r<a;)(!c||!c.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[s-1]&&n[i]===t[a-1]){let d=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--s],d),t[a]=t[r-1]}else{if(!c){c=new Map;let y=i;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[r]);if(d!=null)if(i<d&&d<s){let y=r,$=1;for(;++y<a&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+$);)$++;if($>d-i){let ie=t[r];for(;i<d;)g(e,n[i++],ie)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],u),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function b(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){x.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 X(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 z(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 O(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,l.createRenderEffect)(()=>{let f=typeof n=="function"?n():n;T(e,t,f,o)})}function H(e,t,n){return typeof n!="function"?(v(e,t,n),()=>{}):(0,l.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;v(e,t,o)})}function J(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,l.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,l.createRenderEffect)(()=>L(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function C(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((0,l.createRenderEffect)(()=>{let s=!!f();for(let r of a)e.classList.toggle(r,s)}));else{let s=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,s)}}}function P(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 Pe(e){let{element:t,props:n,prevProps:o=xe,isSVG:f=!1,skipChildren:a=!1}=e;if(!t||!Z(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=f||t.namespaceURI===D,r=[];for(let i in n){if(a&&i==="children")continue;let u=n[i],c=o[i];if(u===c)continue;if(i==="ref"){U(u,t);continue}if(i==="use"){z(t,u);continue}if(i.startsWith("on:")){r.push(X(t,i.slice(3),u));continue}if(i.startsWith("prop:")){r.push(H(t,i.slice(5),u));continue}if(i.startsWith("attr:")){r.push(O(t,i.slice(5),u,s));continue}if(i.startsWith("bool:")){r.push(J(t,i.slice(5),u));continue}if(i==="class"||i==="className"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>L(t,u()))):L(t,u);continue}if(i==="classList"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>C(t,u()))):C(t,u,r);continue}if(i==="style"){typeof u=="function"?r.push((0,l.createRenderEffect)(()=>P(t,u()))):P(t,u);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();c&&B(t,y),u&&ne(t,y,u);continue}let d=W.has(i)||!s&&i in t;typeof u=="function"?r.push(d?H(t,i,u):O(t,i,u,s)):r.push((0,l.createRenderEffect)(()=>d?v(t,i,n[i]):T(t,i,n[i],s)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let u=i.slice(2).toLowerCase();B(t,u)}else W.has(i)?v(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function Me(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){U(f,e);continue}if(o!=="children"){if(o==="use"){z(e,f);continue}if(o.startsWith("on:")){X(e,o.slice(3),f);continue}if(o.startsWith("prop:")){H(e,o.slice(5),f);continue}if(o.startsWith("attr:")){O(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){J(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(j.has(a)){e[`$$${a}`]=f;let s=`__fx_${a}`;if(!e[s]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[s]=r}}else e[`$$${a}`]=f,R.has(a)||q([a]);continue}if(o==="class"||o==="className"){L(e,f);continue}if(o==="classList"){typeof f=="function"?(0,l.createRenderEffect)(()=>C(e,f())):C(e,f);continue}if(o==="style"){typeof f=="function"?(0,l.createRenderEffect)(()=>P(e,f())):P(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,l.onCleanup)(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,s=(0,l.createEffect)(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,l.onCleanup)(()=>{s()})}else{let a=!0;(0,l.createRenderEffect)(()=>{let s=t[o];a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof f=="function"){let a=(0,l.createEffect)(()=>{let s=f();for(;typeof s=="function"&&s.length===0;)s=s();F(e,o,s,n)});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>F(e,o,t[o],n))}}}function Re(...e){let t=o=>{for(let f=e.length-1;f>=0;f--){let a=e[f];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let f of e)if(f&&o in f)return!0;return!1};return new Proxy({},{get:(o,f)=>t(f),has:(o,f)=>n(f),ownKeys:()=>{let o=new Set;for(let f of e)if(f)for(let a of Reflect.ownKeys(f))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,f)=>n(f)?{enumerable:!0,configurable:!0,get:()=>t(f)}:void 0})}function Oe(e,...t){let n=new Set;for(let s of t)for(let r of s)n.add(r);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),f=t.map(s=>{let r=new Set(s);return new Proxy({},{get:(i,u)=>r.has(u)?e[u]:void 0,has:(i,u)=>r.has(u)&&u in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,u)=>r.has(u)&&u in e?o(u):void 0})}),a=new Proxy({},{get:(s,r)=>n.has(r)?void 0:e[r],has:(s,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,r)=>!n.has(r)&&r in e?o(r):void 0});return[...f,a]}function U(e,t){if(e){if(w(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 He(e,t,n){let o=t||document.body,f=(0,l.readChildren)(()=>e),a=[];return(0,l.batch)(()=>{let s=(0,l.createRenderEffect)(()=>{let r=f();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):w(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(s),(0,l.onCleanup)(()=>{a.forEach(r=>r())})}),null}function je(e){return typeof e=="string"&&e.toLowerCase()===e}function $e(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 _e(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function S(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function De(e){return typeof e=="function"&&e.length===0&&(0,p.isSignal)(e)}function Fe(e,t,n){if(!t)throw new Error("Container element is required");let o,f,a=[];return(0,l.createRoot)(s=>{(0,l.batch)(()=>{x.active||(t.textContent=""),G(t,e)}),f=s}),()=>{f?.(),o?.(),a.forEach(s=>s()),t.textContent=""}}
1
+ "use strict";var F=Object.defineProperty;var ae=Object.getOwnPropertyDescriptor;var le=Object.getOwnPropertyNames;var ue=Object.prototype.hasOwnProperty;var ce=(e,t)=>{for(var n in t)F(e,n,{get:t[n],enumerable:!0})},de=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of le(t))!ue.call(e,s)&&s!==n&&F(e,s,{get:()=>t[s],enumerable:!(o=ae(t,s))||o.enumerable});return e};var ye=e=>de(F({},"__esModule",{value:!0}),e);var Be={};ce(Be,{addDelegatedEventListener:()=>oe,addNativeEventListener:()=>z,applyProps:()=>$e,applyUse:()=>J,cleanChildren:()=>b,cloneTemplate:()=>re,createNativeElement:()=>Se,createPortal:()=>Fe,createTemplate:()=>ie,delegateEvents:()=>G,escapeHTML:()=>ke,fnName:()=>Pe,generateID:()=>Ee,getStableElementId:()=>me,handleRef:()=>Y,holeContent:()=>Le,holeEnd:()=>Ce,holeScope:()=>ve,insert:()=>X,insertExpression:()=>v,isAccessor:()=>Ke,isDelegatedEvent:()=>Te,isFunction:()=>we,isNativeElement:()=>We,isPromise:()=>A,isSVGElement:()=>Ie,iterateFn:()=>Me,makeArrayFlat:()=>se,mergeProps:()=>_e,removeDelegatedEventListener:()=>q,render:()=>Ve,setClassList:()=>P,setClassName:()=>L,setDynamicAttribute:()=>j,setDynamicBoolAttribute:()=>U,setDynamicProperty:()=>$,setProperty:()=>C,setStyle:()=>M,splitProps:()=>De,spread:()=>je,templateNode:()=>Ae});module.exports=ye(Be);var g=require("@fluixi/reactive/signal");var W="http://www.w3.org/2000/svg";function pe(e){return e.localName.includes("-")}function I(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(pe(e)){e[t]=n;return}T(e,t,n,o)}var k=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);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 Ge=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function x(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var u=require("@fluixi/reactive/signal");var w=typeof document>"u";var K=Symbol.for("fluixi.server-node"),Z=null;function R(){if(!Z)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Z}function S(e){return e!=null&&e[K]===!0?!0:typeof Node<"u"&&e instanceof Node}function Q(e){return e!=null&&e[K]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ee(e){return e!=null&&e[K]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var y={active:!1,cursor:null,parents:[]},ge=null;function O(){return ge}function V(e,t){return y.active&&t.parentNode===e}function te(e){let t=y.parents.lastIndexOf(e);t!==-1&&(y.parents.length=t),y.cursor=e.nextSibling}function B(e,t){if(!e||e.parentNode==null)return t();let n=y.active,o=y.cursor,s=y.parents;y.active=!0,y.cursor=e,y.parents=[];try{return t()}finally{y.active=n,y.cursor=o,y.parents=s}}function he(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function xe(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 me(e){return xe(he(e))}var Ee=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),be={};var ne=new Map,H=new Set,_=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function G(e){if(!w)for(let t of e)H.has(t)||_.has(t)||(H.add(t),document.addEventListener(t,Ne))}function Ne(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 oe(e,t,n){if(e[`$$${t}`]=n,_.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}H.has(t)||G([t])}function q(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Te(e){return!_.has(e)}function we(e){return typeof e=="function"}function N(e,t=!1){if(w)return R().createText(e);if(y.active&&!t){let n=O()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Se(e,t=!1){if(w)return R().createElement(e,t);if(y.active){let n=O()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(W,e):document.createElement(e)}function ie(e,t=!1){let n=ne.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ne.set(e,o),o}function Ae(e,t,n=!1,o=!1){if(w){let s=R();return n?s.parseTemplate(e,o):s.createRaw(e)}if(y.active){let s=O()?.hydrateStatic(t);if(s)return s}return re(ie(e,o),o).firstChild}function ve(e,t){if(!y.active)return t();let n=B(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>y.active?B(e.nextSibling,()=>o(...s)):o(...s))}return n}function Ce(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 Le(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function re(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function se(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?se(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Pe(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Me(e){if((0,g.isSignal)(e)||x(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,g.isSignal)(t)&&!x(t);)t=t();return t}var E=0,Re=200;function Oe(e,t,n,o,s){let a=o,f=new Map;return(0,u.createRenderEffect)(()=>{let r;if(x(e)&&!(0,g.isSignal)(e)){if(!f.has(e)){E++;try{let i=e();f.set(e,i)}finally{E--}}for(r=f.get(e);typeof r=="function"&&(0,g.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,g.isSignal)(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(x(r)){if(!f.has(r)){let l=r;E++;try{let c=l();f.set(l,c)}finally{E--}}r=f.get(r)}else if((0,g.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,g.isSignal)(r)&&!x(r))break}E++;try{a=v(t,r,n,a,f),s(a)}finally{E--}})}function X(e,t,n,o){if(E>Re)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{s=v(e,t,n,null)}finally{E--}return()=>s}let r=Oe(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function v(e,t,n,o,s){if(t==null||typeof t=="boolean")return b(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return b(e,o,n);if(A(t)){let f=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),b(e,o.slice(1),n)):h(e,f,n):o?e.replaceChild(f,o):h(e,f,n),t.then(r=>{f.parentNode===e&&v(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return h(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=b(e,o,n)}if(o&&ee(o))return o.data=t,o;let f=N(t);return o&&o.parentNode===e?e.replaceChild(f,o):V(e,f)||h(e,f,n),f}if(S(t))return V(e,t)?(te(t),t):Array.isArray(o)?(o.length===0?h(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),b(e,o.slice(1),n)):h(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,f,e,n,!0,s,i);let l=He(e,r,f,n);for(let c of i){let d=X(e,c.sig,c.marker);(0,u.onCleanup)(()=>{b(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;if("type"in f&&"props"in f){let r=f;if(typeof r.type=="function"){let i=r.type(r.props||{});return v(e,i,n,o)}}}return b(e,o,n)}function m(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!A(i)&&!(0,g.isSignal)(i)&&!x(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(x(i)&&!(0,g.isSignal)(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!A(l)&&!(0,g.isSignal)(l)&&!x(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,g.isSignal)(l)){if(f){let d=N("",!0);t.push(d),f.push({marker:d,sig:l});continue}let c=l();for(;typeof c=="function"&&(0,g.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?m(c,t,n,o,s,a):m([c],t,n,o,s,a);continue}continue}Array.isArray(l)?m(l,t,n,o,s,a,f):m([l],t,n,o,s,a,f);continue}if(A(i)){let l=N("",!0);t.push(l),i.then(c=>{if(l.parentNode){let d=[];if(m([c],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let p=1;p<d.length;p++)l.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(i)){m(i,t,n,o,s,a,f);continue}if(S(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let c=l.type(l.props||{});Array.isArray(c)?m(c,t,n,o,!1,a):m([c],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(N(l));continue}t.push(N(String(i)))}}}}function He(e,t,n,o){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 s=n.length,a=t.length,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let d=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)h(e,n[i++],d)}else if(f===i)for(;r<a;)(!c||!c.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let d=t[--a].nextSibling;h(e,n[i++],t[r++].nextSibling),h(e,n[--f],d),t[a]=t[r-1]}else{if(!c){c=new Map;let p=i;for(;p<f;)c.set(n[p],p++)}let d=c.get(t[r]);if(d!=null)if(i<d&&d<f){let p=r,D=1;for(;++p<a&&p<f&&!(!c.has(t[p])||c.get(t[p])!==d+D);)D++;if(D>d-i){let fe=t[r];for(;i<d;)h(e,n[i++],fe)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(h(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function b(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 h(e,t,n){y.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function C(e,t,n){n==null?delete e[t]:e[t]=n}function z(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 J(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 j(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,u.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function $(e,t,n){return typeof n!="function"?(C(e,t,n),()=>{}):(0,u.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;C(e,t,o)})}function U(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,u.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function L(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,u.createRenderEffect)(()=>L(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function P(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,u.createRenderEffect)(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function M(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 je(e){let{element:t,props:n,prevProps:o=be,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!Q(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===W,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],c=o[i];if(l===c)continue;if(i==="ref"){Y(l,t);continue}if(i==="use"){J(t,l);continue}if(i.startsWith("on:")){r.push(z(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push($(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(j(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(U(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>L(t,l()))):L(t,l);continue}if(i==="classList"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>P(t,l()))):P(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push((0,u.createRenderEffect)(()=>M(t,l()))):M(t,l);continue}if(i.startsWith("on")){let p=i.slice(2).toLowerCase();c&&q(t,p),l&&oe(t,p,l);continue}let d=k.has(i)||!f&&i in t;typeof l=="function"?r.push(d?$(t,i,l):j(t,i,l,f)):r.push((0,u.createRenderEffect)(()=>d?C(t,i,n[i]):T(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();q(t,l)}else k.has(i)?C(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function $e(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){Y(s,e);continue}if(o!=="children"){if(o==="use"){J(e,s);continue}if(o.startsWith("on:")){z(e,o.slice(3),s);continue}if(o.startsWith("prop:")){$(e,o.slice(5),s);continue}if(o.startsWith("attr:")){j(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){U(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(_.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,H.has(a)||G([a]);continue}if(o==="class"||o==="className"){L(e,s);continue}if(o==="classList"){typeof s=="function"?(0,u.createRenderEffect)(()=>P(e,s())):P(e,s);continue}if(o==="style"){typeof s=="function"?(0,u.createRenderEffect)(()=>M(e,s())):M(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});(0,u.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=(0,u.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,u.onCleanup)(()=>{f()})}else{let a=!0;(0,u.createRenderEffect)(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=(0,u.createEffect)(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();I(e,o,f,n)});(0,u.onCleanup)(()=>{a()})}else(0,u.createRenderEffect)(()=>I(e,o,t[o],n))}}}function _e(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function De(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);return new Proxy({},{get:(i,l)=>r.has(l)?e[l]:void 0,has:(i,l)=>r.has(l)&&l in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,l)=>r.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function Y(e,t){if(e){if(S(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 Fe(e,t,n){let o=t||document.body,s=(0,u.readChildren)(()=>e),a=[];return(0,u.batch)(()=>{let f=(0,u.createRenderEffect)(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):S(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),(0,u.onCleanup)(()=>{a.forEach(r=>r())})}),null}function We(e){return typeof e=="string"&&e.toLowerCase()===e}function Ie(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 ke(e){return e.replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#39;")}function A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ke(e){return typeof e=="function"&&e.length===0&&(0,g.isSignal)(e)}function Ve(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return(0,u.createRoot)(f=>{(0,u.batch)(()=>{y.active||(t.textContent=""),X(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}
@@ -52,6 +52,54 @@ export declare function isDelegatedEvent(name: string): boolean;
52
52
  export declare function isFunction(value: any): value is Function;
53
53
  export declare function createNativeElement(tag: string, isSVG?: boolean): Element;
54
54
  export declare function createTemplate(html: string, isSVG?: boolean): HTMLTemplateElement;
55
+ /**
56
+ * A node for a compiler-emitted static template, built the way the current environment
57
+ * needs it.
58
+ *
59
+ * The three cases mirror {@link createNativeElement}, which is the point: a template has
60
+ * to behave like the elements it replaces, or it works only in client-rendered apps —
61
+ * which is exactly how it failed before this existed.
62
+ *
63
+ * - **server** — carried as text and written out verbatim. Parsing it into elements
64
+ * only to serialize them straight back would be pure cost.
65
+ * - **hydrating** — adopt the server's existing subtree and skip past it. The subtree
66
+ * is inert, so there is nothing inside to wire up.
67
+ * - **client** — parse once (cached by HTML) and clone per instance.
68
+ */
69
+ export declare function templateNode(html: string, tag: string, holes?: boolean, isSVG?: boolean): Node;
70
+ /**
71
+ * Evaluate a hole's content with the hydration cursor placed at what the server rendered
72
+ * for *that hole*.
73
+ *
74
+ * Without this, only the hole's top level adopts. `templateNode` moves the cursor past the
75
+ * whole template — the subtree is inert, so there is nothing in it to walk — which leaves
76
+ * the cursor in the wrong place for anything the hole builds internally. A component in a
77
+ * hole would then recreate its own elements: no duplication, but every server node thrown
78
+ * away, which is most of what hydration is for.
79
+ *
80
+ * The markers make the position exact: the content starts immediately after `start`.
81
+ */
82
+ export declare function holeScope<T>(start: Node, produce: () => T): T;
83
+ /**
84
+ * The closing marker for a hole opened at `start`.
85
+ *
86
+ * Found by scanning rather than by position: on a fresh clone it is the very next node,
87
+ * but the server's DOM has the rendered content in between, and hydration walks that DOM.
88
+ * Scanning is what makes one set of generated references work in both.
89
+ */
90
+ export declare function holeEnd(start: Node): Node;
91
+ /**
92
+ * The nodes a hole already contains, for `insert` to reconcile against.
93
+ *
94
+ * On a fresh clone the markers are adjacent and this is empty, so `insert` builds the
95
+ * content. When hydrating, the server's rendered content sits between them and is handed
96
+ * back — `insertExpression` then reuses those nodes (setting `.data` on a text node
97
+ * rather than creating one), which is what adoption means here.
98
+ *
99
+ * Paired markers are what make this exact: a hole's content is *by definition* the nodes
100
+ * between its own two markers, with no dependence on the hydration cursor's position.
101
+ */
102
+ export declare function holeContent(start: Node, end: Node): Node[];
55
103
  export declare function cloneTemplate(template: HTMLTemplateElement, isSVG?: boolean): DocumentFragment | Element;
56
104
  export declare function makeArrayFlat(values: any[]): any;
57
105
  export declare function fnName(fn: Function): any;