@fluixi/dom 1.0.0-alpha.82 → 1.0.0-alpha.83
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-client.cjs +1 -1
- package/dist/cdn/dom-client.global.js +1 -1
- package/dist/cdn/dom-client.mjs +1 -1
- 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/dynamic-element.cjs +1 -1
- package/dist/lib/dom/dynamic-element.js +1 -1
- package/dist/lib/dom/dynamic-element.mjs +1 -1
- package/dist/lib/dom/hydration.cjs +1 -1
- package/dist/lib/dom/hydration.mjs +1 -1
- package/dist/lib/dom/index.cjs +1 -1
- package/dist/lib/dom/index.mjs +1 -1
- package/dist/lib/dom/integration.cjs +1 -1
- package/dist/lib/dom/integration.d.ts.map +1 -1
- package/dist/lib/dom/integration.js +13 -4
- package/dist/lib/dom/integration.mjs +1 -1
- package/dist/lib/dom/island.cjs +1 -1
- package/dist/lib/dom/island.js +1 -1
- package/dist/lib/dom/island.mjs +1 -1
- package/dist/lib/dom/runtime.cjs +1 -1
- package/dist/lib/dom/runtime.d.ts +11 -2
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +142 -24
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/dom/server/host.cjs +1 -1
- package/dist/lib/dom/server/host.d.ts +8 -2
- package/dist/lib/dom/server/host.d.ts.map +1 -1
- package/dist/lib/dom/server/host.js +31 -9
- package/dist/lib/dom/server/host.mjs +1 -1
- package/dist/lib/dom/server/index.cjs +1 -1
- package/dist/lib/dom/server/index.mjs +1 -1
- package/dist/lib/dom/server/nodes.cjs +1 -1
- package/dist/lib/dom/server/nodes.mjs +1 -1
- package/dist/lib/dom/server/parse-template.cjs +1 -1
- package/dist/lib/dom/server/parse-template.mjs +1 -1
- package/dist/lib/dom/server/render.cjs +1 -1
- package/dist/lib/dom/server/render.js +2 -2
- package/dist/lib/dom/server/render.mjs +1 -1
- package/dist/lib/dom/server/serialize.cjs +1 -1
- package/dist/lib/dom/server/serialize.mjs +1 -1
- package/dist/lib/dom/server-renderer.cjs +1 -1
- package/dist/lib/dom/server-renderer.mjs +1 -1
- package/dist/lib/dom/versions.cjs +1 -1
- package/dist/lib/dom/versions.mjs +1 -1
- package/dist/lib/flow/class-map.cjs +1 -1
- package/dist/lib/flow/class-map.js +1 -1
- package/dist/lib/flow/class-map.mjs +1 -1
- package/dist/lib/flow/client-only.cjs +1 -1
- package/dist/lib/flow/client-only.js +1 -1
- package/dist/lib/flow/client-only.mjs +1 -1
- package/dist/lib/flow/dynamic.cjs +1 -1
- package/dist/lib/flow/dynamic.js +1 -1
- package/dist/lib/flow/dynamic.mjs +1 -1
- package/dist/lib/flow/error-boundary.cjs +1 -1
- package/dist/lib/flow/error-boundary.js +1 -1
- package/dist/lib/flow/error-boundary.mjs +1 -1
- package/dist/lib/flow/index.cjs +1 -1
- package/dist/lib/flow/index.mjs +1 -1
- package/dist/lib/flow/portal.cjs +1 -1
- package/dist/lib/flow/portal.mjs +1 -1
- package/dist/lib/flow/show.cjs +1 -1
- package/dist/lib/flow/show.d.ts.map +1 -1
- package/dist/lib/flow/show.js +8 -3
- package/dist/lib/flow/show.mjs +1 -1
- package/dist/lib/flow/style-map.cjs +1 -1
- package/dist/lib/flow/style-map.js +1 -1
- package/dist/lib/flow/style-map.mjs +1 -1
- package/dist/lib/flow/switch.cjs +1 -1
- package/dist/lib/flow/switch.js +1 -1
- package/dist/lib/flow/switch.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/version.generated.mjs +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function Fr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Hr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function Vr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Wr(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 Ur=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Br=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),U="http://www.w3.org/2000/svg";function en(e){return e.localName.includes("-")}function Se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(en(e)){e[t]=n;return}h(e,t,n,r)}var ve=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Ze(e,t=document){return t.querySelector(e)}function Kr(e,t=document){return Array.from(t.querySelectorAll(e))}function zr(e,t){return e.closest(t)}function Qe(e,...t){e.classList.add(...t)}function et(e,...t){e.classList.remove(...t)}function tt(e,...t){t.forEach(n=>e.classList.toggle(n))}function Gr(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function nt(e,t){return e.getAttribute(t)}function rt(e,t){e.removeAttribute(t)}function Ae(e,t){Object.assign(e.style,t)}function Xr(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ot(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")Ae(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function it(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function st(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Jr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Yr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Zr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Qr(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 eo(e,t=5e3){return new Promise((n,r)=>{let o=Ze(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Ze(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 to(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function no(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var tn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ro(e){return typeof e=="object"&&e!==null&&e.$$typeof===tn}function nn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function oo(e){if(typeof e!="function")return!1;try{let t=e();return nn(t)}catch{return!1}}function io(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function so(e){return e instanceof Node}function ao(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function lo(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as b}from"@fluixi/reactive/signal";var Ce="1.0.0-alpha.82";import{VERSION as rn}from"@fluixi/reactive/version";var x={dom:Ce,reactive:rn};function on(e){x.core=e}function Re(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function Me(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function mo(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function go(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function ho(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function xo(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function To(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function bo(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function at(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Eo(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function sn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function an(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function ln(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function cn(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function un(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function fn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function dn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function wo(e){return sn(e)?{type:"router",value:e}:ln(e)?{type:"route",value:e}:an(e)?{type:"routes",value:e}:cn(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:dn(e)?{type:"suspense",value:e}:un(e)?{type:"provider",value:e}:fn(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as dt,createEffect as z,createRenderEffect as m,createRoot as mn,onCleanup as O,readChildren as gn}from"@fluixi/reactive/signal";var g=typeof document>"u";function _(e){g=e}var B=Symbol.for("fluixi.server-node"),Pe=null;function lt(e){Pe=e}function $(){if(!Pe)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return Pe}function I(e){return e!=null&&e[B]===!0?!0:typeof Node<"u"&&e instanceof Node}function Oe(e){return e!=null&&e[B]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Le(e){return e!=null&&e[B]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},ct=null;function ut(e){ct=e}function ee(){return ct}function ke(e,t){return u.active&&t.parentNode===e}function De(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function pn(){return u.active?u.cursor:null}function te(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function yn(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function K(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&De(t)}function hn(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 xn(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 Do(e){return xn(hn(e))}var _o=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Tn={};var ft=new Map,re=new Set,le=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ce(e){if(!g)for(let t of e)re.has(t)||le.has(t)||(re.add(t),document.addEventListener(t,bn))}function bn(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function _e(e,t,n){if(e[`$$${t}`]=n,le.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}re.has(t)||ce([t])}function oe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function $o(e){return!le.has(e)}function Io(e){return typeof e=="function"}function R(e,t=!1){if(g)return $().createText(e);if(u.active&&!t){let n=ee()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ue(e,t=!1){if(g)return $().createElement(e,t);if(u.active){let n=ee()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(U,e):document.createElement(e)}function $e(e,t=!1){let n=ft.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,ft.set(e,r),r}function pt(e,t,n=!1,r=!1){if(g){let o=$();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=ee()?.hydrateStatic(t);if(o)return o}return Ie($e(e,r),r).firstChild}function yt(e,t){if(!u.active)return t();let n=te(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?te(e.nextSibling,()=>r(...o)):r(...o))}return n}function mt(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function gt(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ie(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function En(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?En(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function qo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function jo(e){if(b(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!b(t)&&!N(t);)t=t();return t}var A=0,wn=200;function Nn(e,t,n,r,o){let i=r,s=new Map;return m(()=>{let a;if(N(e)&&!b(e)){if(!s.has(e)){A++;try{let l=e();s.set(e,l)}finally{A--}}for(a=s.get(e);typeof a=="function"&&b(a);)a=a()}else for(a=e();typeof a=="function"&&b(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;A++;try{let f=c();s.set(c,f)}finally{A--}}a=s.get(a)}else if(b(a))a=a();else if(a=a(),typeof a!="function"||!b(a)&&!N(a))break}A++;try{i=ie(t,a,n,i,s),o(i)}finally{A--}})}function E(e,t,n,r){if(A>wn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=R("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){A++;try{o=ie(e,t,n,o)}finally{A--}return()=>o}let a=Nn(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ie(e,t,n,r,o){if(t==null||typeof t=="boolean")return P(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return P(e,r,n);if(ne(t)){let s=R("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),P(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&ie(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=R(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=P(e,r,n)}if(r&&Le(r))return r.data=t,r;let s=R(t);return r&&r.parentNode===e?e.replaceChild(s,r):ke(e,s)||T(e,s,n),s}if(I(t))return ke(e,t)?(De(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),P(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];v(t,s,e,n,!0,o,l);let c=Sn(e,a,s,n);for(let f of l){let d=E(e,f.sig,f.marker);O(()=>{P(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(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 ie(e,l,n,r)}}}return P(e,r,n)}function v(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"&&!ne(l)&&!b(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!b(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!ne(c)&&!b(c)&&!N(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(b(c)){if(s){let d=R("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&b(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?v(f,t,n,r,o,i):v([f],t,n,r,o,i);continue}continue}Array.isArray(c)?v(c,t,n,r,o,i,s):v([c],t,n,r,o,i,s);continue}if(ne(l)){let c=R("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(v([f],d,c.parentNode,void 0,!1,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)){v(l,t,n,r,o,i,s);continue}if(I(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?v(f,t,n,r,!1,i):v([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(R(c));continue}t.push(R(String(l)))}}}}function Sn(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let 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;)T(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;T(e,n[l++],t[a++].nextSibling),T(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,y=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let we=t[a];for(;l<d;)T(e,n[l++],we)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function P(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function q(e,t,n){n==null?delete e[t]:e[t]=n}function ht(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 xt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function G(e,t,n,r=!1){return typeof n!="function"?(h(e,t,n,r),()=>{}):m(()=>{let o=typeof n=="function"?n():n;h(e,t,o,r)})}function X(e,t,n){return typeof n!="function"?(q(e,t,n),()=>{}):m(()=>{let r=typeof n=="function"?n():n;q(e,t,r)})}function Tt(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):m(()=>{let r=n();h(e,t,!!r)})}function j(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>j(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function se(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(m(()=>{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 ae(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function bt(e){let{element:t,props:n,prevProps:r=Tn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!Oe(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===U,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"){F(c,t);continue}if(l==="use"){xt(t,c);continue}if(l.startsWith("on:")){a.push(ht(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(X(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(G(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(Tt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>j(t,c()))):j(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(m(()=>se(t,c()))):se(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(m(()=>ae(t,c()))):ae(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&oe(t,p),c&&_e(t,p,c);continue}let d=ve.has(l)||!s&&l in t;typeof c=="function"?a.push(d?X(t,l,c):G(t,l,c,s)):a.push(m(()=>d?q(t,l,n[l]):h(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();oe(t,c)}else ve.has(l)?q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function fe(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){F(o,e);continue}if(r!=="children"){if(r==="use"){xt(e,o);continue}if(r.startsWith("on:")){ht(e,r.slice(3),o);continue}if(r.startsWith("prop:")){X(e,r.slice(5),o);continue}if(r.startsWith("attr:")){G(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Tt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(le.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,re.has(i)||ce([i]);continue}if(r==="class"||r==="className"){j(e,o);continue}if(r==="classList"){typeof o=="function"?m(()=>se(e,o())):se(e,o);continue}if(r==="style"){typeof o=="function"?m(()=>ae(e,o())):ae(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});O(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});O(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});O(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=z(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});O(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=z(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();Se(e,r,s,n)});O(()=>{i()})}else m(()=>Se(e,r,t[r],n))}}}function Et(...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 Fo(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 F(e,t){if(e){if(I(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function wt(e,t,n){let r=t||document.body,o=gn(()=>e),i=[];return dt(()=>{let s=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):I(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),O(()=>{i.forEach(a=>a())})}),null}function Ho(e){return typeof e=="string"&&e.toLowerCase()===e}function Nt(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Vo(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ne(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Wo(e){return typeof e=="function"&&e.length===0&&b(e)}function de(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return mn(s=>{dt(()=>{u.active||(t.textContent=""),Re(t),Me(),E(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function St(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as vn,isSignal as An}from"@fluixi/reactive";var Cn="__fx_dom_create_component__",L=globalThis[Cn]??={fn:null};function zo(e){L.fn=e}function Go(e={}){let t=e.signalSystem?.createComponent;t&&(L.fn=t)}function pe(e,t){if(L.fn)return L.fn(e,t);let n=typeof e=="function"?vn(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!An(n)){try{n.$name=e?.name}catch{}return at(n)}return n}var Xo=()=>L.fn!==null,vt=()=>L.fn!==null;function At(){L.fn=null}var ye,Rt={getStore:()=>ye,run(e,t){let n=ye;ye=e;try{return t()}finally{ye=n}}},qe=Rt;function Mt(e){qe=e??Rt}function J(e={}){e.locals||(e.locals=e.request?Fe(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 Y(e,t){return qe.run(e,t)}function C(){return qe.getStore()}function je(){return C()?.event}function Pt(){let e=je();return e?(e.locals||(e.locals={}),e.locals):{}}var Ct=new WeakMap;function Fe(e){let t=Ct.get(e);return t||(t={},Ct.set(e,t)),t}import{setResourceIdSource as Rn,setServerDataGetter as Mn}from"@fluixi/reactive/signal";var Z="__FX_DATA__";function me(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var He;function ge(){let e=globalThis.__FX_DATA__;if(e)return e;if(He!==void 0)return He;let t=null;if(typeof document<"u"){let n=document.getElementById(Z)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return He=t}function he(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var Pn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),xe=typeof process<"u"&&process.env&&!1;function Te(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function On(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Pn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(xe&&t&&Te(`<${e}>`,t),null)}function Ln(e){he();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`<${e}> (static)`,t),null)}function kn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}he();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(xe&&t&&Te(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Dn(e){he();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(xe&&t&&Te(`marker <!--${e.slice(0,24)}-->`,t),null)}var Ot=!1;function _n(){Ot||(Ot=!0,ut({hydrateElement:On,hydrateText:kn,hydrateMarker:Dn,hydrateStatic:Ln}))}function Q(e,t,n){_n(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ge(),o=n?.resourceNamespace,i=0;Rn(()=>o?`${o}:r${i++}`:`r${i++}`),Mn(r?s=>s in r?{value:r[s]}:void 0:null);try{return de(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ve="fluixi-island";function $n(e){let{component:t,props:n={},name:r}=e,o=ue(Ve),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g?C():void 0;if(s){let a=s.nextIslandNamespace(i);E(o,()=>s.withResourceScope(a,()=>t(n)))}else E(o,()=>t(n));return o}var Lt=!1;function In(){if(Lt||typeof document>"u")return;Lt=!0;let e=document.createElement("style");e.textContent=`${Ve}{display:contents}`,document.head.appendChild(e)}function qn(e){if(typeof document>"u")return;In();let t=document.querySelectorAll(Ve),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{}Q(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function jn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Fn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as Hn}from"@fluixi/reactive/signal";function Si(e,t={}){if(typeof e=="function")return pe(e,t);if(typeof e!="string"||e.length===0)return null;let n=Nt(e);if(g)return $().createElement(e,n);let r=n?document.createElementNS(U,e):document.createElement(e);return fe(r,t,n),Vn(r,t),r}function Vn(e,t){if(!t||t.children===void 0)return;let n=Hn(()=>t.children),r=o=>{E(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as Wn,createMemo as We,disposeScope as Un,getOwner as Bn,runWithOwner as Kn,untrack as $t}from"@fluixi/reactive/signal";function kt(e){return typeof e=="function"?e:(()=>e)}function M(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Dt(e){return e!=null&&e!==!1}function _t(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zn(e){let t=M(()=>e.when),n=We(t,void 0),r=We(n,void 0),o=Bn(),i=null,s=null,a=l=>{l!==s&&(i&&Un(i),i=Wn(o),s=l)};return We(()=>{let l=r();return a(l?"when":"fallback"),Kn(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!_t(c)?typeof n=="function"?$t(()=>$t(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}import{mapArray as Gn,keyArray as Xn}from"@fluixi/reactive/signal";function Jn(e){let t=M(()=>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 K(a),a};return e.by?Xn(t,e.by,(o,i)=>r(o,i),{fallback:n}):Gn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Yn}from"@fluixi/reactive/signal";function Zn(e){let t=M(()=>e.each);return Yn(t,(n,r)=>{let o=e.children(n,r);return K(o),o},{fallback:()=>e.fallback??null})}import{mapArray as bs,keyArray as Es,indexArray as ws}from"@fluixi/reactive/signal";import{createMemo as Qn,createChildOwner as er,disposeScope as tr,getOwner as nr,runWithOwner as It}from"@fluixi/reactive/signal";var Ue=Symbol("match");function rr(e){return{[Ue]:!0,when:M(()=>e.when),get children(){return e.children}}}function or(e){let t=Array.isArray(e.children)?e.children:[e.children],n=nr(),r=null,o=-1,i=s=>{s!==o&&(r&&tr(r),r=er(n),o=s)};return Qn(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Ue]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ue]!==!0)continue;let f=l.when();if(Dt(f))return i(s),It(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),It(r,()=>e.fallback??null)})}import{createMemo as ir,createChildOwner as sr,disposeScope as ar,getOwner as lr,runWithOwner as cr}from"@fluixi/reactive/signal";function ur(e){let t=kt(e.component),{component:n,...r}=e,o=lr(),i=null,s;return ir(()=>{let a=t();return a!==s&&(i&&ar(i),i=sr(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:cr(i,()=>a(r))})}import{createRoot as fr,onCleanup as dr}from"@fluixi/reactive/signal";function pr(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return fr(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),E(r,e.children)&&F(e.ref,r)}),dr(()=>{n(),r.remove()}),null}import{createMemo as yr,createSignal as mr}from"@fluixi/reactive/signal";function qt(e){if(g)return e.fallback??null;let t=u.active,[n,r]=mr(!t);return t&&queueMicrotask(()=>r(!0)),yr(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var gr=qt;import{createMemo as hr,createSignal as xr}from"@fluixi/reactive/signal";function Tr(e){let[t,n]=xr(null),r=()=>n(null);return hr(()=>{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 br}from"@fluixi/reactive/signal";function Er(e){return br(()=>{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 wr}from"@fluixi/reactive/signal";function Nr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Sr(e){return wr(()=>{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(`${Nr(r)}: ${i}`)}return n.join("; ")})}var Ee=1,ze=3,Ge=8,jt;jt=B;var H=class{constructor(){this[jt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},k=class e extends H{constructor(n){super();this.nodeType=ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},be=class e extends H{constructor(n){super();this.nodeType=Ee;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},V=class e extends H{constructor(n){super();this.nodeType=Ge;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Be=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Ke=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},D=class e extends H{constructor(n,r=!1){super();this.nodeType=Ee;this.attributes=new Map;this.style=new Be;this.classList=new Ke(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new k(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var vr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ht=/&/g,Vt=/</g,Wt=/>/g,Ar=/"/g;function Xe(e){return e.replace(Ht,"&").replace(Vt,"<").replace(Wt,">")}function Ft(e){return e.replace(Ht,"&").replace(Ar,""").replace(Vt,"<").replace(Wt,">")}function Cr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Rr(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(`${Cr(n)}: ${r}`)}return t.join("; ")}function Mr(e){let t="",n=Rr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Ft(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Ft(o)}"`}return t}function S(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Xe(e);if(typeof e=="number")return Xe(String(e));if(typeof e=="function")return S(e());if(Array.isArray(e))return e.map(S).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case ze:return Xe(e.data??"");case Ge:return`<!--${e.data??""}-->`;case Ee:{let t=e.localName,n=`<${t}${Mr(e)}>`;if(vr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(S).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(S).join(""):""}import{createRoot as Xt}from"@fluixi/reactive/signal";import{setResourceTracker as Lr,setResourceIdSource as kr,setResourceDataSink as Dr,getOwner as _r,runWithOwner as Kt,flush as $r}from"@fluixi/reactive/signal";var Pr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Or={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Ut(e){return e.replace(/&(#?\w+);/g,(t,n)=>Or[n]??t)}var w=class extends Error{};function Bt(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new w(`unterminated comment at ${c}`);i(new V(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new w(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new w(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new w(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof D))throw new w(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new k(Ut(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new w(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new D(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let we=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let W=e.slice(we,y);if(W==="")throw new w(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new w(`attribute ${W} must have a double-quoted value`);let Ne=e.indexOf('"',y+2);if(Ne===-1)throw new w(`unterminated value for ${W}`);p.setAttribute(W,Ut(e.slice(y+2,Ne))),y=Ne+1}else p.setAttribute(W,"")}return i(p),Pr.has(d)||o.push(p),y}}var zt=!1;function Jt(){zt||(zt=!0,lt({createElement:(e,t)=>new D(e,t),createText:e=>new k(e),createRaw:e=>new be(e),parseTemplate:(e,t)=>Bt(e,t),createComment:e=>new V(e)}))}function Yt(e,t={}){let n=g;Jt(),_(!0);let r=J(t.event);try{return Y(r,()=>Xt(o=>{try{let i=typeof e=="function"?e():e;return S(i)}finally{o()}}))}finally{_(n)}}var Gt=!1;function Ir(){Gt||(Gt=!0,Lr(e=>{C()?.pending.add(e)}),kr(()=>C()?.nextResourceId()??""),Dr((e,t)=>{e&&C()?.data.set(e,t)}))}var Je=null;function Zt(e){Je=e}function Ye(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(Je)try{i=Je(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=me(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${Z}">${n}<\/script>`}var qr=50;async function Qt(e,t={}){let n=g;Jt(),_(!0),Ir();let r=J(t.event);try{return await Y(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Xt(f=>{s=f,i=_r(),o=typeof e=="function"?e():e});let a=()=>{try{Kt(i,()=>S(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<qr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await $r(),a()}let c=Kt(i,()=>S(o))+Ye(r);return s(),c})}finally{_(n)}}var jr={createComponent:pe,createElement:ot,createNativeElement:ue,createTemplate:$e,cloneTemplate:Ie,templateNode:pt,holeContent:gt,holeEnd:mt,holeScope:yt,createPortal:wt,render:de,hydrate:Q,insert:E,appendChildren:st,removeChildren:it,spread:bt,applyProps:fe,mergeProps:Et,bindPair:St,setProperty:q,setDynamicProperty:X,setAttribute:h,setDynamicAttribute:G,removeAttribute:rt,getAttribute:nt,setClassName:j,addClass:Qe,removeClass:et,toggleClass:tt,setStyles:Ae,delegateEvents:ce,addDelegatedEventListener:_e,removeDelegatedEventListener:oe,handleRef:F,resetIntegration:At,isIntegrationInitialized:vt},aa=jr;export{qt as ClientOnly,ur as Dynamic,Tr as ErrorBoundary,Z as FX_DATA_ID,Jn as For,Zn as Index,$n as Island,ve as JSX_PROPERTIES,rr as Match,gr as NoSsr,pr as Portal,Br as SVG_ELEMENTS,U as SVG_NAMESPACE,zn as Show,or as Switch,Ce as VERSION,Ur as VOID_ELEMENTS,Qe as addClass,_e as addDelegatedEventListener,ht as addNativeEventListener,st as appendChildren,Se as applyElementProp,fe as applyProps,xt as applyUse,at as asComponent,bo as asContext,xo as asOutlet,To as asProvider,ho as asRoute,mo as asRouter,go as asRoutes,Eo as asSuspense,St as bindPair,pn as captureHydrationCursor,wo as checkRenderType,Er as classMap,P as cleanChildren,Ie as cloneTemplate,zr as closest,pe as createComponent,Si as createDynamicElement,ot as createElement,ue as createNativeElement,wt as createPortal,J as createRequestContext,$e as createTemplate,aa as default,Qr as delegate,ce as delegateEvents,me as escapeFxJson,Vo as escapeHTML,qo as fnName,_o as generateID,nt as getAttribute,lo as getGlobal,Vr as getLitEventName,Pt as getLocals,Zr as getOffset,C as getRequestContext,je as getRequestEvent,Fe as getRequestLocals,ge as getServerData,Do as getStableElementId,Xr as getStyle,F as handleRef,Gr as hasClass,gt as holeContent,mt as holeEnd,yt as holeScope,jn as html,Q as hydrate,K as hydrateAdvancePast,qn as hydrateIslands,ws as indexArray,Go as initializeIntegration,E as insert,ie as insertExpression,Xo as intergartionInitialized,Wo as isAccessor,N as isComponent,fn as isContext,en as isCustomElement,so as isDOMNode,$o as isDelegatedEvent,Oe as isDomElement,I as isDomNode,Le as isDomText,Hr as isEventHandler,Io as isFunction,vt as isIntegrationInitialized,io as isJSXTemplate,nn as isLitTemplateResult,Ho as isNativeElement,cn as isOutlet,ne as isPromise,un as isProvider,ro as isReactElement,ln as isRoute,sn as isRouter,an as isRoutes,Nt as isSVGElement,g as isServer,dn as isSuspense,oo as isTemplateFactory,Jr as isVisible,jo as iterateFn,Es as keyArray,En as makeArrayFlat,bs as mapArray,Et as mergeProps,to as observeIntersection,no as observeResize,Ze as query,Kr as queryAll,on as registerCoreVersion,zo as registerCreateComponent,ao as registerGlobal,rt as removeAttribute,it as removeChildren,et as removeClass,oe as removeDelegatedEventListener,de as render,Yt as renderToString,Qt as renderToStringAsync,At as resetIntegration,te as runHydrationAt,Y as runWithRequestContext,yn as runWithoutHydration,Yr as scrollIntoView,S as serializeNode,Ye as serializeResourceData,h as setAttribute,se as setClassList,j as setClassName,Zt as setDataRedactor,G as setDynamicAttribute,Tt as setDynamicBoolAttribute,X as setDynamicProperty,q as setProperty,Mt as setRequestStore,_ as setServerMode,ae as setStyle,Ae as setStyles,Wr as shouldSetAsProperty,Fo as splitProps,bt as spread,Re as stampVersions,Sr as styleMap,Fn as svg,pt as templateNode,Fr as toAttributeName,tt as toggleClass,x as versions,eo as waitForElement,Me as warnOnVersionSkew};
|
|
1
|
+
function Qr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function eo(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function to(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function no(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 ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),oo=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"]),K="http://www.w3.org/2000/svg";function cn(e){return e.localName.includes("-")}function Me(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(cn(e)){e[t]=n;return}h(e,t,n,r)}var Pe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function nt(e,t=document){return t.querySelector(e)}function io(e,t=document){return Array.from(t.querySelectorAll(e))}function so(e,t){return e.closest(t)}function rt(e,...t){e.classList.add(...t)}function ot(e,...t){e.classList.remove(...t)}function it(e,...t){t.forEach(n=>e.classList.toggle(n))}function ao(e,t){return e.classList.contains(t)}function h(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function st(e,t){return e.getAttribute(t)}function at(e,t){e.removeAttribute(t)}function ke(e,t){Object.assign(e.style,t)}function lo(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function lt(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")ke(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else h(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function ct(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ut(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function co(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function uo(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function fo(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function po(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 yo(e,t=5e3){return new Promise((n,r)=>{let o=nt(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=nt(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 mo(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function go(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var un=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function ho(e){return typeof e=="object"&&e!==null&&e.$$typeof===un}function fn(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function xo(e){if(typeof e!="function")return!1;try{let t=e();return fn(t)}catch{return!1}}function To(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function bo(e){return e instanceof Node}function Eo(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function wo(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as b}from"@fluixi/reactive/signal";var Oe="1.0.0-alpha.83";import{VERSION as dn}from"@fluixi/reactive/version";var x={dom:Oe,reactive:dn};function pn(e){x.core=e}function Le(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function De(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function Ro(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Mo(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Po(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ko(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Oo(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Lo(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function ft(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Do(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function yn(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function mn(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function gn(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function hn(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function xn(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Tn(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function bn(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function _o(e){return yn(e)?{type:"router",value:e}:gn(e)?{type:"route",value:e}:mn(e)?{type:"routes",value:e}:hn(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:bn(e)?{type:"suspense",value:e}:xn(e)?{type:"provider",value:e}:Tn(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as xt,createEffect as J,createRenderEffect as m,createRoot as vn,onCleanup as L,readChildren as An,reportReactiveBinding as S,reportReactiveDirective as v,untrack as Cn}from"@fluixi/reactive/signal";var G=Symbol.for("fluixi.server-node"),En=Symbol.for("fluixi.dom.server-host"),wn=globalThis,z=wn[En]??={server:typeof document>"u",nodes:null};function g(){return z.server}function I(e){z.server=e}function dt(e){z.nodes=e}function q(){if(!z.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return z.nodes}function j(e){return e!=null&&e[G]===!0?!0:typeof Node<"u"&&e instanceof Node}function _e(e){return e!=null&&e[G]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function $e(e){return e!=null&&e[G]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},pt=null;function yt(e){pt=e}function re(){return pt}function Ie(e,t){return u.active&&t.parentNode===e}function qe(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Nn(){return u.active?u.cursor:null}function oe(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 Sn(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 X(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&qe(t)}function Rn(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 Mn(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 Ko(e){return Mn(Rn(e))}var zo=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Pn={};var se="__fx_at",Tt="__fx_loc";function mt(e,t){return t&&(e[Tt]=t),e}var gt=new Map,ae=new Set,pe=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ye(e){if(!g())for(let t of e)ae.has(t)||pe.has(t)||(ae.add(t),document.addEventListener(t,kn))}function kn(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 je(e,t,n){if(e[`$$${t}`]=n,pe.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}ae.has(t)||ye([t])}function le(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Go(e){return!pe.has(e)}function Xo(e){return typeof e=="function"}function P(e,t=!1){if(g())return q().createText(e);if(u.active&&!t){let n=re()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function me(e,t=!1,n){if(g())return q().createElement(e,t);if(u.active){let r=re()?.hydrateElement(e);if(r)return n?mt(r,n):r}return mt(t?document.createElementNS(K,e):document.createElement(e),n)}function He(e,t=!1){let n=gt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,gt.set(e,r),r}function bt(e,t,n=!1,r=!1,o){if(g()){let i=q();return n?i.parseTemplate(e,r):i.createRaw(e)}if(u.active){let i=re()?.hydrateStatic(t);if(i)return ht(i,o)}return ht(Fe(He(e,r),r).firstChild,o)}function ht(e,t){let n=e;if(!t||typeof n?.querySelectorAll!="function")return e;let r=[n,...n.querySelectorAll("*")];for(let o=0;o<r.length&&o*2+1<t.pos.length;o++){let i=t.pos[o*2];i&&(r[o][Tt]={file:t.file,line:i,column:t.pos[o*2+1]})}return e}function Et(e,t){if(!u.active)return t();let n=oe(e.nextSibling,t);if(typeof n=="function"){let r=n;return On(r,(...i)=>u.active?oe(e.nextSibling,()=>r(...i)):r(...i))}return n}function On(e,t){let n=e[se];return n!==void 0&&(t[se]=n),t}function wt(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Nt(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Fe(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Ln(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Ln(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Jo(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Yo(e){if(b(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!b(t)&&!N(t);)t=t();return t}var R=0,Dn=200;function _n(e,t,n,r,o){let i=r,s=new Map;return m(()=>{S(n??t,"content",void 0,e);let a;if(N(e)&&!b(e)){if(!s.has(e)){R++;try{let l=e();s.set(e,l)}finally{R--}}for(a=s.get(e);typeof a=="function"&&b(a);)a=a()}else for(a=e();typeof a=="function"&&b(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!s.has(a)){let c=a;R++;try{let f=c();s.set(c,f)}finally{R--}}a=s.get(a)}else if(b(a))a=a();else if(a=a(),typeof a!="function"||!b(a)&&!N(a))break}R++;try{i=ce(t,a,n,i,s),o(i)}finally{R--}})}function E(e,t,n,r){if(R>Dn)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=P("",!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)){R++;try{o=ce(e,t,n,o)}finally{R--}return()=>o}let a=_n(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function ce(e,t,n,r,o){if(t==null||typeof t=="boolean")return O(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return O(e,r,n);if(ie(t)){let s=P("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),O(e,r.slice(1),n)):T(e,s,n):r?e.replaceChild(s,r):T(e,s,n),t.then(a=>{s.parentNode===e&&ce(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=P(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=O(e,r,n)}if(r&&$e(r))return r.data=t,r;let s=P(t);return r&&r.parentNode===e?e.replaceChild(s,r):Ie(e,s)||T(e,s,n),s}if(j(t))return Ie(e,t)?(qe(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),O(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];C(t,s,e,n,!0,o,l);let c=$n(e,a,s,n);for(let f of l){let d=E(e,f.sig,f.marker);L(()=>{O(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 ce(e,l,n,r)}}}return O(e,r,n)}function C(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"&&!ie(l)&&!b(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!b(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!ie(c)&&!b(c)&&!N(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(b(c)){if(s){let d=P("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&b(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?C(f,t,n,r,o,i):C([f],t,n,r,o,i);continue}continue}Array.isArray(c)?C(c,t,n,r,o,i,s):C([c],t,n,r,o,i,s);continue}if(ie(l)){let c=P("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(C([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)){C(l,t,n,r,o,i,s);continue}if(j(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)?C(f,t,n,r,!1,i):C([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(P(c));continue}t.push(P(String(l)))}}}}function $n(e,t,n,r){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let 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;)T(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;T(e,n[l++],t[a++].nextSibling),T(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,y=1;for(;++p<i&&p<s&&!(!f.has(t[p])||f.get(t[p])!==d+y);)y++;if(y>d-l){let Ce=t[a];for(;l<d;)T(e,n[l++],Ce)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function O(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function H(e,t,n){n==null?delete e[t]:e[t]=n}function St(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 vt(e,t){if(!t||typeof t!="function")return;let n=t[se]?.name;if(!n)return;let r=n.indexOf(":");r!==-1&&v(e,n.slice(0,r),n.slice(r+1),t)}function ue(e,t,n){let r=typeof n=="function"?Cn(()=>n()):n;if(!(!r||typeof r!="object"))for(let o of Object.keys(r))v(e,t,o)}function At(e,t){let n=(r,o)=>{typeof r=="function"&&(v(e,"use",r.name||"use",o),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 Y(e,t,n,r=!1){return vt(e,n),typeof n!="function"?(h(e,t,n,r),()=>{}):m(()=>{S(e,"attribute",t,n);let o=typeof n=="function"?n():n;h(e,t,o,r)})}function Z(e,t,n){return typeof n!="function"?(H(e,t,n),()=>{}):(vt(e,n),m(()=>{S(e,"property",t,n);let r=typeof n=="function"?n():n;H(e,t,r)}))}function Ct(e,t,n){return typeof n!="function"?(h(e,t,!!n),()=>{}):m(()=>{S(e,"attribute",t,n);let r=n();h(e,t,!!r)})}function F(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){m(()=>{S(e,"attribute","class",t),F(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 fe(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(m(()=>{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 de(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=Pn,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!_e(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===K,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"){V(c,t);continue}if(l==="use"){At(t,c);continue}if(l.startsWith("on:")){a.push(St(t,l.slice(3),c));continue}if(l.startsWith("prop:")){v(t,"prop",l.slice(5),c),a.push(Z(t,l.slice(5),c));continue}if(l.startsWith("attr:")){v(t,"attr",l.slice(5),c),a.push(Y(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){v(t,"bool",l.slice(5),c),a.push(Ct(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(m(()=>{S(t,"attribute","class",c),F(t,c())})):F(t,c);continue}if(l==="classList"){ue(t,"class",c),typeof c=="function"?a.push(m(()=>{S(t,"attribute","class",c),fe(t,c())})):fe(t,c,a);continue}if(l==="style"){ue(t,"style",c),typeof c=="function"?a.push(m(()=>{S(t,"attribute","style",c),de(t,c())})):de(t,c);continue}if(l.startsWith("on")){let p=l.slice(2).toLowerCase();f&&le(t,p),c&&je(t,p,c);continue}let d=Pe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?Z(t,l,c):Y(t,l,c,s)):a.push(m(()=>d?H(t,l,n[l]):h(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();le(t,c)}else Pe.has(l)?H(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ge(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){V(o,e);continue}if(r!=="children"){if(r==="use"){At(e,o);continue}if(r.startsWith("on:")){St(e,r.slice(3),o);continue}if(r.startsWith("prop:")){v(e,"prop",r.slice(5),o),Z(e,r.slice(5),o);continue}if(r.startsWith("attr:")){v(e,"attr",r.slice(5),o),Y(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){v(e,"bool",r.slice(5),o),Ct(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(pe.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,ae.has(i)||ye([i]);continue}if(r==="class"||r==="className"){F(e,o);continue}if(r==="classList"){ue(e,"class",o),typeof o=="function"?m(()=>{S(e,"attribute","class",o),fe(e,o())}):fe(e,o);continue}if(r==="style"){ue(e,"style",o),typeof o=="function"?m(()=>{S(e,"attribute","style",o),de(e,o())}):de(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=J(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});L(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=J(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});L(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=J(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});L(()=>{i()})}else m(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=J(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});L(()=>{s()})}else{let i=!0;m(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=J(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();Me(e,r,s,n)});L(()=>{i()})}else m(()=>Me(e,r,t[r],n))}}}function Mt(...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 Zo(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 V(e,t){if(!e)return;let n=e[se]?.name;if(v(t,"ref",n||typeof e=="function"&&e.name||"ref",e),j(e)){let r=t,o=e;if(!r)return;typeof r=="function"?r(o):typeof r=="object"&&"current"in r&&(r.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Pt(e,t,n){let r=t||document.body,o=An(()=>e),i=[];return xt(()=>{let s=m(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):j(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),L(()=>{i.forEach(a=>a())})}),null}function Qo(e){return typeof e=="string"&&e.toLowerCase()===e}function kt(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 ei(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function ie(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ti(e){return typeof e=="function"&&e.length===0&&b(e)}function he(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return vn(s=>{xt(()=>{u.active||(t.textContent=""),Le(t),De(),E(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}function Ot(e){if(Array.isArray(e))return e;if(typeof e=="function"&&typeof e.set=="function")return[e,e.set];throw new TypeError("[fluixi] bind: needs a signal — either `signal(…)` or the `[get, set]` pair from `createSignal(…)`.")}import{untrack as In,isSignal as qn,reportReactiveProps as jn}from"@fluixi/reactive";var Hn="__fx_dom_create_component__",D=globalThis[Hn]??={fn:null};function ii(e){D.fn=e}function si(e={}){let t=e.signalSystem?.createComponent;t&&(D.fn=t)}function xe(e,t){if(D.fn)return D.fn(e,t);t&&jn(t);let n=typeof e=="function"?In(()=>e(t)):e,r=n!=null&&(typeof n=="function"||typeof n=="object");if(r)try{n.$name=e?.name}catch{}return r&&!qn(n)?ft(n):n}var ai=()=>D.fn!==null,Lt=()=>D.fn!==null;function Dt(){D.fn=null}var Te,$t={getStore:()=>Te,run(e,t){let n=Te;Te=e;try{return t()}finally{Te=n}}},Ve=$t;function It(e){Ve=e??$t}function Q(e={}){e.locals||(e.locals=e.request?Ue(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 ee(e,t){return Ve.run(e,t)}function M(){return Ve.getStore()}function We(){return M()?.event}function qt(){let e=We();return e?(e.locals||(e.locals={}),e.locals):{}}var _t=new WeakMap;function Ue(e){let t=_t.get(e);return t||(t={},_t.set(e,t)),t}import{setResourceIdSource as Fn,setServerDataGetter as Vn}from"@fluixi/reactive/signal";var te="__FX_DATA__";function be(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Be;function Ee(){let e=globalThis.__FX_DATA__;if(e)return e;if(Be!==void 0)return Be;let t=null;if(typeof document<"u"){let n=document.getElementById(te)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Be=t}function we(){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 Wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ne=typeof process<"u"&&process.env&&!1;function Se(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Un(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Wn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ne&&t&&Se(`<${e}>`,t),null)}function Bn(e){we();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(Ne&&t&&Se(`<${e}> (static)`,t),null)}function Kn(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}we();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ne&&t&&Se(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function zn(e){we();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ne&&t&&Se(`marker <!--${e.slice(0,24)}-->`,t),null)}var jt=!1;function Gn(){jt||(jt=!0,yt({hydrateElement:Un,hydrateText:Kn,hydrateMarker:zn,hydrateStatic:Bn}))}function ne(e,t,n){Gn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=Ee(),o=n?.resourceNamespace,i=0;Fn(()=>o?`${o}:r${i++}`:`r${i++}`),Vn(r?s=>s in r?{value:r[s]}:void 0:null);try{return he(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ke="fluixi-island";function Xn(e){let{component:t,props:n={},name:r}=e,o=me(Ke),i=r??t.name??"Island";h(o,"name",i),h(o,"props",JSON.stringify(n??{}));let s=g()?M():void 0;if(s){let a=s.nextIslandNamespace(i);E(o,()=>s.withResourceScope(a,()=>t(n)))}else E(o,()=>t(n));return o}var Ht=!1;function Jn(){if(Ht||typeof document>"u")return;Ht=!0;let e=document.createElement("style");e.textContent=`${Ke}{display:contents}`,document.head.appendChild(e)}function Yn(e){if(typeof document>"u")return;Jn();let t=document.querySelectorAll(Ke),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{}ne(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function Zn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Qn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as er}from"@fluixi/reactive/signal";function $i(e,t={}){if(typeof e=="function")return xe(e,t);if(typeof e!="string"||e.length===0)return null;let n=kt(e);if(g())return q().createElement(e,n);let r=n?document.createElementNS(K,e):document.createElement(e);return ge(r,t,n),tr(r,t),r}function tr(e,t){if(!t||t.children===void 0)return;let n=er(()=>t.children),r=o=>{E(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createChildOwner as nr,createMemo as ze,disposeScope as rr,getOwner as or,runWithOwner as ir,untrack as Ut}from"@fluixi/reactive/signal";function Ft(e){return typeof e=="function"?e:(()=>e)}function k(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Vt(e){return e!=null&&e!==!1}function Wt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function sr(e){let t=k(()=>e.when),n=ze(t,void 0,{name:"Show.when"}),r=ze(n,void 0,{name:"Show.cond"}),o=or(),i=null,s=null,a=l=>{l!==s&&(i&&rr(i),i=nr(o),s=l)};return ze(()=>{let l=r();return a(l?"when":"fallback"),ir(i,()=>{if(l){let c=e.children;return typeof c=="function"&&!Wt(c)?typeof n=="function"?Ut(()=>Ut(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"Show.result"})}import{mapArray as ar,keyArray as lr}from"@fluixi/reactive/signal";function cr(e){let t=k(()=>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 X(a),a};return e.by?lr(t,e.by,(o,i)=>r(o,i),{fallback:n}):ar(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as ur}from"@fluixi/reactive/signal";function fr(e){let t=k(()=>e.each);return ur(t,(n,r)=>{let o=e.children(n,r);return X(o),o},{fallback:()=>e.fallback??null})}import{mapArray as Os,keyArray as Ls,indexArray as Ds}from"@fluixi/reactive/signal";import{createMemo as dr,createChildOwner as pr,disposeScope as yr,getOwner as mr,runWithOwner as Bt}from"@fluixi/reactive/signal";var Ge=Symbol("match");function gr(e){return{[Ge]:!0,when:k(()=>e.when),get children(){return e.children}}}function hr(e){let t=Array.isArray(e.children)?e.children:[e.children],n=mr(),r=null,o=-1,i=s=>{s!==o&&(r&&yr(r),r=pr(n),o=s)};return dr(()=>{for(let s=0;s<t.length;s+=1){let l=t[s],c=0;for(;typeof l=="function"&&!l[Ge]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ge]!==!0)continue;let f=l.when();if(Vt(f))return i(s),Bt(r,()=>typeof l.children=="function"?l.children(f):l.children)}return i(-2),Bt(r,()=>e.fallback??null)},void 0,{name:"Switch"})}import{createMemo as xr,createChildOwner as Tr,disposeScope as br,getOwner as Er,runWithOwner as wr}from"@fluixi/reactive/signal";function Nr(e){let t=Ft(e.component),{component:n,...r}=e,o=Er(),i=null,s;return xr(()=>{let a=t();return a!==s&&(i&&br(i),i=Tr(o),s=a),a==null?null:typeof a=="string"?{tag:a,props:r}:wr(i,()=>a(r))},void 0,{name:"Dynamic"})}import{createRoot as Sr,onCleanup as vr}from"@fluixi/reactive/signal";function Ar(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Sr(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),E(r,e.children)&&V(e.ref,r)}),vr(()=>{n(),r.remove()}),null}import{createMemo as Cr,createSignal as Rr}from"@fluixi/reactive/signal";function Kt(e){if(g())return e.fallback??null;let t=u.active,[n,r]=Rr(!t);return t&&queueMicrotask(()=>r(!0)),Cr(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Mr=Kt;import{createMemo as Pr,createSignal as kr}from"@fluixi/reactive/signal";function Or(e){let[t,n]=kr(null),r=()=>n(null);return Pr(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}},void 0,{name:"ErrorBoundary"})}import{createMemo as Lr}from"@fluixi/reactive/signal";function Dr(e){return Lr(()=>{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(" ")},void 0,{name:"ClassMap"})}import{createMemo as _r}from"@fluixi/reactive/signal";function $r(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function Ir(e){return _r(()=>{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(`${$r(r)}: ${i}`)}return n.join("; ")},void 0,{name:"StyleMap"})}var Ae=1,Ye=3,Ze=8,zt;zt=G;var W=class{constructor(){this[zt]=!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(){}},_=class e extends W{constructor(n){super();this.nodeType=Ye;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)}},ve=class e extends W{constructor(n){super();this.nodeType=Ae;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},U=class e extends W{constructor(n){super();this.nodeType=Ze;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Xe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Je=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}},$=class e extends W{constructor(n,r=!1){super();this.nodeType=Ae;this.attributes=new Map;this.style=new Xe;this.classList=new Je(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 _(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 qr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Xt=/&/g,Jt=/</g,Yt=/>/g,jr=/"/g;function Qe(e){return e.replace(Xt,"&").replace(Jt,"<").replace(Yt,">")}function Gt(e){return e.replace(Xt,"&").replace(jr,""").replace(Jt,"<").replace(Yt,">")}function Hr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Fr(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(`${Hr(n)}: ${r}`)}return t.join("; ")}function Vr(e){let t="",n=Fr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Gt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Gt(o)}"`}return t}function A(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Qe(e);if(typeof e=="number")return Qe(String(e));if(typeof e=="function")return A(e());if(Array.isArray(e))return e.map(A).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case Ye:return Qe(e.data??"");case Ze:return`<!--${e.data??""}-->`;case Ae:{let t=e.localName,n=`<${t}${Vr(e)}>`;if(qr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(A).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(A).join(""):""}import{createRoot as rn}from"@fluixi/reactive/signal";import{setResourceTracker as Br,setResourceIdSource as Kr,setResourceDataSink as zr,getOwner as Gr,runWithOwner as en,flush as Xr}from"@fluixi/reactive/signal";var Wr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ur={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function Zt(e){return e.replace(/&(#?\w+);/g,(t,n)=>Ur[n]??t)}var w=class extends Error{};function Qt(e,t=!1){let n=0,r=[],o=[],i=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new w(`unterminated comment at ${c}`);i(new U(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new w(`unterminated closing tag at ${c}`);let d=e.slice(c+2,f).trim().toLowerCase(),p=o.pop();if(!p||p.localName!==d)throw new w(`</${d}> does not close <${p?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new w(`unclosed <${o[o.length-1].localName}>`);let s=r[0];if(r.length!==1||!(s instanceof $))throw new w(`expected exactly one root element, got ${r.length}`);return s;function a(c){c!==""&&i(new _(Zt(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new w(`unterminated tag at ${c}`);let d=e.slice(c+1,c+1+f.index).toLowerCase(),p=new $(d,t),y=c+1+f.index;for(;y<e.length;){for(;y<e.length&&/\s/.test(e[y]);)y++;if(e[y]===">"){y++;break}if(e[y]==="/"&&e[y+1]===">"){y+=2;break}let Ce=y;for(;y<e.length&&!/[\s=/>]/.test(e[y]);)y++;let B=e.slice(Ce,y);if(B==="")throw new w(`malformed attribute at ${y}`);if(e[y]==="="){if(e[y+1]!=='"')throw new w(`attribute ${B} must have a double-quoted value`);let Re=e.indexOf('"',y+2);if(Re===-1)throw new w(`unterminated value for ${B}`);p.setAttribute(B,Zt(e.slice(y+2,Re))),y=Re+1}else p.setAttribute(B,"")}return i(p),Wr.has(d)||o.push(p),y}}var tn=!1;function on(){tn||(tn=!0,dt({createElement:(e,t)=>new $(e,t),createText:e=>new _(e),createRaw:e=>new ve(e),parseTemplate:(e,t)=>Qt(e,t),createComment:e=>new U(e)}))}function sn(e,t={}){let n=g();on(),I(!0);let r=Q(t.event);try{return ee(r,()=>rn(o=>{try{let i=typeof e=="function"?e():e;return A(i)}finally{o()}}))}finally{I(n)}}var nn=!1;function Jr(){nn||(nn=!0,Br(e=>{M()?.pending.add(e)}),Kr(()=>M()?.nextResourceId()??""),zr((e,t)=>{e&&M()?.data.set(e,t)}))}var et=null;function an(e){et=e}function tt(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(et)try{i=et(o,r)}catch{continue}i!==void 0&&(typeof i=="function"||typeof i=="symbol"||(t[r]=i))}if(Object.keys(t).length===0)return"";let n=be(JSON.stringify(t));return n==="{}"?"":`<script type="application/json" id="${te}">${n}<\/script>`}var Yr=50;async function ln(e,t={}){let n=g();on(),I(!0),Jr();let r=Q(t.event);try{return await ee(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};rn(f=>{s=f,i=Gr(),o=typeof e=="function"?e():e});let a=()=>{try{en(i,()=>A(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Yr;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Xr(),a()}let c=en(i,()=>A(o))+tt(r);return s(),c})}finally{I(n)}}var Zr={createComponent:xe,createElement:lt,createNativeElement:me,createTemplate:He,cloneTemplate:Fe,templateNode:bt,holeContent:Nt,holeEnd:wt,holeScope:Et,createPortal:Pt,render:he,hydrate:ne,insert:E,appendChildren:ut,removeChildren:ct,spread:Rt,applyProps:ge,mergeProps:Mt,bindPair:Ot,setProperty:H,setDynamicProperty:Z,setAttribute:h,setDynamicAttribute:Y,removeAttribute:at,getAttribute:st,setClassName:F,addClass:rt,removeClass:ot,toggleClass:it,setStyles:ke,delegateEvents:ye,addDelegatedEventListener:je,removeDelegatedEventListener:le,handleRef:V,resetIntegration:Dt,isIntegrationInitialized:Lt},Ta=Zr;export{Kt as ClientOnly,Nr as Dynamic,Or as ErrorBoundary,te as FX_DATA_ID,cr as For,fr as Index,Xn as Island,Pe as JSX_PROPERTIES,gr as Match,Mr as NoSsr,Ar as Portal,oo as SVG_ELEMENTS,K as SVG_NAMESPACE,sr as Show,hr as Switch,Oe as VERSION,ro as VOID_ELEMENTS,rt as addClass,je as addDelegatedEventListener,St as addNativeEventListener,ut as appendChildren,Me as applyElementProp,ge as applyProps,At as applyUse,ft as asComponent,Lo as asContext,ko as asOutlet,Oo as asProvider,Po as asRoute,Ro as asRouter,Mo as asRoutes,Do as asSuspense,Ot as bindPair,Nn as captureHydrationCursor,_o as checkRenderType,Dr as classMap,O as cleanChildren,Fe as cloneTemplate,so as closest,xe as createComponent,$i as createDynamicElement,lt as createElement,me as createNativeElement,Pt as createPortal,Q as createRequestContext,He as createTemplate,Ta as default,po as delegate,ye as delegateEvents,be as escapeFxJson,ei as escapeHTML,Jo as fnName,zo as generateID,st as getAttribute,wo as getGlobal,to as getLitEventName,qt as getLocals,fo as getOffset,M as getRequestContext,We as getRequestEvent,Ue as getRequestLocals,Ee as getServerData,Ko as getStableElementId,lo as getStyle,V as handleRef,ao as hasClass,Nt as holeContent,wt as holeEnd,Et as holeScope,Zn as html,ne as hydrate,X as hydrateAdvancePast,Yn as hydrateIslands,Ds as indexArray,si as initializeIntegration,E as insert,ce as insertExpression,ai as intergartionInitialized,ti as isAccessor,N as isComponent,Tn as isContext,cn as isCustomElement,bo as isDOMNode,Go as isDelegatedEvent,_e as isDomElement,j as isDomNode,$e as isDomText,eo as isEventHandler,Xo as isFunction,Lt as isIntegrationInitialized,To as isJSXTemplate,fn as isLitTemplateResult,Qo as isNativeElement,hn as isOutlet,ie as isPromise,xn as isProvider,ho as isReactElement,gn as isRoute,yn as isRouter,mn as isRoutes,kt as isSVGElement,g as isServer,bn as isSuspense,xo as isTemplateFactory,co as isVisible,Yo as iterateFn,Ls as keyArray,Ln as makeArrayFlat,Os as mapArray,Mt as mergeProps,mo as observeIntersection,go as observeResize,nt as query,io as queryAll,pn as registerCoreVersion,ii as registerCreateComponent,Eo as registerGlobal,at as removeAttribute,ct as removeChildren,ot as removeClass,le as removeDelegatedEventListener,he as render,sn as renderToString,ln as renderToStringAsync,Dt as resetIntegration,oe as runHydrationAt,ee as runWithRequestContext,Sn as runWithoutHydration,uo as scrollIntoView,A as serializeNode,tt as serializeResourceData,h as setAttribute,fe as setClassList,F as setClassName,an as setDataRedactor,Y as setDynamicAttribute,Ct as setDynamicBoolAttribute,Z as setDynamicProperty,H as setProperty,It as setRequestStore,I as setServerMode,de as setStyle,ke as setStyles,no as shouldSetAsProperty,Zo as splitProps,Rt as spread,Le as stampVersions,Ir as styleMap,Qn as svg,bt as templateNode,Qr as toAttributeName,it as toggleClass,x as versions,yo as waitForElement,De as warnOnVersionSkew};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var M=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var ee=Object.getOwnPropertyNames;var te=Object.prototype.hasOwnProperty;var ne=(e,t)=>{for(var n in t)M(e,n,{get:t[n],enumerable:!0})},oe=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of ee(t))!te.call(e,s)&&s!==n&&M(e,s,{get:()=>t[s],enumerable:!(o=Q(t,s))||o.enumerable});return e};var re=e=>oe(M({},"__esModule",{value:!0}),e);var Te={};ne(Te,{createDynamicElement:()=>Ee});module.exports=re(Te);var m=require("@fluixi/reactive/signal");var P="http://www.w3.org/2000/svg";function ie(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ie(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Se=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function j(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var c=require("@fluixi/reactive/signal");var S=typeof document>"u";var F=Symbol.for("fluixi.server-node"),$=null;function w(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function A(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},se=null;function k(){return se}function H(e,t){return b.active&&t.parentNode===e}function W(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function fe(e){if(!S)for(let t of e)D.has(t)||B.has(t)||(D.add(t),document.addEventListener(t,ae))}function ae(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(S)return w().createText(e);if(b.active&&!t){let n=k()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,le=200;function ue(e,t,n,o,s){let a=o,r=new Map;return(0,c.createRenderEffect)(()=>{let i;if(E(e)&&!(0,m.isSignal)(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(i=r.get(e);typeof i=="function"&&(0,m.isSignal)(i);)i=i()}else for(i=e();typeof i=="function"&&(0,m.isSignal)(i);)i=i();{let f=0;for(;typeof i=="function"&&f++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if((0,m.isSignal)(i))i=i();else if(i=i(),typeof i!="function"||!(0,m.isSignal)(i)&&!E(i))break}x++;try{a=C(t,i,n,a,r),s(a)}finally{x--}})}function _(e,t,n,o){if(x>le)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{s=C(e,t,n,s)}finally{x--}return()=>s}let i=ue(r(t),e,n,s,f=>{s=f});return()=>(i?.(),s)}function C(e,t,n,o,s){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(v(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(i=>{r.parentNode===e&&C(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return p(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&I(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||p(e,r,n),r}if(A(t))return H(e,t)?(W(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,s,f);let l=ce(e,i,r,n);for(let u of f){let d=_(e,u.sig,u.marker);(0,c.onCleanup)(()=>{T(e,d()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let f=i.type(i.props||{});return C(e,f,n,o)}}}return T(e,o,n)}function g(e,t,n,o,s=!0,a,r){for(let i=0;i<e.length;i++){let f=e[i];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!v(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!v(l)&&!(0,m.isSignal)(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if((0,m.isSignal)(l)){if(r){let d=h("",!0);t.push(d),r.push({marker:d,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,m.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,s,a):g([u],t,n,o,s,a);continue}continue}Array.isArray(l)?g(l,t,n,o,s,a,r):g([l],t,n,o,s,a,r);continue}if(v(f)){let l=h("",!0);t.push(l),f.then(u=>{if(l.parentNode){let d=[];if(g([u],d,l.parentNode,void 0,!1,a),d.length>0){l.parentNode.replaceChild(d[0],l);for(let y=1;y<d.length;y++)l.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,s,a,r);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function ce(e,t,n,o){for(let d=0;d<n.length;d++){let y=n[d].parentNode;y!==null&&y!==e&&y.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let s=n.length,a=t.length,r=s,i=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||f<r;){if(t[i]===n[f]){i++,f++;continue}for(;a>i&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===i){let d=r<s?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],d)}else if(r===f)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[f]===t[a-1]){let d=t[--a].nextSibling;p(e,n[f++],t[i++].nextSibling),p(e,n[--r],d),t[a]=t[i-1]}else{if(!u){u=new Map;let y=f;for(;y<r;)u.set(n[y],y++)}let d=u.get(t[i]);if(d!=null)if(f<d&&d<r){let y=i,R=1;for(;++y<a&&y<r&&!(!u.has(t[y])||u.get(t[y])!==d+R);)R++;if(R>d-f){let Z=t[i];for(;f<d;)p(e,n[f++],Z)}else t[i].parentNode===e?e.replaceChild(n[f++],t[i++]):(p(e,n[f++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function V(e,t,n){n==null?delete e[t]:e[t]=n}function de(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ye(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function pe(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):(0,c.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;N(e,t,s,o)})}function me(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):(0,c.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;V(e,t,o)})}function ge(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):(0,c.createRenderEffect)(()=>{let o=n();N(e,t,!!o)})}function G(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,c.createRenderEffect)(()=>G(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function q(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,c.createRenderEffect)(()=>{let r=!!s();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof s=="function"?s():s);for(let i of a)e.classList.toggle(i,r)}}}function K(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let s=n[o];s==null?e.style[o]="":e.style[o]=s}}function U(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){xe(s,e);continue}if(o!=="children"){if(o==="use"){ye(e,s);continue}if(o.startsWith("on:")){de(e,o.slice(3),s);continue}if(o.startsWith("prop:")){me(e,o.slice(5),s);continue}if(o.startsWith("attr:")){pe(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){ge(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(B.has(a)){e[`$$${a}`]=s;let r=`__fx_${a}`;if(!e[r]){let i=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=s,D.has(a)||fe([a]);continue}if(o==="class"||o==="className"){G(e,s);continue}if(o==="classList"){typeof s=="function"?(0,c.createRenderEffect)(()=>q(e,s())):q(e,s);continue}if(o==="style"){typeof s=="function"?(0,c.createRenderEffect)(()=>K(e,s())):K(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function";)r=r();e.innerHTML=r});(0,c.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,r=(0,c.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});(0,c.onCleanup)(()=>{r()})}else{let a=!0;(0,c.createRenderEffect)(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof s=="function"){let a=(0,c.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();O(e,o,r,n)});(0,c.onCleanup)(()=>{a()})}else(0,c.createRenderEffect)(()=>O(e,o,t[o],n))}}}function xe(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function v(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var L=require("@fluixi/reactive");var he="__fx_dom_create_component__",X=globalThis[he]??={fn:null};function J(e,t){if(X.fn)return X.fn(e,t);let n=typeof e=="function"?(0,L.untrack)(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!(0,L.isSignal)(n)){try{n.$name=e?.name}catch{}return j(n)}return n}var Y=require("@fluixi/reactive/signal");function Ee(e,t={}){if(typeof e=="function")return J(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return U(o,t,n),be(o,t),o}function be(e,t){if(!t||t.children===void 0)return;let n=(0,Y.readChildren)(()=>t.children),o=s=>{_(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
|
|
1
|
+
"use strict";var P=Object.defineProperty;var ne=Object.getOwnPropertyDescriptor;var oe=Object.getOwnPropertyNames;var re=Object.prototype.hasOwnProperty;var ie=(e,t)=>{for(var n in t)P(e,n,{get:t[n],enumerable:!0})},se=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of oe(t))!re.call(e,r)&&r!==n&&P(e,r,{get:()=>t[r],enumerable:!(o=ne(t,r))||o.enumerable});return e};var fe=e=>se(P({},"__esModule",{value:!0}),e);var Ae={};ie(Ae,{createDynamicElement:()=>Se});module.exports=fe(Ae);var m=require("@fluixi/reactive/signal");var M="http://www.w3.org/2000/svg";function ae(e){return e.localName.includes("-")}function H(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ae(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Re=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function k(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var l=require("@fluixi/reactive/signal");var $=Symbol.for("fluixi.server-node"),le=Symbol.for("fluixi.dom.server-host"),ue=globalThis,O=ue[le]??={server:typeof document>"u",nodes:null};function S(){return O.server}function v(){if(!O.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return O.nodes}function A(e){return e!=null&&e[$]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[$]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},ce=null;function I(){return ce}function _(e,t){return b.active&&t.parentNode===e}function W(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var G="__fx_at";var D=new Set,U=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function de(e){if(!S())for(let t of e)D.has(t)||U.has(t)||(D.add(t),document.addEventListener(t,pe))}function pe(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(S())return v().createText(e);if(b.active&&!t){let n=I()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,ye=200;function me(e,t,n,o,r){let a=o,i=new Map;return(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(n??t,"content",void 0,e);let s;if(E(e)&&!(0,m.isSignal)(e)){if(!i.has(e)){x++;try{let f=e();i.set(e,f)}finally{x--}}for(s=i.get(e);typeof s=="function"&&(0,m.isSignal)(s);)s=s()}else for(s=e();typeof s=="function"&&(0,m.isSignal)(s);)s=s();{let f=0;for(;typeof s=="function"&&f++<50;)if(E(s)){if(!i.has(s)){let u=s;x++;try{let c=u();i.set(u,c)}finally{x--}}s=i.get(s)}else if((0,m.isSignal)(s))s=s();else if(s=s(),typeof s!="function"||!(0,m.isSignal)(s)&&!E(s))break}x++;try{a=R(t,s,n,a,i),r(a)}finally{x--}})}function j(e,t,n,o){if(x>ye)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let r=o??null,a=f=>Array.isArray(f)&&f.some(u=>typeof u=="function"),i=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{r=R(e,t,n,r)}finally{x--}return()=>r}let s=me(i(t),e,n,r,f=>{r=f});return()=>(s?.(),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(C(t)){let i=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(i,o[0]),T(e,o.slice(1),n)):y(e,i,n):o?e.replaceChild(i,o):y(e,i,n),t.then(s=>{i.parentNode===e&&R(e,s,i.nextSibling,i)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),i}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let s=h(t);return y(e,s,n),s}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&F(o))return o.data=t,o;let i=h(t);return o&&o.parentNode===e?e.replaceChild(i,o):_(e,i)||y(e,i,n),i}if(A(t))return _(e,t)?(W(t),t):Array.isArray(o)?(o.length===0?y(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let i=[],s=Array.isArray(o)?o:o?[o]:[],f=[];g(t,i,e,n,!0,r,f);let u=ge(e,s,i,n);for(let c of f){let d=j(e,c.sig,c.marker);(0,l.onCleanup)(()=>{T(e,d()),c.marker.parentNode===e&&e.removeChild(c.marker)})}return u}if(a==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let s=i;if(typeof s.type=="function"){let f=s.type(s.props||{});return R(e,f,n,o)}}}return T(e,o,n)}function g(e,t,n,o,r=!0,a,i){for(let s=0;s<e.length;s++){let f=e[s];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!C(f)&&!(0,m.isSignal)(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let u;for(E(f)&&!(0,m.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),u=a.get(f)):u=f();typeof u=="function"&&!C(u)&&!(0,m.isSignal)(u)&&!E(u);)a||(a=new Map),a.has(u)||a.set(u,u()),u=a.get(u);if(u==null||typeof u=="boolean")continue;if(typeof u=="function"){if((0,m.isSignal)(u)){if(i){let d=h("",!0);t.push(d),i.push({marker:d,sig:u});continue}let c=u();for(;typeof c=="function"&&(0,m.isSignal)(c);)c=c();if(c==null||typeof c=="boolean")continue;Array.isArray(c)?g(c,t,n,o,r,a):g([c],t,n,o,r,a);continue}continue}Array.isArray(u)?g(u,t,n,o,r,a,i):g([u],t,n,o,r,a,i);continue}if(C(f)){let u=h("",!0);t.push(u),f.then(c=>{if(u.parentNode){let d=[];if(g([c],d,u.parentNode,void 0,!1,a),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(f)){g(f,t,n,o,r,a,i);continue}if(A(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let u=f;if(typeof u.type=="function"){let c=u.type(u.props||{});Array.isArray(c)?g(c,t,n,o,!1,a):g([c],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let u=String(f);if(u.trim()===""&&u!==" ")continue;t.push(h(u));continue}t.push(h(String(f)))}}}}function ge(e,t,n,o){for(let d=0;d<n.length;d++){let p=n[d].parentNode;p!==null&&p!==e&&p.nodeType!==11&&(n=n.slice(),n[d]=n[d].cloneNode(!0))}let r=n.length,a=t.length,i=r,s=0,f=0,u=a>0?t[a-1].nextSibling??void 0:o,c=null;for(;s<a||f<i;){if(t[s]===n[f]){s++,f++;continue}for(;a>s&&i>f&&t[a-1]===n[i-1];)a--,i--;if(a===s){let d=i<r?f?n[f-1].nextSibling??void 0:n[i-f]:u;for(;f<i;)y(e,n[f++],d)}else if(i===f)for(;s<a;)(!c||!c.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===n[i-1]&&n[f]===t[a-1]){let d=t[--a].nextSibling;y(e,n[f++],t[s++].nextSibling),y(e,n[--i],d),t[a]=t[s-1]}else{if(!c){c=new Map;let p=f;for(;p<i;)c.set(n[p],p++)}let d=c.get(t[s]);if(d!=null)if(f<d&&d<i){let p=s,L=1;for(;++p<a&&p<i&&!(!c.has(t[p])||c.get(t[p])!==d+L);)L++;if(L>d-f){let te=t[s];for(;f<d;)y(e,n[f++],te)}else t[s].parentNode===e?e.replaceChild(n[f++],t[s++]):(y(e,n[f++],u),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function V(e,t,n){n==null?delete e[t]:e[t]=n}function xe(e,t,n){let o=n,r;return Array.isArray(n)&&(o=n[0],r=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,r),()=>e.removeEventListener(t,o,r))}function z(e,t){if(!t||typeof t!="function")return;let n=t[G]?.name;if(!n)return;let o=n.indexOf(":");o!==-1&&(0,l.reportReactiveDirective)(e,n.slice(0,o),n.slice(o+1),t)}function q(e,t,n){let o=typeof n=="function"?(0,l.untrack)(()=>n()):n;if(!(!o||typeof o!="object"))for(let r of Object.keys(o))(0,l.reportReactiveDirective)(e,t,r)}function he(e,t){let n=(o,r)=>{typeof o=="function"&&((0,l.reportReactiveDirective)(e,"use",o.name||"use",r),o(e,r??(()=>{})))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function Ee(e,t,n,o=!1){return z(e,n),typeof n!="function"?(N(e,t,n,o),()=>{}):(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute",t,n);let r=typeof n=="function"?n():n;N(e,t,r,o)})}function be(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):(z(e,n),(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"property",t,n);let o=typeof n=="function"?n():n;V(e,t,o)}))}function Te(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute",t,n);let o=n();N(e,t,!!o)})}function X(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute","class",t),X(e,t())});return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let r=t[o];return typeof r=="function"?r():!!r}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function K(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let r=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof r=="function"&&n)n.push((0,l.createRenderEffect)(()=>{let i=!!r();for(let s of a)e.classList.toggle(s,i)}));else{let i=!!(typeof r=="function"?r():r);for(let s of a)e.classList.toggle(s,i)}}}function B(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 J(e,t,n=!1){for(let o in t){let r=t[o];if(o==="ref"){Ne(r,e);continue}if(o!=="children"){if(o==="use"){he(e,r);continue}if(o.startsWith("on:")){xe(e,o.slice(3),r);continue}if(o.startsWith("prop:")){(0,l.reportReactiveDirective)(e,"prop",o.slice(5),r),be(e,o.slice(5),r);continue}if(o.startsWith("attr:")){(0,l.reportReactiveDirective)(e,"attr",o.slice(5),r),Ee(e,o.slice(5),r,n);continue}if(o.startsWith("bool:")){(0,l.reportReactiveDirective)(e,"bool",o.slice(5),r),Te(e,o.slice(5),r);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof r=="function")if(U.has(a)){e[`$$${a}`]=r;let i=`__fx_${a}`;if(!e[i]){let s=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,s),e[i]=s}}else e[`$$${a}`]=r,D.has(a)||de([a]);continue}if(o==="class"||o==="className"){X(e,r);continue}if(o==="classList"){q(e,"class",r),typeof r=="function"?(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute","class",r),K(e,r())}):K(e,r);continue}if(o==="style"){q(e,"style",r),typeof r=="function"?(0,l.createRenderEffect)(()=>{(0,l.reportReactiveBinding)(e,"attribute","style",r),B(e,r())}):B(e,r);continue}if(o==="innerHTML"){if(typeof r=="function"){let a=(0,l.createEffect)(()=>{let i=r();for(;typeof i=="function";)i=i();e.innerHTML=i});(0,l.onCleanup)(()=>a())}else e.innerHTML=r;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof r=="function"){let a=(0,l.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof r=="function"){let a=(0,l.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof r=="function"){let a=!0,i=(0,l.createEffect)(()=>{let s=r();for(;typeof s=="function"&&s.length===0;)s=s();a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""});(0,l.onCleanup)(()=>{i()})}else{let a=!0;(0,l.createRenderEffect)(()=>{let i=t[o];a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof r=="function"){let a=(0,l.createEffect)(()=>{let i=r();for(;typeof i=="function"&&i.length===0;)i=i();H(e,o,i,n)});(0,l.onCleanup)(()=>{a()})}else(0,l.createRenderEffect)(()=>H(e,o,t[o],n))}}}function Ne(e,t){if(!e)return;let n=e[G]?.name;if((0,l.reportReactiveDirective)(t,"ref",n||typeof e=="function"&&e.name||"ref",e),A(e)){let o=t,r=e;if(!o)return;typeof o=="function"?o(r):typeof o=="object"&&"current"in o&&(o.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Y(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 C(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var w=require("@fluixi/reactive");var we="__fx_dom_create_component__",Z=globalThis[we]??={fn:null};function Q(e,t){if(Z.fn)return Z.fn(e,t);t&&(0,w.reportReactiveProps)(t);let n=typeof e=="function"?(0,w.untrack)(()=>e(t)):e,o=n!=null&&(typeof n=="function"||typeof n=="object");if(o)try{n.$name=e?.name}catch{}return o&&!(0,w.isSignal)(n)?k(n):n}var ee=require("@fluixi/reactive/signal");function Se(e,t={}){if(typeof e=="function")return Q(e,t);if(typeof e!="string"||e.length===0)return null;let n=Y(e);if(S())return v().createElement(e,n);let o=n?document.createElementNS(M,e):document.createElement(e);return J(o,t,n),ve(o,t),o}function ve(e,t){if(!t||t.children===void 0)return;let n=(0,ee.readChildren)(()=>t.children),o=r=>{j(e,r,typeof r=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
|
|
@@ -31,7 +31,7 @@ export function createDynamicElement(type, props = {}) {
|
|
|
31
31
|
if (typeof type !== 'string' || type.length === 0)
|
|
32
32
|
return null;
|
|
33
33
|
const svgTag = isSVGElement(type);
|
|
34
|
-
if (isServer)
|
|
34
|
+
if (isServer())
|
|
35
35
|
return getServerNodes().createElement(type, svgTag);
|
|
36
36
|
const element = svgTag
|
|
37
37
|
? document.createElementNS(SVG_NAMESPACE, type)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSignal as m}from"@fluixi/reactive/signal";var P="http://www.w3.org/2000/svg";function Z(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Z(e)){e[t]=n;return}N(e,t,n,o)}function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ge=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function j(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Le,createEffect as A,createRenderEffect as p,createRoot as Re,onCleanup as S,readChildren as Me}from"@fluixi/reactive/signal";var w=typeof document>"u";var F=Symbol.for("fluixi.server-node"),$=null;function v(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function C(e){return e!=null&&e[F]===!0?!0:typeof Node<"u"&&e instanceof Node}function I(e){return e!=null&&e[F]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},Q=null;function k(){return Q}function H(e,t){return b.active&&t.parentNode===e}function W(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var D=new Set,B=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ee(e){if(!w)for(let t of e)D.has(t)||B.has(t)||(D.add(t),document.addEventListener(t,te))}function te(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(w)return v().createText(e);if(b.active&&!t){let n=k()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,ne=200;function oe(e,t,n,o,f){let a=o,r=new Map;return p(()=>{let i;if(E(e)&&!m(e)){if(!r.has(e)){x++;try{let s=e();r.set(e,s)}finally{x--}}for(i=r.get(e);typeof i=="function"&&m(i);)i=i()}else for(i=e();typeof i=="function"&&m(i);)i=i();{let s=0;for(;typeof i=="function"&&s++<50;)if(E(i)){if(!r.has(i)){let l=i;x++;try{let u=l();r.set(l,u)}finally{x--}}i=r.get(i)}else if(m(i))i=i();else if(i=i(),typeof i!="function"||!m(i)&&!E(i))break}x++;try{a=R(t,i,n,a,r),f(a)}finally{x--}})}function _(e,t,n,o){if(x>ne)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let f=o??null,a=s=>Array.isArray(s)&&s.some(l=>typeof l=="function"),r=s=>typeof s=="function"?s:()=>s;if(typeof t!="function"&&!a(t)){x++;try{f=R(e,t,n,f)}finally{x--}return()=>f}let i=oe(r(t),e,n,f,s=>{f=s});return()=>(i?.(),f)}function R(e,t,n,o,f){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(L(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):y(e,r,n):o?e.replaceChild(r,o):y(e,r,n),t.then(i=>{r.parentNode===e&&R(e,i,r.nextSibling,r)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let i=h(t);return y(e,i,n),i}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&I(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):H(e,r)||y(e,r,n),r}if(C(t))return H(e,t)?(W(t),t):Array.isArray(o)?(o.length===0?y(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let r=[],i=Array.isArray(o)?o:o?[o]:[],s=[];g(t,r,e,n,!0,f,s);let l=re(e,i,r,n);for(let u of s){let c=_(e,u.sig,u.marker);S(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let i=r;if(typeof i.type=="function"){let s=i.type(i.props||{});return R(e,s,n,o)}}}return T(e,o,n)}function g(e,t,n,o,f=!0,a,r){for(let i=0;i<e.length;i++){let s=e[i];if(!(s==null||typeof s=="boolean")){for(;typeof s=="function"&&!L(s)&&!m(s)&&!E(s)&&(s=s(),!(s==null||typeof s=="boolean")););if(!(s==null||typeof s=="boolean")){if(typeof s=="function"){let l;for(E(s)&&!m(s)?(a||(a=new Map),a.has(s)||a.set(s,s()),l=a.get(s)):l=s();typeof l=="function"&&!L(l)&&!m(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(m(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,f,a):g([u],t,n,o,f,a);continue}continue}Array.isArray(l)?g(l,t,n,o,f,a,r):g([l],t,n,o,f,a,r);continue}if(L(s)){let l=h("",!0);t.push(l),s.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(s)){g(s,t,n,o,f,a,r);continue}if(C(s)){t.push(s);continue}if(typeof s=="object"&&s!==null&&"type"in s&&"props"in s){let l=s;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof s=="string"||typeof s=="number"){let l=String(s);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(s)))}}}}function re(e,t,n,o){for(let c=0;c<n.length;c++){let d=n[c].parentNode;d!==null&&d!==e&&d.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let f=n.length,a=t.length,r=f,i=0,s=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;i<a||s<r;){if(t[i]===n[s]){i++,s++;continue}for(;a>i&&r>s&&t[a-1]===n[r-1];)a--,r--;if(a===i){let c=r<f?s?n[s-1].nextSibling??void 0:n[r-s]:l;for(;s<r;)y(e,n[s++],c)}else if(r===s)for(;i<a;)(!u||!u.has(t[i]))&&t[i].parentNode===e&&e.removeChild(t[i]),i++;else if(t[i]===n[r-1]&&n[s]===t[a-1]){let c=t[--a].nextSibling;y(e,n[s++],t[i++].nextSibling),y(e,n[--r],c),t[a]=t[i-1]}else{if(!u){u=new Map;let d=s;for(;d<r;)u.set(n[d],d++)}let c=u.get(t[i]);if(c!=null)if(s<c&&c<r){let d=i,M=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+M);)M++;if(M>c-s){let Y=t[i];for(;s<c;)y(e,n[s++],Y)}else t[i].parentNode===e?e.replaceChild(n[s++],t[i++]):(y(e,n[s++],l),i++)}else i++;else t[i].parentNode===e&&e.removeChild(t[i]),i++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function V(e,t,n){n==null?delete e[t]:e[t]=n}function ie(e,t,n){let o=n,f;return Array.isArray(n)&&(o=n[0],f=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,f),()=>e.removeEventListener(t,o,f))}function se(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function fe(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;N(e,t,f,o)})}function ae(e,t,n){return typeof n!="function"?(V(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;V(e,t,o)})}function le(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):p(()=>{let o=n();N(e,t,!!o)})}function G(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>G(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function q(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(p(()=>{let r=!!f();for(let i of a)e.classList.toggle(i,r)}));else{let r=!!(typeof f=="function"?f():f);for(let i of a)e.classList.toggle(i,r)}}}function K(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let f=n[o];f==null?e.style[o]="":e.style[o]=f}}function U(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){ue(f,e);continue}if(o!=="children"){if(o==="use"){se(e,f);continue}if(o.startsWith("on:")){ie(e,o.slice(3),f);continue}if(o.startsWith("prop:")){ae(e,o.slice(5),f);continue}if(o.startsWith("attr:")){fe(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){le(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(B.has(a)){e[`$$${a}`]=f;let r=`__fx_${a}`;if(!e[r]){let i=s=>{e[`$$${a}`]?.(s)};e.addEventListener(a,i),e[r]=i}}else e[`$$${a}`]=f,D.has(a)||ee([a]);continue}if(o==="class"||o==="className"){G(e,f);continue}if(o==="classList"){typeof f=="function"?p(()=>q(e,f())):q(e,f);continue}if(o==="style"){typeof f=="function"?p(()=>K(e,f())):K(e,f);continue}if(o==="innerHTML"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function";)r=r();e.innerHTML=r});S(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof f=="function"){let a=!0,r=A(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""});S(()=>{r()})}else{let a=!0;p(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof f=="function"){let a=A(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();O(e,o,r,n)});S(()=>{a()})}else p(()=>O(e,o,t[o],n))}}}function ue(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}import{untrack as ce,isSignal as de}from"@fluixi/reactive";var ye="__fx_dom_create_component__",X=globalThis[ye]??={fn:null};function J(e,t){if(X.fn)return X.fn(e,t);let n=typeof e=="function"?ce(()=>e(t)):e;if(n!=null&&(typeof n=="function"||typeof n=="object")&&!de(n)){try{n.$name=e?.name}catch{}return j(n)}return n}import{readChildren as pe}from"@fluixi/reactive/signal";function qe(e,t={}){if(typeof e=="function")return J(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(w)return v().createElement(e,n);let o=n?document.createElementNS(P,e):document.createElement(e);return U(o,t,n),me(o,t),o}function me(e,t){if(!t||t.children===void 0)return;let n=pe(()=>t.children),o=f=>{_(e,f,typeof f=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{qe as createDynamicElement};
|
|
1
|
+
import{isSignal as m}from"@fluixi/reactive/signal";var O="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function _(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(e)){e[t]=n;return}S(e,t,n,o)}function S(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ve=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function F(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ke,createEffect as C,createRenderEffect as y,createRoot as $e,onCleanup as v,readChildren as Fe,reportReactiveBinding as w,reportReactiveDirective as N,untrack as fe}from"@fluixi/reactive/signal";var I=Symbol.for("fluixi.server-node"),re=Symbol.for("fluixi.dom.server-host"),ie=globalThis,D=ie[re]??={server:typeof document>"u",nodes:null};function A(){return D.server}function R(){if(!D.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return D.nodes}function L(e){return e!=null&&e[I]===!0?!0:typeof Node<"u"&&e instanceof Node}function W(e){return e!=null&&e[I]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},se=null;function V(){return se}function j(e,t){return b.active&&t.parentNode===e}function q(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var z="__fx_at";var k=new Set,X=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function ae(e){if(!A())for(let t of e)k.has(t)||X.has(t)||(k.add(t),document.addEventListener(t,le))}function le(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function h(e,t=!1){if(A())return R().createText(e);if(b.active&&!t){let n=V()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var x=0,ue=200;function ce(e,t,n,o,i){let a=o,r=new Map;return y(()=>{w(n??t,"content",void 0,e);let s;if(E(e)&&!m(e)){if(!r.has(e)){x++;try{let f=e();r.set(e,f)}finally{x--}}for(s=r.get(e);typeof s=="function"&&m(s);)s=s()}else for(s=e();typeof s=="function"&&m(s);)s=s();{let f=0;for(;typeof s=="function"&&f++<50;)if(E(s)){if(!r.has(s)){let l=s;x++;try{let u=l();r.set(l,u)}finally{x--}}s=r.get(s)}else if(m(s))s=s();else if(s=s(),typeof s!="function"||!m(s)&&!E(s))break}x++;try{a=M(t,s,n,a,r),i(a)}finally{x--}})}function $(e,t,n,o){if(x>ue)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=h("",!0),e.appendChild(n));let i=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),r=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){x++;try{i=M(e,t,n,i)}finally{x--}return()=>i}let s=ce(r(t),e,n,i,f=>{i=f});return()=>(s?.(),i)}function M(e,t,n,o,i){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(P(t)){let r=h("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(r,o[0]),T(e,o.slice(1),n)):p(e,r,n):o?e.replaceChild(r,o):p(e,r,n),t.then(s=>{r.parentNode===e&&M(e,s,r.nextSibling,r)}).catch(s=>{console.error("Error resolving promise in insertExpression:",s)}),r}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let s=h(t);return p(e,s,n),s}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&W(o))return o.data=t,o;let r=h(t);return o&&o.parentNode===e?e.replaceChild(r,o):j(e,r)||p(e,r,n),r}if(L(t))return j(e,t)?(q(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let r=[],s=Array.isArray(o)?o:o?[o]:[],f=[];g(t,r,e,n,!0,i,f);let l=de(e,s,r,n);for(let u of f){let c=$(e,u.sig,u.marker);v(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let r=t;if("type"in r&&"props"in r){let s=r;if(typeof s.type=="function"){let f=s.type(s.props||{});return M(e,f,n,o)}}}return T(e,o,n)}function g(e,t,n,o,i=!0,a,r){for(let s=0;s<e.length;s++){let f=e[s];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!P(f)&&!m(f)&&!E(f)&&(f=f(),!(f==null||typeof f=="boolean")););if(!(f==null||typeof f=="boolean")){if(typeof f=="function"){let l;for(E(f)&&!m(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!P(l)&&!m(l)&&!E(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(m(l)){if(r){let c=h("",!0);t.push(c),r.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?g(u,t,n,o,i,a):g([u],t,n,o,i,a);continue}continue}Array.isArray(l)?g(l,t,n,o,i,a,r):g([l],t,n,o,i,a,r);continue}if(P(f)){let l=h("",!0);t.push(l),f.then(u=>{if(l.parentNode){let c=[];if(g([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let d=1;d<c.length;d++)l.parentNode?.insertBefore(c[d],c[d-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){g(f,t,n,o,i,a,r);continue}if(L(f)){t.push(f);continue}if(typeof f=="object"&&f!==null&&"type"in f&&"props"in f){let l=f;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?g(u,t,n,o,!1,a):g([u],t,n,o,!1,a);continue}}if(typeof f=="string"||typeof f=="number"){let l=String(f);if(l.trim()===""&&l!==" ")continue;t.push(h(l));continue}t.push(h(String(f)))}}}}function de(e,t,n,o){for(let c=0;c<n.length;c++){let d=n[c].parentNode;d!==null&&d!==e&&d.nodeType!==11&&(n=n.slice(),n[c]=n[c].cloneNode(!0))}let i=n.length,a=t.length,r=i,s=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;s<a||f<r;){if(t[s]===n[f]){s++,f++;continue}for(;a>s&&r>f&&t[a-1]===n[r-1];)a--,r--;if(a===s){let c=r<i?f?n[f-1].nextSibling??void 0:n[r-f]:l;for(;f<r;)p(e,n[f++],c)}else if(r===f)for(;s<a;)(!u||!u.has(t[s]))&&t[s].parentNode===e&&e.removeChild(t[s]),s++;else if(t[s]===n[r-1]&&n[f]===t[a-1]){let c=t[--a].nextSibling;p(e,n[f++],t[s++].nextSibling),p(e,n[--r],c),t[a]=t[s-1]}else{if(!u){u=new Map;let d=f;for(;d<r;)u.set(n[d],d++)}let c=u.get(t[s]);if(c!=null)if(f<c&&c<r){let d=s,H=1;for(;++d<a&&d<r&&!(!u.has(t[d])||u.get(t[d])!==c+H);)H++;if(H>c-f){let ne=t[s];for(;f<c;)p(e,n[f++],ne)}else t[s].parentNode===e?e.replaceChild(n[f++],t[s++]):(p(e,n[f++],l),s++)}else s++;else t[s].parentNode===e&&e.removeChild(t[s]),s++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function K(e,t,n){n==null?delete e[t]:e[t]=n}function pe(e,t,n){let o=n,i;return Array.isArray(n)&&(o=n[0],i=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,i),()=>e.removeEventListener(t,o,i))}function J(e,t){if(!t||typeof t!="function")return;let n=t[z]?.name;if(!n)return;let o=n.indexOf(":");o!==-1&&N(e,n.slice(0,o),n.slice(o+1),t)}function B(e,t,n){let o=typeof n=="function"?fe(()=>n()):n;if(!(!o||typeof o!="object"))for(let i of Object.keys(o))N(e,t,i)}function ye(e,t){let n=(o,i)=>{typeof o=="function"&&(N(e,"use",o.name||"use",i),o(e,i??(()=>{})))};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 me(e,t,n,o=!1){return J(e,n),typeof n!="function"?(S(e,t,n,o),()=>{}):y(()=>{w(e,"attribute",t,n);let i=typeof n=="function"?n():n;S(e,t,i,o)})}function ge(e,t,n){return typeof n!="function"?(K(e,t,n),()=>{}):(J(e,n),y(()=>{w(e,"property",t,n);let o=typeof n=="function"?n():n;K(e,t,o)}))}function xe(e,t,n){return typeof n!="function"?(S(e,t,!!n),()=>{}):y(()=>{w(e,"attribute",t,n);let o=n();S(e,t,!!o)})}function Y(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>{w(e,"attribute","class",t),Y(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 i=t[o];return typeof i=="function"?i():!!i}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function G(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let i=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof i=="function"&&n)n.push(y(()=>{let r=!!i();for(let s of a)e.classList.toggle(s,r)}));else{let r=!!(typeof i=="function"?i():i);for(let s of a)e.classList.toggle(s,r)}}}function U(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 i=n[o];i==null?e.style[o]="":e.style[o]=i}}function Z(e,t,n=!1){for(let o in t){let i=t[o];if(o==="ref"){he(i,e);continue}if(o!=="children"){if(o==="use"){ye(e,i);continue}if(o.startsWith("on:")){pe(e,o.slice(3),i);continue}if(o.startsWith("prop:")){N(e,"prop",o.slice(5),i),ge(e,o.slice(5),i);continue}if(o.startsWith("attr:")){N(e,"attr",o.slice(5),i),me(e,o.slice(5),i,n);continue}if(o.startsWith("bool:")){N(e,"bool",o.slice(5),i),xe(e,o.slice(5),i);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof i=="function")if(X.has(a)){e[`$$${a}`]=i;let r=`__fx_${a}`;if(!e[r]){let s=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,s),e[r]=s}}else e[`$$${a}`]=i,k.has(a)||ae([a]);continue}if(o==="class"||o==="className"){Y(e,i);continue}if(o==="classList"){B(e,"class",i),typeof i=="function"?y(()=>{w(e,"attribute","class",i),G(e,i())}):G(e,i);continue}if(o==="style"){B(e,"style",i),typeof i=="function"?y(()=>{w(e,"attribute","style",i),U(e,i())}):U(e,i);continue}if(o==="innerHTML"){if(typeof i=="function"){let a=C(()=>{let r=i();for(;typeof r=="function";)r=r();e.innerHTML=r});v(()=>a())}else e.innerHTML=i;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof i=="function"){let a=C(()=>{let r=i();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.value=r??"")});v(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof i=="function"){let a=C(()=>{let r=i();for(;typeof r=="function"&&r.length===0;)r=r();document.activeElement!==e&&(e.checked=r??"")});v(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof i=="function"){let a=!0,r=C(()=>{let s=i();for(;typeof s=="function"&&s.length===0;)s=s();a?(a=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""});v(()=>{r()})}else{let a=!0;y(()=>{let r=t[o];a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""})}continue}if(typeof i=="function"){let a=C(()=>{let r=i();for(;typeof r=="function"&&r.length===0;)r=r();_(e,o,r,n)});v(()=>{a()})}else y(()=>_(e,o,t[o],n))}}}function he(e,t){if(!e)return;let n=e[z]?.name;if(N(t,"ref",n||typeof e=="function"&&e.name||"ref",e),L(e)){let o=t,i=e;if(!o)return;typeof o=="function"?o(i):typeof o=="object"&&"current"in o&&(o.current=i);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}function Q(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 P(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}import{untrack as Ee,isSignal as be,reportReactiveProps as Te}from"@fluixi/reactive";var Ne="__fx_dom_create_component__",ee=globalThis[Ne]??={fn:null};function te(e,t){if(ee.fn)return ee.fn(e,t);t&&Te(t);let n=typeof e=="function"?Ee(()=>e(t)):e,o=n!=null&&(typeof n=="function"||typeof n=="object");if(o)try{n.$name=e?.name}catch{}return o&&!be(n)?F(n):n}import{readChildren as we}from"@fluixi/reactive/signal";function Ye(e,t={}){if(typeof e=="function")return te(e,t);if(typeof e!="string"||e.length===0)return null;let n=Q(e);if(A())return R().createElement(e,n);let o=n?document.createElementNS(O,e):document.createElement(e);return Z(o,t,n),Se(o,t),o}function Se(e,t){if(!t||t.children===void 0)return;let n=we(()=>t.children),o=i=>{$(e,i,typeof i=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{Ye as createDynamicElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var
|
|
1
|
+
"use strict";var P=Object.defineProperty;var Q=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var ee=Object.prototype.hasOwnProperty;var ne=(n,e)=>{for(var t in e)P(n,t,{get:e[t],enumerable:!0})},te=(n,e,t,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let c of Z(e))!ee.call(n,c)&&c!==t&&P(n,c,{get:()=>e[c],enumerable:!(i=Q(e,c))||i.enumerable});return n};var oe=n=>te(P({},"__esModule",{value:!0}),n);var xe={};ne(xe,{hydrate:()=>he});module.exports=oe(xe);var x=require("@fluixi/reactive/signal");var $="1.0.0-alpha.83";var O=require("@fluixi/reactive/version"),h={dom:$,reactive:O.VERSION};function H(n){h.core&&n.setAttribute("fluixi",h.core),n.setAttribute("fx-dom",h.dom),n.setAttribute("fx-reactive",h.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=h)}function F(){let n=[h.core,h.dom,h.reactive].filter(e=>e!==void 0);new Set(n).size<=1||console.warn(`[fluixi] package versions disagree — core ${h.core??"(absent)"}, dom ${h.dom}, reactive ${h.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function E(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}var p=require("@fluixi/reactive/signal");var j=Symbol.for("fluixi.server-node"),re=Symbol.for("fluixi.dom.server-host"),ie=globalThis,R=ie[re]??={server:typeof document>"u",nodes:null};function V(){return R.server}function I(){if(!R.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return R.nodes}function L(n){return n!=null&&n[j]===!0?!0:typeof Node<"u"&&n instanceof Node}function W(n){return n!=null&&n[j]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var u={active:!1,cursor:null,parents:[]},K=null;function B(n){K=n}function q(){return K}function M(n,e){return u.active&&e.parentNode===n}function X(n){let e=u.parents.lastIndexOf(n);e!==-1&&(u.parents.length=e),u.cursor=n.nextSibling}function N(n,e=!1){if(V())return I().createText(n);if(u.active&&!e){let t=q()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var b=0,se=200;function fe(n,e,t,i,c){let f=i,s=new Map;return(0,p.createRenderEffect)(()=>{(0,p.reportReactiveBinding)(t??e,"content",void 0,n);let r;if(E(n)&&!(0,x.isSignal)(n)){if(!s.has(n)){b++;try{let o=n();s.set(n,o)}finally{b--}}for(r=s.get(n);typeof r=="function"&&(0,x.isSignal)(r);)r=r()}else for(r=n();typeof r=="function"&&(0,x.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(E(r)){if(!s.has(r)){let a=r;b++;try{let l=a();s.set(a,l)}finally{b--}}r=s.get(r)}else if((0,x.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,x.isSignal)(r)&&!E(r))break}b++;try{f=S(e,r,t,f,s),c(f)}finally{b--}})}function J(n,e,t,i){if(b>se)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=N("",!0),n.appendChild(t));let c=i??null,f=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){b++;try{c=S(n,e,t,c)}finally{b--}return()=>c}let r=fe(s(e),n,t,c,o=>{c=o});return()=>(r?.(),c)}function S(n,e,t,i,c){if(e==null||typeof e=="boolean")return T(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return T(n,i,t);if(w(e)){let s=N("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),T(n,i.slice(1),t)):g(n,s,t):i?n.replaceChild(s,i):g(n,s,t),e.then(r=>{s.parentNode===n&&S(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=N(e);return g(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=T(n,i,t)}if(i&&W(i))return i.data=e,i;let s=N(e);return i&&i.parentNode===n?n.replaceChild(s,i):M(n,s)||g(n,s,t),s}if(L(e))return M(n,e)?(X(e),e):Array.isArray(i)?(i.length===0?g(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),T(n,i.slice(1),t)):g(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):g(n,e,t)):g(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];m(e,s,n,t,!0,c,o);let a=ae(n,r,s,t);for(let l of o){let d=J(n,l.sig,l.marker);(0,p.onCleanup)(()=>{T(n,d()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return S(n,o,t,i)}}}return T(n,i,t)}function m(n,e,t,i,c=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!w(o)&&!(0,x.isSignal)(o)&&!E(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(E(o)&&!(0,x.isSignal)(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),a=f.get(o)):a=o();typeof a=="function"&&!w(a)&&!(0,x.isSignal)(a)&&!E(a);)f||(f=new Map),f.has(a)||f.set(a,a()),a=f.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if((0,x.isSignal)(a)){if(s){let d=N("",!0);e.push(d),s.push({marker:d,sig:a});continue}let l=a();for(;typeof l=="function"&&(0,x.isSignal)(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?m(l,e,t,i,c,f):m([l],e,t,i,c,f);continue}continue}Array.isArray(a)?m(a,e,t,i,c,f,s):m([a],e,t,i,c,f,s);continue}if(w(o)){let a=N("",!0);e.push(a),o.then(l=>{if(a.parentNode){let d=[];if(m([l],d,a.parentNode,void 0,!1,f),d.length>0){a.parentNode.replaceChild(d[0],a);for(let y=1;y<d.length;y++)a.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){m(o,e,t,i,c,f,s);continue}if(L(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let l=a.type(a.props||{});Array.isArray(l)?m(l,e,t,i,!1,f):m([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;e.push(N(a));continue}e.push(N(String(o)))}}}}function ae(n,e,t,i){for(let d=0;d<t.length;d++){let y=t[d].parentNode;y!==null&&y!==n&&y.nodeType!==11&&(t=t.slice(),t[d]=t[d].cloneNode(!0))}let c=t.length,f=e.length,s=c,r=0,o=0,a=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let d=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:a;for(;o<s;)g(n,t[o++],d)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let d=e[--f].nextSibling;g(n,t[o++],e[r++].nextSibling),g(n,t[--s],d),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let d=l.get(e[r]);if(d!=null)if(o<d&&d<s){let y=r,_=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==d+_);)_++;if(_>d-o){let Y=e[r];for(;o<d;)g(n,t[o++],Y)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(g(n,t[o++],a),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function T(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function g(n,e,t){u.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function w(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function G(n,e,t){if(!e)throw new Error("Container element is required");let i,c,f=[];return(0,p.createRoot)(s=>{(0,p.batch)(()=>{u.active||(e.textContent=""),H(e),F(),J(e,n)}),c=s}),()=>{c?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}var v=require("@fluixi/reactive/signal");var ue="__FX_DATA__";var D;function U(){let n=globalThis.__FX_DATA__;if(n)return n;if(D!==void 0)return D;let e=null;if(typeof document<"u"){let t=document.getElementById(ue)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return D=e}function A(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var le=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),k=typeof process<"u"&&process.env&&!1;function C(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ce(n){A();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(le.has(n.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(k&&e&&C(`<${n}>`,e),null)}function de(n){A();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(u.cursor=e.nextSibling,e):(k&&e&&C(`<${n}> (static)`,e),null)}function ye(n){if(n===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}A();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(k&&e&&C(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function pe(n){A();let e=u.cursor;return e&&e.nodeType===8&&e.data===n?(u.cursor=e.nextSibling,e):(k&&e&&C(`marker <!--${n.slice(0,24)}-->`,e),null)}var z=!1;function ge(){z||(z=!0,B({hydrateElement:ce,hydrateText:ye,hydrateMarker:pe,hydrateStatic:de}))}function he(n,e,t){ge(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=U(),c=t?.resourceNamespace,f=0;(0,v.setResourceIdSource)(()=>c?`${c}:r${f++}`:`r${f++}`),(0,v.setServerDataGetter)(i?s=>s in i?{value:i[s]}:void 0:null);try{return G(n,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSignal as
|
|
1
|
+
import{isSignal as h}from"@fluixi/reactive/signal";var L="1.0.0-alpha.83";import{VERSION as G}from"@fluixi/reactive/version";var g={dom:L,reactive:G};function M(n){g.core&&n.setAttribute("fluixi",g.core),n.setAttribute("fx-dom",g.dom),n.setAttribute("fx-reactive",g.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=g)}function D(){let n=[g.core,g.dom,g.reactive].filter(e=>e!==void 0);new Set(n).size<=1||console.warn(`[fluixi] package versions disagree — core ${g.core??"(absent)"}, dom ${g.dom}, reactive ${g.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function N(n){return typeof n=="function"&&n[Symbol.for("fluixi-component")]===!0}import{batch as Y,createEffect as ke,createRenderEffect as Q,createRoot as Z,onCleanup as ee,readChildren as Ce,reportReactiveBinding as ne,reportReactiveDirective as _e,untrack as Pe}from"@fluixi/reactive/signal";var $=Symbol.for("fluixi.server-node"),U=Symbol.for("fluixi.dom.server-host"),z=globalThis,C=z[U]??={server:typeof document>"u",nodes:null};function O(){return C.server}function H(){if(!C.nodes)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return C.nodes}function _(n){return n!=null&&n[$]===!0?!0:typeof Node<"u"&&n instanceof Node}function F(n){return n!=null&&n[$]===!0?n.nodeType===3:typeof Text<"u"&&n instanceof Text}var u={active:!1,cursor:null,parents:[]},j=null;function V(n){j=n}function I(){return j}function P(n,e){return u.active&&e.parentNode===n}function W(n){let e=u.parents.lastIndexOf(n);e!==-1&&(u.parents.length=e),u.cursor=n.nextSibling}function b(n,e=!1){if(O())return H().createText(n);if(u.active&&!e){let t=I()?.hydrateText(n);if(t)return t}return document.createTextNode(n)}var m=0,te=200;function oe(n,e,t,i,d){let f=i,s=new Map;return Q(()=>{ne(t??e,"content",void 0,n);let r;if(N(n)&&!h(n)){if(!s.has(n)){m++;try{let o=n();s.set(n,o)}finally{m--}}for(r=s.get(n);typeof r=="function"&&h(r);)r=r()}else for(r=n();typeof r=="function"&&h(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let a=r;m++;try{let l=a();s.set(a,l)}finally{m--}}r=s.get(r)}else if(h(r))r=r();else if(r=r(),typeof r!="function"||!h(r)&&!N(r))break}m++;try{f=w(e,r,t,f,s),d(f)}finally{m--}})}function K(n,e,t,i){if(m>te)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=b("",!0),n.appendChild(t));let d=i??null,f=o=>Array.isArray(o)&&o.some(a=>typeof a=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof e!="function"&&!f(e)){m++;try{d=w(n,e,t,d)}finally{m--}return()=>d}let r=oe(s(e),n,t,d,o=>{d=o});return()=>(r?.(),d)}function w(n,e,t,i,d){if(e==null||typeof e=="boolean")return E(n,i,t);if(typeof e=="function")for(;typeof e=="function";)e=e();if(e==null||typeof e=="boolean")return E(n,i,t);if(T(e)){let s=b("",!0);return Array.isArray(i)?i.length>0?(n.replaceChild(s,i[0]),E(n,i.slice(1),t)):p(n,s,t):i?n.replaceChild(s,i):p(n,s,t),e.then(r=>{s.parentNode===n&&w(n,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let f=typeof e;if(f==="string"||f==="number"){if(f==="number"&&(e=String(e)),Array.isArray(i)){if(i.length===0){let r=b(e);return p(n,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=e,i;i=E(n,i,t)}if(i&&F(i))return i.data=e,i;let s=b(e);return i&&i.parentNode===n?n.replaceChild(s,i):P(n,s)||p(n,s,t),s}if(_(e))return P(n,e)?(W(e),e):Array.isArray(i)?(i.length===0?p(n,e,t):i[0].parentNode===n?(n.replaceChild(e,i[0]),E(n,i.slice(1),t)):p(n,e,t),e):(i?i!==e&&(i.parentNode===n?n.replaceChild(e,i):p(n,e,t)):p(n,e,t),e);if(Array.isArray(e)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];x(e,s,n,t,!0,d,o);let a=re(n,r,s,t);for(let l of o){let c=K(n,l.sig,l.marker);ee(()=>{E(n,c()),l.marker.parentNode===n&&n.removeChild(l.marker)})}return a}if(f==="object"&&e!==null&&typeof e=="object"){let s=e;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return w(n,o,t,i)}}}return E(n,i,t)}function x(n,e,t,i,d=!0,f,s){for(let r=0;r<n.length;r++){let o=n[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!h(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let a;for(N(o)&&!h(o)?(f||(f=new Map),f.has(o)||f.set(o,o()),a=f.get(o)):a=o();typeof a=="function"&&!T(a)&&!h(a)&&!N(a);)f||(f=new Map),f.has(a)||f.set(a,a()),a=f.get(a);if(a==null||typeof a=="boolean")continue;if(typeof a=="function"){if(h(a)){if(s){let c=b("",!0);e.push(c),s.push({marker:c,sig:a});continue}let l=a();for(;typeof l=="function"&&h(l);)l=l();if(l==null||typeof l=="boolean")continue;Array.isArray(l)?x(l,e,t,i,d,f):x([l],e,t,i,d,f);continue}continue}Array.isArray(a)?x(a,e,t,i,d,f,s):x([a],e,t,i,d,f,s);continue}if(T(o)){let a=b("",!0);e.push(a),o.then(l=>{if(a.parentNode){let c=[];if(x([l],c,a.parentNode,void 0,!1,f),c.length>0){a.parentNode.replaceChild(c[0],a);for(let y=1;y<c.length;y++)a.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(l=>console.error("Error resolving promise in array:",l));continue}if(Array.isArray(o)){x(o,e,t,i,d,f,s);continue}if(_(o)){e.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let a=o;if(typeof a.type=="function"){let l=a.type(a.props||{});Array.isArray(l)?x(l,e,t,i,!1,f):x([l],e,t,i,!1,f);continue}}if(typeof o=="string"||typeof o=="number"){let a=String(o);if(a.trim()===""&&a!==" ")continue;e.push(b(a));continue}e.push(b(String(o)))}}}}function re(n,e,t,i){for(let c=0;c<t.length;c++){let y=t[c].parentNode;y!==null&&y!==n&&y.nodeType!==11&&(t=t.slice(),t[c]=t[c].cloneNode(!0))}let d=t.length,f=e.length,s=d,r=0,o=0,a=f>0?e[f-1].nextSibling??void 0:i,l=null;for(;r<f||o<s;){if(e[r]===t[o]){r++,o++;continue}for(;f>r&&s>o&&e[f-1]===t[s-1];)f--,s--;if(f===r){let c=s<d?o?t[o-1].nextSibling??void 0:t[s-o]:a;for(;o<s;)p(n,t[o++],c)}else if(s===o)for(;r<f;)(!l||!l.has(e[r]))&&e[r].parentNode===n&&n.removeChild(e[r]),r++;else if(e[r]===t[s-1]&&t[o]===e[f-1]){let c=e[--f].nextSibling;p(n,t[o++],e[r++].nextSibling),p(n,t[--s],c),e[f]=e[r-1]}else{if(!l){l=new Map;let y=o;for(;y<s;)l.set(t[y],y++)}let c=l.get(e[r]);if(c!=null)if(o<c&&c<s){let y=r,k=1;for(;++y<f&&y<s&&!(!l.has(e[y])||l.get(e[y])!==c+k);)k++;if(k>c-o){let J=e[r];for(;o<c;)p(n,t[o++],J)}else e[r].parentNode===n?n.replaceChild(t[o++],e[r++]):(p(n,t[o++],a),r++)}else r++;else e[r].parentNode===n&&n.removeChild(e[r]),r++}}return t}function E(n,e,t){if(e)if(Array.isArray(e))for(let i=0;i<e.length;i++)e[i].parentNode===n&&n.removeChild(e[i]);else e.parentNode===n&&n.removeChild(e);return null}function p(n,e,t){u.active&&e.parentNode===n||(t&&t.parentNode===n?n.insertBefore(e,t):n.appendChild(e))}function T(n){return n!=null&&(typeof n=="object"||typeof n=="function")&&typeof n.then=="function"||n instanceof Promise}function B(n,e,t){if(!e)throw new Error("Container element is required");let i,d,f=[];return Z(s=>{Y(()=>{u.active||(e.textContent=""),M(e),D(),K(e,n)}),d=s}),()=>{d?.(),i?.(),f.forEach(s=>s()),e.textContent=""}}import{setResourceIdSource as se,setServerDataGetter as fe}from"@fluixi/reactive/signal";var ie="__FX_DATA__";var R;function q(){let n=globalThis.__FX_DATA__;if(n)return n;if(R!==void 0)return R;let e=null;if(typeof document<"u"){let t=document.getElementById(ie)?.textContent;if(t)try{e=JSON.parse(t)}catch{e=null}}return R=e}function S(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var ae=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),v=typeof process<"u"&&process.env&&!1;function A(n,e){let t=e.nodeType===1?`<${e.tagName.toLowerCase()}>`:e.nodeType===3?`text ${JSON.stringify((e.nodeValue??"").slice(0,24))}`:e.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${n} but the server DOM has ${t}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function ue(n){S();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(ae.has(n.toLowerCase())?u.cursor=e.nextSibling:(u.parents.push(e),u.cursor=e.firstChild),e):(v&&e&&A(`<${n}>`,e),null)}function le(n){S();let e=u.cursor;return e&&e.nodeType===1&&e.tagName.toLowerCase()===n.toLowerCase()?(u.cursor=e.nextSibling,e):(v&&e&&A(`<${n}> (static)`,e),null)}function ce(n){if(n===""){let t=u.cursor;return t&&t.nodeType===3&&t.data!==""?(u.cursor=t.nextSibling,t.data="",t):null}S();let e=u.cursor;return e&&e.nodeType===3?(u.cursor=e.nextSibling,e.nodeValue!==n&&(e.nodeValue=n),e):(v&&e&&A(`text ${JSON.stringify(n.slice(0,24))}`,e),null)}function de(n){S();let e=u.cursor;return e&&e.nodeType===8&&e.data===n?(u.cursor=e.nextSibling,e):(v&&e&&A(`marker <!--${n.slice(0,24)}-->`,e),null)}var X=!1;function ye(){X||(X=!0,V({hydrateElement:ue,hydrateText:ce,hydrateMarker:de,hydrateStatic:le}))}function je(n,e,t){ye(),u.active=!0,u.cursor=e.firstChild,u.parents=[];let i=q(),d=t?.resourceNamespace,f=0;se(()=>d?`${d}:r${f++}`:`r${f++}`),fe(i?s=>s in i?{value:i[s]}:void 0:null);try{return B(n,e)}finally{u.active=!1,u.cursor=null,u.parents=[]}}export{je as hydrate};
|