@jasonshimmy/custom-elements-runtime 2.5.7 → 2.5.8
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/custom-elements-runtime.cjs.js +1 -1
- package/dist/custom-elements-runtime.es.js +3 -3
- package/dist/custom-elements-runtime.router.cjs.js +1 -1
- package/dist/custom-elements-runtime.router.es.js +1 -1
- package/dist/custom-elements-runtime.transitions.cjs.js +1 -1
- package/dist/custom-elements-runtime.transitions.es.js +1 -1
- package/dist/{template-compiler-C4L8vT-6.cjs → template-compiler-DXKQZPJB.cjs} +2 -2
- package/dist/{template-compiler-C4L8vT-6.cjs.map → template-compiler-DXKQZPJB.cjs.map} +1 -1
- package/dist/{template-compiler-BO8UEEDA.js → template-compiler-DbHgEJzb.js} +2 -2
- package/dist/{template-compiler-BO8UEEDA.js.map → template-compiler-DbHgEJzb.js.map} +1 -1
- package/dist/{transitions-Di5wW9yc.js → transitions-Bo0DVkSp.js} +2 -2
- package/dist/transitions-Bo0DVkSp.js.map +1 -0
- package/dist/{transitions-DPZiuXb9.cjs → transitions-Cm2TlhoN.cjs} +2 -2
- package/dist/{transitions-Di5wW9yc.js.map → transitions-Cm2TlhoN.cjs.map} +1 -1
- package/package.json +1 -1
- package/dist/transitions-DPZiuXb9.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./template-compiler-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./template-compiler-DXKQZPJB.cjs"),c=require("./namespace-helpers-4qeKVqQw.cjs"),O=require("./transitions-Cm2TlhoN.cjs"),d=require("./logger-CSALKaYm.cjs"),x=100,k=3e4;function A(e,t,o){return o==="jitCacheHitRate"?e<t*.5?"critical":e<t?"warning":"healthy":e>t*2?"critical":e>t?"warning":"healthy"}function D(e){const t=[];return e.memoryUsage?.status!=="healthy"&&t.push("Consider reducing component complexity or implementing better memory cleanup"),e.averageRenderTime?.status!=="healthy"&&t.push("Optimize component render functions - consider lazy loading or virtualization"),e.jitCacheHitRate?.status!=="healthy"&&t.push("JIT CSS cache performance is poor - review CSS patterns for optimization"),e.componentErrorRate?.status!=="healthy"&&t.push("High component error rate detected - review error handling and component logic"),e.activeReactiveStates?.status!=="healthy"&&t.push("High number of reactive states - consider state consolidation or cleanup"),e.memoryLeakIndicator?.status!=="healthy"&&t.push("Potential memory leak detected - review component cleanup and event listener management"),t}function v(){const e=new Map,t=new Set;let o=null;function n(s,i,a){e.set(s,{name:s,value:i,threshold:a,status:"healthy",lastUpdated:Date.now(),history:[]})}function l(){n("activeComponents",0,1e3),n("componentCreateRate",0,50),n("componentErrorRate",0,.1),n("memoryUsage",0,50*1024*1024),n("memoryGrowthRate",0,1024*1024),n("averageRenderTime",0,16),n("slowRenderCount",0,10),n("jitCacheHitRate",100,80),n("activeReactiveStates",0,5e3),n("dependencyUpdates",0,100),n("memoryLeakIndicator",0,.1)}function m(s,i){const a=e.get(s);a&&(a.value=i,a.lastUpdated=Date.now(),a.history.push(i),a.history.length>x&&a.history.shift(),a.status=A(i,a.threshold,s))}function u(){const s={};let i="healthy";for(const[a,h]of e)s[a]={...h},h.status==="critical"?i="critical":h.status==="warning"&&i==="healthy"&&(i="warning");return{overall:i,metrics:s,timestamp:Date.now(),recommendations:D(s)}}function p(){if("memory"in performance&&performance.memory){const s=performance.memory;m("memoryUsage",s.usedJSHeapSize);const i=e.get("memoryUsage");if(i&&i.history.length>1){const a=i.history[i.history.length-2],h=i.history[i.history.length-1];m("memoryGrowthRate",Math.max(0,h-a))}}}function w(s){for(const i of t)try{i(s)}catch(a){d.devError("Error in health monitor listener:",a)}}function _(){p();const s=u();w(s),s.overall==="critical"?d.devError("🚨 Runtime Health: Critical issues detected",s.recommendations):s.overall==="warning"&&d.devWarn("⚠️ Runtime Health: Performance warnings",s.recommendations)}function R(){typeof window>"u"||(o=setInterval(_,k))}function H(){o!==null&&(clearInterval(o),o=null)}function M(s){t.add(s)}function L(s){t.delete(s)}function b(s){const i=e.get(s);return i?[...i.history]:[]}function T(){for(const s of e.values())s.history=[]}return l(),R(),{updateMetric:m,getHealthReport:u,addListener:M,removeListener:L,stop:H,getMetricHistory:b,clearHistory:T}}let f=null;function g(){return f||(f=v()),f}function I(e,t){g().updateMetric(e,t)}function U(){return g().getHealthReport()}function C(){typeof window>"u"||typeof customElements>"u"||customElements.get("cer-keep-alive")||customElements.define("cer-keep-alive",K())}function K(){return class extends HTMLElement{_cache=new Map;_slot=null;_slotListener=null;connectedCallback(){this.shadowRoot||this.attachShadow({mode:"open"}),this.shadowRoot.querySelector("slot")||(this.shadowRoot.innerHTML="<slot></slot>"),this._slot=this.shadowRoot.querySelector("slot"),this._slot&&(this._slotListener=()=>this._handleSlotChange(),this._slot.addEventListener("slotchange",this._slotListener),this._handleSlotChange())}disconnectedCallback(){this._slot&&this._slotListener&&this._slot.removeEventListener("slotchange",this._slotListener),this._slotListener=null}clearCache(t){t?this._cache.delete(t):this._cache.clear()}_handleSlotChange(){if(!this._slot)return;const t=this._slot.assignedElements({flatten:!0});for(const o of t){const n=this._buildCacheKey(o);if(!this._cache.has(n))this._cache.set(n,o);else{const l=this._cache.get(n);if(l!==o)try{o.parentNode?.replaceChild(l,o)}catch{this._cache.set(n,o)}}}}_buildCacheKey(t){const o=t.tagName.toLowerCase(),n=t.getAttribute("id");return n?`${o}:${n}`:o}}}function S(){customElements.get("cer-suspense")||r.component("cer-suspense",()=>{const{pending:e}=r.useProps({pending:!1});return e?r.html`<slot name="fallback"><span>Loading…</span></slot>`:r.html`<slot></slot>`})}function E(){customElements.get("cer-error-boundary")||r.component("cer-error-boundary",()=>{const e=c.ref(!1),t=c.ref("");return r.useOnError(o=>{e.value=!0,t.value=o.message}),r.useExpose({_cerHandleChildError:o=>{e.peek()||(e.value=!0,t.value=o instanceof Error?o.message:String(o))},reset:()=>{e.value=!1,t.value=""}}),e.value?r.html`<slot name="fallback"
|
|
2
2
|
><div role="alert">
|
|
3
3
|
<strong>Something went wrong.</strong>
|
|
4
4
|
${t.value?r.html`<p>${t.value}</p>`:r.html``}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { c as v, u as b, a as T, h as l, b as x, g as k, v as m, i as A } from "./template-compiler-
|
|
2
|
-
import { d as ee, e as te, p as ne, f as re, j as oe, k as se, l as ie, m as ae, n as ce } from "./template-compiler-
|
|
1
|
+
import { c as v, u as b, a as T, h as l, b as x, g as k, v as m, i as A } from "./template-compiler-DbHgEJzb.js";
|
|
2
|
+
import { d as ee, e as te, p as ne, f as re, j as oe, k as se, l as ie, m as ae, n as ce } from "./template-compiler-DbHgEJzb.js";
|
|
3
3
|
import { r as p, a as I } from "./namespace-helpers-DcD_6_K1.js";
|
|
4
4
|
import { R as ue, c as he, d as de, f as fe, i as me, n as pe, s as ye, u as ge, w as ve, b as Ce } from "./namespace-helpers-DcD_6_K1.js";
|
|
5
|
-
import { c as Se } from "./transitions-
|
|
5
|
+
import { c as Se } from "./transitions-Bo0DVkSp.js";
|
|
6
6
|
import { d as y, a as O } from "./logger-BvkEbVM4.js";
|
|
7
7
|
import { b as Re, s as Ee } from "./logger-BvkEbVM4.js";
|
|
8
8
|
const U = 100, D = 3e4;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./logger-CSALKaYm.cjs"),$=require("./namespace-helpers-4qeKVqQw.cjs"),x=require("./template-compiler-C4L8vT-6.cjs"),ot=require("./custom-elements-runtime.store.cjs.js"),bt=require("./custom-elements-runtime.directives.cjs.js"),rt={enabled:!0,offset:0,timeoutMs:2e3},tt=t=>t?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(t)):{},ft=t=>{if(!t||Object.keys(t).length===0)return"";try{return"?"+new URLSearchParams(t).toString()}catch{return""}},nt=t=>t?/^\s*javascript\s*:/i.test(t):!1,U=t=>/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)||t.startsWith("//"),dt=t=>{try{return decodeURIComponent(t)}catch{return t}};function A(t){if(!t)return"/";let r=t.replace(/\/+/g,"/");return r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r}const ht=t=>{if(!t)return"";const r=A(t);return r==="/"?"":r},st=new WeakMap;function wt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function St(t){const r=t.path||"/",v=A(r),a=v==="/"?[]:v.split("/").filter(Boolean),l=[],o=[];for(let u=0;u<a.length;u++){const f=a[u];if(f==="*"){if(u!==a.length-1)return c.devWarn(`Route '${t.path}' contains a '*' splat in a non-terminal position; splats must be the last segment. This route will be ignored.`),{invalid:!0};const W=`splat${l.length}`;l.push(W),o.push("__SPLAT__");continue}const y=f.match(/^:([A-Za-z0-9_-]+)(\*)?$/);if(y){const W=y[1],k=!!y[2];if(k&&u!==a.length-1)return c.devWarn(`Route '${t.path}' contains a splat param ':${W}*' in a non-terminal position; splats must be the last segment. This route will be ignored.`),{invalid:!0};l.push(W),o.push(k?"__SPLAT__":"([^/]+)");continue}o.push(wt(f))}let b;if(o.length===0)b="^/$";else if(o[o.length-1]==="__SPLAT__"){const f=o.slice(0,-1).join("/");f?b=`^/${f}(?:/(.*))?(?:/)?$`:b="^(?:/(.*))?(?:/)?$"}else b=`^/${o.join("/")}(?:/)?$`;try{return{regex:new RegExp(b),paramNames:l}}catch(u){return c.devWarn(`Failed to compile route regex for '${t.path}': ${String(u)}`),{invalid:!0}}}const F=(t,r)=>{const v=A(r);for(const a of t){let l=st.get(a);if(l||(l=St(a),st.set(a,l)),l.invalid)continue;const{regex:o,paramNames:b}=l,u=o.exec(v);if(u){const f={};for(let y=0;y<b.length;y++){const W=u[y+1]||"";f[b[y]]=W?dt(W):""}return{route:a,params:f}}}return{route:null,params:{}}};function Z(t,r){for(const v of t)if(F([v],r).route!==null)return v;return null}function Rt(t,r){return F(t,r)}const ct=50;let G={},L={};function pt(){G={},L={}}function Et(){const t=Object.entries(G);if(t.length<=ct)return;const v=t.sort(([,a],[,l])=>a.lastAccessed-l.lastAccessed).slice(0,t.length-ct);for(const[a]of v)delete G[a]}async function yt(t){if(t.component)return t.component;if(t.load){const r=G[t.path];if(r)return r.lastAccessed=Date.now(),r.component;if(L[t.path]!==void 0)return L[t.path];const v=typeof window>"u";try{const a=t.load().then(l=>{Et();const o=l.default;return G[t.path]={component:o,lastAccessed:Date.now()},delete L[t.path],o}).catch(l=>{delete L[t.path];const o=l instanceof Error?l.message:String(l);throw v&&c.devError(`SSR component load failed for route: ${t.path}. ${o}`),new Error(`Failed to load component for route: ${t.path}. ${o}`)});return L[t.path]=a,await a}catch(a){const l=a instanceof Error?a.message:String(a);throw new Error(`Failed to load component for route: ${t.path}. ${l}`,{cause:a})}}throw new Error(`No component or loader defined for route: ${t.path}`)}let g=null;function $t(t){g=t}function it(){return g}const j=new Set;let N=null;function mt(){if(N){try{N()}catch{}N=null}if(g)try{let t=!1;N=g.subscribe(r=>{t=!0;for(const v of j)try{v(r)}catch{}});try{C.base=g.base}catch{}if(t){const r=g.getCurrent();for(const v of j)try{v(r)}catch{}}else{const r=g.getCurrent();for(const v of j)try{v(r)}catch{}}try{typeof window<"u"&&$.flushDOMUpdates()}catch{}}catch{N=null}}function Ct(){mt()}const C={store:{subscribe(t){if(g)return g.store.subscribe(t);try{t({path:"/",params:{},query:{}})}catch{}return()=>{}},getState(){return g?g.getCurrent():{path:"/",params:{},query:{}}},setState(t){if(g)try{g.store.setState(t)}catch{}}},subscribe(t){if(typeof t!="function")return c.devWarn("activeRouterProxy.subscribe: listener must be a function"),()=>{};if(j.add(t),g)if(!N)mt();else try{const r=g.getCurrent();r&&t(r)}catch(r){c.devWarn("activeRouterProxy subscription failed",r)}else try{t({path:"/",params:{},query:{}})}catch(r){c.devWarn("activeRouterProxy fallback state delivery failed",r)}return()=>{try{if(j.delete(t),j.size===0&&N){try{N()}catch(r){c.devWarn("activeRouterProxy inner unsubscribe failed",r)}N=null}}catch(r){c.devWarn("activeRouterProxy unsubscribe failed",r)}}},getCurrent(){return g?g.getCurrent():{path:"/",params:{},query:{}}},async push(t){return g?g.push(t):Promise.resolve()},async replace(t){return g?g.replace(t):Promise.resolve()},back(){if(g)return g.back()},matchRoute(t){return g?g.matchRoute(t):{route:null,params:{}}},resolveRouteComponent(t){return g?g.resolveRouteComponent(t):Promise.reject(new Error("No active router"))},base:"",scrollToFragment(t){return g?g.scrollToFragment(t):Promise.resolve(!1)}};function vt(t){const{routes:r,base:v="",initialUrl:a,scrollToFragment:l=!0}=t,o=ht(v),b=typeof l=="boolean"?{...rt,enabled:l}:{...rt,...l};let u,f,y,W,k,z,B;const _=new Set,K=10;let q=0;const J=async(s,i)=>{const e=Z(r,s.path);if(!e||!e.beforeEnter)return!0;try{const n=await e.beforeEnter(s,i);if(typeof n=="string"){const p=`${s.path}->${n}`;return _.has(p)||q>=K?(c.devError(`Redirect loop detected: ${p}`),!1):n}return n!==!1}catch(n){c.devError("beforeEnter error",n);try{y.setState(i)}catch{}throw n}},X=async(s,i)=>{const e=Z(r,s.path);if(!e||!e.onEnter)return!0;try{const n=await e.onEnter(s,i);if(typeof n=="string"){const p=`${s.path}->${n}`;return _.has(p)||q>=K?(c.devError(`Redirect loop detected: ${p}`),!1):n}return n!==!1}catch(n){c.devError("onEnter error",n);try{y.setState(i)}catch{}throw n}},et=(s,i)=>{const e=Z(r,s.path);if(!(!e||!e.afterEnter))try{e.afterEnter(s,i)}catch(n){c.devError("afterEnter error",n)}},I=new Map,M=100,T=s=>{if(I.has(s))return I.get(s);const i=F(r,s);if(I.size>=M){const e=Math.floor(M*.25),n=Array.from(I.keys());for(let p=0;p<e&&p<n.length;p++)I.delete(n[p])}return I.set(s,i),i},Y=()=>{};async function V(s,i=0){try{const e=document.getElementById(s);if(!e)return!1;if(i>0)try{const n=e.getBoundingClientRect(),p=Math.max(0,window.scrollY+n.top-i);typeof window.scrollTo=="function"&&window.scrollTo({top:p,behavior:"auto"})}catch{try{e.scrollIntoView()}catch{return!1}}else if(typeof e.scrollIntoView=="function")try{e.scrollIntoView({behavior:"auto",block:"start",inline:"nearest"})}catch{try{e.scrollIntoView()}catch{return!1}}return!0}catch{return!1}}function h(s,i=0,e=2e3){return new Promise(n=>{let p=!1,m=null;const w=Date.now(),S=P=>{p||(p=!0,m&&clearTimeout(m),n(P))},E=async()=>{if(!p)try{if(await V(s,i))return S(!0);const P=async()=>{if(p)return;if(Date.now()-w>=e)return S(!1);try{if(await V(s,i))return S(!0);requestAnimationFrame(P)}catch(gt){c.devWarn("Scroll retry attempt failed:",gt),requestAnimationFrame(P)}};requestAnimationFrame(P)}catch(P){c.devWarn("Initial scroll attempt failed:",P),S(!1)}};m=setTimeout(()=>{S(!1)},e),E().catch(P=>{c.devWarn("Scroll attempt failed:",P),S(!1)})})}let R=!1;const d=async(s,i=!1)=>{if(R){c.devWarn(`Navigation to ${s} blocked - navigation already in progress`);return}R=!0,q=0,_.clear();try{await D(s,i)}finally{R=!1,q=0,_.clear()}},O=s=>{const i=s.indexOf("#"),e=i>=0?s.slice(i+1):"",n=i>=0?s.slice(0,i):s,p=n.indexOf("?"),m=p>=0?n.slice(0,p):n,w=p>=0?tt(n.slice(p)):{},S=m.startsWith(o)?m.slice(o.length):m;return{path:A(S||"/"),query:w,fragment:e}},D=async(s,i=!1)=>{try{const e=O(s),n=T(e.path);if(!n.route)throw new Error(`No route found for ${e.path}`);const p=y.getState(),m={path:e.path,params:n.params,query:e.query,fragment:e.fragment},w=await J(m,p);if(w===!1)return;if(typeof w=="string"){q++;const E=`${m.path}->${w}`;_.add(E),await D(w,!0);return}const S=await X(m,p);if(S===!1)return;if(typeof S=="string"){q++;const E=`${m.path}->${S}`;_.add(E),await D(S,!0);return}if(typeof window<"u"&&typeof document<"u"){const E=ft(e.query),P=o+e.path+(E||"")+(e.fragment?"#"+e.fragment:"");i?window.history.replaceState({},"",P):window.history.pushState({},"",P)}if(y.setState(m),et(m,p),typeof window<"u"&&typeof document<"u")try{const E=m.fragment;b.enabled&&E&&h(String(E),b.offset,b.timeoutMs).catch(()=>{})}catch{}}catch(e){if(c.devError("Navigation error:",e),e instanceof Error&&(e.stack?.includes("runBeforeEnter")||e.stack?.includes("runOnEnter")))throw e;try{const n=y.getState();if(!F(r,n.path).route){let m=r.find(w=>w.path==="/");if(m||(m=r.find(w=>!w.path.includes(":")&&!w.path.includes("*"))),!m&&r.length>0&&(m=r[0]),m){const w=F(r,m.path);y.setState({path:m.path,params:w.params,query:{}})}else c.devError("No fallback route available for error recovery")}}catch(n){c.devWarn("State recovery failed during navigation error:",n)}}};if((s=>{if(!s||s.length===0)return c.devError("Router configuration error: No routes provided"),!1;const i=new Set;for(const e of s){if(!e.path)return c.devError("Router configuration error: Route missing path",e),!1;i.has(e.path)&&c.devWarn(`Duplicate route path detected: ${e.path}`),i.add(e.path),!e.component&&!e.load&&c.devWarn(`Route '${e.path}' has no component or load function`)}return!0})(r),typeof window>"u"||typeof a<"u"){for(const s of r)T(s.path);c.devWarn(`Pre-compiled ${r.length} routes for SSR`)}if(typeof window<"u"&&typeof document<"u"&&typeof a>"u"){u=()=>{try{const e=new URL(window.location.href),n=e.pathname,p=n.startsWith(o)?n.slice(o.length):n,m=A(p||"/"),w=tt(e.search),S=e.hash&&e.hash.length?e.hash.slice(1):"";return{path:m,query:w,fragment:S}}catch(e){return c.devWarn("Invalid URL detected, falling back to safe defaults",e),{path:"/",query:{},fragment:""}}},f=u();const s=T(f.path);y=ot.createStore({path:f.path,params:s.params,query:f.query,fragment:f.fragment}),W=async(e=!1)=>{const n=u();await d(n.path,e)};const i=()=>W(!0);window.addEventListener("popstate",i),k=e=>d(e,!1),z=e=>d(e,!0),B=()=>window.history.back()}else{u=()=>{try{const e=new URL(a||"/","http://localhost"),n=e.pathname,p=n.startsWith(o)?n.slice(o.length):n,m=A(p||"/"),w=tt(e.search),S=e.hash&&e.hash.length?e.hash.slice(1):"";return{path:m,query:w,fragment:S}}catch(e){return c.devWarn("Invalid SSR URL detected, falling back to safe defaults",e),{path:"/",query:{},fragment:""}}},f=u();const s=T(f.path);y=ot.createStore({path:f.path,params:s.params,query:f.query,fragment:f.fragment}),W=async()=>{const e=u();await i(e.path)};const i=async e=>{if(q++,q>K){c.devError(`SSR redirect depth exceeded for path: ${e}`);return}try{const n=O(e),p=T(n.path);if(!p.route)throw new Error(`No route found for ${n.path}`);const m=y.getState(),w={path:n.path,params:p.params,query:n.query,fragment:n.fragment},S=Z(r,w.path);if(S?.beforeEnter){const E=await S.beforeEnter(w,m);if(typeof E=="string"){const P=`${w.path}->${E}`;_.add(P),await i(E);return}if(E===!1)return}if(S?.onEnter){const E=await S.onEnter(w,m);if(typeof E=="string"){const P=`${w.path}->${E}`;_.add(P),await i(E);return}if(E===!1)return}y.setState(w),S?.afterEnter&&S.afterEnter(w,m)}catch(n){throw c.devError("SSR navigation error:",n),n}};k=async e=>(q=0,_.clear(),i(e)),z=async e=>(q=0,_.clear(),i(e)),B=()=>{}}return{_cleanupScrollState:Y,store:y,push:k,replace:z,back:B,subscribe:y.subscribe,matchRoute:s=>T(s),getCurrent:()=>y.getState(),resolveRouteComponent:yt,base:o,scrollToFragment:s=>{const i=s||y.getState().fragment;return!i||typeof window>"u"||typeof document>"u"?Promise.resolve(!1):h(i,b.offset,b.timeoutMs)}}}function At(t){pt();const r=vt(t),v=it();if(v)try{v._cleanupScrollState?.()}catch{}$t(r);try{Ct();try{typeof window<"u"&&$.flushDOMUpdates()}catch{}try{typeof window<"u"&&queueMicrotask(()=>{try{$.flushDOMUpdates()}catch{}})}catch{}}catch{}return x.component("router-view",async()=>{if(!it())return x.html`<div>Router not initialized.</div>`;const a=$.ref(C.getCurrent()),l=typeof window>"u";let o;l||(x.useOnConnected(()=>{try{typeof C.subscribe=="function"&&(o=C.subscribe(u=>{try{u&&typeof u=="object"&&typeof u.path=="string"?a.value=u:(c.devWarn("router-view received invalid state",u),a.value={path:"/",params:{},query:{}})}catch(f){c.devWarn("router-view subscription update failed",f);try{a.value={path:"/",params:{},query:{}}}catch{}}}))}catch(u){c.devWarn("router-view subscribe failed",u)}}),x.useOnDisconnected(()=>{if(typeof o=="function"){try{o()}catch(u){c.devWarn("router-view unsubscribe failed",u)}o=void 0}}));const b=C.matchRoute(a.value.path);if(!b||!b.route)return x.html`<div>Not found</div>`;try{const f=await C.resolveRouteComponent(b.route);if(typeof f=="string")return{tag:f,props:{},children:[]};if(typeof f=="function"){const y=f();return(y instanceof Promise?y:Promise.resolve(y)).then(k=>typeof k=="string"?{tag:k,props:{},children:[]}:k)}return x.html`<div>Invalid route component</div>`}catch{return x.html`<div>Invalid route component</div>`}}),x.component("router-link",()=>{const a=x.useProps({to:"",tag:"a",replace:!1,exact:!1,activeClass:"active",exactActiveClass:"exact-active",ariaCurrentValue:"page",disabled:!1,external:!1,class:"",style:""}),l=typeof window>"u",o=$.ref(C.getCurrent()),b=o.value?.path||"/",u=String(a.to||""),f=l?{isExactActive:lt(b,u,C.base),isActive:ut(b,u,C.base),isExternal:U(u)||!!a.external}:null;let y;x.useStyle(()=>"a,button{display:inline-block;}");const W=$.ref(a.class||""),k=$.ref(a.style||"");if(!l){let h=null;x.useOnConnected(R=>{try{if(typeof C.subscribe=="function"){y=C.subscribe(d=>{try{d&&typeof d=="object"&&typeof d.path=="string"?o.value=d:(c.devWarn("router-link received invalid state",d),o.value={path:"/",params:{},query:{}})}catch(O){c.devWarn("router-link subscription update failed",O);try{o.value={path:"/",params:{},query:{}}}catch{}}});try{const d=C.getCurrent();d&&typeof d.path=="string"&&(o.value=d)}catch(d){c.devWarn("router-link initial state sync failed",d)}h=setInterval(()=>{try{const d=C.getCurrent();d&&typeof d.path=="string"&&JSON.stringify(o.value)!==JSON.stringify(d)&&(o.value=d)}catch{}},100)}}catch(d){c.devWarn("router-link subscribe failed",d)}try{const d=R?._host;if(d instanceof HTMLElement){const O=d.getAttribute("class"),D=d.getAttribute("style");O&&(W.value=O),D&&(k.value=D),O!==null&&d.removeAttribute("class"),D!==null&&d.removeAttribute("style");try{R?._requestRender?.();try{$.flushDOMUpdates()}catch{}}catch{}}}catch(d){c.devWarn("router-link host migration failed",d)}}),x.useOnDisconnected(()=>{if(typeof y=="function")try{y()}catch(R){c.devWarn("router-link unsubscribe failed",R)}finally{y=void 0}if(h)try{clearInterval(h)}catch(R){c.devWarn("router-link sync interval cleanup failed",R)}finally{h=null}})}const z=$.computed(()=>{if(l&&f)return f.isExactActive;try{const h=C.base??"",R=a.to||"";return!o.value||typeof o.value.path!="string"?!1:lt(o.value.path,R,h)}catch(h){return c.devWarn("isExactActive computation error",h),!1}}),B=$.computed(()=>{if(l&&f)return f.isActive;try{const h=C.base??"",R=a.to||"";return!o.value||typeof o.value.path!="string"?!1:a.exact?z.value:ut(o.value.path,R,h)}catch(h){return c.devWarn("isActive computation error",h),!1}}),_=$.computed(()=>{const h=String(a.to||"");if(nt(h))return null;if(U(h))return h;const[R,d]=h.split("#"),[O,D]=(R||"").split("?"),H=C.base??"";let Q=O||"/";if(H&&H!=="/"){const s=A(H),i=A(Q);i.startsWith(s)?Q=i.slice(s.length)||"/":Q=i}const at=A(Q||"/");return H+at+(D?"?"+D:"")+(d?"#"+d:"")}),K=$.computed(()=>{const R=(W&&W.value||a.class||"").split(/\s+/).filter(Boolean),d={};for(const O of R)d[O]=!0;return d}),q=$.computed(()=>({...K.value,[a.activeClass||"active"]:B.value,[a.exactActiveClass||"exact-active"]:z.value})),J=$.computed(()=>Object.keys(q.value).filter(h=>q.value[h]).join(" ")),X=$.computed(()=>a.tag||"a"),et=$.computed(()=>X.value==="button"),I=$.computed(()=>z.value?a.ariaCurrentValue:null),M=$.computed(()=>!!a.disabled),T=$.computed(()=>{const h=String(a.to||"");return(U(h)||!!a.external)&&X.value==="a"}),Y=$.computed(()=>k&&k.value||a.style||""),V=h=>{if(h.defaultPrevented||h.button!==0||h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)return;if(M.value){h.preventDefault();return}const R=String(a.to||"");if(nt(R)){try{h.preventDefault()}catch{}c.devWarn("Blocked unsafe javascript: URI in router-link.to");return}T.value||(h.preventDefault(),a.replace?C.replace(a.to):C.push(a.to))};return x.html`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("./logger-CSALKaYm.cjs"),$=require("./namespace-helpers-4qeKVqQw.cjs"),x=require("./template-compiler-DXKQZPJB.cjs"),ot=require("./custom-elements-runtime.store.cjs.js"),bt=require("./custom-elements-runtime.directives.cjs.js"),rt={enabled:!0,offset:0,timeoutMs:2e3},tt=t=>t?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(t)):{},ft=t=>{if(!t||Object.keys(t).length===0)return"";try{return"?"+new URLSearchParams(t).toString()}catch{return""}},nt=t=>t?/^\s*javascript\s*:/i.test(t):!1,U=t=>/^[a-zA-Z][a-zA-Z0-9+.-]*:/.test(t)||t.startsWith("//"),dt=t=>{try{return decodeURIComponent(t)}catch{return t}};function A(t){if(!t)return"/";let r=t.replace(/\/+/g,"/");return r.startsWith("/")||(r="/"+r),r.length>1&&r.endsWith("/")&&(r=r.slice(0,-1)),r}const ht=t=>{if(!t)return"";const r=A(t);return r==="/"?"":r},st=new WeakMap;function wt(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function St(t){const r=t.path||"/",v=A(r),a=v==="/"?[]:v.split("/").filter(Boolean),l=[],o=[];for(let u=0;u<a.length;u++){const f=a[u];if(f==="*"){if(u!==a.length-1)return c.devWarn(`Route '${t.path}' contains a '*' splat in a non-terminal position; splats must be the last segment. This route will be ignored.`),{invalid:!0};const W=`splat${l.length}`;l.push(W),o.push("__SPLAT__");continue}const y=f.match(/^:([A-Za-z0-9_-]+)(\*)?$/);if(y){const W=y[1],k=!!y[2];if(k&&u!==a.length-1)return c.devWarn(`Route '${t.path}' contains a splat param ':${W}*' in a non-terminal position; splats must be the last segment. This route will be ignored.`),{invalid:!0};l.push(W),o.push(k?"__SPLAT__":"([^/]+)");continue}o.push(wt(f))}let b;if(o.length===0)b="^/$";else if(o[o.length-1]==="__SPLAT__"){const f=o.slice(0,-1).join("/");f?b=`^/${f}(?:/(.*))?(?:/)?$`:b="^(?:/(.*))?(?:/)?$"}else b=`^/${o.join("/")}(?:/)?$`;try{return{regex:new RegExp(b),paramNames:l}}catch(u){return c.devWarn(`Failed to compile route regex for '${t.path}': ${String(u)}`),{invalid:!0}}}const F=(t,r)=>{const v=A(r);for(const a of t){let l=st.get(a);if(l||(l=St(a),st.set(a,l)),l.invalid)continue;const{regex:o,paramNames:b}=l,u=o.exec(v);if(u){const f={};for(let y=0;y<b.length;y++){const W=u[y+1]||"";f[b[y]]=W?dt(W):""}return{route:a,params:f}}}return{route:null,params:{}}};function Z(t,r){for(const v of t)if(F([v],r).route!==null)return v;return null}function Rt(t,r){return F(t,r)}const ct=50;let G={},L={};function pt(){G={},L={}}function Et(){const t=Object.entries(G);if(t.length<=ct)return;const v=t.sort(([,a],[,l])=>a.lastAccessed-l.lastAccessed).slice(0,t.length-ct);for(const[a]of v)delete G[a]}async function yt(t){if(t.component)return t.component;if(t.load){const r=G[t.path];if(r)return r.lastAccessed=Date.now(),r.component;if(L[t.path]!==void 0)return L[t.path];const v=typeof window>"u";try{const a=t.load().then(l=>{Et();const o=l.default;return G[t.path]={component:o,lastAccessed:Date.now()},delete L[t.path],o}).catch(l=>{delete L[t.path];const o=l instanceof Error?l.message:String(l);throw v&&c.devError(`SSR component load failed for route: ${t.path}. ${o}`),new Error(`Failed to load component for route: ${t.path}. ${o}`)});return L[t.path]=a,await a}catch(a){const l=a instanceof Error?a.message:String(a);throw new Error(`Failed to load component for route: ${t.path}. ${l}`,{cause:a})}}throw new Error(`No component or loader defined for route: ${t.path}`)}let g=null;function $t(t){g=t}function it(){return g}const j=new Set;let N=null;function mt(){if(N){try{N()}catch{}N=null}if(g)try{let t=!1;N=g.subscribe(r=>{t=!0;for(const v of j)try{v(r)}catch{}});try{C.base=g.base}catch{}if(t){const r=g.getCurrent();for(const v of j)try{v(r)}catch{}}else{const r=g.getCurrent();for(const v of j)try{v(r)}catch{}}try{typeof window<"u"&&$.flushDOMUpdates()}catch{}}catch{N=null}}function Ct(){mt()}const C={store:{subscribe(t){if(g)return g.store.subscribe(t);try{t({path:"/",params:{},query:{}})}catch{}return()=>{}},getState(){return g?g.getCurrent():{path:"/",params:{},query:{}}},setState(t){if(g)try{g.store.setState(t)}catch{}}},subscribe(t){if(typeof t!="function")return c.devWarn("activeRouterProxy.subscribe: listener must be a function"),()=>{};if(j.add(t),g)if(!N)mt();else try{const r=g.getCurrent();r&&t(r)}catch(r){c.devWarn("activeRouterProxy subscription failed",r)}else try{t({path:"/",params:{},query:{}})}catch(r){c.devWarn("activeRouterProxy fallback state delivery failed",r)}return()=>{try{if(j.delete(t),j.size===0&&N){try{N()}catch(r){c.devWarn("activeRouterProxy inner unsubscribe failed",r)}N=null}}catch(r){c.devWarn("activeRouterProxy unsubscribe failed",r)}}},getCurrent(){return g?g.getCurrent():{path:"/",params:{},query:{}}},async push(t){return g?g.push(t):Promise.resolve()},async replace(t){return g?g.replace(t):Promise.resolve()},back(){if(g)return g.back()},matchRoute(t){return g?g.matchRoute(t):{route:null,params:{}}},resolveRouteComponent(t){return g?g.resolveRouteComponent(t):Promise.reject(new Error("No active router"))},base:"",scrollToFragment(t){return g?g.scrollToFragment(t):Promise.resolve(!1)}};function vt(t){const{routes:r,base:v="",initialUrl:a,scrollToFragment:l=!0}=t,o=ht(v),b=typeof l=="boolean"?{...rt,enabled:l}:{...rt,...l};let u,f,y,W,k,z,B;const _=new Set,K=10;let q=0;const J=async(s,i)=>{const e=Z(r,s.path);if(!e||!e.beforeEnter)return!0;try{const n=await e.beforeEnter(s,i);if(typeof n=="string"){const p=`${s.path}->${n}`;return _.has(p)||q>=K?(c.devError(`Redirect loop detected: ${p}`),!1):n}return n!==!1}catch(n){c.devError("beforeEnter error",n);try{y.setState(i)}catch{}throw n}},X=async(s,i)=>{const e=Z(r,s.path);if(!e||!e.onEnter)return!0;try{const n=await e.onEnter(s,i);if(typeof n=="string"){const p=`${s.path}->${n}`;return _.has(p)||q>=K?(c.devError(`Redirect loop detected: ${p}`),!1):n}return n!==!1}catch(n){c.devError("onEnter error",n);try{y.setState(i)}catch{}throw n}},et=(s,i)=>{const e=Z(r,s.path);if(!(!e||!e.afterEnter))try{e.afterEnter(s,i)}catch(n){c.devError("afterEnter error",n)}},I=new Map,M=100,T=s=>{if(I.has(s))return I.get(s);const i=F(r,s);if(I.size>=M){const e=Math.floor(M*.25),n=Array.from(I.keys());for(let p=0;p<e&&p<n.length;p++)I.delete(n[p])}return I.set(s,i),i},Y=()=>{};async function V(s,i=0){try{const e=document.getElementById(s);if(!e)return!1;if(i>0)try{const n=e.getBoundingClientRect(),p=Math.max(0,window.scrollY+n.top-i);typeof window.scrollTo=="function"&&window.scrollTo({top:p,behavior:"auto"})}catch{try{e.scrollIntoView()}catch{return!1}}else if(typeof e.scrollIntoView=="function")try{e.scrollIntoView({behavior:"auto",block:"start",inline:"nearest"})}catch{try{e.scrollIntoView()}catch{return!1}}return!0}catch{return!1}}function h(s,i=0,e=2e3){return new Promise(n=>{let p=!1,m=null;const w=Date.now(),S=P=>{p||(p=!0,m&&clearTimeout(m),n(P))},E=async()=>{if(!p)try{if(await V(s,i))return S(!0);const P=async()=>{if(p)return;if(Date.now()-w>=e)return S(!1);try{if(await V(s,i))return S(!0);requestAnimationFrame(P)}catch(gt){c.devWarn("Scroll retry attempt failed:",gt),requestAnimationFrame(P)}};requestAnimationFrame(P)}catch(P){c.devWarn("Initial scroll attempt failed:",P),S(!1)}};m=setTimeout(()=>{S(!1)},e),E().catch(P=>{c.devWarn("Scroll attempt failed:",P),S(!1)})})}let R=!1;const d=async(s,i=!1)=>{if(R){c.devWarn(`Navigation to ${s} blocked - navigation already in progress`);return}R=!0,q=0,_.clear();try{await D(s,i)}finally{R=!1,q=0,_.clear()}},O=s=>{const i=s.indexOf("#"),e=i>=0?s.slice(i+1):"",n=i>=0?s.slice(0,i):s,p=n.indexOf("?"),m=p>=0?n.slice(0,p):n,w=p>=0?tt(n.slice(p)):{},S=m.startsWith(o)?m.slice(o.length):m;return{path:A(S||"/"),query:w,fragment:e}},D=async(s,i=!1)=>{try{const e=O(s),n=T(e.path);if(!n.route)throw new Error(`No route found for ${e.path}`);const p=y.getState(),m={path:e.path,params:n.params,query:e.query,fragment:e.fragment},w=await J(m,p);if(w===!1)return;if(typeof w=="string"){q++;const E=`${m.path}->${w}`;_.add(E),await D(w,!0);return}const S=await X(m,p);if(S===!1)return;if(typeof S=="string"){q++;const E=`${m.path}->${S}`;_.add(E),await D(S,!0);return}if(typeof window<"u"&&typeof document<"u"){const E=ft(e.query),P=o+e.path+(E||"")+(e.fragment?"#"+e.fragment:"");i?window.history.replaceState({},"",P):window.history.pushState({},"",P)}if(y.setState(m),et(m,p),typeof window<"u"&&typeof document<"u")try{const E=m.fragment;b.enabled&&E&&h(String(E),b.offset,b.timeoutMs).catch(()=>{})}catch{}}catch(e){if(c.devError("Navigation error:",e),e instanceof Error&&(e.stack?.includes("runBeforeEnter")||e.stack?.includes("runOnEnter")))throw e;try{const n=y.getState();if(!F(r,n.path).route){let m=r.find(w=>w.path==="/");if(m||(m=r.find(w=>!w.path.includes(":")&&!w.path.includes("*"))),!m&&r.length>0&&(m=r[0]),m){const w=F(r,m.path);y.setState({path:m.path,params:w.params,query:{}})}else c.devError("No fallback route available for error recovery")}}catch(n){c.devWarn("State recovery failed during navigation error:",n)}}};if((s=>{if(!s||s.length===0)return c.devError("Router configuration error: No routes provided"),!1;const i=new Set;for(const e of s){if(!e.path)return c.devError("Router configuration error: Route missing path",e),!1;i.has(e.path)&&c.devWarn(`Duplicate route path detected: ${e.path}`),i.add(e.path),!e.component&&!e.load&&c.devWarn(`Route '${e.path}' has no component or load function`)}return!0})(r),typeof window>"u"||typeof a<"u"){for(const s of r)T(s.path);c.devWarn(`Pre-compiled ${r.length} routes for SSR`)}if(typeof window<"u"&&typeof document<"u"&&typeof a>"u"){u=()=>{try{const e=new URL(window.location.href),n=e.pathname,p=n.startsWith(o)?n.slice(o.length):n,m=A(p||"/"),w=tt(e.search),S=e.hash&&e.hash.length?e.hash.slice(1):"";return{path:m,query:w,fragment:S}}catch(e){return c.devWarn("Invalid URL detected, falling back to safe defaults",e),{path:"/",query:{},fragment:""}}},f=u();const s=T(f.path);y=ot.createStore({path:f.path,params:s.params,query:f.query,fragment:f.fragment}),W=async(e=!1)=>{const n=u();await d(n.path,e)};const i=()=>W(!0);window.addEventListener("popstate",i),k=e=>d(e,!1),z=e=>d(e,!0),B=()=>window.history.back()}else{u=()=>{try{const e=new URL(a||"/","http://localhost"),n=e.pathname,p=n.startsWith(o)?n.slice(o.length):n,m=A(p||"/"),w=tt(e.search),S=e.hash&&e.hash.length?e.hash.slice(1):"";return{path:m,query:w,fragment:S}}catch(e){return c.devWarn("Invalid SSR URL detected, falling back to safe defaults",e),{path:"/",query:{},fragment:""}}},f=u();const s=T(f.path);y=ot.createStore({path:f.path,params:s.params,query:f.query,fragment:f.fragment}),W=async()=>{const e=u();await i(e.path)};const i=async e=>{if(q++,q>K){c.devError(`SSR redirect depth exceeded for path: ${e}`);return}try{const n=O(e),p=T(n.path);if(!p.route)throw new Error(`No route found for ${n.path}`);const m=y.getState(),w={path:n.path,params:p.params,query:n.query,fragment:n.fragment},S=Z(r,w.path);if(S?.beforeEnter){const E=await S.beforeEnter(w,m);if(typeof E=="string"){const P=`${w.path}->${E}`;_.add(P),await i(E);return}if(E===!1)return}if(S?.onEnter){const E=await S.onEnter(w,m);if(typeof E=="string"){const P=`${w.path}->${E}`;_.add(P),await i(E);return}if(E===!1)return}y.setState(w),S?.afterEnter&&S.afterEnter(w,m)}catch(n){throw c.devError("SSR navigation error:",n),n}};k=async e=>(q=0,_.clear(),i(e)),z=async e=>(q=0,_.clear(),i(e)),B=()=>{}}return{_cleanupScrollState:Y,store:y,push:k,replace:z,back:B,subscribe:y.subscribe,matchRoute:s=>T(s),getCurrent:()=>y.getState(),resolveRouteComponent:yt,base:o,scrollToFragment:s=>{const i=s||y.getState().fragment;return!i||typeof window>"u"||typeof document>"u"?Promise.resolve(!1):h(i,b.offset,b.timeoutMs)}}}function At(t){pt();const r=vt(t),v=it();if(v)try{v._cleanupScrollState?.()}catch{}$t(r);try{Ct();try{typeof window<"u"&&$.flushDOMUpdates()}catch{}try{typeof window<"u"&&queueMicrotask(()=>{try{$.flushDOMUpdates()}catch{}})}catch{}}catch{}return x.component("router-view",async()=>{if(!it())return x.html`<div>Router not initialized.</div>`;const a=$.ref(C.getCurrent()),l=typeof window>"u";let o;l||(x.useOnConnected(()=>{try{typeof C.subscribe=="function"&&(o=C.subscribe(u=>{try{u&&typeof u=="object"&&typeof u.path=="string"?a.value=u:(c.devWarn("router-view received invalid state",u),a.value={path:"/",params:{},query:{}})}catch(f){c.devWarn("router-view subscription update failed",f);try{a.value={path:"/",params:{},query:{}}}catch{}}}))}catch(u){c.devWarn("router-view subscribe failed",u)}}),x.useOnDisconnected(()=>{if(typeof o=="function"){try{o()}catch(u){c.devWarn("router-view unsubscribe failed",u)}o=void 0}}));const b=C.matchRoute(a.value.path);if(!b||!b.route)return x.html`<div>Not found</div>`;try{const f=await C.resolveRouteComponent(b.route);if(typeof f=="string")return{tag:f,props:{},children:[]};if(typeof f=="function"){const y=f();return(y instanceof Promise?y:Promise.resolve(y)).then(k=>typeof k=="string"?{tag:k,props:{},children:[]}:k)}return x.html`<div>Invalid route component</div>`}catch{return x.html`<div>Invalid route component</div>`}}),x.component("router-link",()=>{const a=x.useProps({to:"",tag:"a",replace:!1,exact:!1,activeClass:"active",exactActiveClass:"exact-active",ariaCurrentValue:"page",disabled:!1,external:!1,class:"",style:""}),l=typeof window>"u",o=$.ref(C.getCurrent()),b=o.value?.path||"/",u=String(a.to||""),f=l?{isExactActive:lt(b,u,C.base),isActive:ut(b,u,C.base),isExternal:U(u)||!!a.external}:null;let y;x.useStyle(()=>"a,button{display:inline-block;}");const W=$.ref(a.class||""),k=$.ref(a.style||"");if(!l){let h=null;x.useOnConnected(R=>{try{if(typeof C.subscribe=="function"){y=C.subscribe(d=>{try{d&&typeof d=="object"&&typeof d.path=="string"?o.value=d:(c.devWarn("router-link received invalid state",d),o.value={path:"/",params:{},query:{}})}catch(O){c.devWarn("router-link subscription update failed",O);try{o.value={path:"/",params:{},query:{}}}catch{}}});try{const d=C.getCurrent();d&&typeof d.path=="string"&&(o.value=d)}catch(d){c.devWarn("router-link initial state sync failed",d)}h=setInterval(()=>{try{const d=C.getCurrent();d&&typeof d.path=="string"&&JSON.stringify(o.value)!==JSON.stringify(d)&&(o.value=d)}catch{}},100)}}catch(d){c.devWarn("router-link subscribe failed",d)}try{const d=R?._host;if(d instanceof HTMLElement){const O=d.getAttribute("class"),D=d.getAttribute("style");O&&(W.value=O),D&&(k.value=D),O!==null&&d.removeAttribute("class"),D!==null&&d.removeAttribute("style");try{R?._requestRender?.();try{$.flushDOMUpdates()}catch{}}catch{}}}catch(d){c.devWarn("router-link host migration failed",d)}}),x.useOnDisconnected(()=>{if(typeof y=="function")try{y()}catch(R){c.devWarn("router-link unsubscribe failed",R)}finally{y=void 0}if(h)try{clearInterval(h)}catch(R){c.devWarn("router-link sync interval cleanup failed",R)}finally{h=null}})}const z=$.computed(()=>{if(l&&f)return f.isExactActive;try{const h=C.base??"",R=a.to||"";return!o.value||typeof o.value.path!="string"?!1:lt(o.value.path,R,h)}catch(h){return c.devWarn("isExactActive computation error",h),!1}}),B=$.computed(()=>{if(l&&f)return f.isActive;try{const h=C.base??"",R=a.to||"";return!o.value||typeof o.value.path!="string"?!1:a.exact?z.value:ut(o.value.path,R,h)}catch(h){return c.devWarn("isActive computation error",h),!1}}),_=$.computed(()=>{const h=String(a.to||"");if(nt(h))return null;if(U(h))return h;const[R,d]=h.split("#"),[O,D]=(R||"").split("?"),H=C.base??"";let Q=O||"/";if(H&&H!=="/"){const s=A(H),i=A(Q);i.startsWith(s)?Q=i.slice(s.length)||"/":Q=i}const at=A(Q||"/");return H+at+(D?"?"+D:"")+(d?"#"+d:"")}),K=$.computed(()=>{const R=(W&&W.value||a.class||"").split(/\s+/).filter(Boolean),d={};for(const O of R)d[O]=!0;return d}),q=$.computed(()=>({...K.value,[a.activeClass||"active"]:B.value,[a.exactActiveClass||"exact-active"]:z.value})),J=$.computed(()=>Object.keys(q.value).filter(h=>q.value[h]).join(" ")),X=$.computed(()=>a.tag||"a"),et=$.computed(()=>X.value==="button"),I=$.computed(()=>z.value?a.ariaCurrentValue:null),M=$.computed(()=>!!a.disabled),T=$.computed(()=>{const h=String(a.to||"");return(U(h)||!!a.external)&&X.value==="a"}),Y=$.computed(()=>k&&k.value||a.style||""),V=h=>{if(h.defaultPrevented||h.button!==0||h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)return;if(M.value){h.preventDefault();return}const R=String(a.to||"");if(nt(R)){try{h.preventDefault()}catch{}c.devWarn("Blocked unsafe javascript: URI in router-link.to");return}T.value||(h.preventDefault(),a.replace?C.replace(a.to):C.push(a.to))};return x.html`
|
|
2
2
|
${bt.match().when(et.value,x.html`
|
|
3
3
|
<button
|
|
4
4
|
part="button"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { a as y, d as I } from "./logger-BvkEbVM4.js";
|
|
2
2
|
import { f as rt, r as tt, c as T } from "./namespace-helpers-DcD_6_K1.js";
|
|
3
|
-
import { c as st, h as F, k as ct, l as it, b as bt, n as wt } from "./template-compiler-
|
|
3
|
+
import { c as st, h as F, k as ct, l as it, b as bt, n as wt } from "./template-compiler-DbHgEJzb.js";
|
|
4
4
|
import { createStore as lt } from "./custom-elements-runtime.store.es.js";
|
|
5
5
|
import { match as St } from "./custom-elements-runtime.directives.es.js";
|
|
6
6
|
const ut = {
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./custom-elements-runtime.directives.cjs.js");const t=require("./transitions-
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});require("./custom-elements-runtime.directives.cjs.js");const t=require("./transitions-Cm2TlhoN.cjs");exports.Transition=t.Transition;exports.TransitionGroup=t.TransitionGroup;exports.createTransitionPreset=t.createTransitionPreset;exports.getTransitionStyleSheet=t.getTransitionStyleSheet;exports.transitionPresets=t.transitionPresets;
|
|
2
2
|
//# sourceMappingURL=custom-elements-runtime.transitions.cjs.js.map
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import "./custom-elements-runtime.directives.es.js";
|
|
2
|
-
import { T as r, e as a, f as i, b as n, t as o } from "./transitions-
|
|
2
|
+
import { T as r, e as a, f as i, b as n, t as o } from "./transitions-Bo0DVkSp.js";
|
|
3
3
|
export {
|
|
4
4
|
r as Transition,
|
|
5
5
|
a as TransitionGroup,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";const l=require("./namespace-helpers-4qeKVqQw.cjs"),x=require("./logger-CSALKaYm.cjs"),B=require("./transitions-DPZiuXb9.cjs"),le=new Map,Me=Symbol.for("cer.registry");function it(){if(!(typeof window>"u"&&typeof document>"u"&&typeof navigator>"u"))try{const n=globalThis;if(!n[Me]){const t=crypto.randomUUID();n[Me]=new Map([...le.entries()]),n[Me].__realmId=t}}catch(n){x.devWarn("Could not initialize global registry:",n)}}function ot(e,n,t){if(t)for(const[s,r]of Object.entries(t)){let o,i={};if(Array.isArray(r)?(o=r[0],i=r[1]||{}):o=r,n.set(s,{callback:o,options:i,oldValue:l.getNestedValue(e,s)}),i.immediate)try{const a=l.getNestedValue(e,s);o(a,void 0,e)}catch(a){x.devError(`Error in immediate watcher for "${s}":`,a)}}}function at(e,n,t,s){const r=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((p,_)=>r(p,a[_]));const u=i,d=a,y=Object.keys(u||{}),h=Object.keys(d||{});return y.length!==h.length?!1:y.every(p=>r(u[p],d[p]))},o=n.get(t);if(o&&!r(s,o.oldValue))try{o.callback(s,o.oldValue,e),o.oldValue=s}catch(i){x.devError(`Error in watcher for "${t}":`,i)}for(const[i,a]of n.entries())if(a.options.deep&&t.startsWith(i+"."))try{const u=l.getNestedValue(e,i);r(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){x.devError(`Error in deep watcher for "${i}":`,u)}}function je(e,n){return n===Boolean?e===""||e==="true":n===Number?Number(e):e}function ct(e,n,t){if(n)for(const s in n){const r=n[s],o=l.toKebab(s),i=e.getAttribute(o);if(r.type===Function&&typeof e[s]=="function")t[s]=e[s];else if(i!==null)t[s]=je(i,r.type);else if(typeof e[s]<"u")try{const a=e[s];if(r.type===String&&a&&typeof a=="object")try{t[s]=je(String(a),r.type)}catch{t[s]=a}else r.type===Boolean&&typeof a=="boolean"||r.type===Number&&typeof a=="number"||r.type===Function&&typeof a=="function"?t[s]=a:t[s]=je(String(a),r.type)}catch{t[s]=e[s]}else"default"in r&&r.default!==void 0&&(t[s]=r.default)}}function lt(e,n,t){if(!n.props){try{const s=t?._hookCallbacks?.props||{},r=Array.from(new Set([...Object.keys(e||{}),...Object.keys(s||{})]));for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(t,o);if(!(!Object.prototype.hasOwnProperty.call(s,o)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get(){try{const u=l.toKebab(o),d=e.getAttribute(u);if(d!==null)return d;const y=e[o];let h;return l.isReactiveState(y)||y&&typeof y=="object"&&"value"in y&&!(y instanceof Node)?h=y.value:h=y,h}catch{return e[o]}}})}catch{}}}catch{}return}ct(e,n.props,t)}function ft(e,n,t,s){e.onConnected&&!t&&(e.onConnected(n),s(!0))}function ut(e,n,t,s,r,o,i,a){e.onDisconnected&&e.onDisconnected(n),t.forEach(u=>u()),s(),r(),o(!1),i(null),a(!1)}function dt(e,n,t,s,r){e.onAttributeChanged&&e.onAttributeChanged(n,t,s,r)}class Z{static cleanupFunctions=new WeakMap;static addListener(n,t,s,r){n.addEventListener(t,s,r);const i={event:t,handler:s,wrapper:s,options:r,cleanup:()=>n.removeEventListener(t,s,r),addedAt:Date.now()};this.cleanupFunctions.has(n)||this.cleanupFunctions.set(n,[]);const a=this.cleanupFunctions.get(n);a.push(i),a.__metaList=a}static removeListener(n,t,s,r){n.removeEventListener(t,s,r);const o=this.cleanupFunctions.get(n);if(o)for(let i=0;i<o.length;i++){const a=o[i];if(a.event===t&&a.handler===s){o.splice(i,1),o.length===0&&this.cleanupFunctions.delete(n);return}}}static cleanup(n){const t=this.cleanupFunctions.get(n);t&&(t.forEach(s=>{try{s.cleanup()}catch{}}),this.cleanupFunctions.delete(n))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(n){const t=this.cleanupFunctions.get(n);return!!(t&&t.length>0)}static getListenerCount(n){const t=this.cleanupFunctions.get(n);return t?t.length:0}static getListenerInfo(n){const t=this.cleanupFunctions.get(n);return t?t.map(s=>({event:s.event,handler:s.handler,wrapper:s.wrapper,options:s.options})):[]}}class pt{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(n,t){const s=this.cache.get(n);if(s){if(!s.isSecure){x.devWarn("Blocked cached dangerous expression:",n);return}try{this.cache.delete(n),this.cache.set(n,s)}catch{}return s.evaluator(t)}const r=this.createEvaluator(n);if(this.cache.size>=this.maxCacheSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}if(this.cache.set(n,r),!r.isSecure){x.devWarn("Blocked dangerous expression:",n);return}return r.evaluator(t)}static createEvaluator(n){if(this.hasDangerousPatterns(n))return{evaluator:()=>{},isSecure:!1};if(n.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(n),isSecure:!0}}catch(t){return x.devWarn("Failed to create evaluator for expression:",n,t),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(n){return this.dangerousPatterns.some(t=>t.test(n))}static createSafeEvaluator(n){const t=n.trim();if(t.startsWith("{")&&t.endsWith("}"))return this.createObjectEvaluator(n);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(n.trim())){const s=n.trim().slice(4);return r=>l.getNestedValue(r,s)}return n.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(n)?this.createSimpleEvaluator(n):s=>l.getNestedValue(s,n)}static createObjectEvaluator(n){const t=n.trim().slice(1,-1),s=this.parseObjectProperties(t);return r=>{const o={};for(const{key:i,value:a}of s)try{if(a.startsWith("ctx.")){const u=a.slice(4);o[i]=l.getNestedValue(r,u)}else o[i]=this.evaluateSimpleValue(a,r)}catch{o[i]=void 0}return o}}static parseObjectProperties(n){const t=[],s=n.split(",");for(const r of s){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),a=r.slice(o+1).trim(),u=i.replace(/^['"]|['"]$/g,"");t.push({key:u,value:a})}return t}static createSimpleEvaluator(n){return t=>{try{let s=n;const r=[];s=s.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,h=>`<<#${r.push(h)-1}#>>`);const o=s.match(/ctx\.[\w.]+/g)||[];for(const h of o){const p=h.slice(4),_=l.getNestedValue(t,p);if(_===void 0)return;const R=r.push(JSON.stringify(_))-1;s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${R}#>>`)}const i=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=s.match(i)||[];for(const h of a){if(h.startsWith("ctx."))continue;const p=l.getNestedValue(t,h);if(p===void 0)return;const _=r.push(JSON.stringify(p))-1;s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${_}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let d;const y=new Set;for(;(d=u.exec(s))!==null;){const h=d[1];if(["true","false","null","undefined"].includes(h)||/^[0-9]+$/.test(h)||h==="ctx"||y.has(h))continue;y.add(h);const p=l.getNestedValue(t,h);if(p===void 0)return;const _=JSON.stringify(p),R=r.push(_)-1;h.includes(".")?s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${R}#>>`):s=s.replace(new RegExp("\\b"+h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${R}#>>`)}s=s.replace(/<<#(\d+)#>>/g,(h,p)=>r[Number(p)]);try{return this.evaluateBasicExpression(s)}catch{return}}catch{return}}}static evaluateBasicExpression(n){const t=this.tokenize(n);let s=0;function r(){return t[s]}function o(b){const w=t[s++];if(b&&!w)throw new Error(`Unexpected token EOF, expected ${b}`);if(b&&w&&w.type!==b&&w.value!==b)throw new Error(`Unexpected token ${w.type}/${w.value}, expected ${b}`);return w}function i(){return R()}function a(b){if(typeof b=="number")return b;if(b==null)return NaN;if(typeof b=="boolean")return b?1:0;const w=Number(b);return Number.isNaN(w)?NaN:w}function u(b,w){return typeof b=="string"||typeof w=="string"?String(b)+String(w):a(b)+a(w)}function d(b,w){return a(b)-a(w)}function y(b,w){return a(b)*a(w)}function h(b,w){return a(b)/a(w)}function p(b,w){return a(b)%a(w)}function _(b,w,f){if(typeof w=="number"&&typeof f=="number")switch(b){case">":return w>f;case"<":return w<f;case">=":return w>=f;case"<=":return w<=f;default:return!1}const m=String(w),T=String(f);switch(b){case">":return m>T;case"<":return m<T;case">=":return m>=T;case"<=":return m<=T;default:return!1}}function R(){const b=k(),w=r();if(w&&w.value==="?"){o("?");const f=i();o(":");const m=i();return b?f:m}return b}function k(){let b=c();for(;;){const w=r();if(!w||w.value!=="||")break;o("OP");const f=c();b=b||f}return b}function c(){let b=v();for(;;){const w=r();if(!w||w.value!=="&&")break;o("OP");const f=v();b=b&&f}return b}function v(){let b=E();for(;;){const w=r();if(!w||!["==","!=","===","!=="].includes(w.value))break;const f=o("OP").value,m=E();switch(f){case"==":b=b==m;break;case"!=":b=b!=m;break;case"===":b=b===m;break;case"!==":b=b!==m;break}}return b}function E(){let b=g();for(;;){const w=r();if(!w||![">","<",">=","<="].includes(w.value))break;const f=o("OP").value,m=g();switch(f){case">":b=_(">",b,m);break;case"<":b=_("<",b,m);break;case">=":b=_(">=",b,m);break;case"<=":b=_("<=",b,m);break}}return b}function g(){let b=S();for(;;){const w=r();if(!w||w.value!=="+"&&w.value!=="-")break;const f=o("OP").value,m=S();b=f==="+"?u(b,m):d(b,m)}return b}function S(){let b=C();for(;;){const w=r();if(!w||w.value!=="*"&&w.value!=="/"&&w.value!=="%")break;const f=o("OP").value,m=C();switch(f){case"*":b=y(b,m);break;case"/":b=h(b,m);break;case"%":b=p(b,m);break}}return b}function C(){const b=r();if(b&&b.value==="!")return o("OP"),!C();if(b&&b.value==="-"){o("OP");const w=C();return d(0,w)}return A()}function A(){const b=r();if(b){if(b.type==="NUMBER")return o("NUMBER"),Number(b.value);if(b.type==="STRING")return o("STRING"),b.value.slice(1,-1);if(b.type==="IDENT")return o("IDENT"),b.value==="true"?!0:b.value==="false"?!1:b.value==="null"?null:void 0;if(b.value==="["){o("PUNC");const w=[];for(;;){const f=r();if(!f||f.value==="]")break;w.push(i());const m=r();m&&m.value===","&&o("PUNC")}return o("PUNC"),w}if(b.value==="("){o("PUNC");const w=i();return o("PUNC"),w}throw new Error("Unexpected token in expression")}}return i()}static tokenize(n){const t=[],s=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let r;for(;(r=s.exec(n))!==null;){const o=r[1];o&&(/^\d/.test(o)?t.push({type:"NUMBER",value:o}):/^"/.test(o)||/^'/.test(o)?t.push({type:"STRING",value:o}):/^[a-zA-Z_]/.test(o)?t.push({type:"IDENT",value:o}):/^[()?:,[\]]$/.test(o)?t.push({type:"PUNC",value:o}):t.push({type:"OP",value:o}))}return t}static evaluateSimpleValue(n,t){if(n==="true")return!0;if(n==="false")return!1;if(!isNaN(Number(n)))return Number(n);if(n.startsWith("ctx.")){const s=n.slice(4);return l.getNestedValue(t,s)}return n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'")?n.slice(1,-1):n}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}function we(e,n){return Array.isArray(e)&&Array.isArray(n)?JSON.stringify([...e].sort())!==JSON.stringify([...n].sort()):e!==n}function Ke(e,n,t,s,r){if(e){const o=n.value;if(r&&typeof o=="object"&&o!==null){const i={...o};i[r]=t,n.value=i}else n.value=t}else{const o=s._state||s;l.setNestedValue(o,n,t)}}function Te(e,n,t,s){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const r=n?"reactiveState":t;e._triggerWatchers(r,s)}}function ht(e,n,t){const s=`update:${l.toKebab(n)}`,r=`update:${n}`,o=new CustomEvent(s,{detail:t,bubbles:!0,cancelable:!0}),i=new CustomEvent(r,{detail:t,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(i)}function Ve(e,n,t,s){const r=t;if(l.safe(()=>{if(typeof e.setAttribute=="function")try{e[n]=r}catch{}else e[n]=r}),r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"){const o=l.safeSerializeAttr(r);o!==null?l.safe(()=>{typeof e.setAttribute=="function"&&l.setAttributeSmart(e,l.toKebab(n),String(o))}):l.safe(()=>{typeof e.removeAttribute=="function"&&l.removeAttributeSmart(e,l.toKebab(n))})}}function yt(e,n,t,s){if(e){const r=n.value;return s&&typeof r=="object"&&r!==null?r[s]:r}else{const r=t._state||t;return l.getNestedValue(r,n)}}function ve(e){return e!=null&&typeof e=="object"&&"value"in e}function He(e){return e!=null&&typeof e=="object"&&"value"in e?e.value:e}function X(e,n,t){if(!e)return;e.attrs||(e.attrs={});const s=e.attrs;s[n]=t}function q(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function oe(e){return e!=null&&typeof e=="object"&&"value"in e?oe(e.value):!(e!=null&&typeof e=="object"||e===!1||e==="false"||e===null||e===void 0||e===0)}function Je(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function De(e){return typeof e=="boolean"||e==="true"||e==="false"}function mt(e,n,t,s,r,o,i,a){if(!o)return;const u=n.includes("lazy"),d=n.includes("trim"),y=n.includes("number"),h=()=>{if(l.isReactiveState(e)){const S=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof S=="object"&&S!==null?S[a]:S}const g=o?._state||o;return l.getNestedValue(g,e)},p=h();let _="text";i instanceof HTMLInputElement?_=s?.type||i.type||"text":i instanceof HTMLSelectElement?_="select":i instanceof HTMLTextAreaElement&&(_="textarea");const R=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,c=R?_==="checkbox"||_==="radio"?"checked":"value":a??"modelValue";if(_==="checkbox")if(Array.isArray(p))t[c]=p.includes(String(i?.getAttribute("value")??s?.value??""));else{const g=i?.getAttribute("true-value")??!0;t[c]=p===g}else if(_==="radio")t[c]=p===(s?.value??"");else if(_==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const g=Array.isArray(p)?p.map(String):[];setTimeout(()=>{Array.from(i.options).forEach(S=>{S.selected=g.includes(S.value)})},0),t[c]=Array.isArray(p)?p:[]}else t[c]=p;else{!R&&l.isReactiveState(e)?t[c]=e:t[c]=p;try{const g=l.toKebab(c);s&&(s[g]=p)}catch{}}const v=u||_==="checkbox"||_==="radio"||_==="select"?"change":"input",E=g=>{if(g.isComposing||r._isComposing)return;const S=globalThis.process,C=!!S&&S.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(g.isTrusted===!1&&!C)return;const A=g.target;if(!A||A._modelUpdating)return;let N=A.value;if(_==="checkbox"){const f=h();if(Array.isArray(f)){const m=A.getAttribute("value")??"",T=Array.from(f);if(A.checked)T.includes(m)||T.push(m);else{const L=T.indexOf(m);L>-1&&T.splice(L,1)}N=T}else{const m=A.getAttribute("true-value")??!0,T=A.getAttribute("false-value")??!1;N=A.checked?m:T}}else if(_==="radio")N=A.getAttribute("value")??A.value;else if(_==="select"&&A.multiple)N=Array.from(A.selectedOptions).map(f=>f.value);else if(d&&typeof N=="string"&&(N=N.trim()),y){const f=Number(N);isNaN(f)||(N=f)}const b=h();if(we(N,b)){A._modelUpdating=!0;try{Ke(l.isReactiveState(e),e,N,o,a),Te(o,l.isReactiveState(e),e,N),A&&ht(A,c,N)}finally{setTimeout(()=>A._modelUpdating=!1,0)}}};if(R){if(r[v]){const g=r[v];i&&Z.removeListener(i,v,g)}r[v]=E}else{const g=`update:${l.toKebab(c)}`,S=`update:${c}`;if(r[g]){const C=r[g];i&&Z.removeListener(i,g,C)}if(r[S]){const C=r[S];i&&Z.removeListener(i,S,C)}if(r[g]=C=>{const A=C.detail;let N=A!==void 0?A:void 0;if(N===void 0){const f=C.target;if(f&&typeof f=="object"&&"value"in f)try{N=f.value}catch{N=void 0}}const b=yt(l.isReactiveState(e),e,o,a);if(we(N,b)){Ke(l.isReactiveState(e),e,N,o,a),Te(o,l.isReactiveState(e),e,N);const f=C.target;f&&Ve(f,c,l.isReactiveState(e)?e:N,l.isReactiveState(e))}},l.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let C;try{C=Reflect.ownKeys(e.value)}catch{C=Object.keys(e.value)}const A=C.filter(N=>typeof N=="string"&&!String(N).startsWith("_")&&N!=="constructor");for(const N of A){const b=String(N),w=`update:${l.toKebab(b)}`,f=`update:${b}`;r[w]||(r[w]=m=>{const T=m.detail!==void 0?m.detail:m.target?.value,L=l.isReactiveState(e)?e.value[b]:l.getNestedValue(o?._state||o,e);if(!we(T,L))return;if(l.isReactiveState(e)){const I={...e.value};I[b]=T,e.value=I}else l.setNestedValue(o?._state||o,e,T);Te(o,l.isReactiveState(e),e,T);const j=m.currentTarget||i||m.target;j&&Ve(j,c,l.isReactiveState(e)?e:T,l.isReactiveState(e))},r[f]=r[w])}}r[S]=r[g]}(_==="text"||_==="textarea")&&(r.compositionstart=()=>r._isComposing=!0,r.compositionend=g=>{r._isComposing=!1;const S=g.target;S&&setTimeout(()=>{const C=S.value,A=o?._state||o,N=l.getNestedValue(A,e);let b=C;if(d&&(b=b.trim()),y){const f=Number(b);isNaN(f)||(b=f)}if(we(b,N)){S._modelUpdating=!0;try{l.setNestedValue(A,e,b),Te(o,l.isReactiveState(e),e,b)}finally{setTimeout(()=>S._modelUpdating=!1,0)}}},0)})}function gt(e,n,t,s,r){if(typeof e=="object"&&e!==null)for(const[o,i]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")t[o]=i;else if(o==="disabled"&&r&&q(r)){const a=i&&typeof i=="object"&&"value"in i;(()=>{try{return l.isReactiveState(i)}catch{return!1}})()||a?n[o]=i:t[o]=i}else n[o]=i;else if(typeof e=="string"){if(!s)return;try{const o=Ae(e,s);if(typeof o=="object"&&o!==null){for(const[i,a]of Object.entries(o))if(i.startsWith("data-")||i.startsWith("aria-")||i==="class")t[i]=a;else if(i==="disabled"&&r&&q(r)){const u=a&&typeof a=="object"&&"value"in a;(()=>{try{return l.isReactiveState(a)}catch{return!1}})()||u?n[i]=a:t[i]=a}else n[i]=a;return}else{t[e]=o;return}}catch{const o=l.getNestedValue(s,e);t[e]=o}}}function bt(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(e,t)}else s=e;const r=String(n.style||"");let o=r;if(s){if(r){const i=String(r).split(";").map(u=>u.trim()).filter(Boolean),a=i.findIndex(u=>u.startsWith("display:"));a>=0&&i[a]==="display: none"&&(i.splice(a,1),o=i.length>0?i.join("; ")+";":"")}}else if(r){const i=String(r).split(";").filter(Boolean),a=i.findIndex(u=>u.trim().startsWith("display:"));a>=0?i[a]="display: none":i.push("display: none"),o=i.join("; ")}else o="display: none";o!==r&&(o?n.style=o:n.style=void 0)}function Ae(e,n){return pt.evaluate(e,n)}function vt(e,n,t,s){let r;if(typeof e=="string"){if(!t)return;r=Ae(e,t)}else r=e;try{if(r&&typeof r=="object"){if(l.isReactiveState(r))r=r.value;else if("value"in r&&typeof r.value<"u"){const d=r.value;d instanceof Node||(r=d)}}}catch{}let o=[];if(typeof r=="string")o=[r];else if(Array.isArray(r))o=r.filter(Boolean);else if(typeof r=="object"&&r!==null)for(const[d,y]of Object.entries(r))y&&o.push(d);const i=o.join(" "),a=s&&s.class||n.class||"",u=a?`${a} ${i}`.trim():i.trim();u?n.class=u:n.class=void 0}function St(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(e,t)}else s=e;let r="";if(typeof s=="string")r=s;else if(s&&typeof s=="object"){const i=[];for(const[a,u]of Object.entries(s))if(u!=null&&u!==""){const d=a.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),y=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let h=String(u);typeof u=="number"&&y.includes(d)&&(h=`${u}px`),i.push(`${d}: ${h}`)}r=i.join("; ")+(i.length>0?";":"")}const o=String(n.style||"");n.style=o+(o&&!o.endsWith(";")?"; ":"")+r}function Et(e,n,t){let s=e;typeof e=="string"&&t&&(s=Ae(e,t)),l.isReactiveState(s)?n.reactiveRef=s:n.ref=s}function Ye(e,n,t,s){const r={},o={...s||{}},i={};for(const[a,u]of Object.entries(e)){const{value:d,modifiers:y,arg:h}=u;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),_=p.length>1?p[1]:h;mt(d,y,r,o,i,n,t,_);continue}switch(a){case"bind":gt(d,r,o,n,t);break;case"show":bt(d,o,n);break;case"class":vt(d,o,n,s);break;case"style":St(d,o,n);break;case"ref":Et(d,r,n);break}}try{if(Object.prototype.hasOwnProperty.call(r,"disabled")&&t&&q(t)){const u=r.disabled,d=u&&typeof u=="object"&&"value"in u;let y=!1;try{y=l.isReactiveState(u)}catch{y=!1}if(!d&&!y)try{o.disabled=u,delete r.disabled;const h=globalThis;h.__VDOM_DISABLED_PROMOTIONS||(h.__VDOM_DISABLED_PROMOTIONS=[]),h.__VDOM_DISABLED_PROMOTIONS.push({phase:"bind-directive:postfix-move",location:"attrs",key:"disabled",value:u,time:Date.now(),stack:new Error().stack})}catch{}}}catch{}return{props:r,attrs:o,listeners:i}}function fe(e){return e?e.split(/\s+/).filter(Boolean):[]}function ue(e,n){if(n.length===0)return;const t=n.filter(s=>s&&!e.classList.contains(s));t.length>0&&e.classList.add(...t)}function ce(e,n){if(n.length===0)return;const t=n.filter(Boolean);t.length>0&&e.classList.remove(...t)}let Pe=!1;async function Ct(e,n,t=10){if(!Pe){if(!e.isConnected){x.devWarn("⚠️ Element not connected to DOM, skipping style wait");return}for(let s=0;s<t;s++){const r=window.getComputedStyle(e),o=r.transform&&r.transform!=="",i=r.opacity&&r.opacity!=="";if(o||i){Pe=!0;return}await new Promise(a=>requestAnimationFrame(()=>a(void 0)))}Pe=!0,x.devWarn("⚠️ Styles did not load in time for transition, continuing anyway")}}function At(e){const n=window.getComputedStyle(e),t=n.transitionDuration||"0s",s=n.transitionDelay||"0s",r=o=>{const i=parseFloat(o);return o.includes("ms")?i:i*1e3};return r(t)+r(s)}function Xe(e,n){return new Promise(t=>{const s=n??At(e);if(s<=0){t();return}let r=!1;const o=()=>{r||(r=!0,e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),t())},i=()=>o();e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i),setTimeout(o,s+50)})}async function me(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeEnter)try{s.onBeforeEnter(e)}catch(R){x.devError("Transition onBeforeEnter error:",R)}if(!r)return s?.onEnter?new Promise(R=>{const k=s.onEnter;typeof k=="function"?k(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(c){x.devError("Transition onAfterEnter error:",c)}R()}):R()}):void 0;const i=fe(t?.enterFrom),a=fe(t?.enterActive),u=fe(t?.enterTo);ue(e,i),e.offsetHeight,ue(e,a),e.offsetHeight;let d;if(s?.onEnter){const R=new Promise(k=>{d=k});try{const k=s.onEnter;typeof k=="function"&&k(e,()=>{d&&d()})}catch(k){x.devError("Transition onEnter error:",k)}d&&await R}await new Promise(R=>requestAnimationFrame(()=>R(void 0))),e.offsetHeight;const y=window.getComputedStyle(e),h=y.transform,p=y.opacity;ce(e,i),h&&h!=="none"&&(e.style.transform=h),p&&p!==""&&(e.style.opacity=p),e.offsetHeight,await new Promise(R=>requestAnimationFrame(()=>R(void 0))),e.style.transform="",e.style.opacity="",ue(e,u),e.offsetHeight,await new Promise(R=>requestAnimationFrame(()=>R(void 0)));let _;if(typeof o=="number"?_=o:o&&typeof o=="object"&&"enter"in o&&(_=o.enter),await Xe(e,_),ce(e,a),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(R){x.devError("Transition onAfterEnter error:",R)}}async function xe(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(h){x.devError("Transition onBeforeLeave error:",h)}if(!r)return s?.onLeave?new Promise(h=>{const p=s.onLeave;typeof p=="function"?p(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(_){x.devError("Transition onAfterLeave error:",_)}h()}):h()}):void 0;const i=fe(t?.leaveFrom),a=fe(t?.leaveActive),u=fe(t?.leaveTo);ue(e,i),e.offsetHeight,ue(e,a);let d;if(s?.onLeave){const h=new Promise(p=>{d=p});try{const p=s.onLeave;typeof p=="function"&&p(e,()=>{d&&d()})}catch(p){x.devError("Transition onLeave error:",p)}d&&await h}await new Promise(h=>requestAnimationFrame(()=>h(void 0))),await Ct(e,[...i,...a]),ce(e,i),ue(e,u);let y;if(typeof o=="number"?y=o:o&&typeof o=="object"&&"leave"in o&&(y=o.leave),await Xe(e,y),ce(e,a),ce(e,u),ce(e,i),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(h){x.devError("Transition onAfterLeave error:",h)}}const Qe=new WeakMap,et=new WeakMap;function Ne(e){if(!e)return;const n=Qe.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t.key!=null)return String(t.key)}catch{}if(e instanceof Element){const t=e.getAttribute("data-anchor-key");if(t)return t}}function V(e,n){try{Qe.set(e,n)}catch{}try{e.key=n}catch{}try{if(e instanceof Element){const t=l.safeSerializeAttr(n);t!==null&&l.setAttributeSmart(e,"data-anchor-key",t)}}catch{}}function _t(e){if(!e)return;const n=et.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function kt(e,n){try{et.set(e,n)}catch{}try{e._transitionGroup=n}catch{}}function ie(e,n){if(n){if(e instanceof Element){Z.cleanup(e);const t=[];for(const s in n)n[s]===e&&t.push(s);for(const s of t)delete n[s]}if(e.hasChildNodes()){const t=e.childNodes;for(let s=t.length-1;s>=0;s--)ie(t[s],n)}}}function ge(e,n,t){if(typeof e=="string")return;const s=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),r=e.props?.ref??(e.props?.props&&e.props.props.ref);if(s)try{if(l.isReactiveState(s)||typeof s=="object"&&"value"in s)s.value=n;else if(typeof s=="function")s(n);else if(typeof s=="string"&&t)try{const o=String(s);t[o]=n}catch{}}catch{}else if(r&&t)try{const o=String(r);t[o]=n}catch{}}function Ie(e,n){if(Array.isArray(e)){const o=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const h=i.tag||"node",_=[i.props?.attrs?.id,i.props?.attrs?.name,i.props?.attrs?.["data-key"],i.props?.props?.id,i.props?.props?.name,i.props?.props?.dataKey,i.props?.props?.["data-key"]].find(R=>R!=null)??"";a=_?`${n}:${h}:${_}`:`${n}:${h}`}let u=a,d=1;for(;o.has(u);)u=`${a}#${d++}`;o.add(u);let y=i.children;return Array.isArray(y)&&(y=Ie(y,u)),{...i,key:u,children:y}})}const t=e,s=t.props?.key??t.key??n;let r=t.children;return Array.isArray(r)&&(r=Ie(r,s)),{...t,key:s,children:r}}function Ue(e,n,t,s){const r=t.directives??{},o=t.attrs?{...t.attrs}:{},i=Ye(r,s,e,o),a={...n.props||{},...t.props||{},...i.props||{}},u={...o||{},...i.attrs||{}},d=n.props??{},y=a,h=!!(t?.isCustomElement??n?.isCustomElement??!1);let p=!1;for(const c in{...d,...y}){const v=d[c],E=y[c];let g=v,S=E;if(l.safe(()=>{(l.isReactiveState(v)||ve(v))&&(g=v.value)}),l.safe(()=>{(l.isReactiveState(E)||ve(E))&&(S=E.value)}),!(v===E&&g===S))if(p=!0,c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const C=He(E),A=C==null?"":String(C);e.value!==A&&(e.value=A)}else if(c==="checked"&&e instanceof HTMLInputElement){const C=He(E);e.checked=!!C}else if(c.startsWith("on")&&typeof E=="function"){const C=Je(c);typeof v=="function"&&Z.removeListener(e,C,v),typeof E=="function"&&Z.addListener(e,C,E);try{if(C&&C.startsWith("update:")){const A=C.split(":",2)[1],N=y[A];let b=[];try{if(l.isReactiveState(N)){const f=N.value;b=f&&typeof f=="object"?Object.keys(f):[]}else N&&typeof N=="object"&&(b=Object.keys(N))}catch{b=[]}const w=b.filter(f=>typeof f=="string"&&!f.startsWith("_")&&f!=="constructor");for(const f of w){const m=`update:${f}`,T=L=>{const O=L.detail!==void 0?L.detail:L.target instanceof HTMLInputElement||L.target instanceof HTMLTextAreaElement||L.target instanceof HTMLSelectElement?L.target.value:void 0,I={...l.isReactiveState(N)?N.value||{}:y[A]||{},[f]:O};try{typeof E=="function"&&E({detail:I})}catch{}};l.safe(()=>{Z.addListener(e,m,T)})}}}catch{}}else if(E==null)l.removeAttributeSmart(e,c);else{const C=t?.isCustomElement??n?.isCustomElement??!1;if(C||c in e)try{e[c]=E,c==="disabled"&&E===!1&&!C&&q(e)&&l.removeAttributeSmart(e,"disabled")}catch{}else E===!1&&l.removeAttributeSmart(e,c)}}for(const[c,v]of Object.entries(i.listeners||{})){Z.addListener(e,c,v);try{const E=e&&e.parentElement;E&&E!==e&&Z.addListener(E,c,v)}catch{}}const _={...n.attrs??{}},R=u,k=i&&i.attrs||{};if(Object.prototype.hasOwnProperty.call(k,"class")&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(_.class=c)}if(Object.prototype.hasOwnProperty.call(k,"style")&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(_.style=c)}try{if(Object.prototype.hasOwnProperty.call(k,"class")&&k.class===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(_.class=c)}if(Object.prototype.hasOwnProperty.call(k,"style")&&k.style===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(_.style=c)}try{if(typeof e.getAttribute=="function"){const c=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&c!==null&&c!==_.class&&(_.class=c)}catch{}}}catch{}}catch{}for(const c in{..._,...R}){const v=_[c],E=R[c];let g=v,S=E;if(l.isReactiveState(v)&&(g=v.value),l.isReactiveState(E)&&(S=E.value),g!==S)if(p=!0,S==null||S===!1)l.safe(()=>{l.removeAttributeSmart(e,c)}),X(n,c,void 0),c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?l.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?l.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&l.safe(()=>{e.value=0})),c==="checked"&&e instanceof HTMLInputElement&&l.safe(()=>{e.checked=!1}),c==="disabled"&&q(e)&&l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(c==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){l.safe(()=>{e.value=S??""});continue}else if(e instanceof HTMLSelectElement){l.safe(()=>{e.value=S??""});continue}else if(e instanceof HTMLProgressElement){l.safe(()=>{e.value=Number(S)});continue}}if(c==="checked"&&e instanceof HTMLInputElement){l.safe(()=>{e.checked=!!S});continue}if(c==="style"){const A=l.safeSerializeAttr(S);A!==null&&l.setAttributeSmart(e,c,String(A)),X(n,c,S);continue}if(c==="class"){const A=l.safeSerializeAttr(S);A!==null&&l.setAttributeSmart(e,c,String(A)),X(n,c,S);continue}if(c==="disabled"&&q(e)){l.safe(()=>{const A=oe(S);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=A)}),oe(S)?l.safe(()=>{l.setAttributeSmart(e,c,"")}):l.safe(()=>{l.removeAttributeSmart(e,c)});continue}const C=e.namespaceURI==="http://www.w3.org/2000/svg";if(h&&!C&&c.includes("-"))if(l.isClassLikeAttr(c)){const A=l.safeSerializeAttr(E??S);if(A!==null){try{l.setAttributeSmart(e,c,String(A))}catch{}X(n,c,S)}}else{const A=l.toCamel(c);try{const N=e;N[A]=l.isReactiveState(E)?E:S,X(n,c,S)}catch{const N=l.safeSerializeAttr(E??S);N!==null&&l.setAttributeSmart(e,c,String(N))}}else if(!C&&c in e)try{const A=e;A[c]=l.isReactiveState(E)?E:S,X(n,c,S)}catch{const A=l.safeSerializeAttr(S);A!==null&&(l.setAttributeSmart(e,c,String(A)),X(n,c,S))}else{const A=l.safeSerializeAttr(S);A!==null&&(l.setAttributeSmart(e,c,String(A)),X(n,c,S))}}}try{if(q(e)){const c=a.disabled;let v;try{const g=Object.prototype.hasOwnProperty.call(i.props||{},"disabled"),S=c&&typeof c=="object"&&"value"in c;let C=!1;l.safe(()=>{C=!!l.isReactiveState(c)});const A=De(c);C||S||g||A?v=c:v=u.disabled}catch{v=u.disabled}const E=oe(v);l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=E)}),E?l.safe(()=>{l.setAttributeSmart(e,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(e,"disabled")})}}catch{}if(h&&p){const c=e;l.safe(()=>{c._applyProps?.(c._cfg)}),l.safe(()=>{typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render?.(c._cfg)})}}function U(e,n,t,s=null){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const c=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&V(c,e.key),c}if(e.tag==="#raw"){const c=typeof e.children=="string"?e.children:"";return document.createRange().createContextualFragment(c)}if(e.tag==="#anchor"){const c=e,v=Array.isArray(c.children)?c.children:[],E=document.createTextNode(""),g=document.createTextNode("");c.key!=null&&(V(E,`${c.key}:start`),V(g,`${c.key}:end`)),c._startNode=E,c._endNode=g;const S=document.createDocumentFragment();S.appendChild(E);for(const C of v){const A=U(C,n,t,s);if(c.key!=null&&A instanceof Element&&!A.hasAttribute("data-anchor-key")){const N=C;N&&typeof N=="object"&&N.key!=null||V(A,String(c.key))}S.appendChild(A)}return S.appendChild(g),S}const r=e&&typeof e=="object"&&e.props&&e.props.attrs?e.props.attrs:void 0,i=(r&&typeof r.xmlns=="string"?String(r.xmlns):void 0)??s??l.TAG_NAMESPACE_MAP[e.tag]??null,a=i?document.createElementNS(i,e.tag):document.createElement(e.tag);e.key!=null&&V(a,e.key),e.props&&e.props?._transitionGroup&&kt(a,e.props?._transitionGroup);const{props:u={},attrs:d={},directives:y={}}=e.props??{},h=Ye(y,n,a instanceof HTMLElement?a:void 0,d),p={...u,...h.props},_={...d,...h.attrs};try{const c=(_&&_.class)??(p&&p.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),v=l.safeSerializeAttr(c);if(v!==null){const E=String(v).trim();E&&l.setAttributeSmart(a,"class",E)}}catch{}try{if(p.disabled!==void 0&&a&&q(a)){const c=p.disabled,v=c&&typeof c=="object"&&"value"in c;let E=!1;try{E=l.isReactiveState(c)}catch{E=!1}!v&&!E&&l.safe(()=>{_.disabled=c,delete p.disabled})}}catch{}const R=a.namespaceURI==="http://www.w3.org/2000/svg";for(const c in _){const v=_[c];if(typeof c!="string"||/\[object Object\]/.test(c))continue;const E=He(v);if(typeof E=="boolean")E?l.setAttributeSmart(a,c,""):l.safe(()=>{l.removeAttributeSmart(a,c)});else if(E!=null){if(c==="disabled"&&q(a)){const g=p.disabled,S=De(g)?g:E,C=oe(S);l.safe(()=>{a.disabled=C}),C?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}if(!R&&c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLProgressElement))try{a instanceof HTMLProgressElement?a.value=Number(E):a.value=String(E??"")}catch{const g=l.safeSerializeAttr(E);g!==null&&l.setAttributeSmart(a,c,String(g))}else if(!R&&c==="checked"&&a instanceof HTMLInputElement)try{a.checked=!!E}catch{const g=l.safeSerializeAttr(E);g!==null&&l.setAttributeSmart(a,c,String(g))}else if(!R&&c in a)try{a[c]=E,c==="disabled"&&E===!1&&q(a)&&l.removeAttributeSmart(a,"disabled"),X(e.props,c,E)}catch{const g=l.safeSerializeAttr(E);g!==null&&l.setAttributeSmart(a,c,String(g))}else if((e.props?.isCustomElement??!1)&&!R&&c.includes("-")){const S=l.toCamel(c);try{a[S]=E}catch{const C=l.safeSerializeAttr(E);C!==null&&l.setAttributeSmart(a,c,String(C))}}else{const S=l.safeSerializeAttr(E);S!==null&&l.setAttributeSmart(a,c,String(S))}}}for(const c in p){const v=p[c];if(!(typeof c!="string"||/\[object Object\]/.test(c)))if(c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)){const E=typeof v=="object"&&v!==null&&ve(v)?v.value:v;l.safe(()=>{a.value=String(E??"")})}else if(c.startsWith("on")&&typeof v=="function"){const E=Je(c),g=E.includes(":")?(()=>{const S=E.split(":"),C=S[1];if(C.includes("-")){const A=C.split("-").map((N,b)=>b===0?N:N.charAt(0).toUpperCase()+N.slice(1)).join("");return`${S[0]}:${A}`}else{const A=C.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${S[0]}:${A}`}})():E;h.listeners&&(h.listeners[E]||h.listeners[g])||Z.addListener(a,E,v)}else{if(c.startsWith("on")&&v===void 0)continue;if(v==null||v===!1)l.removeAttributeSmart(a,c);else{const E=e.props?.isCustomElement??!1,g=typeof v=="object"&&v!==null&&l.isReactiveState(v)?v:ve(v)&&typeof v.value<"u"?v.value:v;if(c==="class"||c==="style"){try{const S=l.safeSerializeAttr(g);S!==null&&l.setAttributeSmart(a,c,String(S))}catch{}continue}if(E||c in a)try{const S=typeof v=="object"&&v!==null&&l.isReactiveState(v)?v:ve(v)?v.value:v;if(c==="disabled"&&q(a)){const C=p.disabled!==void 0?p.disabled:S,A=oe(C);l.safe(()=>{a.disabled=A}),A?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}try{if(typeof a[c]=="boolean"){let A=S;typeof S=="string"?S==="false"?A=!1:S==="true"?A=!0:A=!!S&&S!=="":A=!!S,a[c]=A}else a[c]=S}catch{a[c]=S}}catch{}}}}for(const[c,v]of Object.entries(h.listeners||{}))Z.addListener(a,c,v);const k={...e,props:{...e.props,...h.props}};ge(k,a,t);try{const c=a;if(typeof c._applyProps=="function")try{c._applyProps(c._cfg)}catch{}typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render(c._cfg)}catch{}if(Array.isArray(e.children)){const c=e.tag==="foreignObject"&&i===l.SVG_NS?null:a.namespaceURI??null;for(const v of e.children)a.appendChild(U(v,n,t,c))}else typeof e.children=="string"&&(a.textContent=e.children);try{if(a instanceof HTMLSelectElement&&_&&Object.prototype.hasOwnProperty.call(_,"value"))try{a.value=String(_.value??"")}catch{}}catch{}try{if(q(a)){const c=p.disabled,v=_.disabled,E=c&&typeof c=="object"&&"value"in c;let g=!1;try{g=!!l.isReactiveState(c)}catch{g=!1}const C=g||E||De(c)?c:v,A=oe(C);l.safe(()=>{a.disabled=A}),A?l.safe(()=>{l.setAttributeSmart(a,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(a,"disabled")})}}catch{}return a}function wt(e,n,t,s,r){if(typeof t=="string"){e.textContent!==t&&(e.textContent=t);return}if(!Array.isArray(t))return;const o=e.childNodes,i=[];for(let k=0;k<o.length;k++)i.push(o[k]);const a=Array.isArray(n)?n:[],u=_t(e);if(u){const k=g=>{if(typeof g=="string")return g.startsWith("each-")?g.substring(5):g;if(typeof g=="number")return String(g)},c=[],v=[];for(const g of t)if(g&&g.tag==="#anchor"){const S=Array.isArray(g.children)?g.children:[];for(const C of S){const A=k(C.key??g.key??"unknown");c.push({...C,key:A})}}else g&&c.push({...g,key:k(g.key)});for(const g of a)if(g&&g.tag==="#anchor"){const S=Array.isArray(g.children)?g.children:[];for(const C of S){const A=k(C.key??g.key??"unknown");v.push({...C,key:A})}}else g&&v.push({...g,key:k(g.key)});if(c.some(g=>g&&g.key!=null)||v.some(g=>g&&g.key!=null)){const g=new Map,S=new Map;for(const f of v)if(f&&f.key!=null){const m=String(f.key);g.set(m,f)}for(let f=0;f<i.length;f++){const m=i[f];let T=Ne(m);if(T=k(T),T!=null&&m instanceof Element&&m.nodeType===Node.ELEMENT_NODE){let L=typeof T=="string"&&T.includes(":")?T.substring(0,T.lastIndexOf(":")):T;L=String(L),S.set(L,m)}}const C=new Set,A=new Map,N=i.length>0;if(u.moveClass&&N)for(let f=0;f<i.length;f++){const m=i[f];if(m instanceof HTMLElement&&m.parentElement){const T=m.getBoundingClientRect();A.set(m,T)}}const b=[];for(const f of c){let m=f.key;if(m==null)continue;m=String(m);const T=g.get(m);let L=S.get(m);if(L&&T){const O=be(L,T,f,s);C.add(L);const j=String(m);V(O,j),b.push({node:O,key:m,newVNode:f,oldVNode:T,isNew:!1})}else{L=U(f,s,void 0,e instanceof Element?e.namespaceURI??null:null),V(L,String(m)),e.appendChild(L);const O=N||u.appear===!0;L instanceof HTMLElement&&O&&me(L,u).catch(j=>{x.devError("Enter transition error:",j)}),b.push({node:L,key:m,newVNode:f,isNew:!0})}}const w=[];for(let f=0;f<i.length;f++){const m=i[f],T=Ne(m);if(!C.has(m)&&T!=null&&m instanceof HTMLElement){const O=xe(m,u).then(()=>{e.contains(m)&&e.removeChild(m)}).catch(j=>{x.devError("Leave transition error:",j),e.contains(m)&&e.removeChild(m)});w.push(O)}}if(w.length===0){let f=e.firstChild;for(const{node:m}of b)m!==f&&e.insertBefore(m,f),f=m.nextSibling;if(u.moveClass&&A.size>0){const m=[];for(const{node:T,isNew:L}of b)if(!L&&T instanceof HTMLElement){const O=A.get(T);if(O){const j=T.getBoundingClientRect(),I=O.left-j.left,M=O.top-j.top;if(I!==0||M!==0){const z=u.moveClass.split(/\s+/).filter(D=>D);m.push({node:T,deltaX:I,deltaY:M,moveClasses:z})}}}if(m.length>0){for(const{node:T,deltaX:L,deltaY:O}of m)T.style.transform=`translate(${L}px, ${O}px)`,T.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:T,moveClasses:L}of m)for(const O of L)T.classList.add(O);requestAnimationFrame(()=>{const T=u.moveClass||"",L=T.match(/duration-(\d+)/),O=L?`${L[1]}ms`:"300ms",j=T.match(/ease-(out|in|in-out|linear)/),I=j?`ease-${j[1]}`:"ease-out";for(const{node:M}of m)M.style.transition=`transform ${O} ${I}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:z}of m){M.style.removeProperty("transform");const D=()=>{for(const Q of z)M.classList.remove(Q);M.style.removeProperty("transition"),M.removeEventListener("transitionend",D),M.removeEventListener("transitioncancel",D)};M.addEventListener("transitionend",D,{once:!0}),M.addEventListener("transitioncancel",D,{once:!0})}})})})})}}}return}}const d=new Map;for(const k of a)k&&k.key!=null&&d.set(k.key,k);const y=new Map;for(let k=0;k<i.length;k++){const c=i[k],v=Ne(c);v!=null&&y.set(v,c)}const h=new Set;let p=e.firstChild;function _(k,c){let v=k;for(;v&&(h.add(v),v!==c);)v=v.nextSibling}function R(k,c,v,E,g,S=!0){const C=[];let A=k.nextSibling;for(;A&&A!==c;)C.push(A),A=A.nextSibling;const N=Array.isArray(v)?v:[];if(E.some(w=>w&&w.key!=null)||N.some(w=>w&&w.key!=null)){const w=new Map,f=new Map;for(const O of N)O&&O.key!=null&&w.set(O.key,O);for(const O of C){const j=Ne(O);j!=null&&f.set(j,O)}const m=g&&g.state==="visible"&&N.length===0&&E.length>0,T=new Set;let L=k.nextSibling;for(const O of E){let j;if(O.key!=null&&f.has(O.key)){const I=w.get(O.key);j=be(f.get(O.key),I,O,s),T.add(j),g&&j instanceof HTMLElement&&m&&g.appear&&me(j,g).catch(M=>{x.devError("Transition enter error (appear):",M)}),j!==L&&e.contains(j)&&e.insertBefore(j,L)}else j=U(O,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore(j,L),T.add(j),g&&j instanceof HTMLElement&&S&&me(j,g).catch(I=>{x.devError("Transition enter error:",I)});L=j.nextSibling}for(const O of C)!T.has(O)&&e.contains(O)&&(g&&O instanceof HTMLElement&&S?xe(O,g).then(()=>{e.contains(O)&&e.removeChild(O)}).catch(j=>{x.devError("Transition leave error:",j),e.contains(O)&&e.removeChild(O)}):e.removeChild(O))}else{const w=Math.min(N.length,E.length);for(let f=0;f<w;f++){const m=N[f],T=E[f],L=be(C[f],m,T,s);L!==C[f]&&(e.insertBefore(L,C[f]),e.removeChild(C[f]))}for(let f=w;f<E.length;f++){const m=U(E[f],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(m,c),g&&m instanceof HTMLElement&&S&&me(m,g).catch(T=>{x.devError("Transition enter error:",T)})}for(let f=w;f<C.length;f++){const m=C[f];g&&m instanceof HTMLElement&&S?xe(m,g).then(()=>{e.contains(m)&&e.removeChild(m)}).catch(T=>{x.devError("Transition leave error:",T),e.contains(m)&&e.removeChild(m)}):e.removeChild(m)}}}for(const k of t){let c;if(k.tag==="#anchor"){const v=k.key,E=`${v}:start`,g=`${v}:end`;let S=y.get(E),C=y.get(g);const A=Array.isArray(k.children)?k.children:[];if(S||(S=document.createTextNode(""),V(S,E)),C||(C=document.createTextNode(""),V(C,g)),k._startNode=S,k._endNode=C,!e.contains(S)||!e.contains(C)){e.insertBefore(S,p);const N=k._transition,w=!(N&&N.state==="visible"&&A.length>0)||N.appear;for(const f of A){const m=U(f,s,r,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(m,p),N&&m instanceof HTMLElement&&w&&me(m,N).catch(T=>{x.devError("Transition enter error:",T)})}e.insertBefore(C,p)}else{const N=k._transition,w=d.get(v)._transition,f=w&&w.state!==N?.state,m=N&&N.state==="visible"&&A.length>0&&!f,T=f||!m||N?.appear===!0;R(S,C,d.get(v)?.children,A,N,T)}_(S,C),p=C.nextSibling;continue}if(k.key!=null&&y.has(k.key)){const v=d.get(k.key);c=be(y.get(k.key),v,k,s,r),h.add(c),c!==p&&e.contains(c)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(c,p))}else c=U(k,s,r,e instanceof Element?e.namespaceURI??null:null),p&&!e.contains(p)&&(p=null),e.insertBefore(c,p),h.add(c);p=c.nextSibling}for(let k=0;k<i.length;k++){const c=i[k];!h.has(c)&&e.contains(c)&&(ie(c,r),e.removeChild(c))}}function be(e,n,t,s,r){if(n&&typeof n!="string"&&n.props?.ref&&r&&ie(e,r),n===t)return e;if(typeof t=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==t&&(e.textContent=t),e;{const i=document.createTextNode(t);return e.parentNode?.replaceChild(i,e),i}}if(t&&typeof t!="string"&&t.tag==="#anchor"){const i=t,a=Array.isArray(i.children)?i.children:[],u=i._startNode??document.createTextNode(""),d=i._endNode??document.createTextNode("");i.key!=null&&(V(u,`${i.key}:start`),V(d,`${i.key}:end`)),i._startNode=u,i._endNode=d;const y=document.createDocumentFragment();y.appendChild(u);for(const h of a){const p=U(h,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);y.appendChild(p)}return y.appendChild(d),e.parentNode?.replaceChild(y,e),u}if(!t){ie(e,r);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!n||typeof n=="string"){ie(e,r);const i=U(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,i,r),e.parentNode?.replaceChild(i,e),i}if(t.tag==="#anchor"){const i=Array.isArray(t.children)?t.children:[],a=t._startNode??document.createTextNode(""),u=t._endNode??document.createTextNode("");t.key!=null&&(V(a,`${t.key}:start`),V(u,`${t.key}:end`)),t._startNode=a,t._endNode=u;const d=document.createDocumentFragment();d.appendChild(a);for(const y of i)d.appendChild(U(y,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return d.appendChild(u),e.parentNode?.replaceChild(d,e),a}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&n.key===t.key){const i=e;return Ue(i,n.props||{},t.props||{},s),wt(i,n.children,t.children,s,r),ge(t,i,r),i}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&(n.tag&&String(n.tag).includes("-")||t.props&&t.props.isCustomElement||n.props&&n.props.isCustomElement))try{const a=e;return Ue(a,n.props||{},t.props||{},s),ge(t,a,r),a}catch{}ie(e,r);const o=U(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,o,r),e.parentNode?.replaceChild(o,e),o}function tt(e,n,t,s){let r;Array.isArray(n)?n.length===1?(r=n[0],r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})):r={tag:"div",key:"__root__",children:n}:(r=n,r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})),r&&typeof r=="object"&&r.tag==="#anchor"&&(r={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[r]}),r=Ie(r,String(r.key??"root"));const o=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;o&&i?typeof o!="string"&&typeof r!="string"&&o.tag===r.tag&&o.key===r.key?a=be(i,o,r,t,s):(a=U(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(a,i)):(a=U(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let y=0;y<e.childNodes.length;y++){const h=e.childNodes[y];h!==a&&h.nodeName!=="STYLE"&&(ie(h,s),u.push(h))}u.forEach(y=>e.removeChild(y));const d=r&&typeof r=="object"&&r.props?{...r,props:{...r.props,attrs:r.props.attrs?{...r.props.attrs}:void 0,props:r.props.props?{...r.props.props}:void 0}}:r;e._prevVNode=d,e._prevDom=a}const Se=[],Fe=new WeakMap,de=new WeakMap;function Tt(e,n){de.has(e)||de.set(e,new Set),de.get(e).add(n)}function Nt(e,n){const t=de.get(e);t&&(t.delete(n),t.size===0&&de.delete(e))}function Lt(e,n,t,s,r,o,i,a){if(e){Se.push(t);try{const u=n.render(t);if(u instanceof Promise){o(!0),u.then(d=>{o(!1),i(null),qe(e,d,t,s,r),a(e.innerHTML)}).catch(d=>{o(!1),i(d instanceof Error?d:new Error(String(d)))});return}qe(e,u,t,s,r),a(e.innerHTML)}catch(u){i(u instanceof Error?u:new Error(String(u)))}finally{Se.pop()}}}function qe(e,n,t,s,r){if(e)try{tt(e,Array.isArray(n)?n:[n],t,s),r(e.innerHTML)}catch(o){throw x.devError("Error during VDOM rendering:",o),o}}function Rt(e,n,t,s,r,o,i){o!==null&&clearTimeout(o);const d=Date.now()-n<16,y=(()=>{try{return typeof window<"u"&&!!window.Cypress}catch{return!1}})(),h=(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"&&!y}catch{return!1}})(),p=h||y;if(d){const k=t+1;r(k);const c=p?50:10,v=p?100:25,E=h?12:50;if(k===c&&!p)x.devWarn(`⚠️ Component rendering frequently. Performance may be impacted.
|
|
1
|
+
"use strict";const l=require("./namespace-helpers-4qeKVqQw.cjs"),x=require("./logger-CSALKaYm.cjs"),B=require("./transitions-Cm2TlhoN.cjs"),le=new Map,Me=Symbol.for("cer.registry");function it(){if(!(typeof window>"u"&&typeof document>"u"&&typeof navigator>"u"))try{const n=globalThis;if(!n[Me]){const t=crypto.randomUUID();n[Me]=new Map([...le.entries()]),n[Me].__realmId=t}}catch(n){x.devWarn("Could not initialize global registry:",n)}}function ot(e,n,t){if(t)for(const[s,r]of Object.entries(t)){let o,i={};if(Array.isArray(r)?(o=r[0],i=r[1]||{}):o=r,n.set(s,{callback:o,options:i,oldValue:l.getNestedValue(e,s)}),i.immediate)try{const a=l.getNestedValue(e,s);o(a,void 0,e)}catch(a){x.devError(`Error in immediate watcher for "${s}":`,a)}}}function at(e,n,t,s){const r=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((p,_)=>r(p,a[_]));const u=i,d=a,y=Object.keys(u||{}),h=Object.keys(d||{});return y.length!==h.length?!1:y.every(p=>r(u[p],d[p]))},o=n.get(t);if(o&&!r(s,o.oldValue))try{o.callback(s,o.oldValue,e),o.oldValue=s}catch(i){x.devError(`Error in watcher for "${t}":`,i)}for(const[i,a]of n.entries())if(a.options.deep&&t.startsWith(i+"."))try{const u=l.getNestedValue(e,i);r(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){x.devError(`Error in deep watcher for "${i}":`,u)}}function je(e,n){return n===Boolean?e===""||e==="true":n===Number?Number(e):e}function ct(e,n,t){if(n)for(const s in n){const r=n[s],o=l.toKebab(s),i=e.getAttribute(o);if(r.type===Function&&typeof e[s]=="function")t[s]=e[s];else if(i!==null)t[s]=je(i,r.type);else if(typeof e[s]<"u")try{const a=e[s];if(r.type===String&&a&&typeof a=="object")try{t[s]=je(String(a),r.type)}catch{t[s]=a}else r.type===Boolean&&typeof a=="boolean"||r.type===Number&&typeof a=="number"||r.type===Function&&typeof a=="function"?t[s]=a:t[s]=je(String(a),r.type)}catch{t[s]=e[s]}else"default"in r&&r.default!==void 0&&(t[s]=r.default)}}function lt(e,n,t){if(!n.props){try{const s=t?._hookCallbacks?.props||{},r=Array.from(new Set([...Object.keys(e||{}),...Object.keys(s||{})]));for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(t,o);if(!(!Object.prototype.hasOwnProperty.call(s,o)&&i&&(i.get||i.set||!i.configurable)))try{Object.defineProperty(t,o,{enumerable:!0,configurable:!0,get(){try{const u=l.toKebab(o),d=e.getAttribute(u);if(d!==null)return d;const y=e[o];let h;return l.isReactiveState(y)||y&&typeof y=="object"&&"value"in y&&!(y instanceof Node)?h=y.value:h=y,h}catch{return e[o]}}})}catch{}}}catch{}return}ct(e,n.props,t)}function ft(e,n,t,s){e.onConnected&&!t&&(e.onConnected(n),s(!0))}function ut(e,n,t,s,r,o,i,a){e.onDisconnected&&e.onDisconnected(n),t.forEach(u=>u()),s(),r(),o(!1),i(null),a(!1)}function dt(e,n,t,s,r){e.onAttributeChanged&&e.onAttributeChanged(n,t,s,r)}class Z{static cleanupFunctions=new WeakMap;static addListener(n,t,s,r){n.addEventListener(t,s,r);const i={event:t,handler:s,wrapper:s,options:r,cleanup:()=>n.removeEventListener(t,s,r),addedAt:Date.now()};this.cleanupFunctions.has(n)||this.cleanupFunctions.set(n,[]);const a=this.cleanupFunctions.get(n);a.push(i),a.__metaList=a}static removeListener(n,t,s,r){n.removeEventListener(t,s,r);const o=this.cleanupFunctions.get(n);if(o)for(let i=0;i<o.length;i++){const a=o[i];if(a.event===t&&a.handler===s){o.splice(i,1),o.length===0&&this.cleanupFunctions.delete(n);return}}}static cleanup(n){const t=this.cleanupFunctions.get(n);t&&(t.forEach(s=>{try{s.cleanup()}catch{}}),this.cleanupFunctions.delete(n))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(n){const t=this.cleanupFunctions.get(n);return!!(t&&t.length>0)}static getListenerCount(n){const t=this.cleanupFunctions.get(n);return t?t.length:0}static getListenerInfo(n){const t=this.cleanupFunctions.get(n);return t?t.map(s=>({event:s.event,handler:s.handler,wrapper:s.wrapper,options:s.options})):[]}}class pt{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(n,t){const s=this.cache.get(n);if(s){if(!s.isSecure){x.devWarn("Blocked cached dangerous expression:",n);return}try{this.cache.delete(n),this.cache.set(n,s)}catch{}return s.evaluator(t)}const r=this.createEvaluator(n);if(this.cache.size>=this.maxCacheSize){const o=this.cache.keys().next().value;o&&this.cache.delete(o)}if(this.cache.set(n,r),!r.isSecure){x.devWarn("Blocked dangerous expression:",n);return}return r.evaluator(t)}static createEvaluator(n){if(this.hasDangerousPatterns(n))return{evaluator:()=>{},isSecure:!1};if(n.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(n),isSecure:!0}}catch(t){return x.devWarn("Failed to create evaluator for expression:",n,t),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(n){return this.dangerousPatterns.some(t=>t.test(n))}static createSafeEvaluator(n){const t=n.trim();if(t.startsWith("{")&&t.endsWith("}"))return this.createObjectEvaluator(n);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(n.trim())){const s=n.trim().slice(4);return r=>l.getNestedValue(r,s)}return n.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(n)?this.createSimpleEvaluator(n):s=>l.getNestedValue(s,n)}static createObjectEvaluator(n){const t=n.trim().slice(1,-1),s=this.parseObjectProperties(t);return r=>{const o={};for(const{key:i,value:a}of s)try{if(a.startsWith("ctx.")){const u=a.slice(4);o[i]=l.getNestedValue(r,u)}else o[i]=this.evaluateSimpleValue(a,r)}catch{o[i]=void 0}return o}}static parseObjectProperties(n){const t=[],s=n.split(",");for(const r of s){const o=r.indexOf(":");if(o===-1)continue;const i=r.slice(0,o).trim(),a=r.slice(o+1).trim(),u=i.replace(/^['"]|['"]$/g,"");t.push({key:u,value:a})}return t}static createSimpleEvaluator(n){return t=>{try{let s=n;const r=[];s=s.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,h=>`<<#${r.push(h)-1}#>>`);const o=s.match(/ctx\.[\w.]+/g)||[];for(const h of o){const p=h.slice(4),_=l.getNestedValue(t,p);if(_===void 0)return;const R=r.push(JSON.stringify(_))-1;s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${R}#>>`)}const i=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=s.match(i)||[];for(const h of a){if(h.startsWith("ctx."))continue;const p=l.getNestedValue(t,h);if(p===void 0)return;const _=r.push(JSON.stringify(p))-1;s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${_}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let d;const y=new Set;for(;(d=u.exec(s))!==null;){const h=d[1];if(["true","false","null","undefined"].includes(h)||/^[0-9]+$/.test(h)||h==="ctx"||y.has(h))continue;y.add(h);const p=l.getNestedValue(t,h);if(p===void 0)return;const _=JSON.stringify(p),R=r.push(_)-1;h.includes(".")?s=s.replace(new RegExp(h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${R}#>>`):s=s.replace(new RegExp("\\b"+h.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${R}#>>`)}s=s.replace(/<<#(\d+)#>>/g,(h,p)=>r[Number(p)]);try{return this.evaluateBasicExpression(s)}catch{return}}catch{return}}}static evaluateBasicExpression(n){const t=this.tokenize(n);let s=0;function r(){return t[s]}function o(b){const w=t[s++];if(b&&!w)throw new Error(`Unexpected token EOF, expected ${b}`);if(b&&w&&w.type!==b&&w.value!==b)throw new Error(`Unexpected token ${w.type}/${w.value}, expected ${b}`);return w}function i(){return R()}function a(b){if(typeof b=="number")return b;if(b==null)return NaN;if(typeof b=="boolean")return b?1:0;const w=Number(b);return Number.isNaN(w)?NaN:w}function u(b,w){return typeof b=="string"||typeof w=="string"?String(b)+String(w):a(b)+a(w)}function d(b,w){return a(b)-a(w)}function y(b,w){return a(b)*a(w)}function h(b,w){return a(b)/a(w)}function p(b,w){return a(b)%a(w)}function _(b,w,f){if(typeof w=="number"&&typeof f=="number")switch(b){case">":return w>f;case"<":return w<f;case">=":return w>=f;case"<=":return w<=f;default:return!1}const m=String(w),T=String(f);switch(b){case">":return m>T;case"<":return m<T;case">=":return m>=T;case"<=":return m<=T;default:return!1}}function R(){const b=k(),w=r();if(w&&w.value==="?"){o("?");const f=i();o(":");const m=i();return b?f:m}return b}function k(){let b=c();for(;;){const w=r();if(!w||w.value!=="||")break;o("OP");const f=c();b=b||f}return b}function c(){let b=v();for(;;){const w=r();if(!w||w.value!=="&&")break;o("OP");const f=v();b=b&&f}return b}function v(){let b=E();for(;;){const w=r();if(!w||!["==","!=","===","!=="].includes(w.value))break;const f=o("OP").value,m=E();switch(f){case"==":b=b==m;break;case"!=":b=b!=m;break;case"===":b=b===m;break;case"!==":b=b!==m;break}}return b}function E(){let b=g();for(;;){const w=r();if(!w||![">","<",">=","<="].includes(w.value))break;const f=o("OP").value,m=g();switch(f){case">":b=_(">",b,m);break;case"<":b=_("<",b,m);break;case">=":b=_(">=",b,m);break;case"<=":b=_("<=",b,m);break}}return b}function g(){let b=S();for(;;){const w=r();if(!w||w.value!=="+"&&w.value!=="-")break;const f=o("OP").value,m=S();b=f==="+"?u(b,m):d(b,m)}return b}function S(){let b=C();for(;;){const w=r();if(!w||w.value!=="*"&&w.value!=="/"&&w.value!=="%")break;const f=o("OP").value,m=C();switch(f){case"*":b=y(b,m);break;case"/":b=h(b,m);break;case"%":b=p(b,m);break}}return b}function C(){const b=r();if(b&&b.value==="!")return o("OP"),!C();if(b&&b.value==="-"){o("OP");const w=C();return d(0,w)}return A()}function A(){const b=r();if(b){if(b.type==="NUMBER")return o("NUMBER"),Number(b.value);if(b.type==="STRING")return o("STRING"),b.value.slice(1,-1);if(b.type==="IDENT")return o("IDENT"),b.value==="true"?!0:b.value==="false"?!1:b.value==="null"?null:void 0;if(b.value==="["){o("PUNC");const w=[];for(;;){const f=r();if(!f||f.value==="]")break;w.push(i());const m=r();m&&m.value===","&&o("PUNC")}return o("PUNC"),w}if(b.value==="("){o("PUNC");const w=i();return o("PUNC"),w}throw new Error("Unexpected token in expression")}}return i()}static tokenize(n){const t=[],s=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let r;for(;(r=s.exec(n))!==null;){const o=r[1];o&&(/^\d/.test(o)?t.push({type:"NUMBER",value:o}):/^"/.test(o)||/^'/.test(o)?t.push({type:"STRING",value:o}):/^[a-zA-Z_]/.test(o)?t.push({type:"IDENT",value:o}):/^[()?:,[\]]$/.test(o)?t.push({type:"PUNC",value:o}):t.push({type:"OP",value:o}))}return t}static evaluateSimpleValue(n,t){if(n==="true")return!0;if(n==="false")return!1;if(!isNaN(Number(n)))return Number(n);if(n.startsWith("ctx.")){const s=n.slice(4);return l.getNestedValue(t,s)}return n.startsWith('"')&&n.endsWith('"')||n.startsWith("'")&&n.endsWith("'")?n.slice(1,-1):n}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}function we(e,n){return Array.isArray(e)&&Array.isArray(n)?JSON.stringify([...e].sort())!==JSON.stringify([...n].sort()):e!==n}function Ke(e,n,t,s,r){if(e){const o=n.value;if(r&&typeof o=="object"&&o!==null){const i={...o};i[r]=t,n.value=i}else n.value=t}else{const o=s._state||s;l.setNestedValue(o,n,t)}}function Te(e,n,t,s){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const r=n?"reactiveState":t;e._triggerWatchers(r,s)}}function ht(e,n,t){const s=`update:${l.toKebab(n)}`,r=`update:${n}`,o=new CustomEvent(s,{detail:t,bubbles:!0,cancelable:!0}),i=new CustomEvent(r,{detail:t,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(i)}function Ve(e,n,t,s){const r=t;if(l.safe(()=>{if(typeof e.setAttribute=="function")try{e[n]=r}catch{}else e[n]=r}),r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"){const o=l.safeSerializeAttr(r);o!==null?l.safe(()=>{typeof e.setAttribute=="function"&&l.setAttributeSmart(e,l.toKebab(n),String(o))}):l.safe(()=>{typeof e.removeAttribute=="function"&&l.removeAttributeSmart(e,l.toKebab(n))})}}function yt(e,n,t,s){if(e){const r=n.value;return s&&typeof r=="object"&&r!==null?r[s]:r}else{const r=t._state||t;return l.getNestedValue(r,n)}}function ve(e){return e!=null&&typeof e=="object"&&"value"in e}function He(e){return e!=null&&typeof e=="object"&&"value"in e?e.value:e}function X(e,n,t){if(!e)return;e.attrs||(e.attrs={});const s=e.attrs;s[n]=t}function q(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function oe(e){return e!=null&&typeof e=="object"&&"value"in e?oe(e.value):!(e!=null&&typeof e=="object"||e===!1||e==="false"||e===null||e===void 0||e===0)}function Je(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function De(e){return typeof e=="boolean"||e==="true"||e==="false"}function mt(e,n,t,s,r,o,i,a){if(!o)return;const u=n.includes("lazy"),d=n.includes("trim"),y=n.includes("number"),h=()=>{if(l.isReactiveState(e)){const S=e.value;return a&&i&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)&&typeof S=="object"&&S!==null?S[a]:S}const g=o?._state||o;return l.getNestedValue(g,e)},p=h();let _="text";i instanceof HTMLInputElement?_=s?.type||i.type||"text":i instanceof HTMLSelectElement?_="select":i instanceof HTMLTextAreaElement&&(_="textarea");const R=i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement,c=R?_==="checkbox"||_==="radio"?"checked":"value":a??"modelValue";if(_==="checkbox")if(Array.isArray(p))t[c]=p.includes(String(i?.getAttribute("value")??s?.value??""));else{const g=i?.getAttribute("true-value")??!0;t[c]=p===g}else if(_==="radio")t[c]=p===(s?.value??"");else if(_==="select")if(i&&i.hasAttribute("multiple")&&i instanceof HTMLSelectElement){const g=Array.isArray(p)?p.map(String):[];setTimeout(()=>{Array.from(i.options).forEach(S=>{S.selected=g.includes(S.value)})},0),t[c]=Array.isArray(p)?p:[]}else t[c]=p;else{!R&&l.isReactiveState(e)?t[c]=e:t[c]=p;try{const g=l.toKebab(c);s&&(s[g]=p)}catch{}}const v=u||_==="checkbox"||_==="radio"||_==="select"?"change":"input",E=g=>{if(g.isComposing||r._isComposing)return;const S=globalThis.process,C=!!S&&S.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(g.isTrusted===!1&&!C)return;const A=g.target;if(!A||A._modelUpdating)return;let N=A.value;if(_==="checkbox"){const f=h();if(Array.isArray(f)){const m=A.getAttribute("value")??"",T=Array.from(f);if(A.checked)T.includes(m)||T.push(m);else{const L=T.indexOf(m);L>-1&&T.splice(L,1)}N=T}else{const m=A.getAttribute("true-value")??!0,T=A.getAttribute("false-value")??!1;N=A.checked?m:T}}else if(_==="radio")N=A.getAttribute("value")??A.value;else if(_==="select"&&A.multiple)N=Array.from(A.selectedOptions).map(f=>f.value);else if(d&&typeof N=="string"&&(N=N.trim()),y){const f=Number(N);isNaN(f)||(N=f)}const b=h();if(we(N,b)){A._modelUpdating=!0;try{Ke(l.isReactiveState(e),e,N,o,a),Te(o,l.isReactiveState(e),e,N),A&&ht(A,c,N)}finally{setTimeout(()=>A._modelUpdating=!1,0)}}};if(R){if(r[v]){const g=r[v];i&&Z.removeListener(i,v,g)}r[v]=E}else{const g=`update:${l.toKebab(c)}`,S=`update:${c}`;if(r[g]){const C=r[g];i&&Z.removeListener(i,g,C)}if(r[S]){const C=r[S];i&&Z.removeListener(i,S,C)}if(r[g]=C=>{const A=C.detail;let N=A!==void 0?A:void 0;if(N===void 0){const f=C.target;if(f&&typeof f=="object"&&"value"in f)try{N=f.value}catch{N=void 0}}const b=yt(l.isReactiveState(e),e,o,a);if(we(N,b)){Ke(l.isReactiveState(e),e,N,o,a),Te(o,l.isReactiveState(e),e,N);const f=C.target;f&&Ve(f,c,l.isReactiveState(e)?e:N,l.isReactiveState(e))}},l.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let C;try{C=Reflect.ownKeys(e.value)}catch{C=Object.keys(e.value)}const A=C.filter(N=>typeof N=="string"&&!String(N).startsWith("_")&&N!=="constructor");for(const N of A){const b=String(N),w=`update:${l.toKebab(b)}`,f=`update:${b}`;r[w]||(r[w]=m=>{const T=m.detail!==void 0?m.detail:m.target?.value,L=l.isReactiveState(e)?e.value[b]:l.getNestedValue(o?._state||o,e);if(!we(T,L))return;if(l.isReactiveState(e)){const I={...e.value};I[b]=T,e.value=I}else l.setNestedValue(o?._state||o,e,T);Te(o,l.isReactiveState(e),e,T);const j=m.currentTarget||i||m.target;j&&Ve(j,c,l.isReactiveState(e)?e:T,l.isReactiveState(e))},r[f]=r[w])}}r[S]=r[g]}(_==="text"||_==="textarea")&&(r.compositionstart=()=>r._isComposing=!0,r.compositionend=g=>{r._isComposing=!1;const S=g.target;S&&setTimeout(()=>{const C=S.value,A=o?._state||o,N=l.getNestedValue(A,e);let b=C;if(d&&(b=b.trim()),y){const f=Number(b);isNaN(f)||(b=f)}if(we(b,N)){S._modelUpdating=!0;try{l.setNestedValue(A,e,b),Te(o,l.isReactiveState(e),e,b)}finally{setTimeout(()=>S._modelUpdating=!1,0)}}},0)})}function gt(e,n,t,s,r){if(typeof e=="object"&&e!==null)for(const[o,i]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")t[o]=i;else if(o==="disabled"&&r&&q(r)){const a=i&&typeof i=="object"&&"value"in i;(()=>{try{return l.isReactiveState(i)}catch{return!1}})()||a?n[o]=i:t[o]=i}else n[o]=i;else if(typeof e=="string"){if(!s)return;try{const o=Ae(e,s);if(typeof o=="object"&&o!==null){for(const[i,a]of Object.entries(o))if(i.startsWith("data-")||i.startsWith("aria-")||i==="class")t[i]=a;else if(i==="disabled"&&r&&q(r)){const u=a&&typeof a=="object"&&"value"in a;(()=>{try{return l.isReactiveState(a)}catch{return!1}})()||u?n[i]=a:t[i]=a}else n[i]=a;return}else{t[e]=o;return}}catch{const o=l.getNestedValue(s,e);t[e]=o}}}function bt(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(e,t)}else s=e;const r=String(n.style||"");let o=r;if(s){if(r){const i=String(r).split(";").map(u=>u.trim()).filter(Boolean),a=i.findIndex(u=>u.startsWith("display:"));a>=0&&i[a]==="display: none"&&(i.splice(a,1),o=i.length>0?i.join("; ")+";":"")}}else if(r){const i=String(r).split(";").filter(Boolean),a=i.findIndex(u=>u.trim().startsWith("display:"));a>=0?i[a]="display: none":i.push("display: none"),o=i.join("; ")}else o="display: none";o!==r&&(o?n.style=o:n.style=void 0)}function Ae(e,n){return pt.evaluate(e,n)}function vt(e,n,t,s){let r;if(typeof e=="string"){if(!t)return;r=Ae(e,t)}else r=e;try{if(r&&typeof r=="object"){if(l.isReactiveState(r))r=r.value;else if("value"in r&&typeof r.value<"u"){const d=r.value;d instanceof Node||(r=d)}}}catch{}let o=[];if(typeof r=="string")o=[r];else if(Array.isArray(r))o=r.filter(Boolean);else if(typeof r=="object"&&r!==null)for(const[d,y]of Object.entries(r))y&&o.push(d);const i=o.join(" "),a=s&&s.class||n.class||"",u=a?`${a} ${i}`.trim():i.trim();u?n.class=u:n.class=void 0}function St(e,n,t){let s;if(typeof e=="string"){if(!t)return;s=Ae(e,t)}else s=e;let r="";if(typeof s=="string")r=s;else if(s&&typeof s=="object"){const i=[];for(const[a,u]of Object.entries(s))if(u!=null&&u!==""){const d=a.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),y=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let h=String(u);typeof u=="number"&&y.includes(d)&&(h=`${u}px`),i.push(`${d}: ${h}`)}r=i.join("; ")+(i.length>0?";":"")}const o=String(n.style||"");n.style=o+(o&&!o.endsWith(";")?"; ":"")+r}function Et(e,n,t){let s=e;typeof e=="string"&&t&&(s=Ae(e,t)),l.isReactiveState(s)?n.reactiveRef=s:n.ref=s}function Ye(e,n,t,s){const r={},o={...s||{}},i={};for(const[a,u]of Object.entries(e)){const{value:d,modifiers:y,arg:h}=u;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),_=p.length>1?p[1]:h;mt(d,y,r,o,i,n,t,_);continue}switch(a){case"bind":gt(d,r,o,n,t);break;case"show":bt(d,o,n);break;case"class":vt(d,o,n,s);break;case"style":St(d,o,n);break;case"ref":Et(d,r,n);break}}try{if(Object.prototype.hasOwnProperty.call(r,"disabled")&&t&&q(t)){const u=r.disabled,d=u&&typeof u=="object"&&"value"in u;let y=!1;try{y=l.isReactiveState(u)}catch{y=!1}if(!d&&!y)try{o.disabled=u,delete r.disabled;const h=globalThis;h.__VDOM_DISABLED_PROMOTIONS||(h.__VDOM_DISABLED_PROMOTIONS=[]),h.__VDOM_DISABLED_PROMOTIONS.push({phase:"bind-directive:postfix-move",location:"attrs",key:"disabled",value:u,time:Date.now(),stack:new Error().stack})}catch{}}}catch{}return{props:r,attrs:o,listeners:i}}function fe(e){return e?e.split(/\s+/).filter(Boolean):[]}function ue(e,n){if(n.length===0)return;const t=n.filter(s=>s&&!e.classList.contains(s));t.length>0&&e.classList.add(...t)}function ce(e,n){if(n.length===0)return;const t=n.filter(Boolean);t.length>0&&e.classList.remove(...t)}let Pe=!1;async function Ct(e,n,t=10){if(!Pe){if(!e.isConnected){x.devWarn("⚠️ Element not connected to DOM, skipping style wait");return}for(let s=0;s<t;s++){const r=window.getComputedStyle(e),o=r.transform&&r.transform!=="",i=r.opacity&&r.opacity!=="";if(o||i){Pe=!0;return}await new Promise(a=>requestAnimationFrame(()=>a(void 0)))}Pe=!0,x.devWarn("⚠️ Styles did not load in time for transition, continuing anyway")}}function At(e){const n=window.getComputedStyle(e),t=n.transitionDuration||"0s",s=n.transitionDelay||"0s",r=o=>{const i=parseFloat(o);return o.includes("ms")?i:i*1e3};return r(t)+r(s)}function Xe(e,n){return new Promise(t=>{const s=n??At(e);if(s<=0){t();return}let r=!1;const o=()=>{r||(r=!0,e.removeEventListener("transitionend",i),e.removeEventListener("transitioncancel",i),t())},i=()=>o();e.addEventListener("transitionend",i),e.addEventListener("transitioncancel",i),setTimeout(o,s+50)})}async function me(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeEnter)try{s.onBeforeEnter(e)}catch(R){x.devError("Transition onBeforeEnter error:",R)}if(!r)return s?.onEnter?new Promise(R=>{const k=s.onEnter;typeof k=="function"?k(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(c){x.devError("Transition onAfterEnter error:",c)}R()}):R()}):void 0;const i=fe(t?.enterFrom),a=fe(t?.enterActive),u=fe(t?.enterTo);ue(e,i),e.offsetHeight,ue(e,a),e.offsetHeight;let d;if(s?.onEnter){const R=new Promise(k=>{d=k});try{const k=s.onEnter;typeof k=="function"&&k(e,()=>{d&&d()})}catch(k){x.devError("Transition onEnter error:",k)}d&&await R}await new Promise(R=>requestAnimationFrame(()=>R(void 0))),e.offsetHeight;const y=window.getComputedStyle(e),h=y.transform,p=y.opacity;ce(e,i),h&&h!=="none"&&(e.style.transform=h),p&&p!==""&&(e.style.opacity=p),e.offsetHeight,await new Promise(R=>requestAnimationFrame(()=>R(void 0))),e.style.transform="",e.style.opacity="",ue(e,u),e.offsetHeight,await new Promise(R=>requestAnimationFrame(()=>R(void 0)));let _;if(typeof o=="number"?_=o:o&&typeof o=="object"&&"enter"in o&&(_=o.enter),await Xe(e,_),ce(e,a),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(R){x.devError("Transition onAfterEnter error:",R)}}async function xe(e,n){const{classes:t,hooks:s,css:r,duration:o}=n;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(h){x.devError("Transition onBeforeLeave error:",h)}if(!r)return s?.onLeave?new Promise(h=>{const p=s.onLeave;typeof p=="function"?p(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(_){x.devError("Transition onAfterLeave error:",_)}h()}):h()}):void 0;const i=fe(t?.leaveFrom),a=fe(t?.leaveActive),u=fe(t?.leaveTo);ue(e,i),e.offsetHeight,ue(e,a);let d;if(s?.onLeave){const h=new Promise(p=>{d=p});try{const p=s.onLeave;typeof p=="function"&&p(e,()=>{d&&d()})}catch(p){x.devError("Transition onLeave error:",p)}d&&await h}await new Promise(h=>requestAnimationFrame(()=>h(void 0))),await Ct(e,[...i,...a]),ce(e,i),ue(e,u);let y;if(typeof o=="number"?y=o:o&&typeof o=="object"&&"leave"in o&&(y=o.leave),await Xe(e,y),ce(e,a),ce(e,u),ce(e,i),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(h){x.devError("Transition onAfterLeave error:",h)}}const Qe=new WeakMap,et=new WeakMap;function Ne(e){if(!e)return;const n=Qe.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t.key!=null)return String(t.key)}catch{}if(e instanceof Element){const t=e.getAttribute("data-anchor-key");if(t)return t}}function V(e,n){try{Qe.set(e,n)}catch{}try{e.key=n}catch{}try{if(e instanceof Element){const t=l.safeSerializeAttr(n);t!==null&&l.setAttributeSmart(e,"data-anchor-key",t)}}catch{}}function _t(e){if(!e)return;const n=et.get(e);if(n!==void 0)return n;try{const t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function kt(e,n){try{et.set(e,n)}catch{}try{e._transitionGroup=n}catch{}}function ie(e,n){if(n){if(e instanceof Element){Z.cleanup(e);const t=[];for(const s in n)n[s]===e&&t.push(s);for(const s of t)delete n[s]}if(e.hasChildNodes()){const t=e.childNodes;for(let s=t.length-1;s>=0;s--)ie(t[s],n)}}}function ge(e,n,t){if(typeof e=="string")return;const s=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),r=e.props?.ref??(e.props?.props&&e.props.props.ref);if(s)try{if(l.isReactiveState(s)||typeof s=="object"&&"value"in s)s.value=n;else if(typeof s=="function")s(n);else if(typeof s=="string"&&t)try{const o=String(s);t[o]=n}catch{}}catch{}else if(r&&t)try{const o=String(r);t[o]=n}catch{}}function Ie(e,n){if(Array.isArray(e)){const o=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const h=i.tag||"node",_=[i.props?.attrs?.id,i.props?.attrs?.name,i.props?.attrs?.["data-key"],i.props?.props?.id,i.props?.props?.name,i.props?.props?.dataKey,i.props?.props?.["data-key"]].find(R=>R!=null)??"";a=_?`${n}:${h}:${_}`:`${n}:${h}`}let u=a,d=1;for(;o.has(u);)u=`${a}#${d++}`;o.add(u);let y=i.children;return Array.isArray(y)&&(y=Ie(y,u)),{...i,key:u,children:y}})}const t=e,s=t.props?.key??t.key??n;let r=t.children;return Array.isArray(r)&&(r=Ie(r,s)),{...t,key:s,children:r}}function Ue(e,n,t,s){const r=t.directives??{},o=t.attrs?{...t.attrs}:{},i=Ye(r,s,e,o),a={...n.props||{},...t.props||{},...i.props||{}},u={...o||{},...i.attrs||{}},d=n.props??{},y=a,h=!!(t?.isCustomElement??n?.isCustomElement??!1);let p=!1;for(const c in{...d,...y}){const v=d[c],E=y[c];let g=v,S=E;if(l.safe(()=>{(l.isReactiveState(v)||ve(v))&&(g=v.value)}),l.safe(()=>{(l.isReactiveState(E)||ve(E))&&(S=E.value)}),!(v===E&&g===S))if(p=!0,c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const C=He(E),A=C==null?"":String(C);e.value!==A&&(e.value=A)}else if(c==="checked"&&e instanceof HTMLInputElement){const C=He(E);e.checked=!!C}else if(c.startsWith("on")&&typeof E=="function"){const C=Je(c);typeof v=="function"&&Z.removeListener(e,C,v),typeof E=="function"&&Z.addListener(e,C,E);try{if(C&&C.startsWith("update:")){const A=C.split(":",2)[1],N=y[A];let b=[];try{if(l.isReactiveState(N)){const f=N.value;b=f&&typeof f=="object"?Object.keys(f):[]}else N&&typeof N=="object"&&(b=Object.keys(N))}catch{b=[]}const w=b.filter(f=>typeof f=="string"&&!f.startsWith("_")&&f!=="constructor");for(const f of w){const m=`update:${f}`,T=L=>{const O=L.detail!==void 0?L.detail:L.target instanceof HTMLInputElement||L.target instanceof HTMLTextAreaElement||L.target instanceof HTMLSelectElement?L.target.value:void 0,I={...l.isReactiveState(N)?N.value||{}:y[A]||{},[f]:O};try{typeof E=="function"&&E({detail:I})}catch{}};l.safe(()=>{Z.addListener(e,m,T)})}}}catch{}}else if(E==null)l.removeAttributeSmart(e,c);else{const C=t?.isCustomElement??n?.isCustomElement??!1;if(C||c in e)try{e[c]=E,c==="disabled"&&E===!1&&!C&&q(e)&&l.removeAttributeSmart(e,"disabled")}catch{}else E===!1&&l.removeAttributeSmart(e,c)}}for(const[c,v]of Object.entries(i.listeners||{})){Z.addListener(e,c,v);try{const E=e&&e.parentElement;E&&E!==e&&Z.addListener(E,c,v)}catch{}}const _={...n.attrs??{}},R=u,k=i&&i.attrs||{};if(Object.prototype.hasOwnProperty.call(k,"class")&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(_.class=c)}if(Object.prototype.hasOwnProperty.call(k,"style")&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(_.style=c)}try{if(Object.prototype.hasOwnProperty.call(k,"class")&&k.class===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(_.class=c)}if(Object.prototype.hasOwnProperty.call(k,"style")&&k.style===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(_.style=c)}try{if(typeof e.getAttribute=="function"){const c=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&c!==null&&c!==_.class&&(_.class=c)}catch{}}}catch{}}catch{}for(const c in{..._,...R}){const v=_[c],E=R[c];let g=v,S=E;if(l.isReactiveState(v)&&(g=v.value),l.isReactiveState(E)&&(S=E.value),g!==S)if(p=!0,S==null||S===!1)l.safe(()=>{l.removeAttributeSmart(e,c)}),X(n,c,void 0),c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?l.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?l.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&l.safe(()=>{e.value=0})),c==="checked"&&e instanceof HTMLInputElement&&l.safe(()=>{e.checked=!1}),c==="disabled"&&q(e)&&l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(c==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){l.safe(()=>{e.value=S??""});continue}else if(e instanceof HTMLSelectElement){l.safe(()=>{e.value=S??""});continue}else if(e instanceof HTMLProgressElement){l.safe(()=>{e.value=Number(S)});continue}}if(c==="checked"&&e instanceof HTMLInputElement){l.safe(()=>{e.checked=!!S});continue}if(c==="style"){const A=l.safeSerializeAttr(S);A!==null&&l.setAttributeSmart(e,c,String(A)),X(n,c,S);continue}if(c==="class"){const A=l.safeSerializeAttr(S);A!==null&&l.setAttributeSmart(e,c,String(A)),X(n,c,S);continue}if(c==="disabled"&&q(e)){l.safe(()=>{const A=oe(S);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=A)}),oe(S)?l.safe(()=>{l.setAttributeSmart(e,c,"")}):l.safe(()=>{l.removeAttributeSmart(e,c)});continue}const C=e.namespaceURI==="http://www.w3.org/2000/svg";if(h&&!C&&c.includes("-"))if(l.isClassLikeAttr(c)){const A=l.safeSerializeAttr(E??S);if(A!==null){try{l.setAttributeSmart(e,c,String(A))}catch{}X(n,c,S)}}else{const A=l.toCamel(c);try{const N=e;N[A]=l.isReactiveState(E)?E:S,X(n,c,S)}catch{const N=l.safeSerializeAttr(E??S);N!==null&&l.setAttributeSmart(e,c,String(N))}}else if(!C&&c in e)try{const A=e;A[c]=l.isReactiveState(E)?E:S,X(n,c,S)}catch{const A=l.safeSerializeAttr(S);A!==null&&(l.setAttributeSmart(e,c,String(A)),X(n,c,S))}else{const A=l.safeSerializeAttr(S);A!==null&&(l.setAttributeSmart(e,c,String(A)),X(n,c,S))}}}try{if(q(e)){const c=a.disabled;let v;try{const g=Object.prototype.hasOwnProperty.call(i.props||{},"disabled"),S=c&&typeof c=="object"&&"value"in c;let C=!1;l.safe(()=>{C=!!l.isReactiveState(c)});const A=De(c);C||S||g||A?v=c:v=u.disabled}catch{v=u.disabled}const E=oe(v);l.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=E)}),E?l.safe(()=>{l.setAttributeSmart(e,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(e,"disabled")})}}catch{}if(h&&p){const c=e;l.safe(()=>{c._applyProps?.(c._cfg)}),l.safe(()=>{typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render?.(c._cfg)})}}function U(e,n,t,s=null){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const c=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&V(c,e.key),c}if(e.tag==="#raw"){const c=typeof e.children=="string"?e.children:"";return document.createRange().createContextualFragment(c)}if(e.tag==="#anchor"){const c=e,v=Array.isArray(c.children)?c.children:[],E=document.createTextNode(""),g=document.createTextNode("");c.key!=null&&(V(E,`${c.key}:start`),V(g,`${c.key}:end`)),c._startNode=E,c._endNode=g;const S=document.createDocumentFragment();S.appendChild(E);for(const C of v){const A=U(C,n,t,s);if(c.key!=null&&A instanceof Element&&!A.hasAttribute("data-anchor-key")){const N=C;N&&typeof N=="object"&&N.key!=null||V(A,String(c.key))}S.appendChild(A)}return S.appendChild(g),S}const r=e&&typeof e=="object"&&e.props&&e.props.attrs?e.props.attrs:void 0,i=(r&&typeof r.xmlns=="string"?String(r.xmlns):void 0)??s??l.TAG_NAMESPACE_MAP[e.tag]??null,a=i?document.createElementNS(i,e.tag):document.createElement(e.tag);e.key!=null&&V(a,e.key),e.props&&e.props?._transitionGroup&&kt(a,e.props?._transitionGroup);const{props:u={},attrs:d={},directives:y={}}=e.props??{},h=Ye(y,n,a instanceof HTMLElement?a:void 0,d),p={...u,...h.props},_={...d,...h.attrs};try{const c=(_&&_.class)??(p&&p.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),v=l.safeSerializeAttr(c);if(v!==null){const E=String(v).trim();E&&l.setAttributeSmart(a,"class",E)}}catch{}try{if(p.disabled!==void 0&&a&&q(a)){const c=p.disabled,v=c&&typeof c=="object"&&"value"in c;let E=!1;try{E=l.isReactiveState(c)}catch{E=!1}!v&&!E&&l.safe(()=>{_.disabled=c,delete p.disabled})}}catch{}const R=a.namespaceURI==="http://www.w3.org/2000/svg";for(const c in _){const v=_[c];if(typeof c!="string"||/\[object Object\]/.test(c))continue;const E=He(v);if(typeof E=="boolean")E?l.setAttributeSmart(a,c,""):l.safe(()=>{l.removeAttributeSmart(a,c)});else if(E!=null){if(c==="disabled"&&q(a)){const g=p.disabled,S=De(g)?g:E,C=oe(S);l.safe(()=>{a.disabled=C}),C?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}if(!R&&c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement||a instanceof HTMLProgressElement))try{a instanceof HTMLProgressElement?a.value=Number(E):a.value=String(E??"")}catch{const g=l.safeSerializeAttr(E);g!==null&&l.setAttributeSmart(a,c,String(g))}else if(!R&&c==="checked"&&a instanceof HTMLInputElement)try{a.checked=!!E}catch{const g=l.safeSerializeAttr(E);g!==null&&l.setAttributeSmart(a,c,String(g))}else if(!R&&c in a)try{a[c]=E,c==="disabled"&&E===!1&&q(a)&&l.removeAttributeSmart(a,"disabled"),X(e.props,c,E)}catch{const g=l.safeSerializeAttr(E);g!==null&&l.setAttributeSmart(a,c,String(g))}else if((e.props?.isCustomElement??!1)&&!R&&c.includes("-")){const S=l.toCamel(c);try{a[S]=E}catch{const C=l.safeSerializeAttr(E);C!==null&&l.setAttributeSmart(a,c,String(C))}}else{const S=l.safeSerializeAttr(E);S!==null&&l.setAttributeSmart(a,c,String(S))}}}for(const c in p){const v=p[c];if(!(typeof c!="string"||/\[object Object\]/.test(c)))if(c==="value"&&(a instanceof HTMLInputElement||a instanceof HTMLTextAreaElement||a instanceof HTMLSelectElement)){const E=typeof v=="object"&&v!==null&&ve(v)?v.value:v;l.safe(()=>{a.value=String(E??"")})}else if(c.startsWith("on")&&typeof v=="function"){const E=Je(c),g=E.includes(":")?(()=>{const S=E.split(":"),C=S[1];if(C.includes("-")){const A=C.split("-").map((N,b)=>b===0?N:N.charAt(0).toUpperCase()+N.slice(1)).join("");return`${S[0]}:${A}`}else{const A=C.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${S[0]}:${A}`}})():E;h.listeners&&(h.listeners[E]||h.listeners[g])||Z.addListener(a,E,v)}else{if(c.startsWith("on")&&v===void 0)continue;if(v==null||v===!1)l.removeAttributeSmart(a,c);else{const E=e.props?.isCustomElement??!1,g=typeof v=="object"&&v!==null&&l.isReactiveState(v)?v:ve(v)&&typeof v.value<"u"?v.value:v;if(c==="class"||c==="style"){try{const S=l.safeSerializeAttr(g);S!==null&&l.setAttributeSmart(a,c,String(S))}catch{}continue}if(E||c in a)try{const S=typeof v=="object"&&v!==null&&l.isReactiveState(v)?v:ve(v)?v.value:v;if(c==="disabled"&&q(a)){const C=p.disabled!==void 0?p.disabled:S,A=oe(C);l.safe(()=>{a.disabled=A}),A?l.safe(()=>{l.setAttributeSmart(a,c,"")}):l.safe(()=>{l.removeAttributeSmart(a,c)});continue}try{if(typeof a[c]=="boolean"){let A=S;typeof S=="string"?S==="false"?A=!1:S==="true"?A=!0:A=!!S&&S!=="":A=!!S,a[c]=A}else a[c]=S}catch{a[c]=S}}catch{}}}}for(const[c,v]of Object.entries(h.listeners||{}))Z.addListener(a,c,v);const k={...e,props:{...e.props,...h.props}};ge(k,a,t);try{const c=a;if(typeof c._applyProps=="function")try{c._applyProps(c._cfg)}catch{}typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render(c._cfg)}catch{}if(Array.isArray(e.children)){const c=e.tag==="foreignObject"&&i===l.SVG_NS?null:a.namespaceURI??null;for(const v of e.children)a.appendChild(U(v,n,t,c))}else typeof e.children=="string"&&(a.textContent=e.children);try{if(a instanceof HTMLSelectElement&&_&&Object.prototype.hasOwnProperty.call(_,"value"))try{a.value=String(_.value??"")}catch{}}catch{}try{if(q(a)){const c=p.disabled,v=_.disabled,E=c&&typeof c=="object"&&"value"in c;let g=!1;try{g=!!l.isReactiveState(c)}catch{g=!1}const C=g||E||De(c)?c:v,A=oe(C);l.safe(()=>{a.disabled=A}),A?l.safe(()=>{l.setAttributeSmart(a,"disabled","")}):l.safe(()=>{l.removeAttributeSmart(a,"disabled")})}}catch{}return a}function wt(e,n,t,s,r){if(typeof t=="string"){e.textContent!==t&&(e.textContent=t);return}if(!Array.isArray(t))return;const o=e.childNodes,i=[];for(let k=0;k<o.length;k++)i.push(o[k]);const a=Array.isArray(n)?n:[],u=_t(e);if(u){const k=g=>{if(typeof g=="string")return g.startsWith("each-")?g.substring(5):g;if(typeof g=="number")return String(g)},c=[],v=[];for(const g of t)if(g&&g.tag==="#anchor"){const S=Array.isArray(g.children)?g.children:[];for(const C of S){const A=k(C.key??g.key??"unknown");c.push({...C,key:A})}}else g&&c.push({...g,key:k(g.key)});for(const g of a)if(g&&g.tag==="#anchor"){const S=Array.isArray(g.children)?g.children:[];for(const C of S){const A=k(C.key??g.key??"unknown");v.push({...C,key:A})}}else g&&v.push({...g,key:k(g.key)});if(c.some(g=>g&&g.key!=null)||v.some(g=>g&&g.key!=null)){const g=new Map,S=new Map;for(const f of v)if(f&&f.key!=null){const m=String(f.key);g.set(m,f)}for(let f=0;f<i.length;f++){const m=i[f];let T=Ne(m);if(T=k(T),T!=null&&m instanceof Element&&m.nodeType===Node.ELEMENT_NODE){let L=typeof T=="string"&&T.includes(":")?T.substring(0,T.lastIndexOf(":")):T;L=String(L),S.set(L,m)}}const C=new Set,A=new Map,N=i.length>0;if(u.moveClass&&N)for(let f=0;f<i.length;f++){const m=i[f];if(m instanceof HTMLElement&&m.parentElement){const T=m.getBoundingClientRect();A.set(m,T)}}const b=[];for(const f of c){let m=f.key;if(m==null)continue;m=String(m);const T=g.get(m);let L=S.get(m);if(L&&T){const O=be(L,T,f,s);C.add(L);const j=String(m);V(O,j),b.push({node:O,key:m,newVNode:f,oldVNode:T,isNew:!1})}else{L=U(f,s,void 0,e instanceof Element?e.namespaceURI??null:null),V(L,String(m)),e.appendChild(L);const O=N||u.appear===!0;L instanceof HTMLElement&&O&&me(L,u).catch(j=>{x.devError("Enter transition error:",j)}),b.push({node:L,key:m,newVNode:f,isNew:!0})}}const w=[];for(let f=0;f<i.length;f++){const m=i[f],T=Ne(m);if(!C.has(m)&&T!=null&&m instanceof HTMLElement){const O=xe(m,u).then(()=>{e.contains(m)&&e.removeChild(m)}).catch(j=>{x.devError("Leave transition error:",j),e.contains(m)&&e.removeChild(m)});w.push(O)}}if(w.length===0){let f=e.firstChild;for(const{node:m}of b)m!==f&&e.insertBefore(m,f),f=m.nextSibling;if(u.moveClass&&A.size>0){const m=[];for(const{node:T,isNew:L}of b)if(!L&&T instanceof HTMLElement){const O=A.get(T);if(O){const j=T.getBoundingClientRect(),I=O.left-j.left,M=O.top-j.top;if(I!==0||M!==0){const z=u.moveClass.split(/\s+/).filter(D=>D);m.push({node:T,deltaX:I,deltaY:M,moveClasses:z})}}}if(m.length>0){for(const{node:T,deltaX:L,deltaY:O}of m)T.style.transform=`translate(${L}px, ${O}px)`,T.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:T,moveClasses:L}of m)for(const O of L)T.classList.add(O);requestAnimationFrame(()=>{const T=u.moveClass||"",L=T.match(/duration-(\d+)/),O=L?`${L[1]}ms`:"300ms",j=T.match(/ease-(out|in|in-out|linear)/),I=j?`ease-${j[1]}`:"ease-out";for(const{node:M}of m)M.style.transition=`transform ${O} ${I}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:z}of m){M.style.removeProperty("transform");const D=()=>{for(const Q of z)M.classList.remove(Q);M.style.removeProperty("transition"),M.removeEventListener("transitionend",D),M.removeEventListener("transitioncancel",D)};M.addEventListener("transitionend",D,{once:!0}),M.addEventListener("transitioncancel",D,{once:!0})}})})})})}}}return}}const d=new Map;for(const k of a)k&&k.key!=null&&d.set(k.key,k);const y=new Map;for(let k=0;k<i.length;k++){const c=i[k],v=Ne(c);v!=null&&y.set(v,c)}const h=new Set;let p=e.firstChild;function _(k,c){let v=k;for(;v&&(h.add(v),v!==c);)v=v.nextSibling}function R(k,c,v,E,g,S=!0){const C=[];let A=k.nextSibling;for(;A&&A!==c;)C.push(A),A=A.nextSibling;const N=Array.isArray(v)?v:[];if(E.some(w=>w&&w.key!=null)||N.some(w=>w&&w.key!=null)){const w=new Map,f=new Map;for(const O of N)O&&O.key!=null&&w.set(O.key,O);for(const O of C){const j=Ne(O);j!=null&&f.set(j,O)}const m=g&&g.state==="visible"&&N.length===0&&E.length>0,T=new Set;let L=k.nextSibling;for(const O of E){let j;if(O.key!=null&&f.has(O.key)){const I=w.get(O.key);j=be(f.get(O.key),I,O,s),T.add(j),g&&j instanceof HTMLElement&&m&&g.appear&&me(j,g).catch(M=>{x.devError("Transition enter error (appear):",M)}),j!==L&&e.contains(j)&&e.insertBefore(j,L)}else j=U(O,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore(j,L),T.add(j),g&&j instanceof HTMLElement&&S&&me(j,g).catch(I=>{x.devError("Transition enter error:",I)});L=j.nextSibling}for(const O of C)!T.has(O)&&e.contains(O)&&(g&&O instanceof HTMLElement&&S?xe(O,g).then(()=>{e.contains(O)&&e.removeChild(O)}).catch(j=>{x.devError("Transition leave error:",j),e.contains(O)&&e.removeChild(O)}):e.removeChild(O))}else{const w=Math.min(N.length,E.length);for(let f=0;f<w;f++){const m=N[f],T=E[f],L=be(C[f],m,T,s);L!==C[f]&&(e.insertBefore(L,C[f]),e.removeChild(C[f]))}for(let f=w;f<E.length;f++){const m=U(E[f],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(m,c),g&&m instanceof HTMLElement&&S&&me(m,g).catch(T=>{x.devError("Transition enter error:",T)})}for(let f=w;f<C.length;f++){const m=C[f];g&&m instanceof HTMLElement&&S?xe(m,g).then(()=>{e.contains(m)&&e.removeChild(m)}).catch(T=>{x.devError("Transition leave error:",T),e.contains(m)&&e.removeChild(m)}):e.removeChild(m)}}}for(const k of t){let c;if(k.tag==="#anchor"){const v=k.key,E=`${v}:start`,g=`${v}:end`;let S=y.get(E),C=y.get(g);const A=Array.isArray(k.children)?k.children:[];if(S||(S=document.createTextNode(""),V(S,E)),C||(C=document.createTextNode(""),V(C,g)),k._startNode=S,k._endNode=C,!e.contains(S)||!e.contains(C)){e.insertBefore(S,p);const N=k._transition,w=!(N&&N.state==="visible"&&A.length>0)||N.appear;for(const f of A){const m=U(f,s,r,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(m,p),N&&m instanceof HTMLElement&&w&&me(m,N).catch(T=>{x.devError("Transition enter error:",T)})}e.insertBefore(C,p)}else{const N=k._transition,w=d.get(v)._transition,f=w&&w.state!==N?.state,m=N&&N.state==="visible"&&A.length>0&&!f,T=f||!m||N?.appear===!0;R(S,C,d.get(v)?.children,A,N,T)}_(S,C),p=C.nextSibling;continue}if(k.key!=null&&y.has(k.key)){const v=d.get(k.key);c=be(y.get(k.key),v,k,s,r),h.add(c),c!==p&&e.contains(c)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(c,p))}else c=U(k,s,r,e instanceof Element?e.namespaceURI??null:null),p&&!e.contains(p)&&(p=null),e.insertBefore(c,p),h.add(c);p=c.nextSibling}for(let k=0;k<i.length;k++){const c=i[k];!h.has(c)&&e.contains(c)&&(ie(c,r),e.removeChild(c))}}function be(e,n,t,s,r){if(n&&typeof n!="string"&&n.props?.ref&&r&&ie(e,r),n===t)return e;if(typeof t=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==t&&(e.textContent=t),e;{const i=document.createTextNode(t);return e.parentNode?.replaceChild(i,e),i}}if(t&&typeof t!="string"&&t.tag==="#anchor"){const i=t,a=Array.isArray(i.children)?i.children:[],u=i._startNode??document.createTextNode(""),d=i._endNode??document.createTextNode("");i.key!=null&&(V(u,`${i.key}:start`),V(d,`${i.key}:end`)),i._startNode=u,i._endNode=d;const y=document.createDocumentFragment();y.appendChild(u);for(const h of a){const p=U(h,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);y.appendChild(p)}return y.appendChild(d),e.parentNode?.replaceChild(y,e),u}if(!t){ie(e,r);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!n||typeof n=="string"){ie(e,r);const i=U(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,i,r),e.parentNode?.replaceChild(i,e),i}if(t.tag==="#anchor"){const i=Array.isArray(t.children)?t.children:[],a=t._startNode??document.createTextNode(""),u=t._endNode??document.createTextNode("");t.key!=null&&(V(a,`${t.key}:start`),V(u,`${t.key}:end`)),t._startNode=a,t._endNode=u;const d=document.createDocumentFragment();d.appendChild(a);for(const y of i)d.appendChild(U(y,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return d.appendChild(u),e.parentNode?.replaceChild(d,e),a}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&n.key===t.key){const i=e;return Ue(i,n.props||{},t.props||{},s),wt(i,n.children,t.children,s,r),ge(t,i,r),i}if(typeof n!="string"&&typeof t!="string"&&n.tag===t.tag&&(n.tag&&String(n.tag).includes("-")||t.props&&t.props.isCustomElement||n.props&&n.props.isCustomElement))try{const a=e;return Ue(a,n.props||{},t.props||{},s),ge(t,a,r),a}catch{}ie(e,r);const o=U(t,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,o,r),e.parentNode?.replaceChild(o,e),o}function tt(e,n,t,s){let r;Array.isArray(n)?n.length===1?(r=n[0],r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})):r={tag:"div",key:"__root__",children:n}:(r=n,r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})),r&&typeof r=="object"&&r.tag==="#anchor"&&(r={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[r]}),r=Ie(r,String(r.key??"root"));const o=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;o&&i?typeof o!="string"&&typeof r!="string"&&o.tag===r.tag&&o.key===r.key?a=be(i,o,r,t,s):(a=U(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(a,i)):(a=U(r,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let y=0;y<e.childNodes.length;y++){const h=e.childNodes[y];h!==a&&h.nodeName!=="STYLE"&&(ie(h,s),u.push(h))}u.forEach(y=>e.removeChild(y));const d=r&&typeof r=="object"&&r.props?{...r,props:{...r.props,attrs:r.props.attrs?{...r.props.attrs}:void 0,props:r.props.props?{...r.props.props}:void 0}}:r;e._prevVNode=d,e._prevDom=a}const Se=[],Fe=new WeakMap,de=new WeakMap;function Tt(e,n){de.has(e)||de.set(e,new Set),de.get(e).add(n)}function Nt(e,n){const t=de.get(e);t&&(t.delete(n),t.size===0&&de.delete(e))}function Lt(e,n,t,s,r,o,i,a){if(e){Se.push(t);try{const u=n.render(t);if(u instanceof Promise){o(!0),u.then(d=>{o(!1),i(null),qe(e,d,t,s,r),a(e.innerHTML)}).catch(d=>{o(!1),i(d instanceof Error?d:new Error(String(d)))});return}qe(e,u,t,s,r),a(e.innerHTML)}catch(u){i(u instanceof Error?u:new Error(String(u)))}finally{Se.pop()}}}function qe(e,n,t,s,r){if(e)try{tt(e,Array.isArray(n)?n:[n],t,s),r(e.innerHTML)}catch(o){throw x.devError("Error during VDOM rendering:",o),o}}function Rt(e,n,t,s,r,o,i){o!==null&&clearTimeout(o);const d=Date.now()-n<16,y=(()=>{try{return typeof window<"u"&&!!window.Cypress}catch{return!1}})(),h=(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"&&!y}catch{return!1}})(),p=h||y;if(d){const k=t+1;r(k);const c=p?50:10,v=p?100:25,E=h?12:50;if(k===c&&!p)x.devWarn(`⚠️ Component rendering frequently. Performance may be impacted.
|
|
2
2
|
Common causes:
|
|
3
3
|
• State updates during render cycle
|
|
4
4
|
• Event handlers with immediate function calls
|
|
@@ -20,4 +20,4 @@ ${g}`);Ze(e,S);try{e.adoptedStyleSheets=[B.getBaseResetSheet(),B.getTransitionSt
|
|
|
20
20
|
`))}catch{R=""}const k=B.minifyCSS(`${p}
|
|
21
21
|
${R}
|
|
22
22
|
${y}`);Ze(e,k);try{const c=[B.getBaseResetSheet(),B.getTransitionStyleSheet()];if(u&&c.push(u),typeof CSSStyleSheet<"u")try{const v=new CSSStyleSheet;v.replaceSync(y),c.push(v)}catch{c.push({cssRules:[],replaceSync:()=>{}})}e.adoptedStyleSheets=c}catch{}r(null)}function jt(e,n){if(!n.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_componentId;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=le.get(e)||n,this._componentId=`${e}-${crypto.randomUUID()}`;const t=this._initContext(n),s=(o,i,a)=>{Object.defineProperty(o,i,{value:a,writable:!1,enumerable:!1,configurable:!1})};s(t,"refs",this._refs),s(t,"requestRender",()=>this.requestRender()),s(t,"_requestRender",()=>this._requestRender()),s(t,"_componentId",this._componentId),s(t,"_triggerWatchers",(o,i)=>this._triggerWatchers(o,i)),this.context=t,l.safe(()=>{s(t,"_host",this)}),s(this.context,"emit",(o,i,a)=>{const u={detail:i,bubbles:!0,composed:!0,...a||{}},d=new CustomEvent(o,u);this.dispatchEvent(d);const y=o.indexOf(":");if(y>0){const h=o.substring(0,y),p=o.substring(y+1),_=p.includes("-")?`${h}:${p.split("-").map((R,k)=>k===0?R:R.charAt(0).toUpperCase()+R.slice(1)).join("")}`:`${h}:${p.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;_!==o&&l.safe(()=>{this.dispatchEvent(new CustomEvent(_,u))})}return!d.defaultPrevented});const r=le.get(e)||n;for(const o in r){const i=r[o];typeof i=="function"&&(this.context[o]=(...a)=>i(...a,this.context))}if(r.props)for(const o in r.props){let i=this[o];Object.defineProperty(this,o,{get(){return i},set(a){const u=i;i=a,this.context[o]=a,this._initializing||(this._applyProps(r),u!==a&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(r),this._applyProps(r),this._render(r)}connectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&Tt(t,this),this._applyProps(n),this._requestRender(),ft(n,this.context,this._mounted,s=>{this._mounted=s})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(n,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&Nt(t,this),ut(n,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},s=>{this._templateLoading=s},s=>{this._templateError=s},s=>{this._mounted=s})})}attributeChangedCallback(t,s,r){this._runLogicWithinErrorBoundary(n,()=>{this._applyProps(n),s!==r&&this._requestRender(),dt(n,t,s,r,this.context)})}static get observedAttributes(){return n.props?Object.keys(n.props).map(l.toKebab):[]}_render(t){this._runLogicWithinErrorBoundary(t,()=>{Lt(this.shadowRoot,t,this.context,this._refs,s=>{this._lastHtmlStringForJitCSS=s,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(s)},s=>{this._templateLoading=s,this?.onLoadingStateChange?.(s)},s=>{this._templateError=s,this?.onErrorStateChange?.(s)},s=>this._applyStyle(t,s))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{l.scheduleDOMUpdate(()=>{Rt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})},this._componentId)})}_applyStyle(t,s){this._runLogicWithinErrorBoundary(t,()=>{Mt(this.shadowRoot,this.context,s,this._styleSheet,r=>{this._styleSheet=r})})}_runLogicWithinErrorBoundary(t,s){this._hasError&&(this._hasError=!1);try{s()}catch(r){this._hasError=!0;try{const o=this.tagName?.toLowerCase?.()||"<unknown>",i=this._componentId||"<unknown-id>",a={};if(t&&t.props)for(const u of Object.keys(t.props))try{const d=this.context[u];d instanceof Node?a[u]=`[DOM Node: ${d.nodeName}]`:typeof d=="object"&&d!==null?a[u]=Object.keys(d).length>5?`[object(${Object.keys(d).length} keys)]`:d:a[u]=d}catch{a[u]="[unreadable]"}x.devError(`Error rendering component <${o}> (id=${i}):`,r),x.devError("Component props snapshot:",a),x.devWarn("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}if(t.onError&&t.onError(r,this.context),this.tagName.toLowerCase()!=="cer-error-boundary"){let o=this.parentElement;if(!o){const i=this.getRootNode();i instanceof ShadowRoot&&(o=i.host.parentElement)}for(;o;){if(o.tagName.toLowerCase()==="cer-error-boundary"){o._cerHandleChildError?.(r);break}let i=o.parentElement;if(!i){const a=o.getRootNode();a instanceof ShadowRoot&&(i=a.host.parentElement)}o=i}}}}_initContext(t){try{let s=function(o,i=""){if(Array.isArray(o))return new Proxy(o,{get(a,u,d){const y=Reflect.get(a,u,d);return typeof y=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...p){const _=y.apply(a,p);if(!r._initializing){const R=i||"root";r._triggerWatchers(R,a),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return _}:y},set(a,u,d){if(a[String(u)]=d,!r._initializing){const y=i?`${i}.${String(u)}`:String(u);r._triggerWatchers(y,d),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return!0},deleteProperty(a,u){if(delete a[String(u)],!r._initializing){const d=i?`${i}.${String(u)}`:String(u);r._triggerWatchers(d,void 0),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)}return!0}});if(o&&typeof o=="object"){if(l.isReactiveState(o))return o;for(const a in o){const u=i?`${i}.${a}`:a;o[a]=s(o[a],u)}return new Proxy(o,{set(a,u,d){const y=i?`${i}.${String(u)}`:String(u);return a[String(u)]=s(d,y),r._initializing||(r._triggerWatchers(y,a[String(u)]),l.scheduleDOMUpdate(()=>r._render(t),r._componentId)),!0},get(a,u,d){return Reflect.get(a,u,d)}})}return o};const r=this;return s({...t.props?Object.fromEntries(Object.entries(t.props).map(([o,i])=>[o,i.default])):{}})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{ot(this.context,this._watchers,{})})}_triggerWatchers(t,s){at(this.context,this._watchers,t,s)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{lt(this,t,this.context)})}}}function Pt(){return l.isDiscoveryRender()}let $=null;function Re(e){$=e}function Le(){$=null}function xt(){return $}function $t(){if(!$)throw new Error("useEmit must be called during component render");if(l.isDiscoveryRender())return()=>!1;const e=$.emit;if(typeof e!="function")throw new Error("useEmit requires an emit function on the component context");const n=e;return(t,s,r)=>n(t,s,r)}function ae(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function Ht(e){if(!$)throw new Error("useOnConnected must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onConnected||(n.onConnected=[]),n.onConnected.push(e)}function Dt(e){if(!$)throw new Error("useOnDisconnected must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onDisconnected||(n.onDisconnected=[]),n.onDisconnected.push(e)}function It(e){if(!$)throw new Error("useOnAttributeChanged must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onAttributeChanged||(n.onAttributeChanged=[]),n.onAttributeChanged.push(e)}function Wt(e){if(!$)throw new Error("useOnError must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.onError||(n.onError=[]),n.onError.push(t=>{try{t instanceof Error?e(t):e(new Error(String(t)))}catch{}})}function Bt(e){if(!$)throw new Error("useProps must be called during component render");ae($);const n=$._hookCallbacks;n.props={...n.props||{},...e};const t=$;try{const r=Object.keys(e||{});for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const i=Object.getOwnPropertyDescriptor(t,o);if(!(i&&!i.configurable))try{let u=Object.prototype.hasOwnProperty.call(t,o)?t[o]:void 0;Object.defineProperty(t,o,{configurable:!0,enumerable:!0,get(){try{const d=t&&t._host;if(d){const y=l.toKebab(o),h=d.getAttribute(y);if(h!==null){const p=typeof e[o];return p==="boolean"?h===""||h==="true":p==="number"?Number(h):h}if(typeof d[o]<"u"){const p=d[o];if(l.isReactiveState(p)||p&&typeof p=="object"&&"value"in p&&!(p instanceof Node))return p.value;const _=typeof e[o];if(!(_==="string"&&p&&typeof p=="object"))return _==="boolean"&&typeof p=="string"?p===""||p==="true":p}}}catch{}return u},set(d){u=d}})}catch{}}}catch{}return new Proxy({},{get(r,o){if(typeof o!="string")return;const i=e[o];try{const u=t&&t._host;if(u){if(u instanceof HTMLElement||typeof u.getAttribute=="function"&&typeof u.hasAttribute=="function"){const y=o.replace(/([A-Z])/g,"-$1").toLowerCase(),h=u.getAttribute(y);if(h!==null)return typeof i=="boolean"?h===""||h==="true":typeof i=="number"?Number(h):h}const d=u[o];if(typeof d<"u"&&d!==""){const y=d&&typeof d=="object"&&"value"in d&&!(d instanceof Node);if(!(typeof i=="string"&&d&&typeof d=="object"&&!y&&!l.isReactiveState(d)))return typeof i=="boolean"&&i===!1&&d===""?i:l.isReactiveState(d)||y?d.value:typeof i=="boolean"&&typeof d=="string"?d==="true"||d!==""&&d!=="false":typeof i=="number"&&typeof d=="string"&&!Number.isNaN(Number(d))?Number(d):d}}}catch{}const a=t[o];return typeof i=="boolean"&&a===""?i===!1?i:!0:l.isReactiveState(a)||a&&typeof a=="object"&&"value"in a&&!(a instanceof Node)?a.value:a!=null&&a!==""?typeof i=="boolean"&&typeof a=="string"?a==="true":typeof i=="number"&&typeof a=="string"&&!Number.isNaN(Number(a))?Number(a):a:i},has(r,o){return typeof o=="string"&&(o in t||o in e)},ownKeys(){return Array.from(new Set([...Object.keys(e),...Object.keys(t||{})]))},getOwnPropertyDescriptor(){return{configurable:!0,enumerable:!0}}})}function zt(e){if(!$)throw new Error("useStyle must be called during component render");if(!l.isDiscoveryRender()){ae($);try{const n=e();Object.defineProperty($,"_computedStyle",{value:n,writable:!0,enumerable:!1,configurable:!0})}catch(n){x.devWarn("Error in useStyle callback:",n),Object.defineProperty($,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}}const Ee=Symbol.for("@cer/provides");function Kt(e,n){if(!$)throw new Error("provide must be called during component render");if(l.isDiscoveryRender())return;const t=$;t[Ee]||Object.defineProperty(t,Ee,{value:new Map,writable:!1,enumerable:!1,configurable:!0}),t[Ee].set(e,n)}function Vt(e,n){if(!$)throw new Error("inject must be called during component render");if(l.isDiscoveryRender())return n;try{const t=$._host;if(t){let s=t.parentNode;for(s||(s=t.getRootNode());s;)if(s instanceof ShadowRoot){const r=s.host,o=r.context;if(o){const a=o[Ee];if(a?.has(e))return a.get(e)}if(s=r.parentNode??r.getRootNode(),s===document||s===r)break}else{if(s instanceof Element){const i=s.context;if(i){const a=i[Ee];if(a?.has(e))return a.get(e)}}const r=s;if(s=s.parentNode??s.getRootNode?.(),s===document||s===r)break}}}catch{}return n}function Ut(e){return n=>{const t=n??$;if(!t)throw new Error("createComposable: no component context available. Pass a context explicitly or call inside a render function.");const s=$;Re(t);try{return e()}finally{s?Re(s):Le()}}}function Ft(e){if(!$)throw new Error("useExpose must be called during component render");if(l.isDiscoveryRender())return;ae($);const n=$._hookCallbacks;n.expose={...n.expose??{},...e};const t=$._host;if(t)for(const[s,r]of Object.entries(e))try{t[s]=r}catch{}}function qt(){if(!$)throw new Error("useSlots must be called during component render");if(l.isDiscoveryRender())return{has:()=>!1,getNodes:()=>[],names:()=>[]};const e=$._host;return{has(n){return e?!n||n==="default"?Array.from(e.children).some(t=>!t.hasAttribute("slot")):Array.from(e.children).some(t=>t.getAttribute("slot")===n):!1},getNodes(n){return e?!n||n==="default"?Array.from(e.children).filter(t=>!t.hasAttribute("slot")):Array.from(e.children).filter(t=>t.getAttribute("slot")===n):[]},names(){if(!e)return[];const n=new Set;for(const t of Array.from(e.children)){const s=t.getAttribute("slot");n.add(s??"default")}return Array.from(n)}}}function Gt(e,n){it();let t=l.toKebab(e);t.includes("-")||(t=`cer-${t}`);const s={},r={props:{},onConnected:o=>{if(s.onConnected)try{s.onConnected(o)}catch{}},onDisconnected:o=>{if(s.onDisconnected)try{s.onDisconnected(o)}catch{}},onAttributeChanged:(o,i,a,u)=>{if(s.onAttributeChanged)try{s.onAttributeChanged(o,i,a,u)}catch{}},onError:(o,i)=>{if(s.onError&&o)try{s.onError(o,i)}catch{}},render:o=>{const i=o,a=i._componentId||`${t}-${crypto.randomUUID()}`;l.reactiveSystem.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{Object.defineProperty(o,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!0}),Re(o);let u;try{u=n()}catch(d){try{const h=i._hookCallbacks?.onError;if(Array.isArray(h))for(const p of h)try{p(d)}catch{}else if(typeof h=="function")try{h(d)}catch{}}catch{}try{const y=i._host;if(y?.parentElement){let h=y.parentElement;for(;h;){if(h.tagName.toLowerCase()==="cer-error-boundary"){h._cerHandleChildError?.(d);break}let p=h.parentElement;if(!p){const _=h.getRootNode();_ instanceof ShadowRoot&&(p=_.host.parentElement)}h=p}}}catch{}throw d}if(i._hookCallbacks){const d=i._hookCallbacks;if(d.onConnected){const y=d.onConnected;s.onConnected=h=>{for(const p of y)try{p(h)}catch{}}}if(d.onDisconnected){const y=d.onDisconnected;s.onDisconnected=h=>{for(const p of y)try{p(h)}catch{}}}if(d.onAttributeChanged){const y=d.onAttributeChanged;s.onAttributeChanged=(h,p,_,R)=>{for(const k of y)try{k(h,p,_,R)}catch{}}}if(d.onError){const y=d.onError;s.onError=h=>{for(const p of y)try{p(h)}catch{}}}if(d.props){const y=d.props;r.props=Object.fromEntries(Object.entries(y).map(([h,p])=>[h,{type:typeof p=="boolean"?Boolean:typeof p=="number"?Number:typeof p=="string"?String:Function,default:p}])),le.set(t,r)}}return u}finally{Le(),l.reactiveSystem.clearCurrentComponent()}}};if(le.set(t,r),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};Re(o),l.beginDiscoveryRender();try{n()}catch(i){try{const u=o?._hookCallbacks?.onError;if(Array.isArray(u))for(const d of u)try{d(i)}catch{}else if(typeof u=="function")try{u(i)}catch{}x.devError(`Error during component discovery render <${t}>:`,i),x.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw l.endDiscoveryRender(),Le(),i}if(l.endDiscoveryRender(),Le(),o._hookCallbacks?.props){const i=o._hookCallbacks.props;r.props=Object.fromEntries(Object.entries(i).map(([a,u])=>[a,{type:typeof u=="boolean"?Boolean:typeof u=="number"?Number:typeof u=="string"?String:Function,default:u}])),le.set(t,r)}}catch{}customElements.get(t)||customElements.define(t,jt(t,r))}}function ee(e,n={},t,s){const r=s??n.key;return{tag:e,key:r,props:n,children:t}}function Ce(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function se(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Ce(e)}function Zt(e,n){return e.key!=null?e:{...e,key:n}}class Jt{map=new Map;maxSize;accessOrder=new Map;accessCounter=0;constructor(n){this.maxSize=Math.max(1,n)}get(n){const t=this.map.get(n);if(t!==void 0)return this.accessOrder.set(n,++this.accessCounter),t}set(n,t){const s=this.map.has(n);this.map.set(n,t),this.accessOrder.set(n,++this.accessCounter),!s&&this.map.size>this.maxSize&&this.evictLRU()}evictLRU(){let n,t=1/0;for(const[s,r]of this.accessOrder)r<t&&(t=r,n=s);n!==void 0&&(this.map.delete(n),this.accessOrder.delete(n))}has(n){return this.map.has(n)}clear(){this.map.clear(),this.accessOrder.clear(),this.accessCounter=0}get size(){return this.map.size}}const Yt=()=>{if(typeof navigator<"u"&&"deviceMemory"in navigator){const n=navigator.deviceMemory;if(n)return Math.min(1e3,Math.max(200,n*100))}return(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"}catch{return!1}})()?100:500},$e=new Jt(Yt());function Xt(e,n){if(e==null){x.devWarn(`⚠️ Event handler for '@${n}' is ${e}. This will prevent the event from working. Use a function reference instead: @${n}="\${functionName}"`);return}typeof e!="function"&&x.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${n}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${n}="\${functionName()}" to @${n}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&x.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${n}="\${fn}" not @${n}="\${fn()}"`)}function Qt(e,n=[],t={}){const s={},r={},o={},i=[],a=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g;let u;for(;u=a.exec(e);){const d=u[1],y=u[2];let h="";for(let v=3;v<u.length;v++)if(u[v]!==void 0){h=u[v];break}h.length>=2&&(h[0]==='"'&&h[h.length-1]==='"'||h[0]==="'"&&h[h.length-1]==="'")&&(h=h.slice(1,-1));const p=!/=/.test(u[0]),_=h.match(/^{{(\d+)}}$/),R=!_&&/{{(\d+)}}/.test(h);let k=p?!0:_?n[Number(_[1])]??null:R?h.replace(/{{(\d+)}}/g,(v,E)=>String(n[Number(E)]??"")):h;!_&&!R&&(k==="true"?k=!0:k==="false"?k=!1:k==="null"?k=null:isNaN(Number(k))||(k=Number(k)));const c=["model","bind","show","class","style","ref","when"];if(d===":"){const[v,E]=y.split(":"),[g,...S]=v.split(".");if(c.includes(g)){const C=[...S],A=g==="model"&&E?`model:${E}`:g;o[A]={value:k,modifiers:C,arg:E}}else if(y==="disabled"){let C=k;C&&l.isReactiveState(C)&&(C=C.value);const A=typeof C;if(C===""||A==="boolean"||A==="string"&&(C==="true"||C==="false")||C==null||A==="number")s[y]=C;else{let w=k;w&&l.isReactiveState(w)&&(w=w.value),r[y]=w}i.push(y)}else{let C=k;C&&l.isReactiveState(C)&&(C=C.value),r[y]=C,i.push(y)}}else if(d==="@"){const[v,...E]=y.split("."),g=E;Xt(k,v);const S=typeof k=="function"?k:typeof t[k]=="function"?t[k]:void 0;if(S){const C=N=>{if(g.includes("prevent")&&N.preventDefault(),g.includes("stop")&&N.stopPropagation(),!(g.includes("self")&&N.target!==N.currentTarget))return g.includes("once")&&N.currentTarget?.removeEventListener(v,C),S(N)},A="on"+v.charAt(0).toUpperCase()+v.slice(1);s[A]=C}}else y==="ref"?s.ref=k:r[y]=k}return{props:s,attrs:r,directives:o,bound:i}}function We(e){if(!se(e)||Ce(e))return e;const n=e.props?.directives;if(n&&n.when){const t=n.when.value,s=l.isReactiveState(t)?t.value:t,r={...n};delete r.when;const o={...e.props};Object.keys(r).length>0?o.directives=r:delete o.directives;const i={...e,props:o};return Array.isArray(i.children)&&(i.children=i.children.map(u=>typeof u=="object"&&u!==null?We(u):u)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:s?[i]:[]}}if(Array.isArray(e.children)){const t=e.children.map(s=>typeof s=="object"&&s!==null?We(s):s);return{...e,children:t}}return e}function en(e,n,t){const s=Se.length>0?Se[Se.length-1]:void 0,r=t??s,o=!t&&n.length===0,i=o?e.join("<!--TEMPLATE_DELIM-->"):null;if(o&&i){const f=$e.get(i);if(f)return f}function a(f,m){return ee("#text",{},f,m)}function u(f,m,T=!1){let L=typeof f=="string"?l.decodeEntities(f):f;return!T&&typeof L=="string"&&/[\r\n]/.test(L)&&(L=L.replace(/\s+/g," ")),ee("#text",{},L,m)}let d="";for(let f=0;f<e.length;f++)d+=e[f],f<n.length&&(d+=`{{${f}}}`);const y=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,h=[];let p,_=[],R=null,k={},c,v=0;const E=[],g=new Set(["pre","code","textarea","script","style"]);function S(){if(R&&g.has(R.toLowerCase()))return!0;for(const f of h)if(g.has(f.tag.toLowerCase()))return!0;return!1}function C(f){if(!f||typeof f!="object"||Ce(f))return;const m=f,T=k;if(m.props||m.attrs){const L=m;L.props&&(T.props||(T.props={}),Object.assign(T.props,L.props)),L.attrs&&(T.attrs||(T.attrs={}),Object.keys(L.attrs).forEach(O=>{if(O==="style"&&T.attrs.style){const j=String(T.attrs.style).replace(/;?\s*$/,""),I=String(L.attrs.style).replace(/^;?\s*/,"");T.attrs.style=j+"; "+I}else if(O==="class"&&T.attrs.class){const j=String(T.attrs.class).trim().split(/\s+/).filter(Boolean),I=String(L.attrs.class).trim().split(/\s+/).filter(Boolean),M=[...new Set([...j,...I])];T.attrs.class=M.join(" ")}else T.attrs[O]=L.attrs[O]}))}else T.props||(T.props={}),Object.assign(T.props,m)}function A(f,m){const T=R?_:E;if(Ce(f)){const L=f.key??m,O=f.children;T.push({...f,key:L,children:O});return}if(se(f)){T.push(Zt(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let L=0;L<f.length;L++){const O=f[L];Ce(O)||se(O)||Array.isArray(O)?A(O,`${m}-${L}`):O!==null&&typeof O=="object"?l.isUnsafeHTML(O)?T.push(ee("#raw",{},O.__rawHTML,`${m}-${L}`)):C(O):T.push(a(String(O),`${m}-${L}`))}return}if(f!==null&&typeof f=="object"){if(l.isUnsafeHTML(f)){const L=f.__rawHTML??"";T.push(ee("#raw",{},L,m));return}C(f);return}T.push(a(String(f),m))}const N=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;p=y.exec(d);)if(!(p[0].startsWith("<!--")&&p[0].endsWith("-->"))){if(p[1]){const f=p[1],m=p[0][1]==="/",T=p[0][p[0].length-2]==="/"||N.has(f),{props:L,attrs:O,directives:j,bound:I}=Qt(p[2]||"",n,r??{}),M={props:{},attrs:{}};for(const z in L)M.props[z]=L[z];for(const z in O)M.attrs[z]=O[z];M.attrs&&Object.prototype.hasOwnProperty.call(M.attrs,"key")&&!(M.props&&Object.prototype.hasOwnProperty.call(M.props,"key"))&&l.safe(()=>{M.props.key=M.attrs.key});try{const z={input:["value","checked","readonly","required","placeholder","maxlength","minlength"],textarea:["value","readonly","required","placeholder","maxlength","minlength"],select:["value","required","multiple"],option:["selected","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","autofocus","form"]},D=f.toLowerCase(),Q=z[D]??[];if(M.attrs){for(const H of Q)if(I&&I.includes(H)&&H in M.attrs&&!(M.props&&H in M.props)){let P=M.attrs[H];if(P&&l.isReactiveState(P))P=P.value,M.props[H]=P,delete M.attrs[H];else if(P&&typeof P=="object"&&"value"in P&&!(P instanceof Node))try{const W=P.value;M.props[H]=(D==="select"||D==="option")&&H==="value"?String(W):W,delete M.attrs[H]}catch{}else{const W=typeof P;if(H==="disabled")(P===""||W==="boolean"||W==="string"&&(P==="true"||P==="false")||P==null||W==="number")&&(M.props[H]=P,delete M.attrs[H]);else if(P===""||W==="string"||W==="number"||W==="boolean"||P==null){const G=(D==="select"||D==="option")&&H==="value"?String(P):P;M.props[H]=G,delete M.attrs[H]}}}}if(f.includes("-")||!!r?.__customElements?.has?.(f)){if(M.isCustomElement=!0,I&&M.attrs){const H=new Set(["id","name","data-key","key"]);for(const P of I)if(P in M.attrs&&!(M.props&&P in M.props)){const W=P.includes("-")?l.toCamel(P):P,G=M.attrs[P];if(M.props[W]=G,H.has(P)||l.isClassLikeAttr(P))try{const ke=l.safeSerializeAttr(M.attrs[P]);ke===null?delete M.attrs[P]:M.attrs[P]=ke}catch{delete M.attrs[P]}else delete M.attrs[P]}}try{if(M.attrs&&!(M.props&&"modelValue"in M.props)){const H=M.attrs["model-value"]??M.attrs.modelValue;typeof H<"u"&&(M.props.modelValue=H)}}catch{}}}catch{}if(j&&Object.keys(j).some(z=>z==="model"||z.startsWith("model:")))try{const D=globalThis[Symbol.for("cer.registry")],Q=!!(D&&typeof D.has=="function"&&D.has(f)),F=r,H=!!(F&&(F.__customElements instanceof Set&&F.__customElements.has(f)||Array.isArray(F.__isCustomElements)&&F.__isCustomElements.includes(f)));if(!!(f.includes("-")||H||Q))for(const G of Object.keys(j)){if(G!=="model"&&!G.startsWith("model:"))continue;const _e=j[G],ke=_e.arg??(G.includes(":")?G.split(":",2)[1]:void 0),K=_e.value,Oe=ke??"modelValue",Be=l.getNestedValue,nt=l.setNestedValue,pe=r?._state||r;let Y;typeof K=="string"&&pe?Y=Be(pe,K):Y=K,M.props[Oe]=Y;try{const te=l.toKebab(Oe);M.attrs||(M.attrs={}),Y!=null&&(typeof Y=="string"||typeof Y=="number"||typeof Y=="boolean")&&(M.attrs[te]=Y)}catch{}M.isCustomElement=!0;const ze=`update:${l.toKebab(Oe)}`.replace(/-([a-z])/g,(te,J)=>J.toUpperCase()),rt="on"+ze.charAt(0).toUpperCase()+ze.slice(1);M.props[rt]=function(te){const J=te.detail!==void 0?te.detail:te.target?te.target.value:void 0;if(pe)if(K&&l.isReactiveState(K)){const ne=K.value;if(Array.isArray(J)&&Array.isArray(ne)?JSON.stringify([...J].sort())!==JSON.stringify([...ne].sort()):J!==ne){K.value=J;try{const re=r;if(re){const he=re.requestRender,ye=re._requestRender;typeof he=="function"?he():typeof ye=="function"&&ye()}}catch{}}}else{const ne=Be(pe||{},typeof K=="string"?K:String(K));if(Array.isArray(J)&&Array.isArray(ne)?JSON.stringify([...J].sort())!==JSON.stringify([...ne].sort()):J!==ne){nt(pe||{},typeof K=="string"?K:String(K),J);try{const re=r;if(re){const he=re.requestRender,ye=re._requestRender;typeof he=="function"?he():typeof ye=="function"&&ye()}}catch{}}}},delete j[G]}}catch{}if(Object.keys(j).length>0&&(M.directives={...j}),m){const z=_.some(H=>typeof H=="object"&&H.tag!=="#text");let D=_;if(z&&_.length>0){let H=0;for(;H<_.length;){const W=_[H];if(!se(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;H++}let P=_.length-1;for(;P>=0;){const W=_[P];if(!se(W)||W.tag!=="#text"||typeof W.children!="string"||W.children.trim()!=="")break;P--}H===0&&P===_.length-1?D=_:H>P?D=[]:D=_.slice(H,P+1)}const Q=ee(R,k,D.length===1&&se(D[0])&&D[0].tag==="#text"?typeof D[0].children=="string"?D[0].children:"":D.length?D:void 0,c),F=h.pop();F?(R=F.tag,k=F.props,c=F.key,_=F.children,_.push(Q)):(E.push(Q),R=null,k={},c=void 0,_=[])}else T?R?_.push(ee(f,M,void 0,void 0)):E.push(ee(f,M,void 0,void 0)):(R&&h.push({tag:R,props:k,children:_,key:c}),R=f,k=M,_=[])}else if(typeof p[3]<"u"){const f=Number(p[3]),m=n[f],T=`interp-${f}`;A(m,T)}else if(p[4]){const f=p[4],m=R?_:E,T=f.split(/({{\d+}})/);for(const L of T){if(!L)continue;const O=L.match(/^{{(\d+)}}$/);if(O){const j=Number(O[1]),I=n[j],M=`interp-${j}`;A(I,M)}else{const j=`text-${v++}`,I=S();m.push(u(L,j,I))}}}}const w=E.filter(f=>se(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0).map(f=>We(f));if(w.length===1){const f=w[0];return o&&i&&$e.set(i,f),f}else if(w.length>1){const f=w;return o&&i&&$e.set(i,f),f}return ee("div",{},"","fallback-root")}function tn(e,...n){if(l.isDiscoveryRender())return[];const t=n[n.length-1],s=typeof t=="object"&&t&&!Array.isArray(t)?t:void 0;return en(e,n,s)}exports.component=Gt;exports.createComposable=Ut;exports.getCurrentComponentContext=xt;exports.html=tn;exports.inject=Vt;exports.isDiscoveryRender=Pt;exports.provide=Kt;exports.useEmit=$t;exports.useExpose=Ft;exports.useOnAttributeChanged=It;exports.useOnConnected=Ht;exports.useOnDisconnected=Dt;exports.useOnError=Wt;exports.useProps=Bt;exports.useSlots=qt;exports.useStyle=zt;exports.vdomRenderer=tt;
|
|
23
|
-
//# sourceMappingURL=template-compiler-
|
|
23
|
+
//# sourceMappingURL=template-compiler-DXKQZPJB.cjs.map
|