@mateosuarezdev/flash 0.0.14 → 0.0.16
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/framework.cjs +11 -0
- package/dist/framework.d.ts +53 -0
- package/dist/framework.js +32 -0
- package/dist/index-BkDMcLYE.cjs +11 -0
- package/dist/index-GxoBoxj9.js +47 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +148 -179
- package/dist/jsx-dev-runtime.cjs +1 -1
- package/dist/jsx-dev-runtime.js +3 -3
- package/dist/jsx-runtime.cjs +1 -1
- package/dist/jsx-runtime.js +43 -5
- package/dist/{server-context-CJbtcTMO.js → server-context-giztFmxM.js} +2 -2
- package/dist/server.js +1 -1
- package/dist/vnode-tracking-BAFaVke9.js +25 -0
- package/dist/vnode-tracking-DC68rWms.cjs +11 -0
- package/package.json +6 -1
- package/dist/jsx-dev-runtime-C5Q23IsT.cjs +0 -11
- package/dist/jsx-dev-runtime-dAReTOgq.js +0 -65
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Flash
|
|
4
|
+
* Copyright (c) 2025 Mateo Suarez. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Free to use in your own personal or commercial applications and projects.
|
|
7
|
+
* Unauthorized copying, modification, or distribution is strictly prohibited.
|
|
8
|
+
* See LICENSE file for full terms.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index-BkDMcLYE.cjs"),c="es",u=e.createContext(c);function i(){return e.useContext(u)}const s=e.createContext(null);function S(o){const t=e.useContext(s);if(!t)throw new Error("setSeo must be used within SeoProvider");Object.entries(o).forEach(([r,n])=>{n!==void 0&&(t.current[r]=n)})}function f(){return typeof document>"u"?"<!--FLASH_SEO-->":null}exports.Seo=f;exports.getLang=i;exports.setSeo=S;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Flash
|
|
4
|
+
* Copyright (c) 2025 Mateo Suarez. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Free to use in your own personal or commercial applications and projects.
|
|
7
|
+
* Unauthorized copying, modification, or distribution is strictly prohibited.
|
|
8
|
+
* See LICENSE file for full terms.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Get the current language from context.
|
|
13
|
+
*
|
|
14
|
+
* @returns The current language
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* function MyComponent() {
|
|
18
|
+
* const lang = getLang();
|
|
19
|
+
* return <p>{lang === 'es' ? 'Hola' : 'Hello'}</p>;
|
|
20
|
+
* }
|
|
21
|
+
*/
|
|
22
|
+
export declare function getLang(): Lang;
|
|
23
|
+
|
|
24
|
+
declare type Lang = "es" | "en";
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Marks where SEO meta tags will be injected during SSR.
|
|
28
|
+
* Must be placed inside <head> tag.
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* <html>
|
|
32
|
+
* <head>
|
|
33
|
+
* <Seo />
|
|
34
|
+
* <link rel="stylesheet" href="/style.css" />
|
|
35
|
+
* </head>
|
|
36
|
+
* <body>...</body>
|
|
37
|
+
* </html>
|
|
38
|
+
*/
|
|
39
|
+
export declare function Seo(): "<!--FLASH_SEO-->" | null;
|
|
40
|
+
|
|
41
|
+
export declare type SeoData = {
|
|
42
|
+
title?: string;
|
|
43
|
+
description?: string;
|
|
44
|
+
keywords?: string;
|
|
45
|
+
ogImage?: string;
|
|
46
|
+
ogType?: string;
|
|
47
|
+
canonicalUrl?: string;
|
|
48
|
+
noindex?: boolean;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export declare function setSeo(updates: SeoData): void;
|
|
52
|
+
|
|
53
|
+
export { }
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Flash
|
|
4
|
+
* Copyright (c) 2025 Mateo Suarez. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Free to use in your own personal or commercial applications and projects.
|
|
7
|
+
* Unauthorized copying, modification, or distribution is strictly prohibited.
|
|
8
|
+
* See LICENSE file for full terms.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { u as n, c as o } from "./index-GxoBoxj9.js";
|
|
12
|
+
const s = "es", u = o(s);
|
|
13
|
+
function S() {
|
|
14
|
+
return n(u);
|
|
15
|
+
}
|
|
16
|
+
const i = o(null);
|
|
17
|
+
function d(r) {
|
|
18
|
+
const e = n(i);
|
|
19
|
+
if (!e)
|
|
20
|
+
throw new Error("setSeo must be used within SeoProvider");
|
|
21
|
+
Object.entries(r).forEach(([c, t]) => {
|
|
22
|
+
t !== void 0 && (e.current[c] = t);
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
function l() {
|
|
26
|
+
return typeof document > "u" ? "<!--FLASH_SEO-->" : null;
|
|
27
|
+
}
|
|
28
|
+
export {
|
|
29
|
+
l as Seo,
|
|
30
|
+
S as getLang,
|
|
31
|
+
d as setSeo
|
|
32
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Flash
|
|
4
|
+
* Copyright (c) 2025 Mateo Suarez. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Free to use in your own personal or commercial applications and projects.
|
|
7
|
+
* Unauthorized copying, modification, or distribution is strictly prohibited.
|
|
8
|
+
* See LICENSE file for full terms.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
"use strict";const o=require("./vnode-tracking-DC68rWms.cjs"),d=require("./server-context-C7Uxb3AS.cjs");function u(t){const n=Symbol("context");return{_id:n,_defaultValue:t,provide(e){if(typeof document>"u"){d.provideServerContext(n,e);return}const r=o.getCurrentVNode();if(!r)throw new Error("context.provide() called outside of component render");r._contextMap||(r._contextMap=new Map),r._contextMap.set(n,e)}}}function i(t){if(typeof document>"u")return d.consumeServerContext(t._id,t._defaultValue);const n=o.getCurrentVNode();if(!n)throw new Error("useContext called outside of component render");let e=n;for(;e;){if(e.kind==="VNode"&&e._contextMap?.has(t._id))return e._contextMap.get(t._id);e=e._parent}return t._defaultValue}exports.createContext=u;exports.useContext=i;
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Flash
|
|
4
|
+
* Copyright (c) 2025 Mateo Suarez. All rights reserved.
|
|
5
|
+
*
|
|
6
|
+
* Free to use in your own personal or commercial applications and projects.
|
|
7
|
+
* Unauthorized copying, modification, or distribution is strictly prohibited.
|
|
8
|
+
* See LICENSE file for full terms.
|
|
9
|
+
*/
|
|
10
|
+
|
|
11
|
+
import { g as n } from "./vnode-tracking-BAFaVke9.js";
|
|
12
|
+
import { p as d, c as u } from "./server-context-giztFmxM.js";
|
|
13
|
+
function c(t) {
|
|
14
|
+
const r = Symbol("context");
|
|
15
|
+
return {
|
|
16
|
+
_id: r,
|
|
17
|
+
_defaultValue: t,
|
|
18
|
+
provide(e) {
|
|
19
|
+
if (typeof document > "u") {
|
|
20
|
+
d(r, e);
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
const o = n();
|
|
24
|
+
if (!o)
|
|
25
|
+
throw new Error("context.provide() called outside of component render");
|
|
26
|
+
o._contextMap || (o._contextMap = /* @__PURE__ */ new Map()), o._contextMap.set(r, e);
|
|
27
|
+
}
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
function f(t) {
|
|
31
|
+
if (typeof document > "u")
|
|
32
|
+
return u(t._id, t._defaultValue);
|
|
33
|
+
const r = n();
|
|
34
|
+
if (!r)
|
|
35
|
+
throw new Error("useContext called outside of component render");
|
|
36
|
+
let e = r;
|
|
37
|
+
for (; e; ) {
|
|
38
|
+
if (e.kind === "VNode" && e._contextMap?.has(t._id))
|
|
39
|
+
return e._contextMap.get(t._id);
|
|
40
|
+
e = e._parent;
|
|
41
|
+
}
|
|
42
|
+
return t._defaultValue;
|
|
43
|
+
}
|
|
44
|
+
export {
|
|
45
|
+
c,
|
|
46
|
+
f as u
|
|
47
|
+
};
|
package/dist/index.cjs
CHANGED
|
@@ -8,4 +8,4 @@
|
|
|
8
8
|
* See LICENSE file for full terms.
|
|
9
9
|
*/
|
|
10
10
|
|
|
11
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const d=require("./jsx-dev-runtime-C5Q23IsT.cjs"),L=require("./server-context-C7Uxb3AS.cjs");var z=Symbol.for("preact-signals");function E(){if(y>1)y--;else{for(var t,e=!1;S!==void 0;){var n=S;for(S=void 0,A++;n!==void 0;){var i=n.o;if(n.o=void 0,n.f&=-3,!(8&n.f)&&K(n))try{n.c()}catch(r){e||(t=r,e=!0)}n=i}}if(A=0,y--,e)throw t}}function R(t){if(y>0)return t();y++;try{return t()}finally{E()}}var c=void 0;function H(t){var e=c;c=void 0;try{return t()}finally{c=e}}var S=void 0,y=0,A=0,w=0;function I(t){if(c!==void 0){var e=t.n;if(e===void 0||e.t!==c)return e={i:0,S:t,p:c.s,n:void 0,t:c,e:void 0,x:void 0,r:e},c.s!==void 0&&(c.s.n=e),c.s=e,t.n=e,32&c.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=c.s,e.n=void 0,c.s.n=e,c.s=e),e}}function u(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}u.prototype.brand=z;u.prototype.h=function(){return!0};u.prototype.S=function(t){var e=this,n=this.t;n!==t&&t.e===void 0&&(t.x=n,this.t=t,n!==void 0?n.e=t:H(function(){var i;(i=e.W)==null||i.call(e)}))};u.prototype.U=function(t){var e=this;if(this.t!==void 0){var n=t.e,i=t.x;n!==void 0&&(n.x=i,t.e=void 0),i!==void 0&&(i.e=n,t.x=void 0),t===this.t&&(this.t=i,i===void 0&&H(function(){var r;(r=e.Z)==null||r.call(e)}))}};u.prototype.subscribe=function(t){var e=this;return g(function(){var n=e.value,i=c;c=void 0;try{t(n)}finally{c=i}},{name:"sub"})};u.prototype.valueOf=function(){return this.value};u.prototype.toString=function(){return this.value+""};u.prototype.toJSON=function(){return this.value};u.prototype.peek=function(){var t=c;c=void 0;try{return this.value}finally{c=t}};Object.defineProperty(u.prototype,"value",{get:function(){var t=I(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(A>100)throw new Error("Cycle detected");this.v=t,this.i++,w++,y++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{E()}}}});function q(t,e){return new u(t,e)}function K(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function V(t){for(var e=t.s;e!==void 0;e=e.n){var n=e.S.n;if(n!==void 0&&(e.r=n),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function G(t){for(var e=t.s,n=void 0;e!==void 0;){var i=e.p;e.i===-1?(e.S.U(e),i!==void 0&&(i.n=e.n),e.n!==void 0&&(e.n.p=i)):n=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=i}t.s=n}function m(t,e){u.call(this,void 0),this.x=t,this.s=void 0,this.g=w-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}m.prototype=new u;m.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===w))return!0;if(this.g=w,this.f|=1,this.i>0&&!K(this))return this.f&=-2,!0;var t=c;try{V(this),c=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(n){this.v=n,this.f|=16,this.i++}return c=t,G(this),this.f&=-2,!0};m.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}u.prototype.S.call(this,t)};m.prototype.U=function(t){if(this.t!==void 0&&(u.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};m.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(m.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=I(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function Z(t,e){return new m(t,e)}function j(t){var e=t.u;if(t.u=void 0,typeof e=="function"){y++;var n=c;c=void 0;try{e()}catch(i){throw t.f&=-2,t.f|=8,x(t),i}finally{c=n,E()}}}function x(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,j(t)}function J(t){if(c!==this)throw new Error("Out-of-order effect");G(this),c=t,this.f&=-2,8&this.f&&x(this),E()}function b(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}b.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,j(this),V(this),y++;var t=c;return c=this,J.bind(this,t)};b.prototype.N=function(){2&this.f||(this.f|=2,this.o=S,S=this)};b.prototype.d=function(){this.f|=8,1&this.f||x(this)};b.prototype.dispose=function(){this.d()};function g(t,e){var n=new b(t,e);try{n.c()}catch(r){throw n.d(),r}var i=n.d.bind(n);return i[Symbol.dispose]=i,i}function Q(t){return t instanceof u?t.peek():t}function ee(t){return t instanceof u?t.value:t}function te(t,e){typeof e=="function"?t.value=e():t.value=e}function ne(t){return t instanceof u?()=>t.value:t}function ie(t,e,n=!1){const i=[];for(const[r,s]of Object.entries(e))if(s!=null&&!(r==="children"||r==="key"||r==="autoanimate"||r==="innerHTML")){if(typeof s=="function"&&r!=="ref"&&!r.startsWith("on")&&r!=="viewTransitionName"){const o=g(()=>{const a=s();D(t,r,a,n)});i.push(o);continue}D(t,r,s,n)}return()=>i.forEach(r=>r())}function D(t,e,n,i){if(e==="ref"&&typeof n=="function"){n(t);return}if(e.startsWith("on")&&typeof n=="function"){const r=e.slice(2).toLowerCase();t.addEventListener(r,n);return}if(e==="class"||e==="className"){const r=typeof n=="string"?n:Array.isArray(n)?n.filter(Boolean).join(" "):typeof n=="object"?Object.entries(n).filter(([s,o])=>o).map(([s])=>s).join(" "):"";i?t.setAttribute("class",r):t.className=r;return}if(e==="style"){typeof n=="string"?t.setAttribute("style",n):typeof n=="object"&&n&&Object.assign(t.style,n);return}if(e==="viewTransitionName"){t.style.viewTransitionName=n;return}if(!i&&typeof n=="boolean"){n?t.setAttribute(e,""):t.removeAttribute(e);return}t.setAttribute(e,String(n))}function re(t,e){const n=document.createTextNode(String(e));t.appendChild(n)}function X(t){return{type:"reactive",kind:"ReactiveVNode",fn:t,_id:d.newVNodeId(),_dispose:null,_currentChild:null,_currentDom:null,_placeholder:null,_parent:null,_renderedChildren:[]}}function k(t,e){if(!t&&t!==0)return{vnode:null,dom:null};if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return{vnode:null,dom:document.createTextNode(String(t))};if(t instanceof Node)return{vnode:null,dom:t};if(typeof t=="object"&&"type"in t){const n=t;n.type!=="reactive"&&(n._parent=e),e._renderedChildren.push(n);const i=_(n);return{vnode:n,dom:i}}return{vnode:null,dom:null}}class M{_cancelled=!1;_cancelCallbacks=[];get cancelled(){return this._cancelled}cancel(){this._cancelled||(this._cancelled=!0,this._cancelCallbacks.forEach(e=>{try{e()}catch(n){console.error("Cancel callback error:",n)}}),this._cancelCallbacks=[])}onCancel(e){this._cancelled?e():this._cancelCallbacks.push(e)}throwIfCancelled(){if(this._cancelled)throw new Error("Operation cancelled")}}async function Y(t,e){if(!t)return;const n=t,i=e||new M;if("_onBeforeExitCallbacks"in n&&n._onBeforeExitCallbacks.length>0)for(const r of n._onBeforeExitCallbacks)try{if(i.cancelled)break;await r(i)}catch(s){console.error("onBeforeExit error:",s)}if("_onUnmountCallbacks"in n&&n._onUnmountCallbacks.length>0&&n._onUnmountCallbacks.forEach(r=>{try{r()}catch(s){console.error("onUnmount error:",s)}}),n.type==="reactive"){const r=n;r._dispose&&(r._dispose(),r._dispose=null)}"_renderedChildren"in n&&n._renderedChildren.forEach(r=>{U(r)})}function U(t){if(!t)return;const e=t,n=new M;if(n.cancel(),"_onBeforeExitCallbacks"in e&&e._onBeforeExitCallbacks.length>0&&e._onBeforeExitCallbacks.forEach(i=>{try{const r=i(n);r instanceof Promise&&r.catch(s=>console.error("onBeforeExit error:",s))}catch(r){console.error("onBeforeExit error:",r)}}),"_onUnmountCallbacks"in e&&e._onUnmountCallbacks.length>0&&e._onUnmountCallbacks.forEach(i=>{try{i()}catch(r){console.error("onUnmount error:",r)}}),e.type==="reactive"){const i=e;i._dispose&&(i._dispose(),i._dispose=null)}"_renderedChildren"in e&&e._renderedChildren.forEach(i=>{U(i)})}let se=0;const p=new WeakMap;async function O(t,e,n){const i=t._placeholder;if(!i?.parentNode)return;const r=t._currentChild,s=t._currentDom;if(oe(r,e)){const f=p.get(t);f&&(f.token.cancel(),p.delete(t)),r&&"_lifecycleState"in r&&(r._lifecycleState="mounted");return}if(s instanceof Text&&n instanceof Text){s.nodeValue!==n.nodeValue&&(s.nodeValue=n.nodeValue),t._currentDom=s,t._currentChild=e,e&&"_lifecycleState"in e&&(e._lifecycleState="mounted"),p.delete(t);return}const o=++se,a=p.get(t);a&&a.token.cancel();const l=new M;if(p.set(t,{id:o,token:l}),r&&"_lifecycleState"in r&&(r._lifecycleState="exiting"),r)try{await Y(r,l)}catch(f){console.error(`ReactiveVNode ${t._id}: Unmount threw:`,f)}const h=p.get(t);if(!(!h||h.id!==o)){if(l.cancelled){p.delete(t);return}r&&"_lifecycleState"in r&&(r._lifecycleState="exited"),s&&s.remove(),n&&i.parentNode.insertBefore(n,i.nextSibling),e&&"_lifecycleState"in e&&(e._lifecycleState="mounted"),t._currentChild=e,t._currentDom=n,p.delete(t)}}function oe(t,e){if(!t||!e||typeof t!="object"||typeof e!="object"||!("type"in t)||!("type"in e))return!1;if(typeof t.type=="function"&&typeof e.type=="function"){if(t.type!==e.type)return!1}else if(typeof t.type=="string"&&typeof e.type=="string"){if(t.type!==e.type)return!1}else return!1;const n="props"in t?t.props?.key:void 0,i="props"in e?e.props?.key:void 0;return n!==i?!1:"_lifecycleState"in t&&t._lifecycleState==="exiting"}function ae(t,e){const n=t._listState;n?ce(t,e,n):le(t,e)}function le(t,e){const n=t._placeholder;if(!n?.parentNode)return;const i=[];for(let r=0;r<e.length;r++){const s=e[r],o=P(s,r),{vnode:a,dom:l}=k(s,t);l&&n.parentNode.appendChild(l),i.push({key:o,vnode:a,dom:l})}t._listState={items:i}}function ce(t,e,n){const i=t._placeholder;if(!i?.parentNode)return;const r=new Map;for(const a of n.items)r.set(a.key,a);const s=new Set,o=[];for(let a=0;a<e.length;a++){const l=e[a],h=P(l,a);s.add(h);const f=r.get(h);f?(o.push(f),r.delete(h)):ue(t,l,o)}r.size>0&&fe(r),de(i,o),t._listState={items:o}}function ue(t,e,n){const i=P(e,n.length),{vnode:r,dom:s}=k(e,t);n.push({key:i,vnode:r,dom:s})}function fe(t){for(const[e,n]of t)n.vnode&&Y(n.vnode),n.dom?.parentNode&&n.dom.parentNode.removeChild(n.dom)}function de(t,e){const n=t.parentNode;if(!n)return;let i=t;for(const r of e)r.dom&&(i.nextSibling!==r.dom&&n.insertBefore(r.dom,i.nextSibling),i=r.dom)}function P(t,e){return t&&typeof t=="object"&&"key"in t?t.key??e:e}function $(t,e,n=null,i=!1){if(!e)return;(Array.isArray(e)?e:[e]).forEach(s=>{if(s){if(Array.isArray(s)&&$(t,s,n,i),typeof s=="string"||typeof s=="number")re(t,s);else if(typeof s=="function"){const o=X(s);o._parent=n,n&&n._renderedChildren.push(o);const a=document.createComment("reactive");t.appendChild(a),o._placeholder=a;const l=g(()=>{const h=s();if(Array.isArray(h))ae(o,h);else{const{vnode:f,dom:T}=k(h,o);O(o,f,T)}});o._dispose=l}else if(s instanceof Node)t.append(s);else if(s&&typeof s=="object"&&"type"in s){const o=s;"type"in o&&o.type!=="reactive"&&(o._parent=n),n&&n._renderedChildren.push(o);const a=_(o,i);a&&t.append(a)}}})}const he="http://www.w3.org/2000/svg";function B(t,e=!1){if(t._dom)return t._dom;const n=e||t.type==="svg",i=n?document.createElementNS(he,t.type):document.createElement(t.type),r=ie(i,t.props,n);return t._onUnmountCallbacks.push(r),t.props.innerHTML!==void 0?i.innerHTML=typeof t.props.innerHTML=="object"?JSON.stringify(t.props.innerHTML):t.props.innerHTML:t.props.children&&$(i,t.props.children,t,n),t._dom=i,t._lifecycleState="mounted",t._onMountCallbacks.length>0&&t._onMountCallbacks.forEach(s=>s()),i}function _(t,e=!1){if("type"in t&&t.type==="reactive")return t._placeholder;if(typeof t.type=="string")return B(t,e);const n=t;d.setCurrentVNode(n);const i=n.type(n.props);if(d.setCurrentVNode(null),!i)return null;let r=null;if(typeof i=="string"||typeof i=="number"||typeof i=="boolean")r=document.createTextNode(String(i));else if(i instanceof Node)n._element=i,r=i;else if(i&&typeof i=="object"&&"type"in i){const s=i;"type"in s&&s.type!=="reactive"&&(s._parent=n,n._renderedChildren.push(s));const o=_(s,e);o&&(n._element=o),r=o}return r&&n._onMountCallbacks.length>0&&n._onMountCallbacks.forEach(s=>{s()}),r&&(n._lifecycleState="mounted"),r}function pe(t,e){const n=t instanceof Node?t:_(t);n&&e.append(n)}function ye(t){return document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null)}function me(t,e="self"){const n=ye(t);return e==="children"&&n.firstChild(),{walker:n,isSVG:!1}}function be(t,e,n,i){if(e==="class"||e==="className"){const r=typeof n=="string"?n:Array.isArray(n)?n.filter(Boolean).join(" "):typeof n=="object"?Object.entries(n).filter(([s,o])=>o).map(([s])=>s).join(" "):"";i?t.setAttribute("class",r):t.className=r;return}if(e==="style"){typeof n=="string"?t.setAttribute("style",n):typeof n=="object"&&n&&Object.assign(t.style,n);return}if(e==="viewTransitionName"){t.style.viewTransitionName=n;return}if(!i&&typeof n=="boolean"){n?t.setAttribute(e,""):t.removeAttribute(e);return}t.setAttribute(e,String(n))}function ge(t,e,n=!1,i){const r=[];for(const[s,o]of Object.entries(e))if(o!=null&&!(s==="children"||s==="key"||s==="autoanimate")){if(s==="ref"&&typeof o=="function"){i&&console.log("→ Attaching ref"),o(t);continue}if(s.startsWith("on")&&typeof o=="function"){const a=s.slice(2).toLowerCase();i&&console.log(`→ Attaching event: ${a}`),t.addEventListener(a,o);continue}if(typeof o=="function"&&s!=="ref"&&s!=="viewTransitionName"){i&&console.log(`→ Reactive prop: ${s}`);const a=g(()=>{const l=o();be(t,s,l,n)});r.push(a);continue}}return()=>r.forEach(s=>s())}function ve(t,e,n=null,i){if(!e)return;const r=Array.isArray(e)?e:[e];if(!i.walker.firstChild()&&r.length>0){console.warn("Hydration mismatch: VNode has children but DOM is empty");return}for(const o of r)!o&&o!==0||_e(o,t,n,i);i.walker.parentNode()}function _e(t,e,n,i){if(!(!t&&t!==0)){if(typeof t=="string"||typeof t=="number"||typeof t=="boolean"){const r=i.walker.currentNode;r.nodeType===Node.TEXT_NODE?(i.debug&&console.log("→ Hydrated text node"),i.walker.nextSibling()):console.warn(`Hydration mismatch: expected text node but found ${r.nodeName}`);return}if(typeof t=="function"){i.debug&&console.log("→ Hydrating reactive child");const r=X(t);r._parent=n,n&&n._renderedChildren.push(r);const s=i.walker.currentNode,o=t();if(o&&typeof o=="object"&&"type"in o){const f=o;v(f,i),r._currentChild=f,r._currentDom=f._dom??f._element}else(typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&(r._currentDom=s),i.walker.nextSibling();const a=document.createComment("reactive");r._currentDom?.parentNode&&r._currentDom.parentNode.insertBefore(a,r._currentDom),r._placeholder=a;let l=!0;const h=g(()=>{const f=t();if(l){l=!1;return}const{vnode:T,dom:W}=k(f,r);O(r,T,W)});r._dispose=h;return}if(t instanceof Node){i.walker.nextSibling();return}if(t&&typeof t=="object"&&"type"in t){const r=t;"type"in r&&r.type!=="reactive"&&r.type!=="suspended"&&(r._parent=n),n&&n._renderedChildren.push(r),v(r,i)}}}function Se(t,e){const n=e.walker.currentNode;if(n.nodeType!==Node.ELEMENT_NODE)return console.warn(`Hydration mismatch: expected element <${t.type}> but found ${n.nodeName}`),F(t,n,e);const i=n,r=i.tagName.toLowerCase();if(r!==t.type.toLowerCase())return console.warn(`Hydration mismatch: expected <${t.type}> but found <${r}>`),F(t,n,e);const s=e.isSVG||t.type==="svg",o=e.isSVG;e.isSVG=s,t._dom=i,e.debug&&console.log(`→ Attached existing <${t.type}> DOM`);const a=ge(i,t.props,s,e.debug);return t._onUnmountCallbacks.push(a),t.props.children&&ve(i,t.props.children,t,e),t._lifecycleState="mounted",t._onMountCallbacks.length>0&&t._onMountCallbacks.forEach(l=>l()),e.isSVG=o,e.walker.nextSibling(),i}function F(t,e,n){n.debug&&console.log(`→ Fallback: rendering <${t.type}> fresh`);const i=e.parentNode,r=e.nextSibling;i?.removeChild(e);const s=B(t,n.isSVG);return i&&(r?i.insertBefore(s,r):i.appendChild(s)),n.walker.nextSibling(),s}function v(t,e){if("type"in t&&t.type==="reactive")return e.debug&&console.log(`Hydrating ReactiveVNode #${t._id}`),Ce(t,e);if("type"in t&&t.type==="suspended")return e.debug&&console.log(`Hydrating SuspendedVNode: ${t._componentName}`),we(t,e);if(typeof t.type=="string")return e.debug&&console.log(`Hydrating <${t.type}>`),Se(t,e);const n=t.type.name||"Anonymous";return e.debug&&console.log(`Hydrating Component: ${n}`),ke(t,e)}function ke(t,e){d.setCurrentVNode(t);const n=t.type(t.props);if(d.setCurrentVNode(null),!n)return null;if(typeof n=="object"&&"type"in n&&n.type==="suspended")return v(n,e);let i=null;if(typeof n=="string"||typeof n=="number"||typeof n=="boolean"){const r=e.walker.currentNode;r.nodeType===Node.TEXT_NODE&&(t._element=r,i=r,e.walker.nextSibling())}else if(n instanceof Node)t._element=n,i=n,e.walker.nextSibling();else if(n&&typeof n=="object"&&"type"in n){const r=n;"type"in r&&r.type!=="reactive"&&(r._parent=t,t._renderedChildren.push(r));const s=v(r,e);s&&(t._element=s),i=s}return i&&t._onMountCallbacks.length>0&&(e.debug&&console.log(`→ Firing ${t._onMountCallbacks.length} onMount callback(s)`),t._onMountCallbacks.forEach(r=>r())),i&&(t._lifecycleState="mounted"),i}function Ce(t,e){const n=t.fn(),i=e.walker.currentNode,r=document.createComment("reactive");if(i.parentNode?.insertBefore(r,i),t._placeholder=r,n&&typeof n=="object"&&"type"in n){const a=n;v(a,e),t._currentChild=a,t._currentDom=a._dom??a._element}else(typeof n=="string"||typeof n=="number"||typeof n=="boolean")&&(t._currentDom=i),e.walker.nextSibling();let s=!0;const o=g(()=>{const a=t.fn();if(s){s=!1,e.debug&&console.log("→ Reactive effect setup (skipping initial)");return}const{vnode:l,dom:h}=k(a,t);O(t,l,h)});return t._dispose=o,t._currentDom}function we(t,e){const n=e.walker.currentNode;if(n.nodeType===Node.ELEMENT_NODE&&n.hasAttribute("data-suspended")){const r=n;return r.getAttribute("data-suspended-state")==="resolved"?(t._state="resolved",e.walker.firstChild(),t.promise.then(o=>{t._state="resolved"}).catch(o=>{t._state="error";const a=typeof t.errorFallback=="function"?t.errorFallback(o):t.errorFallback;r.innerHTML="";const l=C(a,e.isSVG);l&&r.appendChild(l)}),e.walker.parentNode(),e.walker.nextSibling(),r):(t._state="pending",t.promise.then(o=>{t._state="resolved",r.innerHTML="";const a=C(o,e.isSVG);a&&r.appendChild(a)}).catch(o=>{t._state="error";const a=typeof t.errorFallback=="function"?t.errorFallback(o):t.errorFallback;r.innerHTML="";const l=C(a,e.isSVG);l&&r.appendChild(l)}),e.walker.nextSibling(),r)}console.warn("Hydration mismatch: expected suspended container");const i=_(t,e.isSVG);return e.walker.nextSibling(),i}function C(t,e){return!t&&t!==0?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?document.createTextNode(String(t)):t instanceof Node?t:typeof t=="object"&&"type"in t?_(t,e):typeof t=="function"?C(t(),e):null}function Ee(t,e,n="self"){const i=me(e,n);v(t,i)}function Te(t,e="Loading...",n="Error"){return i=>({type:"suspended",kind:"SuspendedVNode",promise:t(i),fallback:e,errorFallback:n,_id:d.newVNodeId(),_componentName:t.name||"AsyncComponent",_parent:null,_renderedChildren:[],_currentChild:null,_state:"pending"})}function Ne(t){const e=Symbol("context");return{_id:e,_defaultValue:t,provide(n){if(typeof document>"u"){L.provideServerContext(e,n);return}const i=d.getCurrentVNode();if(!i)throw new Error("context.provide() called outside of component render");i._contextMap||(i._contextMap=new Map),i._contextMap.set(e,n)}}}function Ae(t){if(typeof document>"u")return L.consumeServerContext(t._id,t._defaultValue);const e=d.getCurrentVNode();if(!e)throw new Error("useContext called outside of component render");let n=e;for(;n;){if(n.kind==="VNode"&&n._contextMap?.has(t._id))return n._contextMap.get(t._id);n=n._parent}return t._defaultValue}function xe(t){if(!(typeof document>"u")){if(d.currentVNode===null)throw new Error("onMount must be called inside a component during render");d.currentVNode._onMountCallbacks.push(t)}}function Me(t){if(!(typeof document>"u")){if(d.currentVNode===null)throw new Error("onUnmount must be called inside a component during render");d.currentVNode._onUnmountCallbacks.push(t)}}function Oe(t){if(!(typeof document>"u")){if(d.currentVNode===null)throw new Error("onBeforeExit must be called inside a component during render");d.currentVNode._onBeforeExitCallbacks.push(t)}}function Pe(t){if(!(typeof document>"u"))try{t()}catch(e){console.error(e)}}class De{readCallbacks=new Set;updateCallbacks=new Set;renderCallbacks=new Set;readKeepAlive=new Set;updateKeepAlive=new Set;renderKeepAlive=new Set;isProcessing=!1;frameScheduled=!1;frameId=null;lastTimestamp=0;currentDelta=0;trackFPS;fpsHistorySize;fpsHistory=[];constructor(e={}){this.trackFPS=e.trackFPS??!1,this.fpsHistorySize=e.fpsHistorySize??60}read(e,n=!1){return n?this.readKeepAlive.add(e):this.readCallbacks.add(e),this.scheduleFrame(),e}update(e,n=!1){return n?this.updateKeepAlive.add(e):this.updateCallbacks.add(e),this.scheduleFrame(),e}render(e,n=!1){return n?this.renderKeepAlive.add(e):this.renderCallbacks.add(e),this.scheduleFrame(),e}chain(e){let n,i;"read"in e&&this.readCallbacks.add(r=>{n=e.read(r)}),"update"in e?(this.updateCallbacks.add(r=>{i=e.update(n,r)}),this.renderCallbacks.add(r=>{e.render(i,r)})):this.renderCallbacks.add(r=>{e.render(n,r)}),this.scheduleFrame()}cancel(e){this.readCallbacks.delete(e),this.updateCallbacks.delete(e),this.renderCallbacks.delete(e),this.readKeepAlive.delete(e),this.updateKeepAlive.delete(e),this.renderKeepAlive.delete(e)}cancelAll(){this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.readCallbacks.clear(),this.updateCallbacks.clear(),this.renderCallbacks.clear(),this.readKeepAlive.clear(),this.updateKeepAlive.clear(),this.renderKeepAlive.clear(),this.isProcessing=!1,this.frameScheduled=!1,this.lastTimestamp=0,this.currentDelta=0,this.trackFPS&&(this.fpsHistory=[])}get data(){return{timestamp:this.lastTimestamp,delta:this.currentDelta||16.67}}get isRunning(){return this.isProcessing||this.readKeepAlive.size>0||this.updateKeepAlive.size>0||this.renderKeepAlive.size>0}get fps(){return this.trackFPS?this.currentDelta>0?1e3/this.currentDelta:0:(console.warn("FPS tracking is disabled. Enable with { trackFPS: true }"),0)}get averageFps(){if(!this.trackFPS)return console.warn("FPS tracking is disabled. Enable with { trackFPS: true }"),0;if(this.fpsHistory.length===0)return 0;const e=this.fpsHistory.reduce((n,i)=>n+i,0);return Math.round(e/this.fpsHistory.length)}get refreshRate(){return this.trackFPS?Math.round(this.averageFps):(console.warn("FPS tracking is disabled. Enable with { trackFPS: true }"),0)}scheduleFrame(){this.frameScheduled||this.isProcessing||(this.frameScheduled=!0,this.frameId=requestAnimationFrame(e=>{this.processFrame(e)}))}processFrame(e){this.isProcessing=!0,this.frameScheduled=!1,this.lastTimestamp===0?this.currentDelta=16.67:this.currentDelta=e-this.lastTimestamp,this.lastTimestamp=e,this.trackFPS&&this.currentDelta>0&&(this.fpsHistory.push(1e3/this.currentDelta),this.fpsHistory.length>this.fpsHistorySize&&this.fpsHistory.shift());const n=this.data;this.executeCallbacks(this.readCallbacks,n),this.executeCallbacks(this.readKeepAlive,n),this.executeCallbacks(this.updateCallbacks,n),this.executeCallbacks(this.updateKeepAlive,n),this.executeCallbacks(this.renderCallbacks,n),this.executeCallbacks(this.renderKeepAlive,n),this.isProcessing=!1,this.hasKeepAliveCallbacks()&&this.scheduleFrame()}executeCallbacks(e,n){e.forEach(i=>{try{i(n)}catch(r){console.error("Frame callback error:",r)}}),this.isKeepAliveSet(e)||e.clear()}hasKeepAliveCallbacks(){return this.readKeepAlive.size>0||this.updateKeepAlive.size>0||this.renderKeepAlive.size>0}isKeepAliveSet(e){return e===this.readKeepAlive||e===this.updateKeepAlive||e===this.renderKeepAlive}}class Fe{gestureId=0;activeGestures=new Map;disabledGestures=new Map;capturedId;gestureWithPriority=new Map;maxPriority=-1/0;newId(){return++this.gestureId}canStart(e){if(this.capturedId!==void 0)return!1;const n=this.disabledGestures.get(e);return!(n&&n.size>0)}start(e,n,i){return this.canStart(n)?(this.activeGestures.set(e,n),this.gestureWithPriority.set(e,i),this.maxPriority=Math.max(this.maxPriority,i),!0):!1}capture(e,n,i){return!this.activeGestures.has(e)&&!this.start(e,n,i)?!1:i>=this.maxPriority?(this.capturedId=e,this.activeGestures.forEach((r,s)=>{s!==e&&this.release(s)}),!0):(this.release(e),!1)}release(e){const n=this.activeGestures.get(e);this.activeGestures.delete(e);const i=this.gestureWithPriority.get(e);if(this.gestureWithPriority.delete(e),this.capturedId===e&&(this.capturedId=void 0),i===this.maxPriority&&(this.maxPriority=-1/0,this.gestureWithPriority.forEach(r=>{this.maxPriority=Math.max(this.maxPriority,r)})),n){const r=this.disabledGestures.get(n);r&&(r.delete(e),r.size===0&&this.disabledGestures.delete(n))}}disableGesture(e,n){let i=this.disabledGestures.get(e);i||(i=new Set,this.disabledGestures.set(e,i)),i.add(n)}enableGesture(e,n){const i=this.disabledGestures.get(e);i&&(i.delete(n),i.size===0&&this.disabledGestures.delete(e))}createGesture(e,n){const i=this.newId(),r=n.name||"gesture-"+i,s=n.priority??0;return new Le(this,i,e,r,s,n)}}class Le{el;options;details;minTouches;maxTouches;threshold;direction;lastMoveTime=0;prevX=0;prevY=0;initialDistance=0;initialAngle=0;boundOnStart;boundOnMove;boundOnEnd;passive;hasPassedThreshold=!1;controller;id;name;priority;useThreshold;constructor(e,n,i,r,s,o){this.controller=e,this.id=n,this.el=i,this.options=o,this.name=r,this.priority=s*1e3+n,this.minTouches=o.minTouches??1,this.maxTouches=o.maxTouches??1/0,this.passive=o.passive??!0,this.threshold=o.threshold??0,this.direction=o.direction??"all",this.useThreshold=this.threshold>0,this.details={type:this.name,isTracking:!1,startX:0,startY:0,currentX:0,currentY:0,deltaX:0,deltaY:0,velocityX:0,velocityY:0,touchCount:0,scale:1,rotation:0},this.boundOnStart=this.onStart.bind(this),this.boundOnMove=this.onMove.bind(this),this.boundOnEnd=this.onEnd.bind(this)}getDistance(e){if(e.length<2)return 0;const n=e[0].clientX-e[1].clientX,i=e[0].clientY-e[1].clientY;return Math.sqrt(n*n+i*i)}getAngle(e){if(e.length<2)return 0;const n=e[1].clientX-e[0].clientX,i=e[1].clientY-e[0].clientY;return Math.atan2(i,n)*180/Math.PI}getCenter(e){if("touches"in e){if(e.touches.length===0)return{x:0,y:0};let n=0,i=0;for(let r=0;r<e.touches.length;r++)n+=e.touches[r].clientX,i+=e.touches[r].clientY;return{x:n/e.touches.length,y:i/e.touches.length}}else return{x:e.clientX,y:e.clientY}}canStart(e){const i="touches"in e?e.touches.length:1;return i>=this.minTouches&&i<=this.maxTouches&&this.controller.canStart(this.name)}checkThreshold(){if(!this.useThreshold)return!0;const{deltaX:e,deltaY:n}=this.details;return this.direction==="x"?Math.abs(e)>=this.threshold:this.direction==="y"?Math.abs(n)>=this.threshold:Math.sqrt(e*e+n*n)>=this.threshold}onStart(e){if(!this.canStart(e))return;const n="touches"in e,i=this.getCenter(e);this.details.startX=i.x,this.details.startY=i.y,this.details.currentX=i.x,this.details.currentY=i.y,this.details.touchCount=n?e.touches.length:1,this.details.event=e,n&&e.touches.length>=2?(this.initialDistance=this.getDistance(e.touches),this.initialAngle=this.getAngle(e.touches)):(this.initialDistance=0,this.initialAngle=0),!(this.options.canStart&&!this.options.canStart(this.details))&&(this.passive||e.preventDefault(),this.details.isTracking=!0,this.details.deltaX=0,this.details.deltaY=0,this.details.velocityX=0,this.details.velocityY=0,this.details.scale=1,this.details.rotation=0,this.hasPassedThreshold=!this.useThreshold,this.lastMoveTime=Date.now(),this.prevX=i.x,this.prevY=i.y,this.controller.start(this.id,this.name,this.priority),this.useThreshold||this.tryCapture())}onMove(e){if(!this.details.isTracking)return;this.passive||e.preventDefault();const n="touches"in e,i=this.getCenter(e),r=Date.now(),s=r-this.lastMoveTime;if(this.details.currentX=i.x,this.details.currentY=i.y,this.details.deltaX=this.details.currentX-this.details.startX,this.details.deltaY=this.details.currentY-this.details.startY,this.details.touchCount=n?e.touches.length:1,this.details.event=e,n&&e.touches.length>=2){const o=this.getDistance(e.touches),a=this.getAngle(e.touches);this.initialDistance>0&&(this.details.scale=o/this.initialDistance);let l=a-this.initialAngle;l>180&&(l-=360),l<-180&&(l+=360),this.details.rotation=l}else this.details.scale=1,this.details.rotation=0;if(s>0&&(this.details.velocityX=(this.details.currentX-this.prevX)/s,this.details.velocityY=(this.details.currentY-this.prevY)/s),this.prevX=this.details.currentX,this.prevY=this.details.currentY,this.lastMoveTime=r,!this.hasPassedThreshold&&this.checkThreshold()){this.hasPassedThreshold=!0,this.tryCapture();return}this.hasPassedThreshold&&this.options.onMove&&this.options.onMove(this.details)}tryCapture(){this.controller.capture(this.id,this.name,this.priority)&&this.options.onStart&&this.options.onStart(this.details)}onEnd(e){if(!this.details.isTracking)return;this.passive||e.preventDefault();const n="touches"in e;this.details.touchCount=n?e.touches.length:0,this.details.event=e,this.controller.release(this.id),this.details.isTracking=!1,this.hasPassedThreshold=!this.useThreshold,this.options.onEnd&&this.options.onEnd(this.details)}init(){if(!this.el)return;const e={passive:this.passive},n={passive:this.passive},i={passive:this.passive};this.el.addEventListener("touchstart",this.boundOnStart,e),document.addEventListener("touchmove",this.boundOnMove,n),document.addEventListener("touchend",this.boundOnEnd,i),document.addEventListener("touchcancel",this.boundOnEnd,i),this.el.addEventListener("mousedown",this.boundOnStart,e),document.addEventListener("mousemove",this.boundOnMove,n),document.addEventListener("mouseup",this.boundOnEnd,i),document.addEventListener("mouseleave",this.boundOnEnd,i)}destroy(){this.el&&(this.el.removeEventListener("touchstart",this.boundOnStart),document.removeEventListener("touchmove",this.boundOnMove),document.removeEventListener("touchend",this.boundOnEnd),document.removeEventListener("touchcancel",this.boundOnEnd),this.el.removeEventListener("mousedown",this.boundOnStart),document.removeEventListener("mousemove",this.boundOnMove),document.removeEventListener("mouseup",this.boundOnEnd),document.removeEventListener("mouseleave",this.boundOnEnd),this.controller.release(this.id))}}let N;function He(){return N||(N=new Fe),N}function Ie(t,e){return He().createGesture(t,e)}function Ke(t){typeof document>"u"||(document.startViewTransition?document.startViewTransition(t):t())}let Ve=0;function Ge(t,e=[],n={duration:500,namePrefix:"vt"}){if(!document.startViewTransition){t();return}const i=e.map((s,o)=>`${n.namePrefix}-${++Ve}-${o}`);e.forEach((s,o)=>{s.style.viewTransitionName=i[o]}),document.startViewTransition(()=>{t()}).finished.finally(()=>{e.forEach(s=>{s.style.viewTransitionName=""})}),document.documentElement.style.setProperty("--vt-duration",`${n.duration}ms`)}exports.Fragment=d.Fragment;exports.Computed=m;exports.Effect=b;exports.FrameScheduler=De;exports.Signal=u;exports.batch=R;exports.computed=Z;exports.createContext=Ne;exports.createGesture=Ie;exports.effect=g;exports.get=ee;exports.hydrate=Ee;exports.link=ne;exports.onBeforeExit=Oe;exports.onLoad=Pe;exports.onMount=xe;exports.onUnmount=Me;exports.peek=Q;exports.render=pe;exports.set=te;exports.signal=q;exports.startViewTransition=Ke;exports.suspend=Te;exports.useContext=Ae;exports.withViewTransition=Ge;
|
|
11
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const L=require("./index-BkDMcLYE.cjs"),h=require("./vnode-tracking-DC68rWms.cjs"),z=require("./jsx-runtime.cjs");var R=Symbol.for("preact-signals");function w(){if(y>1)y--;else{for(var t,e=!1;S!==void 0;){var i=S;for(S=void 0,A++;i!==void 0;){var n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&K(i))try{i.c()}catch(r){e||(t=r,e=!0)}i=n}}if(A=0,y--,e)throw t}}function q(t){if(y>0)return t();y++;try{return t()}finally{w()}}var c=void 0;function H(t){var e=c;c=void 0;try{return t()}finally{c=e}}var S=void 0,y=0,A=0,E=0;function I(t){if(c!==void 0){var e=t.n;if(e===void 0||e.t!==c)return e={i:0,S:t,p:c.s,n:void 0,t:c,e:void 0,x:void 0,r:e},c.s!==void 0&&(c.s.n=e),c.s=e,t.n=e,32&c.f&&t.S(e),e;if(e.i===-1)return e.i=0,e.n!==void 0&&(e.n.p=e.p,e.p!==void 0&&(e.p.n=e.n),e.p=c.s,e.n=void 0,c.s.n=e,c.s=e),e}}function u(t,e){this.v=t,this.i=0,this.n=void 0,this.t=void 0,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}u.prototype.brand=R;u.prototype.h=function(){return!0};u.prototype.S=function(t){var e=this,i=this.t;i!==t&&t.e===void 0&&(t.x=i,this.t=t,i!==void 0?i.e=t:H(function(){var n;(n=e.W)==null||n.call(e)}))};u.prototype.U=function(t){var e=this;if(this.t!==void 0){var i=t.e,n=t.x;i!==void 0&&(i.x=n,t.e=void 0),n!==void 0&&(n.e=i,t.x=void 0),t===this.t&&(this.t=n,n===void 0&&H(function(){var r;(r=e.Z)==null||r.call(e)}))}};u.prototype.subscribe=function(t){var e=this;return g(function(){var i=e.value,n=c;c=void 0;try{t(i)}finally{c=n}},{name:"sub"})};u.prototype.valueOf=function(){return this.value};u.prototype.toString=function(){return this.value+""};u.prototype.toJSON=function(){return this.value};u.prototype.peek=function(){var t=c;c=void 0;try{return this.value}finally{c=t}};Object.defineProperty(u.prototype,"value",{get:function(){var t=I(this);return t!==void 0&&(t.i=this.i),this.v},set:function(t){if(t!==this.v){if(A>100)throw new Error("Cycle detected");this.v=t,this.i++,E++,y++;try{for(var e=this.t;e!==void 0;e=e.x)e.t.N()}finally{w()}}}});function Z(t,e){return new u(t,e)}function K(t){for(var e=t.s;e!==void 0;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function G(t){for(var e=t.s;e!==void 0;e=e.n){var i=e.S.n;if(i!==void 0&&(e.r=i),e.S.n=e,e.i=-1,e.n===void 0){t.s=e;break}}}function j(t){for(var e=t.s,i=void 0;e!==void 0;){var n=e.p;e.i===-1?(e.S.U(e),n!==void 0&&(n.n=e.n),e.n!==void 0&&(e.n.p=n)):i=e,e.S.n=e.r,e.r!==void 0&&(e.r=void 0),e=n}t.s=i}function m(t,e){u.call(this,void 0),this.x=t,this.s=void 0,this.g=E-1,this.f=4,this.W=e?.watched,this.Z=e?.unwatched,this.name=e?.name}m.prototype=new u;m.prototype.h=function(){if(this.f&=-3,1&this.f)return!1;if((36&this.f)==32||(this.f&=-5,this.g===E))return!0;if(this.g=E,this.f|=1,this.i>0&&!K(this))return this.f&=-2,!0;var t=c;try{G(this),c=this;var e=this.x();(16&this.f||this.v!==e||this.i===0)&&(this.v=e,this.f&=-17,this.i++)}catch(i){this.v=i,this.f|=16,this.i++}return c=t,j(this),this.f&=-2,!0};m.prototype.S=function(t){if(this.t===void 0){this.f|=36;for(var e=this.s;e!==void 0;e=e.n)e.S.S(e)}u.prototype.S.call(this,t)};m.prototype.U=function(t){if(this.t!==void 0&&(u.prototype.U.call(this,t),this.t===void 0)){this.f&=-33;for(var e=this.s;e!==void 0;e=e.n)e.S.U(e)}};m.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(var t=this.t;t!==void 0;t=t.x)t.t.N()}};Object.defineProperty(m.prototype,"value",{get:function(){if(1&this.f)throw new Error("Cycle detected");var t=I(this);if(this.h(),t!==void 0&&(t.i=this.i),16&this.f)throw this.v;return this.v}});function J(t,e){return new m(t,e)}function X(t){var e=t.u;if(t.u=void 0,typeof e=="function"){y++;var i=c;c=void 0;try{e()}catch(n){throw t.f&=-2,t.f|=8,x(t),n}finally{c=i,w()}}}function x(t){for(var e=t.s;e!==void 0;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,X(t)}function Q(t){if(c!==this)throw new Error("Out-of-order effect");j(this),c=t,this.f&=-2,8&this.f&&x(this),w()}function b(t,e){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32,this.name=e?.name}b.prototype.c=function(){var t=this.S();try{if(8&this.f||this.x===void 0)return;var e=this.x();typeof e=="function"&&(this.u=e)}finally{t()}};b.prototype.S=function(){if(1&this.f)throw new Error("Cycle detected");this.f|=1,this.f&=-9,X(this),G(this),y++;var t=c;return c=this,Q.bind(this,t)};b.prototype.N=function(){2&this.f||(this.f|=2,this.o=S,S=this)};b.prototype.d=function(){this.f|=8,1&this.f||x(this)};b.prototype.dispose=function(){this.d()};function g(t,e){var i=new b(t,e);try{i.c()}catch(r){throw i.d(),r}var n=i.d.bind(i);return n[Symbol.dispose]=n,n}function ee(t){return t instanceof u?t.peek():t}function te(t){return t instanceof u?t.value:t}function ie(t,e){typeof e=="function"?t.value=e():t.value=e}function ne(t){return t instanceof u?()=>t.value:t}function re(t,e,i=!1){const n=[];for(const[r,s]of Object.entries(e))if(s!=null&&!(r==="children"||r==="key"||r==="autoanimate"||r==="innerHTML")){if(typeof s=="function"&&r!=="ref"&&!r.startsWith("on")&&r!=="viewTransitionName"){const o=g(()=>{const a=s();D(t,r,a,i)});n.push(o);continue}D(t,r,s,i)}return()=>n.forEach(r=>r())}function D(t,e,i,n){if(e==="ref"&&typeof i=="function"){i(t);return}if(e.startsWith("on")&&typeof i=="function"){const r=e.slice(2).toLowerCase();t.addEventListener(r,i);return}if(e==="class"||e==="className"){const r=typeof i=="string"?i:Array.isArray(i)?i.filter(Boolean).join(" "):typeof i=="object"?Object.entries(i).filter(([s,o])=>o).map(([s])=>s).join(" "):"";n?t.setAttribute("class",r):t.className=r;return}if(e==="style"){typeof i=="string"?t.setAttribute("style",i):typeof i=="object"&&i&&Object.assign(t.style,i);return}if(e==="viewTransitionName"){t.style.viewTransitionName=i;return}if(!n&&typeof i=="boolean"){i?t.setAttribute(e,""):t.removeAttribute(e);return}t.setAttribute(e,String(i))}function se(t,e){const i=document.createTextNode(String(e));t.appendChild(i)}function V(t){return{type:"reactive",kind:"ReactiveVNode",fn:t,_id:h.newVNodeId(),_dispose:null,_currentChild:null,_currentDom:null,_placeholder:null,_parent:null,_renderedChildren:[]}}function k(t,e){if(!t&&t!==0)return{vnode:null,dom:null};if(typeof t=="string"||typeof t=="number"||typeof t=="boolean")return{vnode:null,dom:document.createTextNode(String(t))};if(t instanceof Node)return{vnode:null,dom:t};if(typeof t=="object"&&"type"in t){const i=t;i.type!=="reactive"&&(i._parent=e),e._renderedChildren.push(i);const n=_(i);return{vnode:i,dom:n}}return{vnode:null,dom:null}}class M{_cancelled=!1;_cancelCallbacks=[];get cancelled(){return this._cancelled}cancel(){this._cancelled||(this._cancelled=!0,this._cancelCallbacks.forEach(e=>{try{e()}catch(i){console.error("Cancel callback error:",i)}}),this._cancelCallbacks=[])}onCancel(e){this._cancelled?e():this._cancelCallbacks.push(e)}throwIfCancelled(){if(this._cancelled)throw new Error("Operation cancelled")}}async function Y(t,e){if(!t)return;const i=t,n=e||new M;if("_onBeforeExitCallbacks"in i&&i._onBeforeExitCallbacks.length>0)for(const r of i._onBeforeExitCallbacks)try{if(n.cancelled)break;await r(n)}catch(s){console.error("onBeforeExit error:",s)}if("_onUnmountCallbacks"in i&&i._onUnmountCallbacks.length>0&&i._onUnmountCallbacks.forEach(r=>{try{r()}catch(s){console.error("onUnmount error:",s)}}),i.type==="reactive"){const r=i;r._dispose&&(r._dispose(),r._dispose=null)}"_renderedChildren"in i&&i._renderedChildren.forEach(r=>{U(r)})}function U(t){if(!t)return;const e=t,i=new M;if(i.cancel(),"_onBeforeExitCallbacks"in e&&e._onBeforeExitCallbacks.length>0&&e._onBeforeExitCallbacks.forEach(n=>{try{const r=n(i);r instanceof Promise&&r.catch(s=>console.error("onBeforeExit error:",s))}catch(r){console.error("onBeforeExit error:",r)}}),"_onUnmountCallbacks"in e&&e._onUnmountCallbacks.length>0&&e._onUnmountCallbacks.forEach(n=>{try{n()}catch(r){console.error("onUnmount error:",r)}}),e.type==="reactive"){const n=e;n._dispose&&(n._dispose(),n._dispose=null)}"_renderedChildren"in e&&e._renderedChildren.forEach(n=>{U(n)})}let oe=0;const p=new WeakMap;async function O(t,e,i){const n=t._placeholder;if(!n?.parentNode)return;const r=t._currentChild,s=t._currentDom;if(ae(r,e)){const f=p.get(t);f&&(f.token.cancel(),p.delete(t)),r&&"_lifecycleState"in r&&(r._lifecycleState="mounted");return}if(s instanceof Text&&i instanceof Text){s.nodeValue!==i.nodeValue&&(s.nodeValue=i.nodeValue),t._currentDom=s,t._currentChild=e,e&&"_lifecycleState"in e&&(e._lifecycleState="mounted"),p.delete(t);return}const o=++oe,a=p.get(t);a&&a.token.cancel();const l=new M;if(p.set(t,{id:o,token:l}),r&&"_lifecycleState"in r&&(r._lifecycleState="exiting"),r)try{await Y(r,l)}catch(f){console.error(`ReactiveVNode ${t._id}: Unmount threw:`,f)}const d=p.get(t);if(!(!d||d.id!==o)){if(l.cancelled){p.delete(t);return}r&&"_lifecycleState"in r&&(r._lifecycleState="exited"),s&&s.remove(),i&&n.parentNode.insertBefore(i,n.nextSibling),e&&"_lifecycleState"in e&&(e._lifecycleState="mounted"),t._currentChild=e,t._currentDom=i,p.delete(t)}}function ae(t,e){if(!t||!e||typeof t!="object"||typeof e!="object"||!("type"in t)||!("type"in e))return!1;if(typeof t.type=="function"&&typeof e.type=="function"){if(t.type!==e.type)return!1}else if(typeof t.type=="string"&&typeof e.type=="string"){if(t.type!==e.type)return!1}else return!1;const i="props"in t?t.props?.key:void 0,n="props"in e?e.props?.key:void 0;return i!==n?!1:"_lifecycleState"in t&&t._lifecycleState==="exiting"}function le(t,e){const i=t._listState;i?ue(t,e,i):ce(t,e)}function ce(t,e){const i=t._placeholder;if(!i?.parentNode)return;const n=[];for(let r=0;r<e.length;r++){const s=e[r],o=P(s,r),{vnode:a,dom:l}=k(s,t);l&&i.parentNode.appendChild(l),n.push({key:o,vnode:a,dom:l})}t._listState={items:n}}function ue(t,e,i){const n=t._placeholder;if(!n?.parentNode)return;const r=new Map;for(const a of i.items)r.set(a.key,a);const s=new Set,o=[];for(let a=0;a<e.length;a++){const l=e[a],d=P(l,a);s.add(d);const f=r.get(d);f?(o.push(f),r.delete(d)):fe(t,l,o)}r.size>0&&de(r),he(n,o),t._listState={items:o}}function fe(t,e,i){const n=P(e,i.length),{vnode:r,dom:s}=k(e,t);i.push({key:n,vnode:r,dom:s})}function de(t){for(const[e,i]of t)i.vnode&&Y(i.vnode),i.dom?.parentNode&&i.dom.parentNode.removeChild(i.dom)}function he(t,e){const i=t.parentNode;if(!i)return;let n=t;for(const r of e)r.dom&&(n.nextSibling!==r.dom&&i.insertBefore(r.dom,n.nextSibling),n=r.dom)}function P(t,e){return t&&typeof t=="object"&&"key"in t?t.key??e:e}function $(t,e,i=null,n=!1){if(!e)return;(Array.isArray(e)?e:[e]).forEach(s=>{if(s){if(Array.isArray(s)&&$(t,s,i,n),typeof s=="string"||typeof s=="number")se(t,s);else if(typeof s=="function"){const o=V(s);o._parent=i,i&&i._renderedChildren.push(o);const a=document.createComment("reactive");t.appendChild(a),o._placeholder=a;const l=g(()=>{const d=s();if(Array.isArray(d))le(o,d);else{const{vnode:f,dom:T}=k(d,o);O(o,f,T)}});o._dispose=l}else if(s instanceof Node)t.append(s);else if(s&&typeof s=="object"&&"type"in s){const o=s;"type"in o&&o.type!=="reactive"&&(o._parent=i),i&&i._renderedChildren.push(o);const a=_(o,n);a&&t.append(a)}}})}const pe="http://www.w3.org/2000/svg";function B(t,e=!1){if(t._dom)return t._dom;const i=e||t.type==="svg",n=i?document.createElementNS(pe,t.type):document.createElement(t.type),r=re(n,t.props,i);return t._onUnmountCallbacks.push(r),t.props.innerHTML!==void 0?n.innerHTML=typeof t.props.innerHTML=="object"?JSON.stringify(t.props.innerHTML):t.props.innerHTML:t.props.children&&$(n,t.props.children,t,i),t._dom=n,t._lifecycleState="mounted",t._onMountCallbacks.length>0&&t._onMountCallbacks.forEach(s=>s()),n}function _(t,e=!1){if("type"in t&&t.type==="reactive")return t._placeholder;if(typeof t.type=="string")return B(t,e);const i=t;h.setCurrentVNode(i);const n=i.type(i.props);if(h.setCurrentVNode(null),!n)return null;let r=null;if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")r=document.createTextNode(String(n));else if(n instanceof Node)i._element=n,r=n;else if(n&&typeof n=="object"&&"type"in n){const s=n;"type"in s&&s.type!=="reactive"&&(s._parent=i,i._renderedChildren.push(s));const o=_(s,e);o&&(i._element=o),r=o}return r&&i._onMountCallbacks.length>0&&i._onMountCallbacks.forEach(s=>{s()}),r&&(i._lifecycleState="mounted"),r}function ye(t,e){const i=t instanceof Node?t:_(t);i&&e.append(i)}function me(t){return document.createTreeWalker(t,NodeFilter.SHOW_ELEMENT|NodeFilter.SHOW_TEXT,null)}function be(t,e="self"){const i=me(t);return e==="children"&&i.firstChild(),{walker:i,isSVG:!1}}function ge(t,e,i,n){if(e==="class"||e==="className"){const r=typeof i=="string"?i:Array.isArray(i)?i.filter(Boolean).join(" "):typeof i=="object"?Object.entries(i).filter(([s,o])=>o).map(([s])=>s).join(" "):"";n?t.setAttribute("class",r):t.className=r;return}if(e==="style"){typeof i=="string"?t.setAttribute("style",i):typeof i=="object"&&i&&Object.assign(t.style,i);return}if(e==="viewTransitionName"){t.style.viewTransitionName=i;return}if(!n&&typeof i=="boolean"){i?t.setAttribute(e,""):t.removeAttribute(e);return}t.setAttribute(e,String(i))}function ve(t,e,i=!1,n){const r=[];for(const[s,o]of Object.entries(e))if(o!=null&&!(s==="children"||s==="key"||s==="autoanimate")){if(s==="ref"&&typeof o=="function"){n&&console.log("→ Attaching ref"),o(t);continue}if(s.startsWith("on")&&typeof o=="function"){const a=s.slice(2).toLowerCase();n&&console.log(`→ Attaching event: ${a}`),t.addEventListener(a,o);continue}if(typeof o=="function"&&s!=="ref"&&s!=="viewTransitionName"){n&&console.log(`→ Reactive prop: ${s}`);const a=g(()=>{const l=o();ge(t,s,l,i)});r.push(a);continue}}return()=>r.forEach(s=>s())}function _e(t,e,i=null,n){if(!e)return;const r=Array.isArray(e)?e:[e];if(!n.walker.firstChild()&&r.length>0){console.warn("Hydration mismatch: VNode has children but DOM is empty");return}for(const o of r)!o&&o!==0||Se(o,t,i,n);n.walker.parentNode()}function Se(t,e,i,n){if(!(!t&&t!==0)){if(typeof t=="string"||typeof t=="number"||typeof t=="boolean"){const r=n.walker.currentNode;r.nodeType===Node.TEXT_NODE?(n.debug&&console.log("→ Hydrated text node"),n.walker.nextSibling()):console.warn(`Hydration mismatch: expected text node but found ${r.nodeName}`);return}if(typeof t=="function"){n.debug&&console.log("→ Hydrating reactive child");const r=V(t);r._parent=i,i&&i._renderedChildren.push(r);const s=n.walker.currentNode,o=t();if(o&&typeof o=="object"&&"type"in o){const f=o;v(f,n),r._currentChild=f,r._currentDom=f._dom??f._element}else(typeof o=="string"||typeof o=="number"||typeof o=="boolean")&&(r._currentDom=s),n.walker.nextSibling();const a=document.createComment("reactive");r._currentDom?.parentNode&&r._currentDom.parentNode.insertBefore(a,r._currentDom),r._placeholder=a;let l=!0;const d=g(()=>{const f=t();if(l){l=!1;return}const{vnode:T,dom:W}=k(f,r);O(r,T,W)});r._dispose=d;return}if(t instanceof Node){n.walker.nextSibling();return}if(t&&typeof t=="object"&&"type"in t){const r=t;"type"in r&&r.type!=="reactive"&&r.type!=="suspended"&&(r._parent=i),i&&i._renderedChildren.push(r),v(r,n)}}}function ke(t,e){const i=e.walker.currentNode;if(i.nodeType!==Node.ELEMENT_NODE)return console.warn(`Hydration mismatch: expected element <${t.type}> but found ${i.nodeName}`),F(t,i,e);const n=i,r=n.tagName.toLowerCase();if(r!==t.type.toLowerCase())return console.warn(`Hydration mismatch: expected <${t.type}> but found <${r}>`),F(t,i,e);const s=e.isSVG||t.type==="svg",o=e.isSVG;e.isSVG=s,t._dom=n,e.debug&&console.log(`→ Attached existing <${t.type}> DOM`);const a=ve(n,t.props,s,e.debug);return t._onUnmountCallbacks.push(a),t.props.children&&_e(n,t.props.children,t,e),t._lifecycleState="mounted",t._onMountCallbacks.length>0&&t._onMountCallbacks.forEach(l=>l()),e.isSVG=o,e.walker.nextSibling(),n}function F(t,e,i){i.debug&&console.log(`→ Fallback: rendering <${t.type}> fresh`);const n=e.parentNode,r=e.nextSibling;n?.removeChild(e);const s=B(t,i.isSVG);return n&&(r?n.insertBefore(s,r):n.appendChild(s)),i.walker.nextSibling(),s}function v(t,e){if("type"in t&&t.type==="reactive")return e.debug&&console.log(`Hydrating ReactiveVNode #${t._id}`),Ee(t,e);if("type"in t&&t.type==="suspended")return e.debug&&console.log(`Hydrating SuspendedVNode: ${t._componentName}`),we(t,e);if(typeof t.type=="string")return e.debug&&console.log(`Hydrating <${t.type}>`),ke(t,e);const i=t.type.name||"Anonymous";return e.debug&&console.log(`Hydrating Component: ${i}`),Ce(t,e)}function Ce(t,e){h.setCurrentVNode(t);const i=t.type(t.props);if(h.setCurrentVNode(null),!i)return null;if(typeof i=="object"&&"type"in i&&i.type==="suspended")return v(i,e);let n=null;if(typeof i=="string"||typeof i=="number"||typeof i=="boolean"){const r=e.walker.currentNode;r.nodeType===Node.TEXT_NODE&&(t._element=r,n=r,e.walker.nextSibling())}else if(i instanceof Node)t._element=i,n=i,e.walker.nextSibling();else if(i&&typeof i=="object"&&"type"in i){const r=i;"type"in r&&r.type!=="reactive"&&(r._parent=t,t._renderedChildren.push(r));const s=v(r,e);s&&(t._element=s),n=s}return n&&t._onMountCallbacks.length>0&&(e.debug&&console.log(`→ Firing ${t._onMountCallbacks.length} onMount callback(s)`),t._onMountCallbacks.forEach(r=>r())),n&&(t._lifecycleState="mounted"),n}function Ee(t,e){const i=t.fn(),n=e.walker.currentNode,r=document.createComment("reactive");if(n.parentNode?.insertBefore(r,n),t._placeholder=r,i&&typeof i=="object"&&"type"in i){const a=i;v(a,e),t._currentChild=a,t._currentDom=a._dom??a._element}else(typeof i=="string"||typeof i=="number"||typeof i=="boolean")&&(t._currentDom=n),e.walker.nextSibling();let s=!0;const o=g(()=>{const a=t.fn();if(s){s=!1,e.debug&&console.log("→ Reactive effect setup (skipping initial)");return}const{vnode:l,dom:d}=k(a,t);O(t,l,d)});return t._dispose=o,t._currentDom}function we(t,e){const i=e.walker.currentNode;if(i.nodeType===Node.ELEMENT_NODE&&i.hasAttribute("data-suspended")){const r=i;return r.getAttribute("data-suspended-state")==="resolved"?(t._state="resolved",e.walker.firstChild(),t.promise.then(o=>{t._state="resolved"}).catch(o=>{t._state="error";const a=typeof t.errorFallback=="function"?t.errorFallback(o):t.errorFallback;r.innerHTML="";const l=C(a,e.isSVG);l&&r.appendChild(l)}),e.walker.parentNode(),e.walker.nextSibling(),r):(t._state="pending",t.promise.then(o=>{t._state="resolved",r.innerHTML="";const a=C(o,e.isSVG);a&&r.appendChild(a)}).catch(o=>{t._state="error";const a=typeof t.errorFallback=="function"?t.errorFallback(o):t.errorFallback;r.innerHTML="";const l=C(a,e.isSVG);l&&r.appendChild(l)}),e.walker.nextSibling(),r)}console.warn("Hydration mismatch: expected suspended container");const n=_(t,e.isSVG);return e.walker.nextSibling(),n}function C(t,e){return!t&&t!==0?null:typeof t=="string"||typeof t=="number"||typeof t=="boolean"?document.createTextNode(String(t)):t instanceof Node?t:typeof t=="object"&&"type"in t?_(t,e):typeof t=="function"?C(t(),e):null}function Te(t,e,i="self"){const n=be(e,i);v(t,n)}function Ne(t,e="Loading...",i="Error"){return n=>({type:"suspended",kind:"SuspendedVNode",promise:t(n),fallback:e,errorFallback:i,_id:h.newVNodeId(),_componentName:t.name||"AsyncComponent",_parent:null,_renderedChildren:[],_currentChild:null,_state:"pending"})}function Ae(t){if(!(typeof document>"u")){if(h.currentVNode===null)throw new Error("onMount must be called inside a component during render");h.currentVNode._onMountCallbacks.push(t)}}function xe(t){if(!(typeof document>"u")){if(h.currentVNode===null)throw new Error("onUnmount must be called inside a component during render");h.currentVNode._onUnmountCallbacks.push(t)}}function Me(t){if(!(typeof document>"u")){if(h.currentVNode===null)throw new Error("onBeforeExit must be called inside a component during render");h.currentVNode._onBeforeExitCallbacks.push(t)}}function Oe(t){if(!(typeof document>"u"))try{t()}catch(e){console.error(e)}}class Pe{readCallbacks=new Set;updateCallbacks=new Set;renderCallbacks=new Set;readKeepAlive=new Set;updateKeepAlive=new Set;renderKeepAlive=new Set;isProcessing=!1;frameScheduled=!1;frameId=null;lastTimestamp=0;currentDelta=0;trackFPS;fpsHistorySize;fpsHistory=[];constructor(e={}){this.trackFPS=e.trackFPS??!1,this.fpsHistorySize=e.fpsHistorySize??60}read(e,i=!1){return i?this.readKeepAlive.add(e):this.readCallbacks.add(e),this.scheduleFrame(),e}update(e,i=!1){return i?this.updateKeepAlive.add(e):this.updateCallbacks.add(e),this.scheduleFrame(),e}render(e,i=!1){return i?this.renderKeepAlive.add(e):this.renderCallbacks.add(e),this.scheduleFrame(),e}chain(e){let i,n;"read"in e&&this.readCallbacks.add(r=>{i=e.read(r)}),"update"in e?(this.updateCallbacks.add(r=>{n=e.update(i,r)}),this.renderCallbacks.add(r=>{e.render(n,r)})):this.renderCallbacks.add(r=>{e.render(i,r)}),this.scheduleFrame()}cancel(e){this.readCallbacks.delete(e),this.updateCallbacks.delete(e),this.renderCallbacks.delete(e),this.readKeepAlive.delete(e),this.updateKeepAlive.delete(e),this.renderKeepAlive.delete(e)}cancelAll(){this.frameId!==null&&(cancelAnimationFrame(this.frameId),this.frameId=null),this.readCallbacks.clear(),this.updateCallbacks.clear(),this.renderCallbacks.clear(),this.readKeepAlive.clear(),this.updateKeepAlive.clear(),this.renderKeepAlive.clear(),this.isProcessing=!1,this.frameScheduled=!1,this.lastTimestamp=0,this.currentDelta=0,this.trackFPS&&(this.fpsHistory=[])}get data(){return{timestamp:this.lastTimestamp,delta:this.currentDelta||16.67}}get isRunning(){return this.isProcessing||this.readKeepAlive.size>0||this.updateKeepAlive.size>0||this.renderKeepAlive.size>0}get fps(){return this.trackFPS?this.currentDelta>0?1e3/this.currentDelta:0:(console.warn("FPS tracking is disabled. Enable with { trackFPS: true }"),0)}get averageFps(){if(!this.trackFPS)return console.warn("FPS tracking is disabled. Enable with { trackFPS: true }"),0;if(this.fpsHistory.length===0)return 0;const e=this.fpsHistory.reduce((i,n)=>i+n,0);return Math.round(e/this.fpsHistory.length)}get refreshRate(){return this.trackFPS?Math.round(this.averageFps):(console.warn("FPS tracking is disabled. Enable with { trackFPS: true }"),0)}scheduleFrame(){this.frameScheduled||this.isProcessing||(this.frameScheduled=!0,this.frameId=requestAnimationFrame(e=>{this.processFrame(e)}))}processFrame(e){this.isProcessing=!0,this.frameScheduled=!1,this.lastTimestamp===0?this.currentDelta=16.67:this.currentDelta=e-this.lastTimestamp,this.lastTimestamp=e,this.trackFPS&&this.currentDelta>0&&(this.fpsHistory.push(1e3/this.currentDelta),this.fpsHistory.length>this.fpsHistorySize&&this.fpsHistory.shift());const i=this.data;this.executeCallbacks(this.readCallbacks,i),this.executeCallbacks(this.readKeepAlive,i),this.executeCallbacks(this.updateCallbacks,i),this.executeCallbacks(this.updateKeepAlive,i),this.executeCallbacks(this.renderCallbacks,i),this.executeCallbacks(this.renderKeepAlive,i),this.isProcessing=!1,this.hasKeepAliveCallbacks()&&this.scheduleFrame()}executeCallbacks(e,i){e.forEach(n=>{try{n(i)}catch(r){console.error("Frame callback error:",r)}}),this.isKeepAliveSet(e)||e.clear()}hasKeepAliveCallbacks(){return this.readKeepAlive.size>0||this.updateKeepAlive.size>0||this.renderKeepAlive.size>0}isKeepAliveSet(e){return e===this.readKeepAlive||e===this.updateKeepAlive||e===this.renderKeepAlive}}class De{gestureId=0;activeGestures=new Map;disabledGestures=new Map;capturedId;gestureWithPriority=new Map;maxPriority=-1/0;newId(){return++this.gestureId}canStart(e){if(this.capturedId!==void 0)return!1;const i=this.disabledGestures.get(e);return!(i&&i.size>0)}start(e,i,n){return this.canStart(i)?(this.activeGestures.set(e,i),this.gestureWithPriority.set(e,n),this.maxPriority=Math.max(this.maxPriority,n),!0):!1}capture(e,i,n){return!this.activeGestures.has(e)&&!this.start(e,i,n)?!1:n>=this.maxPriority?(this.capturedId=e,this.activeGestures.forEach((r,s)=>{s!==e&&this.release(s)}),!0):(this.release(e),!1)}release(e){const i=this.activeGestures.get(e);this.activeGestures.delete(e);const n=this.gestureWithPriority.get(e);if(this.gestureWithPriority.delete(e),this.capturedId===e&&(this.capturedId=void 0),n===this.maxPriority&&(this.maxPriority=-1/0,this.gestureWithPriority.forEach(r=>{this.maxPriority=Math.max(this.maxPriority,r)})),i){const r=this.disabledGestures.get(i);r&&(r.delete(e),r.size===0&&this.disabledGestures.delete(i))}}disableGesture(e,i){let n=this.disabledGestures.get(e);n||(n=new Set,this.disabledGestures.set(e,n)),n.add(i)}enableGesture(e,i){const n=this.disabledGestures.get(e);n&&(n.delete(i),n.size===0&&this.disabledGestures.delete(e))}createGesture(e,i){const n=this.newId(),r=i.name||"gesture-"+n,s=i.priority??0;return new Fe(this,n,e,r,s,i)}}class Fe{el;options;details;minTouches;maxTouches;threshold;direction;lastMoveTime=0;prevX=0;prevY=0;initialDistance=0;initialAngle=0;boundOnStart;boundOnMove;boundOnEnd;passive;hasPassedThreshold=!1;controller;id;name;priority;useThreshold;constructor(e,i,n,r,s,o){this.controller=e,this.id=i,this.el=n,this.options=o,this.name=r,this.priority=s*1e3+i,this.minTouches=o.minTouches??1,this.maxTouches=o.maxTouches??1/0,this.passive=o.passive??!0,this.threshold=o.threshold??0,this.direction=o.direction??"all",this.useThreshold=this.threshold>0,this.details={type:this.name,isTracking:!1,startX:0,startY:0,currentX:0,currentY:0,deltaX:0,deltaY:0,velocityX:0,velocityY:0,touchCount:0,scale:1,rotation:0},this.boundOnStart=this.onStart.bind(this),this.boundOnMove=this.onMove.bind(this),this.boundOnEnd=this.onEnd.bind(this)}getDistance(e){if(e.length<2)return 0;const i=e[0].clientX-e[1].clientX,n=e[0].clientY-e[1].clientY;return Math.sqrt(i*i+n*n)}getAngle(e){if(e.length<2)return 0;const i=e[1].clientX-e[0].clientX,n=e[1].clientY-e[0].clientY;return Math.atan2(n,i)*180/Math.PI}getCenter(e){if("touches"in e){if(e.touches.length===0)return{x:0,y:0};let i=0,n=0;for(let r=0;r<e.touches.length;r++)i+=e.touches[r].clientX,n+=e.touches[r].clientY;return{x:i/e.touches.length,y:n/e.touches.length}}else return{x:e.clientX,y:e.clientY}}canStart(e){const n="touches"in e?e.touches.length:1;return n>=this.minTouches&&n<=this.maxTouches&&this.controller.canStart(this.name)}checkThreshold(){if(!this.useThreshold)return!0;const{deltaX:e,deltaY:i}=this.details;return this.direction==="x"?Math.abs(e)>=this.threshold:this.direction==="y"?Math.abs(i)>=this.threshold:Math.sqrt(e*e+i*i)>=this.threshold}onStart(e){if(!this.canStart(e))return;const i="touches"in e,n=this.getCenter(e);this.details.startX=n.x,this.details.startY=n.y,this.details.currentX=n.x,this.details.currentY=n.y,this.details.touchCount=i?e.touches.length:1,this.details.event=e,i&&e.touches.length>=2?(this.initialDistance=this.getDistance(e.touches),this.initialAngle=this.getAngle(e.touches)):(this.initialDistance=0,this.initialAngle=0),!(this.options.canStart&&!this.options.canStart(this.details))&&(this.passive||e.preventDefault(),this.details.isTracking=!0,this.details.deltaX=0,this.details.deltaY=0,this.details.velocityX=0,this.details.velocityY=0,this.details.scale=1,this.details.rotation=0,this.hasPassedThreshold=!this.useThreshold,this.lastMoveTime=Date.now(),this.prevX=n.x,this.prevY=n.y,this.controller.start(this.id,this.name,this.priority),this.useThreshold||this.tryCapture())}onMove(e){if(!this.details.isTracking)return;this.passive||e.preventDefault();const i="touches"in e,n=this.getCenter(e),r=Date.now(),s=r-this.lastMoveTime;if(this.details.currentX=n.x,this.details.currentY=n.y,this.details.deltaX=this.details.currentX-this.details.startX,this.details.deltaY=this.details.currentY-this.details.startY,this.details.touchCount=i?e.touches.length:1,this.details.event=e,i&&e.touches.length>=2){const o=this.getDistance(e.touches),a=this.getAngle(e.touches);this.initialDistance>0&&(this.details.scale=o/this.initialDistance);let l=a-this.initialAngle;l>180&&(l-=360),l<-180&&(l+=360),this.details.rotation=l}else this.details.scale=1,this.details.rotation=0;if(s>0&&(this.details.velocityX=(this.details.currentX-this.prevX)/s,this.details.velocityY=(this.details.currentY-this.prevY)/s),this.prevX=this.details.currentX,this.prevY=this.details.currentY,this.lastMoveTime=r,!this.hasPassedThreshold&&this.checkThreshold()){this.hasPassedThreshold=!0,this.tryCapture();return}this.hasPassedThreshold&&this.options.onMove&&this.options.onMove(this.details)}tryCapture(){this.controller.capture(this.id,this.name,this.priority)&&this.options.onStart&&this.options.onStart(this.details)}onEnd(e){if(!this.details.isTracking)return;this.passive||e.preventDefault();const i="touches"in e;this.details.touchCount=i?e.touches.length:0,this.details.event=e,this.controller.release(this.id),this.details.isTracking=!1,this.hasPassedThreshold=!this.useThreshold,this.options.onEnd&&this.options.onEnd(this.details)}init(){if(!this.el)return;const e={passive:this.passive},i={passive:this.passive},n={passive:this.passive};this.el.addEventListener("touchstart",this.boundOnStart,e),document.addEventListener("touchmove",this.boundOnMove,i),document.addEventListener("touchend",this.boundOnEnd,n),document.addEventListener("touchcancel",this.boundOnEnd,n),this.el.addEventListener("mousedown",this.boundOnStart,e),document.addEventListener("mousemove",this.boundOnMove,i),document.addEventListener("mouseup",this.boundOnEnd,n),document.addEventListener("mouseleave",this.boundOnEnd,n)}destroy(){this.el&&(this.el.removeEventListener("touchstart",this.boundOnStart),document.removeEventListener("touchmove",this.boundOnMove),document.removeEventListener("touchend",this.boundOnEnd),document.removeEventListener("touchcancel",this.boundOnEnd),this.el.removeEventListener("mousedown",this.boundOnStart),document.removeEventListener("mousemove",this.boundOnMove),document.removeEventListener("mouseup",this.boundOnEnd),document.removeEventListener("mouseleave",this.boundOnEnd),this.controller.release(this.id))}}let N;function Le(){return N||(N=new De),N}function He(t,e){return Le().createGesture(t,e)}function Ie(t){typeof document>"u"||(document.startViewTransition?document.startViewTransition(t):t())}let Ke=0;function Ge(t,e=[],i={duration:500,namePrefix:"vt"}){if(!document.startViewTransition){t();return}const n=e.map((s,o)=>`${i.namePrefix}-${++Ke}-${o}`);e.forEach((s,o)=>{s.style.viewTransitionName=n[o]}),document.startViewTransition(()=>{t()}).finished.finally(()=>{e.forEach(s=>{s.style.viewTransitionName=""})}),document.documentElement.style.setProperty("--vt-duration",`${i.duration}ms`)}exports.createContext=L.createContext;exports.useContext=L.useContext;exports.Fragment=z.Fragment;exports.Computed=m;exports.Effect=b;exports.FrameScheduler=Pe;exports.Signal=u;exports.batch=q;exports.computed=J;exports.createGesture=He;exports.effect=g;exports.get=te;exports.hydrate=Te;exports.link=ne;exports.onBeforeExit=Me;exports.onLoad=Oe;exports.onMount=Ae;exports.onUnmount=xe;exports.peek=ee;exports.render=ye;exports.set=ie;exports.signal=Z;exports.startViewTransition=Ie;exports.suspend=Ne;exports.withViewTransition=Ge;
|