@fluixi/dom 1.0.0-alpha.64 → 1.0.0-alpha.65
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdn/dom.cjs +1 -1
- package/dist/cdn/dom.global.js +1 -1
- package/dist/cdn/dom.mjs +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +1 -1
- package/dist/lib/dom/dynamic-element.cjs +1 -0
- package/dist/lib/dom/dynamic-element.d.ts +10 -0
- package/dist/lib/dom/dynamic-element.d.ts.map +1 -0
- package/dist/lib/dom/dynamic-element.js +61 -0
- package/dist/lib/dom/dynamic-element.mjs +1 -0
- package/dist/lib/element/attributes.cjs +1 -1
- package/dist/lib/element/attributes.d.ts +18 -18
- package/dist/lib/element/attributes.d.ts.map +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.d.ts +1 -0
- package/dist/lib/index.d.ts.map +1 -1
- package/dist/lib/index.js +1 -0
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/package.json +3 -3
package/dist/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function Zn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function Qn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function er(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function tr(e,t){let n=new Set(["checked","value","selected","disabled","readonly","required","multiple","open","contenteditable","draggable","spellcheck"]),r={input:new Set(["value","checked","indeterminate"]),textarea:new Set(["value"]),select:new Set(["value"]),option:new Set(["selected","value"]),audio:new Set(["volume","currentTime","paused"]),video:new Set(["volume","currentTime","paused"]),img:new Set(["src","srcset"]),iframe:new Set(["src"]),a:new Set(["href"])};return n.has(t)||r[e]&&r[e].has(t)}var nr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),rr=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),le="http://www.w3.org/2000/svg";function kt(e){return e.localName.includes("-")}function ce(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(kt(e)){e[t]=n;return}m(e,t,n,r)}var ue=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function qe(e,t=document){return t.querySelector(e)}function or(e,t=document){return Array.from(t.querySelectorAll(e))}function ir(e,t){return e.closest(t)}function je(e,...t){e.classList.add(...t)}function Fe(e,...t){e.classList.remove(...t)}function He(e,...t){t.forEach(n=>e.classList.toggle(n))}function sr(e,t){return e.classList.contains(t)}function m(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function Ve(e,t){return e.getAttribute(t)}function Ue(e,t){e.removeAttribute(t)}function fe(e,t){Object.assign(e.style,t)}function ar(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function We(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,i])=>{if(o==="class"||o==="className")r.className=i;else if(o==="style"&&typeof i=="object")fe(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else m(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Ke(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function ze(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function lr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function cr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function ur(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function fr(e,t,n,r){let o=i=>{let s=i.target.closest(n);s&&e.contains(s)&&r(i,s)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function dr(e,t=5e3){return new Promise((n,r)=>{let o=qe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=qe(e);a&&(i.disconnect(),clearTimeout(s),n(a))});i.observe(document.body,{childList:!0,subtree:!0});let s=setTimeout(()=>{i.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function pr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function yr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Dt=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function mr(e){return typeof e=="object"&&e!==null&&e.$$typeof===Dt}function _t(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function hr(e){if(typeof e!="function")return!1;try{let t=e();return _t(t)}catch{return!1}}function gr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function xr(e){return e instanceof Node}function br(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Tr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as g}from"@fluixi/reactive/signal";function Nr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function vr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Sr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function wr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Ar(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Cr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Rr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Mr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function Ot(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function b(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function Pr(e){return Ot(e)?{type:"router",value:e}:It(e)?{type:"route",value:e}:$t(e)?{type:"routes",value:e}:qt(e)?{type:"outlet",value:e}:b(e)?{type:"component",value:e}:Ht(e)?{type:"suspense",value:e}:jt(e)?{type:"provider",value:e}:Ft(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Ye,createEffect as I,createRenderEffect as p,createRoot as Kt,onCleanup as R,readChildren as zt}from"@fluixi/reactive/signal";var x=typeof document>"u";function P(e){x=e}var O=Symbol.for("fluixi.server-node"),de=null;function Be(e){de=e}function pe(){if(!de)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return de}function L(e){return e!=null&&e[O]===!0?!0:typeof Node<"u"&&e instanceof Node}function ye(e){return e!=null&&e[O]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function me(e){return e!=null&&e[O]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Xe=null;function Ge(e){Xe=e}function he(){return Xe}function ge(e,t){return u.active&&t.parentNode===e}function xe(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Vt(){return u.active?u.cursor:null}function Ut(e,t){if(!e||e.parentNode==null)return t();let n=u.active,r=u.cursor,o=u.parents;u.active=!0,u.cursor=e,u.parents=[];try{return t()}finally{u.active=n,u.cursor=r,u.parents=o}}function Wt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function $(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&xe(t)}function Bt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Xt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Hr(e){return Xt(Bt(e))}var Vr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Gt={};var Je=new Map,B=new Set,Z=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!x)for(let t of e)B.has(t)||Z.has(t)||(B.add(t),document.addEventListener(t,Jt))}function Jt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function be(e,t,n){if(e[`$$${t}`]=n,Z.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}B.has(t)||Q([t])}function X(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function Ur(e){return!Z.has(e)}function Wr(e){return typeof e=="function"}function w(e,t=!1){if(x)return pe().createText(e);if(u.active&&!t){let n=he()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ee(e,t=!1){if(x)return pe().createElement(e,t);if(u.active){let n=he()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(le,e):document.createElement(e)}function Ze(e,t=!1){let n=Je.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Je.set(e,r),r}function Qe(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Yt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Yt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Kr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function zr(e){if(g(e)||b(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!g(t)&&!b(t);)t=t();return t}var N=0,Zt=200;function Qt(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(b(e)&&!g(e)){if(!s.has(e)){N++;try{let l=e();s.set(e,l)}finally{N--}}for(a=s.get(e);typeof a=="function"&&g(a);)a=a()}else for(a=e();typeof a=="function"&&g(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(b(a)){if(!s.has(a)){let c=a;N++;try{let f=c();s.set(c,f)}finally{N--}}a=s.get(a)}else if(g(a))a=a();else if(a=a(),typeof a!="function"||!g(a)&&!b(a))break}N++;try{i=G(t,a,n,i,s),o(i)}finally{N--}})}function v(e,t,n,r){if(N>Zt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){N++;try{o=G(e,t,n,null)}finally{N--}return()=>o}let a=Qt(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function G(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(z(t)){let s=w("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),C(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&G(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=w(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&me(r))return r.data=t,r;let s=w(t);return r&&r.parentNode===e?e.replaceChild(s,r):ge(e,s)||h(e,s,n),s}if(L(t))return ge(e,t)?(xe(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];E(t,s,e,n,!0,o,l);let c=en(e,a,s,n);for(let f of l){let d=v(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return G(e,l,n,r)}}}return C(e,r,n)}function E(e,t,n,r,o=!0,i,s){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!z(l)&&!g(l)&&!b(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(b(l)&&!g(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!z(c)&&!g(c)&&!b(c);)i||(i=new Map),i.has(c)||i.set(c,c()),c=i.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if(g(c)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&g(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?E(f,t,n,r,o,i):E([f],t,n,r,o,i);continue}continue}Array.isArray(c)?E(c,t,n,r,o,i,s):E([c],t,n,r,o,i,s);continue}if(z(l)){let c=w("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(E([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){E(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?E(f,t,n,r,!1,i):E([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(w(c));continue}t.push(w(String(l)))}}}}function en(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,ae=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+ae);)ae++;if(ae>d-l){let Lt=t[a];for(;l<d;)h(e,n[l++],Lt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function et(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function tt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function q(e,t,n,r=!1){return typeof n!="function"?(m(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;m(e,t,o,r)})}function j(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;k(e,t,r)})}function nt(e,t,n){return typeof n!="function"?(m(e,t,!!n),()=>{}):p(()=>{let r=n();m(e,t,!!r)})}function D(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>D(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function J(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function Y(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function rt(e){let{element:t,props:n,prevProps:r=Gt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ye(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let s=o||t.namespaceURI===le,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){_(c,t);continue}if(l==="use"){tt(t,c);continue}if(l.startsWith("on:")){a.push(et(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(j(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(q(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(nt(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>D(t,c()))):D(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>J(t,c()))):J(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Y(t,c()))):Y(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&X(t,y),c&&be(t,y,c);continue}let d=ue.has(l)||!s&&l in t;typeof c=="function"?a.push(d?j(t,l,c):q(t,l,c,s)):a.push(p(()=>d?k(t,l,n[l]):m(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();X(t,c)}else ue.has(l)?k(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function ot(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){_(o,e);continue}if(r!=="children"){if(r==="use"){tt(e,o);continue}if(r.startsWith("on:")){et(e,r.slice(3),o);continue}if(r.startsWith("prop:")){j(e,r.slice(5),o);continue}if(r.startsWith("attr:")){q(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){nt(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(Z.has(i)){e[`$$${i}`]=o;let s=`__fx_${i}`;if(!e[s]){let a=l=>{e[`$$${i}`]?.(l)};e.addEventListener(i,a),e[s]=a}}else e[`$$${i}`]=o,B.has(i)||Q([i]);continue}if(r==="class"||r==="className"){D(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>J(e,o())):J(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Y(e,o())):Y(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=I(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});R(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=I(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=I(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=I(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=I(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();ce(e,r,s,n)});R(()=>{i()})}else p(()=>ce(e,r,t[r],n))}}}function it(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let i=e[o];if(i&&r in i&&i[r]!==void 0)return i[r]}},n=r=>{for(let o of e)if(o&&r in o)return!0;return!1};return new Proxy({},{get:(r,o)=>t(o),has:(r,o)=>n(o),ownKeys:()=>{let r=new Set;for(let o of e)if(o)for(let i of Reflect.ownKeys(o))r.add(i);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Br(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function _(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function st(e,t,n){let r=t||document.body,o=zt(()=>e),i=[];return Ye(()=>{let s=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),R(()=>{i.forEach(a=>a())})}),null}function Xr(e){return typeof e=="string"&&e.toLowerCase()===e}function Gr(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Jr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function z(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Yr(e){return typeof e=="function"&&e.length===0&&g(e)}function te(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return Kt(s=>{Ye(()=>{u.active||(t.textContent=""),v(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var tn="__fx_dom_create_component__",M=globalThis[tn]??={fn:null};function Qr(e){M.fn=e}function eo(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function at(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var to=()=>M.fn!==null,lt=()=>M.fn!==null;function ct(){M.fn=null}var ne,ft={getStore:()=>ne,run(e,t){let n=ne;ne=e;try{return t()}finally{ne=n}}},Te=ft;function dt(e){Te=e??ft}function F(e={}){e.locals||(e.locals=e.request?Ne(e.request):{});let t=0,n=0,r=null,o=new Map,i=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let s=o.get(r)??0;return o.set(r,s+1),`${r}:r${s}`},nextIslandNamespace:s=>{let a=i.get(s)??0;return i.set(s,a+1),`${s}#${a}`},withResourceScope(s,a){let l=r;r=s;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function H(e,t){return Te.run(e,t)}function S(){return Te.getStore()}function Ee(){return S()?.event}function pt(){let e=Ee();return e?(e.locals||(e.locals={}),e.locals):{}}var ut=new WeakMap;function Ne(e){let t=ut.get(e);return t||(t={},ut.set(e,t)),t}import{setResourceIdSource as nn,setServerDataGetter as rn}from"@fluixi/reactive/signal";var V="__FX_DATA__";function re(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var ve;function oe(){let e=globalThis.__FX_DATA__;if(e)return e;if(ve!==void 0)return ve;let t=null;if(typeof document<"u"){let n=document.getElementById(V)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return ve=t}function Se(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var on=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),we=typeof process<"u"&&process.env&&!1;function Ae(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function sn(e){Se();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(on.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(we&&t&&Ae(`<${e}>`,t),null)}function an(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Se();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(we&&t&&Ae(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function ln(e){Se();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(we&&t&&Ae(`marker <!--${e.slice(0,24)}-->`,t),null)}var yt=!1;function cn(){yt||(yt=!0,Ge({hydrateElement:sn,hydrateText:an,hydrateMarker:ln}))}function U(e,t,n){cn(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=oe(),o=n?.resourceNamespace,i=0;nn(()=>o?`${o}:r${i++}`:`r${i++}`),rn(r?s=>s in r?{value:r[s]}:void 0:null);try{return te(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ce="fluixi-island";function un(e){let{component:t,props:n={},name:r}=e,o=ee(Ce),i=r??t.name??"Island";m(o,"name",i),m(o,"props",JSON.stringify(n??{}));let s=x?S():void 0;if(s){let a=s.nextIslandNamespace(i);v(o,()=>s.withResourceScope(a,()=>t(n)))}else v(o,()=>t(n));return o}var mt=!1;function fn(){if(mt||typeof document>"u")return;mt=!0;let e=document.createElement("style");e.textContent=`${Ce}{display:contents}`,document.head.appendChild(e)}function dn(e){if(typeof document>"u")return;fn();let t=document.querySelectorAll(Ce),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",i=n.get(o)??0;n.set(o,i+1);let s=e[o];if(!s){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}U(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function pn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function yn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{createMemo as Re,untrack as bt}from"@fluixi/reactive/signal";function ht(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function gt(e){return e!=null&&e!==!1}function xt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function mn(e){let t=A(()=>e.when),n=Re(t,void 0),r=Re(n,void 0);return Re(()=>{if(r()){let i=e.children;return typeof i=="function"&&!xt(i)?typeof n=="function"?bt(()=>bt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as hn,keyArray as gn}from"@fluixi/reactive/signal";function xn(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return $(a),a};return e.by?gn(t,e.by,(o,i)=>r(o,i),{fallback:n}):hn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as bn}from"@fluixi/reactive/signal";function Tn(e){let t=A(()=>e.each);return bn(t,(n,r)=>{let o=e.children(n,r);return $(o),o},{fallback:()=>e.fallback??null})}import{mapArray as hi,keyArray as gi,indexArray as xi}from"@fluixi/reactive/signal";import{createMemo as En}from"@fluixi/reactive/signal";var Me=Symbol("match");function Nn(e){return{[Me]:!0,when:A(()=>e.when),children:e.children}}function vn(e){let t=Array.isArray(e.children)?e.children:[e.children];return En(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Me]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Me]!==!0)continue;let i=r.when();if(gt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as Sn}from"@fluixi/reactive/signal";function wn(e){let t=ht(e.component),{component:n,...r}=e;return Sn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as An,onCleanup as Cn}from"@fluixi/reactive/signal";function Rn(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return An(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),v(r,e.children)&&_(e.ref,r)}),Cn(()=>{n(),r.remove()}),null}import{createMemo as Mn,createSignal as Pn}from"@fluixi/reactive/signal";function Ln(e){let[t,n]=Pn(null),r=()=>n(null);return Mn(()=>{let o=t();if(o!==null)return typeof e.fallback=="function"?e.fallback(o,r):e.fallback;try{return typeof e.children=="function"?e.children():e.children}catch(i){return n(i),typeof e.fallback=="function"?e.fallback(i,r):e.fallback}})}import{createMemo as kn}from"@fluixi/reactive/signal";function Dn(e){return kn(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;(typeof o=="function"?o():o)&&n.push(r)}return n.join(" ")})}import{createMemo as _n}from"@fluixi/reactive/signal";function On(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function $n(e){return _n(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let i=typeof o=="function"?o():o;i!=null&&n.push(`${On(r)}: ${i}`)}return n.join("; ")})}var ke=1,De=3,_e=8,Tt;Tt=O;var W=class{constructor(){this[Tt]=!0;this.parentNode=null;this.childNodes=[]}get firstChild(){return this.childNodes[0]??null}get lastChild(){return this.childNodes[this.childNodes.length-1]??null}get nextSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>=0?t.childNodes[n+1]??null:null}get previousSibling(){let t=this.parentNode;if(!t)return null;let n=t.childNodes.indexOf(this);return n>0?t.childNodes[n-1]??null:null}get parentElement(){return this.parentNode}appendChild(t){return t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes.push(t),t}insertBefore(t,n){if(n==null)return this.appendChild(t);t.parentNode&&t.parentNode.removeChild(t);let r=this.childNodes.indexOf(n);return t.parentNode=this,r<0?this.childNodes.push(t):this.childNodes.splice(r,0,t),t}removeChild(t){let n=this.childNodes.indexOf(t);return n>=0&&this.childNodes.splice(n,1),t.parentNode=null,t}replaceChild(t,n){let r=this.childNodes.indexOf(n);return r>=0&&(t.parentNode&&t.parentNode.removeChild(t),t.parentNode=this,this.childNodes[r]=t,n.parentNode=null),n}addEventListener(){}removeEventListener(){}},K=class e extends W{constructor(n){super();this.nodeType=De;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ie=class e extends W{constructor(n){super();this.nodeType=_e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},Pe=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},Le=class{constructor(t){this.el=t}list(){let t=this.el.getAttribute("class");return t?t.split(/\s+/).filter(Boolean):[]}write(t){t.length?this.el.setAttribute("class",t.join(" ")):this.el.removeAttribute("class")}add(...t){let n=this.list();for(let r of t)n.includes(r)||n.push(r);this.write(n)}remove(...t){this.write(this.list().filter(n=>!t.includes(n)))}contains(t){return this.list().includes(t)}toggle(t,n){let r=this.contains(t),o=n===void 0?!r:n;return o?this.add(t):this.remove(t),o}},se=class e extends W{constructor(n,r=!1){super();this.nodeType=ke;this.attributes=new Map;this.style=new Pe;this.classList=new Le(this);this.rawHTML=null;this.localName=n.toLowerCase(),this.tagName=r?n:n.toUpperCase(),this.isSVG=r,this.namespaceURI=r?"http://www.w3.org/2000/svg":null}setAttribute(n,r){this.attributes.set(n,String(r))}removeAttribute(n){this.attributes.delete(n)}getAttribute(n){return this.attributes.has(n)?this.attributes.get(n):null}hasAttribute(n){return this.attributes.has(n)}get id(){return this.getAttribute("id")??""}set id(n){n==null?this.removeAttribute("id"):this.setAttribute("id",n)}get className(){return this.getAttribute("class")??""}set className(n){n==null?this.removeAttribute("class"):this.setAttribute("class",n)}get htmlFor(){return this.getAttribute("for")??""}set htmlFor(n){n==null?this.removeAttribute("for"):this.setAttribute("for",n)}set value(n){n==null?this.removeAttribute("value"):this.setAttribute("value",String(n))}set checked(n){n?this.setAttribute("checked",""):this.removeAttribute("checked")}set selected(n){n?this.setAttribute("selected",""):this.removeAttribute("selected")}set indeterminate(n){}get textContent(){return this.childNodes.map(n=>n.textContent??"").join("")}set textContent(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=null,n!=null&&n!==""&&this.appendChild(new K(String(n)))}set innerText(n){this.textContent=n}set innerHTML(n){for(let r of this.childNodes)r.parentNode=null;this.childNodes=[],this.rawHTML=n==null?"":String(n)}cloneNode(n=!1){let r=new e(this.localName,this.isSVG);if(r.attributes=new Map(this.attributes),r.style.cssText=this.style.cssText,r.rawHTML=this.rawHTML,n)for(let o of this.childNodes)r.appendChild(o.cloneNode(!0));return r}};var In=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Nt=/&/g,qn=/</g,jn=/>/g,Fn=/"/g;function Oe(e){return e.replace(Nt,"&").replace(qn,"<").replace(jn,">")}function Et(e){return e.replace(Nt,"&").replace(Fn,""")}function Hn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Vn(e){if(!e)return"";let t=[];e.cssText&&t.push(e.cssText.trim().replace(/;\s*$/,""));for(let n of Object.keys(e)){if(n==="cssText")continue;let r=e[n];r==null||r===""||t.push(`${Hn(n)}: ${r}`)}return t.join("; ")}function Un(e){let t="",n=Vn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Et(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Et(o)}"`}return t}function T(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Oe(e);if(typeof e=="number")return Oe(String(e));if(typeof e=="function")return T(e());if(Array.isArray(e))return e.map(T).join("");switch(e.nodeType){case De:return Oe(e.data??"");case _e:return`<!--${e.data??""}-->`;case ke:{let t=e.localName,n=`<${t}${Un(e)}>`;if(In.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(T).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(T).join(""):""}import{createRoot as At}from"@fluixi/reactive/signal";import{setResourceTracker as Wn,setResourceIdSource as Kn,setResourceDataSink as zn,getOwner as Bn,runWithOwner as vt,flush as Xn}from"@fluixi/reactive/signal";var St=!1;function Ct(){St||(St=!0,Be({createElement:(e,t)=>new se(e,t),createText:e=>new K(e),createComment:e=>new ie(e)}))}function Rt(e,t={}){let n=x;Ct(),P(!0);let r=F(t.event);try{return H(r,()=>At(o=>{try{let i=typeof e=="function"?e():e;return T(i)}finally{o()}}))}finally{P(n)}}var wt=!1;function Gn(){wt||(wt=!0,Wn(e=>{S()?.pending.add(e)}),Kn(()=>S()?.nextResourceId()??""),zn((e,t)=>{e&&S()?.data.set(e,t)}))}var $e=null;function Mt(e){$e=e}function Ie(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if($e)try{i=$e(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=re(JSON.stringify(t));return`<script type="application/json" id="${V}">${n}<\/script>`}var Jn=50;async function Pt(e,t={}){let n=x;Ct(),P(!0),Gn();let r=F(t.event);try{return await H(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};At(f=>{s=f,i=Bn(),o=typeof e=="function"?e():e});let a=()=>{try{vt(i,()=>T(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Jn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Xn(),a()}let c=vt(i,()=>T(o))+Ie(r);return s(),c})}finally{P(n)}}var Yn={createComponent:at,createElement:We,createNativeElement:ee,createTemplate:Ze,cloneTemplate:Qe,createPortal:st,render:te,hydrate:U,insert:v,appendChildren:ze,removeChildren:Ke,spread:rt,applyProps:ot,mergeProps:it,setProperty:k,setDynamicProperty:j,setAttribute:m,setDynamicAttribute:q,removeAttribute:Ue,getAttribute:Ve,setClassName:D,addClass:je,removeClass:Fe,toggleClass:He,setStyles:fe,delegateEvents:Q,addDelegatedEventListener:be,removeDelegatedEventListener:X,handleRef:_,resetIntegration:ct,isIntegrationInitialized:lt},Zi=Yn;export{wn as Dynamic,Ln as ErrorBoundary,V as FX_DATA_ID,xn as For,Tn as Index,un as Island,ue as JSX_PROPERTIES,Nn as Match,Rn as Portal,rr as SVG_ELEMENTS,le as SVG_NAMESPACE,mn as Show,vn as Switch,nr as VOID_ELEMENTS,je as addClass,be as addDelegatedEventListener,et as addNativeEventListener,ze as appendChildren,ce as applyElementProp,ot as applyProps,tt as applyUse,Rr as asComponent,Cr as asContext,wr as asOutlet,Ar as asProvider,Sr as asRoute,Nr as asRouter,vr as asRoutes,Mr as asSuspense,Vt as captureHydrationCursor,Pr as checkRenderType,Dn as classMap,C as cleanChildren,Qe as cloneTemplate,ir as closest,at as createComponent,We as createElement,ee as createNativeElement,st as createPortal,F as createRequestContext,Ze as createTemplate,Zi as default,fr as delegate,Q as delegateEvents,re as escapeFxJson,Jr as escapeHTML,Kr as fnName,Vr as generateID,Ve as getAttribute,Tr as getGlobal,er as getLitEventName,pt as getLocals,ur as getOffset,S as getRequestContext,Ee as getRequestEvent,Ne as getRequestLocals,oe as getServerData,Hr as getStableElementId,ar as getStyle,_ as handleRef,sr as hasClass,pn as html,U as hydrate,$ as hydrateAdvancePast,dn as hydrateIslands,xi as indexArray,eo as initializeIntegration,v as insert,G as insertExpression,to as intergartionInitialized,Yr as isAccessor,b as isComponent,Ft as isContext,kt as isCustomElement,xr as isDOMNode,Ur as isDelegatedEvent,ye as isDomElement,L as isDomNode,me as isDomText,Qn as isEventHandler,Wr as isFunction,lt as isIntegrationInitialized,gr as isJSXTemplate,_t as isLitTemplateResult,Xr as isNativeElement,qt as isOutlet,z as isPromise,jt as isProvider,mr as isReactElement,It as isRoute,Ot as isRouter,$t as isRoutes,Gr as isSVGElement,x as isServer,Ht as isSuspense,hr as isTemplateFactory,lr as isVisible,zr as iterateFn,gi as keyArray,Yt as makeArrayFlat,hi as mapArray,it as mergeProps,pr as observeIntersection,yr as observeResize,qe as query,or as queryAll,Qr as registerCreateComponent,br as registerGlobal,Ue as removeAttribute,Ke as removeChildren,Fe as removeClass,X as removeDelegatedEventListener,te as render,Rt as renderToString,Pt as renderToStringAsync,ct as resetIntegration,Ut as runHydrationAt,H as runWithRequestContext,Wt as runWithoutHydration,cr as scrollIntoView,T as serializeNode,Ie as serializeResourceData,m as setAttribute,J as setClassList,D as setClassName,Mt as setDataRedactor,q as setDynamicAttribute,nt as setDynamicBoolAttribute,j as setDynamicProperty,k as setProperty,dt as setRequestStore,P as setServerMode,Y as setStyle,fe as setStyles,tr as shouldSetAsProperty,Br as splitProps,rt as spread,$n as styleMap,yn as svg,Zn as toAttributeName,He as toggleClass,dr as waitForElement};
|
|
1
|
+
function tr(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function nr(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function rr(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function or(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 ir=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),sr=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"]),O="http://www.w3.org/2000/svg";function kt(e){return e.localName.includes("-")}function de(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(kt(e)){e[t]=n;return}m(e,t,n,r)}var pe=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Fe(e,t=document){return t.querySelector(e)}function ar(e,t=document){return Array.from(t.querySelectorAll(e))}function lr(e,t){return e.closest(t)}function He(e,...t){e.classList.add(...t)}function Ve(e,...t){e.classList.remove(...t)}function Ue(e,...t){t.forEach(n=>e.classList.toggle(n))}function cr(e,t){return e.classList.contains(t)}function m(e,t,n,r=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}function We(e,t){return e.getAttribute(t)}function Ke(e,t){e.removeAttribute(t)}function ye(e,t){Object.assign(e.style,t)}function ur(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function ze(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")ye(r,i);else if(o.startsWith("on")&&typeof i=="function"){let s=o.slice(2).toLowerCase();r.addEventListener(s,i)}else m(r,o,i)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Be(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Ge(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function fr(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function dr(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function pr(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function yr(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 mr(e,t=5e3){return new Promise((n,r)=>{let o=Fe(e);if(o){n(o);return}let i=new MutationObserver(()=>{let a=Fe(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 gr(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(i=>{t(i.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function hr(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var _t=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function xr(e){return typeof e=="object"&&e!==null&&e.$$typeof===_t}function Ot(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function br(e){if(typeof e!="function")return!1;try{let t=e();return Ot(t)}catch{return!1}}function Tr(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Er(e){return e instanceof Node}function Nr(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function vr(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}import{isSignal as x}from"@fluixi/reactive/signal";function wr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Ar(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Cr(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function Rr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function Mr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function Pr(e){return Object.defineProperty(e,Symbol.for("fluixi-context"),{value:!0,enumerable:!0}),e}function Lr(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-component"),{value:!0,enumerable:!0}),e}function Dr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function $t(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function It(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function qt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function jt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function Ft(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function T(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Vt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function kr(e){return $t(e)?{type:"router",value:e}:qt(e)?{type:"route",value:e}:It(e)?{type:"routes",value:e}:jt(e)?{type:"outlet",value:e}:T(e)?{type:"component",value:e}:Vt(e)?{type:"suspense",value:e}:Ft(e)?{type:"provider",value:e}:Ht(e)?{type:"context",value:e}:{type:"none",value:e}}import{batch as Qe,createEffect as j,createRenderEffect as p,createRoot as zt,onCleanup as R,readChildren as Bt}from"@fluixi/reactive/signal";var g=typeof document>"u";function P(e){g=e}var $=Symbol.for("fluixi.server-node"),me=null;function Xe(e){me=e}function I(){if(!me)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return me}function L(e){return e!=null&&e[$]===!0?!0:typeof Node<"u"&&e instanceof Node}function ge(e){return e!=null&&e[$]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function he(e){return e!=null&&e[$]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Je=null;function Ye(e){Je=e}function xe(){return Je}function be(e,t){return u.active&&t.parentNode===e}function Te(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Ut(){return u.active?u.cursor:null}function Wt(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 Kt(e){if(!u.active)return e();let t=u.cursor,n=u.parents;u.active=!1,u.parents=[];try{return e()}finally{u.active=!0,u.cursor=t,u.parents=n}}function q(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Te(t)}function Gt(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let r=0,o=e;for(;o=o.previousElementSibling;)o.tagName===e.tagName&&r++;n+=`:nth-of-type(${r+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function Xt(e){let t=0;for(let n=0;n<e.length;n++)t=(t<<5)-t+e.charCodeAt(n),t|=0;return`el_${Math.abs(t)}`}function Wr(e){return Xt(Gt(e))}var Kr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),Jt={};var Ze=new Map,X=new Set,ee=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function te(e){if(!g)for(let t of e)X.has(t)||ee.has(t)||(X.add(t),document.addEventListener(t,Yt))}function Yt(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let r=n[t];if(r&&!n.disabled&&(r(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function Ee(e,t,n){if(e[`$$${t}`]=n,ee.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=i=>{e[`$$${t}`]?.(i)};e.addEventListener(t,o),e[r]=o}return}X.has(t)||te([t])}function J(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function zr(e){return!ee.has(e)}function Br(e){return typeof e=="function"}function w(e,t=!1){if(g)return I().createText(e);if(u.active&&!t){let n=xe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ne(e,t=!1){if(g)return I().createElement(e,t);if(u.active){let n=xe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(O,e):document.createElement(e)}function et(e,t=!1){let n=Ze.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Ze.set(e,r),r}function tt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Zt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Zt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Gr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Xr(e){if(x(e)||T(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!x(t)&&!T(t);)t=t();return t}var v=0,Qt=200;function en(e,t,n,r,o){let i=r,s=new Map;return p(()=>{let a;if(T(e)&&!x(e)){if(!s.has(e)){v++;try{let l=e();s.set(e,l)}finally{v--}}for(a=s.get(e);typeof a=="function"&&x(a);)a=a()}else for(a=e();typeof a=="function"&&x(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(T(a)){if(!s.has(a)){let c=a;v++;try{let f=c();s.set(c,f)}finally{v--}}a=s.get(a)}else if(x(a))a=a();else if(a=a(),typeof a!="function"||!x(a)&&!T(a))break}v++;try{i=Y(t,a,n,i,s),o(i)}finally{v--}})}function b(e,t,n,r){if(v>Qt)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=w("",!0),e.appendChild(n));let o=r??null,i=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),s=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!i(t)){v++;try{o=Y(e,t,n,null)}finally{v--}return()=>o}let a=en(s(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Y(e,t,n,r,o){if(t==null||typeof t=="boolean")return C(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return C(e,r,n);if(G(t)){let s=w("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),C(e,r.slice(1),n)):h(e,s,n):r?e.replaceChild(s,r):h(e,s,n),t.then(a=>{s.parentNode===e&&Y(e,a,s.nextSibling,s)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),s}let i=typeof t;if(i==="string"||i==="number"){if(i==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=w(t);return h(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=C(e,r,n)}if(r&&he(r))return r.data=t,r;let s=w(t);return r&&r.parentNode===e?e.replaceChild(s,r):be(e,s)||h(e,s,n),s}if(L(t))return be(e,t)?(Te(t),t):Array.isArray(r)?(r.length===0?h(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),C(e,r.slice(1),n)):h(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):h(e,t,n)):h(e,t,n),t);if(Array.isArray(t)){let s=[],a=Array.isArray(r)?r:r?[r]:[],l=[];N(t,s,e,n,!0,o,l);let c=tn(e,a,s,n);for(let f of l){let d=b(e,f.sig,f.marker);R(()=>{C(e,d()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(i==="object"&&t!==null&&typeof t=="object"){let s=t;if("type"in s&&"props"in s){let a=s;if(typeof a.type=="function"){let l=a.type(a.props||{});return Y(e,l,n,r)}}}return C(e,r,n)}function N(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"&&!G(l)&&!x(l)&&!T(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(T(l)&&!x(l)?(i||(i=new Map),i.has(l)||i.set(l,l()),c=i.get(l)):c=l();typeof c=="function"&&!G(c)&&!x(c)&&!T(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(x(c)){if(s){let d=w("",!0);t.push(d),s.push({marker:d,sig:c});continue}let f=c();for(;typeof f=="function"&&x(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?N(f,t,n,r,o,i):N([f],t,n,r,o,i);continue}continue}Array.isArray(c)?N(c,t,n,r,o,i,s):N([c],t,n,r,o,i,s);continue}if(G(l)){let c=w("",!0);t.push(c),l.then(f=>{if(c.parentNode){let d=[];if(N([f],d,c.parentNode,void 0,!1,i),d.length>0){c.parentNode.replaceChild(d[0],c);for(let y=1;y<d.length;y++)c.parentNode?.insertBefore(d[y],d[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){N(l,t,n,r,o,i,s);continue}if(L(l)){t.push(l);continue}if(typeof l=="object"&&l!==null&&"type"in l&&"props"in l){let c=l;if(typeof c.type=="function"){let f=c.type(c.props||{});Array.isArray(f)?N(f,t,n,r,!1,i):N([f],t,n,r,!1,i);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(w(c));continue}t.push(w(String(l)))}}}}function tn(e,t,n,r){for(let d=0;d<n.length;d++)n[d].parentNode!==null&&n[d].parentNode!==e&&(n=n.slice(),n[d]=n[d].cloneNode(!0));let o=n.length,i=t.length,s=o,a=0,l=0,c=i>0?t[i-1].nextSibling??void 0:r,f=null;for(;a<i||l<s;){if(t[a]===n[l]){a++,l++;continue}for(;i>a&&s>l&&t[i-1]===n[s-1];)i--,s--;if(i===a){let d=s<o?l?n[l-1].nextSibling??void 0:n[s-l]:c;for(;l<s;)h(e,n[l++],d)}else if(s===l)for(;a<i;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[s-1]&&n[l]===t[i-1]){let d=t[--i].nextSibling;h(e,n[l++],t[a++].nextSibling),h(e,n[--s],d),t[i]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<s;)f.set(n[y],y++)}let d=f.get(t[a]);if(d!=null)if(l<d&&d<s){let y=a,fe=1;for(;++y<i&&y<s&&!(!f.has(t[y])||f.get(t[y])!==d+fe);)fe++;if(fe>d-l){let Dt=t[a];for(;l<d;)h(e,n[l++],Dt)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(h(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function C(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function h(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function D(e,t,n){n==null?delete e[t]:e[t]=n}function nt(e,t,n){let r=n,o;return Array.isArray(n)&&(r=n[0],o=n[1]),typeof r!="function"?()=>{}:(e.addEventListener(t,r,o),()=>e.removeEventListener(t,r,o))}function rt(e,t){let n=(r,o)=>{typeof r=="function"&&r(e,o??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let r of t)Array.isArray(r)?n(r[0],r[1]):n(r)}}function F(e,t,n,r=!1){return typeof n!="function"?(m(e,t,n,r),()=>{}):p(()=>{let o=typeof n=="function"?n():n;m(e,t,o,r)})}function H(e,t,n){return typeof n!="function"?(D(e,t,n),()=>{}):p(()=>{let r=typeof n=="function"?n():n;D(e,t,r)})}function ot(e,t,n){return typeof n!="function"?(m(e,t,!!n),()=>{}):p(()=>{let r=n();m(e,t,!!r)})}function k(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>k(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(r=>{let o=t[r];return typeof o=="function"?o():!!o}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function Z(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],i=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push(p(()=>{let s=!!o();for(let a of i)e.classList.toggle(a,s)}));else{let s=!!(typeof o=="function"?o():o);for(let a of i)e.classList.toggle(a,s)}}}function Q(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let r in n){let o=n[r];o==null?e.style[r]="":e.style[r]=o}}function it(e){let{element:t,props:n,prevProps:r=Jt,isSVG:o=!1,skipChildren:i=!1}=e;if(!t||!ge(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===O,a=[];for(let l in n){if(i&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){_(c,t);continue}if(l==="use"){rt(t,c);continue}if(l.startsWith("on:")){a.push(nt(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(H(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(F(t,l.slice(5),c,s));continue}if(l.startsWith("bool:")){a.push(ot(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push(p(()=>k(t,c()))):k(t,c);continue}if(l==="classList"){typeof c=="function"?a.push(p(()=>Z(t,c()))):Z(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push(p(()=>Q(t,c()))):Q(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&J(t,y),c&&Ee(t,y,c);continue}let d=pe.has(l)||!s&&l in t;typeof c=="function"?a.push(d?H(t,l,c):F(t,l,c,s)):a.push(p(()=>d?D(t,l,n[l]):m(t,l,n[l],s)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();J(t,c)}else pe.has(l)?D(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function re(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){_(o,e);continue}if(r!=="children"){if(r==="use"){rt(e,o);continue}if(r.startsWith("on:")){nt(e,r.slice(3),o);continue}if(r.startsWith("prop:")){H(e,r.slice(5),o);continue}if(r.startsWith("attr:")){F(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){ot(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let i=r.slice(2).toLowerCase();if(typeof o=="function")if(ee.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,X.has(i)||te([i]);continue}if(r==="class"||r==="className"){k(e,o);continue}if(r==="classList"){typeof o=="function"?p(()=>Z(e,o())):Z(e,o);continue}if(r==="style"){typeof o=="function"?p(()=>Q(e,o())):Q(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function";)s=s();e.innerHTML=s});R(()=>i())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.value=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();document.activeElement!==e&&(e.checked=s??"")});R(()=>{i()})}else p(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let i=!0,s=j(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();i?(i=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});R(()=>{s()})}else{let i=!0;p(()=>{let s=t[r];i?(i=!1,queueMicrotask(()=>{e.value=s??""})):e.value=s??""})}continue}if(typeof o=="function"){let i=j(()=>{let s=o();for(;typeof s=="function"&&s.length===0;)s=s();de(e,r,s,n)});R(()=>{i()})}else p(()=>de(e,r,t[r],n))}}}function st(...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 Jr(e,...t){let n=new Set;for(let s of t)for(let a of s)n.add(a);let r=s=>({enumerable:!0,configurable:!0,get:()=>e[s]}),o=t.map(s=>{let a=new Set(s);return new Proxy({},{get:(l,c)=>a.has(c)?e[c]:void 0,has:(l,c)=>a.has(c)&&c in e,ownKeys:()=>Array.from(a).filter(l=>l in e),getOwnPropertyDescriptor:(l,c)=>a.has(c)&&c in e?r(c):void 0})}),i=new Proxy({},{get:(s,a)=>n.has(a)?void 0:e[a],has:(s,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(s=>!n.has(s)),getOwnPropertyDescriptor:(s,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,i]}function _(e,t){if(e){if(L(e)){let n=t,r=e;if(!n)return;typeof n=="function"?n(r):typeof n=="object"&&"current"in n&&(n.current=r);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function at(e,t,n){let r=t||document.body,o=Bt(()=>e),i=[];return Qe(()=>{let s=p(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),i.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):L(a)&&(r.appendChild(a),i.push(()=>{a.parentNode===r&&r.removeChild(a)}))});i.push(s),R(()=>{i.forEach(a=>a())})}),null}function Yr(e){return typeof e=="string"&&e.toLowerCase()===e}function lt(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function Zr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function G(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Qr(e){return typeof e=="function"&&e.length===0&&x(e)}function oe(e,t,n){if(!t)throw new Error("Container element is required");let r,o,i=[];return zt(s=>{Qe(()=>{u.active||(t.textContent=""),b(t,e)}),o=s}),()=>{o?.(),r?.(),i.forEach(s=>s()),t.textContent=""}}var nn="__fx_dom_create_component__",M=globalThis[nn]??={fn:null};function to(e){M.fn=e}function no(e={}){let t=e.signalSystem?.createComponent;t&&(M.fn=t)}function ie(e,t){return M.fn?M.fn(e,t):(()=>e(t))}var ro=()=>M.fn!==null,ct=()=>M.fn!==null;function ut(){M.fn=null}var se,dt={getStore:()=>se,run(e,t){let n=se;se=e;try{return t()}finally{se=n}}},Ne=dt;function pt(e){Ne=e??dt}function V(e={}){e.locals||(e.locals=e.request?Se(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 U(e,t){return Ne.run(e,t)}function S(){return Ne.getStore()}function ve(){return S()?.event}function yt(){let e=ve();return e?(e.locals||(e.locals={}),e.locals):{}}var ft=new WeakMap;function Se(e){let t=ft.get(e);return t||(t={},ft.set(e,t)),t}import{setResourceIdSource as rn,setServerDataGetter as on}from"@fluixi/reactive/signal";var W="__FX_DATA__";function ae(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var we;function le(){let e=globalThis.__FX_DATA__;if(e)return e;if(we!==void 0)return we;let t=null;if(typeof document<"u"){let n=document.getElementById(W)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return we=t}function Ae(){for(;;){for(;u.cursor&&u.cursor.nodeType===3&&u.cursor.data==="";)u.cursor=u.cursor.nextSibling;if(u.cursor!=null||!u.parents.length)return;u.cursor=u.parents.pop().nextSibling}}var sn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ce=typeof process<"u"&&process.env&&!1;function Re(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function an(e){Ae();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(sn.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ce&&t&&Re(`<${e}>`,t),null)}function ln(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Ae();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ce&&t&&Re(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function cn(e){Ae();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ce&&t&&Re(`marker <!--${e.slice(0,24)}-->`,t),null)}var mt=!1;function un(){mt||(mt=!0,Ye({hydrateElement:an,hydrateText:ln,hydrateMarker:cn}))}function K(e,t,n){un(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=le(),o=n?.resourceNamespace,i=0;rn(()=>o?`${o}:r${i++}`:`r${i++}`),on(r?s=>s in r?{value:r[s]}:void 0:null);try{return oe(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Me="fluixi-island";function fn(e){let{component:t,props:n={},name:r}=e,o=ne(Me),i=r??t.name??"Island";m(o,"name",i),m(o,"props",JSON.stringify(n??{}));let s=g?S():void 0;if(s){let a=s.nextIslandNamespace(i);b(o,()=>s.withResourceScope(a,()=>t(n)))}else b(o,()=>t(n));return o}var gt=!1;function dn(){if(gt||typeof document>"u")return;gt=!0;let e=document.createElement("style");e.textContent=`${Me}{display:contents}`,document.head.appendChild(e)}function pn(e){if(typeof document>"u")return;dn();let t=document.querySelectorAll(Me),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{}K(()=>s(a),r,{resourceNamespace:`${o}#${i}`})})}function yn(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function mn(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}import{readChildren as gn}from"@fluixi/reactive/signal";function ko(e,t={}){if(typeof e=="function")return ie(e,t);if(typeof e!="string"||e.length===0)return null;let n=lt(e);if(g)return I().createElement(e,n);let r=n?document.createElementNS(O,e):document.createElement(e);return re(r,t,n),hn(r,t),r}function hn(e,t){if(!t||t.children===void 0)return;let n=gn(()=>t.children),r=o=>{b(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}import{createMemo as Pe,untrack as Tt}from"@fluixi/reactive/signal";function ht(e){return typeof e=="function"?e:(()=>e)}function A(e){return()=>{let t=e();return typeof t=="function"?t():t}}function xt(e){return e!=null&&e!==!1}function bt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function xn(e){let t=A(()=>e.when),n=Pe(t,void 0),r=Pe(n,void 0);return Pe(()=>{if(r()){let i=e.children;return typeof i=="function"&&!bt(i)?typeof n=="function"?Tt(()=>Tt(n)?i(n()):e.fallback):i(n):i}return e.fallback},void 0,{name:"show"})}import{mapArray as bn,keyArray as Tn}from"@fluixi/reactive/signal";function En(e){let t=A(()=>e.each),n=()=>e.fallback??null,r=(o,i)=>{let s=e.children,a=Array.isArray(s)?s.map(l=>typeof l=="function"?l(o,i):l):typeof s=="function"?s(o,i):s;return q(a),a};return e.by?Tn(t,e.by,(o,i)=>r(o,i),{fallback:n}):bn(t,(o,i)=>r(o,i),{fallback:n})}import{indexArray as Nn}from"@fluixi/reactive/signal";function vn(e){let t=A(()=>e.each);return Nn(t,(n,r)=>{let o=e.children(n,r);return q(o),o},{fallback:()=>e.fallback??null})}import{mapArray as wi,keyArray as Ai,indexArray as Ci}from"@fluixi/reactive/signal";import{createMemo as Sn}from"@fluixi/reactive/signal";var Le=Symbol("match");function wn(e){return{[Le]:!0,when:A(()=>e.when),children:e.children}}function An(e){let t=Array.isArray(e.children)?e.children:[e.children];return Sn(()=>{for(let n of t){let r=n,o=0;for(;typeof r=="function"&&!r[Le]&&o++<10;)r=r();if(!r||typeof r!="object"||r[Le]!==!0)continue;let i=r.when();if(xt(i))return typeof r.children=="function"?r.children(i):r.children}return e.fallback??null})}import{createMemo as Cn}from"@fluixi/reactive/signal";function Rn(e){let t=ht(e.component),{component:n,...r}=e;return Cn(()=>{let o=t();return o==null?null:typeof o=="string"?{tag:o,props:r}:o(r)})}import{createRoot as Mn,onCleanup as Pn}from"@fluixi/reactive/signal";function Ln(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return Mn(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),b(r,e.children)&&_(e.ref,r)}),Pn(()=>{n(),r.remove()}),null}import{createMemo as Dn,createSignal as kn}from"@fluixi/reactive/signal";function _n(e){let[t,n]=kn(null),r=()=>n(null);return Dn(()=>{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 On}from"@fluixi/reactive/signal";function $n(e){return On(()=>{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 In}from"@fluixi/reactive/signal";function qn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function jn(e){return In(()=>{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(`${qn(r)}: ${i}`)}return n.join("; ")})}var _e=1,Oe=3,$e=8,Et;Et=$;var z=class{constructor(){this[Et]=!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(){}},B=class e extends z{constructor(n){super();this.nodeType=Oe;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}get textContent(){return this.data}set textContent(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},ce=class e extends z{constructor(n){super();this.nodeType=$e;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},De=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}},ue=class e extends z{constructor(n,r=!1){super();this.nodeType=_e;this.attributes=new Map;this.style=new De;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 B(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 Fn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),vt=/&/g,Hn=/</g,Vn=/>/g,Un=/"/g;function Ie(e){return e.replace(vt,"&").replace(Hn,"<").replace(Vn,">")}function Nt(e){return e.replace(vt,"&").replace(Un,""")}function Wn(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Kn(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(`${Wn(n)}: ${r}`)}return t.join("; ")}function zn(e){let t="",n=Kn(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${Nt(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${Nt(o)}"`}return t}function E(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return Ie(e);if(typeof e=="number")return Ie(String(e));if(typeof e=="function")return E(e());if(Array.isArray(e))return e.map(E).join("");switch(e.nodeType){case Oe:return Ie(e.data??"");case $e:return`<!--${e.data??""}-->`;case _e:{let t=e.localName,n=`<${t}${zn(e)}>`;if(Fn.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(E).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(E).join(""):""}import{createRoot as Ct}from"@fluixi/reactive/signal";import{setResourceTracker as Bn,setResourceIdSource as Gn,setResourceDataSink as Xn,getOwner as Jn,runWithOwner as St,flush as Yn}from"@fluixi/reactive/signal";var wt=!1;function Rt(){wt||(wt=!0,Xe({createElement:(e,t)=>new ue(e,t),createText:e=>new B(e),createComment:e=>new ce(e)}))}function Mt(e,t={}){let n=g;Rt(),P(!0);let r=V(t.event);try{return U(r,()=>Ct(o=>{try{let i=typeof e=="function"?e():e;return E(i)}finally{o()}}))}finally{P(n)}}var At=!1;function Zn(){At||(At=!0,Bn(e=>{S()?.pending.add(e)}),Gn(()=>S()?.nextResourceId()??""),Xn((e,t)=>{e&&S()?.data.set(e,t)}))}var qe=null;function Pt(e){qe=e}function je(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let i=o;if(qe)try{i=qe(o,r)}catch{continue}i!==void 0&&(t[r]=i)}if(Object.keys(t).length===0)return"";let n=ae(JSON.stringify(t));return`<script type="application/json" id="${W}">${n}<\/script>`}var Qn=50;async function Lt(e,t={}){let n=g;Rt(),P(!0),Zn();let r=V(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,i=null,s=()=>{};Ct(f=>{s=f,i=Jn(),o=typeof e=="function"?e():e});let a=()=>{try{St(i,()=>E(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<Qn;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await Yn(),a()}let c=St(i,()=>E(o))+je(r);return s(),c})}finally{P(n)}}var er={createComponent:ie,createElement:ze,createNativeElement:ne,createTemplate:et,cloneTemplate:tt,createPortal:at,render:oe,hydrate:K,insert:b,appendChildren:Ge,removeChildren:Be,spread:it,applyProps:re,mergeProps:st,setProperty:D,setDynamicProperty:H,setAttribute:m,setDynamicAttribute:F,removeAttribute:Ke,getAttribute:We,setClassName:k,addClass:He,removeClass:Ve,toggleClass:Ue,setStyles:ye,delegateEvents:te,addDelegatedEventListener:Ee,removeDelegatedEventListener:J,handleRef:_,resetIntegration:ut,isIntegrationInitialized:ct},ls=er;export{Rn as Dynamic,_n as ErrorBoundary,W as FX_DATA_ID,En as For,vn as Index,fn as Island,pe as JSX_PROPERTIES,wn as Match,Ln as Portal,sr as SVG_ELEMENTS,O as SVG_NAMESPACE,xn as Show,An as Switch,ir as VOID_ELEMENTS,He as addClass,Ee as addDelegatedEventListener,nt as addNativeEventListener,Ge as appendChildren,de as applyElementProp,re as applyProps,rt as applyUse,Lr as asComponent,Pr as asContext,Rr as asOutlet,Mr as asProvider,Cr as asRoute,wr as asRouter,Ar as asRoutes,Dr as asSuspense,Ut as captureHydrationCursor,kr as checkRenderType,$n as classMap,C as cleanChildren,tt as cloneTemplate,lr as closest,ie as createComponent,ko as createDynamicElement,ze as createElement,ne as createNativeElement,at as createPortal,V as createRequestContext,et as createTemplate,ls as default,yr as delegate,te as delegateEvents,ae as escapeFxJson,Zr as escapeHTML,Gr as fnName,Kr as generateID,We as getAttribute,vr as getGlobal,rr as getLitEventName,yt as getLocals,pr as getOffset,S as getRequestContext,ve as getRequestEvent,Se as getRequestLocals,le as getServerData,Wr as getStableElementId,ur as getStyle,_ as handleRef,cr as hasClass,yn as html,K as hydrate,q as hydrateAdvancePast,pn as hydrateIslands,Ci as indexArray,no as initializeIntegration,b as insert,Y as insertExpression,ro as intergartionInitialized,Qr as isAccessor,T as isComponent,Ht as isContext,kt as isCustomElement,Er as isDOMNode,zr as isDelegatedEvent,ge as isDomElement,L as isDomNode,he as isDomText,nr as isEventHandler,Br as isFunction,ct as isIntegrationInitialized,Tr as isJSXTemplate,Ot as isLitTemplateResult,Yr as isNativeElement,jt as isOutlet,G as isPromise,Ft as isProvider,xr as isReactElement,qt as isRoute,$t as isRouter,It as isRoutes,lt as isSVGElement,g as isServer,Vt as isSuspense,br as isTemplateFactory,fr as isVisible,Xr as iterateFn,Ai as keyArray,Zt as makeArrayFlat,wi as mapArray,st as mergeProps,gr as observeIntersection,hr as observeResize,Fe as query,ar as queryAll,to as registerCreateComponent,Nr as registerGlobal,Ke as removeAttribute,Be as removeChildren,Ve as removeClass,J as removeDelegatedEventListener,oe as render,Mt as renderToString,Lt as renderToStringAsync,ut as resetIntegration,Wt as runHydrationAt,U as runWithRequestContext,Kt as runWithoutHydration,dr as scrollIntoView,E as serializeNode,je as serializeResourceData,m as setAttribute,Z as setClassList,k as setClassName,Pt as setDataRedactor,F as setDynamicAttribute,ot as setDynamicBoolAttribute,H as setDynamicProperty,D as setProperty,pt as setRequestStore,P as setServerMode,Q as setStyle,ye as setStyles,or as shouldSetAsProperty,Jr as splitProps,it as spread,jn as styleMap,mn as svg,tr as toAttributeName,Ue as toggleClass,mr as waitForElement};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var P=Object.defineProperty;var Y=Object.getOwnPropertyDescriptor;var Z=Object.getOwnPropertyNames;var Q=Object.prototype.hasOwnProperty;var ee=(e,t)=>{for(var n in t)P(e,n,{get:t[n],enumerable:!0})},te=(e,t,n,o)=>{if(t&&typeof t=="object"||typeof t=="function")for(let s of Z(t))!Q.call(e,s)&&s!==n&&P(e,s,{get:()=>t[s],enumerable:!(o=Y(t,s))||o.enumerable});return e};var ne=e=>te(P({},"__esModule",{value:!0}),e);var Ee={};ee(Ee,{createDynamicElement:()=>he});module.exports=ne(Ee);var g=require("@fluixi/reactive/signal");var M="http://www.w3.org/2000/svg";function oe(e){return e.localName.includes("-")}function R(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(oe(e)){e[t]=n;return}T(e,t,n,o)}function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Ne=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var d=require("@fluixi/reactive/signal");var S=typeof document>"u";var $=Symbol.for("fluixi.server-node"),j=null;function w(){if(!j)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return j}function v(e){return e!=null&&e[$]===!0?!0:typeof Node<"u"&&e instanceof Node}function D(e){return e!=null&&e[$]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},ie=null;function F(){return ie}function O(e,t){return b.active&&t.parentNode===e}function I(e){let t=b.parents.lastIndexOf(e);t!==-1&&(b.parents.length=t),b.cursor=e.nextSibling}var _=new Set,K=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function re(e){if(!S)for(let t of e)_.has(t)||K.has(t)||(_.add(t),document.addEventListener(t,se))}function se(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function x(e,t=!1){if(S)return w().createText(e);if(b.active&&!t){let n=F()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var h=0,fe=200;function ae(e,t,n,o,s){let a=o,i=new Map;return(0,d.createRenderEffect)(()=>{let r;if(E(e)&&!(0,g.isSignal)(e)){if(!i.has(e)){h++;try{let f=e();i.set(e,f)}finally{h--}}for(r=i.get(e);typeof r=="function"&&(0,g.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,g.isSignal)(r);)r=r();{let f=0;for(;typeof r=="function"&&f++<50;)if(E(r)){if(!i.has(r)){let l=r;h++;try{let u=l();i.set(l,u)}finally{h--}}r=i.get(r)}else if((0,g.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,g.isSignal)(r)&&!E(r))break}h++;try{a=C(t,r,n,a,i),s(a)}finally{h--}})}function H(e,t,n,o){if(h>fe)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=x("",!0),e.appendChild(n));let s=o??null,a=f=>Array.isArray(f)&&f.some(l=>typeof l=="function"),i=f=>typeof f=="function"?f:()=>f;if(typeof t!="function"&&!a(t)){h++;try{s=C(e,t,n,null)}finally{h--}return()=>s}let r=ae(i(t),e,n,s,f=>{s=f});return()=>(r?.(),s)}function C(e,t,n,o,s){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(A(t)){let i=x("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(i,o[0]),N(e,o.slice(1),n)):p(e,i,n):o?e.replaceChild(i,o):p(e,i,n),t.then(r=>{i.parentNode===e&&C(e,r,i.nextSibling,i)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),i}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=x(t);return p(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&D(o))return o.data=t,o;let i=x(t);return o&&o.parentNode===e?e.replaceChild(i,o):O(e,i)||p(e,i,n),i}if(v(t))return O(e,t)?(I(t),t):Array.isArray(o)?(o.length===0?p(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),N(e,o.slice(1),n)):p(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):p(e,t,n)):p(e,t,n),t);if(Array.isArray(t)){let i=[],r=Array.isArray(o)?o:o?[o]:[],f=[];m(t,i,e,n,!0,s,f);let l=le(e,r,i,n);for(let u of f){let c=H(e,u.sig,u.marker);(0,d.onCleanup)(()=>{N(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let r=i;if(typeof r.type=="function"){let f=r.type(r.props||{});return C(e,f,n,o)}}}return N(e,o,n)}function m(e,t,n,o,s=!0,a,i){for(let r=0;r<e.length;r++){let f=e[r];if(!(f==null||typeof f=="boolean")){for(;typeof f=="function"&&!A(f)&&!(0,g.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,g.isSignal)(f)?(a||(a=new Map),a.has(f)||a.set(f,f()),l=a.get(f)):l=f();typeof l=="function"&&!A(l)&&!(0,g.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,g.isSignal)(l)){if(i){let c=x("",!0);t.push(c),i.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&(0,g.isSignal)(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?m(u,t,n,o,s,a):m([u],t,n,o,s,a);continue}continue}Array.isArray(l)?m(l,t,n,o,s,a,i):m([l],t,n,o,s,a,i);continue}if(A(f)){let l=x("",!0);t.push(l),f.then(u=>{if(l.parentNode){let c=[];if(m([u],c,l.parentNode,void 0,!1,a),c.length>0){l.parentNode.replaceChild(c[0],l);for(let y=1;y<c.length;y++)l.parentNode?.insertBefore(c[y],c[y-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(f)){m(f,t,n,o,s,a,i);continue}if(v(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)?m(u,t,n,o,!1,a):m([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(x(l));continue}t.push(x(String(f)))}}}}function le(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let s=n.length,a=t.length,i=s,r=0,f=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||f<i;){if(t[r]===n[f]){r++,f++;continue}for(;a>r&&i>f&&t[a-1]===n[i-1];)a--,i--;if(a===r){let c=i<s?f?n[f-1].nextSibling??void 0:n[i-f]:l;for(;f<i;)p(e,n[f++],c)}else if(i===f)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[i-1]&&n[f]===t[a-1]){let c=t[--a].nextSibling;p(e,n[f++],t[r++].nextSibling),p(e,n[--i],c),t[a]=t[r-1]}else{if(!u){u=new Map;let y=f;for(;y<i;)u.set(n[y],y++)}let c=u.get(t[r]);if(c!=null)if(f<c&&c<i){let y=r,L=1;for(;++y<a&&y<i&&!(!u.has(t[y])||u.get(t[y])!==c+L);)L++;if(L>c-f){let J=t[r];for(;f<c;)p(e,n[f++],J)}else t[r].parentNode===e?e.replaceChild(n[f++],t[r++]):(p(e,n[f++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function p(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function W(e,t,n){n==null?delete e[t]:e[t]=n}function ue(e,t,n){let o=n,s;return Array.isArray(n)&&(o=n[0],s=n[1]),typeof o!="function"?()=>{}:(e.addEventListener(t,o,s),()=>e.removeEventListener(t,o,s))}function ce(e,t){let n=(o,s)=>{typeof o=="function"&&o(e,s??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function de(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):(0,d.createRenderEffect)(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function ye(e,t,n){return typeof n!="function"?(W(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;W(e,t,o)})}function pe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let o=n();T(e,t,!!o)})}function G(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.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 k(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let s=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof s=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let i=!!s();for(let r of a)e.classList.toggle(r,i)}));else{let i=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,i)}}}function V(e,t){let n=t;for(;typeof n=="function";)n=n();if(n==null){e.removeAttribute("style");return}if(typeof n=="string"){e.style.cssText=n;return}if(typeof n=="object")for(let o in n){let s=n[o];s==null?e.style[o]="":e.style[o]=s}}function B(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){ge(s,e);continue}if(o!=="children"){if(o==="use"){ce(e,s);continue}if(o.startsWith("on:")){ue(e,o.slice(3),s);continue}if(o.startsWith("prop:")){ye(e,o.slice(5),s);continue}if(o.startsWith("attr:")){de(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){pe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(K.has(a)){e[`$$${a}`]=s;let i=`__fx_${a}`;if(!e[i]){let r=f=>{e[`$$${a}`]?.(f)};e.addEventListener(a,r),e[i]=r}}else e[`$$${a}`]=s,_.has(a)||re([a]);continue}if(o==="class"||o==="className"){G(e,s);continue}if(o==="classList"){typeof s=="function"?(0,d.createRenderEffect)(()=>k(e,s())):k(e,s);continue}if(o==="style"){typeof s=="function"?(0,d.createRenderEffect)(()=>V(e,s())):V(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function";)i=i();e.innerHTML=i});(0,d.onCleanup)(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,i=(0,d.createEffect)(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});(0,d.onCleanup)(()=>{i()})}else{let a=!0;(0,d.createRenderEffect)(()=>{let i=t[o];a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof s=="function"){let a=(0,d.createEffect)(()=>{let i=s();for(;typeof i=="function"&&i.length===0;)i=i();R(e,o,i,n)});(0,d.onCleanup)(()=>{a()})}else(0,d.createRenderEffect)(()=>R(e,o,t[o],n))}}}function ge(e,t){if(e){if(v(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 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 A(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var me="__fx_dom_create_component__",z=globalThis[me]??={fn:null};function U(e,t){return z.fn?z.fn(e,t):(()=>e(t))}var X=require("@fluixi/reactive/signal");function he(e,t={}){if(typeof e=="function")return U(e,t);if(typeof e!="string"||e.length===0)return null;let n=q(e);if(S)return w().createElement(e,n);let o=n?document.createElementNS(M,e):document.createElement(e);return B(o,t,n),xe(o,t),o}function xe(e,t){if(!t||t.children===void 0)return;let n=(0,X.readChildren)(()=>t.children),o=s=>{H(e,s,typeof s=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/** A tag name, or a component function. */
|
|
2
|
+
export type DynamicType = string | ((props: any) => any);
|
|
3
|
+
/**
|
|
4
|
+
* Create a node for `type` with `props`.
|
|
5
|
+
*
|
|
6
|
+
* A string builds a native element (SVG-aware) and inserts its children; a
|
|
7
|
+
* function is instantiated as a component.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createDynamicElement(type: DynamicType, props?: Record<string, any>): any;
|
|
10
|
+
//# sourceMappingURL=dynamic-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dynamic-element.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/dynamic-element.ts"],"names":[],"mappings":"AAsBA,2CAA2C;AAC3C,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,CAAC,CAAC,KAAK,EAAE,GAAG,KAAK,GAAG,CAAC,CAAC;AAEzD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,WAAW,EAAE,KAAK,GAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAM,GAAG,GAAG,CAc5F"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Build an element or component from a type known only at runtime.
|
|
3
|
+
*
|
|
4
|
+
* This is what a polymorphic `as` prop needs and what JSX syntax cannot express:
|
|
5
|
+
* you can write `<div>` or `<Comp>`, but not `<{value}>`. The automatic JSX
|
|
6
|
+
* runtime has always had this logic; it lived there only because JSX happened to
|
|
7
|
+
* be its first caller.
|
|
8
|
+
*
|
|
9
|
+
* It belongs in dom. Both authoring modes compile to the same dom calls, so an
|
|
10
|
+
* `as`-polymorphic component shouldn't have to depend on `@fluixi/jsx` — which it
|
|
11
|
+
* did, making `@fluixi/jsx` a runtime dependency of every component library built
|
|
12
|
+
* on `as`, including for apps that only ever write html`` templates.
|
|
13
|
+
*
|
|
14
|
+
* One implementation, so the two paths can't drift the way `spread` and
|
|
15
|
+
* `applyProps` did.
|
|
16
|
+
*/
|
|
17
|
+
import { applyProps, insert, isSVGElement } from './runtime.js';
|
|
18
|
+
import { createComponent } from './integration.js';
|
|
19
|
+
import { isServer, getServerNodes } from './server/host.js';
|
|
20
|
+
import { readChildren } from '@fluixi/reactive/signal';
|
|
21
|
+
import { SVG_NAMESPACE } from './utils.js';
|
|
22
|
+
/**
|
|
23
|
+
* Create a node for `type` with `props`.
|
|
24
|
+
*
|
|
25
|
+
* A string builds a native element (SVG-aware) and inserts its children; a
|
|
26
|
+
* function is instantiated as a component.
|
|
27
|
+
*/
|
|
28
|
+
export function createDynamicElement(type, props = {}) {
|
|
29
|
+
if (typeof type === 'function')
|
|
30
|
+
return createComponent(type, props);
|
|
31
|
+
if (typeof type !== 'string' || type.length === 0)
|
|
32
|
+
return null;
|
|
33
|
+
const svgTag = isSVGElement(type);
|
|
34
|
+
if (isServer)
|
|
35
|
+
return getServerNodes().createElement(type, svgTag);
|
|
36
|
+
const element = svgTag
|
|
37
|
+
? document.createElementNS(SVG_NAMESPACE, type)
|
|
38
|
+
: document.createElement(type);
|
|
39
|
+
applyProps(element, props, svgTag);
|
|
40
|
+
insertChildren(element, props);
|
|
41
|
+
return element;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Insert `props.children`, read through `readChildren` so a lazy `get children()`
|
|
45
|
+
* — which is how the compiler emits component children — resolves here rather
|
|
46
|
+
* than being materialised early.
|
|
47
|
+
*/
|
|
48
|
+
function insertChildren(element, props) {
|
|
49
|
+
if (!props || props.children === undefined)
|
|
50
|
+
return;
|
|
51
|
+
const children = readChildren(() => props.children);
|
|
52
|
+
const insertOne = (child) => {
|
|
53
|
+
// A function child is reactive and needs an anchor to update in place;
|
|
54
|
+
// a static one is appended directly.
|
|
55
|
+
insert(element, child, (typeof child === 'function' ? null : undefined));
|
|
56
|
+
};
|
|
57
|
+
if (Array.isArray(children))
|
|
58
|
+
children.forEach(insertOne);
|
|
59
|
+
else
|
|
60
|
+
insertOne(children);
|
|
61
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{isSignal as g}from"@fluixi/reactive/signal";var R="http://www.w3.org/2000/svg";function Y(e){return e.localName.includes("-")}function O(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(Y(e)){e[t]=n;return}T(e,t,n,o)}function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var ye=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function E(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as we,createEffect as v,createRenderEffect as p,createRoot as ve,onCleanup as S,readChildren as Ae}from"@fluixi/reactive/signal";var w=typeof document>"u";var D=Symbol.for("fluixi.server-node"),$=null;function A(){if(!$)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return $}function C(e){return e!=null&&e[D]===!0?!0:typeof Node<"u"&&e instanceof Node}function F(e){return e!=null&&e[D]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var b={active:!1,cursor:null,parents:[]},Z=null;function I(){return Z}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 H=new Set,G=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!w)for(let t of e)H.has(t)||G.has(t)||(H.add(t),document.addEventListener(t,ee))}function ee(e){let t=`$$${e.type}`,n=e.composedPath&&e.composedPath()[0]||e.target;for(;n;){let o=n[t];if(o&&!n.disabled&&(o(e),e.cancelBubble))return;n=n.host&&n.host!==n&&n.host instanceof Element?n.host:n.parentNode}}function x(e,t=!1){if(w)return A().createText(e);if(b.active&&!t){let n=I()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}var h=0,te=200;function ne(e,t,n,o,f){let a=o,i=new Map;return p(()=>{let r;if(E(e)&&!g(e)){if(!i.has(e)){h++;try{let s=e();i.set(e,s)}finally{h--}}for(r=i.get(e);typeof r=="function"&&g(r);)r=r()}else for(r=e();typeof r=="function"&&g(r);)r=r();{let s=0;for(;typeof r=="function"&&s++<50;)if(E(r)){if(!i.has(r)){let l=r;h++;try{let u=l();i.set(l,u)}finally{h--}}r=i.get(r)}else if(g(r))r=r();else if(r=r(),typeof r!="function"||!g(r)&&!E(r))break}h++;try{a=P(t,r,n,a,i),f(a)}finally{h--}})}function j(e,t,n,o){if(h>te)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=x("",!0),e.appendChild(n));let f=o??null,a=s=>Array.isArray(s)&&s.some(l=>typeof l=="function"),i=s=>typeof s=="function"?s:()=>s;if(typeof t!="function"&&!a(t)){h++;try{f=P(e,t,n,null)}finally{h--}return()=>f}let r=ne(i(t),e,n,f,s=>{f=s});return()=>(r?.(),f)}function P(e,t,n,o,f){if(t==null||typeof t=="boolean")return N(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return N(e,o,n);if(L(t)){let i=x("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(i,o[0]),N(e,o.slice(1),n)):y(e,i,n):o?e.replaceChild(i,o):y(e,i,n),t.then(r=>{i.parentNode===e&&P(e,r,i.nextSibling,i)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),i}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=x(t);return y(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=N(e,o,n)}if(o&&F(o))return o.data=t,o;let i=x(t);return o&&o.parentNode===e?e.replaceChild(i,o):_(e,i)||y(e,i,n),i}if(C(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]),N(e,o.slice(1),n)):y(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):y(e,t,n)):y(e,t,n),t);if(Array.isArray(t)){let i=[],r=Array.isArray(o)?o:o?[o]:[],s=[];m(t,i,e,n,!0,f,s);let l=oe(e,r,i,n);for(let u of s){let c=j(e,u.sig,u.marker);S(()=>{N(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let r=i;if(typeof r.type=="function"){let s=r.type(r.props||{});return P(e,s,n,o)}}}return N(e,o,n)}function m(e,t,n,o,f=!0,a,i){for(let r=0;r<e.length;r++){let s=e[r];if(!(s==null||typeof s=="boolean")){for(;typeof s=="function"&&!L(s)&&!g(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)&&!g(s)?(a||(a=new Map),a.has(s)||a.set(s,s()),l=a.get(s)):l=s();typeof l=="function"&&!L(l)&&!g(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(g(l)){if(i){let c=x("",!0);t.push(c),i.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&g(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?m(u,t,n,o,f,a):m([u],t,n,o,f,a);continue}continue}Array.isArray(l)?m(l,t,n,o,f,a,i):m([l],t,n,o,f,a,i);continue}if(L(s)){let l=x("",!0);t.push(l),s.then(u=>{if(l.parentNode){let c=[];if(m([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)){m(s,t,n,o,f,a,i);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)?m(u,t,n,o,!1,a):m([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(x(l));continue}t.push(x(String(s)))}}}}function oe(e,t,n,o){for(let c=0;c<n.length;c++)n[c].parentNode!==null&&n[c].parentNode!==e&&(n=n.slice(),n[c]=n[c].cloneNode(!0));let f=n.length,a=t.length,i=f,r=0,s=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||s<i;){if(t[r]===n[s]){r++,s++;continue}for(;a>r&&i>s&&t[a-1]===n[i-1];)a--,i--;if(a===r){let c=i<f?s?n[s-1].nextSibling??void 0:n[i-s]:l;for(;s<i;)y(e,n[s++],c)}else if(i===s)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[i-1]&&n[s]===t[a-1]){let c=t[--a].nextSibling;y(e,n[s++],t[r++].nextSibling),y(e,n[--i],c),t[a]=t[r-1]}else{if(!u){u=new Map;let d=s;for(;d<i;)u.set(n[d],d++)}let c=u.get(t[r]);if(c!=null)if(s<c&&c<i){let d=r,M=1;for(;++d<a&&d<i&&!(!u.has(t[d])||u.get(t[d])!==c+M);)M++;if(M>c-s){let J=t[r];for(;s<c;)y(e,n[s++],J)}else t[r].parentNode===e?e.replaceChild(n[s++],t[r++]):(y(e,n[s++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function N(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function y(e,t,n){b.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function k(e,t,n){n==null?delete e[t]:e[t]=n}function 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 re(e,t){let n=(o,f)=>{typeof o=="function"&&o(e,f??(()=>{}))};if(typeof t=="function"){n(t);return}if(Array.isArray(t)){if(typeof t[0]=="function"){n(t[0],t[1]);return}for(let o of t)Array.isArray(o)?n(o[0],o[1]):n(o)}}function se(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):p(()=>{let f=typeof n=="function"?n():n;T(e,t,f,o)})}function fe(e,t,n){return typeof n!="function"?(k(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;k(e,t,o)})}function ae(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):p(()=>{let o=n();T(e,t,!!o)})}function B(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>B(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let f=t[o];return typeof f=="function"?f():!!f}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function V(e,t,n){if(!(!t||typeof t!="object"))for(let o in t){let f=t[o],a=o.split(/\s+/).filter(Boolean);if(typeof f=="function"&&n)n.push(p(()=>{let i=!!f();for(let r of a)e.classList.toggle(r,i)}));else{let i=!!(typeof f=="function"?f():f);for(let r of a)e.classList.toggle(r,i)}}}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 q(e,t,n=!1){for(let o in t){let f=t[o];if(o==="ref"){le(f,e);continue}if(o!=="children"){if(o==="use"){re(e,f);continue}if(o.startsWith("on:")){ie(e,o.slice(3),f);continue}if(o.startsWith("prop:")){fe(e,o.slice(5),f);continue}if(o.startsWith("attr:")){se(e,o.slice(5),f,n);continue}if(o.startsWith("bool:")){ae(e,o.slice(5),f);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof f=="function")if(G.has(a)){e[`$$${a}`]=f;let i=`__fx_${a}`;if(!e[i]){let r=s=>{e[`$$${a}`]?.(s)};e.addEventListener(a,r),e[i]=r}}else e[`$$${a}`]=f,H.has(a)||Q([a]);continue}if(o==="class"||o==="className"){B(e,f);continue}if(o==="classList"){typeof f=="function"?p(()=>V(e,f())):V(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=v(()=>{let i=f();for(;typeof i=="function";)i=i();e.innerHTML=i});S(()=>a())}else e.innerHTML=f;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof f=="function"){let a=v(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof f=="function"){let a=v(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});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,i=v(()=>{let r=f();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});S(()=>{i()})}else{let a=!0;p(()=>{let i=t[o];a?(a=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof f=="function"){let a=v(()=>{let i=f();for(;typeof i=="function"&&i.length===0;)i=i();O(e,o,i,n)});S(()=>{a()})}else p(()=>O(e,o,t[o],n))}}}function le(e,t){if(e){if(C(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function z(e){return e==="svg"||e==="path"||e==="circle"||e==="rect"||e==="line"||e==="polygon"||e==="polyline"||e==="ellipse"||e==="g"||e==="defs"||e==="clipPath"||e==="text"}function L(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}var ue="__fx_dom_create_component__",U=globalThis[ue]??={fn:null};function X(e,t){return U.fn?U.fn(e,t):(()=>e(t))}import{readChildren as ce}from"@fluixi/reactive/signal";function De(e,t={}){if(typeof e=="function")return X(e,t);if(typeof e!="string"||e.length===0)return null;let n=z(e);if(w)return A().createElement(e,n);let o=n?document.createElementNS(R,e):document.createElement(e);return q(o,t,n),de(o,t),o}function de(e,t){if(!t||t.children===void 0)return;let n=ce(()=>t.children),o=f=>{j(e,f,typeof f=="function"?null:void 0)};Array.isArray(n)?n.forEach(o):o(n)}export{De as createDynamicElement};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var r=Object.defineProperty;var
|
|
1
|
+
"use strict";var r=Object.defineProperty;var s=Object.getOwnPropertyDescriptor;var o=Object.getOwnPropertyNames;var u=Object.prototype.hasOwnProperty;var c=(t,e,a,i)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of o(e))!u.call(t,n)&&n!==a&&r(t,n,{get:()=>e[n],enumerable:!(i=s(e,n))||i.enumerable});return t};var l=t=>c(r({},"__esModule",{value:!0}),t);var g={};module.exports=l(g);
|
|
@@ -232,7 +232,7 @@ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
|
232
232
|
exportparts?: string;
|
|
233
233
|
exportParts?: string;
|
|
234
234
|
hidden?: Reactive<boolean>;
|
|
235
|
-
id?:
|
|
235
|
+
id?: Reactive<string>;
|
|
236
236
|
inert?: boolean;
|
|
237
237
|
inputmode?: HTMLInputMode;
|
|
238
238
|
inputMode?: HTMLInputMode;
|
|
@@ -247,7 +247,7 @@ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
|
247
247
|
style?: Reactive<string | CSSProperties>;
|
|
248
248
|
tabIndex?: Reactive<number>;
|
|
249
249
|
tabindex?: Reactive<number>;
|
|
250
|
-
title?:
|
|
250
|
+
title?: Reactive<string>;
|
|
251
251
|
translate?: 'yes' | 'no';
|
|
252
252
|
itemid?: string;
|
|
253
253
|
itemId?: string;
|
|
@@ -288,7 +288,7 @@ export interface HTMLAttributes<T = HTMLElement> extends DOMAttributes<T> {
|
|
|
288
288
|
}
|
|
289
289
|
export interface AnchorHTMLAttributes<T = HTMLAnchorElement> extends HTMLAttributes<T> {
|
|
290
290
|
download?: any;
|
|
291
|
-
href?:
|
|
291
|
+
href?: Reactive<string>;
|
|
292
292
|
hrefLang?: string;
|
|
293
293
|
hreflang?: string;
|
|
294
294
|
media?: string;
|
|
@@ -326,7 +326,7 @@ export interface ButtonHTMLAttributes<T = HTMLButtonElement> extends HTMLAttribu
|
|
|
326
326
|
command?: string;
|
|
327
327
|
commandfor?: string;
|
|
328
328
|
commandFor?: string;
|
|
329
|
-
disabled?:
|
|
329
|
+
disabled?: Reactive<boolean>;
|
|
330
330
|
form?: string;
|
|
331
331
|
formAction?: string;
|
|
332
332
|
formaction?: string;
|
|
@@ -437,7 +437,7 @@ export interface ImgHTMLAttributes<T = HTMLImageElement> extends HTMLAttributes<
|
|
|
437
437
|
referrerPolicy?: HTMLReferrerPolicy;
|
|
438
438
|
referrerpolicy?: HTMLReferrerPolicy;
|
|
439
439
|
sizes?: string;
|
|
440
|
-
src?:
|
|
440
|
+
src?: Reactive<string>;
|
|
441
441
|
srcSet?: string;
|
|
442
442
|
srcset?: string;
|
|
443
443
|
useMap?: string;
|
|
@@ -452,12 +452,12 @@ export interface InputHTMLAttributes<T = HTMLInputElement> extends HTMLAttribute
|
|
|
452
452
|
autoFocus?: boolean;
|
|
453
453
|
autofocus?: boolean;
|
|
454
454
|
capture?: boolean | 'user' | 'environment';
|
|
455
|
-
checked?:
|
|
455
|
+
checked?: Reactive<boolean>;
|
|
456
456
|
crossOrigin?: HTMLCrossOrigin;
|
|
457
457
|
crossorigin?: HTMLCrossOrigin;
|
|
458
458
|
dirName?: string;
|
|
459
459
|
dirname?: string;
|
|
460
|
-
disabled?:
|
|
460
|
+
disabled?: Reactive<boolean>;
|
|
461
461
|
form?: string;
|
|
462
462
|
formAction?: string;
|
|
463
463
|
formaction?: string;
|
|
@@ -481,7 +481,7 @@ export interface InputHTMLAttributes<T = HTMLInputElement> extends HTMLAttribute
|
|
|
481
481
|
multiple?: Reactive<boolean>;
|
|
482
482
|
name?: string;
|
|
483
483
|
pattern?: Reactive<string>;
|
|
484
|
-
placeholder?:
|
|
484
|
+
placeholder?: Reactive<string>;
|
|
485
485
|
popoverTarget?: string;
|
|
486
486
|
popovertarget?: string;
|
|
487
487
|
popoverTargetAction?: 'hide' | 'show' | 'toggle';
|
|
@@ -493,7 +493,7 @@ export interface InputHTMLAttributes<T = HTMLInputElement> extends HTMLAttribute
|
|
|
493
493
|
size?: Reactive<number>;
|
|
494
494
|
src?: string;
|
|
495
495
|
step?: Reactive<number | string>;
|
|
496
|
-
indeterminate?:
|
|
496
|
+
indeterminate?: Reactive<boolean>;
|
|
497
497
|
type?: 'button' | 'checkbox' | 'color' | 'date' | 'datetime-local' | 'email' | 'file' | 'hidden' | 'image' | 'month' | 'number' | 'password' | 'radio' | 'range' | 'reset' | 'search' | 'submit' | 'tel' | 'text' | 'time' | 'url' | 'week' | (string & {});
|
|
498
498
|
useMap?: string;
|
|
499
499
|
usemap?: string;
|
|
@@ -649,7 +649,7 @@ export interface SelectHTMLAttributes<T = HTMLSelectElement> extends HTMLAttribu
|
|
|
649
649
|
autocomplete?: string;
|
|
650
650
|
autoFocus?: boolean;
|
|
651
651
|
autofocus?: boolean;
|
|
652
|
-
disabled?:
|
|
652
|
+
disabled?: Reactive<boolean>;
|
|
653
653
|
form?: string;
|
|
654
654
|
multiple?: Reactive<boolean>;
|
|
655
655
|
name?: string;
|
|
@@ -711,14 +711,14 @@ export interface TextareaHTMLAttributes<T = HTMLTextAreaElement> extends HTMLAtt
|
|
|
711
711
|
cols?: number;
|
|
712
712
|
dirName?: string;
|
|
713
713
|
dirname?: string;
|
|
714
|
-
disabled?:
|
|
714
|
+
disabled?: Reactive<boolean>;
|
|
715
715
|
form?: string;
|
|
716
716
|
maxLength?: Reactive<number>;
|
|
717
717
|
maxlength?: Reactive<number>;
|
|
718
718
|
minLength?: Reactive<number>;
|
|
719
719
|
minlength?: Reactive<number>;
|
|
720
720
|
name?: string;
|
|
721
|
-
placeholder?:
|
|
721
|
+
placeholder?: Reactive<string>;
|
|
722
722
|
readOnly?: Reactive<boolean>;
|
|
723
723
|
readonly?: Reactive<boolean>;
|
|
724
724
|
required?: Reactive<boolean>;
|
|
@@ -765,10 +765,10 @@ export interface VideoHTMLAttributes<T = HTMLVideoElement> extends MediaHTMLAttr
|
|
|
765
765
|
export interface AudioHTMLAttributes<T = HTMLAudioElement> extends MediaHTMLAttributes<T> {
|
|
766
766
|
}
|
|
767
767
|
export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
768
|
-
id?: string
|
|
769
|
-
class?:
|
|
770
|
-
className?: string
|
|
771
|
-
style?:
|
|
768
|
+
id?: Reactive<string>;
|
|
769
|
+
class?: Reactive<string>;
|
|
770
|
+
className?: Reactive<string>;
|
|
771
|
+
style?: Reactive<string | CSSProperties>;
|
|
772
772
|
ref?: RefCallback<T> | {
|
|
773
773
|
current: T | null;
|
|
774
774
|
} | {
|
|
@@ -778,8 +778,8 @@ export interface SVGAttributes<T = SVGElement> extends DOMAttributes<T> {
|
|
|
778
778
|
children?: ComponentChild;
|
|
779
779
|
tabIndex?: Reactive<number>;
|
|
780
780
|
tabindex?: Reactive<number>;
|
|
781
|
-
lang?: string
|
|
782
|
-
xml_lang?: string
|
|
781
|
+
lang?: Reactive<string>;
|
|
782
|
+
xml_lang?: Reactive<string>;
|
|
783
783
|
color?: Reactive<string>;
|
|
784
784
|
fill?: Reactive<string>;
|
|
785
785
|
fillOpacity?: Reactive<number | string>;
|