@jasonshimmy/custom-elements-runtime 1.0.8 → 1.0.10

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.
@@ -1,8 +1,11 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class yt{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,r){const n=r||t.toString();this.pendingUpdates.set(n,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const r of t)try{r()}catch(n){typeof console<"u"&&console.error&&console.error("Error in batched update:",n)}}get pendingCount(){return this.pendingUpdates.size}}const bt=new yt;function fe(e,t){bt.schedule(e,t)}const Ze=new WeakSet;class wt{static cache=new WeakMap;static arrayHandlerCache=new WeakMap;static objectHandlerCache=new WeakMap;static getOrCreateProxy(t,r,n=!1){const i=this.cache.get(t);if(i)return i;const s=n?this.getOrCreateArrayHandler(r):this.getOrCreateObjectHandler(r),o=new Proxy(t,s);try{it.markAsProxy(o)}catch{}return this.cache.set(t,o),o}static getOrCreateArrayHandler(t){if(!this.arrayHandlerCache.has(t)){const r={get:(n,i,s)=>{const o=Reflect.get(n,i,s);return typeof o=="function"&&typeof i=="string"&&["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].includes(i)?function(...u){const m=o.apply(n,u);return t.triggerUpdate(),m}:o},set:(n,i,s)=>(n[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(n,i)=>(delete n[i],t.triggerUpdate(),!0)};this.arrayHandlerCache.set(t,r)}return this.arrayHandlerCache.get(t)}static getOrCreateObjectHandler(t){if(!this.objectHandlerCache.has(t)){const r={get:(n,i,s)=>Reflect.get(n,i,s),set:(n,i,s)=>(n[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(n,i)=>(delete n[i],t.triggerUpdate(),!0)};this.objectHandlerCache.set(t,r)}return this.objectHandlerCache.get(t)}static hasProxy(t){return this.cache.has(t)}static clear(){this.cache=new WeakMap,this.arrayHandlerCache=new WeakMap,this.objectHandlerCache=new WeakMap}static getStats(){return{hasCachedProxies:this.cache instanceof WeakMap}}}class it{static contextCache=new WeakMap;static createReactiveProxy(t,r,n){try{if(Ze.has(t))return t}catch{}const i=Array.isArray(t);let s=this.contextCache.get(r);s||(s=new WeakMap,this.contextCache.set(r,s));let o=s.get(n);return o||(o={triggerUpdate:r,makeReactiveValue:n},s.set(n,o)),wt.getOrCreateProxy(t,o,i)}static markAsProxy(t){if(t)try{Ze.add(t)}catch{}}}class vt{currentComponent=null;componentDependencies=new Map;componentRenderFunctions=new Map;stateStorage=new Map;stateIndexCounter=new Map;trackingDisabled=!1;lastWarningTime=new Map;setCurrentComponent(t,r){this.currentComponent=t,this.componentRenderFunctions.set(t,r),this.componentDependencies.has(t)||this.componentDependencies.set(t,new Set),this.stateIndexCounter.set(t,0)}clearCurrentComponent(){this.currentComponent=null}disableTracking(){this.trackingDisabled=!0}enableTracking(){this.trackingDisabled=!1}isRenderingComponent(){return this.currentComponent!==null}shouldEmitRenderWarning(){if(!this.currentComponent)return!0;const t=this.currentComponent,r=this.lastWarningTime.get(t)||0,n=Date.now();return n-r<1e3?!1:(this.lastWarningTime.set(t,n),!0)}withoutTracking(t){const r=this.trackingDisabled;this.trackingDisabled=!0;try{return t()}finally{this.trackingDisabled=r}}getOrCreateState(t){if(!this.currentComponent)return new He(t);const r=this.currentComponent,n=this.stateIndexCounter.get(r)||0,i=`${r}:${n}`;if(this.stateIndexCounter.set(r,n+1),this.stateStorage.has(i))return this.stateStorage.get(i);const s=new He(t);return this.stateStorage.set(i,s),s}trackDependency(t){this.trackingDisabled||this.currentComponent&&(this.componentDependencies.get(this.currentComponent)?.add(t),t.addDependent(this.currentComponent))}triggerUpdate(t){t.getDependents().forEach(r=>{const n=this.componentRenderFunctions.get(r);n&&fe(n,r)})}cleanup(t){const r=this.componentDependencies.get(t);r&&(r.forEach(n=>n.removeDependent(t)),this.componentDependencies.delete(t)),this.componentRenderFunctions.delete(t);for(const n of Array.from(this.stateStorage.keys()))n.startsWith(t+":")&&this.stateStorage.delete(n);this.stateIndexCounter.delete(t)}}const F=new vt;class He{_value;dependents=new Set;constructor(t){this._value=this.makeReactive(t);try{const r=Symbol.for("@cer/ReactiveState");Object.defineProperty(this,r,{value:!0,enumerable:!1,configurable:!1})}catch{}}get value(){return F.trackDependency(this),this._value}set value(t){F.isRenderingComponent()&&F.shouldEmitRenderWarning()&&console.warn(`🚨 State modification detected during render! This can cause infinite loops.
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class $t{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,r){const n=r||t.toString();this.pendingUpdates.set(n,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const r of t)try{r()}catch(n){typeof console<"u"&&console.error&&console.error("Error in batched update:",n)}}get pendingCount(){return this.pendingUpdates.size}}const kt=new $t;function he(e,t){kt.schedule(e,t)}const Xe=new WeakSet;class Ct{static cache=new WeakMap;static arrayHandlerCache=new WeakMap;static objectHandlerCache=new WeakMap;static getOrCreateProxy(t,r,n=!1){const i=this.cache.get(t);if(i)return i;const s=n?this.getOrCreateArrayHandler(r):this.getOrCreateObjectHandler(r),o=new Proxy(t,s);try{lt.markAsProxy(o)}catch{}return this.cache.set(t,o),o}static getOrCreateArrayHandler(t){if(!this.arrayHandlerCache.has(t)){const r={get:(n,i,s)=>{const o=Reflect.get(n,i,s);return typeof o=="function"&&typeof i=="string"&&["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].includes(i)?function(...a){const p=o.apply(n,a);return t.triggerUpdate(),p}:o},set:(n,i,s)=>(n[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(n,i)=>(delete n[i],t.triggerUpdate(),!0)};this.arrayHandlerCache.set(t,r)}return this.arrayHandlerCache.get(t)}static getOrCreateObjectHandler(t){if(!this.objectHandlerCache.has(t)){const r={get:(n,i,s)=>Reflect.get(n,i,s),set:(n,i,s)=>(n[i]=t.makeReactiveValue(s),t.triggerUpdate(),!0),deleteProperty:(n,i)=>(delete n[i],t.triggerUpdate(),!0)};this.objectHandlerCache.set(t,r)}return this.objectHandlerCache.get(t)}static hasProxy(t){return this.cache.has(t)}static clear(){this.cache=new WeakMap,this.arrayHandlerCache=new WeakMap,this.objectHandlerCache=new WeakMap}static getStats(){return{hasCachedProxies:this.cache instanceof WeakMap}}}class lt{static contextCache=new WeakMap;static createReactiveProxy(t,r,n){try{if(Xe.has(t))return t}catch{}const i=Array.isArray(t);let s=this.contextCache.get(r);s||(s=new WeakMap,this.contextCache.set(r,s));let o=s.get(n);return o||(o={triggerUpdate:r,makeReactiveValue:n},s.set(n,o)),Ct.getOrCreateProxy(t,o,i)}static markAsProxy(t){if(t)try{Xe.add(t)}catch{}}}class _t{currentComponent=null;componentDependencies=new Map;componentRenderFunctions=new Map;stateStorage=new Map;stateIndexCounter=new Map;trackingDisabled=!1;lastWarningTime=new Map;setCurrentComponent(t,r){this.currentComponent=t,this.componentRenderFunctions.set(t,r),this.componentDependencies.has(t)||this.componentDependencies.set(t,new Set),this.stateIndexCounter.set(t,0)}clearCurrentComponent(){this.currentComponent=null}disableTracking(){this.trackingDisabled=!0}enableTracking(){this.trackingDisabled=!1}isRenderingComponent(){return this.currentComponent!==null}shouldEmitRenderWarning(){if(!this.currentComponent)return!0;const t=this.currentComponent,r=this.lastWarningTime.get(t)||0,n=Date.now();return n-r<1e3?!1:(this.lastWarningTime.set(t,n),!0)}withoutTracking(t){const r=this.trackingDisabled;this.trackingDisabled=!0;try{return t()}finally{this.trackingDisabled=r}}getOrCreateState(t){if(!this.currentComponent)return new Fe(t);const r=this.currentComponent,n=this.stateIndexCounter.get(r)||0,i=`${r}:${n}`;if(this.stateIndexCounter.set(r,n+1),this.stateStorage.has(i))return this.stateStorage.get(i);const s=new Fe(t);return this.stateStorage.set(i,s),s}trackDependency(t){this.trackingDisabled||this.currentComponent&&(this.componentDependencies.get(this.currentComponent)?.add(t),t.addDependent(this.currentComponent))}triggerUpdate(t){t.getDependents().forEach(r=>{const n=this.componentRenderFunctions.get(r);n&&he(n,r)})}cleanup(t){const r=this.componentDependencies.get(t);r&&(r.forEach(n=>n.removeDependent(t)),this.componentDependencies.delete(t)),this.componentRenderFunctions.delete(t);for(const n of Array.from(this.stateStorage.keys()))n.startsWith(t+":")&&this.stateStorage.delete(n);this.stateIndexCounter.delete(t)}}const F=new _t;class Fe{_value;dependents=new Set;constructor(t){this._value=this.makeReactive(t);try{const r=Symbol.for("@cer/ReactiveState");Object.defineProperty(this,r,{value:!0,enumerable:!1,configurable:!1})}catch{}}get value(){return F.trackDependency(this),this._value}set value(t){F.isRenderingComponent()&&F.shouldEmitRenderWarning()&&console.warn(`🚨 State modification detected during render! This can cause infinite loops.
2
2
  • Move state updates to event handlers
3
3
  • Use useEffect/watch for side effects
4
- • Ensure computed properties don't modify state`),this._value=this.makeReactive(t),F.triggerUpdate(this)}addDependent(t){this.dependents.add(t)}removeDependent(t){this.dependents.delete(t)}getDependents(){return this.dependents}makeReactive(t){return t===null||typeof t!="object"||t instanceof Node||t instanceof Element||t instanceof HTMLElement?t:it.createReactiveProxy(t,()=>F.triggerUpdate(this),r=>this.makeReactive(r))}}function xt(e){return F.getOrCreateState(e===void 0?null:e)}function te(e){if(!e||typeof e!="object")return!1;try{const t=Symbol.for("@cer/ReactiveState");if(e[t])return!0}catch{}try{return!!(e.constructor&&e.constructor.name==="ReactiveState")}catch{return!1}}function $t(e){const t=new He(e());return{get value(){return F.trackDependency(t),e()}}}function kt(e,t,r={}){let n=e();r.immediate&&t(n,n);const i=`watch-${Math.random().toString(36).substr(2,9)}`,s=()=>{F.setCurrentComponent(i,s);const o=e();F.clearCurrentComponent(),o!==n&&(t(o,n),n=o)};return F.setCurrentComponent(i,s),e(),F.clearCurrentComponent(),()=>{F.cleanup(i)}}const xe=new Map,$e=new Map,ke=new Map,Ke=500;function re(e){if(xe.has(e))return xe.get(e);const t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return xe.size<Ke&&xe.set(e,t),t}function st(e){if($e.has(e))return $e.get(e);const t=e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase());return $e.size<Ke&&$e.set(e,t),t}function he(e){if(typeof e=="string"){if(ke.has(e))return ke.get(e);const t=e.replace(/[&<>"']/g,r=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[r]);return t!==e&&ke.size<Ke&&ke.set(e,t),t}return e}function B(e,t){if(typeof t=="string"){const r=t.split(".").reduce((n,i)=>n?.[i],e);return te(r)?r.value:r}return t}function Ee(e,t,r){const n=String(t).split("."),i=n.pop();if(!i)return;const s=n.reduce((o,c)=>(o[c]==null&&(o[c]={}),o[c]),e);te(s[i])?s[i].value=r:s[i]=r}const ot=typeof process<"u"&&process.env?.NODE_ENV!=="production";function se(e,...t){ot&&console.error(e,...t)}function Pe(e,...t){ot&&console.warn(e,...t)}function Ct(e,t,r){if(r)for(const[n,i]of Object.entries(r)){let s,o={};if(Array.isArray(i)?(s=i[0],o=i[1]||{}):s=i,t.set(n,{callback:s,options:o,oldValue:B(e,n)}),o.immediate)try{const c=B(e,n);s(c,void 0,e)}catch(c){se(`Error in immediate watcher for "${n}":`,c)}}}function _t(e,t,r,n){const i=(o,c)=>{if(o===c)return!0;if(typeof o!=typeof c||typeof o!="object"||o===null||c===null)return!1;if(Array.isArray(o)&&Array.isArray(c))return o.length!==c.length?!1:o.every((g,b)=>i(g,c[b]));const u=Object.keys(o),m=Object.keys(c);return u.length!==m.length?!1:u.every(g=>i(o[g],c[g]))},s=t.get(r);if(s&&!i(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(o){se(`Error in watcher for "${r}":`,o)}for(const[o,c]of t.entries())if(c.options.deep&&r.startsWith(o+"."))try{const u=B(e,o);i(u,c.oldValue)||(c.callback(u,c.oldValue,e),c.oldValue=u)}catch(u){se(`Error in deep watcher for "${o}":`,u)}}function Ge(e,t){return t===Boolean?e==="true":t===Number?Number(e):e}function Et(e,t,r){t&&Object.entries(t).forEach(([n,i])=>{const s=re(n),o=e.getAttribute(s);if(i.type===Function&&typeof e[n]=="function")r[n]=e[n];else if(typeof e[n]<"u")try{const c=e[n];i.type===Boolean&&typeof c=="boolean"||i.type===Number&&typeof c=="number"||i.type===Function&&typeof c=="function"?r[n]=c:r[n]=Ge(String(c),i.type)}catch{r[n]=e[n]}else o!==null?r[n]=Ge(o,i.type):"default"in i&&i.default!==void 0&&(r[n]=i.default)})}function St(e,t,r){t.props&&Et(e,t.props,r)}function At(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function Tt(e,t,r,n,i,s,o,c){e.onDisconnected&&e.onDisconnected(t),r.forEach(u=>u()),n(),i(),s(!1),o(null),c(!1)}function Rt(e,t,r,n,i){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,i)}class Ot{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(t,r){const n=this.cache.get(t);if(n){if(!n.isSecure){Pe("Blocked cached dangerous expression:",t);return}return n.evaluator(r)}const i=this.createEvaluator(t);if(this.cache.size>=this.maxCacheSize){const s=this.cache.keys().next().value;s&&this.cache.delete(s)}if(this.cache.set(t,i),!i.isSecure){Pe("Blocked dangerous expression:",t);return}return i.evaluator(r)}static createEvaluator(t){if(this.hasDangerousPatterns(t))return{evaluator:()=>{},isSecure:!1};if(t.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(r){return Pe("Failed to create evaluator for expression:",t,r),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(t){return this.dangerousPatterns.some(r=>r.test(t))}static createSafeEvaluator(t){if(t.trim().startsWith("{")&&t.trim().endsWith("}"))return this.createObjectEvaluator(t);if(/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())){const r=t.trim().slice(4);return n=>B(n,r)}return t.includes("ctx")||/[+\-*/%<>=&|?:\[\]]/.test(t)?this.createSimpleEvaluator(t):r=>B(r,t)}static createObjectEvaluator(t){const r=t.trim().slice(1,-1),n=this.parseObjectProperties(r);return i=>{const s={};for(const{key:o,value:c}of n)try{if(c.startsWith("ctx.")){const u=c.slice(4);s[o]=B(i,u)}else s[o]=this.evaluateSimpleValue(c,i)}catch{s[o]=void 0}return s}}static parseObjectProperties(t){const r=[],n=t.split(",");for(const i of n){const s=i.indexOf(":");if(s===-1)continue;const o=i.slice(0,s).trim(),c=i.slice(s+1).trim(),u=o.replace(/^['"]|['"]$/g,"");r.push({key:u,value:c})}return r}static createSimpleEvaluator(t){return r=>{try{let n=t;const i=[];n=n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,b=>`<<#${i.push(b)-1}#>>`);const s=n.match(/ctx\.[\w.]+/g)||[];for(const b of s){const p=b.slice(4),f=B(r,p);if(f===void 0)return;const h=i.push(JSON.stringify(f))-1;n=n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${h}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,c=n.match(o)||[];for(const b of c){if(b.startsWith("ctx."))continue;const p=B(r,b);if(p===void 0)return;const f=i.push(JSON.stringify(p))-1;n=n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${f}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let m;const g=new Set;for(;(m=u.exec(n))!==null;){const b=m[1];if(["true","false","null","undefined"].includes(b)||/^[0-9]+$/.test(b)||b==="ctx"||g.has(b))continue;g.add(b);const p=B(r,b);if(p===void 0)return;const f=JSON.stringify(p),h=i.push(f)-1;b.includes(".")?n=n.replace(new RegExp(b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${h}#>>`):n=n.replace(new RegExp("\\b"+b.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${h}#>>`)}n=n.replace(/<<#(\d+)#>>/g,(b,p)=>i[Number(p)]);try{return this.evaluateBasicExpression(n)}catch{return}}catch{return}}}static evaluateBasicExpression(t){const r=this.tokenize(t);let n=0;function i(){return r[n]}function s(a){const l=r[n++];if(a&&!l)throw new Error(`Unexpected token EOF, expected ${a}`);if(a&&l&&l.type!==a&&l.value!==a)throw new Error(`Unexpected token ${l.type}/${l.value}, expected ${a}`);return l}function o(){return c()}function c(){let a=u();if(i()&&i().value==="?"){s("?");const l=o();s(":");const y=o();return a?l:y}return a}function u(){let a=m();for(;i()&&i().value==="||";){s("OP");const l=m();a=a||l}return a}function m(){let a=g();for(;i()&&i().value==="&&";){s("OP");const l=g();a=a&&l}return a}function g(){let a=b();for(;i()&&["==","!=","===","!=="].includes(i().value);){const l=s("OP").value,y=b();switch(l){case"==":a=a==y;break;case"!=":a=a!=y;break;case"===":a=a===y;break;case"!==":a=a!==y;break}}return a}function b(){let a=p();for(;i()&&[">","<",">=","<="].includes(i().value);){const l=s("OP").value,y=p();switch(l){case">":a=a>y;break;case"<":a=a<y;break;case">=":a=a>=y;break;case"<=":a=a<=y;break}}return a}function p(){let a=f();for(;i()&&(i().value==="+"||i().value==="-");){const l=s("OP").value,y=f();a=l==="+"?a+y:a-y}return a}function f(){let a=h();for(;i()&&(i().value==="*"||i().value==="/"||i().value==="%");){const l=s("OP").value,y=h();switch(l){case"*":a=a*y;break;case"/":a=a/y;break;case"%":a=a%y;break}}return a}function h(){return i()&&i().value==="!"?(s("OP"),!h()):i()&&i().value==="-"?(s("OP"),-h()):v()}function v(){const a=i();if(a){if(a.type==="NUMBER")return s("NUMBER"),Number(a.value);if(a.type==="STRING")return s("STRING"),a.value.slice(1,-1);if(a.type==="IDENT")return s("IDENT"),a.value==="true"?!0:a.value==="false"?!1:a.value==="null"?null:void 0;if(a.value==="["){s("PUNC");const l=[];for(;i()&&i().value!=="]";)l.push(o()),i()&&i().value===","&&s("PUNC");return s("PUNC"),l}if(a.value==="("){s("PUNC");const l=o();return s("PUNC"),l}throw new Error("Unexpected token in expression")}}return o()}static tokenize(t){const r=[],n=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let i;for(;(i=n.exec(t))!==null;){const s=i[1];s&&(/^\d/.test(s)?r.push({type:"NUMBER",value:s}):/^"/.test(s)||/^'/.test(s)?r.push({type:"STRING",value:s}):/^[a-zA-Z_]/.test(s)?r.push({type:"IDENT",value:s}):/^[()?:,\[\]]$/.test(s)?r.push({type:"PUNC",value:s}):r.push({type:"OP",value:s}))}return r}static evaluateSimpleValue(t,r){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(Number(t)))return Number(t);if(t.startsWith("ctx.")){const n=t.slice(4);return B(r,n)}return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class oe{static cleanupFunctions=new WeakMap;static addListener(t,r,n,i){t.addEventListener(r,n,i);const o={event:r,handler:n,options:i,cleanup:()=>t.removeEventListener(r,n,i),addedAt:Date.now()};this.cleanupFunctions.has(t)||this.cleanupFunctions.set(t,[]);const c=this.cleanupFunctions.get(t);c.push(o),this.cleanupFunctions.get(t).__metaList=c}static removeListener(t,r,n,i){t.removeEventListener(r,n,i);const s=this.cleanupFunctions.get(t);if(s){const o=s.__metaList||null;if(o){const c=o.findIndex(u=>u.event===r&&u.handler===n&&JSON.stringify(u.options)===JSON.stringify(i));if(c>=0){try{o[c].cleanup()}catch{}o.splice(c,1)}o.length===0&&this.cleanupFunctions.delete(t)}else{const c=s.findIndex(()=>!0);c>=0&&(s.splice(c,1),s.length===0&&this.cleanupFunctions.delete(t))}}}static cleanup(t){const r=this.cleanupFunctions.get(t);r&&((r.__metaList||r).forEach(i=>{try{typeof i=="function"?i():i&&typeof i.cleanup=="function"&&i.cleanup()}catch(s){console.error("Error during event cleanup:",s)}}),this.cleanupFunctions.delete(t))}static cleanupAll(){try{this.cleanupFunctions=new WeakMap}catch(t){console.error("Error during global cleanup:",t)}}static hasListeners(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return!!(n&&n.length>0)}static getListenerCount(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return n?n.length:0}}function le(e,t){if(t&&e instanceof HTMLElement){oe.cleanup(e);for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))le(r,t)}}function ge(e,t,r){if(typeof e=="string")return;const n=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),i=e.props?.ref??(e.props?.props&&e.props.props.ref);n?n.value=t:i&&r&&(r[i]=t)}function Pt(e,t,r,n,i,s,o,c){if(!s)return;const u=t.includes("lazy"),m=t.includes("trim"),g=t.includes("number"),b=e&&typeof e=="object"&&"value"in e&&typeof e.value<"u",p=()=>{if(b){const $=e.value;return c&&typeof $=="object"&&$!==null?$[c]:$}return B(s._state||s,e)},f=p();let h="text";o instanceof HTMLInputElement?h=n?.type||o.type||"text":o instanceof HTMLSelectElement?h="select":o instanceof HTMLTextAreaElement&&(h="textarea");const v=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,a=v?h==="checkbox"||h==="radio"?"checked":"value":c??"modelValue";if(h==="checkbox")if(Array.isArray(f))r[a]=f.includes(String(o?.getAttribute("value")??n?.value??""));else{const $=o?.getAttribute("true-value")??!0;r[a]=f===$}else if(h==="radio")r[a]=f===(n?.value??"");else if(h==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const $=Array.isArray(f)?f.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(k=>{k.selected=$.includes(k.value)})},0),r[a]=Array.isArray(f)?f:[]}else r[a]=f;else{r[a]=f;try{const $=re(a);n&&(n[$]=f)}catch{}}const l=u||h==="checkbox"||h==="radio"||h==="select"?"change":"input",y=$=>{if($.isComposing||i._isComposing)return;const k=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if($.isTrusted===!1&&!k)return;const d=$.target;if(!d||d._modelUpdating)return;let x=d.value;if(h==="checkbox"){const T=p();if(Array.isArray(T)){const R=d.getAttribute("value")??"",S=Array.from(T);if(d.checked)S.includes(R)||S.push(R);else{const P=S.indexOf(R);P>-1&&S.splice(P,1)}x=S}else{const R=d.getAttribute("true-value")??!0,S=d.getAttribute("false-value")??!1;x=d.checked?R:S}}else if(h==="radio")x=d.getAttribute("value")??d.value;else if(h==="select"&&d.multiple)x=Array.from(d.selectedOptions).map(T=>T.value);else if(m&&typeof x=="string"&&(x=x.trim()),g){const T=Number(x);isNaN(T)||(x=T)}const A=s._state||s,C=p();if(Array.isArray(x)&&Array.isArray(C)?JSON.stringify([...x].sort())!==JSON.stringify([...C].sort()):x!==C){d._modelUpdating=!0;try{if(b)if(c&&typeof e.value=="object"&&e.value!==null){const T={...e.value};T[c]=x,e.value=T}else e.value=x;else Ee(A,e,x);if(s._requestRender&&s._requestRender(),s._triggerWatchers){const T=b?"reactiveState":e;s._triggerWatchers(T,x)}if(d){const T=`update:${re(a)}`,R=new CustomEvent(T,{detail:x,bubbles:!0,composed:!0});d.dispatchEvent(R)}}finally{setTimeout(()=>d._modelUpdating=!1,0)}}};if(v){if(i[l]){const $=i[l];o&&oe.removeListener(o,l,$)}i[l]=y}else{const $=`update:${re(a)}`;if(i[$]){const k=i[$];o&&oe.removeListener(o,$,k)}i[$]=k=>{const d=s._state||s,x=k.detail!==void 0?k.detail:k.target?.value,A=B(d,e);if(Array.isArray(x)&&Array.isArray(A)?JSON.stringify([...x].sort())!==JSON.stringify([...A].sort()):x!==A){Ee(d,e,x),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,x);const E=k.target;if(E){E[a]=x;try{const T=re(a);typeof x=="boolean"?x?E.setAttribute(T,"true"):E.setAttribute(T,"false"):E.setAttribute(T,String(x))}catch{}queueMicrotask(()=>{typeof E._applyProps=="function"&&E._applyProps(E._cfg),typeof E._requestRender=="function"&&E._requestRender()})}}}}(h==="text"||h==="textarea")&&(i.compositionstart=(()=>i._isComposing=!0),i.compositionend=$=>{i._isComposing=!1;const k=$.target;k&&setTimeout(()=>{const d=k.value,x=s._state||s,A=B(x,e);let C=d;if(m&&(C=C.trim()),g){const T=Number(C);isNaN(T)||(C=T)}if(Array.isArray(C)&&Array.isArray(A)?JSON.stringify([...C].sort())!==JSON.stringify([...A].sort()):C!==A){k._modelUpdating=!0;try{Ee(x,e,C),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,C)}finally{setTimeout(()=>k._modelUpdating=!1,0)}}},0)})}function at(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function Lt(e,t,r,n){if(typeof e=="object"&&e!==null)for(const[i,s]of Object.entries(e))i.startsWith("data-")||i.startsWith("aria-")||i==="class"?r[i]=s:t[i]=s;else if(typeof e=="string"){if(!n)return;try{const i=ye(e,n);if(typeof i=="object"&&i!==null){for(const[s,o]of Object.entries(i))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?r[s]=o:t[s]=o;return}else{r[e]=i;return}}catch{const i=B(n,e);r[e]=i}}}function Mt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ye(e,r)}else n=e;const i=t.style||"";let s=i;if(n){if(i){const o=i.split(";").map(u=>u.trim()).filter(Boolean),c=o.findIndex(u=>u.startsWith("display:"));c>=0&&o[c]==="display: none"&&(o.splice(c,1),s=o.length>0?o.join("; ")+";":"")}}else if(i){const o=i.split(";").filter(Boolean),c=o.findIndex(u=>u.trim().startsWith("display:"));c>=0?o[c]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==i&&(s?t.style=s:delete t.style)}function ye(e,t){return Ot.evaluate(e,t)}function jt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ye(e,r)}else n=e;let i=[];typeof n=="string"?i=[n]:Array.isArray(n)?i=n.filter(Boolean):typeof n=="object"&&n!==null&&(i=Object.entries(n).filter(([,c])=>!!c).flatMap(([c])=>c.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${i.join(" ")}`.trim():i.join(" ");o&&(t.class=o)}function Wt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ye(e,r)}else n=e;let i="";if(typeof n=="string")i=n;else if(n&&typeof n=="object"){const o=[];for(const[c,u]of Object.entries(n))if(u!=null&&u!==""){const m=c.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),g=["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 b=String(u);typeof u=="number"&&g.includes(m)&&(b=`${u}px`),o.push(`${m}: ${b}`)}i=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+i}function Nt(e,t,r){let n=e;typeof e=="string"&&r&&(n=ye(e,r)),te(n)?t.reactiveRef=n:t.ref=n}function ct(e,t,r,n){const i={},s={...n||{}},o={};for(const[c,u]of Object.entries(e)){const{value:m,modifiers:g,arg:b}=u;if(c==="model"||c.startsWith("model:")){const p=c.split(":"),f=p.length>1?p[1]:b;Pt(m,g,i,s,o,t,r,f);continue}switch(c){case"bind":Lt(m,i,s,t);break;case"show":Mt(m,s,t);break;case"class":jt(m,s,t);break;case"style":Wt(m,s,t);break;case"ref":Nt(m,i,t);break}}return{props:i,attrs:s,listeners:o}}function Be(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let c=o.props?.key??o.key;if(!c){const b=o.tag||"node",f=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(h=>h!=null)??"";c=f?`${t}:${b}:${f}`:`${t}:${b}`}let u=c,m=1;for(;s.has(u);)u=`${c}#${m++}`;s.add(u);let g=o.children;return Array.isArray(g)&&(g=Be(g,u)),{...o,key:u,children:g}})}const r=e;let n=r.props?.key??r.key??t,i=r.children;return Array.isArray(i)&&(i=Be(i,n)),{...r,key:n,children:i}}function Qe(e,t,r,n){const i=r.directives??{},s=ct(i,n,e,r.attrs),o={...t.props,...r.props,...s.props},c={...t.attrs,...r.attrs,...s.attrs},u=t.props??{},m=o,g=r?.isCustomElement??t?.isCustomElement??!1;let b=!1;for(const h in{...u,...m}){const v=u[h],w=m[h];if(v!==w)if(b=!0,h==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==w&&(e.value=w??"");else if(h==="checked"&&e instanceof HTMLInputElement)e.checked=!!w;else if(h.startsWith("on")&&typeof w=="function"){const a=at(h);typeof v=="function"&&oe.removeListener(e,a,v),oe.addListener(e,a,w)}else if(w==null)e.removeAttribute(h);else if((r?.isCustomElement??t?.isCustomElement??!1)||h in e)try{e[h]=w}catch{}else w===!1&&e.removeAttribute(h)}for(const[h,v]of Object.entries(s.listeners||{}))oe.addListener(e,h,v);const p=t.attrs??{},f=c;for(const h in{...p,...f}){const v=p[h],w=f[h];let a=v,l=w;if(te(v)&&(a=v.value),te(w)&&(l=w.value),a!==l)if(b=!0,l==null||l===!1){if(e.removeAttribute(h),h==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(h==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(h==="disabled")try{e.disabled=!1}catch{}}else{if(h==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=l??""}catch{e.setAttribute(h,String(l))}continue}else if(e instanceof HTMLSelectElement){try{e.value=l??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(l)}catch{}continue}}if(h==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!l}catch{}continue}if(h==="style"){e.setAttribute(h,String(l));continue}const y=e.namespaceURI==="http://www.w3.org/2000/svg";if(g&&!y&&h.includes("-")){const $=st(h);try{e[$]=l}catch{e.setAttribute(h,String(l))}}else if(!y&&h in e)try{e[h]=l}catch{e.setAttribute(h,String(l))}else e.setAttribute(h,String(l))}}if(g&&b)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function Q(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const p=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(p.key=e.key),p}if(e.tag==="#anchor"){const p=e,f=Array.isArray(p.children)?p.children:[],h=document.createTextNode(""),v=document.createTextNode("");p.key!=null&&(h.key=`${p.key}:start`,v.key=`${p.key}:end`),p._startNode=h,p._endNode=v;const w=document.createDocumentFragment();w.appendChild(h);for(const a of f){const l=Q(a,t);w.appendChild(l)}return w.appendChild(v),w}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:i={},attrs:s={},directives:o={}}=e.props??{},c=ct(o,t,n,s),u={...i,...c.props},m={...s,...c.attrs},g=n.namespaceURI==="http://www.w3.org/2000/svg";for(const p in m){const f=m[p];if(!(typeof p!="string"||/\[object Object\]/.test(p))){if(typeof f=="boolean")f&&n.setAttribute(p,"");else if(f!=null)if(!g&&p==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement||n instanceof HTMLProgressElement))try{n instanceof HTMLProgressElement?n.value=Number(f):n.value=f??""}catch{n.setAttribute(p,String(f))}else if(!g&&p==="checked"&&n instanceof HTMLInputElement)try{n.checked=!!f}catch{n.setAttribute(p,String(f))}else if(!g&&p in n)try{n[p]=f}catch{n.setAttribute(p,String(f))}else if((e.props?.isCustomElement??!1)&&!g&&p.includes("-")){const v=st(p);try{n[v]=f}catch{n.setAttribute(p,String(f))}}else n.setAttribute(p,String(f))}}for(const p in u){const f=u[p];if(!(typeof p!="string"||/\[object Object\]/.test(p)))if(p==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)){const h=typeof f=="object"&&f!==null&&typeof f.value<"u"?f.value:f;n.value=h??""}else if(p==="checked"&&n instanceof HTMLInputElement){const h=typeof f=="object"&&f!==null&&typeof f.value<"u"?f.value:f;n.checked=!!h}else if(p.startsWith("on")&&typeof f=="function")oe.addListener(n,at(p),f);else{if(p.startsWith("on")&&f===void 0)continue;if(f==null||f===!1)n.removeAttribute(p);else if((e.props?.isCustomElement??!1)||p in n)try{const v=typeof f=="object"&&f!==null&&typeof f.value<"u"?f.value:f;n[p]=v}catch{}}}for(const[p,f]of Object.entries(c.listeners||{}))oe.addListener(n,p,f);const b={...e,props:{...e.props,...c.props}};ge(b,n,r);try{if(typeof n._applyProps=="function")try{n._applyProps(n._cfg)}catch{}typeof n.requestRender=="function"?n.requestRender():typeof n._render=="function"&&n._render(n._cfg)}catch{}if(Array.isArray(e.children))for(const p of e.children)n.appendChild(Q(p,t,r));else typeof e.children=="string"&&(n.textContent=e.children);try{if(n instanceof HTMLSelectElement&&m&&m.hasOwnProperty("value"))try{n.value=m.value??""}catch{}}catch{}return n}function zt(e,t,r,n,i){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],c=new Map;for(const f of o)f&&f.key!=null&&c.set(f.key,f);const u=new Map;for(const f of s){const h=f.key;h!=null&&u.set(h,f)}const m=new Set;let g=e.firstChild;function b(f,h){let v=f;for(;v&&(m.add(v),v!==h);)v=v.nextSibling}function p(f,h,v,w){const a=[];let l=f.nextSibling;for(;l&&l!==h;)a.push(l),l=l.nextSibling;const y=Array.isArray(v)?v:[];if(w.some(k=>k&&k.key!=null)||y.some(k=>k&&k.key!=null)){const k=new Map,d=new Map;for(const C of y)C&&C.key!=null&&k.set(C.key,C);for(const C of a){const E=C.key;E!=null&&d.set(E,C)}const x=new Set;let A=f.nextSibling;for(const C of w){let E;if(C.key!=null&&d.has(C.key)){const T=k.get(C.key);E=Se(d.get(C.key),T,C,n),x.add(E),E!==A&&e.contains(E)&&e.insertBefore(E,A)}else E=Q(C,n),e.insertBefore(E,A),x.add(E);A=E.nextSibling}for(const C of a)!x.has(C)&&e.contains(C)&&e.removeChild(C)}else{const k=Math.min(y.length,w.length);for(let d=0;d<k;d++){const x=y[d],A=w[d],C=Se(a[d],x,A,n);C!==a[d]&&(e.insertBefore(C,a[d]),e.removeChild(a[d]))}for(let d=k;d<w.length;d++)e.insertBefore(Q(w[d],n),h);for(let d=k;d<a.length;d++)e.removeChild(a[d])}}for(const f of r){let h;if(f.tag==="#anchor"){const v=f.key,w=`${v}:start`,a=`${v}:end`;let l=u.get(w),y=u.get(a);const $=Array.isArray(f.children)?f.children:[];if(l||(l=document.createTextNode(""),l.key=w),y||(y=document.createTextNode(""),y.key=a),f._startNode=l,f._endNode=y,!e.contains(l)||!e.contains(y)){e.insertBefore(l,g);for(const k of $)e.insertBefore(Q(k,n),g);e.insertBefore(y,g)}else p(l,y,c.get(v)?.children,$);b(l,y),g=y.nextSibling;continue}if(f.key!=null&&u.has(f.key)){const v=c.get(f.key);h=Se(u.get(f.key),v,f,n,i),m.add(h),h!==g&&e.contains(h)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(h,g))}else h=Q(f,n,i),g&&!e.contains(g)&&(g=null),e.insertBefore(h,g),m.add(h);g=h.nextSibling}for(const f of s)!m.has(f)&&e.contains(f)&&(le(f,i),e.removeChild(f))}function Se(e,t,r,n,i){if(t&&typeof t!="string"&&t.props?.ref&&i&&le(e,i),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const o=document.createTextNode(r);return e.parentNode?.replaceChild(o,e),o}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const o=r,c=Array.isArray(o.children)?o.children:[],u=o._startNode??document.createTextNode(""),m=o._endNode??document.createTextNode("");o.key!=null&&(u.key=`${o.key}:start`,m.key=`${o.key}:end`),o._startNode=u,o._endNode=m;const g=document.createDocumentFragment();g.appendChild(u);for(const b of c){const p=Q(b,n);g.appendChild(p)}return g.appendChild(m),e.parentNode?.replaceChild(g,e),u}if(!r){le(e,i);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){le(e,i);const o=Q(r,n,i);return ge(r,o,i),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],c=r._startNode??document.createTextNode(""),u=r._endNode??document.createTextNode("");r.key!=null&&(c.key=`${r.key}:start`,u.key=`${r.key}:end`),r._startNode=c,r._endNode=u;const m=document.createDocumentFragment();m.appendChild(c);for(const g of o)m.appendChild(Q(g,n));return m.appendChild(u),e.parentNode?.replaceChild(m,e),c}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return Qe(o,t.props||{},r.props||{},n),zt(o,t.children,r.children,n,i),ge(r,o,i),o}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&(t.tag&&String(t.tag).includes("-")||r.props&&r.props.isCustomElement||t.props&&t.props.isCustomElement))try{const c=e;return Qe(c,t.props||{},r.props||{},n),ge(r,c,i),c}catch{}le(e,i);const s=Q(r,n,i);return ge(r,s,i),e.parentNode?.replaceChild(s,e),s}function Dt(e,t,r,n){let i;Array.isArray(t)?t.length===1?(i=t[0],i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})):i={tag:"div",key:"__root__",children:t}:(i=t,i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})),i&&typeof i=="object"&&i.tag==="#anchor"&&(i={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[i]}),i=Be(i,String(i.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let c;s&&o?typeof s!="string"&&typeof i!="string"&&s.tag===i.tag&&s.key===i.key?c=Se(o,s,i,r,n):(c=Q(i,r,n),e.replaceChild(c,o)):(c=Q(i,r,n),e.firstChild?e.replaceChild(c,e.firstChild):e.appendChild(c));const u=[];for(let m=0;m<e.childNodes.length;m++){const g=e.childNodes[m];g!==c&&g.nodeName!=="STYLE"&&(le(g,n),u.push(g))}u.forEach(m=>e.removeChild(m)),e._prevVNode=i,e._prevDom=c}function Ae(e){if(typeof e=="string")return he(e);if(e.tag==="#text")return typeof e.children=="string"?he(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(Ae).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([i,s])=>` ${i}="${he(String(s))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([i])=>i!=="attrs"&&i!=="directives"&&i!=="ref"&&i!=="key").map(([i,s])=>` ${i}="${he(String(s))}"`).join(""));const n=Array.isArray(e.children)?e.children.filter(Boolean).map(Ae).join(""):typeof e.children=="string"?he(e.children):e.children?Ae(e.children):"";return`<${e.tag}${t}${r}>${n}</${e.tag}>`}function lt(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function ut(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let Ce=null;function Xe(){return Ce||(Ce=new CSSStyleSheet,Ce.replaceSync(ut(Ht))),Ce}function It(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Ht=lt`
5
- :host, *, ::before, ::after {
4
+ • Ensure computed properties don't modify state`),this._value=this.makeReactive(t),F.triggerUpdate(this)}addDependent(t){this.dependents.add(t)}removeDependent(t){this.dependents.delete(t)}getDependents(){return this.dependents}makeReactive(t){return t===null||typeof t!="object"||t instanceof Node||t instanceof Element||t instanceof HTMLElement?t:lt.createReactiveProxy(t,()=>F.triggerUpdate(this),r=>this.makeReactive(r))}}function Et(e){return F.getOrCreateState(e===void 0?null:e)}function te(e){if(!e||typeof e!="object")return!1;try{const t=Symbol.for("@cer/ReactiveState");if(e[t])return!0}catch{}try{return!!(e.constructor&&e.constructor.name==="ReactiveState")}catch{return!1}}function St(e){const t=new Fe(e());return{get value(){return F.trackDependency(t),e()}}}function At(e,t,r={}){let n=e();r.immediate&&t(n,n);const i=`watch-${Math.random().toString(36).substr(2,9)}`,s=()=>{F.setCurrentComponent(i,s);const o=e();F.clearCurrentComponent(),o!==n&&(t(o,n),n=o)};return F.setCurrentComponent(i,s),e(),F.clearCurrentComponent(),()=>{F.cleanup(i)}}const Ce=new Map,_e=new Map,Ee=new Map,Ge=500;function ie(e){if(Ce.has(e))return Ce.get(e);const t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return Ce.size<Ge&&Ce.set(e,t),t}function ut(e){if(_e.has(e))return _e.get(e);const t=e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase());return _e.size<Ge&&_e.set(e,t),t}function ge(e){if(typeof e=="string"){if(Ee.has(e))return Ee.get(e);const t=e.replace(/[&<>"']/g,r=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[r]);return t!==e&&Ee.size<Ge&&Ee.set(e,t),t}return e}function q(e,t){if(typeof t=="string"){const r=t.split(".").reduce((n,i)=>n?.[i],e);return te(r)?r.value:r}return t}function Oe(e,t,r){const n=String(t).split("."),i=n.pop();if(!i)return;const s=n.reduce((o,c)=>(o[c]==null&&(o[c]={}),o[c]),e);te(s[i])?s[i].value=r:s[i]=r}const ft=typeof process<"u"&&process.env?.NODE_ENV!=="production";function ae(e,...t){ft&&console.error(e,...t)}function Me(e,...t){ft&&console.warn(e,...t)}function Ot(e,t,r){if(r)for(const[n,i]of Object.entries(r)){let s,o={};if(Array.isArray(i)?(s=i[0],o=i[1]||{}):s=i,t.set(n,{callback:s,options:o,oldValue:q(e,n)}),o.immediate)try{const c=q(e,n);s(c,void 0,e)}catch(c){ae(`Error in immediate watcher for "${n}":`,c)}}}function jt(e,t,r,n){const i=(o,c)=>{if(o===c)return!0;if(typeof o!=typeof c||typeof o!="object"||o===null||c===null)return!1;if(Array.isArray(o)&&Array.isArray(c))return o.length!==c.length?!1:o.every((h,x)=>i(h,c[x]));const a=Object.keys(o),p=Object.keys(c);return a.length!==p.length?!1:a.every(h=>i(o[h],c[h]))},s=t.get(r);if(s&&!i(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(o){ae(`Error in watcher for "${r}":`,o)}for(const[o,c]of t.entries())if(c.options.deep&&r.startsWith(o+"."))try{const a=q(e,o);i(a,c.oldValue)||(c.callback(a,c.oldValue,e),c.oldValue=a)}catch(a){ae(`Error in deep watcher for "${o}":`,a)}}function Ye(e,t){return t===Boolean?e==="true":t===Number?Number(e):e}function Tt(e,t,r){t&&Object.entries(t).forEach(([n,i])=>{const s=ie(n),o=e.getAttribute(s);if(i.type===Function&&typeof e[n]=="function")r[n]=e[n];else if(typeof e[n]<"u")try{const c=e[n];i.type===Boolean&&typeof c=="boolean"||i.type===Number&&typeof c=="number"||i.type===Function&&typeof c=="function"?r[n]=c:r[n]=Ye(String(c),i.type)}catch{r[n]=e[n]}else o!==null?r[n]=Ye(o,i.type):"default"in i&&i.default!==void 0&&(r[n]=i.default)})}function Rt(e,t,r){t.props&&Tt(e,t.props,r)}function Pt(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function Lt(e,t,r,n,i,s,o,c){e.onDisconnected&&e.onDisconnected(t),r.forEach(a=>a()),n(),i(),s(!1),o(null),c(!1)}function Mt(e,t,r,n,i){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,i)}class Wt{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(t,r){const n=this.cache.get(t);if(n){if(!n.isSecure){Me("Blocked cached dangerous expression:",t);return}return n.evaluator(r)}const i=this.createEvaluator(t);if(this.cache.size>=this.maxCacheSize){const s=this.cache.keys().next().value;s&&this.cache.delete(s)}if(this.cache.set(t,i),!i.isSecure){Me("Blocked dangerous expression:",t);return}return i.evaluator(r)}static createEvaluator(t){if(this.hasDangerousPatterns(t))return{evaluator:()=>{},isSecure:!1};if(t.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(r){return Me("Failed to create evaluator for expression:",t,r),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(t){return this.dangerousPatterns.some(r=>r.test(t))}static createSafeEvaluator(t){if(t.trim().startsWith("{")&&t.trim().endsWith("}"))return this.createObjectEvaluator(t);if(/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())){const r=t.trim().slice(4);return n=>q(n,r)}return t.includes("ctx")||/[+\-*/%<>=&|?:\[\]]/.test(t)?this.createSimpleEvaluator(t):r=>q(r,t)}static createObjectEvaluator(t){const r=t.trim().slice(1,-1),n=this.parseObjectProperties(r);return i=>{const s={};for(const{key:o,value:c}of n)try{if(c.startsWith("ctx.")){const a=c.slice(4);s[o]=q(i,a)}else s[o]=this.evaluateSimpleValue(c,i)}catch{s[o]=void 0}return s}}static parseObjectProperties(t){const r=[],n=t.split(",");for(const i of n){const s=i.indexOf(":");if(s===-1)continue;const o=i.slice(0,s).trim(),c=i.slice(s+1).trim(),a=o.replace(/^['"]|['"]$/g,"");r.push({key:a,value:c})}return r}static createSimpleEvaluator(t){return r=>{try{let n=t;const i=[];n=n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,x=>`<<#${i.push(x)-1}#>>`);const s=n.match(/ctx\.[\w.]+/g)||[];for(const x of s){const m=x.slice(4),d=q(r,m);if(d===void 0)return;const u=i.push(JSON.stringify(d))-1;n=n.replace(new RegExp(x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${u}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,c=n.match(o)||[];for(const x of c){if(x.startsWith("ctx."))continue;const m=q(r,x);if(m===void 0)return;const d=i.push(JSON.stringify(m))-1;n=n.replace(new RegExp(x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const a=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let p;const h=new Set;for(;(p=a.exec(n))!==null;){const x=p[1];if(["true","false","null","undefined"].includes(x)||/^[0-9]+$/.test(x)||x==="ctx"||h.has(x))continue;h.add(x);const m=q(r,x);if(m===void 0)return;const d=JSON.stringify(m),u=i.push(d)-1;x.includes(".")?n=n.replace(new RegExp(x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${u}#>>`):n=n.replace(new RegExp("\\b"+x.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${u}#>>`)}n=n.replace(/<<#(\d+)#>>/g,(x,m)=>i[Number(m)]);try{return this.evaluateBasicExpression(n)}catch{return}}catch{return}}}static evaluateBasicExpression(t){const r=this.tokenize(t);let n=0;function i(){return r[n]}function s(l){const f=r[n++];if(l&&!f)throw new Error(`Unexpected token EOF, expected ${l}`);if(l&&f&&f.type!==l&&f.value!==l)throw new Error(`Unexpected token ${f.type}/${f.value}, expected ${l}`);return f}function o(){return c()}function c(){let l=a();if(i()&&i().value==="?"){s("?");const f=o();s(":");const b=o();return l?f:b}return l}function a(){let l=p();for(;i()&&i().value==="||";){s("OP");const f=p();l=l||f}return l}function p(){let l=h();for(;i()&&i().value==="&&";){s("OP");const f=h();l=l&&f}return l}function h(){let l=x();for(;i()&&["==","!=","===","!=="].includes(i().value);){const f=s("OP").value,b=x();switch(f){case"==":l=l==b;break;case"!=":l=l!=b;break;case"===":l=l===b;break;case"!==":l=l!==b;break}}return l}function x(){let l=m();for(;i()&&[">","<",">=","<="].includes(i().value);){const f=s("OP").value,b=m();switch(f){case">":l=l>b;break;case"<":l=l<b;break;case">=":l=l>=b;break;case"<=":l=l<=b;break}}return l}function m(){let l=d();for(;i()&&(i().value==="+"||i().value==="-");){const f=s("OP").value,b=d();l=f==="+"?l+b:l-b}return l}function d(){let l=u();for(;i()&&(i().value==="*"||i().value==="/"||i().value==="%");){const f=s("OP").value,b=u();switch(f){case"*":l=l*b;break;case"/":l=l/b;break;case"%":l=l%b;break}}return l}function u(){return i()&&i().value==="!"?(s("OP"),!u()):i()&&i().value==="-"?(s("OP"),-u()):y()}function y(){const l=i();if(l){if(l.type==="NUMBER")return s("NUMBER"),Number(l.value);if(l.type==="STRING")return s("STRING"),l.value.slice(1,-1);if(l.type==="IDENT")return s("IDENT"),l.value==="true"?!0:l.value==="false"?!1:l.value==="null"?null:void 0;if(l.value==="["){s("PUNC");const f=[];for(;i()&&i().value!=="]";)f.push(o()),i()&&i().value===","&&s("PUNC");return s("PUNC"),f}if(l.value==="("){s("PUNC");const f=o();return s("PUNC"),f}throw new Error("Unexpected token in expression")}}return o()}static tokenize(t){const r=[],n=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let i;for(;(i=n.exec(t))!==null;){const s=i[1];s&&(/^\d/.test(s)?r.push({type:"NUMBER",value:s}):/^"/.test(s)||/^'/.test(s)?r.push({type:"STRING",value:s}):/^[a-zA-Z_]/.test(s)?r.push({type:"IDENT",value:s}):/^[()?:,\[\]]$/.test(s)?r.push({type:"PUNC",value:s}):r.push({type:"OP",value:s}))}return r}static evaluateSimpleValue(t,r){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(Number(t)))return Number(t);if(t.startsWith("ctx.")){const n=t.slice(4);return q(r,n)}return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class ce{static cleanupFunctions=new WeakMap;static addListener(t,r,n,i){t.addEventListener(r,n,i);const o={event:r,handler:n,options:i,cleanup:()=>t.removeEventListener(r,n,i),addedAt:Date.now()};this.cleanupFunctions.has(t)||this.cleanupFunctions.set(t,[]);const c=this.cleanupFunctions.get(t);c.push(o),this.cleanupFunctions.get(t).__metaList=c}static removeListener(t,r,n,i){t.removeEventListener(r,n,i);const s=this.cleanupFunctions.get(t);if(s){const o=s.__metaList||null;if(o){const c=o.findIndex(a=>a.event===r&&a.handler===n&&JSON.stringify(a.options)===JSON.stringify(i));if(c>=0){try{o[c].cleanup()}catch{}o.splice(c,1)}o.length===0&&this.cleanupFunctions.delete(t)}else{const c=s.findIndex(()=>!0);c>=0&&(s.splice(c,1),s.length===0&&this.cleanupFunctions.delete(t))}}}static cleanup(t){const r=this.cleanupFunctions.get(t);r&&((r.__metaList||r).forEach(i=>{try{typeof i=="function"?i():i&&typeof i.cleanup=="function"&&i.cleanup()}catch(s){console.error("Error during event cleanup:",s)}}),this.cleanupFunctions.delete(t))}static cleanupAll(){try{this.cleanupFunctions=new WeakMap}catch(t){console.error("Error during global cleanup:",t)}}static hasListeners(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return!!(n&&n.length>0)}static getListenerCount(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return n?n.length:0}}function fe(e,t){if(t&&e instanceof HTMLElement){ce.cleanup(e);for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))fe(r,t)}}function be(e,t,r){if(typeof e=="string")return;const n=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),i=e.props?.ref??(e.props?.props&&e.props.props.ref);n?n.value=t:i&&r&&(r[i]=t)}function Dt(e,t,r,n,i,s,o,c){if(!s)return;const a=t.includes("lazy"),p=t.includes("trim"),h=t.includes("number"),x=e&&typeof e=="object"&&"value"in e&&typeof e.value<"u",m=()=>{if(x){const k=e.value;return c&&typeof k=="object"&&k!==null?k[c]:k}return q(s._state||s,e)},d=m();let u="text";o instanceof HTMLInputElement?u=n?.type||o.type||"text":o instanceof HTMLSelectElement?u="select":o instanceof HTMLTextAreaElement&&(u="textarea");const y=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,l=y?u==="checkbox"||u==="radio"?"checked":"value":c??"modelValue";if(u==="checkbox")if(Array.isArray(d))r[l]=d.includes(String(o?.getAttribute("value")??n?.value??""));else{const k=o?.getAttribute("true-value")??!0;r[l]=d===k}else if(u==="radio")r[l]=d===(n?.value??"");else if(u==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const k=Array.isArray(d)?d.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(C=>{C.selected=k.includes(C.value)})},0),r[l]=Array.isArray(d)?d:[]}else r[l]=d;else{r[l]=d;try{const k=ie(l);n&&(n[k]=d)}catch{}}const f=a||u==="checkbox"||u==="radio"||u==="select"?"change":"input",b=k=>{if(k.isComposing||i._isComposing)return;const C=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(k.isTrusted===!1&&!C)return;const g=k.target;if(!g||g._modelUpdating)return;let $=g.value;if(u==="checkbox"){const A=m();if(Array.isArray(A)){const D=g.getAttribute("value")??"",S=Array.from(A);if(g.checked)S.includes(D)||S.push(D);else{const j=S.indexOf(D);j>-1&&S.splice(j,1)}$=S}else{const D=g.getAttribute("true-value")??!0,S=g.getAttribute("false-value")??!1;$=g.checked?D:S}}else if(u==="radio")$=g.getAttribute("value")??g.value;else if(u==="select"&&g.multiple)$=Array.from(g.selectedOptions).map(A=>A.value);else if(p&&typeof $=="string"&&($=$.trim()),h){const A=Number($);isNaN(A)||($=A)}const O=s._state||s,v=m();if(Array.isArray($)&&Array.isArray(v)?JSON.stringify([...$].sort())!==JSON.stringify([...v].sort()):$!==v){g._modelUpdating=!0;try{if(x)if(c&&typeof e.value=="object"&&e.value!==null){const A={...e.value};A[c]=$,e.value=A}else e.value=$;else Oe(O,e,$);if(s._requestRender&&s._requestRender(),s._triggerWatchers){const A=x?"reactiveState":e;s._triggerWatchers(A,$)}if(g){const A=`update:${ie(l)}`,D=new CustomEvent(A,{detail:$,bubbles:!0,composed:!0});g.dispatchEvent(D)}}finally{setTimeout(()=>g._modelUpdating=!1,0)}}};if(y){if(i[f]){const k=i[f];o&&ce.removeListener(o,f,k)}i[f]=b}else{const k=`update:${ie(l)}`;if(i[k]){const C=i[k];o&&ce.removeListener(o,k,C)}i[k]=C=>{const g=s._state||s,$=C.detail!==void 0?C.detail:C.target?.value,O=q(g,e);if(Array.isArray($)&&Array.isArray(O)?JSON.stringify([...$].sort())!==JSON.stringify([...O].sort()):$!==O){Oe(g,e,$),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,$);const _=C.target;if(_){_[l]=$;try{const A=ie(l);typeof $=="boolean"?$?_.setAttribute(A,"true"):_.setAttribute(A,"false"):_.setAttribute(A,String($))}catch{}queueMicrotask(()=>{typeof _._applyProps=="function"&&_._applyProps(_._cfg),typeof _._requestRender=="function"&&_._requestRender()})}}}}(u==="text"||u==="textarea")&&(i.compositionstart=(()=>i._isComposing=!0),i.compositionend=k=>{i._isComposing=!1;const C=k.target;C&&setTimeout(()=>{const g=C.value,$=s._state||s,O=q($,e);let v=g;if(p&&(v=v.trim()),h){const A=Number(v);isNaN(A)||(v=A)}if(Array.isArray(v)&&Array.isArray(O)?JSON.stringify([...v].sort())!==JSON.stringify([...O].sort()):v!==O){C._modelUpdating=!0;try{Oe($,e,v),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,v)}finally{setTimeout(()=>C._modelUpdating=!1,0)}}},0)})}function dt(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function It(e,t,r,n){if(typeof e=="object"&&e!==null)for(const[i,s]of Object.entries(e))i.startsWith("data-")||i.startsWith("aria-")||i==="class"?r[i]=s:t[i]=s;else if(typeof e=="string"){if(!n)return;try{const i=xe(e,n);if(typeof i=="object"&&i!==null){for(const[s,o]of Object.entries(i))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?r[s]=o:t[s]=o;return}else{r[e]=i;return}}catch{const i=q(n,e);r[e]=i}}}function Nt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=xe(e,r)}else n=e;const i=t.style||"";let s=i;if(n){if(i){const o=i.split(";").map(a=>a.trim()).filter(Boolean),c=o.findIndex(a=>a.startsWith("display:"));c>=0&&o[c]==="display: none"&&(o.splice(c,1),s=o.length>0?o.join("; ")+";":"")}}else if(i){const o=i.split(";").filter(Boolean),c=o.findIndex(a=>a.trim().startsWith("display:"));c>=0?o[c]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==i&&(s?t.style=s:delete t.style)}function xe(e,t){return Wt.evaluate(e,t)}function Ht(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=xe(e,r)}else n=e;let i=[];typeof n=="string"?i=[n]:Array.isArray(n)?i=n.filter(Boolean):typeof n=="object"&&n!==null&&(i=Object.entries(n).filter(([,c])=>!!c).flatMap(([c])=>c.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${i.join(" ")}`.trim():i.join(" ");o&&(t.class=o)}function Bt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=xe(e,r)}else n=e;let i="";if(typeof n=="string")i=n;else if(n&&typeof n=="object"){const o=[];for(const[c,a]of Object.entries(n))if(a!=null&&a!==""){const p=c.replace(/[A-Z]/g,m=>`-${m.toLowerCase()}`),h=["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 x=String(a);typeof a=="number"&&h.includes(p)&&(x=`${a}px`),o.push(`${p}: ${x}`)}i=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+i}function zt(e,t,r){let n=e;typeof e=="string"&&r&&(n=xe(e,r)),te(n)?t.reactiveRef=n:t.ref=n}function ht(e,t,r,n){const i={},s={...n||{}},o={};for(const[c,a]of Object.entries(e)){const{value:p,modifiers:h,arg:x}=a;if(c==="model"||c.startsWith("model:")){const m=c.split(":"),d=m.length>1?m[1]:x;Dt(p,h,i,s,o,t,r,d);continue}switch(c){case"bind":It(p,i,s,t);break;case"show":Nt(p,s,t);break;case"class":Ht(p,s,t);break;case"style":Bt(p,s,t);break;case"ref":zt(p,i,t);break}}return{props:i,attrs:s,listeners:o}}function Ke(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let c=o.props?.key??o.key;if(!c){const x=o.tag||"node",d=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(u=>u!=null)??"";c=d?`${t}:${x}:${d}`:`${t}:${x}`}let a=c,p=1;for(;s.has(a);)a=`${c}#${p++}`;s.add(a);let h=o.children;return Array.isArray(h)&&(h=Ke(h,a)),{...o,key:a,children:h}})}const r=e;let n=r.props?.key??r.key??t,i=r.children;return Array.isArray(i)&&(i=Ke(i,n)),{...r,key:n,children:i}}function et(e,t,r,n){const i=r.directives??{},s=ht(i,n,e,r.attrs),o={...t.props,...r.props,...s.props},c={...t.attrs,...r.attrs,...s.attrs},a=t.props??{},p=o,h=r?.isCustomElement??t?.isCustomElement??!1;let x=!1;for(const u in{...a,...p}){const y=a[u],w=p[u];if(y!==w)if(x=!0,u==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==w&&(e.value=w??"");else if(u==="checked"&&e instanceof HTMLInputElement)e.checked=!!w;else if(u.startsWith("on")&&typeof w=="function"){const l=dt(u);typeof y=="function"&&ce.removeListener(e,l,y),ce.addListener(e,l,w)}else if(w==null)e.removeAttribute(u);else if((r?.isCustomElement??t?.isCustomElement??!1)||u in e)try{e[u]=w}catch{}else w===!1&&e.removeAttribute(u)}for(const[u,y]of Object.entries(s.listeners||{}))ce.addListener(e,u,y);const m=t.attrs??{},d=c;for(const u in{...m,...d}){const y=m[u],w=d[u];let l=y,f=w;if(te(y)&&(l=y.value),te(w)&&(f=w.value),l!==f)if(x=!0,f==null||f===!1){if(e.removeAttribute(u),u==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(u==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(u==="disabled")try{e.disabled=!1}catch{}}else{if(u==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=f??""}catch{e.setAttribute(u,String(f))}continue}else if(e instanceof HTMLSelectElement){try{e.value=f??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(f)}catch{}continue}}if(u==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!f}catch{}continue}if(u==="style"){e.setAttribute(u,String(f));continue}const b=e.namespaceURI==="http://www.w3.org/2000/svg";if(h&&!b&&u.includes("-")){const k=ut(u);try{e[k]=f}catch{e.setAttribute(u,String(f))}}else if(!b&&u in e)try{e[u]=f}catch{e.setAttribute(u,String(f))}else e.setAttribute(u,String(f))}}if(h&&x)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function Z(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const m=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(m.key=e.key),m}if(e.tag==="#anchor"){const m=e,d=Array.isArray(m.children)?m.children:[],u=document.createTextNode(""),y=document.createTextNode("");m.key!=null&&(u.key=`${m.key}:start`,y.key=`${m.key}:end`),m._startNode=u,m._endNode=y;const w=document.createDocumentFragment();w.appendChild(u);for(const l of d){const f=Z(l,t);w.appendChild(f)}return w.appendChild(y),w}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:i={},attrs:s={},directives:o={}}=e.props??{},c=ht(o,t,n,s),a={...i,...c.props},p={...s,...c.attrs},h=n.namespaceURI==="http://www.w3.org/2000/svg";for(const m in p){const d=p[m];if(!(typeof m!="string"||/\[object Object\]/.test(m))){if(typeof d=="boolean")d&&n.setAttribute(m,"");else if(d!=null)if(!h&&m==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement||n instanceof HTMLProgressElement))try{n instanceof HTMLProgressElement?n.value=Number(d):n.value=d??""}catch{n.setAttribute(m,String(d))}else if(!h&&m==="checked"&&n instanceof HTMLInputElement)try{n.checked=!!d}catch{n.setAttribute(m,String(d))}else if(!h&&m in n)try{n[m]=d}catch{n.setAttribute(m,String(d))}else if((e.props?.isCustomElement??!1)&&!h&&m.includes("-")){const y=ut(m);try{n[y]=d}catch{n.setAttribute(m,String(d))}}else n.setAttribute(m,String(d))}}for(const m in a){const d=a[m];if(!(typeof m!="string"||/\[object Object\]/.test(m)))if(m==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)){const u=typeof d=="object"&&d!==null&&typeof d.value<"u"?d.value:d;n.value=u??""}else if(m==="checked"&&n instanceof HTMLInputElement){const u=typeof d=="object"&&d!==null&&typeof d.value<"u"?d.value:d;n.checked=!!u}else if(m.startsWith("on")&&typeof d=="function")ce.addListener(n,dt(m),d);else{if(m.startsWith("on")&&d===void 0)continue;if(d==null||d===!1)n.removeAttribute(m);else if((e.props?.isCustomElement??!1)||m in n)try{const y=typeof d=="object"&&d!==null&&typeof d.value<"u"?d.value:d;n[m]=y}catch{}}}for(const[m,d]of Object.entries(c.listeners||{}))ce.addListener(n,m,d);const x={...e,props:{...e.props,...c.props}};be(x,n,r);try{if(typeof n._applyProps=="function")try{n._applyProps(n._cfg)}catch{}typeof n.requestRender=="function"?n.requestRender():typeof n._render=="function"&&n._render(n._cfg)}catch{}if(Array.isArray(e.children))for(const m of e.children)n.appendChild(Z(m,t,r));else typeof e.children=="string"&&(n.textContent=e.children);try{if(n instanceof HTMLSelectElement&&p&&p.hasOwnProperty("value"))try{n.value=p.value??""}catch{}}catch{}return n}function Ut(e,t,r,n,i){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],c=new Map;for(const d of o)d&&d.key!=null&&c.set(d.key,d);const a=new Map;for(const d of s){const u=d.key;u!=null&&a.set(u,d)}const p=new Set;let h=e.firstChild;function x(d,u){let y=d;for(;y&&(p.add(y),y!==u);)y=y.nextSibling}function m(d,u,y,w){const l=[];let f=d.nextSibling;for(;f&&f!==u;)l.push(f),f=f.nextSibling;const b=Array.isArray(y)?y:[];if(w.some(C=>C&&C.key!=null)||b.some(C=>C&&C.key!=null)){const C=new Map,g=new Map;for(const v of b)v&&v.key!=null&&C.set(v.key,v);for(const v of l){const _=v.key;_!=null&&g.set(_,v)}const $=new Set;let O=d.nextSibling;for(const v of w){let _;if(v.key!=null&&g.has(v.key)){const A=C.get(v.key);_=je(g.get(v.key),A,v,n),$.add(_),_!==O&&e.contains(_)&&e.insertBefore(_,O)}else _=Z(v,n),e.insertBefore(_,O),$.add(_);O=_.nextSibling}for(const v of l)!$.has(v)&&e.contains(v)&&e.removeChild(v)}else{const C=Math.min(b.length,w.length);for(let g=0;g<C;g++){const $=b[g],O=w[g],v=je(l[g],$,O,n);v!==l[g]&&(e.insertBefore(v,l[g]),e.removeChild(l[g]))}for(let g=C;g<w.length;g++)e.insertBefore(Z(w[g],n),u);for(let g=C;g<l.length;g++)e.removeChild(l[g])}}for(const d of r){let u;if(d.tag==="#anchor"){const y=d.key,w=`${y}:start`,l=`${y}:end`;let f=a.get(w),b=a.get(l);const k=Array.isArray(d.children)?d.children:[];if(f||(f=document.createTextNode(""),f.key=w),b||(b=document.createTextNode(""),b.key=l),d._startNode=f,d._endNode=b,!e.contains(f)||!e.contains(b)){e.insertBefore(f,h);for(const C of k)e.insertBefore(Z(C,n),h);e.insertBefore(b,h)}else m(f,b,c.get(y)?.children,k);x(f,b),h=b.nextSibling;continue}if(d.key!=null&&a.has(d.key)){const y=c.get(d.key);u=je(a.get(d.key),y,d,n,i),p.add(u),u!==h&&e.contains(u)&&(h&&!e.contains(h)&&(h=null),e.insertBefore(u,h))}else u=Z(d,n,i),h&&!e.contains(h)&&(h=null),e.insertBefore(u,h),p.add(u);h=u.nextSibling}for(const d of s)!p.has(d)&&e.contains(d)&&(fe(d,i),e.removeChild(d))}function je(e,t,r,n,i){if(t&&typeof t!="string"&&t.props?.ref&&i&&fe(e,i),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const o=document.createTextNode(r);return e.parentNode?.replaceChild(o,e),o}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const o=r,c=Array.isArray(o.children)?o.children:[],a=o._startNode??document.createTextNode(""),p=o._endNode??document.createTextNode("");o.key!=null&&(a.key=`${o.key}:start`,p.key=`${o.key}:end`),o._startNode=a,o._endNode=p;const h=document.createDocumentFragment();h.appendChild(a);for(const x of c){const m=Z(x,n);h.appendChild(m)}return h.appendChild(p),e.parentNode?.replaceChild(h,e),a}if(!r){fe(e,i);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){fe(e,i);const o=Z(r,n,i);return be(r,o,i),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],c=r._startNode??document.createTextNode(""),a=r._endNode??document.createTextNode("");r.key!=null&&(c.key=`${r.key}:start`,a.key=`${r.key}:end`),r._startNode=c,r._endNode=a;const p=document.createDocumentFragment();p.appendChild(c);for(const h of o)p.appendChild(Z(h,n));return p.appendChild(a),e.parentNode?.replaceChild(p,e),c}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return et(o,t.props||{},r.props||{},n),Ut(o,t.children,r.children,n,i),be(r,o,i),o}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&(t.tag&&String(t.tag).includes("-")||r.props&&r.props.isCustomElement||t.props&&t.props.isCustomElement))try{const c=e;return et(c,t.props||{},r.props||{},n),be(r,c,i),c}catch{}fe(e,i);const s=Z(r,n,i);return be(r,s,i),e.parentNode?.replaceChild(s,e),s}function qt(e,t,r,n){let i;Array.isArray(t)?t.length===1?(i=t[0],i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})):i={tag:"div",key:"__root__",children:t}:(i=t,i&&typeof i=="object"&&i.key==null&&(i={...i,key:"__root__"})),i&&typeof i=="object"&&i.tag==="#anchor"&&(i={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[i]}),i=Ke(i,String(i.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let c;s&&o?typeof s!="string"&&typeof i!="string"&&s.tag===i.tag&&s.key===i.key?c=je(o,s,i,r,n):(c=Z(i,r,n),e.replaceChild(c,o)):(c=Z(i,r,n),e.firstChild?e.replaceChild(c,e.firstChild):e.appendChild(c));const a=[];for(let p=0;p<e.childNodes.length;p++){const h=e.childNodes[p];h!==c&&h.nodeName!=="STYLE"&&(fe(h,n),a.push(h))}a.forEach(p=>e.removeChild(p)),e._prevVNode=i,e._prevDom=c}function Te(e){if(typeof e=="string")return ge(e);if(e.tag==="#text")return typeof e.children=="string"?ge(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(Te).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([i,s])=>` ${i}="${ge(String(s))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([i])=>i!=="attrs"&&i!=="directives"&&i!=="ref"&&i!=="key").map(([i,s])=>` ${i}="${ge(String(s))}"`).join(""));const n=Array.isArray(e.children)?e.children.filter(Boolean).map(Te).join(""):typeof e.children=="string"?ge(e.children):e.children?Te(e.children):"";return`<${e.tag}${t}${r}>${n}</${e.tag}>`}function pt(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function gt(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let Se=null;function tt(){return Se||(Se=new CSSStyleSheet,Se.replaceSync(gt(Kt))),Se}function Ft(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Kt=pt`
5
+ :host,
6
+ *,
7
+ ::before,
8
+ ::after {
6
9
  all: isolate;
7
10
  box-sizing: border-box;
8
11
  border: 0 solid currentColor;
@@ -19,47 +22,97 @@
19
22
  font: 16px/1.5 var(--font-sans, ui-sans-serif, system-ui, sans-serif);
20
23
  -webkit-text-size-adjust: 100%;
21
24
  text-size-adjust: 100%;
25
+ /* Default gradient variables to avoid undefined var() usage in generated utilities */
26
+ --tw-gradient-from-position: 0%;
27
+ --tw-gradient-to-position: 100%;
28
+ --tw-gradient-via-position: 50%;
29
+ --tw-gradient-from: rgba(255,255,255,0);
30
+ --tw-gradient-to: rgba(255,255,255,0);
31
+ --tw-gradient-stops: var(--tw-gradient-from), var(--tw-gradient-to);
22
32
  }
23
- button, input, select, textarea {
33
+ button,
34
+ input,
35
+ select,
36
+ textarea {
24
37
  background: transparent;
25
38
  outline: none;
26
39
  }
27
- textarea { resize: vertical }
28
- progress { vertical-align: baseline }
29
- button, textarea { overflow: visible }
30
- img, svg, video, canvas, audio, iframe, embed, object {
40
+ textarea {
41
+ resize: vertical;
42
+ }
43
+ progress {
44
+ vertical-align: baseline;
45
+ }
46
+ button,
47
+ textarea {
48
+ overflow: visible;
49
+ }
50
+ img,
51
+ svg,
52
+ video,
53
+ canvas,
54
+ audio,
55
+ iframe,
56
+ embed,
57
+ object {
31
58
  display: block;
32
59
  max-width: 100%;
33
60
  height: auto;
34
61
  }
35
- svg { fill: currentColor; stroke: none }
36
- a { text-decoration: inherit; cursor: pointer }
37
- button, [type=button], [type=reset], [type=submit] {
62
+ svg {
63
+ fill: currentColor;
64
+ stroke: none;
65
+ }
66
+ a {
67
+ text-decoration: inherit;
68
+ cursor: pointer;
69
+ }
70
+ button,
71
+ [type="button"],
72
+ [type="reset"],
73
+ [type="submit"] {
38
74
  cursor: pointer;
39
75
  appearance: button;
40
76
  background: none;
41
77
  -webkit-user-select: none;
42
78
  user-select: none;
43
79
  }
44
- ::-webkit-input-placeholder, ::placeholder {
45
- color: inherit; opacity: .5;
80
+ ::-webkit-input-placeholder,
81
+ ::placeholder {
82
+ color: inherit;
83
+ opacity: 0.5;
46
84
  }
47
85
  *:focus-visible {
48
86
  outline: 2px solid var(--color-primary-500, #3b82f6);
49
87
  outline-offset: 2px;
50
88
  }
51
- ol, ul { list-style: none }
52
- table { border-collapse: collapse }
53
- sub, sup {
54
- font-size: .75em;
89
+ ol,
90
+ ul {
91
+ list-style: none;
92
+ }
93
+ table {
94
+ border-collapse: collapse;
95
+ }
96
+ sub,
97
+ sup {
98
+ font-size: 0.75em;
55
99
  line-height: 0;
56
100
  position: relative;
57
101
  }
58
- sub { bottom: -.25em }
59
- sup { top: -.5em }
60
- [disabled], [aria-disabled=true] { cursor: not-allowed }
61
- [hidden] { display: none }
62
- `,Bt={neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}},Ut=Object.fromEntries(Object.entries(Bt).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,n])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${n})`]))])),ce="0.25rem",qt={"3xs":64,"2xs":72,xs:80,sm:96,md:112,lg:128,xl:144,"2xl":168,"3xl":192,"4xl":224,"5xl":256,"6xl":288,"7xl":320},Ft=()=>{const e={};for(const[t,r]of Object.entries(qt))e[`max-w-${t}`]=`max-width:calc(${ce} * ${r});`,e[`min-w-${t}`]=`min-width:calc(${ce} * ${r});`,e[`w-${t}`]=`width:calc(${ce} * ${r});`,e[`max-h-${t}`]=`max-height:calc(${ce} * ${r});`,e[`min-h-${t}`]=`min-height:calc(${ce} * ${r});`,e[`h-${t}`]=`height:calc(${ce} * ${r});`;return e},Kt=()=>{const e={},t=[1,2,3,4,5,6,7,8,9,10,11,12];for(const r of t)e[`grid-cols-${r}`]=`grid-template-columns:repeat(${r},minmax(0,1fr));`,e[`grid-rows-${r}`]=`grid-template-rows:repeat(${r},minmax(0,1fr));`,e[`col-span-${r}`]=`grid-column:span ${r} / span ${r};`,e[`row-span-${r}`]=`grid-row:span ${r} / span ${r};`,e[`col-start-${r}`]=`grid-column-start:${r};`,e[`col-end-${r}`]=`grid-column-end:${r};`,e[`row-start-${r}`]=`grid-row-start:${r};`,e[`row-end-${r}`]=`grid-row-end:${r};`;return e["grid-cols-none"]="grid-template-columns:none;",e["grid-rows-none"]="grid-template-rows:none;",e["col-span-full"]="grid-column:1 / -1;",e["row-span-full"]="grid-row:1 / -1;",e["auto-cols-auto"]="grid-auto-columns:auto;",e["auto-cols-min"]="grid-auto-columns:min-content;",e["auto-cols-max"]="grid-auto-columns:max-content;",e["auto-cols-fr"]="grid-auto-columns:1fr;",e["auto-rows-auto"]="grid-auto-rows:auto;",e["auto-rows-min"]="grid-auto-rows:min-content;",e["auto-rows-max"]="grid-auto-rows:max-content;",e["auto-rows-fr"]="grid-auto-rows:1fr;",e["grid-flow-row"]="grid-auto-flow:row;",e["grid-flow-col"]="grid-auto-flow:column;",e["grid-flow-row-dense"]="grid-auto-flow:row dense;",e["grid-flow-col-dense"]="grid-auto-flow:column dense;",e},Vt=()=>{const e={},t=[0,1,2,4,6,8];for(const r of t){const n=`${r}px`;e[`border-${r}`]=`border-width:${n};`,e[`border-s-${r}`]=`border-inline-start-width:${n};`,e[`border-e-${r}`]=`border-inline-end-width:${n};`,e[`border-bs-${r}`]=`border-block-start-width:${n};`,e[`border-be-${r}`]=`border-block-end-width:${n};`,e[`border-x-${r}`]=`border-inline-width:${n};`,e[`border-y-${r}`]=`border-block-width:${n};`,e[`border-t-${r}`]=`border-top-width:${n};`,e[`border-r-${r}`]=`border-right-width:${n};`,e[`border-b-${r}`]=`border-bottom-width:${n};`,e[`border-l-${r}`]=`border-left-width:${n};`}return e.border="border-width:1px;",e["border-t"]="border-top-width:1px;",e["border-r"]="border-right-width:1px;",e["border-b"]="border-bottom-width:1px;",e["border-l"]="border-left-width:1px;",e["border-x"]="border-left-width:1px;border-right-width:1px;",e["border-y"]="border-top-width:1px;border-bottom-width:1px;",e["border-s"]="border-inline-start-width:1px;",e["border-e"]="border-inline-end-width:1px;",e["border-bs"]="border-block-start-width:1px;",e["border-be"]="border-block-end-width:1px;",e},Jt=()=>{const e={},t={none:0,xs:2,sm:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,"4xl":32,full:9999};for(const[r,n]of Object.entries(t)){const i=n===9999?"9999px":`${n/16}rem`;e[`rounded-${r}`]=`border-radius:${i};`,e[`rounded-s-${r}`]=`border-start-start-radius:${i};border-end-start-radius:${i};`,e[`rounded-e-${r}`]=`border-start-end-radius:${i};border-end-end-radius:${i};`,e[`rounded-t-${r}`]=`border-top-left-radius:${i};border-top-right-radius:${i};`,e[`rounded-r-${r}`]=`border-top-right-radius:${i};border-bottom-right-radius:${i};`,e[`rounded-b-${r}`]=`border-bottom-left-radius:${i};border-bottom-right-radius:${i};`,e[`rounded-l-${r}`]=`border-top-left-radius:${i};border-bottom-left-radius:${i};`,e[`rounded-x-${r}`]=`border-top-left-radius:${i};border-bottom-left-radius:${i};border-top-right-radius:${i};border-bottom-right-radius:${i};`,e[`rounded-y-${r}`]=`border-top-left-radius:${i};border-top-right-radius:${i};border-bottom-left-radius:${i};border-bottom-right-radius:${i};`}return e},Le={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","max-w-screen":"max-width:100dvw;","max-h-screen":"max-height:100dvh;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","min-w-screen":"min-width:100dvw;","min-h-screen":"min-height:100dvh;",...Ft(),"m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","overflow-y-auto":"overflow-y:auto;","overflow-y-hidden":"overflow-y:hidden;","overflow-y-visible":"overflow-y:visible;","overflow-y-scroll":"overflow-y:scroll;","overflow-x-auto":"overflow-x:auto;","overflow-x-hidden":"overflow-x:hidden;","overflow-x-visible":"overflow-x:visible;","overflow-x-scroll":"overflow-x:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;",...Kt(),absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",...Vt(),...Jt(),"shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:var(--font-sans, ui-sans-serif,system-ui,sans-serif);","font-serif":"font-family:var(--font-serif, ui-serif,Georgia,serif);","font-mono":"font-family:var(--font-mono, ui-monospace,SFMono-Regular,monospace);","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},Ye={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function G(e,t){let r=0,n=0;for(let i=0;i<e.length;i++){const s=e[i];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")n++;else if(s===")"&&n>0)n--;else if(r===0&&n===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,i)+t+e.slice(i)}return e+t}const Zt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${G(e,":hover")}{${t}}`,focus:(e,t)=>`${G(e,":focus")}{${t}}`,active:(e,t)=>`${G(e,":active")}{${t}}`,disabled:(e,t)=>`${G(e,":disabled")}{${t}}`,visited:(e,t)=>`${G(e,":visited")}{${t}}`,checked:(e,t)=>`${G(e,":checked")}{${t}}`,first:(e,t)=>`${G(e,":first-child")}{${t}}`,last:(e,t)=>`${G(e,":last-child")}{${t}}`,odd:(e,t)=>`${G(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${G(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${G(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${G(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},Me={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},je=["sm","md","lg","xl","2xl"];function We(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const i=n.slice(0,-1).join("-"),s=n[n.length-1],o=parseFloat(s);if(Number.isNaN(o)||!Ye[i])return null;const c=t?"-":"";return Ye[i].map(u=>`${u}:calc(${c}${ce} * ${o});`).join("")}function et(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,i=r>>8&255,s=r&255;return`${n} ${i} ${s}`}function Gt(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,i="DEFAULT"]=t,s=Ut[n]?.[i];if(!s)return null;if(r==="shadow")return`--ce-shadow-color:${s};`;const c={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[r];return c?`${c}:${s};`:null}function Qt(e){const[t,r]=e.split("/");if(!r)return{base:t};const n=parseInt(r,10);return isNaN(n)||n<0||n>100?{base:t}:{base:t,opacity:n/100}}function Ne(e){const{base:t,opacity:r}=Qt(e),n=Gt(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const o=et(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return n}const i=Te(t);if(i&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=et(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return i}function ze(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function Te(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const i=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(i){const s=i[1].trim();let o=i[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let i=e.slice(t+2,-1);i=i.replace(/_/g," ");const s={bg:"background-color",text:"color",shadow:"box-shadow",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top-width","border-b":"border-bottom-width","border-l":"border-left-width","border-r":"border-right-width","border-x":"border-inline-width","border-y":"border-block-width","grid-cols":"grid-template-columns","grid-rows":"grid-template-rows",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",weight:"font-weight",leading:"line-height",z:"z-index"};if(n==="rotate")return`transform:rotate(${i});`;const o=s[n]??n.replace(/_/g,"-");if(o&&i)return`${o}:${i};`}return null}function Xt(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function Yt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function er(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let n;for(;n=t.exec(e);){const i=n[2].split(/\s+/).filter(Boolean);i.length&&r.push(...i)}return r.filter(Boolean)}const tt=new Map,tr=16;function rr(e){const t=Date.now(),r=tt.get(e);if(r&&t-r.timestamp<tr)return r.css;const n=er(e),i=new Set(n),s=[],o=[],c=[],u=[],m={};function g(w,a=!1){const l=(a?"dark|":"")+w;if(l in m)return m[l];const y=h(w,a);return m[l]=y,y}function b(w){const a=w.some(y=>je.includes(y)),l=w.includes("dark");return w.length===0?1:!a&&!l?2:a&&!l?3:4}function p(w){const a=[];let l="",y=0,$=0;for(let k=0;k<w.length;k++){const d=w[k];d==="["?y++:d==="]"&&y>0?y--:d==="("?$++:d===")"&&$>0&&$--,d===":"&&y===0&&$===0?(a.push(l),l=""):l+=d}return l&&a.push(l),a}function f(w){switch(w){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function h(w,a=!1){const l=p(w);let y=!1;const $=l.find(_=>(_.startsWith("!")&&(y=!0,_=_.slice(1)),Le[_]||We(_)||ze(_)||Ne(_)||Te(_)));if(!$)return null;const k=$.replace(/^!/,""),d=Le[k]??We(k)??ze(k)??Ne(k)??Te(k);if(!d)return null;const x=l.indexOf($);let A=x>=0?l.slice(0,x):[];a&&(A=A.filter(_=>_!=="dark"));const C=`.${Yt(w)}`,E="__SUBJECT__",T=y?d.replace(/;$/," !important;"):d;let R=E;const S=[];for(const _ of A)_.startsWith("group-")?(R=`.group:${_.slice(6)} ${R}`,S.push(_)):_.startsWith("peer-")&&(R=R.replace(E,`.peer:${_.slice(5)}~${E}`),S.push(_));A=A.filter(_=>!S.includes(_));const P=[],U=[];let V=null;for(const _ of A){if(_==="dark"||je.includes(_))continue;const q=Xt(_);if(q){V=q;continue}const D=f(_);if(D){V?U.push(D):P.push(D);continue}const N=Zt[_];typeof N=="function"&&(R=N(R,T).split("{")[0])}function ve(_,q){if(!q)return _;let D=0,N=0;if(_.length&&(_[0]===">"||_[0]==="+"||_[0]==="~"||_[0]===" ")){let O=1;for(;O<_.length&&_[O]===" ";)O++;for(;O<_.length;O++){const I=_[O];if(I==="["?D++:I==="]"&&D>0?D--:I==="("?N++:I===")"&&N>0&&N--,D===0&&N===0&&(_[O]===">"||_[O]==="+"||_[O]==="~"||_[O]===" "))return _.slice(0,O)+q+_.slice(O)}return _+q}for(let O=0;O<_.length;O++){const I=_[O];if(I==="["?D++:I==="]"&&D>0?D--:I==="("?N++:I===")"&&N>0&&N--,D===0&&N===0&&(I===">"||I==="+"||I==="~"||I===" "))return _.slice(0,O)+q+_.slice(O)}return _+q}const K=P.join(""),L=U.join("");if(V)if(V.includes("&")){const _=V.indexOf("&"),q=V.slice(0,_),D=V.slice(_+1),N=E+K,O=R;if(P.length===0)R=O.replace(E,q+N+L+D);else{const I=ve(D,L);R=O.replace(E,q+N+I)}}else R=R.replace(E,`${V}${E+K}`),L&&(R=R.replace(E,`${E}${L}`));else R=E+K+L;R=R.replace(new RegExp(E,"g"),C);let j=`${R}{${T}}`;const J=A.filter(_=>je.includes(_)),Z=J.length?J[J.length-1]:null,z=A.includes("dark");return a&&Z?j=`@media (prefers-color-scheme: dark) and ${Me[Z]}{${j}}`:a?j=`@media (prefers-color-scheme: dark){${j}}`:z&&Z?j=`@media (prefers-color-scheme: dark) and ${Me[Z]}{${j}}`:z?j=`@media (prefers-color-scheme: dark){${j}}`:Z&&(j=`@media ${Me[Z]}{${j}}`),j}for(const w of i){const a=p(w),l=a.find(d=>Le[d]||We(d)||ze(d)||Ne(d)||Te(d));if(!l)continue;const y=a.indexOf(l),$=y>=0?a.slice(0,y):[],k=b($);if(k===4){const d=g(w,!0);d&&u.push(d)}else{const d=g(w);d&&(k===1?s.push(d):k===2?o.push(d):k===3&&c.push(d))}}const v=[...s,...o,...c,...u].join("");return tt.set(e,{css:v,timestamp:t}),v}const me=[];function nr(e,t,r,n,i,s,o,c){if(e){me.push(r);try{const u=t.render(r);if(u instanceof Promise){s(!0),u.then(m=>{s(!1),o(null),rt(e,m,r,n,i),c(e.innerHTML)}).catch(m=>{s(!1),o(m)});return}rt(e,u,r,n,i),c(e.innerHTML)}finally{me.pop()}}}function rt(e,t,r,n,i){e&&(Dt(e,Array.isArray(t)?t:[t],r,n),i(e.innerHTML))}function ir(e,t,r,n,i,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(i(r+1),r===15)console.warn(`⚠️ Component is re-rendering rapidly. This might indicate:
102
+ sub {
103
+ bottom: -0.25em;
104
+ }
105
+ sup {
106
+ top: -0.5em;
107
+ }
108
+ [disabled],
109
+ [aria-disabled="true"] {
110
+ cursor: not-allowed;
111
+ }
112
+ [hidden] {
113
+ display: none;
114
+ }
115
+ `,Vt={neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}},mt=Object.fromEntries(Object.entries(Vt).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,n])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${n})`]))])),ue="0.25rem",Jt={"3xs":64,"2xs":72,xs:80,sm:96,md:112,lg:128,xl:144,"2xl":168,"3xl":192,"4xl":224,"5xl":256,"6xl":288,"7xl":320},rt={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]},Zt=()=>{const e={};e["@container"]="container-type:inline-size;",["block","inline","inline-block","flex","inline-flex","grid","inline-grid","table","table-cell","table-row","hidden"].forEach(a=>{e[a]=a==="hidden"?"display:none;":`display:${a};`}),["absolute","relative","fixed","sticky","static"].forEach(a=>{e[a]=`position:${a};`}),Object.assign(e,{"items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-evenly":"align-content:space-evenly;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;","flex-col-reverse":"flex-direction:column-reverse;","flex-row-reverse":"flex-direction:row-reverse;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;"});for(let a=1;a<=12;a++)e[`grid-cols-${a}`]=`grid-template-columns:repeat(${a},minmax(0,1fr));`,e[`grid-rows-${a}`]=`grid-template-rows:repeat(${a},minmax(0,1fr));`,e[`col-span-${a}`]=`grid-column:span ${a} / span ${a};`,e[`row-span-${a}`]=`grid-row:span ${a} / span ${a};`,e[`col-start-${a}`]=`grid-column-start:${a};`,e[`col-end-${a}`]=`grid-column-end:${a};`,e[`row-start-${a}`]=`grid-row-start:${a};`,e[`row-end-${a}`]=`grid-row-end:${a};`;Object.assign(e,{"grid-cols-none":"grid-template-columns:none;","grid-rows-none":"grid-template-rows:none;","col-span-full":"grid-column:1 / -1;","row-span-full":"grid-row:1 / -1;","auto-cols-auto":"grid-auto-columns:auto;","auto-cols-min":"grid-auto-columns:min-content;","auto-cols-max":"grid-auto-columns:max-content;","auto-cols-fr":"grid-auto-columns:1fr;","auto-rows-auto":"grid-auto-rows:auto;","auto-rows-min":"grid-auto-rows:min-content;","auto-rows-max":"grid-auto-rows:max-content;","auto-rows-fr":"grid-auto-rows:1fr;","grid-flow-row":"grid-auto-flow:row;","grid-flow-col":"grid-auto-flow:column;","grid-flow-row-dense":"grid-auto-flow:row dense;","grid-flow-col-dense":"grid-auto-flow:column dense;"}),Object.assign(e,{"text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-justify":"text-align:justify;","font-thin":"font-weight:100;","font-extralight":"font-weight:200;","font-light":"font-weight:300;","font-normal":"font-weight:400;","font-medium":"font-weight:500;","font-semibold":"font-weight:600;","font-bold":"font-weight:700;","font-extrabold":"font-weight:800;","font-black":"font-weight:900;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;","whitespace-normal":"white-space:normal;","whitespace-nowrap":"white-space:nowrap;","whitespace-pre":"white-space:pre;","whitespace-pre-line":"white-space:pre-line;","whitespace-pre-wrap":"white-space:pre-wrap;","break-normal":"overflow-wrap:normal;word-break:normal;","break-words":"overflow-wrap:break-word;","break-all":"word-break:break-all;"}),[["text-xs","0.75rem","1"],["text-sm","0.875rem","1.25"],["text-base","1rem","1.5"],["text-lg","1.125rem","1.75"],["text-xl","1.25rem","1.75"],["text-2xl","1.5rem","2"],["text-3xl","1.875rem","2.25"],["text-4xl","2.25rem","2.5"],["text-5xl","3rem","1"],["text-6xl","3.75rem","1"],["text-7xl","4.5rem","1"],["text-8xl","6rem","1"],["text-9xl","8rem","1"]].forEach(([a,p,h])=>{e[a]=`font-size:${p};line-height:${h};`}),[["tracking-tighter","-0.05em"],["tracking-tight","-0.025em"],["tracking-normal","0em"],["tracking-wide","0.025em"],["tracking-wider","0.05em"],["tracking-widest","0.1em"]].forEach(([a,p])=>{e[a]=`letter-spacing:${p};`}),[["leading-3","0.75rem"],["leading-4","1rem"],["leading-5","1.25rem"],["leading-6","1.5rem"],["leading-7","1.75rem"],["leading-8","2rem"],["leading-9","2.25rem"],["leading-10","2.5rem"],["leading-none","1"],["leading-tight","1.25"],["leading-snug","1.375"],["leading-normal","1.5"],["leading-relaxed","1.625"],["leading-loose","2"]].forEach(([a,p])=>{e[a]=`line-height:${p};`}),Object.assign(e,{"font-sans":"font-family:var(--font-sans, ui-sans-serif,system-ui,sans-serif);","font-serif":"font-family:var(--font-serif, ui-serif,Georgia,serif);","font-mono":"font-family:var(--font-mono, ui-monospace,SFMono-Regular,monospace);"}),[0,1,2,4,6,8].forEach(a=>{const p=`${a}px`;e[`border-${a}`]=`border-width:${p};`,e[`border-t-${a}`]=`border-top-width:${p};`,e[`border-r-${a}`]=`border-right-width:${p};`,e[`border-b-${a}`]=`border-bottom-width:${p};`,e[`border-l-${a}`]=`border-left-width:${p};`,e[`border-x-${a}`]=`border-left-width:${p};border-right-width:${p};`,e[`border-y-${a}`]=`border-top-width:${p};border-bottom-width:${p};`}),e.border="border-width:1px;",e["border-t"]="border-top-width:1px;",e["border-r"]="border-right-width:1px;",e["border-b"]="border-bottom-width:1px;",e["border-l"]="border-left-width:1px;",e["border-x"]="border-left-width:1px;border-right-width:1px;",e["border-y"]="border-top-width:1px;border-bottom-width:1px;",Object.assign(e,{"border-solid":"border-style:solid;","border-dashed":"border-style:dashed;","border-dotted":"border-style:dotted;","border-double":"border-style:double;","border-none":"border-style:none;"}),Object.entries({none:0,xs:2,sm:4,md:6,lg:8,xl:12,"2xl":16,"3xl":24,"4xl":32,full:9999}).forEach(([a,p])=>{const h=p===9999?"9999px":`${p/16}rem`;e[`rounded-${a}`]=`border-radius:${h};`,e[`rounded-t-${a}`]=`border-top-left-radius:${h};border-top-right-radius:${h};`,e[`rounded-r-${a}`]=`border-top-right-radius:${h};border-bottom-right-radius:${h};`,e[`rounded-b-${a}`]=`border-bottom-left-radius:${h};border-bottom-right-radius:${h};`,e[`rounded-l-${a}`]=`border-top-left-radius:${h};border-bottom-left-radius:${h};`,e[`rounded-tl-${a}`]=`border-top-left-radius:${h};`,e[`rounded-tr-${a}`]=`border-top-right-radius:${h};`,e[`rounded-br-${a}`]=`border-bottom-right-radius:${h};`,e[`rounded-bl-${a}`]=`border-bottom-left-radius:${h};`}),Object.assign(e,{"shadow-none":"--ce-shadow-color:rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color:rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));",shadow:"--ce-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color:rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));","shadow-inner":"box-shadow:inset 0 2px 4px 0 rgb(0 0 0 / 0.05);"}),Object.assign(e,{rounded:"border-radius:0.25rem;",shadow:"--ce-shadow-color:rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));"}),Object.assign(e,{"overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","overflow-x-auto":"overflow-x:auto;","overflow-x-hidden":"overflow-x:hidden;","overflow-x-visible":"overflow-x:visible;","overflow-x-scroll":"overflow-x:scroll;","overflow-y-auto":"overflow-y:auto;","overflow-y-hidden":"overflow-y:hidden;","overflow-y-visible":"overflow-y:visible;","overflow-y-scroll":"overflow-y:scroll;"}),Object.assign(e,{"sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;"}),Object.assign(e,{"pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;"}),["auto","default","pointer","wait","text","move","help","not-allowed","grab","grabbing"].forEach(a=>{e[`cursor-${a}`]=`cursor:${a};`}),[0,10,20,30,40,50].forEach(a=>{e[`z-${a}`]=`z-index:${a};`}),Object.assign(e,{visible:"visibility:visible;",invisible:"visibility:hidden;"}),Object.assign(e,{"w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvh;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","max-w-screen":"max-width:100dvw;","max-h-screen":"max-height:100dvh;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","min-w-full":"min-width:100%;","min-h-full":"min-height:100%;","min-w-screen":"min-width:100dvw;","min-h-screen":"min-height:100dvh;","w-auto":"width:auto;","h-auto":"height:auto;","w-fit":"width:fit-content;","h-fit":"height:fit-content;","w-min":"width:min-content;","h-min":"height:min-content;","w-max":"width:max-content;","h-max":"height:max-content;"}),Object.assign(e,{"m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;"}),Object.entries(Jt).forEach(([a,p])=>{e[`max-w-${a}`]=`max-width:calc(${ue} * ${p});`,e[`min-w-${a}`]=`min-width:calc(${ue} * ${p});`,e[`w-${a}`]=`width:calc(${ue} * ${p});`,e[`max-h-${a}`]=`max-height:calc(${ue} * ${p});`,e[`min-h-${a}`]=`min-height:calc(${ue} * ${p});`,e[`h-${a}`]=`height:calc(${ue} * ${p});`}),Object.assign(e,{transition:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-none":"transition-property:none;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","ease-linear":"transition-timing-function:linear;","ease-in":"transition-timing-function:ease-in;","ease-out":"transition-timing-function:ease-out;","ease-in-out":"transition-timing-function:ease-in-out;","duration-75":"transition-duration:75ms;","duration-100":"transition-duration:100ms;","duration-150":"transition-duration:150ms;","duration-200":"transition-duration:200ms;","duration-300":"transition-duration:300ms;","duration-500":"transition-duration:500ms;","duration-700":"transition-duration:700ms;","duration-1000":"transition-duration:1000ms;"}),Object.assign(e,{"scale-0":"transform:scale(0);","scale-50":"transform:scale(0.5);","scale-75":"transform:scale(0.75);","scale-90":"transform:scale(0.9);","scale-95":"transform:scale(0.95);","scale-100":"transform:scale(1);","scale-105":"transform:scale(1.05);","scale-110":"transform:scale(1.1);","scale-125":"transform:scale(1.25);","scale-150":"transform:scale(1.5);","rotate-0":"transform:rotate(0deg);","rotate-1":"transform:rotate(1deg);","rotate-2":"transform:rotate(2deg);","rotate-3":"transform:rotate(3deg);","rotate-6":"transform:rotate(6deg);","rotate-12":"transform:rotate(12deg);","rotate-45":"transform:rotate(45deg);","rotate-90":"transform:rotate(90deg);","rotate-180":"transform:rotate(180deg);","-rotate-1":"transform:rotate(-1deg);","-rotate-2":"transform:rotate(-2deg);","-rotate-3":"transform:rotate(-3deg);","-rotate-6":"transform:rotate(-6deg);","-rotate-12":"transform:rotate(-12deg);","-rotate-45":"transform:rotate(-45deg);","-rotate-90":"transform:rotate(-90deg);","-rotate-180":"transform:rotate(-180deg);"}),Object.assign(e,{"aspect-auto":"aspect-ratio:auto;","aspect-square":"aspect-ratio:1 / 1;","aspect-video":"aspect-ratio:16 / 9;"}),Object.assign(e,{"object-contain":"object-fit:contain;","object-cover":"object-fit:cover;","object-fill":"object-fit:fill;","object-none":"object-fit:none;","object-scale-down":"object-fit:scale-down;","object-bottom":"object-position:bottom;","object-center":"object-position:center;","object-left":"object-position:left;","object-left-bottom":"object-position:left bottom;","object-left-top":"object-position:left top;","object-right":"object-position:right;","object-right-bottom":"object-position:right bottom;","object-right-top":"object-position:right top;","object-top":"object-position:top;"});for(let a=1;a<=6;a++)e[`line-clamp-${a}`]=`display:-webkit-box;-webkit-line-clamp:${a};-webkit-box-orient:vertical;overflow:hidden;`;e["line-clamp-none"]="overflow:visible;display:block;-webkit-box-orient:horizontal;-webkit-line-clamp:none;";for(let a=1;a<=12;a++)e[`order-${a}`]=`order:${a};`;e["order-first"]="order:-9999;",e["order-last"]="order:9999;",e["order-none"]="order:0;";for(let a=0;a<=12;a++)a<=1||(e[`grow-${a}`]=`flex-grow:${a};`,e[`shrink-${a}`]=`flex-shrink:${a};`);return Object.assign(e,{"bg-gradient-to-t":"background-image:linear-gradient(to top, var(--tw-gradient-stops));","bg-gradient-to-tr":"background-image:linear-gradient(to top right, var(--tw-gradient-stops));","bg-gradient-to-r":"background-image:linear-gradient(to right, var(--tw-gradient-stops));","bg-gradient-to-br":"background-image:linear-gradient(to bottom right, var(--tw-gradient-stops));","bg-gradient-to-b":"background-image:linear-gradient(to bottom, var(--tw-gradient-stops));","bg-gradient-to-bl":"background-image:linear-gradient(to bottom left, var(--tw-gradient-stops));","bg-gradient-to-l":"background-image:linear-gradient(to left, var(--tw-gradient-stops));","bg-gradient-to-tl":"background-image:linear-gradient(to top left, var(--tw-gradient-stops));"}),e},We=Zt();function J(e,t){let r=0;for(let n=0;n<e.length;n++){const i=e[n];if(i==="["||i==="(")r++;else if((i==="]"||i===")")&&r>0)r--;else if(r===0&&(i===">"||i==="+"||i==="~"||i===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const Gt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${J(e,":hover")}{${t}}`,focus:(e,t)=>`${J(e,":focus")}{${t}}`,active:(e,t)=>`${J(e,":active")}{${t}}`,disabled:(e,t)=>`${J(e,":disabled")}{${t}}`,visited:(e,t)=>`${J(e,":visited")}{${t}}`,checked:(e,t)=>`${J(e,":checked")}{${t}}`,first:(e,t)=>`${J(e,":first-child")}{${t}}`,last:(e,t)=>`${J(e,":last-child")}{${t}}`,odd:(e,t)=>`${J(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${J(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${J(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${J(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},nt={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Qt={xs:"(min-width:20rem)",sm:"(min-width:24rem)",md:"(min-width:28rem)",lg:"(min-width:32rem)",xl:"(min-width:36rem)","2xl":"(min-width:42rem)","3xl":"(min-width:48rem)","4xl":"(min-width:56rem)","5xl":"(min-width:64rem)","6xl":"(min-width:72rem)","7xl":"(min-width:80rem)"},De=["sm","md","lg","xl","2xl"],Ie=["xs","sm","md","lg","xl","2xl","3xl","4xl","5xl","6xl","7xl"];function Ne(e){const t=e.startsWith("-"),r=t?e.slice(1):e,n=r.lastIndexOf("-");if(n===-1)return null;const i=r.slice(0,n),s=r.slice(n+1),o=parseFloat(s);if(Number.isNaN(o)||!rt[i])return null;const c=t?"-":"";return rt[i].map(a=>`${a}:calc(${c}${ue} * ${o});`).join("")}function it(e){const t=e.replace("#",""),r=parseInt(t,16);return`${r>>16&255} ${r>>8&255} ${r&255}`}const Xt=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/,Yt={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"};function er(e){const t=Xt.exec(e);if(!t)return null;const[,r,n,i="DEFAULT"]=t,s=mt[n]?.[i];if(!s)return null;if(r==="shadow")return`--ce-shadow-color:${s};`;const o=Yt[r];return o?`${o}:${s};`:null}function tr(e){const t=e.indexOf("/");if(t===-1)return{base:e};const r=e.slice(0,t),n=e.slice(t+1),i=parseInt(n,10);return isNaN(i)||i<0||i>100?{base:r}:{base:r,opacity:i/100}}function He(e){const{base:t,opacity:r}=tr(e),n=er(t);if(n&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const o=it(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}if(n)return n;const i=Re(t);if(i&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=it(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return i}function Be(e){const t=/^(from|to|via)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,i="DEFAULT"]=t,s=mt[n]?.[i];if(!s)return null;switch(r){case"from":return`--tw-gradient-from:${s} var(--tw-gradient-from-position);--tw-gradient-to:rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), var(--tw-gradient-to);`;case"to":return`--tw-gradient-to:${s} var(--tw-gradient-to-position);`;case"via":return`--tw-gradient-to:rgb(255 255 255 / 0) var(--tw-gradient-to-position);--tw-gradient-stops:var(--tw-gradient-from), ${s} var(--tw-gradient-via-position), var(--tw-gradient-to);`;default:return null}}function ze(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function Re(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const o=e.slice(1,-1).trim(),c=o.indexOf(":");if(c===-1)return null;const a=o.slice(0,c).trim();let p=o.slice(c+1).trim();return/^[a-zA-Z][a-zA-Z0-9-]*$/.test(a)?(p=p.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),p=p.replace(/^'([^']*)'$/g,'"$1"'),`${a}:${p};`):null}const t=e.indexOf("-[");if(t<=0||!e.endsWith("]"))return null;const r=e.slice(0,t);let n=e.slice(t+2,-1).replace(/_/g," ");const i={bg:"background-color",shadow:"box-shadow",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top-width","border-b":"border-bottom-width","border-l":"border-left-width","border-r":"border-right-width","border-x":"border-inline-width","border-y":"border-block-width","grid-cols":"grid-template-columns","grid-rows":"grid-template-rows",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",leading:"line-height",z:"z-index",opacity:"opacity"};if(r==="text")return/^\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex)$/.test(n)?`font-size:${n};`:`color:${n};`;if(r==="rotate")return`transform:rotate(${n});`;if(r==="scale")return`transform:scale(${n});`;if(r==="translate-x")return`transform:translateX(${n});`;if(r==="translate-y")return`transform:translateY(${n});`;const s=i[r]??r.replace(/_/g,"-");return s&&n?`${s}:${n};`:null}function rr(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function st(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function nr(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let n;for(;n=t.exec(e);){const i=n[2].split(/\s+/).filter(Boolean);i.length&&r.push(...i)}return r}const me=new Map,ir=16,ot=1e3;function sr(e){const t=Date.now(),r=me.get(e);if(r&&t-r.timestamp<ir)return r.css;const n=nr(e);if(!n.length)return"";const i=new Set(n),s=[[],[],[],[]],o={},c=(u,y=!1)=>{const w=y?`dark|${u}`:u;if(w in o)return o[w];const l=x(u,y);return o[w]=l,l},a=u=>{const y=u.some(f=>De.includes(f)),w=u.some(f=>f.startsWith("@")&&(Ie.includes(f.slice(1))||f.match(/^@\[.+\]$/))),l=u.includes("dark");return u.length?!y&&!l&&!w?1:l&&(y||w)?3:2:0},p=u=>{const y=[];let w="",l=0;for(let f=0;f<u.length;f++){const b=u[f];b==="["||b==="("?l++:(b==="]"||b===")")&&l--,b===":"&&l===0?(y.push(w),w=""):w+=b}return w&&y.push(w),y},h={hover:":hover",focus:":focus",active:":active",visited:":visited",disabled:":disabled",checked:":checked",first:":first-child",last:":last-child",odd:":nth-child(odd)",even:":nth-child(even)","focus-within":":focus-within","focus-visible":":focus-visible"},x=(u,y=!1)=>{const w=p(u);let l="",f=!1;for(const E of w){let T=E;if(T.startsWith("!")&&(f=!0,T=T.slice(1)),We[T]||Ne(T)||ze(T)||He(T)||Be(T)||Re(T)){l=E;break}}if(!l)return null;const b=l.replace(/^!/,""),k=We[b]??Ne(b)??ze(b)??He(b)??Be(b)??Re(b);if(!k)return null;const C=w.indexOf(l);let g=C>=0?w.slice(0,C):[];y&&(g=g.filter(E=>E!=="dark"));const $=`.${st(u)}`,O=f?k.replace(/;/g," !important;"):k,v="__SUBJECT__";let _=v;const A=[];for(const E of g)E.startsWith("group-")?(_=`.group:${E.slice(6)} ${_}`,A.push(E)):E.startsWith("peer-")&&(_=_.replace(v,`.peer:${E.slice(5)}~${v}`),A.push(E));g=g.filter(E=>!A.includes(E));const D=[],S=[];let j=null;for(const E of g){if(E==="dark"||De.includes(E)||E.startsWith("@")&&(Ie.includes(E.slice(1))||E.match(/^@\[.+\]$/)))continue;const T=rr(E);if(T){j=T;continue}const R=h[E];if(R){j?S.push(R):D.push(R);continue}const B=Gt[E];typeof B=="function"&&(_=B(_,O).split("{")[0])}const H=D.join(""),re=S.join("");function ke(E,T){if(!T)return E;let R=0,B=0;if(E.length&&(E[0]===">"||E[0]==="+"||E[0]==="~"||E[0]===" ")){let P=1;for(;P<E.length&&E[P]===" ";)P++;for(;P<E.length;P++){const z=E[P];if(z==="["?R++:z==="]"&&R>0?R--:z==="("?B++:z===")"&&B>0&&B--,R===0&&B===0&&(E[P]===">"||E[P]==="+"||E[P]==="~"||E[P]===" "))return E.slice(0,P)+T+E.slice(P)}return E+T}for(let P=0;P<E.length;P++){const z=E[P];if(z==="["?R++:z==="]"&&R>0?R--:z==="("?B++:z===")"&&B>0&&B--,R===0&&B===0&&(z===">"||z==="+"||z==="~"||z===" "))return E.slice(0,P)+T+E.slice(P)}return E+T}if(j)if(j.includes("&")){const E=j.indexOf("&"),T=j.slice(0,E),R=j.slice(E+1),B=v+H;if(D.length===0)_=_.replace(v,T+B+re+R);else{const P=ke(R,re);_=_.replace(v,T+B+P)}}else _=_.replace(v,`${j}${v+H}`),re&&(_=_.replace(v,`${v}${re}`));else _=_.replace(v,v+H+re);_=_.replace(new RegExp(v,"g"),$);let N=`${_}{${O}}`;const W=g.filter(E=>De.includes(E)),V=g.filter(E=>E.startsWith("@")&&(Ie.includes(E.slice(1))||E.match(/^@\[.+\]$/))),K=W.length?W[W.length-1]:null,G=V.length?V[V.length-1]:null,I=g.includes("dark");let Q="",ne="";if(I&&K?Q=`@media (prefers-color-scheme: dark) and ${nt[K]}`:I?Q="@media (prefers-color-scheme: dark)":K&&(Q=`@media ${nt[K]}`),G)if(G.startsWith("@[")&&G.endsWith("]")){const E=G.slice(2,-1);if(!/^-?\d*\.?\d+(px|rem|em|%|vh|vw|ch|ex|cm|mm|in|pt|pc)$/.test(E))return null;ne=`@container (min-width:${E})`}else{const E=G.slice(1);ne=`@container ${Qt[E]||`(min-width:${E})`}`}return Q&&ne?N=`${Q}${ne}{${N}}`:Q?N=`${Q}{${N}}`:ne&&(N=`${ne}{${N}}`),N};for(const u of i){const y=p(u),w=y.find(C=>We[C.replace(/^!/,"")]||Ne(C.replace(/^!/,""))||ze(C.replace(/^!/,""))||He(C.replace(/^!/,""))||Be(C.replace(/^!/,""))||Re(C.replace(/^!/,"")));if(!w)continue;const l=y.indexOf(w),f=l>=0?y.slice(0,l):[],b=a(f),k=c(u);k&&s[b].push(k)}const m=/^(from|via|to)-[a-z]+-?\d{2,3}?$/;for(const u of i)if(m.test(u)){if(s.flat().join("").includes(`.${st(u)}`))continue;const w=c(u);w&&s[0].push(w)}const d=s.flat().join("");return me.size>=ot&&Array.from(me.keys()).slice(0,Math.floor(ot/2)).forEach(y=>me.delete(y)),me.set(e,{css:d,timestamp:t}),d}const we=[];function or(e,t,r,n,i,s,o,c){if(e){we.push(r);try{const a=t.render(r);if(a instanceof Promise){s(!0),a.then(p=>{s(!1),o(null),at(e,p,r,n,i),c(e.innerHTML)}).catch(p=>{s(!1),o(p)});return}at(e,a,r,n,i),c(e.innerHTML)}finally{we.pop()}}}function at(e,t,r,n,i){e&&(qt(e,Array.isArray(t)?t:[t],r,n),i(e.innerHTML))}function ar(e,t,r,n,i,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(i(r+1),r===15)console.warn(`⚠️ Component is re-rendering rapidly. This might indicate:
63
116
  Common causes:
64
117
  • Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
65
118
  • State modification during render
@@ -67,28 +120,28 @@
67
120
  Component rendering will be throttled to prevent browser freeze.`);else if(r>20){console.error(`🛑 Infinite loop detected in component render:
68
121
  • This might be caused by state updates during render
69
122
  • Ensure all state modifications are done in event handlers or effects
70
- Stopping runaway component render to prevent browser freeze`),o(null);return}}else i(0);const m=setTimeout(()=>{n(Date.now()),e(),o(null)},r>10?100:0);o(m)}function sr(e,t,r,n,i){if(!e)return;const s=rr(r);if((!s||s.trim()==="")&&!t._computedStyle){i(null),e.adoptedStyleSheets=[Xe()];return}let o="";t._computedStyle&&(o=t._computedStyle);let c=It(`${o}
123
+ Stopping runaway component render to prevent browser freeze`),o(null);return}}else i(0);const p=setTimeout(()=>{n(Date.now()),e(),o(null)},r>10?100:0);o(p)}function cr(e,t,r,n,i){if(!e)return;const s=sr(r);if((!s||s.trim()==="")&&!t._computedStyle){i(null),e.adoptedStyleSheets=[tt()];return}let o="";t._computedStyle&&(o=t._computedStyle);let c=Ft(`${o}
71
124
  ${s}
72
- `);c=ut(c);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==c)&&u.replaceSync(c),e.adoptedStyleSheets=[Xe(),u],i(u)}let W=null;function or(e){W=e}function ar(){W=null}function cr(){if(!W)throw new Error("useEmit must be called during component render");const e=W.emit;return(t,r)=>e(t,r)}function be(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function lr(e){if(!W)throw new Error("useOnConnected must be called during component render");be(W),W._hookCallbacks.onConnected=e}function ur(e){if(!W)throw new Error("useOnDisconnected must be called during component render");be(W),W._hookCallbacks.onDisconnected=e}function fr(e){if(!W)throw new Error("useOnAttributeChanged must be called during component render");be(W),W._hookCallbacks.onAttributeChanged=e}function dr(e){if(!W)throw new Error("useOnError must be called during component render");be(W),W._hookCallbacks.onError=e}function hr(e){if(!W)throw new Error("useStyle must be called during component render");be(W);try{const t=e();Object.defineProperty(W,"_computedStyle",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(t){console.warn("Error in useStyle callback:",t),Object.defineProperty(W,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const Oe=new Map,nt=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[nt]||(e[nt]=Oe)}function pr(e,t){if(!t.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=Oe.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_componentId",{value:this._componentId,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_triggerWatchers",{value:(i,s)=>this._triggerWatchers(i,s),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(i,s,o)=>{const c=new CustomEvent(i,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(c),!c.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const n=Oe.get(e)||t;Object.keys(n).forEach(i=>{const s=n[i];typeof s=="function"&&(this.context[i]=(...o)=>s(...o,this.context))}),this._applyComputed(n),n.props&&Object.keys(n.props).forEach(i=>{let s=this[i];Object.defineProperty(this,i,{get(){return s},set(o){const c=s;s=o,this.context[i]=o,this._initializing||(this._applyProps(n),c!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(n),this._applyProps(n),this._render(n)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),At(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Tt(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,n,i){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),n!==i&&this._requestRender(),Rt(t,r,n,i,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(re):[]}_applyComputed(r){}_render(r){this._runLogicWithinErrorBoundary(r,()=>{nr(this.shadowRoot,r,this.context,this._refs,n=>{this._lastHtmlStringForJitCSS=n,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(n)},n=>{this._templateLoading=n,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(n)},n=>{this._templateError=n,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(n)},n=>this._applyStyle(r,n))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{fe(()=>{ir(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})},this._componentId)})}_applyStyle(r,n){this._runLogicWithinErrorBoundary(r,()=>{sr(this.shadowRoot,this.context,n,this._styleSheet,i=>{this._styleSheet=i})})}_runLogicWithinErrorBoundary(r,n){this._hasError&&(this._hasError=!1);try{n()}catch(i){this._hasError=!0,r.onError&&r.onError(i,this.context)}}_initContext(r){try{let n=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(c,u,m){const g=Reflect.get(c,u,m);return typeof g=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...p){const f=g.apply(c,p);if(!i._initializing){const h=o||"root";i._triggerWatchers(h,c),fe(()=>i._render(r),i._componentId)}return f}:g},set(c,u,m){if(c[u]=m,!i._initializing){const g=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(g,m),fe(()=>i._render(r),i._componentId)}return!0},deleteProperty(c,u){if(delete c[u],!i._initializing){const m=o?`${o}.${String(u)}`:String(u);i._triggerWatchers(m,void 0),fe(()=>i._render(r),i._componentId)}return!0}}):s&&typeof s=="object"?s.constructor&&s.constructor.name==="ReactiveState"?s:(Object.keys(s).forEach(c=>{const u=o?`${o}.${c}`:c;s[c]=n(s[c],u)}),new Proxy(s,{set(c,u,m){const g=o?`${o}.${String(u)}`:String(u);return c[u]=n(m,g),i._initializing||(i._triggerWatchers(g,c[u]),fe(()=>i._render(r),i._componentId)),!0},get(c,u,m){return Reflect.get(c,u,m)}})):s};const i=this;return n({...r.props?Object.fromEntries(Object.entries(r.props).map(([s,o])=>[s,o.default])):{}})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Ct(this.context,this._watchers,{})})}_triggerWatchers(r,n){_t(this.context,this._watchers,r,n)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{St(this,r,this.context)}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context)}})}}}function Ue(e,t){let r=re(e);r.includes("-")||(r=`cer-${r}`);let n={};if(typeof window<"u")try{const o=t.toString();let c=null;const u=o.indexOf("({");if(u!==-1){let m=0,g=!1,b=null,p=!1,f=-1;for(let h=u+2;h<o.length;h++){const v=o[h];if(p){p=!1;continue}if(v==="\\"){p=!0;continue}if(!g&&(v==='"'||v==="'"||v==="`")){g=!0,b=v;continue}if(g&&v===b){g=!1,b=null;continue}if(!g){if(v==="{")m++;else if(v==="}"){if(m===0){f=h;break}m--}}}if(f!==-1){const h=o.substring(u,f+2),v=o.substring(u+2,f).trim();c=[h,v]}}if(c){const m=c[1];let g="",b="",p=!0,f=0,h=null,v=!1,w=0;for(;w<m.length;){const a=m[w];if(v){p?g+=a:b+=a,v=!1,w++;continue}if(a==="\\"){v=!0,p?g+=a:b+=a,w++;continue}if((a==='"'||a==="'"||a==="`")&&!h){h=a,p?g+=a:b+=a,w++;continue}if(a===h){h=null,p?g+=a:b+=a,w++;continue}if(h){p?g+=a:b+=a,w++;continue}if(a==="{"||a==="["){f++,p?g+=a:b+=a,w++;continue}if(a==="}"||a==="]"){f--,p?g+=a:b+=a,w++;continue}if(a==="="&&f===0&&p){p=!1,w++;continue}if(a===","&&f===0){if(g.trim()&&b.trim()){const l=g.trim(),y=b.trim();try{if(y==="true")n[l]=!0;else if(y==="false")n[l]=!1;else if(y==="[]")n[l]=[];else if(y==="{}")n[l]={};else if(/^\d+$/.test(y))n[l]=parseInt(y);else if(/^'.*'$/s.test(y))n[l]=y.slice(1,-1).replace(/\\'/g,"'").replace(/\\"/g,'"').replace(/\\\//g,"/");else if(/^".*"$/s.test(y))n[l]=y.slice(1,-1).replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\//g,"/");else if(/^`.*`$/s.test(y)){const $=y.slice(1,-1);if($.includes("${"))try{n[l]=new Function(`return \`${$}\`;`)()}catch{n[l]=$}else n[l]=$}else n[l]=y}catch{n[l]=""}}else if(g.trim()){const l=g.split(":")[0].trim();l&&!l.includes("}")&&(n[l]="")}g="",b="",p=!0,w++;continue}p?g+=a:b+=a,w++}if(g.trim()&&b.trim()){const a=g.trim(),l=b.trim();try{if(l==="true")n[a]=!0;else if(l==="false")n[a]=!1;else if(l==="[]")n[a]=[];else if(l==="{}")n[a]={};else if(/^\d+$/.test(l))n[a]=parseInt(l);else if(/^'.*'$/s.test(l))n[a]=l.slice(1,-1).replace(/\\'/g,"'").replace(/\\"/g,'"').replace(/\\\//g,"/");else if(/^".*"$/s.test(l))n[a]=l.slice(1,-1).replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\//g,"/");else if(/^`.*`$/s.test(l)){const y=l.slice(1,-1);if(y.includes("${"))try{n[a]=new Function(`return \`${y}\`;`)()}catch{n[a]=y}else n[a]=y}else n[a]=l}catch{n[a]=""}}else if(g.trim()){const a=g.split(":")[0].trim();a&&!a.includes("}")&&(n[a]="")}}}catch{}let i={};const s={props:Object.fromEntries(Object.entries(n).map(([o,c])=>[o,{type:typeof c=="boolean"?Boolean:typeof c=="number"?Number:typeof c=="string"?String:Function,default:c}])),onConnected:o=>{i.onConnected&&i.onConnected()},onDisconnected:o=>{i.onDisconnected&&i.onDisconnected()},onAttributeChanged:(o,c,u,m)=>{i.onAttributeChanged&&i.onAttributeChanged(o,c,u)},onError:(o,c)=>{i.onError&&o&&i.onError(o)},render:o=>{const c=o._componentId||`${r}-${Math.random().toString(36).substr(2,9)}`;F.setCurrentComponent(c,()=>{o.requestRender&&o.requestRender()});try{or(o);const u=Object.keys(n).length>0;let m;if(u){const g={};Object.keys(n).forEach(b=>{const p=o[b],f=n[b];g[b]=p!=null&&p!==""?p:f}),m=t(g)}else m=t();if(o._hookCallbacks){const g=o._hookCallbacks;g.onConnected&&(i.onConnected=g.onConnected),g.onDisconnected&&(i.onDisconnected=g.onDisconnected),g.onAttributeChanged&&(i.onAttributeChanged=g.onAttributeChanged),g.onError&&(i.onError=g.onError),g.style&&(o._styleCallback=g.style)}return m}finally{ar(),F.clearCurrentComponent()}}};Oe.set(r,s),typeof window<"u"&&(customElements.get(r)||customElements.define(r,pr(r,s)))}class gr{map=new Map;maxSize;constructor(t){this.maxSize=t}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}set(t,r){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,r),this.map.size>this.maxSize){const n=this.map.keys().next().value;n!==void 0&&this.map.delete(n)}}has(t){return this.map.has(t)}clear(){this.map.clear()}}const De=new gr(500);function mr(e,t){if(e==null){console.warn(`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`);return}typeof e!="function"&&console.warn(`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&console.warn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`)}function pe(e,t={},r,n){const i=n??t.key;return{tag:e,key:i,props:t,children:r}}function Re(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function _e(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Re(e)}function yr(e,t){return e.key!=null?e:{...e,key:t}}function br(e,t=[],r={}){const n={},i={},s={},o=[],c=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let u;for(;u=c.exec(e);){const m=u[1],g=u[2],b=(u[4]||u[6])??"",p=b.match(/^{{(\d+)}}$/);let f=p?t[Number(p[1])]??null:b;p||(f==="true"?f=!0:f==="false"?f=!1:f==="null"?f=null:isNaN(Number(f))||(f=Number(f)));const h=["model","bind","show","class","style","ref"];if(m===":"){const[v,w]=g.split(":"),[a,...l]=v.split(".");if(h.includes(a)){const y=[...l],$=a==="model"&&w?`model:${w}`:a;s[$]={value:f,modifiers:y,arg:w}}else{let y=f;y&&te(y)&&(y=y.value),i[g]=y,o.push(g)}}else if(m==="@"){const[v,...w]=g.split("."),a=w;mr(f,v);const l=typeof f=="function"?f:typeof r[f]=="function"?r[f]:void 0;if(l){const y=k=>{if(a.includes("prevent")&&k.preventDefault(),a.includes("stop")&&k.stopPropagation(),!(a.includes("self")&&k.target!==k.currentTarget))return a.includes("once")&&k.currentTarget?.removeEventListener(v,y),l(k)},$="on"+v.charAt(0).toUpperCase()+v.slice(1);n[$]=y}}else g==="ref"?n.ref=f:i[g]=f}return{props:n,attrs:i,directives:s,bound:o}}function wr(e,t,r){const n=me.length>0?me[me.length-1]:void 0,i=r??n,s=!r&&t.length===0,o=s?e.join("<!--TEMPLATE_DELIM-->"):null;if(s&&o){const d=De.get(o);if(d)return d}function c(d,x){return pe("#text",{},d,x)}let u="";for(let d=0;d<e.length;d++)u+=e[d],d<t.length&&(u+=`{{${d}}}`);const m=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,g=[];let b,p=[],f=null,h={},v,w=0,a=[];function l(d){!d||typeof d!="object"||Re(d)||(d.props||d.attrs?(d.props&&(h.props||(h.props={}),Object.assign(h.props,d.props)),d.attrs&&(h.attrs||(h.attrs={}),Object.keys(d.attrs).forEach(x=>{if(x==="style"&&h.attrs.style){const A=h.attrs.style.replace(/;?\s*$/,""),C=d.attrs.style.replace(/^;?\s*/,"");h.attrs.style=A+"; "+C}else if(x==="class"&&h.attrs.class){const A=h.attrs.class.trim().split(/\s+/).filter(Boolean),C=d.attrs.class.trim().split(/\s+/).filter(Boolean),E=[...new Set([...A,...C])];h.attrs.class=E.join(" ")}else h.attrs[x]=d.attrs[x]}))):(h.props||(h.props={}),Object.assign(h.props,d)))}function y(d,x){const A=f?p:a;if(Re(d)){const C=d.key??x;let E=d.children;A.push({...d,key:C,children:E});return}if(_e(d)){A.push(yr(d,void 0));return}if(Array.isArray(d)){if(d.length===0)return;for(let C=0;C<d.length;C++){const E=d[C];Re(E)||_e(E)||Array.isArray(E)?y(E,`${x}-${C}`):E!==null&&typeof E=="object"?l(E):A.push(c(String(E),`${x}-${C}`))}return}if(d!==null&&typeof d=="object"){l(d);return}A.push(c(String(d),x))}const $=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;b=m.exec(u);)if(!(b[0].startsWith("<!--")&&b[0].endsWith("-->"))){if(b[1]){const d=b[1],x=b[0][1]==="/",A=b[0][b[0].length-2]==="/"||$.has(d),{props:C,attrs:E,directives:T,bound:R}=br(b[2]||"",t,i),S={props:{},attrs:{}};for(const P in C)S.props[P]=C[P];for(const P in E)S.attrs[P]=E[P];if(S.attrs&&Object.prototype.hasOwnProperty.call(S.attrs,"key")&&!(S.props&&Object.prototype.hasOwnProperty.call(S.props,"key")))try{S.props.key=S.attrs.key}catch{}try{const P={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},U=d.toLowerCase(),V=P[U]??[];if(S.attrs){for(const K of V)if(R&&R.includes(K)&&K in S.attrs&&!(S.props&&K in S.props)){let L=S.attrs[K];L&&te(L)&&(L=L.value),S.props[K]=L,delete S.attrs[K]}}if((d.includes("-")||!!i?.__customElements?.has?.(d))&&(S.isCustomElement=!0,R&&S.attrs)){const K=new Set(["id","name","data-key","key"]);for(const L of R)if(L in S.attrs&&!(S.props&&L in S.props)){const j=L.includes("-")?L.split("-").map((Z,z)=>z===0?Z:Z.charAt(0).toUpperCase()+Z.slice(1)).join(""):L;let J=S.attrs[L];J&&te(J)&&(J=J.value),S.props[j]=J,K.has(L)||delete S.attrs[L]}}}catch{}if(T&&Object.keys(T).some(P=>P==="model"||P.startsWith("model:")))try{const P=Symbol.for("cer.registry"),U=globalThis[P],V=!!(U&&typeof U.has=="function"&&U.has(d)),ve=!!(i&&(i.__customElements instanceof Set&&i.__customElements.has(d)||Array.isArray(i.__isCustomElements)&&i.__isCustomElements.includes(d)));if(!!(d.includes("-")||ve||V))for(const j of Object.keys(T)){if(j!=="model"&&!j.startsWith("model:"))continue;const J=T[j],Z=J.arg??(j.includes(":")?j.split(":",2)[1]:void 0),z=J.value,_=Z??"modelValue",q=B,D=Ee,N=i?i._state||i:void 0;let O;typeof z=="string"&&i?O=q(N,z):(O=z,O&&te(O)&&(O=O.value)),S.props[_]=O;try{const ne=re(_);S.attrs||(S.attrs={}),O!==void 0&&(S.attrs[ne]=O)}catch{}S.isCustomElement=!0;const Je=`update:${re(_)}`.replace(/-([a-z])/g,(ne,Y)=>Y.toUpperCase()),gt="on"+Je.charAt(0).toUpperCase()+Je.slice(1);S.props[gt]=function(ne){const Y=ne.detail!==void 0?ne.detail:ne.target?ne.target.value:void 0;if(N)if(z&&te(z)){const ae=z.value;(Array.isArray(Y)&&Array.isArray(ae)?JSON.stringify([...Y].sort())!==JSON.stringify([...ae].sort()):Y!==ae)&&(z.value=Y,i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}else{const ae=q(N,typeof z=="string"?z:String(z));(Array.isArray(Y)&&Array.isArray(ae)?JSON.stringify([...Y].sort())!==JSON.stringify([...ae].sort()):Y!==ae)&&(D(N,typeof z=="string"?z:String(z),Y),i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}},delete T[j]}}catch{}if(Object.keys(T).length>0&&(S.directives={...T}),x){const P=pe(f,h,p.length===1&&_e(p[0])&&p[0].tag==="#text"?typeof p[0].children=="string"?p[0].children:"":p.length?p:void 0,v),U=g.pop();U?(f=U.tag,h=U.props,v=U.key,p=U.children,p.push(P)):(a.push(P),f=null,h={},v=void 0,p=[])}else A?f?p.push(pe(d,S,void 0,void 0)):a.push(pe(d,S,void 0,void 0)):(f&&g.push({tag:f,props:h,children:p,key:v}),f=d,h=S,p=[])}else if(typeof b[3]<"u"){const d=Number(b[3]),x=t[d],A=`interp-${d}`;y(x,A)}else if(b[4]){const d=b[4],x=f?p:a,A=d.split(/({{\d+}})/);for(const C of A){if(!C)continue;const E=C.match(/^{{(\d+)}}$/);if(E){const T=Number(E[1]),R=t[T],S=`interp-${T}`;y(R,S)}else{const T=`text-${w++}`;x.push(c(C,T))}}}}const k=a.filter(d=>_e(d)&&d.tag==="#text"?typeof d.children=="string"&&d.children.trim()!=="":!0);if(k.length===1){const d=k[0];return s&&o&&De.set(o,d),d}else if(k.length>1){const d=k;return s&&o&&De.set(o,d),d}return pe("div",{},"","fallback-root")}function ie(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return wr(e,t,n)}function we(e,t){return M(e?t:[],"when-block")}function vr(e,t){return e.map((r,n)=>{const i=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return M(t(r,n),`each-${i}`)})}function ft(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return xr(...e)}}}function xr(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[M(n,`whenChain-branch-${t}`)]}return[M([],"whenChain-empty")]}function M(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}function $r(e,t){return we(!e,t)}function kr(e,t){const r=!e||e.length===0;return we(r,t)}function Cr(e,t){const r=!!(e&&e.length>0);return we(r,t)}function _r(e,t,r){const n=[];return e.forEach((i,s)=>{t(i,s)&&n.push({item:i,originalIndex:s})}),n.map(({item:i,originalIndex:s},o)=>{const c=typeof i=="object"&&i!=null?i?.key??i?.id??`filtered-${s}`:`filtered-${s}`;return M(r(i,s,o),`each-where-${c}`)})}function Er(e,t){const r=e?.length??0;return r===0&&t.empty?M(t.empty,"switch-length-empty"):r===1&&t.one?M(t.one(e[0]),"switch-length-one"):t.exactly?.[r]?M(t.exactly[r](e),`switch-length-${r}`):r>1&&t.many?M(t.many(e),"switch-length-many"):M([],"switch-length-fallback")}function Sr(e,t,r){const n=new Map;return e.forEach(i=>{const s=t(i);n.has(s)||n.set(s,[]),n.get(s).push(i)}),Array.from(n.entries()).map(([i,s],o)=>M(r(i,s,o),`each-group-${i}`))}function Ar(e,t,r,n){const i=r*t,s=Math.min(i+t,e.length);return e.slice(i,s).map((c,u)=>{const m=i+u,g=typeof c=="object"&&c!=null?c?.key??c?.id??`page-${m}`:`page-${m}`;return M(n(c,m,u),`each-page-${g}`)})}function Tr(e,t){return e.loading&&t.loading?M(t.loading,"promise-loading"):e.error&&t.error?M(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?M(t.success(e.data),"promise-success"):t.idle?M(t.idle,"promise-idle"):M([],"promise-fallback")}function H(e,t){const r=typeof window<"u"&&window.matchMedia?.(e)?.matches;return we(!!r,t)}const ee={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Ve=["sm","md","lg","xl","2xl"],dt={sm:e=>H(ee.sm,e),md:e=>H(ee.md,e),lg:e=>H(ee.lg,e),xl:e=>H(ee.xl,e),"2xl":e=>H(ee["2xl"],e),dark:e=>H(ee.dark,e),light:e=>H("(prefers-color-scheme: light)",e),touch:e=>H("(hover: none) and (pointer: coarse)",e),mouse:e=>H("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>H("(prefers-reduced-motion: reduce)",e),highContrast:e=>H("(prefers-contrast: high)",e),portrait:e=>H("(orientation: portrait)",e),landscape:e=>H("(orientation: landscape)",e)};function Rr(e,t){const r=[];e.includes("dark")?r.push(ee.dark):e.includes("light")&&r.push("(prefers-color-scheme: light)");const n=e.filter(o=>Ve.includes(o)),i=n[n.length-1];i&&i in ee&&r.push(ee[i]);const s=r.length>0?r.join(" and "):"all";return H(s,t)}function Or(e){const t=[];return e.base&&t.push(M(e.base,"responsive-base")),Ve.forEach(r=>{const n=e[r];n&&t.push(dt[r](n))}),t}function Pr(e){const t=[];let r=null;return{case(n,i){const s=typeof n=="function"?n:o=>o===n;return t.push({condition:s,content:i}),this},when(n,i){return t.push({condition:n,content:i}),this},otherwise(n){return r=n,this},done(){for(let n=0;n<t.length;n++){const{condition:i,content:s}=t[n];if(i(e))return M(s,`switch-case-${n}`)}return M(r||[],"switch-otherwise")}}}class ue extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return ue.instance||(ue.instance=new ue),ue.instance}emit(t,r){const n=Date.now(),i=this.eventCounters.get(t);if(!i||n-i.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(i.count++,i.count>50&&i.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(r)}catch(c){se(`Error in global event handler for "${t}":`,c)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const n=this.handlers[t];n&&n.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,n){return this.addEventListener(t,r,n),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(n=>{const i=this.on(t,s=>{i(),r(s),n(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const de=ue.getInstance(),Lr=(e,t)=>de.emit(e,t),Mr=(e,t)=>de.on(e,t),jr=(e,t)=>de.off(e,t),Wr=(e,t)=>de.once(e,t),Nr=(e,t,r)=>de.listen(e,t,r);function qe(e){let t={...e};const r=[];function n(c){r.push(c),c(t)}function i(){return t}function s(c){const u=typeof c=="function"?c(t):c;t={...t,...u},o()}function o(){r.forEach(c=>c(t))}return{subscribe:n,getState:i,setState:s}}const Fe=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},X=(e,t)=>{for(const r of e){const n=[],i=r.path.replace(/:[^/]+/g,c=>(n.push(c.slice(1)),"([^/]+)")),s=new RegExp(`^${i}$`),o=t.match(s);if(o){const c={};return n.forEach((u,m)=>{c[u]=o[m+1]}),{route:r,params:c}}}return{route:null,params:{}}},Ie={};async function ht(e){if(e.component)return e.component;if(e.load){if(Ie[e.path])return Ie[e.path];try{const t=await e.load();return Ie[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function pt(e){const{routes:t,base:r="",initialUrl:n}=e;let i,s,o,c,u,m,g;const b=async(v,w)=>{const a=t.find(l=>X([l],v.path).route!==null);if(a?.beforeEnter)try{const l=await a.beforeEnter(v,w);return typeof l=="string"?(await h(l,!0),!1):l!==!1}catch(l){return se("beforeEnter error",l),!1}return!0},p=async(v,w)=>{const a=t.find(l=>X([l],v.path).route!==null);if(a?.onEnter)try{const l=await a.onEnter(v,w);return typeof l=="string"?(await h(l,!0),!1):l!==!1}catch(l){return se("onEnter error",l),!1}return!0},f=(v,w)=>{const a=t.find(l=>X([l],v.path).route!==null);if(a?.afterEnter)try{a.afterEnter(v,w)}catch(l){se("afterEnter error",l)}},h=async(v,w=!1)=>{try{const a={path:v.replace(r,"")||"/",query:{}},l=X(t,a.path);if(!l)throw new Error(`No route found for ${a.path}`);const y=o.getState(),$={path:a.path,params:l.params,query:a.query};if(!await b($,y)||!await p($,y))return;typeof window<"u"&&typeof document<"u"&&(w?window.history.replaceState({},"",r+v):window.history.pushState({},"",r+v)),o.setState($),f($,y)}catch(a){se("Navigation error:",a)}};if(typeof window<"u"&&typeof document<"u"&&typeof n>"u"){i=()=>{const w=new URL(window.location.href),a=w.pathname.replace(r,"")||"/",l=Fe(w.search);return{path:a,query:l}},s=i();const v=X(t,s.path);o=qe({path:s.path,params:v.params,query:s.query}),c=async(w=!1)=>{const a=i();await h(a.path,w)},window.addEventListener("popstate",()=>c(!0)),u=w=>h(w,!1),m=w=>h(w,!0),g=()=>window.history.back()}else{i=()=>{const a=new URL(n||"/","http://localhost"),l=a.pathname.replace(r,"")||"/",y=Fe(a.search);return{path:l,query:y}},s=i();const v=X(t,s.path);o=qe({path:s.path,params:v.params,query:s.query}),c=async()=>{const a=i();await w(a.path)};const w=async a=>{try{const l={path:a.replace(r,"")||"/",query:{}},y=X(t,l.path);if(!y)throw new Error(`No route found for ${l.path}`);const $=o.getState(),k={path:l.path,params:y.params,query:l.query},d=t.find(x=>X([x],k.path).route!==null);if(d?.beforeEnter)try{const x=await d.beforeEnter(k,$);if(typeof x=="string"){await w(x);return}if(x===!1)return}catch{return}if(d?.onEnter)try{const x=await d.onEnter(k,$);if(typeof x=="string"){await w(x);return}if(x===!1)return}catch{return}if(o.setState(k),d?.afterEnter)try{d.afterEnter(k,$)}catch{}}catch{}};u=async a=>w(a),m=async a=>w(a),g=()=>{}}return{store:o,push:u,replace:m,back:g,subscribe:o.subscribe,matchRoute:v=>X(t,v),getCurrent:()=>o.getState(),resolveRouteComponent:ht}}function zr(e,t){return X(e,t)}function Dr(e){const t=pt(e);return Ue("router-view",(r={},n={})=>{const{onConnected:i}=n;if(i&&i(()=>{t&&typeof t.subscribe=="function"&&t.subscribe(()=>{})}),!t)return ie`<div>Router not initialized.</div>`;const s=t.getCurrent(),{path:o}=s,c=t.matchRoute(o);return c.route?t.resolveRouteComponent(c.route).then(u=>{if(typeof u=="string")return{tag:u,props:{},children:[]};if(typeof u=="function"){const m=u();return(m instanceof Promise?m:Promise.resolve(m)).then(b=>typeof b=="string"?{tag:b,props:{},children:[]}:b)}return ie`<div>Invalid route component</div>`}).catch(()=>ie`<div>Invalid route component</div>`):ie`<div>Not found</div>`}),Ue("router-link",(r={},n={})=>{const{to:i="",tag:s="a",replace:o=!1,exact:c=!1,activeClass:u="active",exactActiveClass:m="exact-active",ariaCurrentValue:g="page",disabled:b=!1,external:p=!1,class:f=""}=r,h=t.getCurrent(),v=h.path===i,w=c?v:h&&typeof h.path=="string"?h.path.startsWith(i):!1,a=v?`aria-current="${g}"`:"",l=(f||"").split(/\s+/).filter(Boolean),y={};for(const C of l)y[C]=!0;const $={...y,[u]:w,[m]:v},k=s==="button",d=b?k?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",x=p&&(s==="a"||!s)?'target="_blank" rel="noopener noreferrer"':"",A=C=>{if(b){C.preventDefault();return}p&&(s==="a"||!s)||(C.preventDefault(),o?t.replace(i):t.push(i))};return ie`
73
- ${ft().when(k,ie`
125
+ `);c=gt(c);let a=n;a||(a=new CSSStyleSheet),(a.cssRules.length===0||a.toString()!==c)&&a.replaceSync(c),e.adoptedStyleSheets=[tt(),a],i(a)}let M=null;function lr(e){M=e}function ur(){M=null}function fr(){if(!M)throw new Error("useEmit must be called during component render");const e=M.emit;return(t,r)=>e(t,r)}function ve(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function dr(e){if(!M)throw new Error("useOnConnected must be called during component render");ve(M),M._hookCallbacks.onConnected=e}function hr(e){if(!M)throw new Error("useOnDisconnected must be called during component render");ve(M),M._hookCallbacks.onDisconnected=e}function pr(e){if(!M)throw new Error("useOnAttributeChanged must be called during component render");ve(M),M._hookCallbacks.onAttributeChanged=e}function gr(e){if(!M)throw new Error("useOnError must be called during component render");ve(M),M._hookCallbacks.onError=e}function mr(e){if(!M)throw new Error("useStyle must be called during component render");ve(M);try{const t=e();Object.defineProperty(M,"_computedStyle",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(t){console.warn("Error in useStyle callback:",t),Object.defineProperty(M,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const Le=new Map,ct=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[ct]||(e[ct]=Le)}function yr(e,t){if(!t.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)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_componentId",{value:this._componentId,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_triggerWatchers",{value:(i,s)=>this._triggerWatchers(i,s),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(i,s,o)=>{const c=new CustomEvent(i,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(c),!c.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const n=Le.get(e)||t;Object.keys(n).forEach(i=>{const s=n[i];typeof s=="function"&&(this.context[i]=(...o)=>s(...o,this.context))}),this._applyComputed(n),n.props&&Object.keys(n.props).forEach(i=>{let s=this[i];Object.defineProperty(this,i,{get(){return s},set(o){const c=s;s=o,this.context[i]=o,this._initializing||(this._applyProps(n),c!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(n),this._applyProps(n),this._render(n)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),Pt(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Lt(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,n,i){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),n!==i&&this._requestRender(),Mt(t,r,n,i,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(ie):[]}_applyComputed(r){}_render(r){this._runLogicWithinErrorBoundary(r,()=>{or(this.shadowRoot,r,this.context,this._refs,n=>{this._lastHtmlStringForJitCSS=n,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(n)},n=>{this._templateLoading=n,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(n)},n=>{this._templateError=n,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(n)},n=>this._applyStyle(r,n))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{he(()=>{ar(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})},this._componentId)})}_applyStyle(r,n){this._runLogicWithinErrorBoundary(r,()=>{cr(this.shadowRoot,this.context,n,this._styleSheet,i=>{this._styleSheet=i})})}_runLogicWithinErrorBoundary(r,n){this._hasError&&(this._hasError=!1);try{n()}catch(i){this._hasError=!0,r.onError&&r.onError(i,this.context)}}_initContext(r){try{let n=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(c,a,p){const h=Reflect.get(c,a,p);return typeof h=="function"&&typeof a=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(a)?function(...m){const d=h.apply(c,m);if(!i._initializing){const u=o||"root";i._triggerWatchers(u,c),he(()=>i._render(r),i._componentId)}return d}:h},set(c,a,p){if(c[a]=p,!i._initializing){const h=o?`${o}.${String(a)}`:String(a);i._triggerWatchers(h,p),he(()=>i._render(r),i._componentId)}return!0},deleteProperty(c,a){if(delete c[a],!i._initializing){const p=o?`${o}.${String(a)}`:String(a);i._triggerWatchers(p,void 0),he(()=>i._render(r),i._componentId)}return!0}}):s&&typeof s=="object"?s.constructor&&s.constructor.name==="ReactiveState"?s:(Object.keys(s).forEach(c=>{const a=o?`${o}.${c}`:c;s[c]=n(s[c],a)}),new Proxy(s,{set(c,a,p){const h=o?`${o}.${String(a)}`:String(a);return c[a]=n(p,h),i._initializing||(i._triggerWatchers(h,c[a]),he(()=>i._render(r),i._componentId)),!0},get(c,a,p){return Reflect.get(c,a,p)}})):s};const i=this;return n({...r.props?Object.fromEntries(Object.entries(r.props).map(([s,o])=>[s,o.default])):{}})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Ot(this.context,this._watchers,{})})}_triggerWatchers(r,n){jt(this.context,this._watchers,r,n)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Rt(this,r,this.context)}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context)}})}}}function Ve(e,t){let r=ie(e);r.includes("-")||(r=`cer-${r}`);let n={};if(typeof window<"u")try{const o=t.toString();let c=null;const a=o.indexOf("({");if(a!==-1){let p=0,h=!1,x=null,m=!1,d=-1;for(let u=a+2;u<o.length;u++){const y=o[u];if(m){m=!1;continue}if(y==="\\"){m=!0;continue}if(!h&&(y==='"'||y==="'"||y==="`")){h=!0,x=y;continue}if(h&&y===x){h=!1,x=null;continue}if(!h){if(y==="{")p++;else if(y==="}"){if(p===0){d=u;break}p--}}}if(d!==-1){const u=o.substring(a,d+2),y=o.substring(a+2,d).trim();c=[u,y]}}if(c){const p=c[1];let h="",x="",m=!0,d=0,u=null,y=!1,w=0;for(;w<p.length;){const l=p[w];if(y){m?h+=l:x+=l,y=!1,w++;continue}if(l==="\\"){y=!0,m?h+=l:x+=l,w++;continue}if((l==='"'||l==="'"||l==="`")&&!u){u=l,m?h+=l:x+=l,w++;continue}if(l===u){u=null,m?h+=l:x+=l,w++;continue}if(u){m?h+=l:x+=l,w++;continue}if(l==="{"||l==="["){d++,m?h+=l:x+=l,w++;continue}if(l==="}"||l==="]"){d--,m?h+=l:x+=l,w++;continue}if(l==="="&&d===0&&m){m=!1,w++;continue}if(l===","&&d===0){if(h.trim()&&x.trim()){const f=h.trim(),b=x.trim();try{if(b==="true")n[f]=!0;else if(b==="false")n[f]=!1;else if(b==="[]")n[f]=[];else if(b==="{}")n[f]={};else if(/^\d+$/.test(b))n[f]=parseInt(b);else if(/^'.*'$/s.test(b))n[f]=b.slice(1,-1).replace(/\\'/g,"'").replace(/\\"/g,'"').replace(/\\\//g,"/");else if(/^".*"$/s.test(b))n[f]=b.slice(1,-1).replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\//g,"/");else if(/^`.*`$/s.test(b)){const k=b.slice(1,-1);if(k.includes("${"))try{n[f]=new Function(`return \`${k}\`;`)()}catch{n[f]=k}else n[f]=k}else n[f]=b}catch{n[f]=""}}else if(h.trim()){const f=h.split(":")[0].trim();f&&!f.includes("}")&&(n[f]="")}h="",x="",m=!0,w++;continue}m?h+=l:x+=l,w++}if(h.trim()&&x.trim()){const l=h.trim(),f=x.trim();try{if(f==="true")n[l]=!0;else if(f==="false")n[l]=!1;else if(f==="[]")n[l]=[];else if(f==="{}")n[l]={};else if(/^\d+$/.test(f))n[l]=parseInt(f);else if(/^'.*'$/s.test(f))n[l]=f.slice(1,-1).replace(/\\'/g,"'").replace(/\\"/g,'"').replace(/\\\//g,"/");else if(/^".*"$/s.test(f))n[l]=f.slice(1,-1).replace(/\\"/g,'"').replace(/\\'/g,"'").replace(/\\\//g,"/");else if(/^`.*`$/s.test(f)){const b=f.slice(1,-1);if(b.includes("${"))try{n[l]=new Function(`return \`${b}\`;`)()}catch{n[l]=b}else n[l]=b}else n[l]=f}catch{n[l]=""}}else if(h.trim()){const l=h.split(":")[0].trim();l&&!l.includes("}")&&(n[l]="")}}}catch{}let i={};const s={props:Object.fromEntries(Object.entries(n).map(([o,c])=>[o,{type:typeof c=="boolean"?Boolean:typeof c=="number"?Number:typeof c=="string"?String:Function,default:c}])),onConnected:o=>{i.onConnected&&i.onConnected()},onDisconnected:o=>{i.onDisconnected&&i.onDisconnected()},onAttributeChanged:(o,c,a,p)=>{i.onAttributeChanged&&i.onAttributeChanged(o,c,a)},onError:(o,c)=>{i.onError&&o&&i.onError(o)},render:o=>{const c=o._componentId||`${r}-${Math.random().toString(36).substr(2,9)}`;F.setCurrentComponent(c,()=>{o.requestRender&&o.requestRender()});try{lr(o);const a=Object.keys(n).length>0;let p;if(a){const h={};Object.keys(n).forEach(x=>{const m=o[x],d=n[x];h[x]=m!=null&&m!==""?m:d}),p=t(h)}else p=t();if(o._hookCallbacks){const h=o._hookCallbacks;h.onConnected&&(i.onConnected=h.onConnected),h.onDisconnected&&(i.onDisconnected=h.onDisconnected),h.onAttributeChanged&&(i.onAttributeChanged=h.onAttributeChanged),h.onError&&(i.onError=h.onError),h.style&&(o._styleCallback=h.style)}return p}finally{ur(),F.clearCurrentComponent()}}};Le.set(r,s),typeof window<"u"&&(customElements.get(r)||customElements.define(r,yr(r,s)))}class br{map=new Map;maxSize;constructor(t){this.maxSize=t}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}set(t,r){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,r),this.map.size>this.maxSize){const n=this.map.keys().next().value;n!==void 0&&this.map.delete(n)}}has(t){return this.map.has(t)}clear(){this.map.clear()}}const Ue=new br(500);function wr(e,t){if(e==null){console.warn(`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`);return}typeof e!="function"&&console.warn(`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&console.warn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`)}function ye(e,t={},r,n){const i=n??t.key;return{tag:e,key:i,props:t,children:r}}function Pe(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function Ae(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Pe(e)}function xr(e,t){return e.key!=null?e:{...e,key:t}}function vr(e,t=[],r={}){const n={},i={},s={},o=[],c=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=c.exec(e);){const p=a[1],h=a[2],x=(a[4]||a[6])??"",m=x.match(/^{{(\d+)}}$/);let d=m?t[Number(m[1])]??null:x;m||(d==="true"?d=!0:d==="false"?d=!1:d==="null"?d=null:isNaN(Number(d))||(d=Number(d)));const u=["model","bind","show","class","style","ref"];if(p===":"){const[y,w]=h.split(":"),[l,...f]=y.split(".");if(u.includes(l)){const b=[...f],k=l==="model"&&w?`model:${w}`:l;s[k]={value:d,modifiers:b,arg:w}}else{let b=d;b&&te(b)&&(b=b.value),i[h]=b,o.push(h)}}else if(p==="@"){const[y,...w]=h.split("."),l=w;wr(d,y);const f=typeof d=="function"?d:typeof r[d]=="function"?r[d]:void 0;if(f){const b=C=>{if(l.includes("prevent")&&C.preventDefault(),l.includes("stop")&&C.stopPropagation(),!(l.includes("self")&&C.target!==C.currentTarget))return l.includes("once")&&C.currentTarget?.removeEventListener(y,b),f(C)},k="on"+y.charAt(0).toUpperCase()+y.slice(1);n[k]=b}}else h==="ref"?n.ref=d:i[h]=d}return{props:n,attrs:i,directives:s,bound:o}}function $r(e,t,r){const n=we.length>0?we[we.length-1]:void 0,i=r??n,s=!r&&t.length===0,o=s?e.join("<!--TEMPLATE_DELIM-->"):null;if(s&&o){const g=Ue.get(o);if(g)return g}function c(g,$){return ye("#text",{},g,$)}let a="";for(let g=0;g<e.length;g++)a+=e[g],g<t.length&&(a+=`{{${g}}}`);const p=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,h=[];let x,m=[],d=null,u={},y,w=0,l=[];function f(g){!g||typeof g!="object"||Pe(g)||(g.props||g.attrs?(g.props&&(u.props||(u.props={}),Object.assign(u.props,g.props)),g.attrs&&(u.attrs||(u.attrs={}),Object.keys(g.attrs).forEach($=>{if($==="style"&&u.attrs.style){const O=u.attrs.style.replace(/;?\s*$/,""),v=g.attrs.style.replace(/^;?\s*/,"");u.attrs.style=O+"; "+v}else if($==="class"&&u.attrs.class){const O=u.attrs.class.trim().split(/\s+/).filter(Boolean),v=g.attrs.class.trim().split(/\s+/).filter(Boolean),_=[...new Set([...O,...v])];u.attrs.class=_.join(" ")}else u.attrs[$]=g.attrs[$]}))):(u.props||(u.props={}),Object.assign(u.props,g)))}function b(g,$){const O=d?m:l;if(Pe(g)){const v=g.key??$;let _=g.children;O.push({...g,key:v,children:_});return}if(Ae(g)){O.push(xr(g,void 0));return}if(Array.isArray(g)){if(g.length===0)return;for(let v=0;v<g.length;v++){const _=g[v];Pe(_)||Ae(_)||Array.isArray(_)?b(_,`${$}-${v}`):_!==null&&typeof _=="object"?f(_):O.push(c(String(_),`${$}-${v}`))}return}if(g!==null&&typeof g=="object"){f(g);return}O.push(c(String(g),$))}const k=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;x=p.exec(a);)if(!(x[0].startsWith("<!--")&&x[0].endsWith("-->"))){if(x[1]){const g=x[1],$=x[0][1]==="/",O=x[0][x[0].length-2]==="/"||k.has(g),{props:v,attrs:_,directives:A,bound:D}=vr(x[2]||"",t,i),S={props:{},attrs:{}};for(const j in v)S.props[j]=v[j];for(const j in _)S.attrs[j]=_[j];if(S.attrs&&Object.prototype.hasOwnProperty.call(S.attrs,"key")&&!(S.props&&Object.prototype.hasOwnProperty.call(S.props,"key")))try{S.props.key=S.attrs.key}catch{}try{const j={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},H=g.toLowerCase(),re=j[H]??[];if(S.attrs){for(const N of re)if(D&&D.includes(N)&&N in S.attrs&&!(S.props&&N in S.props)){let W=S.attrs[N];W&&te(W)&&(W=W.value),S.props[N]=W,delete S.attrs[N]}}if((g.includes("-")||!!i?.__customElements?.has?.(g))&&(S.isCustomElement=!0,D&&S.attrs)){const N=new Set(["id","name","data-key","key"]);for(const W of D)if(W in S.attrs&&!(S.props&&W in S.props)){const V=W.includes("-")?W.split("-").map((G,I)=>I===0?G:G.charAt(0).toUpperCase()+G.slice(1)).join(""):W;let K=S.attrs[W];K&&te(K)&&(K=K.value),S.props[V]=K,N.has(W)||delete S.attrs[W]}}}catch{}if(A&&Object.keys(A).some(j=>j==="model"||j.startsWith("model:")))try{const j=Symbol.for("cer.registry"),H=globalThis[j],re=!!(H&&typeof H.has=="function"&&H.has(g)),ke=!!(i&&(i.__customElements instanceof Set&&i.__customElements.has(g)||Array.isArray(i.__isCustomElements)&&i.__isCustomElements.includes(g)));if(!!(g.includes("-")||ke||re))for(const V of Object.keys(A)){if(V!=="model"&&!V.startsWith("model:"))continue;const K=A[V],G=K.arg??(V.includes(":")?V.split(":",2)[1]:void 0),I=K.value,Q=G??"modelValue",ne=q,E=Oe,T=i?i._state||i:void 0;let R;typeof I=="string"&&i?R=ne(T,I):(R=I,R&&te(R)&&(R=R.value)),S.props[Q]=R;try{const se=ie(Q);S.attrs||(S.attrs={}),R!==void 0&&(S.attrs[se]=R)}catch{}S.isCustomElement=!0;const P=`update:${ie(Q)}`.replace(/-([a-z])/g,(se,Y)=>Y.toUpperCase()),z="on"+P.charAt(0).toUpperCase()+P.slice(1);S.props[z]=function(se){const Y=se.detail!==void 0?se.detail:se.target?se.target.value:void 0;if(T)if(I&&te(I)){const le=I.value;(Array.isArray(Y)&&Array.isArray(le)?JSON.stringify([...Y].sort())!==JSON.stringify([...le].sort()):Y!==le)&&(I.value=Y,i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}else{const le=ne(T,typeof I=="string"?I:String(I));(Array.isArray(Y)&&Array.isArray(le)?JSON.stringify([...Y].sort())!==JSON.stringify([...le].sort()):Y!==le)&&(E(T,typeof I=="string"?I:String(I),Y),i?.requestRender?i.requestRender():i?._requestRender&&i._requestRender())}},delete A[V]}}catch{}if(Object.keys(A).length>0&&(S.directives={...A}),$){const j=ye(d,u,m.length===1&&Ae(m[0])&&m[0].tag==="#text"?typeof m[0].children=="string"?m[0].children:"":m.length?m:void 0,y),H=h.pop();H?(d=H.tag,u=H.props,y=H.key,m=H.children,m.push(j)):(l.push(j),d=null,u={},y=void 0,m=[])}else O?d?m.push(ye(g,S,void 0,void 0)):l.push(ye(g,S,void 0,void 0)):(d&&h.push({tag:d,props:u,children:m,key:y}),d=g,u=S,m=[])}else if(typeof x[3]<"u"){const g=Number(x[3]),$=t[g],O=`interp-${g}`;b($,O)}else if(x[4]){const g=x[4],$=d?m:l,O=g.split(/({{\d+}})/);for(const v of O){if(!v)continue;const _=v.match(/^{{(\d+)}}$/);if(_){const A=Number(_[1]),D=t[A],S=`interp-${A}`;b(D,S)}else{const A=`text-${w++}`;$.push(c(v,A))}}}}const C=l.filter(g=>Ae(g)&&g.tag==="#text"?typeof g.children=="string"&&g.children.trim()!=="":!0);if(C.length===1){const g=C[0];return s&&o&&Ue.set(o,g),g}else if(C.length>1){const g=C;return s&&o&&Ue.set(o,g),g}return ye("div",{},"","fallback-root")}function oe(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return $r(e,t,n)}function $e(e,t){return L(e?t:[],"when-block")}function kr(e,t){return e.map((r,n)=>{const i=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return L(t(r,n),`each-${i}`)})}function yt(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return Cr(...e)}}}function Cr(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[L(n,`whenChain-branch-${t}`)]}return[L([],"whenChain-empty")]}function L(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}function _r(e,t){return $e(!e,t)}function Er(e,t){const r=!e||e.length===0;return $e(r,t)}function Sr(e,t){const r=!!(e&&e.length>0);return $e(r,t)}function Ar(e,t,r){const n=[];return e.forEach((i,s)=>{t(i,s)&&n.push({item:i,originalIndex:s})}),n.map(({item:i,originalIndex:s},o)=>{const c=typeof i=="object"&&i!=null?i?.key??i?.id??`filtered-${s}`:`filtered-${s}`;return L(r(i,s,o),`each-where-${c}`)})}function Or(e,t){const r=e?.length??0;return r===0&&t.empty?L(t.empty,"switch-length-empty"):r===1&&t.one?L(t.one(e[0]),"switch-length-one"):t.exactly?.[r]?L(t.exactly[r](e),`switch-length-${r}`):r>1&&t.many?L(t.many(e),"switch-length-many"):L([],"switch-length-fallback")}function jr(e,t,r){const n=new Map;return e.forEach(i=>{const s=t(i);n.has(s)||n.set(s,[]),n.get(s).push(i)}),Array.from(n.entries()).map(([i,s],o)=>L(r(i,s,o),`each-group-${i}`))}function Tr(e,t,r,n){const i=r*t,s=Math.min(i+t,e.length);return e.slice(i,s).map((c,a)=>{const p=i+a,h=typeof c=="object"&&c!=null?c?.key??c?.id??`page-${p}`:`page-${p}`;return L(n(c,p,a),`each-page-${h}`)})}function Rr(e,t){return e.loading&&t.loading?L(t.loading,"promise-loading"):e.error&&t.error?L(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?L(t.success(e.data),"promise-success"):t.idle?L(t.idle,"promise-idle"):L([],"promise-fallback")}function U(e,t){const r=typeof window<"u"&&window.matchMedia?.(e)?.matches;return $e(!!r,t)}const ee={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Qe=["sm","md","lg","xl","2xl"],bt={sm:e=>U(ee.sm,e),md:e=>U(ee.md,e),lg:e=>U(ee.lg,e),xl:e=>U(ee.xl,e),"2xl":e=>U(ee["2xl"],e),dark:e=>U(ee.dark,e),light:e=>U("(prefers-color-scheme: light)",e),touch:e=>U("(hover: none) and (pointer: coarse)",e),mouse:e=>U("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>U("(prefers-reduced-motion: reduce)",e),highContrast:e=>U("(prefers-contrast: high)",e),portrait:e=>U("(orientation: portrait)",e),landscape:e=>U("(orientation: landscape)",e)};function Pr(e,t){const r=[];e.includes("dark")?r.push(ee.dark):e.includes("light")&&r.push("(prefers-color-scheme: light)");const n=e.filter(o=>Qe.includes(o)),i=n[n.length-1];i&&i in ee&&r.push(ee[i]);const s=r.length>0?r.join(" and "):"all";return U(s,t)}function Lr(e){const t=[];return e.base&&t.push(L(e.base,"responsive-base")),Qe.forEach(r=>{const n=e[r];n&&t.push(bt[r](n))}),t}function Mr(e){const t=[];let r=null;return{case(n,i){const s=typeof n=="function"?n:o=>o===n;return t.push({condition:s,content:i}),this},when(n,i){return t.push({condition:n,content:i}),this},otherwise(n){return r=n,this},done(){for(let n=0;n<t.length;n++){const{condition:i,content:s}=t[n];if(i(e))return L(s,`switch-case-${n}`)}return L(r||[],"switch-otherwise")}}}class de extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return de.instance||(de.instance=new de),de.instance}emit(t,r){const n=Date.now(),i=this.eventCounters.get(t);if(!i||n-i.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(i.count++,i.count>50&&i.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(r)}catch(c){ae(`Error in global event handler for "${t}":`,c)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const n=this.handlers[t];n&&n.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,n){return this.addEventListener(t,r,n),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(n=>{const i=this.on(t,s=>{i(),r(s),n(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const pe=de.getInstance(),Wr=(e,t)=>pe.emit(e,t),Dr=(e,t)=>pe.on(e,t),Ir=(e,t)=>pe.off(e,t),Nr=(e,t)=>pe.once(e,t),Hr=(e,t,r)=>pe.listen(e,t,r);function Je(e){let t={...e};const r=[];function n(c){r.push(c),c(t)}function i(){return t}function s(c){const a=typeof c=="function"?c(t):c;t={...t,...a},o()}function o(){r.forEach(c=>c(t))}return{subscribe:n,getState:i,setState:s}}const Ze=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},X=(e,t)=>{for(const r of e){const n=[],i=r.path.replace(/:[^/]+/g,c=>(n.push(c.slice(1)),"([^/]+)")),s=new RegExp(`^${i}$`),o=t.match(s);if(o){const c={};return n.forEach((a,p)=>{c[a]=o[p+1]}),{route:r,params:c}}}return{route:null,params:{}}},qe={};async function wt(e){if(e.component)return e.component;if(e.load){if(qe[e.path])return qe[e.path];try{const t=await e.load();return qe[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function xt(e){const{routes:t,base:r="",initialUrl:n}=e;let i,s,o,c,a,p,h;const x=async(y,w)=>{const l=t.find(f=>X([f],y.path).route!==null);if(l?.beforeEnter)try{const f=await l.beforeEnter(y,w);return typeof f=="string"?(await u(f,!0),!1):f!==!1}catch(f){return ae("beforeEnter error",f),!1}return!0},m=async(y,w)=>{const l=t.find(f=>X([f],y.path).route!==null);if(l?.onEnter)try{const f=await l.onEnter(y,w);return typeof f=="string"?(await u(f,!0),!1):f!==!1}catch(f){return ae("onEnter error",f),!1}return!0},d=(y,w)=>{const l=t.find(f=>X([f],y.path).route!==null);if(l?.afterEnter)try{l.afterEnter(y,w)}catch(f){ae("afterEnter error",f)}},u=async(y,w=!1)=>{try{const l={path:y.replace(r,"")||"/",query:{}},f=X(t,l.path);if(!f)throw new Error(`No route found for ${l.path}`);const b=o.getState(),k={path:l.path,params:f.params,query:l.query};if(!await x(k,b)||!await m(k,b))return;typeof window<"u"&&typeof document<"u"&&(w?window.history.replaceState({},"",r+y):window.history.pushState({},"",r+y)),o.setState(k),d(k,b)}catch(l){ae("Navigation error:",l)}};if(typeof window<"u"&&typeof document<"u"&&typeof n>"u"){i=()=>{const w=new URL(window.location.href),l=w.pathname.replace(r,"")||"/",f=Ze(w.search);return{path:l,query:f}},s=i();const y=X(t,s.path);o=Je({path:s.path,params:y.params,query:s.query}),c=async(w=!1)=>{const l=i();await u(l.path,w)},window.addEventListener("popstate",()=>c(!0)),a=w=>u(w,!1),p=w=>u(w,!0),h=()=>window.history.back()}else{i=()=>{const l=new URL(n||"/","http://localhost"),f=l.pathname.replace(r,"")||"/",b=Ze(l.search);return{path:f,query:b}},s=i();const y=X(t,s.path);o=Je({path:s.path,params:y.params,query:s.query}),c=async()=>{const l=i();await w(l.path)};const w=async l=>{try{const f={path:l.replace(r,"")||"/",query:{}},b=X(t,f.path);if(!b)throw new Error(`No route found for ${f.path}`);const k=o.getState(),C={path:f.path,params:b.params,query:f.query},g=t.find($=>X([$],C.path).route!==null);if(g?.beforeEnter)try{const $=await g.beforeEnter(C,k);if(typeof $=="string"){await w($);return}if($===!1)return}catch{return}if(g?.onEnter)try{const $=await g.onEnter(C,k);if(typeof $=="string"){await w($);return}if($===!1)return}catch{return}if(o.setState(C),g?.afterEnter)try{g.afterEnter(C,k)}catch{}}catch{}};a=async l=>w(l),p=async l=>w(l),h=()=>{}}return{store:o,push:a,replace:p,back:h,subscribe:o.subscribe,matchRoute:y=>X(t,y),getCurrent:()=>o.getState(),resolveRouteComponent:wt}}function Br(e,t){return X(e,t)}function zr(e){const t=xt(e);return Ve("router-view",(r={},n={})=>{const{onConnected:i}=n;if(i&&i(()=>{t&&typeof t.subscribe=="function"&&t.subscribe(()=>{})}),!t)return oe`<div>Router not initialized.</div>`;const s=t.getCurrent(),{path:o}=s,c=t.matchRoute(o);return c.route?t.resolveRouteComponent(c.route).then(a=>{if(typeof a=="string")return{tag:a,props:{},children:[]};if(typeof a=="function"){const p=a();return(p instanceof Promise?p:Promise.resolve(p)).then(x=>typeof x=="string"?{tag:x,props:{},children:[]}:x)}return oe`<div>Invalid route component</div>`}).catch(()=>oe`<div>Invalid route component</div>`):oe`<div>Not found</div>`}),Ve("router-link",(r={},n={})=>{const{to:i="",tag:s="a",replace:o=!1,exact:c=!1,activeClass:a="active",exactActiveClass:p="exact-active",ariaCurrentValue:h="page",disabled:x=!1,external:m=!1,class:d=""}=r,u=t.getCurrent(),y=u.path===i,w=c?y:u&&typeof u.path=="string"?u.path.startsWith(i):!1,l=y?`aria-current="${h}"`:"",f=(d||"").split(/\s+/).filter(Boolean),b={};for(const v of f)b[v]=!0;const k={...b,[a]:w,[p]:y},C=s==="button",g=x?C?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",$=m&&(s==="a"||!s)?'target="_blank" rel="noopener noreferrer"':"",O=v=>{if(x){v.preventDefault();return}m&&(s==="a"||!s)||(v.preventDefault(),o?t.replace(i):t.push(i))};return oe`
126
+ ${yt().when(C,oe`
74
127
  <button
75
128
  part="button"
76
- :class="${$}"
77
- ${a}
78
- ${d}
79
- ${x}
80
- @click="${A}"
129
+ :class="${k}"
130
+ ${l}
131
+ ${g}
132
+ ${$}
133
+ @click="${O}"
81
134
  ><slot></slot></button>
82
- `).otherwise(ie`
135
+ `).otherwise(oe`
83
136
  <a
84
137
  part="link"
85
138
  href="${i}"
86
- :class="${$}"
87
- ${a}
88
- ${d}
89
- ${x}
90
- @click="${A}"
139
+ :class="${k}"
140
+ ${l}
141
+ ${g}
142
+ ${$}
143
+ @click="${O}"
91
144
  ><slot></slot></a>
92
145
  `).done()}
93
- `}),t}exports.GlobalEventBus=ue;exports.anchorBlock=M;exports.component=Ue;exports.computed=$t;exports.createStore=qe;exports.css=lt;exports.each=vr;exports.eachGroup=Sr;exports.eachPage=Ar;exports.eachWhere=_r;exports.emit=Lr;exports.eventBus=de;exports.html=ie;exports.initRouter=Dr;exports.listen=Nr;exports.match=ft;exports.matchRoute=X;exports.matchRouteSSR=zr;exports.mediaVariants=ee;exports.off=jr;exports.on=Mr;exports.once=Wr;exports.parseQuery=Fe;exports.ref=xt;exports.renderToString=Ae;exports.resolveRouteComponent=ht;exports.responsive=dt;exports.responsiveOrder=Ve;exports.responsiveSwitch=Or;exports.switchOn=Pr;exports.switchOnLength=Er;exports.switchOnPromise=Tr;exports.unless=$r;exports.useEmit=cr;exports.useOnAttributeChanged=fr;exports.useOnConnected=lr;exports.useOnDisconnected=ur;exports.useOnError=dr;exports.useRouter=pt;exports.useStyle=hr;exports.watch=kt;exports.when=we;exports.whenEmpty=kr;exports.whenMedia=H;exports.whenNotEmpty=Cr;exports.whenVariants=Rr;
146
+ `}),t}exports.GlobalEventBus=de;exports.anchorBlock=L;exports.component=Ve;exports.computed=St;exports.createStore=Je;exports.css=pt;exports.each=kr;exports.eachGroup=jr;exports.eachPage=Tr;exports.eachWhere=Ar;exports.emit=Wr;exports.eventBus=pe;exports.html=oe;exports.initRouter=zr;exports.listen=Hr;exports.match=yt;exports.matchRoute=X;exports.matchRouteSSR=Br;exports.mediaVariants=ee;exports.off=Ir;exports.on=Dr;exports.once=Nr;exports.parseQuery=Ze;exports.ref=Et;exports.renderToString=Te;exports.resolveRouteComponent=wt;exports.responsive=bt;exports.responsiveOrder=Qe;exports.responsiveSwitch=Lr;exports.switchOn=Mr;exports.switchOnLength=Or;exports.switchOnPromise=Rr;exports.unless=_r;exports.useEmit=fr;exports.useOnAttributeChanged=pr;exports.useOnConnected=dr;exports.useOnDisconnected=hr;exports.useOnError=gr;exports.useRouter=xt;exports.useStyle=mr;exports.watch=At;exports.when=$e;exports.whenEmpty=Er;exports.whenMedia=U;exports.whenNotEmpty=Sr;exports.whenVariants=Pr;
94
147
  //# sourceMappingURL=custom-elements-runtime.cjs.js.map