@fluixi/dom 1.0.0-alpha.70 → 1.0.0-alpha.72
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.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.mjs +1 -1
- package/dist/lib/dom/dynamic-element.cjs +1 -1
- package/dist/lib/dom/dynamic-element.mjs +1 -1
- package/dist/lib/dom/hydration.cjs +1 -1
- package/dist/lib/dom/hydration.mjs +1 -1
- package/dist/lib/dom/index.cjs +1 -1
- package/dist/lib/dom/index.mjs +1 -1
- package/dist/lib/dom/island.cjs +1 -1
- package/dist/lib/dom/island.mjs +1 -1
- package/dist/lib/dom/runtime.cjs +1 -1
- package/dist/lib/dom/runtime.d.ts.map +1 -1
- package/dist/lib/dom/runtime.js +5 -0
- package/dist/lib/dom/runtime.mjs +1 -1
- package/dist/lib/dom/versions.cjs +1 -0
- package/dist/lib/dom/versions.d.ts +33 -0
- package/dist/lib/dom/versions.d.ts.map +1 -0
- package/dist/lib/dom/versions.js +57 -0
- package/dist/lib/dom/versions.mjs +1 -0
- package/dist/lib/flow/portal.cjs +1 -1
- package/dist/lib/flow/portal.mjs +1 -1
- package/dist/lib/index.cjs +1 -1
- package/dist/lib/index.mjs +1 -1
- package/dist/tsconfig.lib.tsbuildinfo +1 -1
- package/dist/version.generated.cjs +1 -1
- package/dist/version.generated.d.ts +1 -1
- package/dist/version.generated.js +1 -1
- package/dist/version.generated.mjs +1 -1
- package/package.json +3 -3
package/dist/lib/dom/runtime.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{isSignal as h}from"@fluixi/reactive/signal";var F="http://www.w3.org/2000/svg";function se(e){return e.localName.includes("-")}function W(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(se(e)){e[t]=n;return}N(e,t,n,o)}var I=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function N(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Ne=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function x(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Z,createEffect as v,createRenderEffect as y,createRoot as ae,onCleanup as w,readChildren as le}from"@fluixi/reactive/signal";var S=typeof document>"u";var k=Symbol.for("fluixi.server-node"),G=null;function C(){if(!G)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return G}function A(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function X(e){return e!=null&&e[k]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function z(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},fe=null;function L(){return fe}function K(e,t){return d.active&&t.parentNode===e}function J(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function V(e,t){if(!e||e.parentNode==null)return t();let n=d.active,o=d.cursor,s=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=o,d.parents=s}}function ue(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function ce(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 He(e){return ce(ue(e))}var je=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),de={};var U=new Map,M=new Set,_=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function Q(e){if(!S)for(let t of e)M.has(t)||_.has(t)||(M.add(t),document.addEventListener(t,ye))}function ye(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 pe(e,t,n){if(e[`$$${t}`]=n,_.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}M.has(t)||Q([t])}function Y(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function $e(e){return!_.has(e)}function _e(e){return typeof e=="function"}function b(e,t=!1){if(S)return C().createText(e);if(d.active&&!t){let n=L()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function De(e,t=!1){if(S)return C().createElement(e,t);if(d.active){let n=L()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(F,e):document.createElement(e)}function ge(e,t=!1){let n=U.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,U.set(e,o),o}function Fe(e,t,n=!1,o=!1){if(S){let s=C();return n?s.parseTemplate(e,o):s.createRaw(e)}if(d.active){let s=L()?.hydrateStatic(t);if(s)return s}return he(ge(e,o),o).firstChild}function We(e,t){if(!d.active)return t();let n=V(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>d.active?V(e.nextSibling,()=>o(...s)):o(...s))}return n}function Ie(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function ke(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function he(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function xe(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?xe(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ke(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Ve(e){if(h(e)||x(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!h(t)&&!x(t);)t=t();return t}var E=0,me=200;function Ee(e,t,n,o,s){let a=o,f=new Map;return y(()=>{let r;if(x(e)&&!h(e)){if(!f.has(e)){E++;try{let i=e();f.set(e,i)}finally{E--}}for(r=f.get(e);typeof r=="function"&&h(r);)r=r()}else for(r=e();typeof r=="function"&&h(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(x(r)){if(!f.has(r)){let l=r;E++;try{let u=l();f.set(l,u)}finally{E--}}r=f.get(r)}else if(h(r))r=r();else if(r=r(),typeof r!="function"||!h(r)&&!x(r))break}E++;try{a=R(t,r,n,a,f),s(a)}finally{E--}})}function ee(e,t,n,o){if(E>me)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=b("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){E++;try{s=R(e,t,n,null)}finally{E--}return()=>s}let r=Ee(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function R(e,t,n,o,s){if(t==null||typeof t=="boolean")return T(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return T(e,o,n);if(P(t)){let f=b("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),T(e,o.slice(1),n)):g(e,f,n):o?e.replaceChild(f,o):g(e,f,n),t.then(r=>{f.parentNode===e&&R(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=b(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=T(e,o,n)}if(o&&z(o))return o.data=t,o;let f=b(t);return o&&o.parentNode===e?e.replaceChild(f,o):K(e,f)||g(e,f,n),f}if(A(t))return K(e,t)?(J(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),T(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];m(t,f,e,n,!0,s,i);let l=be(e,r,f,n);for(let u of i){let c=ee(e,u.sig,u.marker);w(()=>{T(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;if("type"in f&&"props"in f){let r=f;if(typeof r.type=="function"){let i=r.type(r.props||{});return R(e,i,n,o)}}}return T(e,o,n)}function m(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!P(i)&&!h(i)&&!x(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(x(i)&&!h(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!P(l)&&!h(l)&&!x(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(h(l)){if(f){let c=b("",!0);t.push(c),f.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&h(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,f):m([l],t,n,o,s,a,f);continue}if(P(i)){let l=b("",!0);t.push(l),i.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 p=1;p<c.length;p++)l.parentNode?.insertBefore(c[p],c[p-1].nextSibling)}}}).catch(u=>console.error("Error resolving promise in array:",u));continue}if(Array.isArray(i)){m(i,t,n,o,s,a,f);continue}if(A(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let 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 i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(b(l));continue}t.push(b(String(i)))}}}}function be(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,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let c=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)g(e,n[i++],c)}else if(f===i)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--f],c),t[a]=t[r-1]}else{if(!u){u=new Map;let p=i;for(;p<f;)u.set(n[p],p++)}let c=u.get(t[r]);if(c!=null)if(i<c&&c<f){let p=r,D=1;for(;++p<a&&p<f&&!(!u.has(t[p])||u.get(t[p])!==c+D);)D++;if(D>c-i){let re=t[r];for(;i<c;)g(e,n[i++],re)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function T(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function O(e,t,n){n==null?delete e[t]:e[t]=n}function te(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 ne(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 B(e,t,n,o=!1){return typeof n!="function"?(N(e,t,n,o),()=>{}):y(()=>{let s=typeof n=="function"?n():n;N(e,t,s,o)})}function q(e,t,n){return typeof n!="function"?(O(e,t,n),()=>{}):y(()=>{let o=typeof n=="function"?n():n;O(e,t,o)})}function oe(e,t,n){return typeof n!="function"?(N(e,t,!!n),()=>{}):y(()=>{let o=n();N(e,t,!!o)})}function H(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){y(()=>H(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 j(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(y(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function $(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 Be(e){let{element:t,props:n,prevProps:o=de,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!X(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===F,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],u=o[i];if(l===u)continue;if(i==="ref"){ie(l,t);continue}if(i==="use"){ne(t,l);continue}if(i.startsWith("on:")){r.push(te(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(q(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(B(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(oe(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push(y(()=>H(t,l()))):H(t,l);continue}if(i==="classList"){typeof l=="function"?r.push(y(()=>j(t,l()))):j(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push(y(()=>$(t,l()))):$(t,l);continue}if(i.startsWith("on")){let p=i.slice(2).toLowerCase();u&&Y(t,p),l&&pe(t,p,l);continue}let c=I.has(i)||!f&&i in t;typeof l=="function"?r.push(c?q(t,i,l):B(t,i,l,f)):r.push(y(()=>c?O(t,i,n[i]):N(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();Y(t,l)}else I.has(i)?O(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function qe(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){ie(s,e);continue}if(o!=="children"){if(o==="use"){ne(e,s);continue}if(o.startsWith("on:")){te(e,o.slice(3),s);continue}if(o.startsWith("prop:")){q(e,o.slice(5),s);continue}if(o.startsWith("attr:")){B(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){oe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(_.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,M.has(a)||Q([a]);continue}if(o==="class"||o==="className"){H(e,s);continue}if(o==="classList"){typeof s=="function"?y(()=>j(e,s())):j(e,s);continue}if(o==="style"){typeof s=="function"?y(()=>$(e,s())):$(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=v(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});w(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=v(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});w(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=v(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});w(()=>{a()})}else y(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=v(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});w(()=>{f()})}else{let a=!0;y(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=v(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();W(e,o,f,n)});w(()=>{a()})}else y(()=>W(e,o,t[o],n))}}}function Ge(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function Xe(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);return new Proxy({},{get:(i,l)=>r.has(l)?e[l]:void 0,has:(i,l)=>r.has(l)&&l in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,l)=>r.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function ie(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function ze(e,t,n){let o=t||document.body,s=le(()=>e),a=[];return Z(()=>{let f=y(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):A(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),w(()=>{a.forEach(r=>r())})}),null}function Je(e){return typeof e=="string"&&e.toLowerCase()===e}function Ue(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 Ye(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function P(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Ze(e){return typeof e=="function"&&e.length===0&&h(e)}function Qe(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return ae(f=>{Z(()=>{d.active||(t.textContent=""),ee(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}export{pe as addDelegatedEventListener,te as addNativeEventListener,qe as applyProps,ne as applyUse,T as cleanChildren,he as cloneTemplate,De as createNativeElement,ze as createPortal,ge as createTemplate,Q as delegateEvents,Ye as escapeHTML,Ke as fnName,je as generateID,He as getStableElementId,ie as handleRef,ke as holeContent,Ie as holeEnd,We as holeScope,ee as insert,R as insertExpression,Ze as isAccessor,$e as isDelegatedEvent,_e as isFunction,Je as isNativeElement,P as isPromise,Ue as isSVGElement,Ve as iterateFn,xe as makeArrayFlat,Ge as mergeProps,Y as removeDelegatedEventListener,Qe as render,j as setClassList,H as setClassName,B as setDynamicAttribute,oe as setDynamicBoolAttribute,q as setDynamicProperty,O as setProperty,$ as setStyle,Xe as splitProps,Be as spread,Fe as templateNode};
|
|
1
|
+
import{isSignal as m}from"@fluixi/reactive/signal";var k="http://www.w3.org/2000/svg";function ue(e){return e.localName.includes("-")}function I(e,t,n,o=!1){if(n==null){e.removeAttribute(t);return}if(ue(e)){e[t]=n;return}T(e,t,n,o)}var V=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function T(e,t,n,o=!1){if(n==null||n===!1){e.removeAttribute(t);return}if(n===!0){e.setAttribute(t,"");return}if(typeof n=="object"){e.setAttribute(t,JSON.stringify(n));return}e.setAttribute(t,String(n))}var Ae=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;var z="1.0.0-alpha.72";import{VERSION as ce}from"@fluixi/reactive";var x={dom:z,reactive:ce};function X(e){x.core&&e.setAttribute("fluixi",x.core),e.setAttribute("fx-dom",x.dom),e.setAttribute("fx-reactive",x.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=x)}function J(){let e=[x.core,x.dom,x.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${x.core??"(absent)"}, dom ${x.dom}, reactive ${x.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function h(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as ne,createEffect as C,createRenderEffect as p,createRoot as pe,onCleanup as S,readChildren as ye}from"@fluixi/reactive/signal";var v=typeof document>"u";var W=Symbol.for("fluixi.server-node"),U=null;function L(){if(!U)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return U}function A(e){return e!=null&&e[W]===!0?!0:typeof Node<"u"&&e instanceof Node}function Y(e){return e!=null&&e[W]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function Z(e){return e!=null&&e[W]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var d={active:!1,cursor:null,parents:[]},de=null;function P(){return de}function K(e,t){return d.active&&t.parentNode===e}function Q(e){let t=d.parents.lastIndexOf(e);t!==-1&&(d.parents.length=t),d.cursor=e.nextSibling}function B(e,t){if(!e||e.parentNode==null)return t();let n=d.active,o=d.cursor,s=d.parents;d.active=!0,d.cursor=e,d.parents=[];try{return t()}finally{d.active=n,d.cursor=o,d.parents=s}}function ge(e){let t=[];for(;e&&e.nodeType===1;){let n=e.tagName.toLowerCase();if(e.id){n+=`#${e.id}`,t.unshift(n);break}e.getAttribute("data-id")&&(n+=`[data-id="${e.getAttribute("data-id")}"]`);let o=0,s=e;for(;s=s.previousElementSibling;)s.tagName===e.tagName&&o++;n+=`:nth-of-type(${o+1})`,t.unshift(n),e=e.parentElement}return t.join(">")}function me(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 Ke(e){return me(ge(e))}var Be=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),xe={};var ee=new Map,R=new Set,D=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function oe(e){if(!v)for(let t of e)R.has(t)||D.has(t)||(R.add(t),document.addEventListener(t,he))}function he(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 Ee(e,t,n){if(e[`$$${t}`]=n,D.has(t)){let o=`__fx_${t}`;if(!e[o]){let s=a=>{e[`$$${t}`]?.(a)};e.addEventListener(t,s),e[o]=s}return}R.has(t)||oe([t])}function te(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,o=e[n];o&&(e.removeEventListener(t,o),delete e[n])}function qe(e){return!D.has(e)}function Ge(e){return typeof e=="function"}function N(e,t=!1){if(v)return L().createText(e);if(d.active&&!t){let n=P()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function ze(e,t=!1){if(v)return L().createElement(e,t);if(d.active){let n=P()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(k,e):document.createElement(e)}function be(e,t=!1){let n=ee.get(e);if(n)return n;let o=document.createElement("template");return t?o.innerHTML=`<svg>${e}</svg>`:o.innerHTML=e,ee.set(e,o),o}function Xe(e,t,n=!1,o=!1){if(v){let s=L();return n?s.parseTemplate(e,o):s.createRaw(e)}if(d.active){let s=P()?.hydrateStatic(t);if(s)return s}return Ne(be(e,o),o).firstChild}function Je(e,t){if(!d.active)return t();let n=B(e.nextSibling,t);if(typeof n=="function"){let o=n;return((...s)=>d.active?B(e.nextSibling,()=>o(...s)):o(...s))}return n}function Ue(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function Ye(e,t){let n=[];for(let o=e.nextSibling;o&&o!==t;o=o.nextSibling)n.push(o);return n}function Ne(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Te(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Te(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Ze(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Qe(e){if(m(e)||h(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!m(t)&&!h(t);)t=t();return t}var b=0,we=200;function Se(e,t,n,o,s){let a=o,f=new Map;return p(()=>{let r;if(h(e)&&!m(e)){if(!f.has(e)){b++;try{let i=e();f.set(e,i)}finally{b--}}for(r=f.get(e);typeof r=="function"&&m(r);)r=r()}else for(r=e();typeof r=="function"&&m(r);)r=r();{let i=0;for(;typeof r=="function"&&i++<50;)if(h(r)){if(!f.has(r)){let l=r;b++;try{let u=l();f.set(l,u)}finally{b--}}r=f.get(r)}else if(m(r))r=r();else if(r=r(),typeof r!="function"||!m(r)&&!h(r))break}b++;try{a=O(t,r,n,a,f),s(a)}finally{b--}})}function ie(e,t,n,o){if(b>we)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=N("",!0),e.appendChild(n));let s=o??null,a=i=>Array.isArray(i)&&i.some(l=>typeof l=="function"),f=i=>typeof i=="function"?i:()=>i;if(typeof t!="function"&&!a(t)){b++;try{s=O(e,t,n,null)}finally{b--}return()=>s}let r=Se(f(t),e,n,s,i=>{s=i});return()=>(r?.(),s)}function O(e,t,n,o,s){if(t==null||typeof t=="boolean")return w(e,o,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return w(e,o,n);if(M(t)){let f=N("",!0);return Array.isArray(o)?o.length>0?(e.replaceChild(f,o[0]),w(e,o.slice(1),n)):g(e,f,n):o?e.replaceChild(f,o):g(e,f,n),t.then(r=>{f.parentNode===e&&O(e,r,f.nextSibling,f)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),f}let a=typeof t;if(a==="string"||a==="number"){if(a==="number"&&(t=String(t)),Array.isArray(o)){if(o.length===0){let r=N(t);return g(e,r,n),r}if(o.length===1&&o[0].nodeType===3)return o[0].data=t,o;o=w(e,o,n)}if(o&&Z(o))return o.data=t,o;let f=N(t);return o&&o.parentNode===e?e.replaceChild(f,o):K(e,f)||g(e,f,n),f}if(A(t))return K(e,t)?(Q(t),t):Array.isArray(o)?(o.length===0?g(e,t,n):o[0].parentNode===e?(e.replaceChild(t,o[0]),w(e,o.slice(1),n)):g(e,t,n),t):(o?o!==t&&(o.parentNode===e?e.replaceChild(t,o):g(e,t,n)):g(e,t,n),t);if(Array.isArray(t)){let f=[],r=Array.isArray(o)?o:o?[o]:[],i=[];E(t,f,e,n,!0,s,i);let l=ve(e,r,f,n);for(let u of i){let c=ie(e,u.sig,u.marker);S(()=>{w(e,c()),u.marker.parentNode===e&&e.removeChild(u.marker)})}return l}if(a==="object"&&t!==null&&typeof t=="object"){let f=t;if("type"in f&&"props"in f){let r=f;if(typeof r.type=="function"){let i=r.type(r.props||{});return O(e,i,n,o)}}}return w(e,o,n)}function E(e,t,n,o,s=!0,a,f){for(let r=0;r<e.length;r++){let i=e[r];if(!(i==null||typeof i=="boolean")){for(;typeof i=="function"&&!M(i)&&!m(i)&&!h(i)&&(i=i(),!(i==null||typeof i=="boolean")););if(!(i==null||typeof i=="boolean")){if(typeof i=="function"){let l;for(h(i)&&!m(i)?(a||(a=new Map),a.has(i)||a.set(i,i()),l=a.get(i)):l=i();typeof l=="function"&&!M(l)&&!m(l)&&!h(l);)a||(a=new Map),a.has(l)||a.set(l,l()),l=a.get(l);if(l==null||typeof l=="boolean")continue;if(typeof l=="function"){if(m(l)){if(f){let c=N("",!0);t.push(c),f.push({marker:c,sig:l});continue}let u=l();for(;typeof u=="function"&&m(u);)u=u();if(u==null||typeof u=="boolean")continue;Array.isArray(u)?E(u,t,n,o,s,a):E([u],t,n,o,s,a);continue}continue}Array.isArray(l)?E(l,t,n,o,s,a,f):E([l],t,n,o,s,a,f);continue}if(M(i)){let l=N("",!0);t.push(l),i.then(u=>{if(l.parentNode){let c=[];if(E([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(i)){E(i,t,n,o,s,a,f);continue}if(A(i)){t.push(i);continue}if(typeof i=="object"&&i!==null&&"type"in i&&"props"in i){let l=i;if(typeof l.type=="function"){let u=l.type(l.props||{});Array.isArray(u)?E(u,t,n,o,!1,a):E([u],t,n,o,!1,a);continue}}if(typeof i=="string"||typeof i=="number"){let l=String(i);if(l.trim()===""&&l!==" ")continue;t.push(N(l));continue}t.push(N(String(i)))}}}}function ve(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,f=s,r=0,i=0,l=a>0?t[a-1].nextSibling??void 0:o,u=null;for(;r<a||i<f;){if(t[r]===n[i]){r++,i++;continue}for(;a>r&&f>i&&t[a-1]===n[f-1];)a--,f--;if(a===r){let c=f<s?i?n[i-1].nextSibling??void 0:n[f-i]:l;for(;i<f;)g(e,n[i++],c)}else if(f===i)for(;r<a;)(!u||!u.has(t[r]))&&t[r].parentNode===e&&e.removeChild(t[r]),r++;else if(t[r]===n[f-1]&&n[i]===t[a-1]){let c=t[--a].nextSibling;g(e,n[i++],t[r++].nextSibling),g(e,n[--f],c),t[a]=t[r-1]}else{if(!u){u=new Map;let y=i;for(;y<f;)u.set(n[y],y++)}let c=u.get(t[r]);if(c!=null)if(i<c&&c<f){let y=r,_=1;for(;++y<a&&y<f&&!(!u.has(t[y])||u.get(t[y])!==c+_);)_++;if(_>c-i){let le=t[r];for(;i<c;)g(e,n[i++],le)}else t[r].parentNode===e?e.replaceChild(n[i++],t[r++]):(g(e,n[i++],l),r++)}else r++;else t[r].parentNode===e&&e.removeChild(t[r]),r++}}return n}function w(e,t,n){if(t)if(Array.isArray(t))for(let o=0;o<t.length;o++)t[o].parentNode===e&&e.removeChild(t[o]);else t.parentNode===e&&e.removeChild(t);return null}function g(e,t,n){d.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function H(e,t,n){n==null?delete e[t]:e[t]=n}function re(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 se(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 q(e,t,n,o=!1){return typeof n!="function"?(T(e,t,n,o),()=>{}):p(()=>{let s=typeof n=="function"?n():n;T(e,t,s,o)})}function G(e,t,n){return typeof n!="function"?(H(e,t,n),()=>{}):p(()=>{let o=typeof n=="function"?n():n;H(e,t,o)})}function fe(e,t,n){return typeof n!="function"?(T(e,t,!!n),()=>{}):p(()=>{let o=n();T(e,t,!!o)})}function $(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){p(()=>$(e,t()));return}if(typeof t=="string"){e.setAttribute("class",t);return}if(Array.isArray(t)){e.setAttribute("class",t.filter(Boolean).join(" "));return}if(typeof t=="object"){let n=Object.keys(t).filter(o=>{let s=t[o];return typeof s=="function"?s():!!s}).join(" ");e.setAttribute("class",n);return}e.setAttribute("class",String(t))}function j(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(p(()=>{let f=!!s();for(let r of a)e.classList.toggle(r,f)}));else{let f=!!(typeof s=="function"?s():s);for(let r of a)e.classList.toggle(r,f)}}}function F(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 et(e){let{element:t,props:n,prevProps:o=xe,isSVG:s=!1,skipChildren:a=!1}=e;if(!t||!Y(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let f=s||t.namespaceURI===k,r=[];for(let i in n){if(a&&i==="children")continue;let l=n[i],u=o[i];if(l===u)continue;if(i==="ref"){ae(l,t);continue}if(i==="use"){se(t,l);continue}if(i.startsWith("on:")){r.push(re(t,i.slice(3),l));continue}if(i.startsWith("prop:")){r.push(G(t,i.slice(5),l));continue}if(i.startsWith("attr:")){r.push(q(t,i.slice(5),l,f));continue}if(i.startsWith("bool:")){r.push(fe(t,i.slice(5),l));continue}if(i==="class"||i==="className"){typeof l=="function"?r.push(p(()=>$(t,l()))):$(t,l);continue}if(i==="classList"){typeof l=="function"?r.push(p(()=>j(t,l()))):j(t,l,r);continue}if(i==="style"){typeof l=="function"?r.push(p(()=>F(t,l()))):F(t,l);continue}if(i.startsWith("on")){let y=i.slice(2).toLowerCase();u&&te(t,y),l&&Ee(t,y,l);continue}let c=V.has(i)||!f&&i in t;typeof l=="function"?r.push(c?G(t,i,l):q(t,i,l,f)):r.push(p(()=>c?H(t,i,n[i]):T(t,i,n[i],f)))}for(let i in o)if(!(i in n))if(i.startsWith("on")){let l=i.slice(2).toLowerCase();te(t,l)}else V.has(i)?H(t,i,null):t.removeAttribute(i);return()=>{r.forEach(i=>i())}}function tt(e,t,n=!1){for(let o in t){let s=t[o];if(o==="ref"){ae(s,e);continue}if(o!=="children"){if(o==="use"){se(e,s);continue}if(o.startsWith("on:")){re(e,o.slice(3),s);continue}if(o.startsWith("prop:")){G(e,o.slice(5),s);continue}if(o.startsWith("attr:")){q(e,o.slice(5),s,n);continue}if(o.startsWith("bool:")){fe(e,o.slice(5),s);continue}if(o.startsWith("on")&&o.length>2){let a=o.slice(2).toLowerCase();if(typeof s=="function")if(D.has(a)){e[`$$${a}`]=s;let f=`__fx_${a}`;if(!e[f]){let r=i=>{e[`$$${a}`]?.(i)};e.addEventListener(a,r),e[f]=r}}else e[`$$${a}`]=s,R.has(a)||oe([a]);continue}if(o==="class"||o==="className"){$(e,s);continue}if(o==="classList"){typeof s=="function"?p(()=>j(e,s())):j(e,s);continue}if(o==="style"){typeof s=="function"?p(()=>F(e,s())):F(e,s);continue}if(o==="innerHTML"){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function";)f=f();e.innerHTML=f});S(()=>a())}else e.innerHTML=s;continue}if(o==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.value=f??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.value=t[o]??"")});continue}if(o==="checked"&&e.tagName==="INPUT"){if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();document.activeElement!==e&&(e.checked=f??"")});S(()=>{a()})}else p(()=>{document.activeElement!==e&&(e.checked=t[o]??"")});continue}if(o==="value"&&e.tagName==="SELECT"){if(typeof s=="function"){let a=!0,f=C(()=>{let r=s();for(;typeof r=="function"&&r.length===0;)r=r();a?(a=!1,queueMicrotask(()=>{e.value=r??""})):e.value=r??""});S(()=>{f()})}else{let a=!0;p(()=>{let f=t[o];a?(a=!1,queueMicrotask(()=>{e.value=f??""})):e.value=f??""})}continue}if(typeof s=="function"){let a=C(()=>{let f=s();for(;typeof f=="function"&&f.length===0;)f=f();I(e,o,f,n)});S(()=>{a()})}else p(()=>I(e,o,t[o],n))}}}function nt(...e){let t=o=>{for(let s=e.length-1;s>=0;s--){let a=e[s];if(a&&o in a&&a[o]!==void 0)return a[o]}},n=o=>{for(let s of e)if(s&&o in s)return!0;return!1};return new Proxy({},{get:(o,s)=>t(s),has:(o,s)=>n(s),ownKeys:()=>{let o=new Set;for(let s of e)if(s)for(let a of Reflect.ownKeys(s))o.add(a);return[...o]},getOwnPropertyDescriptor:(o,s)=>n(s)?{enumerable:!0,configurable:!0,get:()=>t(s)}:void 0})}function ot(e,...t){let n=new Set;for(let f of t)for(let r of f)n.add(r);let o=f=>({enumerable:!0,configurable:!0,get:()=>e[f]}),s=t.map(f=>{let r=new Set(f);return new Proxy({},{get:(i,l)=>r.has(l)?e[l]:void 0,has:(i,l)=>r.has(l)&&l in e,ownKeys:()=>Array.from(r).filter(i=>i in e),getOwnPropertyDescriptor:(i,l)=>r.has(l)&&l in e?o(l):void 0})}),a=new Proxy({},{get:(f,r)=>n.has(r)?void 0:e[r],has:(f,r)=>!n.has(r)&&r in e,ownKeys:()=>Reflect.ownKeys(e).filter(f=>!n.has(f)),getOwnPropertyDescriptor:(f,r)=>!n.has(r)&&r in e?o(r):void 0});return[...s,a]}function ae(e,t){if(e){if(A(e)){let n=t,o=e;if(!n)return;typeof n=="function"?n(o):typeof n=="object"&&"current"in n&&(n.current=o);return}typeof e=="function"?e(t):typeof e=="object"&&"current"in e&&(e.current=t)}}function it(e,t,n){let o=t||document.body,s=ye(()=>e),a=[];return ne(()=>{let f=p(()=>{let r=s();Array.isArray(r)?(r.forEach(i=>o.appendChild(i)),a.push(()=>{r.forEach(i=>{i.parentNode===o&&o.removeChild(i)})})):A(r)&&(o.appendChild(r),a.push(()=>{r.parentNode===o&&o.removeChild(r)}))});a.push(f),S(()=>{a.forEach(r=>r())})}),null}function rt(e){return typeof e=="string"&&e.toLowerCase()===e}function st(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 ft(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function M(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function at(e){return typeof e=="function"&&e.length===0&&m(e)}function lt(e,t,n){if(!t)throw new Error("Container element is required");let o,s,a=[];return pe(f=>{ne(()=>{d.active||(t.textContent=""),X(t),J(),ie(t,e)}),s=f}),()=>{s?.(),o?.(),a.forEach(f=>f()),t.textContent=""}}export{Ee as addDelegatedEventListener,re as addNativeEventListener,tt as applyProps,se as applyUse,w as cleanChildren,Ne as cloneTemplate,ze as createNativeElement,it as createPortal,be as createTemplate,oe as delegateEvents,ft as escapeHTML,Ze as fnName,Be as generateID,Ke as getStableElementId,ae as handleRef,Ye as holeContent,Ue as holeEnd,Je as holeScope,ie as insert,O as insertExpression,at as isAccessor,qe as isDelegatedEvent,Ge as isFunction,rt as isNativeElement,M as isPromise,st as isSVGElement,Qe as iterateFn,Te as makeArrayFlat,nt as mergeProps,te as removeDelegatedEventListener,lt as render,j as setClassList,$ as setClassName,q as setDynamicAttribute,fe as setDynamicBoolAttribute,G as setDynamicProperty,H as setProperty,F as setStyle,ot as splitProps,et as spread,Xe as templateNode};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var t=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var d=Object.getOwnPropertyNames;var f=Object.prototype.hasOwnProperty;var u=(e,o)=>{for(var s in o)t(e,s,{get:o[s],enumerable:!0})},m=(e,o,s,n)=>{if(o&&typeof o=="object"||typeof o=="function")for(let r of d(o))!f.call(e,r)&&r!==s&&t(e,r,{get:()=>o[r],enumerable:!(n=c(o,r))||n.enumerable});return e};var p=e=>m(t({},"__esModule",{value:!0}),e);var V={};u(V,{registerCoreVersion:()=>x,stampVersions:()=>v,versions:()=>i,warnOnVersionSkew:()=>g});module.exports=p(V);var a="1.0.0-alpha.72";var l=require("@fluixi/reactive"),i={dom:a,reactive:l.VERSION};function x(e){i.core=e}function v(e){i.core&&e.setAttribute("fluixi",i.core),e.setAttribute("fx-dom",i.dom),e.setAttribute("fx-reactive",i.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=i)}function g(){let e=[i.core,i.dom,i.reactive].filter(o=>o!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${i.core??"(absent)"}, dom ${i.dom}, reactive ${i.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/** The versions of the packages this app is running. */
|
|
2
|
+
export interface FluixiVersions {
|
|
3
|
+
/** Absent when the app does not use `@fluixi/core` — dom and reactive can run alone. */
|
|
4
|
+
core?: string;
|
|
5
|
+
dom: string;
|
|
6
|
+
reactive: string;
|
|
7
|
+
}
|
|
8
|
+
export declare const versions: FluixiVersions;
|
|
9
|
+
declare global {
|
|
10
|
+
var Fluixi: FluixiVersions | undefined;
|
|
11
|
+
}
|
|
12
|
+
/**
|
|
13
|
+
* Record the `@fluixi/core` version, called by core when it is loaded.
|
|
14
|
+
*
|
|
15
|
+
* Inverted rather than imported, because core sits above this package.
|
|
16
|
+
*/
|
|
17
|
+
export declare function registerCoreVersion(version: string): void;
|
|
18
|
+
/**
|
|
19
|
+
* Stamp the versions onto the mount element and expose them as `window.Fluixi`.
|
|
20
|
+
*
|
|
21
|
+
* The attributes make it visible in the page source and in a screenshot of devtools —
|
|
22
|
+
* usually all a bug report contains — while the global is what you reach for in a console.
|
|
23
|
+
*/
|
|
24
|
+
export declare function stampVersions(container: Element): void;
|
|
25
|
+
/**
|
|
26
|
+
* Warn when the packages are not all from the same release.
|
|
27
|
+
*
|
|
28
|
+
* They are versioned as one unit, so a mismatch means the install is wrong rather than a
|
|
29
|
+
* combination that needs supporting. Worth saying once, loudly, rather than letting it
|
|
30
|
+
* surface later as a reactivity bug nobody can reproduce.
|
|
31
|
+
*/
|
|
32
|
+
export declare function warnOnVersionSkew(): void;
|
|
33
|
+
//# sourceMappingURL=versions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"versions.d.ts","sourceRoot":"","sources":["../../../src/lib/dom/versions.ts"],"names":[],"mappings":"AAmBA,wDAAwD;AACxD,MAAM,WAAW,cAAc;IAC7B,wFAAwF;IACxF,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,eAAO,MAAM,QAAQ,EAAE,cAAiD,CAAC;AAEzE,OAAO,CAAC,MAAM,CAAC;IAEb,IAAI,MAAM,EAAE,cAAc,GAAG,SAAS,CAAC;CACxC;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI,CAEzD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,SAAS,EAAE,OAAO,GAAG,IAAI,CAMtD;AAED;;;;;;GAMG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAYxC"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Which build of each package is actually running.
|
|
3
|
+
*
|
|
4
|
+
* This used to live in `@fluixi/core`, stamped only by *its* `render`. But an app can
|
|
5
|
+
* reach the DOM through either entry point — `@fluixi/core`'s `render`, or this package's
|
|
6
|
+
* `render`/`hydrate` by way of `startClient` — and only the first stamped anything. An app
|
|
7
|
+
* that hydrated (the docs site, every SSR app) therefore had no version attributes at all,
|
|
8
|
+
* which is exactly the case where a bug report needs them most.
|
|
9
|
+
*
|
|
10
|
+
* So the stamping sits at the bottom instead, where both paths pass through.
|
|
11
|
+
*
|
|
12
|
+
* The core version cannot be imported here: `@fluixi/core` depends on this package, not
|
|
13
|
+
* the other way round, and reversing that would be a cycle. Core registers its own version
|
|
14
|
+
* on import instead, and whichever render runs stamps whatever has been registered. That
|
|
15
|
+
* keeps the dependency direction intact and still gets all three onto the element.
|
|
16
|
+
*/
|
|
17
|
+
import { VERSION as DOM } from '../../version.generated.js';
|
|
18
|
+
import { VERSION as REACTIVE } from '@fluixi/reactive';
|
|
19
|
+
export const versions = { dom: DOM, reactive: REACTIVE };
|
|
20
|
+
/**
|
|
21
|
+
* Record the `@fluixi/core` version, called by core when it is loaded.
|
|
22
|
+
*
|
|
23
|
+
* Inverted rather than imported, because core sits above this package.
|
|
24
|
+
*/
|
|
25
|
+
export function registerCoreVersion(version) {
|
|
26
|
+
versions.core = version;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Stamp the versions onto the mount element and expose them as `window.Fluixi`.
|
|
30
|
+
*
|
|
31
|
+
* The attributes make it visible in the page source and in a screenshot of devtools —
|
|
32
|
+
* usually all a bug report contains — while the global is what you reach for in a console.
|
|
33
|
+
*/
|
|
34
|
+
export function stampVersions(container) {
|
|
35
|
+
if (versions.core)
|
|
36
|
+
container.setAttribute('fluixi', versions.core);
|
|
37
|
+
container.setAttribute('fx-dom', versions.dom);
|
|
38
|
+
container.setAttribute('fx-reactive', versions.reactive);
|
|
39
|
+
if (typeof globalThis !== 'undefined')
|
|
40
|
+
globalThis.Fluixi = versions;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Warn when the packages are not all from the same release.
|
|
44
|
+
*
|
|
45
|
+
* They are versioned as one unit, so a mismatch means the install is wrong rather than a
|
|
46
|
+
* combination that needs supporting. Worth saying once, loudly, rather than letting it
|
|
47
|
+
* surface later as a reactivity bug nobody can reproduce.
|
|
48
|
+
*/
|
|
49
|
+
export function warnOnVersionSkew() {
|
|
50
|
+
const present = [versions.core, versions.dom, versions.reactive].filter((v) => v !== undefined);
|
|
51
|
+
if (new Set(present).size <= 1)
|
|
52
|
+
return;
|
|
53
|
+
console.warn(`[fluixi] package versions disagree — core ${versions.core ?? '(absent)'}, ` +
|
|
54
|
+
`dom ${versions.dom}, reactive ${versions.reactive}. These ship as one release, so a ` +
|
|
55
|
+
`mismatch usually means a stale lockfile or two copies resolved side by side. ` +
|
|
56
|
+
`Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`);
|
|
57
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
var o="1.0.0-alpha.72";import{VERSION as s}from"@fluixi/reactive";var e={dom:o,reactive:s};function l(i){e.core=i}function c(i){e.core&&i.setAttribute("fluixi",e.core),i.setAttribute("fx-dom",e.dom),i.setAttribute("fx-reactive",e.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=e)}function d(){let i=[e.core,e.dom,e.reactive].filter(r=>r!==void 0);new Set(i).size<=1||console.warn(`[fluixi] package versions disagree — core ${e.core??"(absent)"}, dom ${e.dom}, reactive ${e.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}export{l as registerCoreVersion,c as stampVersions,e as versions,d as warnOnVersionSkew};
|
package/dist/lib/flow/portal.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var P=Object.defineProperty;var
|
|
1
|
+
"use strict";var P=Object.defineProperty;var F=Object.getOwnPropertyDescriptor;var W=Object.getOwnPropertyNames;var I=Object.prototype.hasOwnProperty;var K=(e,n)=>{for(var t in n)P(e,t,{get:n[t],enumerable:!0})},B=(e,n,t,i)=>{if(n&&typeof n=="object"||typeof n=="function")for(let c of W(n))!I.call(e,c)&&c!==t&&P(e,c,{get:()=>n[c],enumerable:!(i=F(n,c))||i.enumerable});return e};var V=e=>B(P({},"__esModule",{value:!0}),e);var J={};K(J,{Portal:()=>G});module.exports=V(J);var A=require("@fluixi/reactive/signal");var p=require("@fluixi/reactive/signal");function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}var m=require("@fluixi/reactive/signal");var R=typeof document>"u";var k=Symbol.for("fluixi.server-node"),M=null;function H(){if(!M)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return M}function T(e){return e!=null&&e[k]===!0?!0:typeof Node<"u"&&e instanceof Node}function _(e){return e!=null&&e[k]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var E={active:!1,cursor:null,parents:[]},q=null;function D(){return q}function C(e,n){return E.active&&n.parentNode===e}function $(e){let n=E.parents.lastIndexOf(e);n!==-1&&(E.parents.length=n),E.cursor=e.nextSibling}function g(e,n=!1){if(R)return H().createText(e);if(E.active&&!n){let t=D()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var x=0,U=200;function X(e,n,t,i,c){let u=i,s=new Map;return(0,m.createRenderEffect)(()=>{let r;if(N(e)&&!(0,p.isSignal)(e)){if(!s.has(e)){x++;try{let o=e();s.set(e,o)}finally{x--}}for(r=s.get(e);typeof r=="function"&&(0,p.isSignal)(r);)r=r()}else for(r=e();typeof r=="function"&&(0,p.isSignal)(r);)r=r();{let o=0;for(;typeof r=="function"&&o++<50;)if(N(r)){if(!s.has(r)){let f=r;x++;try{let a=f();s.set(f,a)}finally{x--}}r=s.get(r)}else if((0,p.isSignal)(r))r=r();else if(r=r(),typeof r!="function"||!(0,p.isSignal)(r)&&!N(r))break}x++;try{u=S(n,r,t,u,s),c(u)}finally{x--}})}function L(e,n,t,i){if(x>U)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=g("",!0),e.appendChild(t));let c=i??null,u=o=>Array.isArray(o)&&o.some(f=>typeof f=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof n!="function"&&!u(n)){x++;try{c=S(e,n,t,null)}finally{x--}return()=>c}let r=X(s(n),e,t,c,o=>{c=o});return()=>(r?.(),c)}function S(e,n,t,i,c){if(n==null||typeof n=="boolean")return b(e,i,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return b(e,i,t);if(w(n)){let s=g("",!0);return Array.isArray(i)?i.length>0?(e.replaceChild(s,i[0]),b(e,i.slice(1),t)):y(e,s,t):i?e.replaceChild(s,i):y(e,s,t),n.then(r=>{s.parentNode===e&&S(e,r,s.nextSibling,s)}).catch(r=>{console.error("Error resolving promise in insertExpression:",r)}),s}let u=typeof n;if(u==="string"||u==="number"){if(u==="number"&&(n=String(n)),Array.isArray(i)){if(i.length===0){let r=g(n);return y(e,r,t),r}if(i.length===1&&i[0].nodeType===3)return i[0].data=n,i;i=b(e,i,t)}if(i&&_(i))return i.data=n,i;let s=g(n);return i&&i.parentNode===e?e.replaceChild(s,i):C(e,s)||y(e,s,t),s}if(T(n))return C(e,n)?($(n),n):Array.isArray(i)?(i.length===0?y(e,n,t):i[0].parentNode===e?(e.replaceChild(n,i[0]),b(e,i.slice(1),t)):y(e,n,t),n):(i?i!==n&&(i.parentNode===e?e.replaceChild(n,i):y(e,n,t)):y(e,n,t),n);if(Array.isArray(n)){let s=[],r=Array.isArray(i)?i:i?[i]:[],o=[];h(n,s,e,t,!0,c,o);let f=z(e,r,s,t);for(let a of o){let l=L(e,a.sig,a.marker);(0,m.onCleanup)(()=>{b(e,l()),a.marker.parentNode===e&&e.removeChild(a.marker)})}return f}if(u==="object"&&n!==null&&typeof n=="object"){let s=n;if("type"in s&&"props"in s){let r=s;if(typeof r.type=="function"){let o=r.type(r.props||{});return S(e,o,t,i)}}}return b(e,i,t)}function h(e,n,t,i,c=!0,u,s){for(let r=0;r<e.length;r++){let o=e[r];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!w(o)&&!(0,p.isSignal)(o)&&!N(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let f;for(N(o)&&!(0,p.isSignal)(o)?(u||(u=new Map),u.has(o)||u.set(o,o()),f=u.get(o)):f=o();typeof f=="function"&&!w(f)&&!(0,p.isSignal)(f)&&!N(f);)u||(u=new Map),u.has(f)||u.set(f,f()),f=u.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if((0,p.isSignal)(f)){if(s){let l=g("",!0);n.push(l),s.push({marker:l,sig:f});continue}let a=f();for(;typeof a=="function"&&(0,p.isSignal)(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?h(a,n,t,i,c,u):h([a],n,t,i,c,u);continue}continue}Array.isArray(f)?h(f,n,t,i,c,u,s):h([f],n,t,i,c,u,s);continue}if(w(o)){let f=g("",!0);n.push(f),o.then(a=>{if(f.parentNode){let l=[];if(h([a],l,f.parentNode,void 0,!1,u),l.length>0){f.parentNode.replaceChild(l[0],f);for(let d=1;d<l.length;d++)f.parentNode?.insertBefore(l[d],l[d-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){h(o,n,t,i,c,u,s);continue}if(T(o)){n.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let f=o;if(typeof f.type=="function"){let a=f.type(f.props||{});Array.isArray(a)?h(a,n,t,i,!1,u):h([a],n,t,i,!1,u);continue}}if(typeof o=="string"||typeof o=="number"){let f=String(o);if(f.trim()===""&&f!==" ")continue;n.push(g(f));continue}n.push(g(String(o)))}}}}function z(e,n,t,i){for(let l=0;l<t.length;l++)t[l].parentNode!==null&&t[l].parentNode!==e&&(t=t.slice(),t[l]=t[l].cloneNode(!0));let c=t.length,u=n.length,s=c,r=0,o=0,f=u>0?n[u-1].nextSibling??void 0:i,a=null;for(;r<u||o<s;){if(n[r]===t[o]){r++,o++;continue}for(;u>r&&s>o&&n[u-1]===t[s-1];)u--,s--;if(u===r){let l=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:f;for(;o<s;)y(e,t[o++],l)}else if(s===o)for(;r<u;)(!a||!a.has(n[r]))&&n[r].parentNode===e&&e.removeChild(n[r]),r++;else if(n[r]===t[s-1]&&t[o]===n[u-1]){let l=n[--u].nextSibling;y(e,t[o++],n[r++].nextSibling),y(e,t[--s],l),n[u]=n[r-1]}else{if(!a){a=new Map;let d=o;for(;d<s;)a.set(t[d],d++)}let l=a.get(n[r]);if(l!=null)if(o<l&&l<s){let d=r,v=1;for(;++d<u&&d<s&&!(!a.has(n[d])||a.get(n[d])!==l+v);)v++;if(v>l-o){let O=n[r];for(;o<l;)y(e,t[o++],O)}else n[r].parentNode===e?e.replaceChild(t[o++],n[r++]):(y(e,t[o++],f),r++)}else r++;else n[r].parentNode===e&&e.removeChild(n[r]),r++}}return t}function b(e,n,t){if(n)if(Array.isArray(n))for(let i=0;i<n.length;i++)n[i].parentNode===e&&e.removeChild(n[i]);else n.parentNode===e&&e.removeChild(n);return null}function y(e,n,t){E.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function j(e,n){if(e){if(T(e)){let t=n,i=e;if(!t)return;typeof t=="function"?t(i):typeof t=="object"&&"current"in t&&(t.current=i);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function w(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function G(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,i;return(0,A.createRoot)(c=>{t=c,i=document.createElement("div"),i.style.display="contents",n().appendChild(i),L(i,e.children)&&j(e.ref,i)}),(0,A.onCleanup)(()=>{t(),i.remove()}),null}
|
package/dist/lib/flow/portal.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRoot as K,onCleanup as B}from"@fluixi/reactive/signal";import{isSignal as p}from"@fluixi/reactive/signal";function
|
|
1
|
+
import{createRoot as K,onCleanup as B}from"@fluixi/reactive/signal";import{isSignal as p}from"@fluixi/reactive/signal";function m(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}import{batch as Q,createEffect as Z,createRenderEffect as j,createRoot as ee,onCleanup as O,readChildren as ne}from"@fluixi/reactive/signal";var C=typeof document>"u";var L=Symbol.for("fluixi.server-node"),P=null;function M(){if(!P)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return P}function b(e){return e!=null&&e[L]===!0?!0:typeof Node<"u"&&e instanceof Node}function R(e){return e!=null&&e[L]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var N={active:!1,cursor:null,parents:[]},$=null;function k(){return $}function A(e,n){return N.active&&n.parentNode===e}function H(e){let n=N.parents.lastIndexOf(e);n!==-1&&(N.parents.length=n),N.cursor=e.nextSibling}function g(e,n=!1){if(C)return M().createText(e);if(N.active&&!n){let t=k()?.hydrateText(e);if(t)return t}return document.createTextNode(e)}var x=0,F=200;function W(e,n,t,r,c){let u=r,s=new Map;return j(()=>{let i;if(m(e)&&!p(e)){if(!s.has(e)){x++;try{let o=e();s.set(e,o)}finally{x--}}for(i=s.get(e);typeof i=="function"&&p(i);)i=i()}else for(i=e();typeof i=="function"&&p(i);)i=i();{let o=0;for(;typeof i=="function"&&o++<50;)if(m(i)){if(!s.has(i)){let f=i;x++;try{let a=f();s.set(f,a)}finally{x--}}i=s.get(i)}else if(p(i))i=i();else if(i=i(),typeof i!="function"||!p(i)&&!m(i))break}x++;try{u=w(n,i,t,u,s),c(u)}finally{x--}})}function v(e,n,t,r){if(x>F)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;t!==void 0&&!t&&(t=g("",!0),e.appendChild(t));let c=r??null,u=o=>Array.isArray(o)&&o.some(f=>typeof f=="function"),s=o=>typeof o=="function"?o:()=>o;if(typeof n!="function"&&!u(n)){x++;try{c=w(e,n,t,null)}finally{x--}return()=>c}let i=W(s(n),e,t,c,o=>{c=o});return()=>(i?.(),c)}function w(e,n,t,r,c){if(n==null||typeof n=="boolean")return E(e,r,t);if(typeof n=="function")for(;typeof n=="function";)n=n();if(n==null||typeof n=="boolean")return E(e,r,t);if(T(n)){let s=g("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(s,r[0]),E(e,r.slice(1),t)):y(e,s,t):r?e.replaceChild(s,r):y(e,s,t),n.then(i=>{s.parentNode===e&&w(e,i,s.nextSibling,s)}).catch(i=>{console.error("Error resolving promise in insertExpression:",i)}),s}let u=typeof n;if(u==="string"||u==="number"){if(u==="number"&&(n=String(n)),Array.isArray(r)){if(r.length===0){let i=g(n);return y(e,i,t),i}if(r.length===1&&r[0].nodeType===3)return r[0].data=n,r;r=E(e,r,t)}if(r&&R(r))return r.data=n,r;let s=g(n);return r&&r.parentNode===e?e.replaceChild(s,r):A(e,s)||y(e,s,t),s}if(b(n))return A(e,n)?(H(n),n):Array.isArray(r)?(r.length===0?y(e,n,t):r[0].parentNode===e?(e.replaceChild(n,r[0]),E(e,r.slice(1),t)):y(e,n,t),n):(r?r!==n&&(r.parentNode===e?e.replaceChild(n,r):y(e,n,t)):y(e,n,t),n);if(Array.isArray(n)){let s=[],i=Array.isArray(r)?r:r?[r]:[],o=[];h(n,s,e,t,!0,c,o);let f=I(e,i,s,t);for(let a of o){let l=v(e,a.sig,a.marker);O(()=>{E(e,l()),a.marker.parentNode===e&&e.removeChild(a.marker)})}return f}if(u==="object"&&n!==null&&typeof n=="object"){let s=n;if("type"in s&&"props"in s){let i=s;if(typeof i.type=="function"){let o=i.type(i.props||{});return w(e,o,t,r)}}}return E(e,r,t)}function h(e,n,t,r,c=!0,u,s){for(let i=0;i<e.length;i++){let o=e[i];if(!(o==null||typeof o=="boolean")){for(;typeof o=="function"&&!T(o)&&!p(o)&&!m(o)&&(o=o(),!(o==null||typeof o=="boolean")););if(!(o==null||typeof o=="boolean")){if(typeof o=="function"){let f;for(m(o)&&!p(o)?(u||(u=new Map),u.has(o)||u.set(o,o()),f=u.get(o)):f=o();typeof f=="function"&&!T(f)&&!p(f)&&!m(f);)u||(u=new Map),u.has(f)||u.set(f,f()),f=u.get(f);if(f==null||typeof f=="boolean")continue;if(typeof f=="function"){if(p(f)){if(s){let l=g("",!0);n.push(l),s.push({marker:l,sig:f});continue}let a=f();for(;typeof a=="function"&&p(a);)a=a();if(a==null||typeof a=="boolean")continue;Array.isArray(a)?h(a,n,t,r,c,u):h([a],n,t,r,c,u);continue}continue}Array.isArray(f)?h(f,n,t,r,c,u,s):h([f],n,t,r,c,u,s);continue}if(T(o)){let f=g("",!0);n.push(f),o.then(a=>{if(f.parentNode){let l=[];if(h([a],l,f.parentNode,void 0,!1,u),l.length>0){f.parentNode.replaceChild(l[0],f);for(let d=1;d<l.length;d++)f.parentNode?.insertBefore(l[d],l[d-1].nextSibling)}}}).catch(a=>console.error("Error resolving promise in array:",a));continue}if(Array.isArray(o)){h(o,n,t,r,c,u,s);continue}if(b(o)){n.push(o);continue}if(typeof o=="object"&&o!==null&&"type"in o&&"props"in o){let f=o;if(typeof f.type=="function"){let a=f.type(f.props||{});Array.isArray(a)?h(a,n,t,r,!1,u):h([a],n,t,r,!1,u);continue}}if(typeof o=="string"||typeof o=="number"){let f=String(o);if(f.trim()===""&&f!==" ")continue;n.push(g(f));continue}n.push(g(String(o)))}}}}function I(e,n,t,r){for(let l=0;l<t.length;l++)t[l].parentNode!==null&&t[l].parentNode!==e&&(t=t.slice(),t[l]=t[l].cloneNode(!0));let c=t.length,u=n.length,s=c,i=0,o=0,f=u>0?n[u-1].nextSibling??void 0:r,a=null;for(;i<u||o<s;){if(n[i]===t[o]){i++,o++;continue}for(;u>i&&s>o&&n[u-1]===t[s-1];)u--,s--;if(u===i){let l=s<c?o?t[o-1].nextSibling??void 0:t[s-o]:f;for(;o<s;)y(e,t[o++],l)}else if(s===o)for(;i<u;)(!a||!a.has(n[i]))&&n[i].parentNode===e&&e.removeChild(n[i]),i++;else if(n[i]===t[s-1]&&t[o]===n[u-1]){let l=n[--u].nextSibling;y(e,t[o++],n[i++].nextSibling),y(e,t[--s],l),n[u]=n[i-1]}else{if(!a){a=new Map;let d=o;for(;d<s;)a.set(t[d],d++)}let l=a.get(n[i]);if(l!=null)if(o<l&&l<s){let d=i,S=1;for(;++d<u&&d<s&&!(!a.has(n[d])||a.get(n[d])!==l+S);)S++;if(S>l-o){let D=n[i];for(;o<l;)y(e,t[o++],D)}else n[i].parentNode===e?e.replaceChild(t[o++],n[i++]):(y(e,t[o++],f),i++)}else i++;else n[i].parentNode===e&&e.removeChild(n[i]),i++}}return t}function E(e,n,t){if(n)if(Array.isArray(n))for(let r=0;r<n.length;r++)n[r].parentNode===e&&e.removeChild(n[r]);else n.parentNode===e&&e.removeChild(n);return null}function y(e,n,t){N.active&&n.parentNode===e||(t&&t.parentNode===e?e.insertBefore(n,t):e.appendChild(n))}function _(e,n){if(e){if(b(e)){let t=n,r=e;if(!t)return;typeof t=="function"?t(r):typeof t=="object"&&"current"in t&&(t.current=r);return}typeof e=="function"?e(n):typeof e=="object"&&"current"in e&&(e.current=n)}}function T(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function ue(e){let n=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,t,r;return K(c=>{t=c,r=document.createElement("div"),r.style.display="contents",n().appendChild(r),v(r,e.children)&&_(e.ref,r)}),B(()=>{t(),r.remove()}),null}export{ue as Portal};
|
package/dist/lib/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var ke=Object.defineProperty;var pn=Object.getOwnPropertyDescriptor;var yn=Object.getOwnPropertyNames;var mn=Object.prototype.hasOwnProperty;var gn=(e,t)=>{for(var n in t)ke(e,n,{get:t[n],enumerable:!0})},hn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of yn(t))!mn.call(e,o)&&o!==n&&ke(e,o,{get:()=>t[o],enumerable:!(r=pn(t,o))||r.enumerable});return e};var xn=e=>hn(ke({},"__esModule",{value:!0}),e);var to={};gn(to,{ClientOnly:()=>Qe,Dynamic:()=>Gt,ErrorBoundary:()=>Yt,FX_DATA_ID:()=>U,For:()=>Wt,Index:()=>Bt,Island:()=>Dt,JSX_PROPERTIES:()=>ae,Match:()=>Kt,NoSsr:()=>Jt,Portal:()=>Xt,SVG_ELEMENTS:()=>Sn,SVG_NAMESPACE:()=>j,Show:()=>Vt,Switch:()=>zt,VOID_ELEMENTS:()=>wn,addClass:()=>Cn,addDelegatedEventListener:()=>At,addNativeEventListener:()=>He,appendChildren:()=>$n,applyElementProp:()=>se,applyProps:()=>We,applyUse:()=>Fe,asComponent:()=>rr,asContext:()=>nr,asOutlet:()=>er,asProvider:()=>tr,asRoute:()=>Qn,asRouter:()=>Yn,asRoutes:()=>Zn,asSuspense:()=>or,captureHydrationCursor:()=>wt,checkRenderType:()=>ir,classMap:()=>Qt,cleanChildren:()=>L,cloneTemplate:()=>Rt,closest:()=>An,createComponent:()=>Ke,createDynamicElement:()=>Wr,createElement:()=>Dn,createNativeElement:()=>je,createPortal:()=>Ar,createRequestContext:()=>V,createTemplate:()=>Ct,delegate:()=>Hn,delegateEvents:()=>qe,escapeFxJson:()=>oe,escapeHTML:()=>Rr,fnName:()=>xr,generateID:()=>cr,getAttribute:()=>Ln,getGlobal:()=>Jn,getLitEventName:()=>En,getLocals:()=>Xe,getOffset:()=>jn,getRequestContext:()=>C,getRequestEvent:()=>ge,getRequestLocals:()=>he,getServerData:()=>ie,getStableElementId:()=>lr,getStyle:()=>On,handleRef:()=>re,hasClass:()=>Pn,holeContent:()=>hr,holeEnd:()=>gr,holeScope:()=>mr,html:()=>$t,hydrate:()=>Ne,hydrateAdvancePast:()=>F,hydrateIslands:()=>_t,indexArray:()=>B.indexArray,initializeIntegration:()=>kr,insert:()=>A,insertExpression:()=>Z,intergartionInitialized:()=>Or,isAccessor:()=>Mr,isComponent:()=>N,isContext:()=>xt,isCustomElement:()=>ut,isDOMNode:()=>Gn,isDelegatedEvent:()=>dr,isDomElement:()=>le,isDomNode:()=>_,isDomText:()=>ce,isEventHandler:()=>bn,isFunction:()=>pr,isIntegrationInitialized:()=>Dr,isJSXTemplate:()=>zn,isLitTemplateResult:()=>dt,isNativeElement:()=>Cr,isOutlet:()=>gt,isPromise:()=>Y,isProvider:()=>ht,isReactElement:()=>Bn,isRoute:()=>mt,isRouter:()=>pt,isRoutes:()=>yt,isSVGElement:()=>Ue,isServer:()=>g,isSuspense:()=>Tt,isTemplateFactory:()=>Kn,isVisible:()=>In,iterateFn:()=>Tr,keyArray:()=>B.keyArray,makeArrayFlat:()=>Mt,mapArray:()=>B.mapArray,mergeProps:()=>Sr,observeIntersection:()=>Vn,observeResize:()=>Wn,query:()=>Oe,queryAll:()=>vn,registerCreateComponent:()=>Lr,registerGlobal:()=>Xn,removeAttribute:()=>kn,removeChildren:()=>_n,removeClass:()=>Rn,removeDelegatedEventListener:()=>Ie,render:()=>Be,renderToString:()=>at,renderToStringAsync:()=>ct,resetIntegration:()=>_r,runHydrationAt:()=>J,runWithRequestContext:()=>W,runWithoutHydration:()=>St,scrollIntoView:()=>qn,serializeNode:()=>S,serializeResourceData:()=>Me,setAttribute:()=>E,setClassList:()=>te,setClassName:()=>ee,setDataRedactor:()=>lt,setDynamicAttribute:()=>de,setDynamicBoolAttribute:()=>Ve,setDynamicProperty:()=>pe,setProperty:()=>Q,setRequestStore:()=>Ge,setServerMode:()=>D,setStyle:()=>ne,setStyles:()=>ft,shouldSetAsProperty:()=>Nn,splitProps:()=>vr,spread:()=>wr,styleMap:()=>tn,svg:()=>It,templateNode:()=>yr,toAttributeName:()=>Tn,toggleClass:()=>Mn,waitForElement:()=>Fn});module.exports=xn(to);function Tn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function bn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function En(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Nn(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 wn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Sn=new Set(["svg","g","path","circle","rect","line","polyline","polygon","ellipse","text","tspan","use","defs","symbol","mask","clipPath","pattern","linearGradient","radialGradient","stop","filter","feGaussianBlur","feOffset","feMerge","feMergeNode","foreignObject"]),j="http://www.w3.org/2000/svg";function ut(e){return e.localName.includes("-")}function se(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ut(e)){e[t]=n;return}E(e,t,n,r)}var ae=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function Oe(e,t=document){return t.querySelector(e)}function vn(e,t=document){return Array.from(t.querySelectorAll(e))}function An(e,t){return e.closest(t)}function Cn(e,...t){e.classList.add(...t)}function Rn(e,...t){e.classList.remove(...t)}function Mn(e,...t){t.forEach(n=>e.classList.toggle(n))}function Pn(e,t){return e.classList.contains(t)}function E(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 Ln(e,t){return e.getAttribute(t)}function kn(e,t){e.removeAttribute(t)}function ft(e,t){Object.assign(e.style,t)}function On(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function Dn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")ft(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else E(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function _n(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function $n(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function In(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function qn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function jn(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Hn(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Fn(e,t=5e3){return new Promise((n,r)=>{let o=Oe(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=Oe(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function Vn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Wn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Un=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Bn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Un}function dt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Kn(e){if(typeof e!="function")return!1;try{let t=e();return dt(t)}catch{return!1}}function zn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Gn(e){return e instanceof Node}function Xn(e,t,n="Fluixi"){typeof globalThis<"u"&&(typeof globalThis[n]>"u"&&(globalThis[n]={}),typeof globalThis[n][e]>"u"&&(globalThis[n][e]=t))}function Jn(e,t,n="Fluixi"){return typeof globalThis<"u"&&typeof globalThis[n]<"u"&&typeof globalThis[n][e]<"u"?globalThis[n][e]:t}var x=require("@fluixi/reactive/signal");function Yn(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function Zn(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function Qn(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function er(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function tr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function nr(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 or(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function pt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function yt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function mt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function gt(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function ht(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function ir(e){return pt(e)?{type:"router",value:e}:mt(e)?{type:"route",value:e}:yt(e)?{type:"routes",value:e}:gt(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:Tt(e)?{type:"suspense",value:e}:ht(e)?{type:"provider",value:e}:xt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function D(e){g=e}var X=Symbol.for("fluixi.server-node"),De=null;function bt(e){De=e}function H(){if(!De)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return De}function _(e){return e!=null&&e[X]===!0?!0:typeof Node<"u"&&e instanceof Node}function le(e){return e!=null&&e[X]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ce(e){return e!=null&&e[X]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},Et=null;function Nt(e){Et=e}function ue(){return Et}function _e(e,t){return u.active&&t.parentNode===e}function $e(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function wt(){return u.active?u.cursor:null}function J(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 St(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 F(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&$e(t)}function sr(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 ar(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 lr(e){return ar(sr(e))}var cr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),ur={};var vt=new Map,fe=new Set,ye=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function qe(e){if(!g)for(let t of e)fe.has(t)||ye.has(t)||(fe.add(t),document.addEventListener(t,fr))}function fr(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 At(e,t,n){if(e[`$$${t}`]=n,ye.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}fe.has(t)||qe([t])}function Ie(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function dr(e){return!ye.has(e)}function pr(e){return typeof e=="function"}function k(e,t=!1){if(g)return H().createText(e);if(u.active&&!t){let n=ue()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function je(e,t=!1){if(g)return H().createElement(e,t);if(u.active){let n=ue()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(j,e):document.createElement(e)}function Ct(e,t=!1){let n=vt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,vt.set(e,r),r}function yr(e,t,n=!1,r=!1){if(g){let o=H();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=ue()?.hydrateStatic(t);if(o)return o}return Rt(Ct(e,r),r).firstChild}function mr(e,t){if(!u.active)return t();let n=J(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?J(e.nextSibling,()=>r(...o)):r(...o))}return n}function gr(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function hr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Rt(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Mt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Mt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function xr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Tr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var P=0,br=200;function Er(e,t,n,r,o){let s=r,i=new Map;return(0,d.createRenderEffect)(()=>{let a;if(N(e)&&!(0,x.isSignal)(e)){if(!i.has(e)){P++;try{let l=e();i.set(e,l)}finally{P--}}for(a=i.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!i.has(a)){let c=a;P++;try{let f=c();i.set(c,f)}finally{P--}}a=i.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}P++;try{s=Z(t,a,n,s,i),o(s)}finally{P--}})}function A(e,t,n,r){if(P>br)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=k("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){P++;try{o=Z(e,t,n,null)}finally{P--}return()=>o}let a=Er(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Z(e,t,n,r,o){if(t==null||typeof t=="boolean")return L(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return L(e,r,n);if(Y(t)){let i=k("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),L(e,r.slice(1),n)):T(e,i,n):r?e.replaceChild(i,r):T(e,i,n),t.then(a=>{i.parentNode===e&&Z(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=k(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=L(e,r,n)}if(r&&ce(r))return r.data=t,r;let i=k(t);return r&&r.parentNode===e?e.replaceChild(i,r):_e(e,i)||T(e,i,n),i}if(_(t))return _e(e,t)?($e(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),L(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];M(t,i,e,n,!0,o,l);let c=Nr(e,a,i,n);for(let f of l){let p=A(e,f.sig,f.marker);(0,d.onCleanup)(()=>{L(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return Z(e,l,n,r)}}}return L(e,r,n)}function M(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!Y(l)&&!(0,x.isSignal)(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!(0,x.isSignal)(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!Y(c)&&!(0,x.isSignal)(c)&&!N(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,x.isSignal)(c)){if(i){let p=k("",!0);t.push(p),i.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,x.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?M(f,t,n,r,o,s):M([f],t,n,r,o,s);continue}continue}Array.isArray(c)?M(c,t,n,r,o,s,i):M([c],t,n,r,o,s,i);continue}if(Y(l)){let c=k("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(M([f],p,c.parentNode,void 0,!1,s),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){M(l,t,n,r,o,s,i);continue}if(_(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)?M(f,t,n,r,!1,s):M([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(k(c));continue}t.push(k(String(l)))}}}}function Nr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let p=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)T(e,n[l++],p)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let p=t[--s].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--i],p),t[s]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<i;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<i){let y=a,m=1;for(;++y<s&&y<i&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Pe=t[a];for(;l<p;)T(e,n[l++],Pe)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function L(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function Q(e,t,n){n==null?delete e[t]:e[t]=n}function He(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 Fe(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 de(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function pe(e,t,n){return typeof n!="function"?(Q(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;Q(e,t,r)})}function Ve(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();E(e,t,!!r)})}function ee(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>ee(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 te(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function ne(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 wr(e){let{element:t,props:n,prevProps:r=ur,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!le(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===j,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){re(c,t);continue}if(l==="use"){Fe(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(pe(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(de(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(Ve(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ee(t,c()))):ee(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>te(t,c()))):te(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&Ie(t,y),c&&At(t,y,c);continue}let p=ae.has(l)||!i&&l in t;typeof c=="function"?a.push(p?pe(t,l,c):de(t,l,c,i)):a.push((0,d.createRenderEffect)(()=>p?Q(t,l,n[l]):E(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();Ie(t,c)}else ae.has(l)?Q(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function We(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){re(o,e);continue}if(r!=="children"){if(r==="use"){Fe(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){pe(e,r.slice(5),o);continue}if(r.startsWith("attr:")){de(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){Ve(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(ye.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,fe.has(s)||qe([s]);continue}if(r==="class"||r==="className"){ee(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>te(e,o())):te(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>ne(e,o())):ne(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});(0,d.onCleanup)(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{i()})}else{let s=!0;(0,d.createRenderEffect)(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();se(e,r,i,n)});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>se(e,r,t[r],n))}}}function Sr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[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 s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function vr(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);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})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function re(e,t){if(e){if(_(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 Ar(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),s=[];return(0,d.batch)(()=>{let i=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):_(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),(0,d.onCleanup)(()=>{s.forEach(a=>a())})}),null}function Cr(e){return typeof e=="string"&&e.toLowerCase()===e}function Ue(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 Rr(e){return e.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function Y(e){return e!=null&&(typeof e=="object"||typeof e=="function")&&typeof e.then=="function"||e instanceof Promise}function Mr(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function Be(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return(0,d.createRoot)(i=>{(0,d.batch)(()=>{u.active||(t.textContent=""),A(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var Pr="__fx_dom_create_component__",$=globalThis[Pr]??={fn:null};function Lr(e){$.fn=e}function kr(e={}){let t=e.signalSystem?.createComponent;t&&($.fn=t)}function Ke(e,t){return $.fn?$.fn(e,t):(()=>e(t))}var Or=()=>$.fn!==null,Dr=()=>$.fn!==null;function _r(){$.fn=null}var me,Lt={getStore:()=>me,run(e,t){let n=me;me=e;try{return t()}finally{me=n}}},ze=Lt;function Ge(e){ze=e??Lt}function V(e={}){e.locals||(e.locals=e.request?he(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function W(e,t){return ze.run(e,t)}function C(){return ze.getStore()}function ge(){return C()?.event}function Xe(){let e=ge();return e?(e.locals||(e.locals={}),e.locals):{}}var Pt=new WeakMap;function he(e){let t=Pt.get(e);return t||(t={},Pt.set(e,t)),t}var xe=require("@fluixi/reactive/signal");var U="__FX_DATA__";function oe(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Je;function ie(){let e=globalThis.__FX_DATA__;if(e)return e;if(Je!==void 0)return Je;let t=null;if(typeof document<"u"){let n=document.getElementById(U)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Je=t}function Te(){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 $r=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),be=typeof process<"u"&&process.env&&!1;function Ee(e,t){let n=t.nodeType===1?`<${t.tagName.toLowerCase()}>`:t.nodeType===3?`text ${JSON.stringify((t.nodeValue??"").slice(0,24))}`:t.nodeType===8?"comment":"node";console.warn(`[fluixi] hydration mismatch: expected ${e} but the server DOM has ${n}. Server and client rendered different markup; recreating this node on the client. Check for non-deterministic render (Date.now(), Math.random(), browser-only branches, untransported data).`)}function Ir(e){Te();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?($r.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(be&&t&&Ee(`<${e}>`,t),null)}function qr(e){Te();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(be&&t&&Ee(`<${e}> (static)`,t),null)}function jr(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}Te();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(be&&t&&Ee(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Hr(e){Te();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(be&&t&&Ee(`marker <!--${e.slice(0,24)}-->`,t),null)}var kt=!1;function Fr(){kt||(kt=!0,Nt({hydrateElement:Ir,hydrateText:jr,hydrateMarker:Hr,hydrateStatic:qr}))}function Ne(e,t,n){Fr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=ie(),o=n?.resourceNamespace,s=0;(0,xe.setResourceIdSource)(()=>o?`${o}:r${s++}`:`r${s++}`),(0,xe.setServerDataGetter)(r?i=>i in r?{value:r[i]}:void 0:null);try{return Be(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ye="fluixi-island";function Dt(e){let{component:t,props:n={},name:r}=e,o=je(Ye),s=r??t.name??"Island";E(o,"name",s),E(o,"props",JSON.stringify(n??{}));let i=g?C():void 0;if(i){let a=i.nextIslandNamespace(s);A(o,()=>i.withResourceScope(a,()=>t(n)))}else A(o,()=>t(n));return o}var Ot=!1;function Vr(){if(Ot||typeof document>"u")return;Ot=!0;let e=document.createElement("style");e.textContent=`${Ye}{display:contents}`,document.head.appendChild(e)}function _t(e){if(typeof document>"u")return;Vr();let t=document.querySelectorAll(Ye),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Ne(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function $t(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function It(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var qt=require("@fluixi/reactive/signal");function Wr(e,t={}){if(typeof e=="function")return Ke(e,t);if(typeof e!="string"||e.length===0)return null;let n=Ue(e);if(g)return H().createElement(e,n);let r=n?document.createElementNS(j,e):document.createElement(e);return We(r,t,n),Ur(r,t),r}function Ur(e,t){if(!t||t.children===void 0)return;let n=(0,qt.readChildren)(()=>t.children),r=o=>{A(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function jt(e){return typeof e=="function"?e:(()=>e)}function O(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Ht(e){return e!=null&&e!==!1}function Ft(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function Vt(e){let t=O(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),o=(0,h.getOwner)(),s=null,i=null,a=l=>{l!==i&&(s&&(0,h.disposeScope)(s),s=(0,h.createChildOwner)(o),i=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!Ft(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var we=require("@fluixi/reactive/signal");function Wt(e){let t=O(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return F(a),a};return e.by?(0,we.keyArray)(t,e.by,(o,s)=>r(o,s),{fallback:n}):(0,we.mapArray)(t,(o,s)=>r(o,s),{fallback:n})}var Ut=require("@fluixi/reactive/signal");function Bt(e){let t=O(()=>e.each);return(0,Ut.indexArray)(t,(n,r)=>{let o=e.children(n,r);return F(o),o},{fallback:()=>e.fallback??null})}var B=require("@fluixi/reactive/signal");var w=require("@fluixi/reactive/signal");var Ze=Symbol("match");function Kt(e){return{[Ze]:!0,when:O(()=>e.when),get children(){return e.children}}}function zt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,w.getOwner)(),r=null,o=-1,s=i=>{i!==o&&(r&&(0,w.disposeScope)(r),r=(0,w.createChildOwner)(n),o=i)};return(0,w.createMemo)(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Ze]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Ze]!==!0)continue;let f=l.when();if(Ht(f))return s(i),(0,w.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),(0,w.runWithOwner)(r,()=>e.fallback??null)})}var R=require("@fluixi/reactive/signal");function Gt(e){let t=jt(e.component),{component:n,...r}=e,o=(0,R.getOwner)(),s=null,i;return(0,R.createMemo)(()=>{let a=t();return a!==i&&(s&&(0,R.disposeScope)(s),s=(0,R.createChildOwner)(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,R.runWithOwner)(s,()=>a(r))})}var Se=require("@fluixi/reactive/signal");function Xt(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,Se.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),A(r,e.children)&&re(e.ref,r)}),(0,Se.onCleanup)(()=>{n(),r.remove()}),null}var ve=require("@fluixi/reactive/signal");function Qe(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,ve.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,ve.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var Jt=Qe;var Ae=require("@fluixi/reactive/signal");function Yt(e){let[t,n]=(0,Ae.createSignal)(null),r=()=>n(null);return(0,Ae.createMemo)(()=>{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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}var Zt=require("@fluixi/reactive/signal");function Qt(e){return(0,Zt.createMemo)(()=>{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(" ")})}var en=require("@fluixi/reactive/signal");function Br(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function tn(e){return(0,en.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Br(r)}: ${s}`)}return n.join("; ")})}var Re=1,nt=3,rt=8,nn;nn=X;var K=class{constructor(){this[nn]=!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(){}},I=class e extends K{constructor(n){super();this.nodeType=nt;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 K{constructor(n){super();this.nodeType=Re;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},z=class e extends K{constructor(n){super();this.nodeType=rt;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},et=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},tt=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}},q=class e extends K{constructor(n,r=!1){super();this.nodeType=Re;this.attributes=new Map;this.style=new et;this.classList=new tt(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 I(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 Kr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),on=/&/g,sn=/</g,an=/>/g,zr=/"/g;function ot(e){return e.replace(on,"&").replace(sn,"<").replace(an,">")}function rn(e){return e.replace(on,"&").replace(zr,""").replace(sn,"<").replace(an,">")}function Gr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function Xr(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(`${Gr(n)}: ${r}`)}return t.join("; ")}function Jr(e){let t="",n=Xr(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${rn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${rn(o)}"`}return t}function S(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return ot(e);if(typeof e=="number")return ot(String(e));if(typeof e=="function")return S(e());if(Array.isArray(e))return e.map(S).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case nt:return ot(e.data??"");case rt:return`<!--${e.data??""}-->`;case Re:{let t=e.localName,n=`<${t}${Jr(e)}>`;if(Kr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(S).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(S).join(""):""}var st=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var Yr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Zr={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function ln(e){return e.replace(/&(#?\w+);/g,(t,n)=>Zr[n]??t)}var v=class extends Error{};function cn(e,t=!1){let n=0,r=[],o=[],s=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new v(`unterminated comment at ${c}`);s(new z(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new v(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new v(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new v(`unclosed <${o[o.length-1].localName}>`);let i=r[0];if(r.length!==1||!(i instanceof q))throw new v(`expected exactly one root element, got ${r.length}`);return i;function a(c){c!==""&&s(new I(ln(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new v(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new q(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Pe=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let G=e.slice(Pe,m);if(G==="")throw new v(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new v(`attribute ${G} must have a double-quoted value`);let Le=e.indexOf('"',m+2);if(Le===-1)throw new v(`unterminated value for ${G}`);y.setAttribute(G,ln(e.slice(m+2,Le))),m=Le+1}else y.setAttribute(G,"")}return s(y),Yr.has(p)||o.push(y),m}}var un=!1;function dn(){un||(un=!0,bt({createElement:(e,t)=>new q(e,t),createText:e=>new I(e),createRaw:e=>new Ce(e),parseTemplate:(e,t)=>cn(e,t),createComment:e=>new z(e)}))}function at(e,t={}){let n=g;dn(),D(!0);let r=V(t.event);try{return W(r,()=>(0,st.createRoot)(o=>{try{let s=typeof e=="function"?e():e;return S(s)}finally{o()}}))}finally{D(n)}}var fn=!1;function Qr(){fn||(fn=!0,(0,b.setResourceTracker)(e=>{C()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>C()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&C()?.data.set(e,t)}))}var it=null;function lt(e){it=e}function Me(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(it)try{s=it(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=oe(JSON.stringify(t));return`<script type="application/json" id="${U}">${n}<\/script>`}var eo=50;async function ct(e,t={}){let n=g;dn(),D(!0),Qr();let r=V(t.event);try{return await W(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};(0,st.createRoot)(f=>{i=f,s=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(s,()=>S(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<eo;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(s,()=>S(o))+Me(r);return i(),c})}finally{D(n)}}
|
|
1
|
+
"use strict";var Oe=Object.defineProperty;var xn=Object.getOwnPropertyDescriptor;var Tn=Object.getOwnPropertyNames;var bn=Object.prototype.hasOwnProperty;var En=(e,t)=>{for(var n in t)Oe(e,n,{get:t[n],enumerable:!0})},wn=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of Tn(t))!bn.call(e,o)&&o!==n&&Oe(e,o,{get:()=>t[o],enumerable:!(r=xn(t,o))||r.enumerable});return e};var Nn=e=>wn(Oe({},"__esModule",{value:!0}),e);var so={};En(so,{ClientOnly:()=>et,Dynamic:()=>Qt,ErrorBoundary:()=>nn,FX_DATA_ID:()=>B,For:()=>Gt,Index:()=>Jt,Island:()=>jt,JSX_PROPERTIES:()=>le,Match:()=>Yt,NoSsr:()=>tn,Portal:()=>en,SVG_ELEMENTS:()=>Mn,SVG_NAMESPACE:()=>F,Show:()=>zt,Switch:()=>Zt,VOID_ELEMENTS:()=>Rn,addClass:()=>kn,addDelegatedEventListener:()=>Lt,addNativeEventListener:()=>He,appendChildren:()=>Hn,applyElementProp:()=>ae,applyProps:()=>Ue,applyUse:()=>Ve,asComponent:()=>lr,asContext:()=>ar,asOutlet:()=>ir,asProvider:()=>sr,asRoute:()=>or,asRouter:()=>nr,asRoutes:()=>rr,asSuspense:()=>cr,captureHydrationCursor:()=>Rt,checkRenderType:()=>ur,classMap:()=>on,cleanChildren:()=>k,cloneTemplate:()=>Ot,closest:()=>Ln,createComponent:()=>ze,createDynamicElement:()=>Gr,createElement:()=>jn,createNativeElement:()=>Fe,createPortal:()=>Lr,createRequestContext:()=>W,createTemplate:()=>kt,delegate:()=>Bn,delegateEvents:()=>je,escapeFxJson:()=>ie,escapeHTML:()=>Or,fnName:()=>Nr,generateID:()=>yr,getAttribute:()=>$n,getGlobal:()=>tr,getLitEventName:()=>An,getLocals:()=>Je,getOffset:()=>Un,getRequestContext:()=>R,getRequestEvent:()=>he,getRequestLocals:()=>xe,getServerData:()=>se,getStableElementId:()=>pr,getStyle:()=>qn,handleRef:()=>oe,hasClass:()=>_n,holeContent:()=>wr,holeEnd:()=>Er,holeScope:()=>br,html:()=>Ht,hydrate:()=>Ne,hydrateAdvancePast:()=>V,hydrateIslands:()=>Ft,indexArray:()=>K.indexArray,initializeIntegration:()=>Ir,insert:()=>C,insertExpression:()=>Q,intergartionInitialized:()=>qr,isAccessor:()=>Dr,isComponent:()=>N,isContext:()=>Nt,isCustomElement:()=>ft,isDOMNode:()=>Qn,isDelegatedEvent:()=>hr,isDomElement:()=>ce,isDomNode:()=>$,isDomText:()=>ue,isEventHandler:()=>vn,isFunction:()=>xr,isIntegrationInitialized:()=>jr,isJSXTemplate:()=>Zn,isLitTemplateResult:()=>pt,isNativeElement:()=>kr,isOutlet:()=>Et,isPromise:()=>Z,isProvider:()=>wt,isReactElement:()=>Jn,isRoute:()=>bt,isRouter:()=>xt,isRoutes:()=>Tt,isSVGElement:()=>Be,isServer:()=>g,isSuspense:()=>St,isTemplateFactory:()=>Yn,isVisible:()=>Vn,iterateFn:()=>Sr,keyArray:()=>K.keyArray,makeArrayFlat:()=>Dt,mapArray:()=>K.mapArray,mergeProps:()=>Mr,observeIntersection:()=>zn,observeResize:()=>Gn,query:()=>De,queryAll:()=>Pn,registerCreateComponent:()=>$r,registerGlobal:()=>er,removeAttribute:()=>In,removeChildren:()=>Fn,removeClass:()=>On,removeDelegatedEventListener:()=>qe,render:()=>Ke,renderToString:()=>lt,renderToStringAsync:()=>ut,resetIntegration:()=>Fr,runHydrationAt:()=>Y,runWithRequestContext:()=>U,runWithoutHydration:()=>Mt,scrollIntoView:()=>Wn,serializeNode:()=>v,serializeResourceData:()=>Pe,setAttribute:()=>E,setClassList:()=>ne,setClassName:()=>te,setDataRedactor:()=>ct,setDynamicAttribute:()=>pe,setDynamicBoolAttribute:()=>We,setDynamicProperty:()=>ye,setProperty:()=>ee,setRequestStore:()=>Xe,setServerMode:()=>_,setStyle:()=>re,setStyles:()=>dt,shouldSetAsProperty:()=>Cn,splitProps:()=>Pr,spread:()=>Rr,styleMap:()=>an,svg:()=>Vt,templateNode:()=>Tr,toAttributeName:()=>Sn,toggleClass:()=>Dn,waitForElement:()=>Kn});module.exports=Nn(so);function Sn(e){return e.startsWith("aria-")||e.startsWith("data-")?e:/[A-Z]/.test(e)?e.replace(/([A-Z])/g,"-$1").toLowerCase():e}function vn(e){return e.startsWith("@")||e.startsWith("on")&&e.length>2}function An(e){return e.startsWith("@")?e.slice(1):e.startsWith("on")?e.slice(2).toLowerCase():e}function Cn(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 Rn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mn=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"]),F="http://www.w3.org/2000/svg";function ft(e){return e.localName.includes("-")}function ae(e,t,n,r=!1){if(n==null){e.removeAttribute(t);return}if(ft(e)){e[t]=n;return}E(e,t,n,r)}var le=new Set(["className","value","checked","selected","innerHTML","innerText","textContent","indeterminate","htmlFor"]);function De(e,t=document){return t.querySelector(e)}function Pn(e,t=document){return Array.from(t.querySelectorAll(e))}function Ln(e,t){return e.closest(t)}function kn(e,...t){e.classList.add(...t)}function On(e,...t){e.classList.remove(...t)}function Dn(e,...t){t.forEach(n=>e.classList.toggle(n))}function _n(e,t){return e.classList.contains(t)}function E(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 $n(e,t){return e.getAttribute(t)}function In(e,t){e.removeAttribute(t)}function dt(e,t){Object.assign(e.style,t)}function qn(e,t){return window.getComputedStyle(e).getPropertyValue(t)}function jn(e,t={},...n){let r=document.createElement(e);return Object.entries(t).forEach(([o,s])=>{if(o==="class"||o==="className")r.className=s;else if(o==="style"&&typeof s=="object")dt(r,s);else if(o.startsWith("on")&&typeof s=="function"){let i=o.slice(2).toLowerCase();r.addEventListener(i,s)}else E(r,o,s)}),n.forEach(o=>{typeof o=="string"?r.appendChild(document.createTextNode(o)):r.appendChild(o)}),r}function Fn(e){for(;e.firstChild;)e.removeChild(e.firstChild)}function Hn(e,...t){t.forEach(n=>{typeof n=="string"?e.appendChild(document.createTextNode(n)):e.appendChild(n)})}function Vn(e){let t=e.getBoundingClientRect();return t.top>=0&&t.left>=0&&t.bottom<=window.innerHeight&&t.right<=window.innerWidth}function Wn(e,t={behavior:"smooth",block:"nearest"}){e.scrollIntoView(t)}function Un(e){let t=e.getBoundingClientRect();return{top:t.top+window.pageYOffset,left:t.left+window.pageXOffset}}function Bn(e,t,n,r){let o=s=>{let i=s.target.closest(n);i&&e.contains(i)&&r(s,i)};return e.addEventListener(t,o),()=>{e.removeEventListener(t,o)}}function Kn(e,t=5e3){return new Promise((n,r)=>{let o=De(e);if(o){n(o);return}let s=new MutationObserver(()=>{let a=De(e);a&&(s.disconnect(),clearTimeout(i),n(a))});s.observe(document.body,{childList:!0,subtree:!0});let i=setTimeout(()=>{s.disconnect(),r(new Error(`Element ${e} not found within ${t}ms`))},t)})}function zn(e,t,n={}){let r=new IntersectionObserver(o=>{o.forEach(s=>{t(s.isIntersecting)})},n);return r.observe(e),()=>{r.disconnect()}}function Gn(e,t){let n=new ResizeObserver(r=>{r.forEach(t)});return n.observe(e),()=>{n.disconnect()}}var Xn=typeof Symbol=="function"&&Symbol.for?Symbol.for("react.element"):60103;function Jn(e){return typeof e=="object"&&e!==null&&e.$$typeof===Xn}function pt(e){return e&&typeof e=="object"&&e.strings&&Array.isArray(e.strings)&&e.values&&Array.isArray(e.values)}function Yn(e){if(typeof e!="function")return!1;try{let t=e();return pt(t)}catch{return!1}}function Zn(e){return typeof e=="object"&&e!==null&&(e.$$typeof==="template"||typeof e.type=="function")}function Qn(e){return e instanceof Node}function er(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}var x=require("@fluixi/reactive/signal");var yt="1.0.0-alpha.72";var mt=require("@fluixi/reactive"),w={dom:yt,reactive:mt.VERSION};function gt(e){w.core&&e.setAttribute("fluixi",w.core),e.setAttribute("fx-dom",w.dom),e.setAttribute("fx-reactive",w.reactive),typeof globalThis<"u"&&(globalThis.Fluixi=w)}function ht(){let e=[w.core,w.dom,w.reactive].filter(t=>t!==void 0);new Set(e).size<=1||console.warn(`[fluixi] package versions disagree — core ${w.core??"(absent)"}, dom ${w.dom}, reactive ${w.reactive}. These ship as one release, so a mismatch usually means a stale lockfile or two copies resolved side by side. Reinstall, or check for duplicates with \`pnpm why @fluixi/dom\`.`)}function nr(e){return Object.defineProperty(e,Symbol.for("fluixi-router"),{value:!0,enumerable:!0}),e}function rr(e){return Object.defineProperty(e,Symbol.for("fluixi-routes"),{value:!0,enumerable:!0}),e}function or(e){return Object.defineProperty(e,Symbol.for("fluixi-route"),{value:!0,enumerable:!0}),e}function ir(e){return typeof e!="function"||Object.defineProperty(e,Symbol.for("fluixi-outlet"),{value:!0,enumerable:!0}),e}function sr(e){return Object.defineProperty(e,Symbol.for("fluixi-provider"),{value:!0,enumerable:!0}),e}function ar(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 cr(e){return Object.defineProperty(e,Symbol.for("fluixi-suspense"),{value:!0,enumerable:!0}),e}function xt(e){return typeof e=="function"&&e[Symbol.for("fluixi-router")]===!0}function Tt(e){return typeof e=="function"&&e[Symbol.for("fluixi-routes")]===!0}function bt(e){return typeof e=="function"&&e[Symbol.for("fluixi-route")]===!0}function Et(e){return typeof e=="function"&&e[Symbol.for("fluixi-outlet")]===!0}function wt(e){return typeof e=="function"&&e[Symbol.for("fluixi-provider")]===!0}function Nt(e){return typeof e=="function"&&e[Symbol.for("fluixi-context")]===!0}function N(e){return typeof e=="function"&&e[Symbol.for("fluixi-component")]===!0}function St(e){return typeof e=="function"&&e[Symbol.for("fluixi-suspense")]===!0}function ur(e){return xt(e)?{type:"router",value:e}:bt(e)?{type:"route",value:e}:Tt(e)?{type:"routes",value:e}:Et(e)?{type:"outlet",value:e}:N(e)?{type:"component",value:e}:St(e)?{type:"suspense",value:e}:wt(e)?{type:"provider",value:e}:Nt(e)?{type:"context",value:e}:{type:"none",value:e}}var d=require("@fluixi/reactive/signal");var g=typeof document>"u";function _(e){g=e}var J=Symbol.for("fluixi.server-node"),_e=null;function vt(e){_e=e}function H(){if(!_e)throw new Error("[fluixi] server render ran before @fluixi/dom/server loaded");return _e}function $(e){return e!=null&&e[J]===!0?!0:typeof Node<"u"&&e instanceof Node}function ce(e){return e!=null&&e[J]===!0?e.nodeType===1:typeof Element<"u"&&e instanceof Element}function ue(e){return e!=null&&e[J]===!0?e.nodeType===3:typeof Text<"u"&&e instanceof Text}var u={active:!1,cursor:null,parents:[]},At=null;function Ct(e){At=e}function fe(){return At}function $e(e,t){return u.active&&t.parentNode===e}function Ie(e){let t=u.parents.lastIndexOf(e);t!==-1&&(u.parents.length=t),u.cursor=e.nextSibling}function Rt(){return u.active?u.cursor:null}function Y(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 Mt(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 V(e){if(!u.active||e==null)return;let t=Array.isArray(e)?e[e.length-1]:e;t&&typeof t.nodeType=="number"&&Ie(t)}function fr(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 dr(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 pr(e){return dr(fr(e))}var yr=()=>"xxyxxxxxxy-4xx8".replace(/[xy]/g,function(e){let t=Math.random()*16|0;return(e==="x"?t:t&3|8).toString(16)}),mr={};var Pt=new Map,de=new Set,me=new Set(["scroll","focus","blur","load","error","resize","mouseenter","mouseleave","pointerenter","pointerleave","gotpointercapture","lostpointercapture"]);function je(e){if(!g)for(let t of e)de.has(t)||me.has(t)||(de.add(t),document.addEventListener(t,gr))}function gr(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 Lt(e,t,n){if(e[`$$${t}`]=n,me.has(t)){let r=`__fx_${t}`;if(!e[r]){let o=s=>{e[`$$${t}`]?.(s)};e.addEventListener(t,o),e[r]=o}return}de.has(t)||je([t])}function qe(e,t){delete e[`$$${t}`];let n=`__fx_${t}`,r=e[n];r&&(e.removeEventListener(t,r),delete e[n])}function hr(e){return!me.has(e)}function xr(e){return typeof e=="function"}function O(e,t=!1){if(g)return H().createText(e);if(u.active&&!t){let n=fe()?.hydrateText(e);if(n)return n}return document.createTextNode(e)}function Fe(e,t=!1){if(g)return H().createElement(e,t);if(u.active){let n=fe()?.hydrateElement(e);if(n)return n}return t?document.createElementNS(F,e):document.createElement(e)}function kt(e,t=!1){let n=Pt.get(e);if(n)return n;let r=document.createElement("template");return t?r.innerHTML=`<svg>${e}</svg>`:r.innerHTML=e,Pt.set(e,r),r}function Tr(e,t,n=!1,r=!1){if(g){let o=H();return n?o.parseTemplate(e,r):o.createRaw(e)}if(u.active){let o=fe()?.hydrateStatic(t);if(o)return o}return Ot(kt(e,r),r).firstChild}function br(e,t){if(!u.active)return t();let n=Y(e.nextSibling,t);if(typeof n=="function"){let r=n;return((...o)=>u.active?Y(e.nextSibling,()=>r(...o)):r(...o))}return n}function Er(e){for(let t=e.nextSibling;t;t=t.nextSibling)if(t.nodeType===8&&t.data==="fx/")return t;throw new Error("[fluixi] template hole is missing its closing marker")}function wr(e,t){let n=[];for(let r=e.nextSibling;r&&r!==t;r=r.nextSibling)n.push(r);return n}function Ot(e,t=!1){let n=e.content.cloneNode(!0);return t?n.firstChild:n}function Dt(e){return Array.isArray(e)?e.length===2&&e[1]===" "?Array.isArray(e[0])?Dt(e[0]):(typeof e[0]=="function",e[0]):e.length===1&&typeof e[0]=="function"?e[0]:e:e}function Nr(e){return typeof e!="function"?null:e._name||e.name||"anonymous"}function Sr(e){if((0,x.isSignal)(e)||N(e)||typeof e!="function")return e;let t=e();for(;typeof t=="function"&&!(0,x.isSignal)(t)&&!N(t);)t=t();return t}var L=0,vr=200;function Ar(e,t,n,r,o){let s=r,i=new Map;return(0,d.createRenderEffect)(()=>{let a;if(N(e)&&!(0,x.isSignal)(e)){if(!i.has(e)){L++;try{let l=e();i.set(e,l)}finally{L--}}for(a=i.get(e);typeof a=="function"&&(0,x.isSignal)(a);)a=a()}else for(a=e();typeof a=="function"&&(0,x.isSignal)(a);)a=a();{let l=0;for(;typeof a=="function"&&l++<50;)if(N(a)){if(!i.has(a)){let c=a;L++;try{let f=c();i.set(c,f)}finally{L--}}a=i.get(a)}else if((0,x.isSignal)(a))a=a();else if(a=a(),typeof a!="function"||!(0,x.isSignal)(a)&&!N(a))break}L++;try{s=Q(t,a,n,s,i),o(s)}finally{L--}})}function C(e,t,n,r){if(L>vr)return console.error("[insert] Exceeded max call depth — possible infinite loop."),()=>null;n!==void 0&&!n&&(n=O("",!0),e.appendChild(n));let o=r??null,s=l=>Array.isArray(l)&&l.some(c=>typeof c=="function"),i=l=>typeof l=="function"?l:()=>l;if(typeof t!="function"&&!s(t)){L++;try{o=Q(e,t,n,null)}finally{L--}return()=>o}let a=Ar(i(t),e,n,o,l=>{o=l});return()=>(a?.(),o)}function Q(e,t,n,r,o){if(t==null||typeof t=="boolean")return k(e,r,n);if(typeof t=="function")for(;typeof t=="function";)t=t();if(t==null||typeof t=="boolean")return k(e,r,n);if(Z(t)){let i=O("",!0);return Array.isArray(r)?r.length>0?(e.replaceChild(i,r[0]),k(e,r.slice(1),n)):T(e,i,n):r?e.replaceChild(i,r):T(e,i,n),t.then(a=>{i.parentNode===e&&Q(e,a,i.nextSibling,i)}).catch(a=>{console.error("Error resolving promise in insertExpression:",a)}),i}let s=typeof t;if(s==="string"||s==="number"){if(s==="number"&&(t=String(t)),Array.isArray(r)){if(r.length===0){let a=O(t);return T(e,a,n),a}if(r.length===1&&r[0].nodeType===3)return r[0].data=t,r;r=k(e,r,n)}if(r&&ue(r))return r.data=t,r;let i=O(t);return r&&r.parentNode===e?e.replaceChild(i,r):$e(e,i)||T(e,i,n),i}if($(t))return $e(e,t)?(Ie(t),t):Array.isArray(r)?(r.length===0?T(e,t,n):r[0].parentNode===e?(e.replaceChild(t,r[0]),k(e,r.slice(1),n)):T(e,t,n),t):(r?r!==t&&(r.parentNode===e?e.replaceChild(t,r):T(e,t,n)):T(e,t,n),t);if(Array.isArray(t)){let i=[],a=Array.isArray(r)?r:r?[r]:[],l=[];P(t,i,e,n,!0,o,l);let c=Cr(e,a,i,n);for(let f of l){let p=C(e,f.sig,f.marker);(0,d.onCleanup)(()=>{k(e,p()),f.marker.parentNode===e&&e.removeChild(f.marker)})}return c}if(s==="object"&&t!==null&&typeof t=="object"){let i=t;if("type"in i&&"props"in i){let a=i;if(typeof a.type=="function"){let l=a.type(a.props||{});return Q(e,l,n,r)}}}return k(e,r,n)}function P(e,t,n,r,o=!0,s,i){for(let a=0;a<e.length;a++){let l=e[a];if(!(l==null||typeof l=="boolean")){for(;typeof l=="function"&&!Z(l)&&!(0,x.isSignal)(l)&&!N(l)&&(l=l(),!(l==null||typeof l=="boolean")););if(!(l==null||typeof l=="boolean")){if(typeof l=="function"){let c;for(N(l)&&!(0,x.isSignal)(l)?(s||(s=new Map),s.has(l)||s.set(l,l()),c=s.get(l)):c=l();typeof c=="function"&&!Z(c)&&!(0,x.isSignal)(c)&&!N(c);)s||(s=new Map),s.has(c)||s.set(c,c()),c=s.get(c);if(c==null||typeof c=="boolean")continue;if(typeof c=="function"){if((0,x.isSignal)(c)){if(i){let p=O("",!0);t.push(p),i.push({marker:p,sig:c});continue}let f=c();for(;typeof f=="function"&&(0,x.isSignal)(f);)f=f();if(f==null||typeof f=="boolean")continue;Array.isArray(f)?P(f,t,n,r,o,s):P([f],t,n,r,o,s);continue}continue}Array.isArray(c)?P(c,t,n,r,o,s,i):P([c],t,n,r,o,s,i);continue}if(Z(l)){let c=O("",!0);t.push(c),l.then(f=>{if(c.parentNode){let p=[];if(P([f],p,c.parentNode,void 0,!1,s),p.length>0){c.parentNode.replaceChild(p[0],c);for(let y=1;y<p.length;y++)c.parentNode?.insertBefore(p[y],p[y-1].nextSibling)}}}).catch(f=>console.error("Error resolving promise in array:",f));continue}if(Array.isArray(l)){P(l,t,n,r,o,s,i);continue}if($(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)?P(f,t,n,r,!1,s):P([f],t,n,r,!1,s);continue}}if(typeof l=="string"||typeof l=="number"){let c=String(l);if(c.trim()===""&&c!==" ")continue;t.push(O(c));continue}t.push(O(String(l)))}}}}function Cr(e,t,n,r){for(let p=0;p<n.length;p++)n[p].parentNode!==null&&n[p].parentNode!==e&&(n=n.slice(),n[p]=n[p].cloneNode(!0));let o=n.length,s=t.length,i=o,a=0,l=0,c=s>0?t[s-1].nextSibling??void 0:r,f=null;for(;a<s||l<i;){if(t[a]===n[l]){a++,l++;continue}for(;s>a&&i>l&&t[s-1]===n[i-1];)s--,i--;if(s===a){let p=i<o?l?n[l-1].nextSibling??void 0:n[i-l]:c;for(;l<i;)T(e,n[l++],p)}else if(i===l)for(;a<s;)(!f||!f.has(t[a]))&&t[a].parentNode===e&&e.removeChild(t[a]),a++;else if(t[a]===n[i-1]&&n[l]===t[s-1]){let p=t[--s].nextSibling;T(e,n[l++],t[a++].nextSibling),T(e,n[--i],p),t[s]=t[a-1]}else{if(!f){f=new Map;let y=l;for(;y<i;)f.set(n[y],y++)}let p=f.get(t[a]);if(p!=null)if(l<p&&p<i){let y=a,m=1;for(;++y<s&&y<i&&!(!f.has(t[y])||f.get(t[y])!==p+m);)m++;if(m>p-l){let Le=t[a];for(;l<p;)T(e,n[l++],Le)}else t[a].parentNode===e?e.replaceChild(n[l++],t[a++]):(T(e,n[l++],c),a++)}else a++;else t[a].parentNode===e&&e.removeChild(t[a]),a++}}return n}function k(e,t,n){if(t)if(Array.isArray(t))for(let r=0;r<t.length;r++)t[r].parentNode===e&&e.removeChild(t[r]);else t.parentNode===e&&e.removeChild(t);return null}function T(e,t,n){u.active&&t.parentNode===e||(n&&n.parentNode===e?e.insertBefore(t,n):e.appendChild(t))}function ee(e,t,n){n==null?delete e[t]:e[t]=n}function He(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 Ve(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 pe(e,t,n,r=!1){return typeof n!="function"?(E(e,t,n,r),()=>{}):(0,d.createRenderEffect)(()=>{let o=typeof n=="function"?n():n;E(e,t,o,r)})}function ye(e,t,n){return typeof n!="function"?(ee(e,t,n),()=>{}):(0,d.createRenderEffect)(()=>{let r=typeof n=="function"?n():n;ee(e,t,r)})}function We(e,t,n){return typeof n!="function"?(E(e,t,!!n),()=>{}):(0,d.createRenderEffect)(()=>{let r=n();E(e,t,!!r)})}function te(e,t){if(t==null){e.removeAttribute("class");return}if(typeof t=="function"){(0,d.createRenderEffect)(()=>te(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 ne(e,t,n){if(!(!t||typeof t!="object"))for(let r in t){let o=t[r],s=r.split(/\s+/).filter(Boolean);if(typeof o=="function"&&n)n.push((0,d.createRenderEffect)(()=>{let i=!!o();for(let a of s)e.classList.toggle(a,i)}));else{let i=!!(typeof o=="function"?o():o);for(let a of s)e.classList.toggle(a,i)}}}function re(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 Rr(e){let{element:t,props:n,prevProps:r=mr,isSVG:o=!1,skipChildren:s=!1}=e;if(!t||!ce(t))return console.error("[spread] Error: element is not a DOM Element!"),()=>{};if(!n)return console.warn("[spread] Warning: props is undefined!"),()=>{};let i=o||t.namespaceURI===F,a=[];for(let l in n){if(s&&l==="children")continue;let c=n[l],f=r[l];if(c===f)continue;if(l==="ref"){oe(c,t);continue}if(l==="use"){Ve(t,c);continue}if(l.startsWith("on:")){a.push(He(t,l.slice(3),c));continue}if(l.startsWith("prop:")){a.push(ye(t,l.slice(5),c));continue}if(l.startsWith("attr:")){a.push(pe(t,l.slice(5),c,i));continue}if(l.startsWith("bool:")){a.push(We(t,l.slice(5),c));continue}if(l==="class"||l==="className"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>te(t,c()))):te(t,c);continue}if(l==="classList"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>ne(t,c()))):ne(t,c,a);continue}if(l==="style"){typeof c=="function"?a.push((0,d.createRenderEffect)(()=>re(t,c()))):re(t,c);continue}if(l.startsWith("on")){let y=l.slice(2).toLowerCase();f&&qe(t,y),c&&Lt(t,y,c);continue}let p=le.has(l)||!i&&l in t;typeof c=="function"?a.push(p?ye(t,l,c):pe(t,l,c,i)):a.push((0,d.createRenderEffect)(()=>p?ee(t,l,n[l]):E(t,l,n[l],i)))}for(let l in r)if(!(l in n))if(l.startsWith("on")){let c=l.slice(2).toLowerCase();qe(t,c)}else le.has(l)?ee(t,l,null):t.removeAttribute(l);return()=>{a.forEach(l=>l())}}function Ue(e,t,n=!1){for(let r in t){let o=t[r];if(r==="ref"){oe(o,e);continue}if(r!=="children"){if(r==="use"){Ve(e,o);continue}if(r.startsWith("on:")){He(e,r.slice(3),o);continue}if(r.startsWith("prop:")){ye(e,r.slice(5),o);continue}if(r.startsWith("attr:")){pe(e,r.slice(5),o,n);continue}if(r.startsWith("bool:")){We(e,r.slice(5),o);continue}if(r.startsWith("on")&&r.length>2){let s=r.slice(2).toLowerCase();if(typeof o=="function")if(me.has(s)){e[`$$${s}`]=o;let i=`__fx_${s}`;if(!e[i]){let a=l=>{e[`$$${s}`]?.(l)};e.addEventListener(s,a),e[i]=a}}else e[`$$${s}`]=o,de.has(s)||je([s]);continue}if(r==="class"||r==="className"){te(e,o);continue}if(r==="classList"){typeof o=="function"?(0,d.createRenderEffect)(()=>ne(e,o())):ne(e,o);continue}if(r==="style"){typeof o=="function"?(0,d.createRenderEffect)(()=>re(e,o())):re(e,o);continue}if(r==="innerHTML"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function";)i=i();e.innerHTML=i});(0,d.onCleanup)(()=>s())}else e.innerHTML=o;continue}if(r==="value"&&(e.tagName==="INPUT"||e.tagName==="TEXTAREA")){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.value=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.value=t[r]??"")});continue}if(r==="checked"&&e.tagName==="INPUT"){if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();document.activeElement!==e&&(e.checked=i??"")});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>{document.activeElement!==e&&(e.checked=t[r]??"")});continue}if(r==="value"&&e.tagName==="SELECT"){if(typeof o=="function"){let s=!0,i=(0,d.createEffect)(()=>{let a=o();for(;typeof a=="function"&&a.length===0;)a=a();s?(s=!1,queueMicrotask(()=>{e.value=a??""})):e.value=a??""});(0,d.onCleanup)(()=>{i()})}else{let s=!0;(0,d.createRenderEffect)(()=>{let i=t[r];s?(s=!1,queueMicrotask(()=>{e.value=i??""})):e.value=i??""})}continue}if(typeof o=="function"){let s=(0,d.createEffect)(()=>{let i=o();for(;typeof i=="function"&&i.length===0;)i=i();ae(e,r,i,n)});(0,d.onCleanup)(()=>{s()})}else(0,d.createRenderEffect)(()=>ae(e,r,t[r],n))}}}function Mr(...e){let t=r=>{for(let o=e.length-1;o>=0;o--){let s=e[o];if(s&&r in s&&s[r]!==void 0)return s[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 s of Reflect.ownKeys(o))r.add(s);return[...r]},getOwnPropertyDescriptor:(r,o)=>n(o)?{enumerable:!0,configurable:!0,get:()=>t(o)}:void 0})}function Pr(e,...t){let n=new Set;for(let i of t)for(let a of i)n.add(a);let r=i=>({enumerable:!0,configurable:!0,get:()=>e[i]}),o=t.map(i=>{let a=new Set(i);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})}),s=new Proxy({},{get:(i,a)=>n.has(a)?void 0:e[a],has:(i,a)=>!n.has(a)&&a in e,ownKeys:()=>Reflect.ownKeys(e).filter(i=>!n.has(i)),getOwnPropertyDescriptor:(i,a)=>!n.has(a)&&a in e?r(a):void 0});return[...o,s]}function oe(e,t){if(e){if($(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 Lr(e,t,n){let r=t||document.body,o=(0,d.readChildren)(()=>e),s=[];return(0,d.batch)(()=>{let i=(0,d.createRenderEffect)(()=>{let a=o();Array.isArray(a)?(a.forEach(l=>r.appendChild(l)),s.push(()=>{a.forEach(l=>{l.parentNode===r&&r.removeChild(l)})})):$(a)&&(r.appendChild(a),s.push(()=>{a.parentNode===r&&r.removeChild(a)}))});s.push(i),(0,d.onCleanup)(()=>{s.forEach(a=>a())})}),null}function kr(e){return typeof e=="string"&&e.toLowerCase()===e}function Be(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 Or(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 Dr(e){return typeof e=="function"&&e.length===0&&(0,x.isSignal)(e)}function Ke(e,t,n){if(!t)throw new Error("Container element is required");let r,o,s=[];return(0,d.createRoot)(i=>{(0,d.batch)(()=>{u.active||(t.textContent=""),gt(t),ht(),C(t,e)}),o=i}),()=>{o?.(),r?.(),s.forEach(i=>i()),t.textContent=""}}var _r="__fx_dom_create_component__",I=globalThis[_r]??={fn:null};function $r(e){I.fn=e}function Ir(e={}){let t=e.signalSystem?.createComponent;t&&(I.fn=t)}function ze(e,t){return I.fn?I.fn(e,t):(()=>e(t))}var qr=()=>I.fn!==null,jr=()=>I.fn!==null;function Fr(){I.fn=null}var ge,$t={getStore:()=>ge,run(e,t){let n=ge;ge=e;try{return t()}finally{ge=n}}},Ge=$t;function Xe(e){Ge=e??$t}function W(e={}){e.locals||(e.locals=e.request?xe(e.request):{});let t=0,n=0,r=null,o=new Map,s=new Map;return{event:e,routeData:new Map,matchedRoute:new Map,nextId:()=>`s${t++}`,nextResourceId:()=>{if(r===null)return`r${n++}`;let i=o.get(r)??0;return o.set(r,i+1),`${r}:r${i}`},nextIslandNamespace:i=>{let a=s.get(i)??0;return s.set(i,a+1),`${i}#${a}`},withResourceScope(i,a){let l=r;r=i;try{return a()}finally{r=l}},pending:new Set,data:new Map}}function U(e,t){return Ge.run(e,t)}function R(){return Ge.getStore()}function he(){return R()?.event}function Je(){let e=he();return e?(e.locals||(e.locals={}),e.locals):{}}var _t=new WeakMap;function xe(e){let t=_t.get(e);return t||(t={},_t.set(e,t)),t}var Te=require("@fluixi/reactive/signal");var B="__FX_DATA__";function ie(e){return e.replace(/[<>&\u2028\u2029]/g,t=>"\\u"+t.charCodeAt(0).toString(16).padStart(4,"0"))}var Ye;function se(){let e=globalThis.__FX_DATA__;if(e)return e;if(Ye!==void 0)return Ye;let t=null;if(typeof document<"u"){let n=document.getElementById(B)?.textContent;if(n)try{t=JSON.parse(n)}catch{t=null}}return Ye=t}function be(){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 Hr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Ee=typeof process<"u"&&process.env&&!1;function we(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 Vr(e){be();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(Hr.has(e.toLowerCase())?u.cursor=t.nextSibling:(u.parents.push(t),u.cursor=t.firstChild),t):(Ee&&t&&we(`<${e}>`,t),null)}function Wr(e){be();let t=u.cursor;return t&&t.nodeType===1&&t.tagName.toLowerCase()===e.toLowerCase()?(u.cursor=t.nextSibling,t):(Ee&&t&&we(`<${e}> (static)`,t),null)}function Ur(e){if(e===""){let n=u.cursor;return n&&n.nodeType===3&&n.data!==""?(u.cursor=n.nextSibling,n.data="",n):null}be();let t=u.cursor;return t&&t.nodeType===3?(u.cursor=t.nextSibling,t.nodeValue!==e&&(t.nodeValue=e),t):(Ee&&t&&we(`text ${JSON.stringify(e.slice(0,24))}`,t),null)}function Br(e){be();let t=u.cursor;return t&&t.nodeType===8&&t.data===e?(u.cursor=t.nextSibling,t):(Ee&&t&&we(`marker <!--${e.slice(0,24)}-->`,t),null)}var It=!1;function Kr(){It||(It=!0,Ct({hydrateElement:Vr,hydrateText:Ur,hydrateMarker:Br,hydrateStatic:Wr}))}function Ne(e,t,n){Kr(),u.active=!0,u.cursor=t.firstChild,u.parents=[];let r=se(),o=n?.resourceNamespace,s=0;(0,Te.setResourceIdSource)(()=>o?`${o}:r${s++}`:`r${s++}`),(0,Te.setServerDataGetter)(r?i=>i in r?{value:r[i]}:void 0:null);try{return Ke(e,t)}finally{u.active=!1,u.cursor=null,u.parents=[]}}var Ze="fluixi-island";function jt(e){let{component:t,props:n={},name:r}=e,o=Fe(Ze),s=r??t.name??"Island";E(o,"name",s),E(o,"props",JSON.stringify(n??{}));let i=g?R():void 0;if(i){let a=i.nextIslandNamespace(s);C(o,()=>i.withResourceScope(a,()=>t(n)))}else C(o,()=>t(n));return o}var qt=!1;function zr(){if(qt||typeof document>"u")return;qt=!0;let e=document.createElement("style");e.textContent=`${Ze}{display:contents}`,document.head.appendChild(e)}function Ft(e){if(typeof document>"u")return;zr();let t=document.querySelectorAll(Ze),n=new Map;t.forEach(r=>{let o=r.getAttribute("name")??"",s=n.get(o)??0;n.set(o,s+1);let i=e[o];if(!i){typeof process>"u"&&console.warn(`[fluixi] island "${o}" has no component in the registry — left static.`);return}let a={};try{a=JSON.parse(r.getAttribute("props")||"{}")}catch{}Ne(()=>i(a),r,{resourceNamespace:`${o}#${s}`})})}function Ht(e,...t){throw new Error("html`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}function Vt(e,...t){throw new Error("svg`` was not compiled — enable the lit format: fluixi({ format: 'lit' }).")}var Wt=require("@fluixi/reactive/signal");function Gr(e,t={}){if(typeof e=="function")return ze(e,t);if(typeof e!="string"||e.length===0)return null;let n=Be(e);if(g)return H().createElement(e,n);let r=n?document.createElementNS(F,e):document.createElement(e);return Ue(r,t,n),Xr(r,t),r}function Xr(e,t){if(!t||t.children===void 0)return;let n=(0,Wt.readChildren)(()=>t.children),r=o=>{C(e,o,typeof o=="function"?null:void 0)};Array.isArray(n)?n.forEach(r):r(n)}var h=require("@fluixi/reactive/signal");function Ut(e){return typeof e=="function"?e:(()=>e)}function D(e){return()=>{let t=e();return typeof t=="function"?t():t}}function Bt(e){return e!=null&&e!==!1}function Kt(e){return!e||typeof e!="object"?!1:!!(typeof e._$litType$<"u"||typeof e._$litDirective$<"u"||Array.isArray(e.strings)&&Array.isArray(e.values))}function zt(e){let t=D(()=>e.when),n=(0,h.createMemo)(t,void 0),r=(0,h.createMemo)(n,void 0),o=(0,h.getOwner)(),s=null,i=null,a=l=>{l!==i&&(s&&(0,h.disposeScope)(s),s=(0,h.createChildOwner)(o),i=l)};return(0,h.createMemo)(()=>{let l=r();return a(l?"when":"fallback"),(0,h.runWithOwner)(s,()=>{if(l){let c=e.children;return typeof c=="function"&&!Kt(c)?typeof n=="function"?(0,h.untrack)(()=>(0,h.untrack)(n)?c(n()):e.fallback):c(n):c}return e.fallback});return e.fallback??null},void 0,{name:"show"})}var Se=require("@fluixi/reactive/signal");function Gt(e){let t=D(()=>e.each),n=()=>e.fallback??null,r=(o,s)=>{let i=e.children,a=Array.isArray(i)?i.map(l=>typeof l=="function"?l(o,s):l):typeof i=="function"?i(o,s):i;return V(a),a};return e.by?(0,Se.keyArray)(t,e.by,(o,s)=>r(o,s),{fallback:n}):(0,Se.mapArray)(t,(o,s)=>r(o,s),{fallback:n})}var Xt=require("@fluixi/reactive/signal");function Jt(e){let t=D(()=>e.each);return(0,Xt.indexArray)(t,(n,r)=>{let o=e.children(n,r);return V(o),o},{fallback:()=>e.fallback??null})}var K=require("@fluixi/reactive/signal");var S=require("@fluixi/reactive/signal");var Qe=Symbol("match");function Yt(e){return{[Qe]:!0,when:D(()=>e.when),get children(){return e.children}}}function Zt(e){let t=Array.isArray(e.children)?e.children:[e.children],n=(0,S.getOwner)(),r=null,o=-1,s=i=>{i!==o&&(r&&(0,S.disposeScope)(r),r=(0,S.createChildOwner)(n),o=i)};return(0,S.createMemo)(()=>{for(let i=0;i<t.length;i+=1){let l=t[i],c=0;for(;typeof l=="function"&&!l[Qe]&&c++<10;)l=l();if(!l||typeof l!="object"||l[Qe]!==!0)continue;let f=l.when();if(Bt(f))return s(i),(0,S.runWithOwner)(r,()=>typeof l.children=="function"?l.children(f):l.children)}return s(-2),(0,S.runWithOwner)(r,()=>e.fallback??null)})}var M=require("@fluixi/reactive/signal");function Qt(e){let t=Ut(e.component),{component:n,...r}=e,o=(0,M.getOwner)(),s=null,i;return(0,M.createMemo)(()=>{let a=t();return a!==i&&(s&&(0,M.disposeScope)(s),s=(0,M.createChildOwner)(o),i=a),a==null?null:typeof a=="string"?{tag:a,props:r}:(0,M.runWithOwner)(s,()=>a(r))})}var ve=require("@fluixi/reactive/signal");function en(e){let t=()=>e.mount?typeof e.mount=="function"?e.mount():e.mount:document.body,n,r;return(0,ve.createRoot)(o=>{n=o,r=document.createElement("div"),r.style.display="contents",t().appendChild(r),C(r,e.children)&&oe(e.ref,r)}),(0,ve.onCleanup)(()=>{n(),r.remove()}),null}var Ae=require("@fluixi/reactive/signal");function et(e){if(g)return e.fallback??null;let t=u.active,[n,r]=(0,Ae.createSignal)(!t);return t&&queueMicrotask(()=>r(!0)),(0,Ae.createMemo)(()=>n()?e.children:e.fallback??null,void 0,{name:"client-only"})}var tn=et;var Ce=require("@fluixi/reactive/signal");function nn(e){let[t,n]=(0,Ce.createSignal)(null),r=()=>n(null);return(0,Ce.createMemo)(()=>{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(s){return n(s),typeof e.fallback=="function"?e.fallback(s,r):e.fallback}})}var rn=require("@fluixi/reactive/signal");function on(e){return(0,rn.createMemo)(()=>{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(" ")})}var sn=require("@fluixi/reactive/signal");function Jr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`)}function an(e){return(0,sn.createMemo)(()=>{let t=typeof e=="function"?e():e,n=[];for(let[r,o]of Object.entries(t)){if(!r)continue;let s=typeof o=="function"?o():o;s!=null&&n.push(`${Jr(r)}: ${s}`)}return n.join("; ")})}var Me=1,rt=3,ot=8,ln;ln=J;var z=class{constructor(){this[ln]=!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(){}},q=class e extends z{constructor(n){super();this.nodeType=rt;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)}},Re=class e extends z{constructor(n){super();this.nodeType=Me;this.rawOuterHTML=n}get textContent(){return this.rawOuterHTML.replace(/<[^>]*>/g,"")}cloneNode(){return new e(this.rawOuterHTML)}},G=class e extends z{constructor(n){super();this.nodeType=ot;this.data=n}get nodeValue(){return this.data}set nodeValue(n){this.data=n==null?"":String(n)}cloneNode(){return new e(this.data)}},tt=class{constructor(){this.cssText=""}setProperty(t,n){this[t]=n}removeProperty(t){delete this[t]}},nt=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}},j=class e extends z{constructor(n,r=!1){super();this.nodeType=Me;this.attributes=new Map;this.style=new tt;this.classList=new nt(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 q(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 Yr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),un=/&/g,fn=/</g,dn=/>/g,Zr=/"/g;function it(e){return e.replace(un,"&").replace(fn,"<").replace(dn,">")}function cn(e){return e.replace(un,"&").replace(Zr,""").replace(fn,"<").replace(dn,">")}function Qr(e){return e.startsWith("--")?e:e.replace(/[A-Z]/g,t=>"-"+t.toLowerCase())}function eo(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(`${Qr(n)}: ${r}`)}return t.join("; ")}function to(e){let t="",n=eo(e.style);for(let[r,o]of e.attributes)r==="style"&&n||(t+=` ${r}="${cn(o)}"`);if(n){let r=e.attributes.get("style"),o=r?`${r.replace(/;\s*$/,"")}; ${n}`:n;t+=` style="${cn(o)}"`}return t}function v(e){if(e==null||e===!1||e===!0)return"";if(typeof e=="string")return it(e);if(typeof e=="number")return it(String(e));if(typeof e=="function")return v(e());if(Array.isArray(e))return e.map(v).join("");if(typeof e.rawOuterHTML=="string")return e.rawOuterHTML;switch(e.nodeType){case rt:return it(e.data??"");case ot:return`<!--${e.data??""}-->`;case Me:{let t=e.localName,n=`<${t}${to(e)}>`;if(Yr.has(t))return n;let r=e.rawHTML!=null?e.rawHTML:(e.childNodes??[]).map(v).join("");return`${n}${r}</${t}>`}}return Array.isArray(e.childNodes)?e.childNodes.map(v).join(""):""}var at=require("@fluixi/reactive/signal"),b=require("@fluixi/reactive/signal");var no=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),ro={amp:"&",lt:"<",gt:">",quot:'"',"#39":"'"};function pn(e){return e.replace(/&(#?\w+);/g,(t,n)=>ro[n]??t)}var A=class extends Error{};function yn(e,t=!1){let n=0,r=[],o=[],s=c=>{let f=o[o.length-1];f?f.appendChild(c):r.push(c)};for(;n<e.length;){let c=e.indexOf("<",n);if(c===-1){a(e.slice(n));break}if(c>n&&a(e.slice(n,c)),e.startsWith("<!--",c)){let f=e.indexOf("-->",c);if(f===-1)throw new A(`unterminated comment at ${c}`);s(new G(e.slice(c+4,f))),n=f+3;continue}if(e[c+1]==="/"){let f=e.indexOf(">",c);if(f===-1)throw new A(`unterminated closing tag at ${c}`);let p=e.slice(c+2,f).trim().toLowerCase(),y=o.pop();if(!y||y.localName!==p)throw new A(`</${p}> does not close <${y?.localName??"nothing"}>`);n=f+1;continue}n=l(c)}if(o.length>0)throw new A(`unclosed <${o[o.length-1].localName}>`);let i=r[0];if(r.length!==1||!(i instanceof j))throw new A(`expected exactly one root element, got ${r.length}`);return i;function a(c){c!==""&&s(new q(pn(c)))}function l(c){let f=/[\s/>]/.exec(e.slice(c+1));if(!f)throw new A(`unterminated tag at ${c}`);let p=e.slice(c+1,c+1+f.index).toLowerCase(),y=new j(p,t),m=c+1+f.index;for(;m<e.length;){for(;m<e.length&&/\s/.test(e[m]);)m++;if(e[m]===">"){m++;break}if(e[m]==="/"&&e[m+1]===">"){m+=2;break}let Le=m;for(;m<e.length&&!/[\s=/>]/.test(e[m]);)m++;let X=e.slice(Le,m);if(X==="")throw new A(`malformed attribute at ${m}`);if(e[m]==="="){if(e[m+1]!=='"')throw new A(`attribute ${X} must have a double-quoted value`);let ke=e.indexOf('"',m+2);if(ke===-1)throw new A(`unterminated value for ${X}`);y.setAttribute(X,pn(e.slice(m+2,ke))),m=ke+1}else y.setAttribute(X,"")}return s(y),no.has(p)||o.push(y),m}}var mn=!1;function hn(){mn||(mn=!0,vt({createElement:(e,t)=>new j(e,t),createText:e=>new q(e),createRaw:e=>new Re(e),parseTemplate:(e,t)=>yn(e,t),createComment:e=>new G(e)}))}function lt(e,t={}){let n=g;hn(),_(!0);let r=W(t.event);try{return U(r,()=>(0,at.createRoot)(o=>{try{let s=typeof e=="function"?e():e;return v(s)}finally{o()}}))}finally{_(n)}}var gn=!1;function oo(){gn||(gn=!0,(0,b.setResourceTracker)(e=>{R()?.pending.add(e)}),(0,b.setResourceIdSource)(()=>R()?.nextResourceId()??""),(0,b.setResourceDataSink)((e,t)=>{e&&R()?.data.set(e,t)}))}var st=null;function ct(e){st=e}function Pe(e){if(e.data.size===0)return"";let t={};for(let[r,o]of e.data){let s=o;if(st)try{s=st(o,r)}catch{continue}s!==void 0&&(t[r]=s)}if(Object.keys(t).length===0)return"";let n=ie(JSON.stringify(t));return`<script type="application/json" id="${B}">${n}<\/script>`}var io=50;async function ut(e,t={}){let n=g;hn(),_(!0),oo();let r=W(t.event);try{return await U(r,async()=>{t.preload&&await t.preload(t.event);let o,s=null,i=()=>{};(0,at.createRoot)(f=>{i=f,s=(0,b.getOwner)(),o=typeof e=="function"?e():e});let a=()=>{try{(0,b.runWithOwner)(s,()=>v(o))}catch{}};a();let l=0;for(;r.pending.size>0&&l++<io;){let f=Array.from(r.pending);r.pending.clear(),await Promise.allSettled(f),await(0,b.flush)(),a()}let c=(0,b.runWithOwner)(s,()=>v(o))+Pe(r);return i(),c})}finally{_(n)}}
|