@jasonshimmy/custom-elements-runtime 3.2.0 → 3.3.0

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.
Files changed (105) hide show
  1. package/dist/{css-utils-Cg4o1MqY.js → css-utils-CC43BbEy.js} +20 -21
  2. package/dist/css-utils-CC43BbEy.js.map +1 -0
  3. package/dist/{css-utils-RqkyBWft.cjs → css-utils-mgjmH8qX.cjs} +5 -4
  4. package/dist/css-utils-mgjmH8qX.cjs.map +1 -0
  5. package/dist/custom-elements-runtime.cjs.js +4 -3
  6. package/dist/custom-elements-runtime.cjs.js.map +1 -1
  7. package/dist/custom-elements-runtime.colors.cjs.js +3 -2
  8. package/dist/custom-elements-runtime.colors.cjs.js.map +1 -1
  9. package/dist/custom-elements-runtime.colors.es.js +3 -2
  10. package/dist/custom-elements-runtime.colors.es.js.map +1 -1
  11. package/dist/custom-elements-runtime.directive-enhancements.cjs.js +3 -2
  12. package/dist/custom-elements-runtime.directive-enhancements.cjs.js.map +1 -1
  13. package/dist/custom-elements-runtime.directive-enhancements.es.js +86 -100
  14. package/dist/custom-elements-runtime.directive-enhancements.es.js.map +1 -1
  15. package/dist/custom-elements-runtime.directives.cjs.js +3 -2
  16. package/dist/custom-elements-runtime.directives.cjs.js.map +1 -1
  17. package/dist/custom-elements-runtime.directives.es.js +40 -43
  18. package/dist/custom-elements-runtime.directives.es.js.map +1 -1
  19. package/dist/custom-elements-runtime.dom-jit-css.cjs.js +7 -6
  20. package/dist/custom-elements-runtime.dom-jit-css.cjs.js.map +1 -1
  21. package/dist/custom-elements-runtime.dom-jit-css.es.js +58 -76
  22. package/dist/custom-elements-runtime.dom-jit-css.es.js.map +1 -1
  23. package/dist/custom-elements-runtime.es.js +162 -186
  24. package/dist/custom-elements-runtime.es.js.map +1 -1
  25. package/dist/custom-elements-runtime.event-bus.cjs.js +3 -2
  26. package/dist/custom-elements-runtime.event-bus.cjs.js.map +1 -1
  27. package/dist/custom-elements-runtime.event-bus.es.js +48 -103
  28. package/dist/custom-elements-runtime.event-bus.es.js.map +1 -1
  29. package/dist/custom-elements-runtime.jit-css.cjs.js +3 -2
  30. package/dist/custom-elements-runtime.jit-css.cjs.js.map +1 -1
  31. package/dist/custom-elements-runtime.jit-css.es.js +29 -30
  32. package/dist/custom-elements-runtime.jit-css.es.js.map +1 -1
  33. package/dist/custom-elements-runtime.router.cjs.js +20 -19
  34. package/dist/custom-elements-runtime.router.cjs.js.map +1 -1
  35. package/dist/custom-elements-runtime.router.es.js +579 -582
  36. package/dist/custom-elements-runtime.router.es.js.map +1 -1
  37. package/dist/custom-elements-runtime.ssr-middleware.cjs.js +5 -4
  38. package/dist/custom-elements-runtime.ssr-middleware.cjs.js.map +1 -1
  39. package/dist/custom-elements-runtime.ssr-middleware.es.js +44 -37
  40. package/dist/custom-elements-runtime.ssr-middleware.es.js.map +1 -1
  41. package/dist/custom-elements-runtime.ssr.cjs.js +1 -4
  42. package/dist/custom-elements-runtime.ssr.es.js +11 -176
  43. package/dist/custom-elements-runtime.store.cjs.js +3 -2
  44. package/dist/custom-elements-runtime.store.cjs.js.map +1 -1
  45. package/dist/custom-elements-runtime.store.es.js +17 -11
  46. package/dist/custom-elements-runtime.store.es.js.map +1 -1
  47. package/dist/custom-elements-runtime.transitions.cjs.js +3 -2
  48. package/dist/custom-elements-runtime.transitions.cjs.js.map +1 -1
  49. package/dist/custom-elements-runtime.transitions.es.js +55 -120
  50. package/dist/custom-elements-runtime.transitions.es.js.map +1 -1
  51. package/dist/custom-elements-runtime.vite-plugin.cjs.js +3 -2
  52. package/dist/custom-elements-runtime.vite-plugin.cjs.js.map +1 -1
  53. package/dist/custom-elements-runtime.vite-plugin.es.js +54 -75
  54. package/dist/custom-elements-runtime.vite-plugin.es.js.map +1 -1
  55. package/dist/hooks-_3xP4G2N.js +1189 -0
  56. package/dist/hooks-_3xP4G2N.js.map +1 -0
  57. package/dist/hooks-fYQgZk2g.cjs +7 -0
  58. package/dist/hooks-fYQgZk2g.cjs.map +1 -0
  59. package/dist/logger-BYIN7ysT.cjs +3 -0
  60. package/dist/logger-BYIN7ysT.cjs.map +1 -0
  61. package/dist/logger-L25axmB-.js +41 -0
  62. package/dist/logger-L25axmB-.js.map +1 -0
  63. package/dist/namespace-helpers-Bf7rm9JV.cjs +3 -0
  64. package/dist/namespace-helpers-Bf7rm9JV.cjs.map +1 -0
  65. package/dist/namespace-helpers-BucDdgz_.js +61 -0
  66. package/dist/namespace-helpers-BucDdgz_.js.map +1 -0
  67. package/dist/reset.css +1 -1
  68. package/dist/ssr-B3lxl1vr.js +165 -0
  69. package/dist/ssr-B3lxl1vr.js.map +1 -0
  70. package/dist/ssr-DtD9e5iA.cjs +5 -0
  71. package/dist/ssr-DtD9e5iA.cjs.map +1 -0
  72. package/dist/style-Bjn8zDiZ.cjs +56 -0
  73. package/dist/style-Bjn8zDiZ.cjs.map +1 -0
  74. package/dist/{style-BmyOIMcU.js → style-DuDoj_xK.js} +724 -876
  75. package/dist/style-DuDoj_xK.js.map +1 -0
  76. package/dist/style.css +1 -1
  77. package/dist/template-compiler-BB4JJdqk.cjs +23 -0
  78. package/dist/template-compiler-BB4JJdqk.cjs.map +1 -0
  79. package/dist/template-compiler-Cs5axmn4.js +3236 -0
  80. package/dist/template-compiler-Cs5axmn4.js.map +1 -0
  81. package/dist/variables.css +1 -1
  82. package/package.json +7 -7
  83. package/dist/css-utils-Cg4o1MqY.js.map +0 -1
  84. package/dist/css-utils-RqkyBWft.cjs.map +0 -1
  85. package/dist/custom-elements-runtime.ssr.cjs.js.map +0 -1
  86. package/dist/custom-elements-runtime.ssr.es.js.map +0 -1
  87. package/dist/hooks-BH-CpUun.js +0 -1474
  88. package/dist/hooks-BH-CpUun.js.map +0 -1
  89. package/dist/hooks-NOFG9QRQ.cjs +0 -6
  90. package/dist/hooks-NOFG9QRQ.cjs.map +0 -1
  91. package/dist/logger-BvkEbVM4.js +0 -48
  92. package/dist/logger-BvkEbVM4.js.map +0 -1
  93. package/dist/logger-CSALKaYm.cjs +0 -2
  94. package/dist/logger-CSALKaYm.cjs.map +0 -1
  95. package/dist/namespace-helpers-D4wC2-qA.js +0 -61
  96. package/dist/namespace-helpers-D4wC2-qA.js.map +0 -1
  97. package/dist/namespace-helpers-ckeEOxpR.cjs +0 -2
  98. package/dist/namespace-helpers-ckeEOxpR.cjs.map +0 -1
  99. package/dist/style-BmyOIMcU.js.map +0 -1
  100. package/dist/style-D40DsIqJ.cjs +0 -55
  101. package/dist/style-D40DsIqJ.cjs.map +0 -1
  102. package/dist/template-compiler-CDvhsHia.cjs +0 -22
  103. package/dist/template-compiler-CDvhsHia.cjs.map +0 -1
  104. package/dist/template-compiler-DiE69FLO.js +0 -3724
  105. package/dist/template-compiler-DiE69FLO.js.map +0 -1
@@ -0,0 +1,23 @@
1
+ const O=require("./logger-BYIN7ysT.cjs"),P=require("./namespace-helpers-Bf7rm9JV.cjs"),h=require("./hooks-fYQgZk2g.cjs"),U=require("./css-utils-mgjmH8qX.cjs"),He=require("./custom-elements-runtime.directives.cjs.js"),Qe=require("./custom-elements-runtime.transitions.cjs.js");function et(e,i,n){if(n)for(const[s,r]of Object.entries(n)){let o,t={};if(Array.isArray(r)?(o=r[0],t=r[1]||{}):o=r,i.set(s,{callback:o,options:t,oldValue:h.getNestedValue(e,s)}),t.immediate)try{const a=h.getNestedValue(e,s);o(a,void 0,e)}catch(a){O.devError(`Error in immediate watcher for "${s}":`,a)}}}function tt(e,i,n,s){const r=(t,a)=>{if(t===a)return!0;if(typeof t!=typeof a||typeof t!="object"||t===null||a===null)return!1;if(Array.isArray(t)&&Array.isArray(a))return t.length!==a.length?!1:t.every((m,C)=>r(m,a[C]));const y=t,u=a,g=Object.keys(y||{}),b=Object.keys(u||{});return g.length!==b.length?!1:g.every(m=>r(y[m],u[m]))},o=i.get(n);if(o&&!r(s,o.oldValue))try{o.callback(s,o.oldValue,e),o.oldValue=s}catch(t){O.devError(`Error in watcher for "${n}":`,t)}for(const[t,a]of i.entries())if(a.options.deep&&n.startsWith(t+"."))try{const y=h.getNestedValue(e,t);r(y,a.oldValue)||(a.callback(y,a.oldValue,e),a.oldValue=y)}catch(y){O.devError(`Error in deep watcher for "${t}":`,y)}}function we(e,i){return i===Boolean?e===""||e==="true":i===Number?Number(e):e}function nt(e,i,n){if(i)for(const s in i){const r=i[s],o=h.toKebab(s),t=e.getAttribute(o);if(r.type===Function&&typeof e[s]=="function")n[s]=e[s];else if(t!==null)n[s]=we(t,r.type);else if(typeof e[s]<"u")try{const a=e[s];if(r.type===String&&a&&typeof a=="object")try{n[s]=we(String(a),r.type)}catch{n[s]=a}else r.type===Boolean&&typeof a=="boolean"||r.type===Number&&typeof a=="number"||r.type===Function&&typeof a=="function"?n[s]=a:n[s]=we(String(a),r.type)}catch{n[s]=e[s]}else"default"in r&&r.default!==void 0&&(n[s]=r.default)}}function rt(e,i,n){if(!i.props){try{const s=n?._hookCallbacks?.props||{},r=Array.from(new Set([...Object.keys(e||{}),...Object.keys(s||{})]));for(const o of r){if(typeof o!="string"||o.startsWith("_"))continue;const t=Object.getOwnPropertyDescriptor(n,o);if(!(!Object.prototype.hasOwnProperty.call(s,o)&&t&&(t.get||t.set||!t.configurable)))try{Object.defineProperty(n,o,{enumerable:!0,configurable:!0,get(){try{const a=h.toKebab(o),y=e.getAttribute(a);if(y!==null)return y;const u=e[o];let g;return h.isReactiveState(u)||u&&typeof u=="object"&&"value"in u&&!(typeof Node<"u"&&u instanceof Node)?g=u.value:g=u,g}catch{return e[o]}}})}catch{}}}catch{}return}nt(e,i.props,n)}function xe(e,i,n,s){e.onConnected&&!n&&(e.onConnected(i),s(!0))}function st(e,i,n,s,r,o,t,a){e.onDisconnected&&e.onDisconnected(i),n.forEach(y=>y()),s(),r(),o(!1),t(null),a(!1)}function it(e,i,n,s,r){e.onAttributeChanged&&e.onAttributeChanged(i,n,s,r)}var F=class{static cleanupFunctions=new WeakMap;static addListener(e,i,n,s){e.addEventListener(i,n,s);const o={event:i,handler:n,wrapper:n,options:s,cleanup:()=>e.removeEventListener(i,n,s),addedAt:Date.now()};this.cleanupFunctions.has(e)||this.cleanupFunctions.set(e,[]),this.cleanupFunctions.get(e).push(o)}static removeListener(e,i,n,s){e.removeEventListener(i,n,s);const r=this.cleanupFunctions.get(e);if(r)for(let o=0;o<r.length;o++){const t=r[o];if(t.event===i&&t.handler===n){r.splice(o,1),r.length===0&&this.cleanupFunctions.delete(e);return}}}static cleanup(e){const i=this.cleanupFunctions.get(e);i&&(i.forEach(n=>{try{n.cleanup()}catch{}}),this.cleanupFunctions.delete(e))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(e){const i=this.cleanupFunctions.get(e);return!!(i&&i.length>0)}static getListenerCount(e){const i=this.cleanupFunctions.get(e);return i?i.length:0}static getListenerInfo(e){const i=this.cleanupFunctions.get(e);return i?i.map(n=>({event:n.event,handler:n.handler,wrapper:n.wrapper,options:n.options})):[]}},Ke=class{map=new Map;maxSize;constructor(e){this.maxSize=Math.max(1,e)}get(e){const i=this.map.get(e);if(i!==void 0)return this.map.delete(e),this.map.set(e,i),i}set(e,i){if(this.map.has(e)&&this.map.delete(e),this.map.set(e,i),this.map.size>this.maxSize){const n=this.map.keys().next().value;this.map.delete(n)}}has(e){return this.map.has(e)}clear(){this.map.clear()}get size(){return this.map.size}},ot=()=>{if(typeof navigator<"u"&&"deviceMemory"in navigator){const e=navigator.deviceMemory;if(e)return Math.min(1e3,Math.max(200,e*100))}return(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"}catch{return!1}})()?100:500},Le=new Ke(ot()),at=new Set(["true","false","null","undefined","typeof","instanceof","in","of","new","delete","void","throw","return","this","class","extends","import","export","from","as","async","await","yield","if","else","for","while","do","switch","case","break","continue","try","catch","finally","let","const","var","function","NaN","Infinity"]),ct=class{static cache=new Ke(1e3);static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/\bfunction\b/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(e,i){const n=this.cache.get(e);if(n){if(!n.isSecure){O.devWarn("Blocked cached dangerous expression:",e);return}return n.evaluator(i)}const s=this.createEvaluator(e);if(this.cache.set(e,s),!s.isSecure){O.devWarn("Blocked dangerous expression:",e);return}return s.evaluator(i)}static createEvaluator(e){if(this.hasDangerousPatterns(e))return{evaluator:()=>{},isSecure:!1};if(e.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(e),isSecure:!0}}catch(i){return O.devWarn("Failed to create evaluator for expression:",e,i),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(e){return this.dangerousPatterns.some(i=>i.test(e))}static createSafeEvaluator(e){const i=e.trim();if(i.startsWith("{")&&i.endsWith("}"))return this.createObjectEvaluator(e);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(e.trim())){const n=e.trim().slice(4);return s=>h.getNestedValue(s,n)}return e.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(e)?this.createSimpleEvaluator(e):n=>h.getNestedValue(n,e)}static createObjectEvaluator(e){const i=e.trim().slice(1,-1),n=this.parseObjectProperties(i);return s=>{const r={};for(const{key:o,value:t}of n)try{t.startsWith("ctx.")?r[o]=h.getNestedValue(s,t.slice(4)):r[o]=this.evaluateSimpleValue(t,s)}catch{r[o]=void 0}return r}}static parseObjectProperties(e){const i=[],n=[];let s=0,r=null,o=0;for(let t=0;t<e.length;t++){const a=e[t];if(r){if(a==="\\"){t++;continue}a===r&&(r=null)}else a==='"'||a==="'"?r=a:a==="("||a==="["||a==="{"?s++:a===")"||a==="]"||a==="}"?s--:a===","&&s===0&&(n.push(e.slice(o,t)),o=t+1)}n.push(e.slice(o));for(const t of n){let a=-1,y=0,u=null;for(let C=0;C<t.length;C++){const R=t[C];if(u){if(R==="\\"){C++;continue}R===u&&(u=null)}else if(R==='"'||R==="'")u=R;else if(R==="("||R==="["||R==="{")y++;else if(R===")"||R==="]"||R==="}")y--;else if(R===":"&&y===0){a=C;break}}if(a===-1)continue;const g=t.slice(0,a).trim(),b=t.slice(a+1).trim(),m=g.replace(/^['"]|['"]$/g,"");i.push({key:m,value:b})}return i}static createSimpleEvaluator(e){return i=>{try{let n=e;const s=[];n=n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,u=>`<<#${s.push(u)-1}#>>`);const r=n.match(/ctx\.[\w.]+/g)||[];for(const u of r){const g=h.getNestedValue(i,u.slice(4));if(g===void 0)return;const b=s.push(JSON.stringify(g))-1;n=n.split(u).join(`<<#${b}#>>`)}const o=n.match(/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g)||[];for(const u of o){if(u.startsWith("ctx."))continue;const g=h.getNestedValue(i,u);if(g===void 0)return;const b=s.push(JSON.stringify(g))-1;n=n.split(u).join(`<<#${b}#>>`)}const t=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let a;const y=new Set;for(;(a=t.exec(n))!==null;){const u=a[1];if(at.has(u)||/^[0-9]+$/.test(u)||u==="ctx"||y.has(u))continue;y.add(u);const g=h.getNestedValue(i,u);if(g===void 0)return;const b=JSON.stringify(g),m=s.push(b)-1;u.includes(".")?n=n.split(u).join(`<<#${m}#>>`):n=n.replace(new RegExp("\\b"+u.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${m}#>>`),t.lastIndex=0}n=n.replace(/<<#(\d+)#>>/g,(u,g)=>s[Number(g)]);try{return this.evaluateBasicExpression(n)}catch{return}}catch{return}}}static evaluateBasicExpression(e){const i=this.tokenize(e);let n=0;function s(){return i[n]}function r(d){const p=i[n++];if(d&&!p)throw new Error(`Unexpected token EOF, expected ${d}`);if(d&&p&&p.type!==d&&p.value!==d)throw new Error(`Unexpected token ${p.type}/${p.value}, expected ${d}`);return p}function o(){return C()}function t(d){if(typeof d=="number")return d;if(d==null)return NaN;if(typeof d=="boolean")return d?1:0;const p=Number(d);return Number.isNaN(p)?NaN:p}function a(d,p){return typeof d=="string"||typeof p=="string"?String(d)+String(p):t(d)+t(p)}function y(d,p){return t(d)-t(p)}function u(d,p){return t(d)*t(p)}function g(d,p){return t(d)/t(p)}function b(d,p){return t(d)%t(p)}function m(d,p,_){if(typeof p=="number"&&typeof _=="number")switch(d){case">":return p>_;case"<":return p<_;case">=":return p>=_;case"<=":return p<=_;default:return!1}const c=String(p),E=String(_);switch(d){case">":return c>E;case"<":return c<E;case">=":return c>=E;case"<=":return c<=E;default:return!1}}function C(){const d=R(),p=s();if(p&&p.value==="?"){r("?");const _=o();r(":");const c=o();return d?_:c}return d}function R(){let d=l();for(;;){const p=s();if(!p||p.value!=="||")break;r("OP");const _=l();d=d||_}return d}function l(){let d=k();for(;;){const p=s();if(!p||p.value!=="&&")break;r("OP");const _=k();d=d&&_}return d}function k(){let d=w();for(;;){const p=s();if(!p||!["==","!=","===","!=="].includes(p.value))break;const _=r("OP").value,c=w();switch(_){case"==":d=d==c;break;case"!=":d=d!=c;break;case"===":d=d===c;break;case"!==":d=d!==c;break}}return d}function w(){let d=S();for(;;){const p=s();if(!p||![">","<",">=","<="].includes(p.value))break;const _=r("OP").value,c=S();switch(_){case">":d=m(">",d,c);break;case"<":d=m("<",d,c);break;case">=":d=m(">=",d,c);break;case"<=":d=m("<=",d,c);break}}return d}function S(){let d=f();for(;;){const p=s();if(!p||p.value!=="+"&&p.value!=="-")break;const _=r("OP").value,c=f();d=_==="+"?a(d,c):y(d,c)}return d}function f(){let d=A();for(;;){const p=s();if(!p||p.value!=="*"&&p.value!=="/"&&p.value!=="%")break;const _=r("OP").value,c=A();switch(_){case"*":d=u(d,c);break;case"/":d=g(d,c);break;case"%":d=b(d,c);break}}return d}function A(){const d=s();return d&&d.value==="!"?(r("OP"),!A()):d&&d.value==="-"?(r("OP"),y(0,A())):v()}function v(){const d=s();if(d){if(d.type==="NUMBER")return r("NUMBER"),Number(d.value);if(d.type==="STRING")return r("STRING"),d.value.slice(1,-1);if(d.type==="IDENT")return r("IDENT"),d.value==="true"?!0:d.value==="false"?!1:d.value==="null"?null:void 0;if(d.value==="["){r("PUNC");const p=[];for(;;){const _=s();if(!_||_.value==="]")break;p.push(o());const c=s();c&&c.value===","&&r("PUNC")}return r("PUNC"),p}if(d.value==="("){r("PUNC");const p=o();return r("PUNC"),p}throw new Error("Unexpected token in expression")}}return o()}static tokenize(e){const i=[],n=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let s;for(;(s=n.exec(e))!==null;){const r=s[1];r&&(/^\d/.test(r)?i.push({type:"NUMBER",value:r}):/^"/.test(r)||/^'/.test(r)?i.push({type:"STRING",value:r}):/^[a-zA-Z_]/.test(r)?i.push({type:"IDENT",value:r}):/^[()?:,[\]]$/.test(r)?i.push({type:"PUNC",value:r}):i.push({type:"OP",value:r}))}return i}static evaluateSimpleValue(e,i){return e==="true"?!0:e==="false"?!1:isNaN(Number(e))?e.startsWith("ctx.")?h.getNestedValue(i,e.slice(4)):e.startsWith('"')&&e.endsWith('"')||e.startsWith("'")&&e.endsWith("'")?e.slice(1,-1):e:Number(e)}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}};function Se(e,i){return Array.isArray(e)&&Array.isArray(i)?JSON.stringify([...e].sort())!==JSON.stringify([...i].sort()):e!==i}function Ie(e,i,n,s,r){if(e){const o=i.value;if(r&&typeof o=="object"&&o!==null){const t={...o};t[r]=n,i.value=t}else i.value=n}else h.setNestedValue(s._state||s,i,n)}function Ee(e,i,n,s){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const r=i?"reactiveState":n;e._triggerWatchers(r,s)}}function lt(e,i,n){const s=`update:${h.toKebab(i)}`,r=`update:${i}`,o=new CustomEvent(s,{detail:n,bubbles:!0,cancelable:!0}),t=new CustomEvent(r,{detail:n,bubbles:!0,cancelable:!0});e.dispatchEvent(o),e.dispatchEvent(t)}function We(e,i,n,s){const r=n;if(h.safe(()=>{if(typeof e.setAttribute=="function")try{e[i]=r}catch{}else e[i]=r}),r==null||typeof r=="string"||typeof r=="number"||typeof r=="boolean"){const o=h.safeSerializeAttr(r);o!==null?h.safe(()=>{typeof e.setAttribute=="function"&&P.setAttributeSmart(e,h.toKebab(i),String(o))}):h.safe(()=>{typeof e.removeAttribute=="function"&&P.removeAttributeSmart(e,h.toKebab(i))})}}function ft(e,i,n,s){if(e){const r=i.value;return s&&typeof r=="object"&&r!==null?r[s]:r}else return h.getNestedValue(n._state||n,i)}function me(e){return e!=null&&typeof e=="object"&&"value"in e}function Me(e){return e!=null&&typeof e=="object"&&"value"in e?e.value:e}function X(e,i,n){if(!e)return;e.attrs||(e.attrs={});const s=e.attrs;s[i]=n}function V(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function ie(e){return e!=null&&typeof e=="object"&&"value"in e?ie(e.value):!(e!=null&&typeof e=="object"||e===!1||e==="false"||e===null||e===void 0||e===0)}function qe(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function Re(e){return typeof e=="boolean"||e==="true"||e==="false"}function ut(e,i,n,s,r,o,t,a){if(!o)return;const y=i.includes("lazy"),u=i.includes("trim"),g=i.includes("number"),b=()=>{if(h.isReactiveState(e)){const S=e.value;return a&&t&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)&&typeof S=="object"&&S!==null?S[a]:S}return h.getNestedValue(o?._state||o,e)},m=b();let C="text";t instanceof HTMLInputElement?C=s?.type||t.type||"text":t instanceof HTMLSelectElement?C="select":t instanceof HTMLTextAreaElement&&(C="textarea");const R=t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement,l=R?C==="checkbox"||C==="radio"?"checked":"value":a??"modelValue";if(C==="checkbox")Array.isArray(m)?n[l]=m.includes(String(t?.getAttribute("value")??s?.value??"")):n[l]=m===(t?.getAttribute("true-value")??!0);else if(C==="radio")n[l]=m===(s?.value??"");else if(C==="select")if(t&&t.hasAttribute("multiple")&&t instanceof HTMLSelectElement){const S=Array.isArray(m)?m.map(String):[];queueMicrotask(()=>{Array.from(t.options).forEach(f=>{f.selected=S.includes(f.value)})}),n[l]=Array.isArray(m)?m:[]}else n[l]=m;else if(!R&&h.isReactiveState(e))n[l]=e;else{n[l]=m;try{const S=h.toKebab(l);s&&(s[S]=m)}catch{}}const k=y||C==="checkbox"||C==="radio"||C==="select"?"change":"input",w=S=>{if(S.isComposing||r._isComposing)return;const f=globalThis.process,A=!!f&&f.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(S.isTrusted===!1&&!A)return;const v=S.target;if(!v||v._modelUpdating)return;let d=v.value;if(C==="checkbox"){const _=b();if(Array.isArray(_)){const c=v.getAttribute("value")??"",E=Array.from(_);if(v.checked)E.includes(c)||E.push(c);else{const T=E.indexOf(c);T>-1&&E.splice(T,1)}d=E}else{const c=v.getAttribute("true-value")??!0,E=v.getAttribute("false-value")??!1;d=v.checked?c:E}}else if(C==="radio")d=v.getAttribute("value")??v.value;else if(C==="select"&&v.multiple)d=Array.from(v.selectedOptions).map(_=>_.value);else if(u&&typeof d=="string"&&(d=d.trim()),g){const _=Number(d);isNaN(_)||(d=_)}const p=b();if(Se(d,p)){v._modelUpdating=!0;try{Ie(h.isReactiveState(e),e,d,o,a),Ee(o,h.isReactiveState(e),e,d),v&&lt(v,l,d)}finally{queueMicrotask(()=>v._modelUpdating=!1)}}};if(R){if(r[k]){const S=r[k];t&&F.removeListener(t,k,S)}r[k]=w}else{const S=`update:${h.toKebab(l)}`,f=`update:${l}`;if(r[S]){const A=r[S];t&&F.removeListener(t,S,A)}if(r[f]){const A=r[f];t&&F.removeListener(t,f,A)}if(r[S]=A=>{const v=A.detail;let d=v!==void 0?v:void 0;if(d===void 0){const _=A.target;if(_&&typeof _=="object"&&"value"in _)try{d=_.value}catch{d=void 0}}const p=ft(h.isReactiveState(e),e,o,a);if(Se(d,p)){Ie(h.isReactiveState(e),e,d,o,a),Ee(o,h.isReactiveState(e),e,d);const _=A.target;_&&We(_,l,h.isReactiveState(e)?e:d,h.isReactiveState(e))}},h.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let A;try{A=Reflect.ownKeys(e.value)}catch{A=Object.keys(e.value)}const v=A.filter(p=>typeof p=="string"&&!String(p).startsWith("_")&&p!=="constructor"),d=new Set(v.map(p=>`update:${h.toKebab(p)}`));for(const p of Object.keys(r))p.startsWith("update:")&&p!==S&&p!==f&&!d.has(p)&&(t&&F.removeListener(t,p,r[p]),delete r[p]);for(const p of v){const _=String(p),c=`update:${h.toKebab(_)}`,E=`update:${_}`;c!==S&&(r[c]&&t&&(F.removeListener(t,c,r[c]),delete r[c]),r[c]=T=>{const N=T.detail!==void 0?T.detail:T.target?.value;if(!Se(N,h.isReactiveState(e)?e.value[_]:h.getNestedValue(o?._state||o,e)))return;if(h.isReactiveState(e)){const $={...e.value};$[_]=N,e.value=$}else h.setNestedValue(o?._state||o,e,N);Ee(o,h.isReactiveState(e),e,N);const L=T.currentTarget||t||T.target;L&&We(L,l,h.isReactiveState(e)?e:N,h.isReactiveState(e))},r[E]=r[c])}}r[f]=r[S]}(C==="text"||C==="textarea")&&(r.compositionstart=()=>r._isComposing=!0,r.compositionend=S=>{r._isComposing=!1;const f=S.target;f&&queueMicrotask(()=>{const A=f.value,v=o?._state||o,d=h.getNestedValue(v,e);let p=A;if(u&&(p=p.trim()),g){const _=Number(p);isNaN(_)||(p=_)}if(Se(p,d)){f._modelUpdating=!0;try{h.setNestedValue(v,e,p),Ee(o,h.isReactiveState(e),e,p)}finally{queueMicrotask(()=>f._modelUpdating=!1)}}})})}function dt(e,i,n,s,r){if(typeof e=="object"&&e!==null)for(const[o,t]of Object.entries(e))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")n[o]=t;else if(o==="disabled"&&r&&V(r)){const a=t&&typeof t=="object"&&"value"in t;(()=>{try{return h.isReactiveState(t)}catch{return!1}})()||a?i[o]=t:n[o]=t}else i[o]=t;else if(typeof e=="string"){if(!s)return;try{const o=ve(e,s);if(typeof o=="object"&&o!==null){for(const[t,a]of Object.entries(o))if(t.startsWith("data-")||t.startsWith("aria-")||t==="class")n[t]=a;else if(t==="disabled"&&r&&V(r)){const y=a&&typeof a=="object"&&"value"in a;(()=>{try{return h.isReactiveState(a)}catch{return!1}})()||y?i[t]=a:n[t]=a}else i[t]=a;return}else{n[e]=o;return}}catch{n[e]=h.getNestedValue(s,e)}}}function pt(e,i,n){let s;if(typeof e=="string"){if(!n)return;s=ve(e,n)}else s=e;const r=String(i.style||"");let o=r;if(s){if(r){const t=String(r).split(";").map(y=>y.trim()).filter(Boolean),a=t.findIndex(y=>y.startsWith("display:"));a>=0&&t[a]==="display: none"&&(t.splice(a,1),o=t.length>0?t.join("; ")+";":"")}}else if(r){const t=String(r).split(";").filter(Boolean),a=t.findIndex(y=>y.trim().startsWith("display:"));a>=0?t[a]="display: none":t.push("display: none"),o=t.join("; ")}else o="display: none";o!==r&&(o?i.style=o:i.style=void 0)}function ve(e,i){return ct.evaluate(e,i)}function ht(e,i,n,s){let r;if(typeof e=="string"){if(!n)return;r=ve(e,n)}else r=e;try{if(r&&typeof r=="object"){if(h.isReactiveState(r))r=r.value;else if("value"in r&&typeof r.value<"u"){const u=r.value;u instanceof Node||(r=u)}}}catch{}let o=[];if(typeof r=="string")o=[r];else if(Array.isArray(r))o=r.filter(Boolean);else if(typeof r=="object"&&r!==null)for(const[u,g]of Object.entries(r))g&&o.push(u);const t=o.join(" "),a=s&&s.class||i.class||"",y=a?`${a} ${t}`.trim():t.trim();y?i.class=y:i.class=void 0}function yt(e,i,n){let s;if(typeof e=="string"){if(!n)return;s=ve(e,n)}else s=e;let r="";if(typeof s=="string")r=s;else if(s&&typeof s=="object"){const t=[];for(const[a,y]of Object.entries(s))if(y!=null&&y!==""){const u=a.replace(/[A-Z]/g,m=>`-${m.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(y);typeof y=="number"&&g.includes(u)&&(b=`${y}px`),t.push(`${u}: ${b}`)}r=t.join("; ")+(t.length>0?";":"")}const o=String(i.style||"");i.style=o+(o&&!o.endsWith(";")?"; ":"")+r}function mt(e,i,n){let s=e;typeof e=="string"&&n&&(s=ve(e,n)),h.isReactiveState(s)?i.reactiveRef=s:i.ref=s}function Fe(e,i,n,s){const r={},o={...s||{}},t={};for(const[a,y]of Object.entries(e)){const{value:u,modifiers:g,arg:b}=y;if(a==="model"||a.startsWith("model:")){const m=a.split(":");ut(u,g,r,o,t,i,n,m.length>1?m[1]:b);continue}switch(a){case"bind":dt(u,r,o,i,n);break;case"show":pt(u,o,i);break;case"class":ht(u,o,i,s);break;case"style":yt(u,o,i);break;case"ref":mt(u,r,i);break;case"when":break}}try{if(Object.prototype.hasOwnProperty.call(r,"disabled")&&n&&V(n)){const a=r.disabled,y=a&&typeof a=="object"&&"value"in a;let u=!1;try{u=h.isReactiveState(a)}catch{u=!1}!y&&!u&&(o.disabled=a,delete r.disabled)}}catch{}return{props:r,attrs:o,listeners:t}}function ae(e){return e?e.split(/\s+/).filter(Boolean):[]}function ce(e,i){if(i.length===0)return;const n=i.filter(s=>s&&!e.classList.contains(s));n.length>0&&e.classList.add(...n)}function oe(e,i){if(i.length===0)return;const n=i.filter(Boolean);n.length>0&&e.classList.remove(...n)}function gt(e){const i=window.getComputedStyle(e),n=i.transitionDuration||"0s",s=i.transitionDelay||"0s",r=o=>{const t=parseFloat(o);return o.includes("ms")?t:t*1e3};return r(n)+r(s)}function Ve(e,i){return new Promise(n=>{const s=i??gt(e);if(s<=0){n();return}let r=!1;const o=()=>{r||(r=!0,e.removeEventListener("transitionend",t),e.removeEventListener("transitioncancel",t),n())},t=()=>o();e.addEventListener("transitionend",t),e.addEventListener("transitioncancel",t),setTimeout(o,s+50)})}async function pe(e,i){const{classes:n,hooks:s,css:r,duration:o}=i;if(s?.onBeforeEnter)try{s.onBeforeEnter(e)}catch(b){O.devError("Transition onBeforeEnter error:",b)}if(!r)return s?.onEnter?new Promise(b=>{const m=s.onEnter;typeof m=="function"?m(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(C){O.devError("Transition onAfterEnter error:",C)}b()}):b()}):void 0;const t=ae(n?.enterFrom),a=ae(n?.enterActive),y=ae(n?.enterTo);ce(e,t),e.offsetHeight,ce(e,a),e.offsetHeight;let u;if(s?.onEnter){const b=new Promise(m=>{u=m});try{const m=s.onEnter;typeof m=="function"&&m(e,()=>{u&&u()})}catch(m){O.devError("Transition onEnter error:",m)}u&&await b}await new Promise(b=>requestAnimationFrame(()=>b())),e.offsetHeight,oe(e,t),ce(e,y),e.offsetHeight,await new Promise(b=>requestAnimationFrame(()=>b()));let g;if(typeof o=="number"?g=o:o&&typeof o=="object"&&"enter"in o&&(g=o.enter),await Ve(e,g),oe(e,a),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(b){O.devError("Transition onAfterEnter error:",b)}}async function Ne(e,i){const{classes:n,hooks:s,css:r,duration:o}=i;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(b){O.devError("Transition onBeforeLeave error:",b)}if(!r)return s?.onLeave?new Promise(b=>{const m=s.onLeave;typeof m=="function"?m(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(C){O.devError("Transition onAfterLeave error:",C)}b()}):b()}):void 0;const t=ae(n?.leaveFrom),a=ae(n?.leaveActive),y=ae(n?.leaveTo);ce(e,t),e.offsetHeight,ce(e,a);let u;if(s?.onLeave){const b=new Promise(m=>{u=m});try{const m=s.onLeave;typeof m=="function"&&m(e,()=>{u&&u()})}catch(m){O.devError("Transition onLeave error:",m)}u&&await b}await new Promise(b=>requestAnimationFrame(()=>b())),oe(e,t),ce(e,y);let g;if(typeof o=="number"?g=o:o&&typeof o=="object"&&"leave"in o&&(g=o.leave),await Ve(e,g),oe(e,a),oe(e,y),oe(e,t),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(b){O.devError("Transition onAfterLeave error:",b)}}var Ge=new WeakMap,Je=new WeakMap;function Ce(e){if(!e)return;const i=Ge.get(e);if(i!==void 0)return i;try{const n=e;if(n&&n.key!=null)return String(n.key)}catch{}if(e instanceof Element){const n=e.getAttribute("data-anchor-key");if(n)return n}}function K(e,i){try{Ge.set(e,i)}catch{}try{e.key=i}catch{}try{if(e instanceof Element){const n=h.safeSerializeAttr(i);n!==null&&P.setAttributeSmart(e,"data-anchor-key",n)}}catch{}}function bt(e){if(!e)return;const i=Je.get(e);if(i!==void 0)return i;try{const n=e;if(n&&n._transitionGroup!=null)return n._transitionGroup}catch{}}function vt(e,i){try{Je.set(e,i)}catch{}try{e._transitionGroup=i}catch{}}var _e=new WeakMap;function se(e,i){if(i){if(e instanceof Element){F.cleanup(e);const n=[];for(const s in i)i[s]===e&&n.push(s);for(const s of n)delete i[s]}if(e.hasChildNodes()){const n=e.childNodes;for(let s=n.length-1;s>=0;s--)se(n[s],i)}}}function he(e,i,n){if(typeof e=="string")return;const s=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),r=e.props?.ref??(e.props?.props&&e.props.props.ref);if(s)try{if(h.isReactiveState(s)||typeof s=="object"&&"value"in s)s.value=i;else if(typeof s=="function")s(i);else if(typeof s=="string"&&n)try{const o=String(s);n[o]=i}catch{}}catch{}else if(r&&n)try{const o=String(r);n[o]=i}catch{}}function $e(e,i){if(Array.isArray(e)){const o=new Set,t=new Map;return e.map(a=>{if(!a||typeof a!="object")return a;let y=a.props?.key??a.key;if(!y){const b=a.tag||"node",m=[a.props?.attrs?.id,a.props?.attrs?.name,a.props?.attrs?.["data-key"],a.props?.props?.id,a.props?.props?.name,a.props?.props?.dataKey,a.props?.props?.["data-key"]].find(C=>C!=null)??"";y=m?`${i}:${b}:${m}`:`${i}:${b}`}let u=y;if(o.has(u)){const b=(t.get(u)??1)+1;t.set(u,b),u=`${y}#${b}`}t.set(y,(t.get(y)??0)+1),o.add(u);let g=a.children;return Array.isArray(g)&&(g=$e(g,u)),{...a,key:u,children:g}})}const n=e,s=n.props?.key??n.key??i;let r=n.children;return Array.isArray(r)&&(r=$e(r,s)),{...n,key:s,children:r}}function Be(e,i,n,s){const r=n.directives??{},o=n.attrs?{...n.attrs}:{},t=Fe(r,s,e,o),a={...i.props||{},...n.props||{},...t.props||{}},y={...o||{},...t.attrs||{}},u=i.props??{},g=a,b=!!(n?.isCustomElement??i?.isCustomElement??!1);let m=!1;const C=new Set;for(const f in u)C.add(f);for(const f in g)C.add(f);for(const f of C){const A=u[f],v=g[f];let d=A,p=v;if(h.safe(()=>{h.isReactiveState(A)?d=A.peek():me(A)&&(d=A.value)}),h.safe(()=>{h.isReactiveState(v)?p=v.peek():me(v)&&(p=v.value)}),!(A===v&&d===p))if(m=!0,f==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const _=Me(v),c=_==null?"":String(_);e.value!==c&&(e.value=c)}else if(f==="checked"&&e instanceof HTMLInputElement)e.checked=!!Me(v);else if(f.startsWith("on")&&typeof v=="function"){const _=qe(f);typeof A=="function"&&F.removeListener(e,_,A),typeof v=="function"&&F.addListener(e,_,v);try{if(_&&_.startsWith("update:")){const c=_.split(":",2)[1],E=g[c];let T=[];try{if(h.isReactiveState(E)){const L=E.value;T=L&&typeof L=="object"?Object.keys(L):[]}else E&&typeof E=="object"&&(T=Object.keys(E))}catch{T=[]}const N=T.filter(L=>typeof L=="string"&&!L.startsWith("_")&&L!=="constructor");for(const L of N){const $=`update:${L}`,W=M=>{const z=M.detail!==void 0?M.detail:M.target instanceof HTMLInputElement||M.target instanceof HTMLTextAreaElement||M.target instanceof HTMLSelectElement?M.target.value:void 0,x={...h.isReactiveState(E)?E.value||{}:g[c]||{},[L]:z};try{typeof v=="function"&&v({detail:x})}catch{}};h.safe(()=>{F.addListener(e,$,W)})}}}catch{}}else if(v==null)P.removeAttributeSmart(e,f);else{const _=n?.isCustomElement??i?.isCustomElement??!1;if(_||f in e)try{e[f]=v,f==="disabled"&&v===!1&&!_&&V(e)&&P.removeAttributeSmart(e,"disabled")}catch{}else v===!1&&P.removeAttributeSmart(e,f)}}const R=t.listeners??{},l=_e.get(e)??{};for(const[f,A]of Object.entries(l))F.removeListener(e,f,A);for(const[f,A]of Object.entries(R))F.addListener(e,f,A);Object.keys(R).length>0?_e.set(e,R):_e.delete(e);const k={...i.attrs??{}},w=y,S=t&&t.attrs||{};if(Object.prototype.hasOwnProperty.call(S,"class")&&typeof e.getAttribute=="function"){const f=e.getAttribute("class");f!==null&&(k.class=f)}if(Object.prototype.hasOwnProperty.call(S,"style")&&typeof e.getAttribute=="function"){const f=e.getAttribute("style");f!==null&&(k.style=f)}try{if(Object.prototype.hasOwnProperty.call(S,"class")&&S.class===void 0&&typeof e.getAttribute=="function"){const f=e.getAttribute("class");f!==null&&(k.class=f)}if(Object.prototype.hasOwnProperty.call(S,"style")&&S.style===void 0&&typeof e.getAttribute=="function"){const f=e.getAttribute("style");f!==null&&(k.style=f)}try{if(typeof e.getAttribute=="function"){const f=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&f!==null&&f!==k.class&&(k.class=f)}catch{}}}catch{}}catch{}for(const f in{...k,...w}){const A=k[f],v=w[f];let d=A,p=v;if(h.isReactiveState(A)&&(d=A.peek()),h.isReactiveState(v)&&(p=v.peek()),d!==p)if(m=!0,p==null||p===!1)h.safe(()=>{P.removeAttributeSmart(e,f)}),X(i,f,void 0),f==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?h.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?h.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&h.safe(()=>{e.value=0})),f==="checked"&&e instanceof HTMLInputElement&&h.safe(()=>{e.checked=!1}),f==="disabled"&&V(e)&&h.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(f==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){h.safe(()=>{e.value=p??""});continue}else if(e instanceof HTMLSelectElement){h.safe(()=>{e.value=p??""});continue}else if(e instanceof HTMLProgressElement){h.safe(()=>{e.value=Number(p)});continue}}if(f==="checked"&&e instanceof HTMLInputElement){h.safe(()=>{e.checked=!!p});continue}if(f==="style"){const c=h.safeSerializeAttr(p);c!==null&&P.setAttributeSmart(e,f,String(c)),X(i,f,p);continue}if(f==="class"){const c=h.safeSerializeAttr(p);c!==null&&P.setAttributeSmart(e,f,String(c)),X(i,f,p);continue}if(f==="disabled"&&V(e)){h.safe(()=>{const c=ie(p);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=c)}),ie(p)?h.safe(()=>{P.setAttributeSmart(e,f,"")}):h.safe(()=>{P.removeAttributeSmart(e,f)});continue}const _=e.namespaceURI==="http://www.w3.org/2000/svg";if(b&&!_&&f.includes("-"))if(h.isClassLikeAttr(f)){const c=h.safeSerializeAttr(v??p);if(c!==null){try{P.setAttributeSmart(e,f,String(c))}catch{}X(i,f,p)}}else{const c=h.toCamel(f);try{const E=e;E[c]=h.isReactiveState(v)?v:p,X(i,f,p)}catch{const E=h.safeSerializeAttr(v??p);E!==null&&P.setAttributeSmart(e,f,String(E))}}else if(!_&&f in e)try{const c=e;c[f]=h.isReactiveState(v)?v:p,X(i,f,p)}catch{const c=h.safeSerializeAttr(p);c!==null&&(P.setAttributeSmart(e,f,String(c)),X(i,f,p))}else{const c=h.safeSerializeAttr(p);c!==null&&(P.setAttributeSmart(e,f,String(c)),X(i,f,p))}}}try{if(V(e)){const f=a.disabled;let A;try{const d=Object.prototype.hasOwnProperty.call(t.props||{},"disabled"),p=f&&typeof f=="object"&&"value"in f;let _=!1;h.safe(()=>{_=!!h.isReactiveState(f)});const c=Re(f);_||p||d||c?A=f:A=y.disabled}catch{A=y.disabled}const v=ie(A);h.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=v)}),v?h.safe(()=>{P.setAttributeSmart(e,"disabled","")}):h.safe(()=>{P.removeAttributeSmart(e,"disabled")})}}catch{}if(b&&m){const f=e;h.safe(()=>{f._applyProps?.(f._cfg)}),h.safe(()=>{typeof f.requestRender=="function"?f.requestRender():typeof f._render=="function"&&f._render?.(f._cfg)})}}function q(e,i,n,s=null){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const l=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&K(l,e.key),l}if(e.tag==="#raw"){const l=typeof e.children=="string"?e.children:"";return O.devWarn("[#raw] Inserting unsanitized HTML. Ensure the content is trusted or sanitized before use — unsanitized input can lead to XSS vulnerabilities."),document.createRange().createContextualFragment(l)}if(e.tag==="#anchor"){const l=e,k=Array.isArray(l.children)?l.children:[],w=document.createTextNode(""),S=document.createTextNode("");l.key!=null&&(K(w,`${l.key}:start`),K(S,`${l.key}:end`)),l._startNode=w,l._endNode=S;const f=document.createDocumentFragment();f.appendChild(w);for(const A of k){const v=q(A,i,n,s);if(l.key!=null&&v instanceof Element&&!v.hasAttribute("data-anchor-key")){const d=A;d&&typeof d=="object"&&d.key!=null||K(v,String(l.key))}f.appendChild(v)}return f.appendChild(S),f}const r=e&&typeof e=="object"&&e.props&&e.props.attrs?e.props.attrs:void 0,o=(r&&typeof r.xmlns=="string"?String(r.xmlns):void 0)??s??P.TAG_NAMESPACE_MAP[e.tag]??null,t=o?document.createElementNS(o,e.tag):document.createElement(e.tag);e.key!=null&&K(t,e.key),e.props&&e.props?._transitionGroup&&vt(t,e.props?._transitionGroup);const{props:a={},attrs:y={},directives:u={}}=e.props??{},g=Fe(u,i,t instanceof HTMLElement?t:void 0,y),b={...a,...g.props},m={...y,...g.attrs};try{const l=h.safeSerializeAttr((m&&m.class)??(b&&b.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class));if(l!==null){const k=String(l).trim();k&&P.setAttributeSmart(t,"class",k)}}catch{}try{if(b.disabled!==void 0&&t&&V(t)){const l=b.disabled,k=l&&typeof l=="object"&&"value"in l;let w=!1;try{w=h.isReactiveState(l)}catch{w=!1}!k&&!w&&h.safe(()=>{m.disabled=l,delete b.disabled})}}catch{}const C=t.namespaceURI==="http://www.w3.org/2000/svg";for(const l in m){const k=m[l];if(typeof l!="string"||/\[object Object\]/.test(l))continue;const w=Me(k);if(typeof w=="boolean")w?P.setAttributeSmart(t,l,""):h.safe(()=>{P.removeAttributeSmart(t,l)});else if(w!=null){if(l==="disabled"&&V(t)){const S=b.disabled,f=ie(Re(S)?S:w);h.safe(()=>{t.disabled=f}),f?h.safe(()=>{P.setAttributeSmart(t,l,"")}):h.safe(()=>{P.removeAttributeSmart(t,l)});continue}if(!C&&l==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement||t instanceof HTMLProgressElement))try{t instanceof HTMLProgressElement?t.value=Number(w):t.value=String(w??"")}catch{const S=h.safeSerializeAttr(w);S!==null&&P.setAttributeSmart(t,l,String(S))}else if(!C&&l==="checked"&&t instanceof HTMLInputElement)try{t.checked=!!w}catch{const S=h.safeSerializeAttr(w);S!==null&&P.setAttributeSmart(t,l,String(S))}else if(!C&&l in t)try{t[l]=w,l==="disabled"&&w===!1&&V(t)&&P.removeAttributeSmart(t,"disabled"),X(e.props,l,w)}catch{const S=h.safeSerializeAttr(w);S!==null&&P.setAttributeSmart(t,l,String(S))}else if((e.props?.isCustomElement??!1)&&!C&&l.includes("-")){const S=h.toCamel(l);try{t[S]=w}catch{const f=h.safeSerializeAttr(w);f!==null&&P.setAttributeSmart(t,l,String(f))}}else{const S=h.safeSerializeAttr(w);S!==null&&P.setAttributeSmart(t,l,String(S))}}}for(const l in b){const k=b[l];if(!(typeof l!="string"||/\[object Object\]/.test(l)))if(l==="value"&&(t instanceof HTMLInputElement||t instanceof HTMLTextAreaElement||t instanceof HTMLSelectElement)){const w=typeof k=="object"&&k!==null&&me(k)?k.value:k;h.safe(()=>{t.value=String(w??"")})}else if(l.startsWith("on")&&typeof k=="function"){const w=qe(l),S=w.includes(":")?(()=>{const f=w.split(":"),A=f[1];if(A.includes("-")){const v=A.split("-").map((d,p)=>p===0?d:d.charAt(0).toUpperCase()+d.slice(1)).join("");return`${f[0]}:${v}`}else{const v=A.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${f[0]}:${v}`}})():w;g.listeners&&(g.listeners[w]||g.listeners[S])||F.addListener(t,w,k)}else{if(l.startsWith("on")&&k===void 0)continue;if(k==null||k===!1)P.removeAttributeSmart(t,l);else{const w=e.props?.isCustomElement??!1,S=typeof k=="object"&&k!==null&&h.isReactiveState(k)?k:me(k)&&typeof k.value<"u"?k.value:k;if(l==="class"||l==="style"){try{const f=h.safeSerializeAttr(S);f!==null&&P.setAttributeSmart(t,l,String(f))}catch{}continue}if(w||l in t)try{const f=typeof k=="object"&&k!==null&&h.isReactiveState(k)?k:me(k)?k.value:k;if(l==="disabled"&&V(t)){const A=ie(b.disabled!==void 0?b.disabled:f);h.safe(()=>{t.disabled=A}),A?h.safe(()=>{P.setAttributeSmart(t,l,"")}):h.safe(()=>{P.removeAttributeSmart(t,l)});continue}try{if(typeof t[l]=="boolean"){let A=f;typeof f=="string"?f==="false"?A=!1:f==="true"?A=!0:A=!!f&&f!=="":A=!!f,t[l]=A}else t[l]=f}catch{t[l]=f}}catch{}}}}const R=g.listeners??{};for(const[l,k]of Object.entries(R))F.addListener(t,l,k);Object.keys(R).length>0&&_e.set(t,R),he({...e,props:{...e.props,...g.props}},t,n);try{const l=t;if(typeof l._applyProps=="function")try{l._applyProps(l._cfg)}catch{}typeof l.requestRender=="function"?l.requestRender():typeof l._render=="function"&&l._render(l._cfg)}catch{}if(Array.isArray(e.children)){const l=e.tag==="foreignObject"&&o==="http://www.w3.org/2000/svg"?null:t.namespaceURI??null;for(const k of e.children)t.appendChild(q(k,i,n,l))}else typeof e.children=="string"&&(t.textContent=e.children);try{if(t instanceof HTMLSelectElement&&m&&Object.prototype.hasOwnProperty.call(m,"value"))try{t.value=String(m.value??"")}catch{}}catch{}try{if(V(t)){const l=b.disabled,k=m.disabled,w=l&&typeof l=="object"&&"value"in l;let S=!1;try{S=!!h.isReactiveState(l)}catch{S=!1}const f=ie(S||w||Re(l)?l:k);h.safe(()=>{t.disabled=f}),f?h.safe(()=>{P.setAttributeSmart(t,"disabled","")}):h.safe(()=>{P.removeAttributeSmart(t,"disabled")})}}catch{}return t}function St(e,i,n,s,r){if(typeof n=="string"){e.textContent!==n&&(e.textContent=n);return}if(!Array.isArray(n))return;const o=e.childNodes,t=[];for(let l=0;l<o.length;l++)t.push(o[l]);const a=Array.isArray(i)?i:[],y=bt(e);if(y){const l=S=>{if(typeof S=="string")return S.startsWith("each-")?S.substring(5):S;if(typeof S=="number")return String(S)},k=[],w=[];for(const S of n)if(S&&S.tag==="#anchor"){const f=Array.isArray(S.children)?S.children:[];for(const A of f){const v=l(A.key??S.key??"unknown");k.push({...A,key:v})}}else S&&k.push({...S,key:l(S.key)});for(const S of a)if(S&&S.tag==="#anchor"){const f=Array.isArray(S.children)?S.children:[];for(const A of f){const v=l(A.key??S.key??"unknown");w.push({...A,key:v})}}else S&&w.push({...S,key:l(S.key)});if(k.some(S=>S&&S.key!=null)||w.some(S=>S&&S.key!=null)){const S=new Map,f=new Map;for(const c of w)if(c&&c.key!=null){const E=String(c.key);S.set(E,c)}for(let c=0;c<t.length;c++){const E=t[c];let T=Ce(E);if(T=l(T),T!=null&&E instanceof Element&&E.nodeType===Node.ELEMENT_NODE){let N=typeof T=="string"&&T.includes(":")?T.substring(0,T.lastIndexOf(":")):T;N=String(N),f.set(N,E)}}const A=new Set,v=new Map,d=t.length>0;if(y.moveClass&&d)for(let c=0;c<t.length;c++){const E=t[c];if(E instanceof HTMLElement&&E.parentElement){const T=E.getBoundingClientRect();v.set(E,T)}}const p=[];for(const c of k){let E=c.key;if(E==null)continue;E=String(E);const T=S.get(E);let N=f.get(E);if(N&&T){const L=ye(N,T,c,s);A.add(N),K(L,String(E)),p.push({node:L,key:E,newVNode:c,oldVNode:T,isNew:!1})}else{N=q(c,s,void 0,e instanceof Element?e.namespaceURI??null:null),K(N,String(E)),e.appendChild(N);const L=d||y.appear===!0;N instanceof HTMLElement&&L&&pe(N,y).catch($=>{O.devError("Enter transition error:",$)}),p.push({node:N,key:E,newVNode:c,isNew:!0})}}const _=[];for(let c=0;c<t.length;c++){const E=t[c],T=Ce(E);if(!A.has(E)&&T!=null&&E instanceof HTMLElement){const N=Ne(E,y).then(()=>{e.contains(E)&&e.removeChild(E)}).catch(L=>{O.devError("Leave transition error:",L),e.contains(E)&&e.removeChild(E)});_.push(N)}}if(_.length===0){let c=e.firstChild;for(const{node:E}of p)E!==c&&e.insertBefore(E,c),c=E.nextSibling;if(y.moveClass&&v.size>0){const E=[];for(const{node:T,isNew:N}of p)if(!N&&T instanceof HTMLElement){const L=v.get(T);if(L){const $=T.getBoundingClientRect(),W=L.left-$.left,M=L.top-$.top;if(W!==0||M!==0){const z=y.moveClass.split(/\s+/).filter(x=>x);E.push({node:T,deltaX:W,deltaY:M,moveClasses:z})}}}if(E.length>0){for(const{node:T,deltaX:N,deltaY:L}of E)T.style.transform=`translate(${N}px, ${L}px)`,T.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:T,moveClasses:N}of E)for(const L of N)T.classList.add(L);requestAnimationFrame(()=>{const T=y.moveClass||"",N=T.match(/duration-(\d+)/),L=N?`${N[1]}ms`:"300ms",$=T.match(/ease-(out|in|in-out|linear)/),W=$?`ease-${$[1]}`:"ease-out";for(const{node:M}of E)M.style.transition=`transform ${L} ${W}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:z}of E){M.style.removeProperty("transform");const x=()=>{for(const G of z)M.classList.remove(G);M.style.removeProperty("transition"),M.removeEventListener("transitionend",x),M.removeEventListener("transitioncancel",x)};M.addEventListener("transitionend",x,{once:!0}),M.addEventListener("transitioncancel",x,{once:!0})}})})})})}}}return}}const u=new Map;for(const l of a)l&&l.key!=null&&u.set(l.key,l);const g=new Map;for(let l=0;l<t.length;l++){const k=t[l],w=Ce(k);w!=null&&g.set(w,k)}const b=new Set;let m=e.firstChild;function C(l,k){let w=l;for(;w&&(b.add(w),w!==k);)w=w.nextSibling}function R(l,k,w,S,f,A=!0){const v=[];let d=l.nextSibling;for(;d&&d!==k;)v.push(d),d=d.nextSibling;const p=Array.isArray(w)?w:[];if(S.some(_=>_&&_.key!=null)||p.some(_=>_&&_.key!=null)){const _=new Map,c=new Map;for(const L of p)L&&L.key!=null&&_.set(L.key,L);for(const L of v){const $=Ce(L);$!=null&&c.set($,L)}const E=f&&f.state==="visible"&&p.length===0&&S.length>0,T=new Set;let N=l.nextSibling;for(const L of S){if(typeof L=="object"&&L.tag==="#anchor"){const W=L.key,M=`${W}:start`,z=`${W}:end`,x=c.get(M),G=c.get(z),H=Array.isArray(L.children)?L.children:[],j=_.get(W);let B,I;if(x&&G&&e.contains(x))B=x,I=G,R(B,I,j?.children,H);else{B=document.createTextNode(""),I=document.createTextNode(""),K(B,M),K(I,z),e.insertBefore(B,N);for(const Ae of H){const D=q(Ae,s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(D,N),T.add(D)}e.insertBefore(I,N)}let J=B;for(;J&&(T.add(J),J!==I);)J=J.nextSibling;L._startNode=B,L._endNode=I,N=I.nextSibling;continue}let $;if(L.key!=null&&c.has(L.key)){const W=_.get(L.key);$=ye(c.get(L.key),W,L,s),T.add($),f&&$ instanceof HTMLElement&&E&&f.appear&&pe($,f).catch(M=>{O.devError("Transition enter error (appear):",M)}),$!==N&&e.contains($)&&e.insertBefore($,N)}else $=q(L,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore($,N),T.add($),f&&$ instanceof HTMLElement&&A&&pe($,f).catch(W=>{O.devError("Transition enter error:",W)});N=$.nextSibling}for(const L of v)!T.has(L)&&e.contains(L)&&(f&&L instanceof HTMLElement&&A?Ne(L,f).then(()=>{e.contains(L)&&e.removeChild(L)}).catch($=>{O.devError("Transition leave error:",$),e.contains(L)&&e.removeChild(L)}):e.removeChild(L))}else{const _=Math.min(p.length,S.length);for(let c=0;c<_;c++){const E=p[c],T=S[c],N=ye(v[c],E,T,s);N!==v[c]&&(e.insertBefore(N,v[c]),e.removeChild(v[c]))}for(let c=_;c<S.length;c++){const E=q(S[c],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(E,k),f&&E instanceof HTMLElement&&A&&pe(E,f).catch(T=>{O.devError("Transition enter error:",T)})}for(let c=_;c<v.length;c++){const E=v[c];f&&E instanceof HTMLElement&&A?Ne(E,f).then(()=>{e.contains(E)&&e.removeChild(E)}).catch(T=>{O.devError("Transition leave error:",T),e.contains(E)&&e.removeChild(E)}):e.removeChild(E)}}}for(const l of n){let k;if(l.tag==="#anchor"){const w=l.key,S=`${w}:start`,f=`${w}:end`;let A=g.get(S),v=g.get(f);const d=Array.isArray(l.children)?l.children:[];if(A||(A=document.createTextNode(""),K(A,S)),v||(v=document.createTextNode(""),K(v,f)),l._startNode=A,l._endNode=v,!e.contains(A)||!e.contains(v)){e.insertBefore(A,m);const p=l._transition,_=!(p&&p.state==="visible"&&d.length>0)||p.appear;for(const c of d){const E=q(c,s,r,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(E,m),p&&E instanceof HTMLElement&&_&&pe(E,p).catch(T=>{O.devError("Transition enter error:",T)})}e.insertBefore(v,m)}else{const p=l._transition,_=u.get(w)._transition,c=_&&_.state!==p?.state,E=p&&p.state==="visible"&&d.length>0&&!c,T=c||!E||p?.appear===!0;R(A,v,u.get(w)?.children,d,p,T)}C(A,v),m=v.nextSibling;continue}if(l.key!=null&&g.has(l.key)){const w=u.get(l.key);k=ye(g.get(l.key),w,l,s,r),b.add(k),k!==m&&e.contains(k)&&(m&&!e.contains(m)&&(m=null),e.insertBefore(k,m))}else k=q(l,s,r,e instanceof Element?e.namespaceURI??null:null),m&&!e.contains(m)&&(m=null),e.insertBefore(k,m),b.add(k);m=k.nextSibling}for(let l=0;l<t.length;l++){const k=t[l];!b.has(k)&&e.contains(k)&&(se(k,r),e.removeChild(k))}}function ye(e,i,n,s,r){if(i&&typeof i!="string"&&i.props?.ref&&r&&se(e,r),i===n)return e;if(typeof n=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==n&&(e.textContent=n),e;{const t=document.createTextNode(n);return e.parentNode?.replaceChild(t,e),t}}if(n&&typeof n!="string"&&n.tag==="#anchor"){const t=n,a=Array.isArray(t.children)?t.children:[],y=t._startNode??document.createTextNode(""),u=t._endNode??document.createTextNode("");t.key!=null&&(K(y,`${t.key}:start`),K(u,`${t.key}:end`)),t._startNode=y,t._endNode=u;const g=document.createDocumentFragment();g.appendChild(y);for(const b of a){const m=q(b,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);g.appendChild(m)}return g.appendChild(u),e.parentNode?.replaceChild(g,e),y}if(!n){se(e,r);const t=document.createComment("removed");return e.parentNode?.replaceChild(t,e),t}if(!i||typeof i=="string"){se(e,r);const t=q(n,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return he(n,t,r),e.parentNode?.replaceChild(t,e),t}if(n.tag==="#anchor"){const t=Array.isArray(n.children)?n.children:[],a=n._startNode??document.createTextNode(""),y=n._endNode??document.createTextNode("");n.key!=null&&(K(a,`${n.key}:start`),K(y,`${n.key}:end`)),n._startNode=a,n._endNode=y;const u=document.createDocumentFragment();u.appendChild(a);for(const g of t)u.appendChild(q(g,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return u.appendChild(y),e.parentNode?.replaceChild(u,e),a}if(typeof i!="string"&&typeof n!="string"&&i.tag===n.tag&&i.key===n.key){const t=e;return Be(t,i.props||{},n.props||{},s),St(t,i.children,n.children,s,r),he(n,t,r),t}if(typeof i!="string"&&typeof n!="string"&&i.tag===n.tag&&(i.tag&&String(i.tag).includes("-")||n.props&&n.props.isCustomElement||i.props&&i.props.isCustomElement))try{const t=e;return Be(t,i.props||{},n.props||{},s),he(n,t,r),t}catch{}se(e,r);const o=q(n,s,r,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return he(n,o,r),e.parentNode?.replaceChild(o,e),o}function Ze(e,i,n,s){let r;Array.isArray(i)?i.length===1?(r=i[0],r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})):r={tag:"div",key:"__root__",children:i}:(r=i,r&&typeof r=="object"&&r.key==null&&(r={...r,key:"__root__"})),r&&typeof r=="object"&&r.tag==="#anchor"&&(r={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[r]}),r=$e(r,String(r.key??"root"));const o=e._prevVNode??null,t=e._prevDom??e.firstChild??null;let a;o&&t?typeof o!="string"&&typeof r!="string"&&o.tag===r.tag&&o.key===r.key?a=ye(t,o,r,n,s):(a=q(r,n,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(a,t)):(a=q(r,n,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const y=[];for(let u=0;u<e.childNodes.length;u++){const g=e.childNodes[u];g!==a&&g.nodeName!=="STYLE"&&(se(g,s),y.push(g))}y.forEach(u=>e.removeChild(u)),e._prevVNode=r&&typeof r=="object"&&r.props?{...r,props:{...r.props,attrs:r.props.attrs?{...r.props.attrs}:void 0,props:r.props.props?{...r.props.props}:void 0}}:r,e._prevDom=a}var ge=[],ze=new WeakMap,le=new WeakMap;function Et(e,i){le.has(e)||le.set(e,new Set),le.get(e).add(i)}function Ct(e,i){const n=le.get(e);n&&(n.delete(i),n.size===0&&le.delete(e))}function kt(e,i,n,s,r,o,t,a){if(e){ge.push(n);try{const y=i.render(n);if(y instanceof Promise){o(!0);const u=e.host.isConnected,g=e,b=g._asyncRenderToken=(g._asyncRenderToken??0)+1;y.then(m=>{u&&!e.host.isConnected||g._asyncRenderToken===b&&(o(!1),t(null),De(e,m,n,s,r),a(e.innerHTML))}).catch(m=>{if(u&&!e.host.isConnected||g._asyncRenderToken!==b)return;o(!1);const C=m instanceof Error?m:new Error(String(m));O.devError(`[${e.host.tagName.toLowerCase()}] Async render error:`,C),t(C)});return}De(e,y,n,s,r),a(e.innerHTML)}catch(y){const u=y instanceof Error?y:new Error(String(y));O.devError(`[${e.host.tagName.toLowerCase()}] Render error:`,u),t(u)}finally{ge.pop()}}}function De(e,i,n,s,r){e&&(Ze(e,Array.isArray(i)?i:[i],n,s),r(e.innerHTML))}function _t(e,i,n,s,r,o,t){o!==null&&clearTimeout(o);const a=Date.now()-i<16,{isVitest:y,isCypress:u,isTest:g}=h.detectTestEnvironment(),b=(y||g)&&!u;if(a){const R=n+1;r(R);const l=g?50:10,k=g?100:25,w=b?12:50;if(R===l&&!g)O.devWarn(`⚠️ Component rendering frequently. Performance may be impacted.
2
+ Common causes:
3
+ • State updates during render cycle
4
+ • Event handlers with immediate function calls
5
+ • Missing effect dependencies`);else if(R===k&&!g)O.devWarn(`⚠️ Component is re-rendering rapidly. Applying throttling.
6
+ This might indicate:
7
+ • Event handler calling function immediately: @click="\${fn()}" should be @click="\${fn}"
8
+ • State modification during render
9
+ • Missing dependencies in computed/watch`);else if(R>=w){O.devError(`🛑 Infinite render loop detected. Stopping to prevent browser freeze.
10
+ Possible causes:
11
+ • State updates triggering immediate re-renders
12
+ • Computed values changing during evaluation
13
+ • Circular dependencies in reactive system`),t(null);return}}else r(0);let m=0;g||(n>=40?m=500:n>=25?m=100:n>=15&&(m=16));const C=()=>{s(Date.now());try{e()}catch(R){O.devError("Error during render execution:",R)}finally{t(null)}};m>0?t(setTimeout(C,m)):g?C():(t({}),queueMicrotask(C))}function At(e,i){let n=i;try{const s=le.get(e);if(s?.size)for(const r of s)try{const o=r.lastHtmlStringForJitCSS;o?.trim()&&(n+=`
14
+ `+o)}catch{}else{const r=e.querySelectorAll("*");for(const o of r)try{const t=o.lastHtmlStringForJitCSS;t?.trim()&&(n+=`
15
+ `+t)}catch{}}}catch{}return n}function Tt(e){return"adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype}function Ue(e,i){let n=e.querySelector("style[data-cer-runtime]");n||(n=document.createElement("style"),P.setAttributeSmart(n,"data-cer-runtime","true"),e.appendChild(n));try{n.textContent=i}catch{}}function wt(e,i,n,s,r){if(!e)return;const o=At(e,n);if(ze.get(e)===o)return;ze.set(e,o);const t=U.isJITCSSActiveFor(e)?U.processJITCSS(o):"",a=U.getProseStyleSheet(),y=i._computedStyle,u=Tt(e),g=Qe.getTransitionStyleSheet();let b="";if(!u)try{g?.cssRules&&(b=Array.from(g.cssRules).map(C=>C.cssText).join(`
16
+ `))}catch{b=""}if(!t?.trim()&&!y&&!a){if(r(null),u)e.adoptedStyleSheets=[U.getBaseResetSheet(),g];else{Ue(e,U.minifyCSS(`${U.minifyCSS(U.baseReset)}
17
+ ${b}`));try{e.adoptedStyleSheets=[U.getBaseResetSheet(),g]}catch{}}return}let m="";if(y&&(m+=y+`
18
+ `),t&&(m+=t+`
19
+ `),m=U.sanitizeCSS(m),m=U.minifyCSS(m),u){let C=s;C||(C=new CSSStyleSheet);try{C.replaceSync(m);const R=[U.getBaseResetSheet(),g];a&&R.push(a),R.push(C),e.adoptedStyleSheets=R,r(C);return}catch{}}Ue(e,U.minifyCSS(`${U.minifyCSS(U.baseReset)}
20
+ ${b}
21
+ ${m}`));try{const C=[U.getBaseResetSheet(),g];if(a&&C.push(a),typeof CSSStyleSheet<"u")try{const R=new CSSStyleSheet;R.replaceSync(m),C.push(R)}catch{C.push({cssRules:[],replaceSync:()=>{}})}e.adoptedStyleSheets=C}catch{}r(null)}function Lt(e,i){if(!i.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 hasError(){return this._hasError}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.shadowRoot||this.attachShadow({mode:"open"}),this._cfg=P.registry.get(e)||i,this._componentId=`${e}-${crypto.randomUUID()}`;const n=this._initContext(i),s=(o,t,a)=>{Object.defineProperty(o,t,{value:a,writable:!1,enumerable:!1,configurable:!1})};s(n,"refs",this._refs),s(n,"requestRender",()=>this.requestRender()),s(n,"_requestRender",()=>this._requestRender()),s(n,"_componentId",this._componentId),s(n,"_triggerWatchers",(o,t)=>this._triggerWatchers(o,t)),this.context=n,h.safe(()=>{s(n,"_host",this)}),s(this.context,"emit",(o,t,a)=>{const y={detail:t,bubbles:!0,composed:!0,...a||{}},u=new CustomEvent(o,y);this.dispatchEvent(u);const g=o.indexOf(":");if(g>0){const b=o.substring(0,g),m=o.substring(g+1),C=m.includes("-")?`${b}:${m.split("-").map((R,l)=>l===0?R:R.charAt(0).toUpperCase()+R.slice(1)).join("")}`:`${b}:${m.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;C!==o&&h.safe(()=>{this.dispatchEvent(new CustomEvent(C,y))})}return!u.defaultPrevented});const r=P.registry.get(e)||i;for(const o in r){const t=r[o];typeof t=="function"&&(this.context[o]=(...a)=>t(...a,this.context))}if(r.props)for(const o in r.props){let t=this[o];Object.defineProperty(this,o,{get(){return t},set(a){const y=t;t=a,this.context[o]=a,this._initializing||(this._applyProps(r),y!==a&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(r),this._applyProps(r),this._render(r)}connectedCallback(){this._runLogicWithinErrorBoundary(i,()=>{const n=this.getRootNode();n&&n!==document&&"host"in n&&Et(n,this);const s=this.getAttribute("data-cer-hydrate");if(s!=="none"){if(s==="idle"){const r=()=>this._hydrateNow(i);typeof requestIdleCallback<"u"?requestIdleCallback(r):setTimeout(r,200);return}if(s==="visible"){new IntersectionObserver((r,o)=>{r.some(t=>t.isIntersecting)&&(o.disconnect(),this._hydrateNow(i))},{rootMargin:"0px",threshold:0}).observe(this);return}this._applyProps(i),this._requestRender(),xe(i,this.context,this._mounted,r=>{this._mounted=r})}})}_hydrateNow(n){this._runLogicWithinErrorBoundary(n,()=>{this._applyProps(n),this._requestRender(),xe(n,this.context,this._mounted,s=>{this._mounted=s})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(i,()=>{const n=this.getRootNode();n&&n!==document&&"host"in n&&Ct(n,this),st(i,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},s=>{this._templateLoading=s},s=>{this._templateError=s},s=>{this._mounted=s}),h.reactiveSystem.cleanup(this._componentId)})}attributeChangedCallback(n,s,r){this._runLogicWithinErrorBoundary(i,()=>{this._applyProps(i),s!==r&&this._requestRender(),it(i,n,s,r,this.context)})}static get observedAttributes(){return i.props?Object.keys(i.props).map(h.toKebab):[]}_render(n){this._runLogicWithinErrorBoundary(n,()=>{kt(this.shadowRoot,n,this.context,this._refs,s=>{this._lastHtmlStringForJitCSS=s,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(s)},s=>{this._templateLoading=s,this?.onLoadingStateChange?.(s)},s=>{this._templateError=s,this?.onErrorStateChange?.(s)},s=>this._applyStyle(n,s))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{h.scheduleDOMUpdate(()=>{_t(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,n=>{this._lastRenderTime=n},n=>{this._renderCount=n},this._renderTimeoutId,n=>{this._renderTimeoutId=n})},this._componentId)})}_applyStyle(n,s){this._runLogicWithinErrorBoundary(n,()=>{wt(this.shadowRoot,this.context,s,this._styleSheet,r=>{this._styleSheet=r})})}_runLogicWithinErrorBoundary(n,s){try{s(),this._hasError=!1}catch(r){this._hasError=!0;try{const o=this.tagName?.toLowerCase?.()||"<unknown>",t=this._componentId||"<unknown-id>",a={};if(n&&n.props)for(const y of Object.keys(n.props))try{const u=this.context[y];u instanceof Node?a[y]=`[DOM Node: ${u.nodeName}]`:typeof u=="object"&&u!==null?a[y]=Object.keys(u).length>5?`[object(${Object.keys(u).length} keys)]`:u:a[y]=u}catch{a[y]="[unreadable]"}O.devError(`Error rendering component <${o}> (id=${t}):`,r),O.devError("Component props snapshot:",a),O.devWarn("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}if(n.onError&&n.onError(r,this.context),this.tagName.toLowerCase()!=="cer-error-boundary"){let o=this.parentElement;if(!o){const t=this.getRootNode();t instanceof ShadowRoot&&(o=t.host.parentElement)}for(;o;){if(o.tagName.toLowerCase()==="cer-error-boundary"){o._cerHandleChildError?.(r);break}let t=o.parentElement;if(!t){const a=o.getRootNode();a instanceof ShadowRoot&&(t=a.host.parentElement)}o=t}}}}_initContext(n){try{let o=function(t,a=""){if(Array.isArray(t))return new Proxy(t,{get(y,u,g){const b=Reflect.get(y,u,g);return typeof b=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...m){const C=b.apply(y,m);if(!r._initializing){const R=a||"root";r._triggerWatchers(R,y),h.scheduleDOMUpdate(()=>r._render(n),r._componentId)}return C}:b},set(y,u,g){if(y[String(u)]=g,!r._initializing){const b=a?`${a}.${String(u)}`:String(u);r._triggerWatchers(b,g),h.scheduleDOMUpdate(()=>r._render(n),r._componentId)}return!0},deleteProperty(y,u){if(delete y[String(u)],!r._initializing){const g=a?`${a}.${String(u)}`:String(u);r._triggerWatchers(g,void 0),h.scheduleDOMUpdate(()=>r._render(n),r._componentId)}return!0}});if(t&&typeof t=="object"){if(h.isReactiveState(t))return t;for(const y in t){const u=a?`${a}.${y}`:y;t[y]=o(t[y],u)}return new Proxy(t,{set(y,u,g){const b=a?`${a}.${String(u)}`:String(u);return y[String(u)]=o(g,b),r._initializing||(r._triggerWatchers(b,y[String(u)]),h.scheduleDOMUpdate(()=>r._render(n),r._componentId)),!0},get(y,u,g){return Reflect.get(y,u,g)}})}return t};var s=o;const r=this;return o({...n.props?Object.fromEntries(Object.entries(n.props).map(([t,a])=>[t,a.default])):{}})}catch{return{}}}_initWatchers(n){this._runLogicWithinErrorBoundary(n,()=>{et(this.context,this._watchers,{})})}_triggerWatchers(n,s){tt(this.context,this._watchers,n,s)}_applyProps(n){this._runLogicWithinErrorBoundary(n,()=>{rt(this,n,this.context)})}}}function ke(e,i,n,s){for(const r of n)try{r(...s)}catch(o){O.devError(`[${e}] Error in ${i} lifecycle hook:`,o)}}function Nt(e,i,n){P.initGlobalRegistryIfNeeded();let s=h.toKebab(e);s.includes("-")||(s=`cer-${s}`);const r={},o={props:{},hydrate:n?.hydrate,onConnected:t=>{if(r.onConnected)try{r.onConnected(t)}catch(a){O.devError(`[${s}] Error in onConnected lifecycle hook:`,a)}},onDisconnected:t=>{if(r.onDisconnected)try{r.onDisconnected(t)}catch(a){O.devError(`[${s}] Error in onDisconnected lifecycle hook:`,a)}},onAttributeChanged:(t,a,y,u)=>{if(r.onAttributeChanged)try{r.onAttributeChanged(t,a,y,u)}catch(g){O.devError(`[${s}] Error in onAttributeChanged lifecycle hook:`,g)}},onError:(t,a)=>{if(r.onError&&t)try{r.onError(t,a)}catch(y){O.devError(`[${s}] Error in onError handler (the error handler itself threw):`,y)}},render:t=>{const a=t,y=a._componentId||`${s}-${crypto.randomUUID()}`;h.reactiveSystem.setCurrentComponent(y,()=>{t.requestRender&&t.requestRender()});try{Object.defineProperty(t,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(t,"_computedStyle",{value:void 0,writable:!0,enumerable:!1,configurable:!0}),h.setCurrentComponentContext(t),He.resetWhenCounter();let u;try{u=i()}catch(g){try{const b=a._hookCallbacks?.onError;if(Array.isArray(b))for(const m of b)try{m(g)}catch{}else if(typeof b=="function")try{b(g)}catch{}}catch{}try{const b=a._host;if(b?.parentElement){let m=b.parentElement;for(;m;){if(m.tagName.toLowerCase()==="cer-error-boundary"){m._cerHandleChildError?.(g);break}let C=m.parentElement;if(!C){const R=m.getRootNode();typeof ShadowRoot<"u"&&R instanceof ShadowRoot&&(C=R.host.parentElement)}m=C}}}catch{}throw g}if(u==null)throw new Error(`[${s}] Component render function did not return a value. Make sure your component returns an html\`...\` template.`);if(a._hookCallbacks){const g=a._hookCallbacks;if(g.onConnected){const b=g.onConnected;r.onConnected=m=>{ke(s,"useOnConnected",b,[m])}}if(g.onDisconnected){const b=g.onDisconnected;r.onDisconnected=m=>{ke(s,"useOnDisconnected",b,[m])}}if(g.onAttributeChanged){const b=g.onAttributeChanged;r.onAttributeChanged=(m,C,R,l)=>{ke(s,"useOnAttributeChanged",b,[m,C,R,l])}}if(g.onError){const b=g.onError;r.onError=m=>{ke(s,"useOnError",b,[m])}}if(g.props&&!Object.keys(o.props??{}).length){const b=g.props;o.props=Object.fromEntries(Object.entries(b).map(([m,C])=>[m,{type:typeof C=="boolean"?Boolean:typeof C=="number"?Number:typeof C=="string"?String:Function,default:C}])),P.registry.set(s,o)}}return u}finally{h.clearCurrentComponentContext(),h.reactiveSystem.clearCurrentComponent()}}};if(P.registry.set(s,o),typeof window<"u"){try{const t={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};h.setCurrentComponentContext(t),h.beginDiscoveryRender(),He.resetWhenCounter();try{i()}catch(a){try{const y=t?._hookCallbacks?.onError;if(Array.isArray(y))for(const u of y)try{u(a)}catch{}else if(typeof y=="function")try{y(a)}catch{}O.devError(`Error during component discovery render <${s}>:`,a),O.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw a}finally{h.endDiscoveryRender(),h.clearCurrentComponentContext()}if(t._hookCallbacks?.props){const a=t._hookCallbacks.props;o.props=Object.fromEntries(Object.entries(a).map(([y,u])=>[y,{type:typeof u=="boolean"?Boolean:typeof u=="number"?Number:typeof u=="string"?String:Function,default:u}])),P.registry.set(s,o)}}catch(t){O.devWarn(`[${s}] Failed to register component. Check your component definition for errors.`,t)}typeof customElements<"u"&&!customElements.get(s)&&customElements.define(s,Lt(s,o))}}function Q(e,i={},n,s){return{tag:e,key:s??i.key,props:i,children:n}}function be(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function re(e){return typeof e=="object"&&e!==null&&"tag"in e&&!be(e)}function Mt(e,i){return e.key!=null?e:{...e,key:i}}function Rt(e,i){if(e==null){O.devWarn(`⚠️ Event handler for '@${i}' is ${e}. This will prevent the event from working. Use a function reference instead: @${i}="\${functionName}"`);return}typeof e!="function"&&O.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${i}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${i}="\${functionName()}" to @${i}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&O.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${i}="\${fn}" not @${i}="\${fn()}"`)}function $t(e,i=[],n={}){const s={},r={},o={},t=[],a=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g;let y;for(;y=a.exec(e);){const u=y[1],g=y[2];let b="";for(let w=3;w<y.length;w++)if(y[w]!==void 0){b=y[w];break}b.length>=2&&(b[0]==='"'&&b[b.length-1]==='"'||b[0]==="'"&&b[b.length-1]==="'")&&(b=b.slice(1,-1));const m=!/=/.test(y[0]),C=b.match(/^{{(\d+)}}$/),R=!C&&/{{(\d+)}}/.test(b);let l=m?!0:C?i[Number(C[1])]??null:R?b.replace(/{{(\d+)}}/g,(w,S)=>String(i[Number(S)]??"")):b;!C&&!R&&(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const k=["model","bind","show","class","style","ref","when"];if(u===":"){const[w,S]=g.split(":"),[f,...A]=w.split(".");if(k.includes(f)){const v=[...A],d=f==="model"&&S?`model:${S}`:f;o[d]={value:l,modifiers:v,arg:S}}else if(g==="disabled"){let v=l;v&&h.isReactiveState(v)&&(v=v.value);const d=typeof v;if(v===""||d==="boolean"||d==="string"&&(v==="true"||v==="false")||v==null||d==="number")s[g]=v;else{let p=l;p&&h.isReactiveState(p)&&(p=p.value),r[g]=p}t.push(g)}else{let v=l;v&&h.isReactiveState(v)&&(v=v.value),r[g]=v,t.push(g)}}else if(u==="@"){const[w,...S]=g.split("."),f=S;Rt(l,w);const A=typeof l=="function"?l:typeof n[l]=="function"?n[l]:void 0;if(A){const v=p=>{if(f.includes("prevent")&&p.preventDefault(),f.includes("stop")&&p.stopPropagation(),!(f.includes("self")&&p.target!==p.currentTarget))return f.includes("once")&&p.currentTarget?.removeEventListener(w,v),A(p)},d="on"+w.charAt(0).toUpperCase()+w.slice(1);s[d]=v}}else g==="ref"?s.ref=l:r[g]=l}return{props:s,attrs:r,directives:o,bound:t}}function je(e){if(!re(e)||be(e))return e;const i=e.props?.directives;if(i&&i.when){const n=i.when.value,s=h.isReactiveState(n)?n.value:n,r={...i};delete r.when;const o={...e.props};Object.keys(r).length>0?o.directives=r:delete o.directives;const t={...e,props:o};return Array.isArray(t.children)&&(t.children=t.children.map(a=>typeof a=="object"&&a!==null?je(a):a)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:s?[t]:[]}}if(Array.isArray(e.children)){const n=e.children.map(s=>typeof s=="object"&&s!==null?je(s):s);return{...e,children:n}}return e}function jt(e,i,n){const s=ge.length>0?ge[ge.length-1]:void 0,r=n??s,o=!n&&i.length===0,t=o?e.join("<!--TEMPLATE_DELIM-->"):null;if(o&&t){const c=Le.get(t);if(c)return c}function a(c,E){return Q("#text",{},c,E)}function y(c,E,T=!1){let N=typeof c=="string"?h.decodeEntities(c):c;return!T&&typeof N=="string"&&/[\r\n]/.test(N)&&(N=N.replace(/\s+/g," ")),Q("#text",{},N,E)}let u="";for(let c=0;c<e.length;c++)u+=e[c],c<i.length&&(u+=`{{${c}}}`);const g=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,b=[];let m,C=[],R=null,l={},k,w=0;const S=[],f=new Set(["pre","code","textarea","script","style"]);function A(){if(R&&f.has(R.toLowerCase()))return!0;for(const c of b)if(f.has(c.tag.toLowerCase()))return!0;return!1}function v(c){if(!c||typeof c!="object"||be(c))return;const E=c,T=l;if(E.props||E.attrs){const N=E;N.props&&(T.props||(T.props={}),Object.assign(T.props,N.props)),N.attrs&&(T.attrs||(T.attrs={}),Object.keys(N.attrs).forEach(L=>{if(L==="style"&&T.attrs.style){const $=String(T.attrs.style).replace(/;?\s*$/,""),W=String(N.attrs.style).replace(/^;?\s*/,"");T.attrs.style=$+"; "+W}else if(L==="class"&&T.attrs.class){const $=String(T.attrs.class).trim().split(/\s+/).filter(Boolean),W=String(N.attrs.class).trim().split(/\s+/).filter(Boolean),M=[...new Set([...$,...W])];T.attrs.class=M.join(" ")}else T.attrs[L]=N.attrs[L]}))}else T.props||(T.props={}),Object.assign(T.props,E)}function d(c,E){const T=R?C:S;if(be(c)){const N=c.key??E,L=c.children;T.push({...c,key:N,children:L});return}if(re(c)){T.push(Mt(c,void 0));return}if(Array.isArray(c)){if(c.length===0)return;for(let N=0;N<c.length;N++){const L=c[N];be(L)||re(L)||Array.isArray(L)?d(L,`${E}-${N}`):L!==null&&typeof L=="object"?h.isUnsafeHTML(L)?T.push(Q("#raw",{},L.__rawHTML,`${E}-${N}`)):v(L):T.push(a(String(L),`${E}-${N}`))}return}if(c!==null&&typeof c=="object"){if(h.isUnsafeHTML(c)){const N=c.__rawHTML??"";T.push(Q("#raw",{},N,E));return}v(c);return}T.push(a(String(c),E))}const p=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;m=g.exec(u);)if(!(m[0].startsWith("<!--")&&m[0].endsWith("-->"))){if(m[1]){const c=m[1],E=m[0][1]==="/",T=m[0][m[0].length-2]==="/"||p.has(c),{props:N,attrs:L,directives:$,bound:W}=$t(m[2]||"",i,r??{}),M={props:{},attrs:{}};for(const z in N)M.props[z]=N[z];for(const z in L)M.attrs[z]=L[z];M.attrs&&Object.prototype.hasOwnProperty.call(M.attrs,"key")&&!(M.props&&Object.prototype.hasOwnProperty.call(M.props,"key"))&&h.safe(()=>{M.props.key=M.attrs.key});try{const z={input:["value","checked","readonly","required","placeholder","maxlength","minlength"],textarea:["value","readonly","required","placeholder","maxlength","minlength"],select:["value","required","multiple"],option:["selected","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","autofocus","form"]},x=c.toLowerCase(),G=z[x]??[];if(M.attrs){for(const H of G)if(W&&W.includes(H)&&H in M.attrs&&!(M.props&&H in M.props)){let j=M.attrs[H];if(j&&h.isReactiveState(j))j=j.value,M.props[H]=j,delete M.attrs[H];else if(j&&typeof j=="object"&&"value"in j&&!(j instanceof Node))try{const B=j.value;M.props[H]=(x==="select"||x==="option")&&H==="value"?String(B):B,delete M.attrs[H]}catch{}else{const B=typeof j;if(H==="disabled")(j===""||B==="boolean"||B==="string"&&(j==="true"||j==="false")||j==null||B==="number")&&(M.props[H]=j,delete M.attrs[H]);else if(j===""||B==="string"||B==="number"||B==="boolean"||j==null){const I=(x==="select"||x==="option")&&H==="value"?String(j):j;M.props[H]=I,delete M.attrs[H]}}}}if(c.includes("-")||r?.__customElements?.has?.(c)){if(M.isCustomElement=!0,W&&M.attrs){const H=new Set(["id","name","data-key","key"]);for(const j of W)if(j in M.attrs&&!(M.props&&j in M.props)){const B=j.includes("-")?h.toCamel(j):j,I=M.attrs[j];if(M.props[B]=I,H.has(j)||h.isClassLikeAttr(j))try{const J=h.safeSerializeAttr(M.attrs[j]);J===null?delete M.attrs[j]:M.attrs[j]=J}catch{delete M.attrs[j]}else delete M.attrs[j]}}try{if(M.attrs&&!(M.props&&"modelValue"in M.props)){const H=M.attrs["model-value"]??M.attrs.modelValue;typeof H<"u"&&(M.props.modelValue=H)}}catch{}}}catch{}if($&&Object.keys($).some(z=>z==="model"||z.startsWith("model:")))try{const x=globalThis[Symbol.for("cer.registry")],G=!!(x&&typeof x.has=="function"&&x.has(c)),H=r,j=!!(H&&(H.__customElements instanceof Set&&H.__customElements.has(c)||Array.isArray(H.__isCustomElements)&&H.__isCustomElements.includes(c)));if(c.includes("-")||j||G)for(const I of Object.keys($)){if(I!=="model"&&!I.startsWith("model:"))continue;const J=$[I],Ae=J.arg??(I.includes(":")?I.split(":",2)[1]:void 0),D=J.value,Te=Ae??"modelValue",Oe=h.getNestedValue,Ye=h.setNestedValue,fe=r?._state||r;let Y;if(typeof D=="string"&&fe)Y=Oe(fe,D);else if(Y=D,h.isReactiveState(D))try{D.value}catch{}M.props[Te]=Y;try{const ee=h.toKebab(Te);M.attrs||(M.attrs={}),Y!=null&&(typeof Y=="string"||typeof Y=="number"||typeof Y=="boolean")&&(M.attrs[ee]=Y)}catch{}M.isCustomElement=!0;const Pe=`update:${h.toKebab(Te)}`.replace(/-([a-z])/g,(ee,Z)=>Z.toUpperCase()),Xe="on"+Pe.charAt(0).toUpperCase()+Pe.slice(1);M.props[Xe]=function(ee){const Z=ee.detail!==void 0?ee.detail:ee.target?ee.target.value:void 0;if(fe)if(D&&h.isReactiveState(D)){const te=D.value;if(Array.isArray(Z)&&Array.isArray(te)?JSON.stringify([...Z].sort())!==JSON.stringify([...te].sort()):Z!==te){D.value=Z;try{const ne=r;if(ne){const ue=ne.requestRender,de=ne._requestRender;typeof ue=="function"?ue():typeof de=="function"&&de()}}catch{}}}else{const te=Oe(fe||{},typeof D=="string"?D:String(D));if(Array.isArray(Z)&&Array.isArray(te)?JSON.stringify([...Z].sort())!==JSON.stringify([...te].sort()):Z!==te){Ye(fe||{},typeof D=="string"?D:String(D),Z);try{const ne=r;if(ne){const ue=ne.requestRender,de=ne._requestRender;typeof ue=="function"?ue():typeof de=="function"&&de()}}catch{}}}},delete $[I]}}catch{}if(Object.keys($).length>0&&(M.directives={...$}),E){const z=C.some(j=>typeof j=="object"&&j.tag!=="#text");let x=C;if(z&&C.length>0){let j=0;for(;j<C.length;){const I=C[j];if(!re(I)||I.tag!=="#text"||typeof I.children!="string"||I.children.trim()!=="")break;j++}let B=C.length-1;for(;B>=0;){const I=C[B];if(!re(I)||I.tag!=="#text"||typeof I.children!="string"||I.children.trim()!=="")break;B--}j===0&&B===C.length-1?x=C:j>B?x=[]:x=C.slice(j,B+1)}const G=Q(R,l,x.length===1&&re(x[0])&&x[0].tag==="#text"?typeof x[0].children=="string"?x[0].children:"":x.length?x:void 0,k),H=b.pop();H?(R=H.tag,l=H.props,k=H.key,C=H.children,C.push(G)):(S.push(G),R=null,l={},k=void 0,C=[])}else T?R?C.push(Q(c,M,void 0,void 0)):S.push(Q(c,M,void 0,void 0)):(R&&b.push({tag:R,props:l,children:C,key:k}),R=c,l=M,C=[])}else if(typeof m[3]<"u"){const c=Number(m[3]),E=i[c];d(E,`interp-${c}`)}else if(m[4]){const c=m[4],E=R?C:S,T=c.split(/({{\d+}})/);for(const N of T){if(!N)continue;const L=N.match(/^{{(\d+)}}$/);if(L){const $=Number(L[1]),W=i[$];d(W,`interp-${$}`)}else{const $=`text-${w++}`,W=A();E.push(y(N,$,W))}}}}const _=S.filter(c=>re(c)&&c.tag==="#text"?typeof c.children=="string"&&c.children.trim()!=="":!0).map(c=>je(c));if(_.length===1){const c=_[0];return o&&t&&Le.set(t,c),c}else if(_.length>1){const c=_;return o&&t&&Le.set(t,c),c}return Q("div",{},"","fallback-root")}function Ot(e,...i){if(h.isDiscoveryRender$1())return[];const n=i[i.length-1];return jt(e,i,typeof n=="object"&&n&&!Array.isArray(n)?n:void 0)}Object.defineProperty(exports,"component",{enumerable:!0,get:function(){return Nt}});Object.defineProperty(exports,"html",{enumerable:!0,get:function(){return Ot}});Object.defineProperty(exports,"vdomRenderer",{enumerable:!0,get:function(){return Ze}});
22
+
23
+ //# sourceMappingURL=template-compiler-BB4JJdqk.cjs.map