@fluixi/dom 1.0.0-alpha.63 → 1.0.0-alpha.64
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/index.cjs +1 -1
- package/dist/lib/dom/index.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 +3 -9
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/element/attributes.d.ts +1 -1
- package/dist/lib/element/attributes.d.ts.map +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 +3 -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"]),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
|
+
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 I,createRenderEffect as p,createRoot as Kt,onCleanup as R,readChildren as zt}from"@fluixi/reactive/signal";var x=typeof document>"u";function P(e){x=e}var O=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[O]===!0?!0:typeof Node<"u"&&e instanceof Node}function ye(e){return e!=null&&e[O]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function me(e){return e!=null&&e[O]===!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 $(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 p(()=>{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 y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){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 y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,ae=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==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 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),()=>{}):p(()=>{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),()=>{}):p(()=>{let r=typeof n=="function"?n():n;k(e,t,r)})}function nt(e,t,n){return typeof n!="function"?(m(e,t,!!n),()=>{}):p(()=>{let r=n();m(e,t,!!r)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>D(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function 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(p(()=>{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"){_(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(p(()=>D(t,c()))):D(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>J(t,c()))):J(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Y(t,c()))):Y(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&X(t,y),c&&be(t,y,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(p(()=>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 ue.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,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"){D(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>J(e,o())):J(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Y(e,o())):Y(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=I(()=>{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=I(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=I(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=I(()=>{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;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=I(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ce(e,r,s,n)});R(()=>{i()})}else p(()=>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 _(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=p(()=>{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 $(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 $(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)&&_(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=O;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:k,setDynamicProperty:j,setAttribute:m,setDynamicAttribute:q,removeAttribute:Ue,getAttribute:Ve,setClassName:D,addClass:je,removeClass:Fe,toggleClass:He,setStyles:fe,delegateEvents:Q,addDelegatedEventListener:be,removeDelegatedEventListener:X,handleRef:_,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,_ as handleRef,sr as hasClass,pn as html,U as hydrate,$ 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,D as setClassName,Mt as setDataRedactor,q as setDynamicAttribute,nt as setDynamicBoolAttribute,j as setDynamicProperty,k 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};
|
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 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}`})})}
|
|
1
|
+
"use strict";var G=Object.defineProperty;var Ie=Object.getOwnPropertyDescriptor;var $e=Object.getOwnPropertyNames;var De=Object.prototype.hasOwnProperty;var Oe=(e,t)=>{for(var n in t)G(e,n,{get:t[n],enumerable:!0})},ke=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of $e(t))!De.call(e,r)&&r!==n&&G(e,r,{get:()=>t[r],enumerable:!(o=Ie(t,r))||o.enumerable});return e};var He=e=>ke(G({},"__esModule",{value:!0}),e);var on={};Oe(on,{Island:()=>Pe,JSX_PROPERTIES:()=>D,SVG_ELEMENTS:()=>Ke,SVG_NAMESPACE:()=>I,VOID_ELEMENTS:()=>Ve,addClass:()=>Je,addDelegatedEventListener:()=>Se,addNativeEventListener:()=>ne,appendChildren:()=>nt,applyElementProp:()=>$,applyProps:()=>It,applyUse:()=>oe,captureHydrationCursor:()=>Ee,cleanChildren:()=>T,cloneTemplate:()=>Ct,closest:()=>Ge,createComponent:()=>Kt,createElement:()=>et,createNativeElement:()=>te,createPortal:()=>Ot,createTemplate:()=>vt,delegate:()=>st,delegateEvents:()=>ee,escapeHTML:()=>jt,fnName:()=>At,generateID:()=>bt,getAttribute:()=>Ye,getGlobal:()=>gt,getLitEventName:()=>Fe,getOffset:()=>it,getStableElementId:()=>Et,getStyle:()=>Qe,handleRef:()=>ie,hasClass:()=>Ue,hydrate:()=>K,hydrateAdvancePast:()=>Te,hydrateIslands:()=>Me,initializeIntegration:()=>Vt,insert:()=>C,insertExpression:()=>R,intergartionInitialized:()=>Bt,isAccessor:()=>qt,isCustomElement:()=>de,isDOMNode:()=>yt,isDelegatedEvent:()=>wt,isDomElement:()=>O,isDomNode:()=>S,isDomText:()=>k,isEventHandler:()=>qe,isFunction:()=>St,isIntegrationInitialized:()=>Gt,isJSXTemplate:()=>pt,isLitTemplateResult:()=>ye,isNativeElement:()=>kt,isPromise:()=>A,isReactElement:()=>ct,isSVGElement:()=>Ht,isServer:()=>E,isTemplateFactory:()=>dt,isVisible:()=>ot,iterateFn:()=>Rt,makeArrayFlat:()=>ve,mergeProps:()=>$t,observeIntersection:()=>ft,observeResize:()=>ut,query:()=>J,queryAll:()=>Be,registerCreateComponent:()=>Wt,registerGlobal:()=>mt,removeAttribute:()=>Ze,removeChildren:()=>tt,removeClass:()=>Xe,removeDelegatedEventListener:()=>Q,render:()=>se,resetIntegration:()=>Jt,runHydrationAt:()=>be,runWithoutHydration:()=>Ne,scrollIntoView:()=>rt,setAttribute:()=>x,setClassList:()=>M,setClassName:()=>P,setDynamicAttribute:()=>j,setDynamicBoolAttribute:()=>re,setDynamicProperty:()=>q,setProperty:()=>L,setServerMode:()=>ge,setStyle:()=>_,setStyles:()=>pe,shouldSetAsProperty:()=>We,splitProps:()=>Dt,spread:()=>_t,toAttributeName:()=>je,toggleClass:()=>ze,waitForElement:()=>at});module.exports=He(on);function je(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function qe(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Fe(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function We(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var Ve=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ke=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),I="http://www.w3.org/2000/svg";function de(e){return e.localName.includes("-")}function $(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(de(e)){e[t]=n;return}x(e,t,n,o)}var D=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function J(e,t=document){return t.querySelector(e)}function Be(e,t=document){return Array.from(t.querySelectorAll(e))}function Ge(e,t){return e.closest(t)}function Je(e,...t){e.classList.add(...t)}function Xe(e,...t){e.classList.remove(...t)}function ze(e,...t){t.forEach(n=>e.classList.toggle(n))}function Ue(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ye(e,t){return e.getAttribute(t)}function Ze(e,t){e.removeAttribute(t)}function pe(e,t){Object.assign(e.style,t)}function Qe(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function et(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")pe(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function tt(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function nt(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function ot(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function rt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function it(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function st(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function at(e,t=5e3){return new Promise((n,o)=>{let r=J(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=J(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function ft(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function ut(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var lt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ct(e){return typeof e=="object"&&e!==null&&e.$$typeof===lt}function ye(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function dt(e){if(typeof e!="function")return!1;try{let t=e();return ye(t)}catch{return!1}}function pt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function yt(e){return e instanceof Node}function mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function gt(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var m=require("@fluixi/reactive/signal");function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var E=typeof document>"u";function ge(e){E=e}var X=Symbol.for("fluixi.server-node"),me=null;function z(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function S(e){return e!=null&&e[X]===!0?!0:typeof Node<"u"&&e instanceof Node}function O(e){return e!=null&&e[X]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function k(e){return e!=null&&e[X]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},xe=null;function he(e){xe=e}function U(){return xe}function Y(e,t){return l.active&&t.parentNode===e}function Z(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ee(){return l.active?l.cursor:null}function be(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Ne(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Te(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Z(t)}function xt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ht(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Et(e){return ht(xt(e))}var bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Nt={};var we=new Map,H=new Set,F=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ee(e){if(!E)for(let t of e)H.has(t)||F.has(t)||(H.add(t),document.addEventListener(t,Tt))}function Tt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Se(e,t,n){if(e[`$$${t}`]=n,F.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}H.has(t)||ee([t])}function Q(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function wt(e){return!F.has(e)}function St(e){return typeof e=="function"}function w(e,t=!1){if(E)return z().createText(e);if(l.active&&!t){let n=U()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function te(e,t=!1){if(E)return z().createElement(e,t);if(l.active){let n=U()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(I,e):document.createElement(e)}function vt(e,t=!1){let n=we.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,we.set(e,o),o}function Ct(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function ve(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?ve(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function At(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Rt(e){if((0,m.isSignal)(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,m.isSignal)(t)&&!h(t);)t=t();return t}var N=0,Lt=200;function Pt(e,t,n,o,r){let f=o,s=new Map;return(0,c.createRenderEffect)(()=>{let i;if(h(e)&&!(0,m.isSignal)(e)){if(!s.has(e)){N++;try{let a=e();s.set(e,a)}finally{N--}}for(i=s.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;N++;try{let d=u();s.set(u,d)}finally{N--}}i=s.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!h(i))break}N++;try{f=R(t,i,n,f,s),r(f)}finally{N--}})}function C(e,t,n,o){if(N>Lt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){N++;try{r=R(e,t,n,null)}finally{N--}return()=>r}let i=Pt(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function R(e,t,n,o,r){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(A(t)){let s=w("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),T(e,o.slice(1),n)):g(e,s,n):o?e.replaceChild(s,o):g(e,s,n),t.then(i=>{s.parentNode===e&&R(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=w(t);return g(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&k(o))return o.data=t,o;let s=w(t);return o&&o.parentNode===e?e.replaceChild(s,o):Y(e,s)||g(e,s,n),s}if(S(t))return Y(e,t)?(Z(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];b(t,s,e,n,!0,r,a);let u=Mt(e,i,s,n);for(let d of a){let p=C(e,d.sig,d.marker);(0,c.onCleanup)(()=>{T(e,p()),d.marker.parentNode===e&&e.removeChild(d.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return R(e,a,n,o)}}}return T(e,o,n)}function b(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!A(a)&&!(0,m.isSignal)(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!(0,m.isSignal)(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!A(u)&&!(0,m.isSignal)(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(s){let p=w("",!0);t.push(p),s.push({marker:p,sig:u});continue}let d=u();for(;typeof d=="function"&&(0,m.isSignal)(d);)d=d();if(d==null||typeof d=="boolean")continue;Array.isArray(d)?b(d,t,n,o,r,f):b([d],t,n,o,r,f);continue}continue}Array.isArray(u)?b(u,t,n,o,r,f,s):b([u],t,n,o,r,f,s);continue}if(A(a)){let u=w("",!0);t.push(u),a.then(d=>{if(u.parentNode){let p=[];if(b([d],p,u.parentNode,void 0,!1,f),p.length>0){u.parentNode.replaceChild(p[0],u);for(let y=1;y<p.length;y++)u.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(d=>console.error("Error resolving promise in array:",d));continue}if(Array.isArray(a)){b(a,t,n,o,r,f,s);continue}if(S(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let d=u.type(u.props||{});Array.isArray(d)?b(d,t,n,o,!1,f):b([d],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(w(u));continue}t.push(w(String(a)))}}}}function Mt(e,t,n,o){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,d=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let p=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)g(e,n[a++],p)}else if(s===a)for(;i<f;)(!d||!d.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let p=t[--f].nextSibling;g(e,n[a++],t[i++].nextSibling),g(e,n[--s],p),t[f]=t[i-1]}else{if(!d){d=new Map;let y=a;for(;y<s;)d.set(n[y],y++)}let p=d.get(t[i]);if(p!=null)if(a<p&&p<s){let y=i,B=1;for(;++y<f&&y<s&&!(!d.has(t[y])||d.get(t[y])!==p+B);)B++;if(B>p-a){let _e=t[i];for(;a<p;)g(e,n[a++],_e)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(g(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function L(e,t,n){n==null?delete e[t]:e[t]=n}function ne(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function oe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function j(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function q(e,t,n){return typeof n!="function"?(L(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;L(e,t,o)})}function re(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();x(e,t,!!o)})}function P(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>P(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function M(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function _(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function _t(e){let{element:t,props:n,prevProps:o=Nt,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!O(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===I,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],d=o[a];if(u===d)continue;if(a==="ref"){ie(u,t);continue}if(a==="use"){oe(t,u);continue}if(a.startsWith("on:")){i.push(ne(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(q(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(j(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(re(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>P(t,u()))):P(t,u);continue}if(a==="classList"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>M(t,u()))):M(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push((0,c.createRenderEffect)(()=>_(t,u()))):_(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();d&&Q(t,y),u&&Se(t,y,u);continue}let p=D.has(a)||!s&&a in t;typeof u=="function"?i.push(p?q(t,a,u):j(t,a,u,s)):i.push((0,c.createRenderEffect)(()=>p?L(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();Q(t,u)}else D.has(a)?L(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function It(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){ie(r,e);continue}if(o!=="children"){if(o==="use"){oe(e,r);continue}if(o.startsWith("on:")){ne(e,o.slice(3),r);continue}if(o.startsWith("prop:")){q(e,o.slice(5),r);continue}if(o.startsWith("attr:")){j(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){re(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(F.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,H.has(f)||ee([f]);continue}if(o==="class"||o==="className"){P(e,r);continue}if(o==="classList"){typeof r=="function"?(0,c.createRenderEffect)(()=>M(e,r())):M(e,r);continue}if(o==="style"){typeof r=="function"?(0,c.createRenderEffect)(()=>_(e,r())):_(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});(0,c.onCleanup)(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=(0,c.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{s()})}else{let f=!0;(0,c.createRenderEffect)(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=(0,c.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();$(e,o,s,n)});(0,c.onCleanup)(()=>{f()})}else(0,c.createRenderEffect)(()=>$(e,o,t[o],n))}}}function $t(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function Dt(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function ie(e,t){if(e){if(S(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function Ot(e,t,n){let o=t||document.body,r=(0,c.readChildren)(()=>e),f=[];return(0,c.batch)(()=>{let s=(0,c.createRenderEffect)(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):S(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),(0,c.onCleanup)(()=>{f.forEach(i=>i())})}),null}function kt(e){return typeof e=="string"&&e.toLowerCase()===e}function Ht(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function jt(e){return e.replace(/&/g,"&").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}`})})}
|
package/dist/lib/dom/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function nt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ot(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function it(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var st=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),at=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),j="http://www.w3.org/2000/svg";function Te(e){return e.localName.includes("-")}function q(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Te(e)){e[t]=n;return}x(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function oe(e,t=document){return t.querySelector(e)}function ft(e,t=document){return Array.from(t.querySelectorAll(e))}function ut(e,t){return e.closest(t)}function lt(e,...t){e.classList.add(...t)}function ct(e,...t){e.classList.remove(...t)}function dt(e,...t){t.forEach(n=>e.classList.toggle(n))}function pt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function yt(e,t){return e.getAttribute(t)}function mt(e,t){e.removeAttribute(t)}function we(e,t){Object.assign(e.style,t)}function gt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function xt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")we(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ht(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Et(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function bt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Tt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function wt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function St(e,t=5e3){return new Promise((n,o)=>{let r=oe(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=oe(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function vt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Ct(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function At(e){return typeof e=="object"&&e!==null&&e.$$typeof===Se}function ve(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Rt(e){if(typeof e!="function")return!1;try{let t=e();return ve(t)}catch{return!1}}function Lt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Pt(e){return e instanceof Node}function Mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _t(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ue,createEffect as A,createRenderEffect as y,createRoot as Me,onCleanup as S,readChildren as _e}from"@fluixi/reactive/signal";var N=typeof document>"u";function Ce(e){N=e}var W=Symbol.for("fluixi.server-node"),re=null;function V(){if(!re)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return re}function C(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function K(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function B(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ie=null;function se(e){ie=e}function G(){return ie}function J(e,t){return l.active&&t.parentNode===e}function X(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function Re(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Le(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Pe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&X(t)}function Ie(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function $e(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Kt(e){return $e(Ie(e))}var Bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),De={};var ae=new Map,P=new Set,O=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function le(e){if(!N)for(let t of e)P.has(t)||O.has(t)||(P.add(t),document.addEventListener(t,Oe))}function Oe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ke(e,t,n){if(e[`$$${t}`]=n,O.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}P.has(t)||le([t])}function fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Gt(e){return!O.has(e)}function Jt(e){return typeof e=="function"}function T(e,t=!1){if(N)return V().createText(e);if(l.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ce(e,t=!1){if(N)return V().createElement(e,t);if(l.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(j,e):document.createElement(e)}function Xt(e,t=!1){let n=ae.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ae.set(e,o),o}function zt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function He(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?He(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ut(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yt(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var b=0,je=200;function qe(e,t,n,o,r){let f=o,s=new Map;return y(()=>{let i;if(h(e)&&!g(e)){if(!s.has(e)){b++;try{let a=e();s.set(e,a)}finally{b--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;b++;try{let c=u();s.set(u,c)}finally{b--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!h(i))break}b++;try{f=M(t,i,n,f,s),r(f)}finally{b--}})}function R(e,t,n,o){if(b>je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){b++;try{r=M(e,t,n,null)}finally{b--}return()=>r}let i=qe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function M(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&M(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=T(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&B(o))return o.data=t,o;let s=T(t);return o&&o.parentNode===e?e.replaceChild(s,o):J(e,s)||m(e,s,n),s}if(C(t))return J(e,t)?(X(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];E(t,s,e,n,!0,r,a);let u=Fe(e,i,s,n);for(let c of a){let d=R(e,c.sig,c.marker);S(()=>{w(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return M(e,a,n,o)}}}return w(e,o,n)}function E(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!g(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=T("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,r,f):E([c],t,n,o,r,f);continue}continue}Array.isArray(u)?E(u,t,n,o,r,f,s):E([u],t,n,o,r,f,s);continue}if(L(a)){let u=T("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(E([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let p=1;p<d.length;p++)u.parentNode?.insertBefore(d[p],d[p-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){E(a,t,n,o,r,f,s);continue}if(C(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?E(c,t,n,o,!1,f):E([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(T(u));continue}t.push(T(String(a)))}}}}function Fe(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let p=a;for(;p<s;)c.set(n[p],p++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let p=i,H=1;for(;++p<f&&p<s&&!(!c.has(t[p])||c.get(t[p])!==d+H);)H++;if(H>d-a){let Ne=t[i];for(;a<d;)m(e,n[a++],Ne)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function _(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function pe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function z(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):y(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function U(e,t,n){return typeof n!="function"?(_(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;_(e,t,o)})}function ye(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):y(()=>{let o=n();x(e,t,!!o)})}function I(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){A(()=>{I(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(y(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function D(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Zt(e){let{element:t,props:n,prevProps:o=De,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!K(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===j,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){me(u,t);continue}if(a==="use"){pe(t,u);continue}if(a.startsWith("on:")){i.push(de(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(U(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(z(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ye(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(y(()=>I(t,u()))):I(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(y(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(y(()=>D(t,u()))):D(t,u);continue}if(a.startsWith("on")){let p=a.slice(2).toLowerCase();c&&fe(t,p),u&&ke(t,p,u);continue}let d=F.has(a)||!s&&a in t;typeof u=="function"?i.push(d?U(t,a,u):z(t,a,u,s)):i.push(y(()=>d?_(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();fe(t,u)}else F.has(a)?_(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Qt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){me(r,e);continue}if(o!=="children"){if(o==="use"){pe(e,r);continue}if(o.startsWith("on:")){de(e,o.slice(3),r);continue}if(o.startsWith("prop:")){U(e,o.slice(5),r);continue}if(o.startsWith("attr:")){z(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ye(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(O.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,P.has(f)||le([f]);continue}if(o==="class"||o==="className"){I(e,r);continue}if(o==="classList"){typeof r=="function"?y(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?y(()=>D(e,r())):D(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});S(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});S(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});S(()=>{f()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=A(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{s()})}else{let f=!0;y(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();q(e,o,s,n)});S(()=>{f()})}else y(()=>q(e,o,t[o],n))}}}function en(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function tn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function me(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function nn(e,t,n){let o=t||document.body,r=_e(()=>e),f=[];return ue(()=>{let s=y(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):C(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),S(()=>{f.forEach(i=>i())})}),null}function on(e){return typeof e=="string"&&e.toLowerCase()===e}function rn(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function sn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function an(e){return typeof e=="function"&&e.length===0&&g(e)}function ge(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return Me(s=>{ue(()=>{l.active||(t.textContent=""),R(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var We="__fx_dom_create_component__",v=globalThis[We]??={fn:null};function un(e){v.fn=e}function ln(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function cn(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var dn=()=>v.fn!==null,pn=()=>v.fn!==null;function yn(){v.fn=null}var k,Ve={getStore:()=>k,run(e,t){let n=k;k=e;try{return t()}finally{k=n}}},Ke=Ve;function xe(){return Ke.getStore()}import{setResourceIdSource as Ge,setServerDataGetter as Je}from"@fluixi/reactive/signal";var Be="__FX_DATA__";var Y;function he(){let e=globalThis.__FX_DATA__;if(e)return e;if(Y!==void 0)return Y;let t=null;if(typeof document<"u"){let n=document.getElementById(Be)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Y=t}function Z(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=typeof process<"u"&&process.env&&!1;function ee(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ze(e){Z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Xe.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(Q&&t&&ee(`<${e}>`,t),null)}function Ue(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}Z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Q&&t&&ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ye(e){Z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(Q&&t&&ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ee=!1;function Ze(){Ee||(Ee=!0,se({hydrateElement:ze,hydrateText:Ue,hydrateMarker:Ye}))}function te(e,t,n){Ze(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=he(),r=n?.resourceNamespace,f=0;Ge(()=>r?`${r}:r${f++}`:`r${f++}`),Je(o?s=>s in o?{value:o[s]}:void 0:null);try{return ge(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ne="fluixi-island";function Qe(e){let{component:t,props:n={},name:o}=e,r=ce(ne),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=N?xe():void 0;if(s){let i=s.nextIslandNamespace(f);R(r,()=>s.withResourceScope(i,()=>t(n)))}else R(r,()=>t(n));return r}var be=!1;function et(){if(be||typeof document>"u")return;be=!0;let e=document.createElement("style");e.textContent=`${ne}{display:contents}`,document.head.appendChild(e)}function tt(e){if(typeof document>"u")return;et();let t=document.querySelectorAll(ne),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}te(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{Qe as Island,F as JSX_PROPERTIES,at as SVG_ELEMENTS,j as SVG_NAMESPACE,st as VOID_ELEMENTS,lt as addClass,ke as addDelegatedEventListener,de as addNativeEventListener,Et as appendChildren,q as applyElementProp,Qt as applyProps,pe as applyUse,Ae as captureHydrationCursor,w as cleanChildren,zt as cloneTemplate,ut as closest,cn as createComponent,xt as createElement,ce as createNativeElement,nn as createPortal,Xt as createTemplate,wt as delegate,le as delegateEvents,sn as escapeHTML,Ut as fnName,Bt as generateID,yt as getAttribute,_t as getGlobal,rt as getLitEventName,Tt as getOffset,Kt as getStableElementId,gt as getStyle,me as handleRef,pt as hasClass,te as hydrate,Pe as hydrateAdvancePast,tt as hydrateIslands,ln as initializeIntegration,R as insert,M as insertExpression,dn as intergartionInitialized,an as isAccessor,Te as isCustomElement,Pt as isDOMNode,Gt as isDelegatedEvent,K as isDomElement,C as isDomNode,B as isDomText,ot as isEventHandler,Jt as isFunction,pn as isIntegrationInitialized,Lt as isJSXTemplate,ve as isLitTemplateResult,on as isNativeElement,L as isPromise,At as isReactElement,rn as isSVGElement,N as isServer,Rt as isTemplateFactory,bt as isVisible,Yt as iterateFn,He as makeArrayFlat,en as mergeProps,vt as observeIntersection,Ct as observeResize,oe as query,ft as queryAll,un as registerCreateComponent,Mt as registerGlobal,mt as removeAttribute,ht as removeChildren,ct as removeClass,fe as removeDelegatedEventListener,ge as render,yn as resetIntegration,Re as runHydrationAt,Le as runWithoutHydration,Nt as scrollIntoView,x as setAttribute,$ as setClassList,I as setClassName,z as setDynamicAttribute,ye as setDynamicBoolAttribute,U as setDynamicProperty,_ as setProperty,Ce as setServerMode,D as setStyle,we as setStyles,it as shouldSetAsProperty,tn as splitProps,Zt as spread,nt as toAttributeName,dt as toggleClass,St as waitForElement};
|
|
1
|
+
function nt(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function ot(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rt(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function it(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),o={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||o[e]&&o[e].has(t)}var st=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),at=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),j="http://www.w3.org/2000/svg";function Te(e){return e.localName.includes("-")}function q(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Te(e)){e[t]=n;return}x(e,t,n,o)}var F=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function oe(e,t=document){return t.querySelector(e)}function ft(e,t=document){return Array.from(t.querySelectorAll(e))}function ut(e,t){return e.closest(t)}function lt(e,...t){e.classList.add(...t)}function ct(e,...t){e.classList.remove(...t)}function dt(e,...t){t.forEach(n=>e.classList.toggle(n))}function pt(e,t){return e.classList.contains(t)}function x(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function yt(e,t){return e.getAttribute(t)}function mt(e,t){e.removeAttribute(t)}function we(e,t){Object.assign(e.style,t)}function gt(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function xt(e,t={},...n){let o=document.createElement(e);return Object.entries(t).forEach(([r,f])=>{if(r==="class"||r==="className")o.className=f;else if(r==="style"&&typeof f=="object")we(o,f);else if(r.startsWith("on")&&typeof f=="function"){let s=r.slice(2).toLowerCase();o.addEventListener(s,f)}else x(o,r,f)}),n.forEach(r=>{typeof r=="string"?o.appendChild(document.createTextNode(r)):o.appendChild(r)}),o}function ht(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Et(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function bt(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Nt(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Tt(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function wt(e,t,n,o){let r=f=>{let s=f.target.closest(n);s&&e.contains(s)&&o(f,s)};return e.addEventListener(t,r),()=>{e.removeEventListener(t,r)}}function St(e,t=5e3){return new Promise((n,o)=>{let r=oe(e);if(r){n(r);return}let f=new MutationObserver(()=>{let i=oe(e);i&&(f.disconnect(),clearTimeout(s),n(i))});f.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{f.disconnect(),o(new Error(`Element ${e} not found within ${t}ms`))},t)})}function vt(e,t,n={}){let o=new IntersectionObserver(r=>{r.forEach(f=>{t(f.isIntersecting)})},n);return o.observe(e),()=>{o.disconnect()}}function Ct(e,t){let n=new ResizeObserver(o=>{o.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function At(e){return typeof e=="object"&&e!==null&&e.$$typeof===Se}function ve(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Rt(e){if(typeof e!="function")return!1;try{let t=e();return ve(t)}catch{return!1}}function Lt(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Pt(e){return e instanceof Node}function Mt(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function _t(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ue,createEffect as A,createRenderEffect as p,createRoot as Me,onCleanup as S,readChildren as _e}from"@fluixi/reactive/signal";var N=typeof document>"u";function Ce(e){N=e}var W=Symbol.for("fluixi.server-node"),re=null;function V(){if(!re)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return re}function C(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function K(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function B(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var l={active:!1,cursor:null,parents:[]},ie=null;function se(e){ie=e}function G(){return ie}function J(e,t){return l.active&&t.parentNode===e}function X(e){let t=l.parents.lastIndexOf(e);t!==-1&&(l.parents.length=t),l.cursor=e.nextSibling}function Ae(){return l.active?l.cursor:null}function Re(e,t){if(!e||e.parentNode==null)return t();let n=l.active,o=l.cursor,r=l.parents;l.active=!0,l.cursor=e,l.parents=[];try{return t()}finally{l.active=n,l.cursor=o,l.parents=r}}function Le(e){if(!l.active)return e();let t=l.cursor,n=l.parents;l.active=!1,l.parents=[];try{return e()}finally{l.active=!0,l.cursor=t,l.parents=n}}function Pe(e){if(!l.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&X(t)}function Ie(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,r=e;for(;r=r.previousElementSibling;)r.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function $e(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Kt(e){return $e(Ie(e))}var Bt=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),De={};var ae=new Map,P=new Set,O=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function le(e){if(!N)for(let t of e)P.has(t)||O.has(t)||(P.add(t),document.addEventListener(t,Oe))}function Oe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function ke(e,t,n){if(e[`$$${t}`]=n,O.has(t)){let o=`__fx_${t}`;if(!e[o]){let r=f=>{e[`$$${t}`]?.(f)};e.addEventListener(t,r),e[o]=r}return}P.has(t)||le([t])}function fe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function Gt(e){return!O.has(e)}function Jt(e){return typeof e=="function"}function T(e,t=!1){if(N)return V().createText(e);if(l.active&&!t){let n=G()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ce(e,t=!1){if(N)return V().createElement(e,t);if(l.active){let n=G()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(j,e):document.createElement(e)}function Xt(e,t=!1){let n=ae.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ae.set(e,o),o}function zt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function He(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?He(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ut(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yt(e){if(g(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!h(t);)t=t();return t}var b=0,je=200;function qe(e,t,n,o,r){let f=o,s=new Map;return p(()=>{let i;if(h(e)&&!g(e)){if(!s.has(e)){b++;try{let a=e();s.set(e,a)}finally{b--}}for(i=s.get(e);typeof i=="function"&&g(i);)i=i()}else for(i=e();typeof i=="function"&&g(i);)i=i();{let a=0;for(;typeof i=="function"&&a++<50;)if(h(i)){if(!s.has(i)){let u=i;b++;try{let c=u();s.set(u,c)}finally{b--}}i=s.get(i)}else if(g(i))i=i();else if(i=i(),typeof i!="function"||!g(i)&&!h(i))break}b++;try{f=M(t,i,n,f,s),r(f)}finally{b--}})}function R(e,t,n,o){if(b>je)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=T("",!0),e.appendChild(n));let r=o??null,f=a=>Array.isArray(a)&&a.some(u=>typeof u=="function"),s=a=>typeof a=="function"?a:()=>a;if(typeof t!="function"&&!f(t)){b++;try{r=M(e,t,n,null)}finally{b--}return()=>r}let i=qe(s(t),e,n,r,a=>{r=a});return()=>(i?.(),r)}function M(e,t,n,o,r){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(L(t)){let s=T("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(s,o[0]),w(e,o.slice(1),n)):m(e,s,n):o?e.replaceChild(s,o):m(e,s,n),t.then(i=>{s.parentNode===e&&M(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let f=typeof t;if(f==="string"||f==="number"){if(f==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=T(t);return m(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&B(o))return o.data=t,o;let s=T(t);return o&&o.parentNode===e?e.replaceChild(s,o):J(e,s)||m(e,s,n),s}if(C(t))return J(e,t)?(X(t),t):Array.isArray(o)?(o.length===0?m(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):m(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):m(e,t,n)):m(e,t,n),t);if(Array.isArray(t)){let s=[],i=Array.isArray(o)?o:o?[o]:[],a=[];E(t,s,e,n,!0,r,a);let u=Fe(e,i,s,n);for(let c of a){let d=R(e,c.sig,c.marker);S(()=>{w(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(f==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let a=i.type(i.props||{});return M(e,a,n,o)}}}return w(e,o,n)}function E(e,t,n,o,r=!0,f,s){for(let i=0;i<e.length;i++){let a=e[i];if(!(a==null||typeof a=="boolean")){for(;typeof a=="function"&&!L(a)&&!g(a)&&!h(a)&&(a=a(),!(a==null||typeof a=="boolean")););if(!(a==null||typeof a=="boolean")){if(typeof a=="function"){let u;for(h(a)&&!g(a)?(f||(f=new Map),f.has(a)||f.set(a,a()),u=f.get(a)):u=a();typeof u=="function"&&!L(u)&&!g(u)&&!h(u);)f||(f=new Map),f.has(u)||f.set(u,u()),u=f.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if(g(u)){if(s){let d=T("",!0);t.push(d),s.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&g(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?E(c,t,n,o,r,f):E([c],t,n,o,r,f);continue}continue}Array.isArray(u)?E(u,t,n,o,r,f,s):E([u],t,n,o,r,f,s);continue}if(L(a)){let u=T("",!0);t.push(u),a.then(c=>{if(u.parentNode){let d=[];if(E([c],d,u.parentNode,void 0,!1,f),d.length>0){u.parentNode.replaceChild(d[0],u);for(let y=1;y<d.length;y++)u.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(c=>console.error("Error resolving promise in array:",c));continue}if(Array.isArray(a)){E(a,t,n,o,r,f,s);continue}if(C(a)){t.push(a);continue}if(typeof a=="object"&&a!==null&&"type"in a&&"props"in a){let u=a;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?E(c,t,n,o,!1,f):E([c],t,n,o,!1,f);continue}}if(typeof a=="string"||typeof a=="number"){let u=String(a);if(u.trim()===""&&u!==" ")continue;t.push(T(u));continue}t.push(T(String(a)))}}}}function Fe(e,t,n,o){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let r=n.length,f=t.length,s=r,i=0,a=0,u=f>0?t[f-1].nextSibling??void 0:o,c=null;for(;i<f||a<s;){if(t[i]===n[a]){i++,a++;continue}for(;f>i&&s>a&&t[f-1]===n[s-1];)f--,s--;if(f===i){let d=s<r?a?n[a-1].nextSibling??void 0:n[s-a]:u;for(;a<s;)m(e,n[a++],d)}else if(s===a)for(;i<f;)(!c||!c.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[s-1]&&n[a]===t[f-1]){let d=t[--f].nextSibling;m(e,n[a++],t[i++].nextSibling),m(e,n[--s],d),t[f]=t[i-1]}else{if(!c){c=new Map;let y=a;for(;y<s;)c.set(n[y],y++)}let d=c.get(t[i]);if(d!=null)if(a<d&&d<s){let y=i,H=1;for(;++y<f&&y<s&&!(!c.has(t[y])||c.get(t[y])!==d+H);)H++;if(H>d-a){let Ne=t[i];for(;a<d;)m(e,n[a++],Ne)}else t[i].parentNode===e?e.replaceChild(n[a++],t[i++]):(m(e,n[a++],u),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function m(e,t,n){l.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function _(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function pe(e,t){let n=(o,r)=>{typeof o=="function"&&o(e,r??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function z(e,t,n,o=!1){return typeof n!="function"?(x(e,t,n,o),()=>{}):p(()=>{let r=typeof n=="function"?n():n;x(e,t,r,o)})}function U(e,t,n){return typeof n!="function"?(_(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;_(e,t,o)})}function ye(e,t,n){return typeof n!="function"?(x(e,t,!!n),()=>{}):p(()=>{let o=n();x(e,t,!!o)})}function I(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>I(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function $(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],f=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push(p(()=>{let s=!!r();for(let i of f)e.classList.toggle(i,s)}));else{let s=!!(typeof r=="function"?r():r);for(let i of f)e.classList.toggle(i,s)}}}function D(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let r=n[o];r==null?e.style[o]="":e.style[o]=r}}function Zt(e){let{element:t,props:n,prevProps:o=De,isSVG:r=!1,skipChildren:f=!1}=e;if(!t||!K(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=r||t.namespaceURI===j,i=[];for(let a in n){if(f&&a==="children")continue;let u=n[a],c=o[a];if(u===c)continue;if(a==="ref"){me(u,t);continue}if(a==="use"){pe(t,u);continue}if(a.startsWith("on:")){i.push(de(t,a.slice(3),u));continue}if(a.startsWith("prop:")){i.push(U(t,a.slice(5),u));continue}if(a.startsWith("attr:")){i.push(z(t,a.slice(5),u,s));continue}if(a.startsWith("bool:")){i.push(ye(t,a.slice(5),u));continue}if(a==="class"||a==="className"){typeof u=="function"?i.push(p(()=>I(t,u()))):I(t,u);continue}if(a==="classList"){typeof u=="function"?i.push(p(()=>$(t,u()))):$(t,u,i);continue}if(a==="style"){typeof u=="function"?i.push(p(()=>D(t,u()))):D(t,u);continue}if(a.startsWith("on")){let y=a.slice(2).toLowerCase();c&&fe(t,y),u&&ke(t,y,u);continue}let d=F.has(a)||!s&&a in t;typeof u=="function"?i.push(d?U(t,a,u):z(t,a,u,s)):i.push(p(()=>d?_(t,a,n[a]):x(t,a,n[a],s)))}for(let a in o)if(!(a in n))if(a.startsWith("on")){let u=a.slice(2).toLowerCase();fe(t,u)}else F.has(a)?_(t,a,null):t.removeAttribute(a);return()=>{i.forEach(a=>a())}}function Qt(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){me(r,e);continue}if(o!=="children"){if(o==="use"){pe(e,r);continue}if(o.startsWith("on:")){de(e,o.slice(3),r);continue}if(o.startsWith("prop:")){U(e,o.slice(5),r);continue}if(o.startsWith("attr:")){z(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){ye(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let f=o.slice(2).toLowerCase();if(typeof r=="function")if(O.has(f)){e[`$$${f}`]=r;let s=`__fx_${f}`;if(!e[s]){let i=a=>{e[`$$${f}`]?.(a)};e.addEventListener(f,i),e[s]=i}}else e[`$$${f}`]=r,P.has(f)||le([f]);continue}if(o==="class"||o==="className"){I(e,r);continue}if(o==="classList"){typeof r=="function"?p(()=>$(e,r())):$(e,r);continue}if(o==="style"){typeof r=="function"?p(()=>D(e,r())):D(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function";)s=s();e.innerHTML=s});S(()=>f())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});S(()=>{f()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let f=!0,s=A(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();f?(f=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{s()})}else{let f=!0;p(()=>{let s=t[o];f?(f=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof r=="function"){let f=A(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();q(e,o,s,n)});S(()=>{f()})}else p(()=>q(e,o,t[o],n))}}}function en(...e){let t=o=>{for(let r=e.length-1;r>=0;r--){let f=e[r];if(f&&o in f&&f[o]!==void 0)return f[o]}},n=o=>{for(let r of e)if(r&&o in r)return!0;return!1};return new Proxy({},{get:(o,r)=>t(r),has:(o,r)=>n(r),ownKeys:()=>{let o=new Set;for(let r of e)if(r)for(let f of Reflect.ownKeys(r))o.add(f);return[...o]},getOwnPropertyDescriptor:(o,r)=>n(r)?{enumerable:!0,configurable:!0,get:()=>t(r)}:void 0})}function tn(e,...t){let n=new Set;for(let s of t)for(let i of s)n.add(i);let o=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),r=t.map(s=>{let i=new Set(s);return new Proxy({},{get:(a,u)=>i.has(u)?e[u]:void 0,has:(a,u)=>i.has(u)&&u in e,ownKeys:()=>Array.from(i).filter(a=>a in e),getOwnPropertyDescriptor:(a,u)=>i.has(u)&&u in e?o(u):void 0})}),f=new Proxy({},{get:(s,i)=>n.has(i)?void 0:e[i],has:(s,i)=>!n.has(i)&&i in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,i)=>!n.has(i)&&i in e?o(i):void 0});return[...r,f]}function me(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function nn(e,t,n){let o=t||document.body,r=_e(()=>e),f=[];return ue(()=>{let s=p(()=>{let i=r();Array.isArray(i)?(i.forEach(a=>o.appendChild(a)),f.push(()=>{i.forEach(a=>{a.parentNode===o&&o.removeChild(a)})})):C(i)&&(o.appendChild(i),f.push(()=>{i.parentNode===o&&o.removeChild(i)}))});f.push(s),S(()=>{f.forEach(i=>i())})}),null}function on(e){return typeof e=="string"&&e.toLowerCase()===e}function rn(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function sn(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function an(e){return typeof e=="function"&&e.length===0&&g(e)}function ge(e,t,n){if(!t)throw new Error("Container element is required");let o,r,f=[];return Me(s=>{ue(()=>{l.active||(t.textContent=""),R(t,e)}),r=s}),()=>{r?.(),o?.(),f.forEach(s=>s()),t.textContent=""}}var We="__fx_dom_create_component__",v=globalThis[We]??={fn:null};function un(e){v.fn=e}function ln(e={}){let t=e.signalSystem?.createComponent;t&&(v.fn=t)}function cn(e,t){return v.fn?v.fn(e,t):(()=>e(t))}var dn=()=>v.fn!==null,pn=()=>v.fn!==null;function yn(){v.fn=null}var k,Ve={getStore:()=>k,run(e,t){let n=k;k=e;try{return t()}finally{k=n}}},Ke=Ve;function xe(){return Ke.getStore()}import{setResourceIdSource as Ge,setServerDataGetter as Je}from"@fluixi/reactive/signal";var Be="__FX_DATA__";var Y;function he(){let e=globalThis.__FX_DATA__;if(e)return e;if(Y!==void 0)return Y;let t=null;if(typeof document<"u"){let n=document.getElementById(Be)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Y=t}function Z(){for(;;){for(;l.cursor&&l.cursor.nodeType===3&&l.cursor.data==="";)l.cursor=l.cursor.nextSibling;if(l.cursor!=null||!l.parents.length)return;l.cursor=l.parents.pop().nextSibling}}var Xe=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Q=typeof process<"u"&&process.env&&!1;function ee(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ze(e){Z();let t=l.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Xe.has(e.toLowerCase())?l.cursor=t.nextSibling:(l.parents.push(t),l.cursor=t.firstChild),t):(Q&&t&&ee(`<${e}>`,t),null)}function Ue(e){if(e===""){let n=l.cursor;return n&&n.nodeType===3&&n.data!==""?(l.cursor=n.nextSibling,n.data="",n):null}Z();let t=l.cursor;return t&&t.nodeType===3?(l.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Q&&t&&ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Ye(e){Z();let t=l.cursor;return t&&t.nodeType===8&&t.data===e?(l.cursor=t.nextSibling,t):(Q&&t&&ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ee=!1;function Ze(){Ee||(Ee=!0,se({hydrateElement:ze,hydrateText:Ue,hydrateMarker:Ye}))}function te(e,t,n){Ze(),l.active=!0,l.cursor=t.firstChild,l.parents=[];let o=he(),r=n?.resourceNamespace,f=0;Ge(()=>r?`${r}:r${f++}`:`r${f++}`),Je(o?s=>s in o?{value:o[s]}:void 0:null);try{return ge(e,t)}finally{l.active=!1,l.cursor=null,l.parents=[]}}var ne="fluixi-island";function Qe(e){let{component:t,props:n={},name:o}=e,r=ce(ne),f=o??t.name??"Island";x(r,"name",f),x(r,"props",JSON.stringify(n??{}));let s=N?xe():void 0;if(s){let i=s.nextIslandNamespace(f);R(r,()=>s.withResourceScope(i,()=>t(n)))}else R(r,()=>t(n));return r}var be=!1;function et(){if(be||typeof document>"u")return;be=!0;let e=document.createElement("style");e.textContent=`${ne}{display:contents}`,document.head.appendChild(e)}function tt(e){if(typeof document>"u")return;et();let t=document.querySelectorAll(ne),n=new Map;t.forEach(o=>{let r=o.getAttribute("name")??"",f=n.get(r)??0;n.set(r,f+1);let s=e[r];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${r}" has no component in the registry — left static.`);return}let i={};try{i=JSON.parse(o.getAttribute("props")||"{}")}catch{}te(()=>s(i),o,{resourceNamespace:`${r}#${f}`})})}export{Qe as Island,F as JSX_PROPERTIES,at as SVG_ELEMENTS,j as SVG_NAMESPACE,st as VOID_ELEMENTS,lt as addClass,ke as addDelegatedEventListener,de as addNativeEventListener,Et as appendChildren,q as applyElementProp,Qt as applyProps,pe as applyUse,Ae as captureHydrationCursor,w as cleanChildren,zt as cloneTemplate,ut as closest,cn as createComponent,xt as createElement,ce as createNativeElement,nn as createPortal,Xt as createTemplate,wt as delegate,le as delegateEvents,sn as escapeHTML,Ut as fnName,Bt as generateID,yt as getAttribute,_t as getGlobal,rt as getLitEventName,Tt as getOffset,Kt as getStableElementId,gt as getStyle,me as handleRef,pt as hasClass,te as hydrate,Pe as hydrateAdvancePast,tt as hydrateIslands,ln as initializeIntegration,R as insert,M as insertExpression,dn as intergartionInitialized,an as isAccessor,Te as isCustomElement,Pt as isDOMNode,Gt as isDelegatedEvent,K as isDomElement,C as isDomNode,B as isDomText,ot as isEventHandler,Jt as isFunction,pn as isIntegrationInitialized,Lt as isJSXTemplate,ve as isLitTemplateResult,on as isNativeElement,L as isPromise,At as isReactElement,rn as isSVGElement,N as isServer,Rt as isTemplateFactory,bt as isVisible,Yt as iterateFn,He as makeArrayFlat,en as mergeProps,vt as observeIntersection,Ct as observeResize,oe as query,ft as queryAll,un as registerCreateComponent,Mt as registerGlobal,mt as removeAttribute,ht as removeChildren,ct as removeClass,fe as removeDelegatedEventListener,ge as render,yn as resetIntegration,Re as runHydrationAt,Le as runWithoutHydration,Nt as scrollIntoView,x as setAttribute,$ as setClassList,I as setClassName,z as setDynamicAttribute,ye as setDynamicBoolAttribute,U as setDynamicProperty,_ as setProperty,Ce as setServerMode,D as setStyle,we as setStyles,it as shouldSetAsProperty,tn as splitProps,Zt as spread,nt as toAttributeName,dt as toggleClass,St as waitForElement};
|