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