@jasonshimmy/custom-elements-runtime 3.2.0 → 3.2.1

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 +585 -603
  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
@@ -1,22 +0,0 @@
1
- "use strict";const d=require("./hooks-NOFG9QRQ.cjs"),Ie=require("./custom-elements-runtime.directives.cjs.js"),H=require("./logger-CSALKaYm.cjs"),P=require("./namespace-helpers-ckeEOxpR.cjs"),V=require("./css-utils-RqkyBWft.cjs"),nt=require("./custom-elements-runtime.transitions.cjs.js");function rt(e,r,t){if(t)for(const[s,n]of Object.entries(t)){let a,o={};if(Array.isArray(n)?(a=n[0],o=n[1]||{}):a=n,r.set(s,{callback:a,options:o,oldValue:d.getNestedValue(e,s)}),o.immediate)try{const i=d.getNestedValue(e,s);a(i,void 0,e)}catch(i){H.devError(`Error in immediate watcher for "${s}":`,i)}}}function st(e,r,t,s){const n=(o,i)=>{if(o===i)return!0;if(typeof o!=typeof i||typeof o!="object"||o===null||i===null)return!1;if(Array.isArray(o)&&Array.isArray(i))return o.length!==i.length?!1:o.every((p,E)=>n(p,i[E]));const f=o,v=i,b=Object.keys(f||{}),y=Object.keys(v||{});return b.length!==y.length?!1:b.every(p=>n(f[p],v[p]))},a=r.get(t);if(a&&!n(s,a.oldValue))try{a.callback(s,a.oldValue,e),a.oldValue=s}catch(o){H.devError(`Error in watcher for "${t}":`,o)}for(const[o,i]of r.entries())if(i.options.deep&&t.startsWith(o+"."))try{const f=d.getNestedValue(e,o);n(f,i.oldValue)||(i.callback(f,i.oldValue,e),i.oldValue=f)}catch(f){H.devError(`Error in deep watcher for "${o}":`,f)}}function Ne(e,r){return r===Boolean?e===""||e==="true":r===Number?Number(e):e}function it(e,r,t){if(r)for(const s in r){const n=r[s],a=d.toKebab(s),o=e.getAttribute(a);if(n.type===Function&&typeof e[s]=="function")t[s]=e[s];else if(o!==null)t[s]=Ne(o,n.type);else if(typeof e[s]<"u")try{const i=e[s];if(n.type===String&&i&&typeof i=="object")try{t[s]=Ne(String(i),n.type)}catch{t[s]=i}else n.type===Boolean&&typeof i=="boolean"||n.type===Number&&typeof i=="number"||n.type===Function&&typeof i=="function"?t[s]=i:t[s]=Ne(String(i),n.type)}catch{t[s]=e[s]}else"default"in n&&n.default!==void 0&&(t[s]=n.default)}}function ot(e,r,t){if(!r.props){try{const s=t?._hookCallbacks?.props||{},n=Array.from(new Set([...Object.keys(e||{}),...Object.keys(s||{})]));for(const a of n){if(typeof a!="string"||a.startsWith("_"))continue;const o=Object.getOwnPropertyDescriptor(t,a);if(!(!Object.prototype.hasOwnProperty.call(s,a)&&o&&(o.get||o.set||!o.configurable)))try{Object.defineProperty(t,a,{enumerable:!0,configurable:!0,get(){try{const f=d.toKebab(a),v=e.getAttribute(f);if(v!==null)return v;const b=e[a];let y;return d.isReactiveState(b)||b&&typeof b=="object"&&"value"in b&&!(typeof Node<"u"&&b instanceof Node)?y=b.value:y=b,y}catch{return e[a]}}})}catch{}}}catch{}return}it(e,r.props,t)}function We(e,r,t,s){e.onConnected&&!t&&(e.onConnected(r),s(!0))}function at(e,r,t,s,n,a,o,i){e.onDisconnected&&e.onDisconnected(r),t.forEach(f=>f()),s(),n(),a(!1),o(null),i(!1)}function ct(e,r,t,s,n){e.onAttributeChanged&&e.onAttributeChanged(r,t,s,n)}class G{static cleanupFunctions=new WeakMap;static addListener(r,t,s,n){r.addEventListener(t,s,n);const o={event:t,handler:s,wrapper:s,options:n,cleanup:()=>r.removeEventListener(t,s,n),addedAt:Date.now()};this.cleanupFunctions.has(r)||this.cleanupFunctions.set(r,[]),this.cleanupFunctions.get(r).push(o)}static removeListener(r,t,s,n){r.removeEventListener(t,s,n);const a=this.cleanupFunctions.get(r);if(a)for(let o=0;o<a.length;o++){const i=a[o];if(i.event===t&&i.handler===s){a.splice(o,1),a.length===0&&this.cleanupFunctions.delete(r);return}}}static cleanup(r){const t=this.cleanupFunctions.get(r);t&&(t.forEach(s=>{try{s.cleanup()}catch{}}),this.cleanupFunctions.delete(r))}static cleanupAll(){this.cleanupFunctions=new WeakMap}static hasListeners(r){const t=this.cleanupFunctions.get(r);return!!(t&&t.length>0)}static getListenerCount(r){const t=this.cleanupFunctions.get(r);return t?t.length:0}static getListenerInfo(r){const t=this.cleanupFunctions.get(r);return t?t.map(s=>({event:s.event,handler:s.handler,wrapper:s.wrapper,options:s.options})):[]}}class qe{map=new Map;maxSize;constructor(r){this.maxSize=Math.max(1,r)}get(r){const t=this.map.get(r);if(t!==void 0)return this.map.delete(r),this.map.set(r,t),t}set(r,t){if(this.map.has(r)&&this.map.delete(r),this.map.set(r,t),this.map.size>this.maxSize){const s=this.map.keys().next().value;this.map.delete(s)}}has(r){return this.map.has(r)}clear(){this.map.clear()}get size(){return this.map.size}}const lt=()=>{if(typeof navigator<"u"&&"deviceMemory"in navigator){const r=navigator.deviceMemory;if(r)return Math.min(1e3,Math.max(200,r*100))}return(()=>{try{return globalThis.process?.env?.NODE_ENV==="test"}catch{return!1}})()?100:500},Re=new qe(lt()),ft=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"]);class ut{static cache=new qe(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(r,t){const s=this.cache.get(r);if(s){if(!s.isSecure){H.devWarn("Blocked cached dangerous expression:",r);return}return s.evaluator(t)}const n=this.createEvaluator(r);if(this.cache.set(r,n),!n.isSecure){H.devWarn("Blocked dangerous expression:",r);return}return n.evaluator(t)}static createEvaluator(r){if(this.hasDangerousPatterns(r))return{evaluator:()=>{},isSecure:!1};if(r.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(r),isSecure:!0}}catch(t){return H.devWarn("Failed to create evaluator for expression:",r,t),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(r){return this.dangerousPatterns.some(t=>t.test(r))}static createSafeEvaluator(r){const t=r.trim();if(t.startsWith("{")&&t.endsWith("}"))return this.createObjectEvaluator(r);if(/^ctx\.[a-zA-Z0-9_.]+$/.test(r.trim())){const s=r.trim().slice(4);return n=>d.getNestedValue(n,s)}return r.includes("ctx")||/[+\-*/%<>=&|?:[\]]/.test(r)?this.createSimpleEvaluator(r):s=>d.getNestedValue(s,r)}static createObjectEvaluator(r){const t=r.trim().slice(1,-1),s=this.parseObjectProperties(t);return n=>{const a={};for(const{key:o,value:i}of s)try{if(i.startsWith("ctx.")){const f=i.slice(4);a[o]=d.getNestedValue(n,f)}else a[o]=this.evaluateSimpleValue(i,n)}catch{a[o]=void 0}return a}}static parseObjectProperties(r){const t=[],s=[];let n=0,a=null,o=0;for(let i=0;i<r.length;i++){const f=r[i];if(a){if(f==="\\"){i++;continue}f===a&&(a=null)}else f==='"'||f==="'"?a=f:f==="("||f==="["||f==="{"?n++:f===")"||f==="]"||f==="}"?n--:f===","&&n===0&&(s.push(r.slice(o,i)),o=i+1)}s.push(r.slice(o));for(const i of s){let f=-1,v=0,b=null;for(let j=0;j<i.length;j++){const k=i[j];if(b){if(k==="\\"){j++;continue}k===b&&(b=null)}else if(k==='"'||k==="'")b=k;else if(k==="("||k==="["||k==="{")v++;else if(k===")"||k==="]"||k==="}")v--;else if(k===":"&&v===0){f=j;break}}if(f===-1)continue;const y=i.slice(0,f).trim(),p=i.slice(f+1).trim(),E=y.replace(/^['"]|['"]$/g,"");t.push({key:E,value:p})}return t}static createSimpleEvaluator(r){return t=>{try{let s=r;const n=[];s=s.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,y=>`<<#${n.push(y)-1}#>>`);const a=s.match(/ctx\.[\w.]+/g)||[];for(const y of a){const p=y.slice(4),E=d.getNestedValue(t,p);if(E===void 0)return;const j=n.push(JSON.stringify(E))-1;s=s.split(y).join(`<<#${j}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,i=s.match(o)||[];for(const y of i){if(y.startsWith("ctx."))continue;const p=d.getNestedValue(t,y);if(p===void 0)return;const E=n.push(JSON.stringify(p))-1;s=s.split(y).join(`<<#${E}#>>`)}const f=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let v;const b=new Set;for(;(v=f.exec(s))!==null;){const y=v[1];if(ft.has(y)||/^[0-9]+$/.test(y)||y==="ctx"||b.has(y))continue;b.add(y);const p=d.getNestedValue(t,y);if(p===void 0)return;const E=JSON.stringify(p),j=n.push(E)-1;y.includes(".")?s=s.split(y).join(`<<#${j}#>>`):s=s.replace(new RegExp("\\b"+y.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${j}#>>`),f.lastIndex=0}s=s.replace(/<<#(\d+)#>>/g,(y,p)=>n[Number(p)]);try{return this.evaluateBasicExpression(s)}catch{return}}catch{return}}}static evaluateBasicExpression(r){const t=this.tokenize(r);let s=0;function n(){return t[s]}function a(u){const g=t[s++];if(u&&!g)throw new Error(`Unexpected token EOF, expected ${u}`);if(u&&g&&g.type!==u&&g.value!==u)throw new Error(`Unexpected token ${g.type}/${g.value}, expected ${u}`);return g}function o(){return j()}function i(u){if(typeof u=="number")return u;if(u==null)return NaN;if(typeof u=="boolean")return u?1:0;const g=Number(u);return Number.isNaN(g)?NaN:g}function f(u,g){return typeof u=="string"||typeof g=="string"?String(u)+String(g):i(u)+i(g)}function v(u,g){return i(u)-i(g)}function b(u,g){return i(u)*i(g)}function y(u,g){return i(u)/i(g)}function p(u,g){return i(u)%i(g)}function E(u,g,l){if(typeof g=="number"&&typeof l=="number")switch(u){case">":return g>l;case"<":return g<l;case">=":return g>=l;case"<=":return g<=l;default:return!1}const S=String(g),_=String(l);switch(u){case">":return S>_;case"<":return S<_;case">=":return S>=_;case"<=":return S<=_;default:return!1}}function j(){const u=k(),g=n();if(g&&g.value==="?"){a("?");const l=o();a(":");const S=o();return u?l:S}return u}function k(){let u=T();for(;;){const g=n();if(!g||g.value!=="||")break;a("OP");const l=T();u=u||l}return u}function T(){let u=h();for(;;){const g=n();if(!g||g.value!=="&&")break;a("OP");const l=h();u=u&&l}return u}function h(){let u=N();for(;;){const g=n();if(!g||!["==","!=","===","!=="].includes(g.value))break;const l=a("OP").value,S=N();switch(l){case"==":u=u==S;break;case"!=":u=u!=S;break;case"===":u=u===S;break;case"!==":u=u!==S;break}}return u}function N(){let u=c();for(;;){const g=n();if(!g||![">","<",">=","<="].includes(g.value))break;const l=a("OP").value,S=c();switch(l){case">":u=E(">",u,S);break;case"<":u=E("<",u,S);break;case">=":u=E(">=",u,S);break;case"<=":u=E("<=",u,S);break}}return u}function c(){let u=A();for(;;){const g=n();if(!g||g.value!=="+"&&g.value!=="-")break;const l=a("OP").value,S=A();u=l==="+"?f(u,S):v(u,S)}return u}function A(){let u=m();for(;;){const g=n();if(!g||g.value!=="*"&&g.value!=="/"&&g.value!=="%")break;const l=a("OP").value,S=m();switch(l){case"*":u=b(u,S);break;case"/":u=y(u,S);break;case"%":u=p(u,S);break}}return u}function m(){const u=n();if(u&&u.value==="!")return a("OP"),!m();if(u&&u.value==="-"){a("OP");const g=m();return v(0,g)}return L()}function L(){const u=n();if(u){if(u.type==="NUMBER")return a("NUMBER"),Number(u.value);if(u.type==="STRING")return a("STRING"),u.value.slice(1,-1);if(u.type==="IDENT")return a("IDENT"),u.value==="true"?!0:u.value==="false"?!1:u.value==="null"?null:void 0;if(u.value==="["){a("PUNC");const g=[];for(;;){const l=n();if(!l||l.value==="]")break;g.push(o());const S=n();S&&S.value===","&&a("PUNC")}return a("PUNC"),g}if(u.value==="("){a("PUNC");const g=o();return a("PUNC"),g}throw new Error("Unexpected token in expression")}}return o()}static tokenize(r){const t=[],s=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let n;for(;(n=s.exec(r))!==null;){const a=n[1];a&&(/^\d/.test(a)?t.push({type:"NUMBER",value:a}):/^"/.test(a)||/^'/.test(a)?t.push({type:"STRING",value:a}):/^[a-zA-Z_]/.test(a)?t.push({type:"IDENT",value:a}):/^[()?:,[\]]$/.test(a)?t.push({type:"PUNC",value:a}):t.push({type:"OP",value:a}))}return t}static evaluateSimpleValue(r,t){if(r==="true")return!0;if(r==="false")return!1;if(!isNaN(Number(r)))return Number(r);if(r.startsWith("ctx.")){const s=r.slice(4);return d.getNestedValue(t,s)}return r.startsWith('"')&&r.endsWith('"')||r.startsWith("'")&&r.endsWith("'")?r.slice(1,-1):r}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}function ke(e,r){return Array.isArray(e)&&Array.isArray(r)?JSON.stringify([...e].sort())!==JSON.stringify([...r].sort()):e!==r}function Be(e,r,t,s,n){if(e){const a=r.value;if(n&&typeof a=="object"&&a!==null){const o={...a};o[n]=t,r.value=o}else r.value=t}else{const a=s._state||s;d.setNestedValue(a,r,t)}}function Ae(e,r,t,s){if(typeof e._requestRender=="function"&&e._requestRender(),typeof e._triggerWatchers=="function"){const n=r?"reactiveState":t;e._triggerWatchers(n,s)}}function dt(e,r,t){const s=`update:${d.toKebab(r)}`,n=`update:${r}`,a=new CustomEvent(s,{detail:t,bubbles:!0,cancelable:!0}),o=new CustomEvent(n,{detail:t,bubbles:!0,cancelable:!0});e.dispatchEvent(a),e.dispatchEvent(o)}function ze(e,r,t,s){const n=t;if(d.safe(()=>{if(typeof e.setAttribute=="function")try{e[r]=n}catch{}else e[r]=n}),n==null||typeof n=="string"||typeof n=="number"||typeof n=="boolean"){const a=d.safeSerializeAttr(n);a!==null?d.safe(()=>{typeof e.setAttribute=="function"&&P.setAttributeSmart(e,d.toKebab(r),String(a))}):d.safe(()=>{typeof e.removeAttribute=="function"&&P.removeAttributeSmart(e,d.toKebab(r))})}}function pt(e,r,t,s){if(e){const n=r.value;return s&&typeof n=="object"&&n!==null?n[s]:n}else{const n=t._state||t;return d.getNestedValue(n,r)}}function ve(e){return e!=null&&typeof e=="object"&&"value"in e}function je(e){return e!=null&&typeof e=="object"&&"value"in e?e.value:e}function Q(e,r,t){if(!e)return;e.attrs||(e.attrs={});const s=e.attrs;s[r]=t}function J(e){return e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement}function ae(e){return e!=null&&typeof e=="object"&&"value"in e?ae(e.value):!(e!=null&&typeof e=="object"||e===!1||e==="false"||e===null||e===void 0||e===0)}function Fe(e){return e.substring(2,3).toLowerCase()+e.substring(3)}function $e(e){return typeof e=="boolean"||e==="true"||e==="false"}function ht(e,r,t,s,n,a,o,i){if(!a)return;const f=r.includes("lazy"),v=r.includes("trim"),b=r.includes("number"),y=()=>{if(d.isReactiveState(e)){const A=e.value;return i&&o&&(o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement)&&typeof A=="object"&&A!==null?A[i]:A}const c=a?._state||a;return d.getNestedValue(c,e)},p=y();let E="text";o instanceof HTMLInputElement?E=s?.type||o.type||"text":o instanceof HTMLSelectElement?E="select":o instanceof HTMLTextAreaElement&&(E="textarea");const j=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,T=j?E==="checkbox"||E==="radio"?"checked":"value":i??"modelValue";if(E==="checkbox")if(Array.isArray(p))t[T]=p.includes(String(o?.getAttribute("value")??s?.value??""));else{const c=o?.getAttribute("true-value")??!0;t[T]=p===c}else if(E==="radio")t[T]=p===(s?.value??"");else if(E==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const c=Array.isArray(p)?p.map(String):[];queueMicrotask(()=>{Array.from(o.options).forEach(A=>{A.selected=c.includes(A.value)})}),t[T]=Array.isArray(p)?p:[]}else t[T]=p;else if(!j&&d.isReactiveState(e))t[T]=e;else{t[T]=p;try{const c=d.toKebab(T);s&&(s[c]=p)}catch{}}const h=f||E==="checkbox"||E==="radio"||E==="select"?"change":"input",N=c=>{if(c.isComposing||n._isComposing)return;const A=globalThis.process,m=!!A&&A.env?.NODE_ENV==="test"||typeof window<"u"&&globalThis.__vitest__;if(c.isTrusted===!1&&!m)return;const L=c.target;if(!L||L._modelUpdating)return;let C=L.value;if(E==="checkbox"){const l=y();if(Array.isArray(l)){const S=L.getAttribute("value")??"",_=Array.from(l);if(L.checked)_.includes(S)||_.push(S);else{const w=_.indexOf(S);w>-1&&_.splice(w,1)}C=_}else{const S=L.getAttribute("true-value")??!0,_=L.getAttribute("false-value")??!1;C=L.checked?S:_}}else if(E==="radio")C=L.getAttribute("value")??L.value;else if(E==="select"&&L.multiple)C=Array.from(L.selectedOptions).map(l=>l.value);else if(v&&typeof C=="string"&&(C=C.trim()),b){const l=Number(C);isNaN(l)||(C=l)}const u=y();if(ke(C,u)){L._modelUpdating=!0;try{Be(d.isReactiveState(e),e,C,a,i),Ae(a,d.isReactiveState(e),e,C),L&&dt(L,T,C)}finally{queueMicrotask(()=>L._modelUpdating=!1)}}};if(j){if(n[h]){const c=n[h];o&&G.removeListener(o,h,c)}n[h]=N}else{const c=`update:${d.toKebab(T)}`,A=`update:${T}`;if(n[c]){const m=n[c];o&&G.removeListener(o,c,m)}if(n[A]){const m=n[A];o&&G.removeListener(o,A,m)}if(n[c]=m=>{const L=m.detail;let C=L!==void 0?L:void 0;if(C===void 0){const l=m.target;if(l&&typeof l=="object"&&"value"in l)try{C=l.value}catch{C=void 0}}const u=pt(d.isReactiveState(e),e,a,i);if(ke(C,u)){Be(d.isReactiveState(e),e,C,a,i),Ae(a,d.isReactiveState(e),e,C);const l=m.target;l&&ze(l,T,d.isReactiveState(e)?e:C,d.isReactiveState(e))}},d.isReactiveState(e)&&typeof e.value=="object"&&e.value!==null){let m;try{m=Reflect.ownKeys(e.value)}catch{m=Object.keys(e.value)}const L=m.filter(u=>typeof u=="string"&&!String(u).startsWith("_")&&u!=="constructor"),C=new Set(L.map(u=>`update:${d.toKebab(u)}`));for(const u of Object.keys(n))u.startsWith("update:")&&u!==c&&u!==A&&!C.has(u)&&(o&&G.removeListener(o,u,n[u]),delete n[u]);for(const u of L){const g=String(u),l=`update:${d.toKebab(g)}`,S=`update:${g}`;l!==c&&(n[l]&&o&&(G.removeListener(o,l,n[l]),delete n[l]),n[l]=_=>{const w=_.detail!==void 0?_.detail:_.target?.value,R=d.isReactiveState(e)?e.value[g]:d.getNestedValue(a?._state||a,e);if(!ke(w,R))return;if(d.isReactiveState(e)){const M={...e.value};M[g]=w,e.value=M}else d.setNestedValue(a?._state||a,e,w);Ae(a,d.isReactiveState(e),e,w);const x=_.currentTarget||o||_.target;x&&ze(x,T,d.isReactiveState(e)?e:w,d.isReactiveState(e))},n[S]=n[l])}}n[A]=n[c]}(E==="text"||E==="textarea")&&(n.compositionstart=()=>n._isComposing=!0,n.compositionend=c=>{n._isComposing=!1;const A=c.target;A&&queueMicrotask(()=>{const m=A.value,L=a?._state||a,C=d.getNestedValue(L,e);let u=m;if(v&&(u=u.trim()),b){const l=Number(u);isNaN(l)||(u=l)}if(ke(u,C)){A._modelUpdating=!0;try{d.setNestedValue(L,e,u),Ae(a,d.isReactiveState(e),e,u)}finally{queueMicrotask(()=>A._modelUpdating=!1)}}})})}function yt(e,r,t,s,n){if(typeof e=="object"&&e!==null)for(const[a,o]of Object.entries(e))if(a.startsWith("data-")||a.startsWith("aria-")||a==="class")t[a]=o;else if(a==="disabled"&&n&&J(n)){const i=o&&typeof o=="object"&&"value"in o;(()=>{try{return d.isReactiveState(o)}catch{return!1}})()||i?r[a]=o:t[a]=o}else r[a]=o;else if(typeof e=="string"){if(!s)return;try{const a=Ce(e,s);if(typeof a=="object"&&a!==null){for(const[o,i]of Object.entries(a))if(o.startsWith("data-")||o.startsWith("aria-")||o==="class")t[o]=i;else if(o==="disabled"&&n&&J(n)){const f=i&&typeof i=="object"&&"value"in i;(()=>{try{return d.isReactiveState(i)}catch{return!1}})()||f?r[o]=i:t[o]=i}else r[o]=i;return}else{t[e]=a;return}}catch{const a=d.getNestedValue(s,e);t[e]=a}}}function mt(e,r,t){let s;if(typeof e=="string"){if(!t)return;s=Ce(e,t)}else s=e;const n=String(r.style||"");let a=n;if(s){if(n){const o=String(n).split(";").map(f=>f.trim()).filter(Boolean),i=o.findIndex(f=>f.startsWith("display:"));i>=0&&o[i]==="display: none"&&(o.splice(i,1),a=o.length>0?o.join("; ")+";":"")}}else if(n){const o=String(n).split(";").filter(Boolean),i=o.findIndex(f=>f.trim().startsWith("display:"));i>=0?o[i]="display: none":o.push("display: none"),a=o.join("; ")}else a="display: none";a!==n&&(a?r.style=a:r.style=void 0)}function Ce(e,r){return ut.evaluate(e,r)}function gt(e,r,t,s){let n;if(typeof e=="string"){if(!t)return;n=Ce(e,t)}else n=e;try{if(n&&typeof n=="object"){if(d.isReactiveState(n))n=n.value;else if("value"in n&&typeof n.value<"u"){const v=n.value;v instanceof Node||(n=v)}}}catch{}let a=[];if(typeof n=="string")a=[n];else if(Array.isArray(n))a=n.filter(Boolean);else if(typeof n=="object"&&n!==null)for(const[v,b]of Object.entries(n))b&&a.push(v);const o=a.join(" "),i=s&&s.class||r.class||"",f=i?`${i} ${o}`.trim():o.trim();f?r.class=f:r.class=void 0}function bt(e,r,t){let s;if(typeof e=="string"){if(!t)return;s=Ce(e,t)}else s=e;let n="";if(typeof s=="string")n=s;else if(s&&typeof s=="object"){const o=[];for(const[i,f]of Object.entries(s))if(f!=null&&f!==""){const v=i.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),b=["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 y=String(f);typeof f=="number"&&b.includes(v)&&(y=`${f}px`),o.push(`${v}: ${y}`)}n=o.join("; ")+(o.length>0?";":"")}const a=String(r.style||"");r.style=a+(a&&!a.endsWith(";")?"; ":"")+n}function vt(e,r,t){let s=e;typeof e=="string"&&t&&(s=Ce(e,t)),d.isReactiveState(s)?r.reactiveRef=s:r.ref=s}function Ge(e,r,t,s){const n={},a={...s||{}},o={};for(const[i,f]of Object.entries(e)){const{value:v,modifiers:b,arg:y}=f;if(i==="model"||i.startsWith("model:")){const p=i.split(":"),E=p.length>1?p[1]:y;ht(v,b,n,a,o,r,t,E);continue}switch(i){case"bind":yt(v,n,a,r,t);break;case"show":mt(v,a,r);break;case"class":gt(v,a,r,s);break;case"style":bt(v,a,r);break;case"ref":vt(v,n,r);break}}try{if(Object.prototype.hasOwnProperty.call(n,"disabled")&&t&&J(t)){const f=n.disabled,v=f&&typeof f=="object"&&"value"in f;let b=!1;try{b=d.isReactiveState(f)}catch{b=!1}!v&&!b&&(a.disabled=f,delete n.disabled)}}catch{}return{props:n,attrs:a,listeners:o}}function fe(e){return e?e.split(/\s+/).filter(Boolean):[]}function ue(e,r){if(r.length===0)return;const t=r.filter(s=>s&&!e.classList.contains(s));t.length>0&&e.classList.add(...t)}function le(e,r){if(r.length===0)return;const t=r.filter(Boolean);t.length>0&&e.classList.remove(...t)}function St(e){const r=window.getComputedStyle(e),t=r.transitionDuration||"0s",s=r.transitionDelay||"0s",n=a=>{const o=parseFloat(a);return a.includes("ms")?o:o*1e3};return n(t)+n(s)}function Je(e,r){return new Promise(t=>{const s=r??St(e);if(s<=0){t();return}let n=!1;const a=()=>{n||(n=!0,e.removeEventListener("transitionend",o),e.removeEventListener("transitioncancel",o),t())},o=()=>a();e.addEventListener("transitionend",o),e.addEventListener("transitioncancel",o),setTimeout(a,s+50)})}async function me(e,r){const{classes:t,hooks:s,css:n,duration:a}=r;if(s?.onBeforeEnter)try{s.onBeforeEnter(e)}catch(y){H.devError("Transition onBeforeEnter error:",y)}if(!n)return s?.onEnter?new Promise(y=>{const p=s.onEnter;typeof p=="function"?p(e,()=>{if(s?.onAfterEnter)try{s.onAfterEnter(e)}catch(E){H.devError("Transition onAfterEnter error:",E)}y()}):y()}):void 0;const o=fe(t?.enterFrom),i=fe(t?.enterActive),f=fe(t?.enterTo);ue(e,o),e.offsetHeight,ue(e,i),e.offsetHeight;let v;if(s?.onEnter){const y=new Promise(p=>{v=p});try{const p=s.onEnter;typeof p=="function"&&p(e,()=>{v&&v()})}catch(p){H.devError("Transition onEnter error:",p)}v&&await y}await new Promise(y=>requestAnimationFrame(()=>y())),e.offsetHeight,le(e,o),ue(e,f),e.offsetHeight,await new Promise(y=>requestAnimationFrame(()=>y()));let b;if(typeof a=="number"?b=a:a&&typeof a=="object"&&"enter"in a&&(b=a.enter),await Je(e,b),le(e,i),s?.onAfterEnter)try{s.onAfterEnter(e)}catch(y){H.devError("Transition onAfterEnter error:",y)}}async function Me(e,r){const{classes:t,hooks:s,css:n,duration:a}=r;if(s?.onBeforeLeave)try{s.onBeforeLeave(e)}catch(y){H.devError("Transition onBeforeLeave error:",y)}if(!n)return s?.onLeave?new Promise(y=>{const p=s.onLeave;typeof p=="function"?p(e,()=>{if(s?.onAfterLeave)try{s.onAfterLeave(e)}catch(E){H.devError("Transition onAfterLeave error:",E)}y()}):y()}):void 0;const o=fe(t?.leaveFrom),i=fe(t?.leaveActive),f=fe(t?.leaveTo);ue(e,o),e.offsetHeight,ue(e,i);let v;if(s?.onLeave){const y=new Promise(p=>{v=p});try{const p=s.onLeave;typeof p=="function"&&p(e,()=>{v&&v()})}catch(p){H.devError("Transition onLeave error:",p)}v&&await y}await new Promise(y=>requestAnimationFrame(()=>y())),le(e,o),ue(e,f);let b;if(typeof a=="number"?b=a:a&&typeof a=="object"&&"leave"in a&&(b=a.leave),await Je(e,b),le(e,i),le(e,f),le(e,o),s?.onAfterLeave)try{s.onAfterLeave(e)}catch(y){H.devError("Transition onAfterLeave error:",y)}}const Ze=new WeakMap,Ye=new WeakMap;function _e(e){if(!e)return;const r=Ze.get(e);if(r!==void 0)return r;try{const t=e;if(t&&t.key!=null)return String(t.key)}catch{}if(e instanceof Element){const t=e.getAttribute("data-anchor-key");if(t)return t}}function q(e,r){try{Ze.set(e,r)}catch{}try{e.key=r}catch{}try{if(e instanceof Element){const t=d.safeSerializeAttr(r);t!==null&&P.setAttributeSmart(e,"data-anchor-key",t)}}catch{}}function Et(e){if(!e)return;const r=Ye.get(e);if(r!==void 0)return r;try{const t=e;if(t&&t._transitionGroup!=null)return t._transitionGroup}catch{}}function Ct(e,r){try{Ye.set(e,r)}catch{}try{e._transitionGroup=r}catch{}}const we=new WeakMap;function oe(e,r){if(r){if(e instanceof Element){G.cleanup(e);const t=[];for(const s in r)r[s]===e&&t.push(s);for(const s of t)delete r[s]}if(e.hasChildNodes()){const t=e.childNodes;for(let s=t.length-1;s>=0;s--)oe(t[s],r)}}}function ge(e,r,t){if(typeof e=="string")return;const s=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),n=e.props?.ref??(e.props?.props&&e.props.props.ref);if(s)try{if(d.isReactiveState(s)||typeof s=="object"&&"value"in s)s.value=r;else if(typeof s=="function")s(r);else if(typeof s=="string"&&t)try{const a=String(s);t[a]=r}catch{}}catch{}else if(n&&t)try{const a=String(n);t[a]=r}catch{}}function Oe(e,r){if(Array.isArray(e)){const a=new Set,o=new Map;return e.map(i=>{if(!i||typeof i!="object")return i;let f=i.props?.key??i.key;if(!f){const y=i.tag||"node",E=[i.props?.attrs?.id,i.props?.attrs?.name,i.props?.attrs?.["data-key"],i.props?.props?.id,i.props?.props?.name,i.props?.props?.dataKey,i.props?.props?.["data-key"]].find(j=>j!=null)??"";f=E?`${r}:${y}:${E}`:`${r}:${y}`}let v=f;if(a.has(v)){const y=(o.get(v)??1)+1;o.set(v,y),v=`${f}#${y}`}o.set(f,(o.get(f)??0)+1),a.add(v);let b=i.children;return Array.isArray(b)&&(b=Oe(b,v)),{...i,key:v,children:b}})}const t=e,s=t.props?.key??t.key??r;let n=t.children;return Array.isArray(n)&&(n=Oe(n,s)),{...t,key:s,children:n}}function De(e,r,t,s){const n=t.directives??{},a=t.attrs?{...t.attrs}:{},o=Ge(n,s,e,a),i={...r.props||{},...t.props||{},...o.props||{}},f={...a||{},...o.attrs||{}},v=r.props??{},b=i,y=!!(t?.isCustomElement??r?.isCustomElement??!1);let p=!1;const E=new Set;for(const c in v)E.add(c);for(const c in b)E.add(c);for(const c of E){const A=v[c],m=b[c];let L=A,C=m;if(d.safe(()=>{d.isReactiveState(A)?L=A.peek():ve(A)&&(L=A.value)}),d.safe(()=>{d.isReactiveState(m)?C=m.peek():ve(m)&&(C=m.value)}),!(A===m&&L===C))if(p=!0,c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)){const u=je(m),g=u==null?"":String(u);e.value!==g&&(e.value=g)}else if(c==="checked"&&e instanceof HTMLInputElement){const u=je(m);e.checked=!!u}else if(c.startsWith("on")&&typeof m=="function"){const u=Fe(c);typeof A=="function"&&G.removeListener(e,u,A),typeof m=="function"&&G.addListener(e,u,m);try{if(u&&u.startsWith("update:")){const g=u.split(":",2)[1],l=b[g];let S=[];try{if(d.isReactiveState(l)){const w=l.value;S=w&&typeof w=="object"?Object.keys(w):[]}else l&&typeof l=="object"&&(S=Object.keys(l))}catch{S=[]}const _=S.filter(w=>typeof w=="string"&&!w.startsWith("_")&&w!=="constructor");for(const w of _){const R=`update:${w}`,$=x=>{const M=x.detail!==void 0?x.detail:x.target instanceof HTMLInputElement||x.target instanceof HTMLTextAreaElement||x.target instanceof HTMLSelectElement?x.target.value:void 0,W={...d.isReactiveState(l)?l.value||{}:b[g]||{},[w]:M};try{typeof m=="function"&&m({detail:W})}catch{}};d.safe(()=>{G.addListener(e,R,$)})}}}catch{}}else if(m==null)P.removeAttributeSmart(e,c);else{const u=t?.isCustomElement??r?.isCustomElement??!1;if(u||c in e)try{e[c]=m,c==="disabled"&&m===!1&&!u&&J(e)&&P.removeAttributeSmart(e,"disabled")}catch{}else m===!1&&P.removeAttributeSmart(e,c)}}const j=o.listeners??{},k=we.get(e)??{};for(const[c,A]of Object.entries(k))G.removeListener(e,c,A);for(const[c,A]of Object.entries(j))G.addListener(e,c,A);Object.keys(j).length>0?we.set(e,j):we.delete(e);const T={...r.attrs??{}},h=f,N=o&&o.attrs||{};if(Object.prototype.hasOwnProperty.call(N,"class")&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(T.class=c)}if(Object.prototype.hasOwnProperty.call(N,"style")&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(T.style=c)}try{if(Object.prototype.hasOwnProperty.call(N,"class")&&N.class===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("class");c!==null&&(T.class=c)}if(Object.prototype.hasOwnProperty.call(N,"style")&&N.style===void 0&&typeof e.getAttribute=="function"){const c=e.getAttribute("style");c!==null&&(T.style=c)}try{if(typeof e.getAttribute=="function"){const c=e.getAttribute("class");try{e instanceof HTMLInputElement&&e.type==="text"&&c!==null&&c!==T.class&&(T.class=c)}catch{}}}catch{}}catch{}for(const c in{...T,...h}){const A=T[c],m=h[c];let L=A,C=m;if(d.isReactiveState(A)&&(L=A.peek()),d.isReactiveState(m)&&(C=m.peek()),L!==C)if(p=!0,C==null||C===!1)d.safe(()=>{P.removeAttributeSmart(e,c)}),Q(r,c,void 0),c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement?d.safe(()=>{e.value=""}):e instanceof HTMLSelectElement?d.safe(()=>{e.value=""}):e instanceof HTMLProgressElement&&d.safe(()=>{e.value=0})),c==="checked"&&e instanceof HTMLInputElement&&d.safe(()=>{e.checked=!1}),c==="disabled"&&J(e)&&d.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=!1)});else{if(c==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){d.safe(()=>{e.value=C??""});continue}else if(e instanceof HTMLSelectElement){d.safe(()=>{e.value=C??""});continue}else if(e instanceof HTMLProgressElement){d.safe(()=>{e.value=Number(C)});continue}}if(c==="checked"&&e instanceof HTMLInputElement){d.safe(()=>{e.checked=!!C});continue}if(c==="style"){const g=d.safeSerializeAttr(C);g!==null&&P.setAttributeSmart(e,c,String(g)),Q(r,c,C);continue}if(c==="class"){const g=d.safeSerializeAttr(C);g!==null&&P.setAttributeSmart(e,c,String(g)),Q(r,c,C);continue}if(c==="disabled"&&J(e)){d.safe(()=>{const g=ae(C);(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=g)}),ae(C)?d.safe(()=>{P.setAttributeSmart(e,c,"")}):d.safe(()=>{P.removeAttributeSmart(e,c)});continue}const u=e.namespaceURI==="http://www.w3.org/2000/svg";if(y&&!u&&c.includes("-"))if(d.isClassLikeAttr(c)){const g=d.safeSerializeAttr(m??C);if(g!==null){try{P.setAttributeSmart(e,c,String(g))}catch{}Q(r,c,C)}}else{const g=d.toCamel(c);try{const l=e;l[g]=d.isReactiveState(m)?m:C,Q(r,c,C)}catch{const l=d.safeSerializeAttr(m??C);l!==null&&P.setAttributeSmart(e,c,String(l))}}else if(!u&&c in e)try{const g=e;g[c]=d.isReactiveState(m)?m:C,Q(r,c,C)}catch{const g=d.safeSerializeAttr(C);g!==null&&(P.setAttributeSmart(e,c,String(g)),Q(r,c,C))}else{const g=d.safeSerializeAttr(C);g!==null&&(P.setAttributeSmart(e,c,String(g)),Q(r,c,C))}}}try{if(J(e)){const c=i.disabled;let A;try{const L=Object.prototype.hasOwnProperty.call(o.props||{},"disabled"),C=c&&typeof c=="object"&&"value"in c;let u=!1;d.safe(()=>{u=!!d.isReactiveState(c)});const g=$e(c);u||C||L||g?A=c:A=f.disabled}catch{A=f.disabled}const m=ae(A);d.safe(()=>{(e instanceof HTMLInputElement||e instanceof HTMLSelectElement||e instanceof HTMLTextAreaElement||e instanceof HTMLButtonElement)&&(e.disabled=m)}),m?d.safe(()=>{P.setAttributeSmart(e,"disabled","")}):d.safe(()=>{P.removeAttributeSmart(e,"disabled")})}}catch{}if(y&&p){const c=e;d.safe(()=>{c._applyProps?.(c._cfg)}),d.safe(()=>{typeof c.requestRender=="function"?c.requestRender():typeof c._render=="function"&&c._render?.(c._cfg)})}}function F(e,r,t,s=null){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const h=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&q(h,e.key),h}if(e.tag==="#raw"){const h=typeof e.children=="string"?e.children:"";return H.devWarn("[#raw] Inserting unsanitized HTML. Ensure the content is trusted or sanitized before use — unsanitized input can lead to XSS vulnerabilities."),document.createRange().createContextualFragment(h)}if(e.tag==="#anchor"){const h=e,N=Array.isArray(h.children)?h.children:[],c=document.createTextNode(""),A=document.createTextNode("");h.key!=null&&(q(c,`${h.key}:start`),q(A,`${h.key}:end`)),h._startNode=c,h._endNode=A;const m=document.createDocumentFragment();m.appendChild(c);for(const L of N){const C=F(L,r,t,s);if(h.key!=null&&C instanceof Element&&!C.hasAttribute("data-anchor-key")){const u=L;u&&typeof u=="object"&&u.key!=null||q(C,String(h.key))}m.appendChild(C)}return m.appendChild(A),m}const n=e&&typeof e=="object"&&e.props&&e.props.attrs?e.props.attrs:void 0,o=(n&&typeof n.xmlns=="string"?String(n.xmlns):void 0)??s??P.TAG_NAMESPACE_MAP[e.tag]??null,i=o?document.createElementNS(o,e.tag):document.createElement(e.tag);e.key!=null&&q(i,e.key),e.props&&e.props?._transitionGroup&&Ct(i,e.props?._transitionGroup);const{props:f={},attrs:v={},directives:b={}}=e.props??{},y=Ge(b,r,i instanceof HTMLElement?i:void 0,v),p={...f,...y.props},E={...v,...y.attrs};try{const h=(E&&E.class)??(p&&p.class)??(e.props&&e.props.attrs&&e.props.attrs.class)??(e.props&&e.props.props&&e.props.props.class),N=d.safeSerializeAttr(h);if(N!==null){const c=String(N).trim();c&&P.setAttributeSmart(i,"class",c)}}catch{}try{if(p.disabled!==void 0&&i&&J(i)){const h=p.disabled,N=h&&typeof h=="object"&&"value"in h;let c=!1;try{c=d.isReactiveState(h)}catch{c=!1}!N&&!c&&d.safe(()=>{E.disabled=h,delete p.disabled})}}catch{}const j=i.namespaceURI==="http://www.w3.org/2000/svg";for(const h in E){const N=E[h];if(typeof h!="string"||/\[object Object\]/.test(h))continue;const c=je(N);if(typeof c=="boolean")c?P.setAttributeSmart(i,h,""):d.safe(()=>{P.removeAttributeSmart(i,h)});else if(c!=null){if(h==="disabled"&&J(i)){const A=p.disabled,m=$e(A)?A:c,L=ae(m);d.safe(()=>{i.disabled=L}),L?d.safe(()=>{P.setAttributeSmart(i,h,"")}):d.safe(()=>{P.removeAttributeSmart(i,h)});continue}if(!j&&h==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement||i instanceof HTMLProgressElement))try{i instanceof HTMLProgressElement?i.value=Number(c):i.value=String(c??"")}catch{const A=d.safeSerializeAttr(c);A!==null&&P.setAttributeSmart(i,h,String(A))}else if(!j&&h==="checked"&&i instanceof HTMLInputElement)try{i.checked=!!c}catch{const A=d.safeSerializeAttr(c);A!==null&&P.setAttributeSmart(i,h,String(A))}else if(!j&&h in i)try{i[h]=c,h==="disabled"&&c===!1&&J(i)&&P.removeAttributeSmart(i,"disabled"),Q(e.props,h,c)}catch{const A=d.safeSerializeAttr(c);A!==null&&P.setAttributeSmart(i,h,String(A))}else if((e.props?.isCustomElement??!1)&&!j&&h.includes("-")){const m=d.toCamel(h);try{i[m]=c}catch{const L=d.safeSerializeAttr(c);L!==null&&P.setAttributeSmart(i,h,String(L))}}else{const m=d.safeSerializeAttr(c);m!==null&&P.setAttributeSmart(i,h,String(m))}}}for(const h in p){const N=p[h];if(!(typeof h!="string"||/\[object Object\]/.test(h)))if(h==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement)){const c=typeof N=="object"&&N!==null&&ve(N)?N.value:N;d.safe(()=>{i.value=String(c??"")})}else if(h.startsWith("on")&&typeof N=="function"){const c=Fe(h),A=c.includes(":")?(()=>{const m=c.split(":"),L=m[1];if(L.includes("-")){const C=L.split("-").map((u,g)=>g===0?u:u.charAt(0).toUpperCase()+u.slice(1)).join("");return`${m[0]}:${C}`}else{const C=L.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();return`${m[0]}:${C}`}})():c;y.listeners&&(y.listeners[c]||y.listeners[A])||G.addListener(i,c,N)}else{if(h.startsWith("on")&&N===void 0)continue;if(N==null||N===!1)P.removeAttributeSmart(i,h);else{const c=e.props?.isCustomElement??!1,A=typeof N=="object"&&N!==null&&d.isReactiveState(N)?N:ve(N)&&typeof N.value<"u"?N.value:N;if(h==="class"||h==="style"){try{const m=d.safeSerializeAttr(A);m!==null&&P.setAttributeSmart(i,h,String(m))}catch{}continue}if(c||h in i)try{const m=typeof N=="object"&&N!==null&&d.isReactiveState(N)?N:ve(N)?N.value:N;if(h==="disabled"&&J(i)){const L=p.disabled!==void 0?p.disabled:m,C=ae(L);d.safe(()=>{i.disabled=C}),C?d.safe(()=>{P.setAttributeSmart(i,h,"")}):d.safe(()=>{P.removeAttributeSmart(i,h)});continue}try{if(typeof i[h]=="boolean"){let C=m;typeof m=="string"?m==="false"?C=!1:m==="true"?C=!0:C=!!m&&m!=="":C=!!m,i[h]=C}else i[h]=m}catch{i[h]=m}}catch{}}}}const k=y.listeners??{};for(const[h,N]of Object.entries(k))G.addListener(i,h,N);Object.keys(k).length>0&&we.set(i,k);const T={...e,props:{...e.props,...y.props}};ge(T,i,t);try{const h=i;if(typeof h._applyProps=="function")try{h._applyProps(h._cfg)}catch{}typeof h.requestRender=="function"?h.requestRender():typeof h._render=="function"&&h._render(h._cfg)}catch{}if(Array.isArray(e.children)){const h=e.tag==="foreignObject"&&o===P.SVG_NS?null:i.namespaceURI??null;for(const N of e.children)i.appendChild(F(N,r,t,h))}else typeof e.children=="string"&&(i.textContent=e.children);try{if(i instanceof HTMLSelectElement&&E&&Object.prototype.hasOwnProperty.call(E,"value"))try{i.value=String(E.value??"")}catch{}}catch{}try{if(J(i)){const h=p.disabled,N=E.disabled,c=h&&typeof h=="object"&&"value"in h;let A=!1;try{A=!!d.isReactiveState(h)}catch{A=!1}const L=A||c||$e(h)?h:N,C=ae(L);d.safe(()=>{i.disabled=C}),C?d.safe(()=>{P.setAttributeSmart(i,"disabled","")}):d.safe(()=>{P.removeAttributeSmart(i,"disabled")})}}catch{}return i}function kt(e,r,t,s,n){if(typeof t=="string"){e.textContent!==t&&(e.textContent=t);return}if(!Array.isArray(t))return;const a=e.childNodes,o=[];for(let k=0;k<a.length;k++)o.push(a[k]);const i=Array.isArray(r)?r:[],f=Et(e);if(f){const k=c=>{if(typeof c=="string")return c.startsWith("each-")?c.substring(5):c;if(typeof c=="number")return String(c)},T=[],h=[];for(const c of t)if(c&&c.tag==="#anchor"){const A=Array.isArray(c.children)?c.children:[];for(const m of A){const L=k(m.key??c.key??"unknown");T.push({...m,key:L})}}else c&&T.push({...c,key:k(c.key)});for(const c of i)if(c&&c.tag==="#anchor"){const A=Array.isArray(c.children)?c.children:[];for(const m of A){const L=k(m.key??c.key??"unknown");h.push({...m,key:L})}}else c&&h.push({...c,key:k(c.key)});if(T.some(c=>c&&c.key!=null)||h.some(c=>c&&c.key!=null)){const c=new Map,A=new Map;for(const l of h)if(l&&l.key!=null){const S=String(l.key);c.set(S,l)}for(let l=0;l<o.length;l++){const S=o[l];let _=_e(S);if(_=k(_),_!=null&&S instanceof Element&&S.nodeType===Node.ELEMENT_NODE){let w=typeof _=="string"&&_.includes(":")?_.substring(0,_.lastIndexOf(":")):_;w=String(w),A.set(w,S)}}const m=new Set,L=new Map,C=o.length>0;if(f.moveClass&&C)for(let l=0;l<o.length;l++){const S=o[l];if(S instanceof HTMLElement&&S.parentElement){const _=S.getBoundingClientRect();L.set(S,_)}}const u=[];for(const l of T){let S=l.key;if(S==null)continue;S=String(S);const _=c.get(S);let w=A.get(S);if(w&&_){const R=be(w,_,l,s);m.add(w);const $=String(S);q(R,$),u.push({node:R,key:S,newVNode:l,oldVNode:_,isNew:!1})}else{w=F(l,s,void 0,e instanceof Element?e.namespaceURI??null:null),q(w,String(S)),e.appendChild(w);const R=C||f.appear===!0;w instanceof HTMLElement&&R&&me(w,f).catch($=>{H.devError("Enter transition error:",$)}),u.push({node:w,key:S,newVNode:l,isNew:!0})}}const g=[];for(let l=0;l<o.length;l++){const S=o[l],_=_e(S);if(!m.has(S)&&_!=null&&S instanceof HTMLElement){const R=Me(S,f).then(()=>{e.contains(S)&&e.removeChild(S)}).catch($=>{H.devError("Leave transition error:",$),e.contains(S)&&e.removeChild(S)});g.push(R)}}if(g.length===0){let l=e.firstChild;for(const{node:S}of u)S!==l&&e.insertBefore(S,l),l=S.nextSibling;if(f.moveClass&&L.size>0){const S=[];for(const{node:_,isNew:w}of u)if(!w&&_ instanceof HTMLElement){const R=L.get(_);if(R){const $=_.getBoundingClientRect(),x=R.left-$.left,M=R.top-$.top;if(x!==0||M!==0){const z=f.moveClass.split(/\s+/).filter(W=>W);S.push({node:_,deltaX:x,deltaY:M,moveClasses:z})}}}if(S.length>0){for(const{node:_,deltaX:w,deltaY:R}of S)_.style.transform=`translate(${w}px, ${R}px)`,_.style.transitionProperty="none";e.offsetHeight,requestAnimationFrame(()=>{requestAnimationFrame(()=>{for(const{node:_,moveClasses:w}of S)for(const R of w)_.classList.add(R);requestAnimationFrame(()=>{const _=f.moveClass||"",w=_.match(/duration-(\d+)/),R=w?`${w[1]}ms`:"300ms",$=_.match(/ease-(out|in|in-out|linear)/),x=$?`ease-${$[1]}`:"ease-out";for(const{node:M}of S)M.style.transition=`transform ${R} ${x}`;requestAnimationFrame(()=>{for(const{node:M,moveClasses:z}of S){M.style.removeProperty("transform");const W=()=>{for(const Z of z)M.classList.remove(Z);M.style.removeProperty("transition"),M.removeEventListener("transitionend",W),M.removeEventListener("transitioncancel",W)};M.addEventListener("transitionend",W,{once:!0}),M.addEventListener("transitioncancel",W,{once:!0})}})})})})}}}return}}const v=new Map;for(const k of i)k&&k.key!=null&&v.set(k.key,k);const b=new Map;for(let k=0;k<o.length;k++){const T=o[k],h=_e(T);h!=null&&b.set(h,T)}const y=new Set;let p=e.firstChild;function E(k,T){let h=k;for(;h&&(y.add(h),h!==T);)h=h.nextSibling}function j(k,T,h,N,c,A=!0){const m=[];let L=k.nextSibling;for(;L&&L!==T;)m.push(L),L=L.nextSibling;const C=Array.isArray(h)?h:[];if(N.some(g=>g&&g.key!=null)||C.some(g=>g&&g.key!=null)){const g=new Map,l=new Map;for(const R of C)R&&R.key!=null&&g.set(R.key,R);for(const R of m){const $=_e(R);$!=null&&l.set($,R)}const S=c&&c.state==="visible"&&C.length===0&&N.length>0,_=new Set;let w=k.nextSibling;for(const R of N){if(typeof R=="object"&&R.tag==="#anchor"){const x=R.key,M=`${x}:start`,z=`${x}:end`,W=l.get(M),Z=l.get(z),K=Array.isArray(R.children)?R.children:[],I=g.get(x);let O,B;if(W&&Z&&e.contains(W))O=W,B=Z,j(O,B,I?.children,K);else{O=document.createTextNode(""),B=document.createTextNode(""),q(O,M),q(B,z),e.insertBefore(O,w);for(const ce of K){const te=F(ce,s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(te,w),_.add(te)}e.insertBefore(B,w)}let D=O;for(;D&&(_.add(D),D!==B);)D=D.nextSibling;R._startNode=O,R._endNode=B,w=B.nextSibling;continue}let $;if(R.key!=null&&l.has(R.key)){const x=g.get(R.key);$=be(l.get(R.key),x,R,s),_.add($),c&&$ instanceof HTMLElement&&S&&c.appear&&me($,c).catch(M=>{H.devError("Transition enter error (appear):",M)}),$!==w&&e.contains($)&&e.insertBefore($,w)}else $=F(R,s,void 0,e instanceof Element?e.namespaceURI??null:null),e.insertBefore($,w),_.add($),c&&$ instanceof HTMLElement&&A&&me($,c).catch(x=>{H.devError("Transition enter error:",x)});w=$.nextSibling}for(const R of m)!_.has(R)&&e.contains(R)&&(c&&R instanceof HTMLElement&&A?Me(R,c).then(()=>{e.contains(R)&&e.removeChild(R)}).catch($=>{H.devError("Transition leave error:",$),e.contains(R)&&e.removeChild(R)}):e.removeChild(R))}else{const g=Math.min(C.length,N.length);for(let l=0;l<g;l++){const S=C[l],_=N[l],w=be(m[l],S,_,s);w!==m[l]&&(e.insertBefore(w,m[l]),e.removeChild(m[l]))}for(let l=g;l<N.length;l++){const S=F(N[l],s,void 0,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(S,T),c&&S instanceof HTMLElement&&A&&me(S,c).catch(_=>{H.devError("Transition enter error:",_)})}for(let l=g;l<m.length;l++){const S=m[l];c&&S instanceof HTMLElement&&A?Me(S,c).then(()=>{e.contains(S)&&e.removeChild(S)}).catch(_=>{H.devError("Transition leave error:",_),e.contains(S)&&e.removeChild(S)}):e.removeChild(S)}}}for(const k of t){let T;if(k.tag==="#anchor"){const h=k.key,N=`${h}:start`,c=`${h}:end`;let A=b.get(N),m=b.get(c);const L=Array.isArray(k.children)?k.children:[];if(A||(A=document.createTextNode(""),q(A,N)),m||(m=document.createTextNode(""),q(m,c)),k._startNode=A,k._endNode=m,!e.contains(A)||!e.contains(m)){e.insertBefore(A,p);const C=k._transition,g=!(C&&C.state==="visible"&&L.length>0)||C.appear;for(const l of L){const S=F(l,s,n,e instanceof Element?e.namespaceURI??null:null);e.insertBefore(S,p),C&&S instanceof HTMLElement&&g&&me(S,C).catch(_=>{H.devError("Transition enter error:",_)})}e.insertBefore(m,p)}else{const C=k._transition,g=v.get(h)._transition,l=g&&g.state!==C?.state,S=C&&C.state==="visible"&&L.length>0&&!l,_=l||!S||C?.appear===!0;j(A,m,v.get(h)?.children,L,C,_)}E(A,m),p=m.nextSibling;continue}if(k.key!=null&&b.has(k.key)){const h=v.get(k.key);T=be(b.get(k.key),h,k,s,n),y.add(T),T!==p&&e.contains(T)&&(p&&!e.contains(p)&&(p=null),e.insertBefore(T,p))}else T=F(k,s,n,e instanceof Element?e.namespaceURI??null:null),p&&!e.contains(p)&&(p=null),e.insertBefore(T,p),y.add(T);p=T.nextSibling}for(let k=0;k<o.length;k++){const T=o[k];!y.has(T)&&e.contains(T)&&(oe(T,n),e.removeChild(T))}}function be(e,r,t,s,n){if(r&&typeof r!="string"&&r.props?.ref&&n&&oe(e,n),r===t)return e;if(typeof t=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==t&&(e.textContent=t),e;{const o=document.createTextNode(t);return e.parentNode?.replaceChild(o,e),o}}if(t&&typeof t!="string"&&t.tag==="#anchor"){const o=t,i=Array.isArray(o.children)?o.children:[],f=o._startNode??document.createTextNode(""),v=o._endNode??document.createTextNode("");o.key!=null&&(q(f,`${o.key}:start`),q(v,`${o.key}:end`)),o._startNode=f,o._endNode=v;const b=document.createDocumentFragment();b.appendChild(f);for(const y of i){const p=F(y,s,n,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);b.appendChild(p)}return b.appendChild(v),e.parentNode?.replaceChild(b,e),f}if(!t){oe(e,n);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!r||typeof r=="string"){oe(e,n);const o=F(t,s,n,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,o,n),e.parentNode?.replaceChild(o,e),o}if(t.tag==="#anchor"){const o=Array.isArray(t.children)?t.children:[],i=t._startNode??document.createTextNode(""),f=t._endNode??document.createTextNode("");t.key!=null&&(q(i,`${t.key}:start`),q(f,`${t.key}:end`)),t._startNode=i,t._endNode=f;const v=document.createDocumentFragment();v.appendChild(i);for(const b of o)v.appendChild(F(b,s,n,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null));return v.appendChild(f),e.parentNode?.replaceChild(v,e),i}if(typeof r!="string"&&typeof t!="string"&&r.tag===t.tag&&r.key===t.key){const o=e;return De(o,r.props||{},t.props||{},s),kt(o,r.children,t.children,s,n),ge(t,o,n),o}if(typeof r!="string"&&typeof t!="string"&&r.tag===t.tag&&(r.tag&&String(r.tag).includes("-")||t.props&&t.props.isCustomElement||r.props&&r.props.isCustomElement))try{const i=e;return De(i,r.props||{},t.props||{},s),ge(t,i,n),i}catch{}oe(e,n);const a=F(t,s,n,e.parentNode instanceof Element?e.parentNode.namespaceURI??null:null);return ge(t,a,n),e.parentNode?.replaceChild(a,e),a}function Xe(e,r,t,s){let n;Array.isArray(r)?r.length===1?(n=r[0],n&&typeof n=="object"&&n.key==null&&(n={...n,key:"__root__"})):n={tag:"div",key:"__root__",children:r}:(n=r,n&&typeof n=="object"&&n.key==null&&(n={...n,key:"__root__"})),n&&typeof n=="object"&&n.tag==="#anchor"&&(n={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[n]}),n=Oe(n,String(n.key??"root"));const a=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let i;a&&o?typeof a!="string"&&typeof n!="string"&&a.tag===n.tag&&a.key===n.key?i=be(o,a,n,t,s):(i=F(n,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.replaceChild(i,o)):(i=F(n,t,s,e.host instanceof Element?e.host.namespaceURI??null:null),e.firstChild?e.replaceChild(i,e.firstChild):e.appendChild(i));const f=[];for(let b=0;b<e.childNodes.length;b++){const y=e.childNodes[b];y!==i&&y.nodeName!=="STYLE"&&(oe(y,s),f.push(y))}f.forEach(b=>e.removeChild(b));const v=n&&typeof n=="object"&&n.props?{...n,props:{...n.props,attrs:n.props.attrs?{...n.props.attrs}:void 0,props:n.props.props?{...n.props.props}:void 0}}:n;e._prevVNode=v,e._prevDom=i}const Se=[],Ke=new WeakMap,de=new WeakMap;function At(e,r){de.has(e)||de.set(e,new Set),de.get(e).add(r)}function _t(e,r){const t=de.get(e);t&&(t.delete(r),t.size===0&&de.delete(e))}function Tt(e,r,t,s,n,a,o,i){if(e){Se.push(t);try{const f=r.render(t);if(f instanceof Promise){a(!0);const v=e.host.isConnected,b=e,y=b._asyncRenderToken=(b._asyncRenderToken??0)+1;f.then(p=>{v&&!e.host.isConnected||b._asyncRenderToken===y&&(a(!1),o(null),Ue(e,p,t,s,n),i(e.innerHTML))}).catch(p=>{v&&!e.host.isConnected||b._asyncRenderToken===y&&(a(!1),o(p instanceof Error?p:new Error(String(p))))});return}Ue(e,f,t,s,n),i(e.innerHTML)}catch(f){o(f instanceof Error?f:new Error(String(f)))}finally{Se.pop()}}}function Ue(e,r,t,s,n){if(e)try{Xe(e,Array.isArray(r)?r:[r],t,s),n(e.innerHTML)}catch(a){throw H.devError("Error during VDOM rendering:",a),a}}function wt(e,r,t,s,n,a,o){a!==null&&clearTimeout(a);const v=Date.now()-r<16,{isVitest:b,isCypress:y,isTest:p}=d.detectTestEnvironment(),E=(b||p)&&!y;if(v){const T=t+1;n(T);const h=p?50:10,N=p?100:25,c=E?12:50;if(T===h&&!p)H.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(T===N&&!p)H.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(T>=c){H.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`),o(null);return}}else n(0);let j=0;p||(t>=40?j=500:t>=25?j=100:t>=15&&(j=16));const k=()=>{s(Date.now());try{e()}catch(T){H.devError("Error during render execution:",T)}finally{o(null)}};if(j>0){const T=setTimeout(k,j);o(T)}else p?k():(o({}),queueMicrotask(k))}function Lt(e,r){let t=r;try{const s=de.get(e);if(s?.size)for(const n of s)try{const a=n.lastHtmlStringForJitCSS;a?.trim()&&(t+=`
14
- `+a)}catch{}else{const n=e.querySelectorAll("*");for(const a of n)try{const o=a.lastHtmlStringForJitCSS;o?.trim()&&(t+=`
15
- `+o)}catch{}}}catch{}return t}function Nt(e){return"adoptedStyleSheets"in e&&typeof CSSStyleSheet<"u"&&"replaceSync"in CSSStyleSheet.prototype}function Ve(e,r){let t=e.querySelector("style[data-cer-runtime]");t||(t=document.createElement("style"),P.setAttributeSmart(t,"data-cer-runtime","true"),e.appendChild(t));try{t.textContent=r}catch{}}function Rt(e,r,t,s,n){if(!e)return;const a=Lt(e,t);if(Ke.get(e)===a)return;Ke.set(e,a);const i=V.isJITCSSActiveFor(e)?V.processJITCSS(a):"",f=V.getProseStyleSheet(),v=r._computedStyle,b=Nt(e),y=nt.getTransitionStyleSheet();let p="";if(!b)try{y?.cssRules&&(p=Array.from(y.cssRules).map(T=>T.cssText).join(`
16
- `))}catch{p=""}if(!i?.trim()&&!v&&!f){if(n(null),b)e.adoptedStyleSheets=[V.getBaseResetSheet(),y];else{const T=V.minifyCSS(V.baseReset),h=V.minifyCSS(`${T}
17
- ${p}`);Ve(e,h);try{e.adoptedStyleSheets=[V.getBaseResetSheet(),y]}catch{}}return}let E="";if(v&&(E+=v+`
18
- `),i&&(E+=i+`
19
- `),E=V.sanitizeCSS(E),E=V.minifyCSS(E),b){let T=s;T||(T=new CSSStyleSheet);try{T.replaceSync(E);const h=[V.getBaseResetSheet(),y];f&&h.push(f),h.push(T),e.adoptedStyleSheets=h,n(T);return}catch{}}const j=V.minifyCSS(V.baseReset),k=V.minifyCSS(`${j}
20
- ${p}
21
- ${E}`);Ve(e,k);try{const T=[V.getBaseResetSheet(),y];if(f&&T.push(f),typeof CSSStyleSheet<"u")try{const h=new CSSStyleSheet;h.replaceSync(E),T.push(h)}catch{T.push({cssRules:[],replaceSync:()=>{}})}e.adoptedStyleSheets=T}catch{}n(null)}function Mt(e,r){if(!r.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)||r,this._componentId=`${e}-${crypto.randomUUID()}`;const t=this._initContext(r),s=(a,o,i)=>{Object.defineProperty(a,o,{value:i,writable:!1,enumerable:!1,configurable:!1})};s(t,"refs",this._refs),s(t,"requestRender",()=>this.requestRender()),s(t,"_requestRender",()=>this._requestRender()),s(t,"_componentId",this._componentId),s(t,"_triggerWatchers",(a,o)=>this._triggerWatchers(a,o)),this.context=t,d.safe(()=>{s(t,"_host",this)}),s(this.context,"emit",(a,o,i)=>{const f={detail:o,bubbles:!0,composed:!0,...i||{}},v=new CustomEvent(a,f);this.dispatchEvent(v);const b=a.indexOf(":");if(b>0){const y=a.substring(0,b),p=a.substring(b+1),E=p.includes("-")?`${y}:${p.split("-").map((j,k)=>k===0?j:j.charAt(0).toUpperCase()+j.slice(1)).join("")}`:`${y}:${p.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase()}`;E!==a&&d.safe(()=>{this.dispatchEvent(new CustomEvent(E,f))})}return!v.defaultPrevented});const n=P.registry.get(e)||r;for(const a in n){const o=n[a];typeof o=="function"&&(this.context[a]=(...i)=>o(...i,this.context))}if(n.props)for(const a in n.props){let o=this[a];Object.defineProperty(this,a,{get(){return o},set(i){const f=o;o=i,this.context[a]=i,this._initializing||(this._applyProps(n),f!==i&&this._requestRender())},enumerable:!0,configurable:!0})}this._initializing=!1,this._initWatchers(n),this._applyProps(n),this._render(n)}connectedCallback(){this._runLogicWithinErrorBoundary(r,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&At(t,this);const s=this.getAttribute("data-cer-hydrate");if(s!=="none"){if(s==="idle"){const n=()=>this._hydrateNow(r);typeof requestIdleCallback<"u"?requestIdleCallback(n):setTimeout(n,200);return}if(s==="visible"){new IntersectionObserver((a,o)=>{a.some(i=>i.isIntersecting)&&(o.disconnect(),this._hydrateNow(r))},{rootMargin:"0px",threshold:0}).observe(this);return}this._applyProps(r),this._requestRender(),We(r,this.context,this._mounted,n=>{this._mounted=n})}})}_hydrateNow(t){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),We(t,this.context,this._mounted,s=>{this._mounted=s})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(r,()=>{const t=this.getRootNode();t&&t!==document&&"host"in t&&_t(t,this),at(r,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},s=>{this._templateLoading=s},s=>{this._templateError=s},s=>{this._mounted=s}),d.reactiveSystem.cleanup(this._componentId)})}attributeChangedCallback(t,s,n){this._runLogicWithinErrorBoundary(r,()=>{this._applyProps(r),s!==n&&this._requestRender(),ct(r,t,s,n,this.context)})}static get observedAttributes(){return r.props?Object.keys(r.props).map(d.toKebab):[]}_render(t){this._runLogicWithinErrorBoundary(t,()=>{Tt(this.shadowRoot,t,this.context,this._refs,s=>{this._lastHtmlStringForJitCSS=s,typeof this.onHtmlStringUpdate=="function"&&this?.onHtmlStringUpdate?.(s)},s=>{this._templateLoading=s,this?.onLoadingStateChange?.(s)},s=>{this._templateError=s,this?.onErrorStateChange?.(s)},s=>this._applyStyle(t,s))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{d.scheduleDOMUpdate(()=>{wt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})},this._componentId)})}_applyStyle(t,s){this._runLogicWithinErrorBoundary(t,()=>{Rt(this.shadowRoot,this.context,s,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(t,s){try{s(),this._hasError=!1}catch(n){this._hasError=!0;try{const a=this.tagName?.toLowerCase?.()||"<unknown>",o=this._componentId||"<unknown-id>",i={};if(t&&t.props)for(const f of Object.keys(t.props))try{const v=this.context[f];v instanceof Node?i[f]=`[DOM Node: ${v.nodeName}]`:typeof v=="object"&&v!==null?i[f]=Object.keys(v).length>5?`[object(${Object.keys(v).length} keys)]`:v:i[f]=v}catch{i[f]="[unreadable]"}H.devError(`Error rendering component <${a}> (id=${o}):`,n),H.devError("Component props snapshot:",i),H.devWarn("Common causes: accessing properties of null/undefined inside template interpolations; expensive or throwing expressions inside templates that evaluate eagerly. Fixes: use optional chaining (obj?.prop), guard with ternary, or use the runtime lazy overload: when(cond, () => html`...`).")}catch{}if(t.onError&&t.onError(n,this.context),this.tagName.toLowerCase()!=="cer-error-boundary"){let a=this.parentElement;if(!a){const o=this.getRootNode();o instanceof ShadowRoot&&(a=o.host.parentElement)}for(;a;){if(a.tagName.toLowerCase()==="cer-error-boundary"){a._cerHandleChildError?.(n);break}let o=a.parentElement;if(!o){const i=a.getRootNode();i instanceof ShadowRoot&&(o=i.host.parentElement)}a=o}}}}_initContext(t){try{let s=function(a,o=""){if(Array.isArray(a))return new Proxy(a,{get(i,f,v){const b=Reflect.get(i,f,v);return typeof b=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...p){const E=b.apply(i,p);if(!n._initializing){const j=o||"root";n._triggerWatchers(j,i),d.scheduleDOMUpdate(()=>n._render(t),n._componentId)}return E}:b},set(i,f,v){if(i[String(f)]=v,!n._initializing){const b=o?`${o}.${String(f)}`:String(f);n._triggerWatchers(b,v),d.scheduleDOMUpdate(()=>n._render(t),n._componentId)}return!0},deleteProperty(i,f){if(delete i[String(f)],!n._initializing){const v=o?`${o}.${String(f)}`:String(f);n._triggerWatchers(v,void 0),d.scheduleDOMUpdate(()=>n._render(t),n._componentId)}return!0}});if(a&&typeof a=="object"){if(d.isReactiveState(a))return a;for(const i in a){const f=o?`${o}.${i}`:i;a[i]=s(a[i],f)}return new Proxy(a,{set(i,f,v){const b=o?`${o}.${String(f)}`:String(f);return i[String(f)]=s(v,b),n._initializing||(n._triggerWatchers(b,i[String(f)]),d.scheduleDOMUpdate(()=>n._render(t),n._componentId)),!0},get(i,f,v){return Reflect.get(i,f,v)}})}return a};const n=this;return s({...t.props?Object.fromEntries(Object.entries(t.props).map(([a,o])=>[a,o.default])):{}})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{rt(this.context,this._watchers,{})})}_triggerWatchers(t,s){st(this.context,this._watchers,t,s)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{ot(this,t,this.context)})}}}function Te(e,r,t,s){for(const n of t)try{n(...s)}catch(a){H.devError(`[${e}] Error in ${r} lifecycle hook:`,a)}}function jt(e,r,t){P.initGlobalRegistryIfNeeded();let s=d.toKebab(e);s.includes("-")||(s=`cer-${s}`);const n={},a={props:{},hydrate:t?.hydrate,onConnected:o=>{if(n.onConnected)try{n.onConnected(o)}catch(i){H.devError(`[${s}] Error in onConnected lifecycle hook:`,i)}},onDisconnected:o=>{if(n.onDisconnected)try{n.onDisconnected(o)}catch(i){H.devError(`[${s}] Error in onDisconnected lifecycle hook:`,i)}},onAttributeChanged:(o,i,f,v)=>{if(n.onAttributeChanged)try{n.onAttributeChanged(o,i,f,v)}catch(b){H.devError(`[${s}] Error in onAttributeChanged lifecycle hook:`,b)}},onError:(o,i)=>{if(n.onError&&o)try{n.onError(o,i)}catch(f){H.devError(`[${s}] Error in onError handler (the error handler itself threw):`,f)}},render:o=>{const i=o,f=i._componentId||`${s}-${crypto.randomUUID()}`;d.reactiveSystem.setCurrentComponent(f,()=>{o.requestRender&&o.requestRender()});try{Object.defineProperty(o,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!0}),Object.defineProperty(o,"_computedStyle",{value:void 0,writable:!0,enumerable:!1,configurable:!0}),d.setCurrentComponentContext(o),Ie.resetWhenCounter();let v;try{v=r()}catch(b){try{const p=i._hookCallbacks?.onError;if(Array.isArray(p))for(const E of p)try{E(b)}catch{}else if(typeof p=="function")try{p(b)}catch{}}catch{}try{const y=i._host;if(y?.parentElement){let p=y.parentElement;for(;p;){if(p.tagName.toLowerCase()==="cer-error-boundary"){p._cerHandleChildError?.(b);break}let E=p.parentElement;if(!E){const j=p.getRootNode();typeof ShadowRoot<"u"&&j instanceof ShadowRoot&&(E=j.host.parentElement)}p=E}}}catch{}throw b}if(i._hookCallbacks){const b=i._hookCallbacks;if(b.onConnected){const y=b.onConnected;n.onConnected=p=>{Te(s,"useOnConnected",y,[p])}}if(b.onDisconnected){const y=b.onDisconnected;n.onDisconnected=p=>{Te(s,"useOnDisconnected",y,[p])}}if(b.onAttributeChanged){const y=b.onAttributeChanged;n.onAttributeChanged=(p,E,j,k)=>{Te(s,"useOnAttributeChanged",y,[p,E,j,k])}}if(b.onError){const y=b.onError;n.onError=p=>{Te(s,"useOnError",y,[p])}}if(b.props&&!Object.keys(a.props??{}).length){const y=b.props;a.props=Object.fromEntries(Object.entries(y).map(([p,E])=>[p,{type:typeof E=="boolean"?Boolean:typeof E=="number"?Number:typeof E=="string"?String:Function,default:E}])),P.registry.set(s,a)}}return v}finally{d.clearCurrentComponentContext(),d.reactiveSystem.clearCurrentComponent()}}};if(P.registry.set(s,a),typeof window<"u"){try{const o={_hookCallbacks:{},requestRender:()=>{},emit:()=>!0};d.setCurrentComponentContext(o),d.beginDiscoveryRender(),Ie.resetWhenCounter();try{r()}catch(i){try{const v=o?._hookCallbacks?.onError;if(Array.isArray(v))for(const b of v)try{b(i)}catch{}else if(typeof v=="function")try{v(i)}catch{}H.devError(`Error during component discovery render <${s}>:`,i),H.devWarn("Error occurred during initial component discovery render. Consider guarding expensive expressions or using lazy factories for directives like when().")}catch{}throw i}finally{d.endDiscoveryRender(),d.clearCurrentComponentContext()}if(o._hookCallbacks?.props){const i=o._hookCallbacks.props;a.props=Object.fromEntries(Object.entries(i).map(([f,v])=>[f,{type:typeof v=="boolean"?Boolean:typeof v=="number"?Number:typeof v=="string"?String:Function,default:v}])),P.registry.set(s,a)}}catch{}typeof customElements<"u"&&!customElements.get(s)&&customElements.define(s,Mt(s,a))}}function ee(e,r={},t,s){const n=s??r.key;return{tag:e,key:n,props:r,children:t}}function Ee(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ie(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Ee(e)}function $t(e,r){return e.key!=null?e:{...e,key:r}}function Ot(e,r){if(e==null){H.devWarn(`⚠️ Event handler for '@${r}' is ${e}. This will prevent the event from working. Use a function reference instead: @${r}="\${functionName}"`);return}typeof e!="function"&&H.devWarn(`🚨 Potential infinite loop detected! Event handler for '@${r}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${r}="\${functionName()}" to @${r}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&H.devWarn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${r}="\${fn}" not @${r}="\${fn()}"`)}function Pt(e,r=[],t={}){const s={},n={},a={},o=[],i=/([:@#]?)([a-zA-Z0-9-:.]+)(?:\s*=\s*("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)'|([^\s>]+)))?/g;let f;for(;f=i.exec(e);){const v=f[1],b=f[2];let y="";for(let h=3;h<f.length;h++)if(f[h]!==void 0){y=f[h];break}y.length>=2&&(y[0]==='"'&&y[y.length-1]==='"'||y[0]==="'"&&y[y.length-1]==="'")&&(y=y.slice(1,-1));const p=!/=/.test(f[0]),E=y.match(/^{{(\d+)}}$/),j=!E&&/{{(\d+)}}/.test(y);let k=p?!0:E?r[Number(E[1])]??null:j?y.replace(/{{(\d+)}}/g,(h,N)=>String(r[Number(N)]??"")):y;!E&&!j&&(k==="true"?k=!0:k==="false"?k=!1:k==="null"?k=null:isNaN(Number(k))||(k=Number(k)));const T=["model","bind","show","class","style","ref","when"];if(v===":"){const[h,N]=b.split(":"),[c,...A]=h.split(".");if(T.includes(c)){const m=[...A],L=c==="model"&&N?`model:${N}`:c;a[L]={value:k,modifiers:m,arg:N}}else if(b==="disabled"){let m=k;m&&d.isReactiveState(m)&&(m=m.value);const L=typeof m;if(m===""||L==="boolean"||L==="string"&&(m==="true"||m==="false")||m==null||L==="number")s[b]=m;else{let g=k;g&&d.isReactiveState(g)&&(g=g.value),n[b]=g}o.push(b)}else{let m=k;m&&d.isReactiveState(m)&&(m=m.value),n[b]=m,o.push(b)}}else if(v==="@"){const[h,...N]=b.split("."),c=N;Ot(k,h);const A=typeof k=="function"?k:typeof t[k]=="function"?t[k]:void 0;if(A){const m=C=>{if(c.includes("prevent")&&C.preventDefault(),c.includes("stop")&&C.stopPropagation(),!(c.includes("self")&&C.target!==C.currentTarget))return c.includes("once")&&C.currentTarget?.removeEventListener(h,m),A(C)},L="on"+h.charAt(0).toUpperCase()+h.slice(1);s[L]=m}}else b==="ref"?s.ref=k:n[b]=k}return{props:s,attrs:n,directives:a,bound:o}}function Pe(e){if(!ie(e)||Ee(e))return e;const r=e.props?.directives;if(r&&r.when){const t=r.when.value,s=d.isReactiveState(t)?t.value:t,n={...r};delete n.when;const a={...e.props};Object.keys(n).length>0?a.directives=n:delete a.directives;const o={...e,props:a};return Array.isArray(o.children)&&(o.children=o.children.map(f=>typeof f=="object"&&f!==null?Pe(f):f)),{tag:"#anchor",key:e.key!=null?`when-${e.key}`:`when-${e.tag}`,children:s?[o]:[]}}if(Array.isArray(e.children)){const t=e.children.map(s=>typeof s=="object"&&s!==null?Pe(s):s);return{...e,children:t}}return e}function Ht(e,r,t){const s=Se.length>0?Se[Se.length-1]:void 0,n=t??s,a=!t&&r.length===0,o=a?e.join("<!--TEMPLATE_DELIM-->"):null;if(a&&o){const l=Re.get(o);if(l)return l}function i(l,S){return ee("#text",{},l,S)}function f(l,S,_=!1){let w=typeof l=="string"?d.decodeEntities(l):l;return!_&&typeof w=="string"&&/[\r\n]/.test(w)&&(w=w.replace(/\s+/g," ")),ee("#text",{},w,S)}let v="";for(let l=0;l<e.length;l++)v+=e[l],l<r.length&&(v+=`{{${l}}}`);const b=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,y=[];let p,E=[],j=null,k={},T,h=0;const N=[],c=new Set(["pre","code","textarea","script","style"]);function A(){if(j&&c.has(j.toLowerCase()))return!0;for(const l of y)if(c.has(l.tag.toLowerCase()))return!0;return!1}function m(l){if(!l||typeof l!="object"||Ee(l))return;const S=l,_=k;if(S.props||S.attrs){const w=S;w.props&&(_.props||(_.props={}),Object.assign(_.props,w.props)),w.attrs&&(_.attrs||(_.attrs={}),Object.keys(w.attrs).forEach(R=>{if(R==="style"&&_.attrs.style){const $=String(_.attrs.style).replace(/;?\s*$/,""),x=String(w.attrs.style).replace(/^;?\s*/,"");_.attrs.style=$+"; "+x}else if(R==="class"&&_.attrs.class){const $=String(_.attrs.class).trim().split(/\s+/).filter(Boolean),x=String(w.attrs.class).trim().split(/\s+/).filter(Boolean),M=[...new Set([...$,...x])];_.attrs.class=M.join(" ")}else _.attrs[R]=w.attrs[R]}))}else _.props||(_.props={}),Object.assign(_.props,S)}function L(l,S){const _=j?E:N;if(Ee(l)){const w=l.key??S,R=l.children;_.push({...l,key:w,children:R});return}if(ie(l)){_.push($t(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let w=0;w<l.length;w++){const R=l[w];Ee(R)||ie(R)||Array.isArray(R)?L(R,`${S}-${w}`):R!==null&&typeof R=="object"?d.isUnsafeHTML(R)?_.push(ee("#raw",{},R.__rawHTML,`${S}-${w}`)):m(R):_.push(i(String(R),`${S}-${w}`))}return}if(l!==null&&typeof l=="object"){if(d.isUnsafeHTML(l)){const w=l.__rawHTML??"";_.push(ee("#raw",{},w,S));return}m(l);return}_.push(i(String(l),S))}const C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;p=b.exec(v);)if(!(p[0].startsWith("<!--")&&p[0].endsWith("-->"))){if(p[1]){const l=p[1],S=p[0][1]==="/",_=p[0][p[0].length-2]==="/"||C.has(l),{props:w,attrs:R,directives:$,bound:x}=Pt(p[2]||"",r,n??{}),M={props:{},attrs:{}};for(const z in w)M.props[z]=w[z];for(const z in R)M.attrs[z]=R[z];M.attrs&&Object.prototype.hasOwnProperty.call(M.attrs,"key")&&!(M.props&&Object.prototype.hasOwnProperty.call(M.props,"key"))&&d.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"]},W=l.toLowerCase(),Z=z[W]??[];if(M.attrs){for(const I of Z)if(x&&x.includes(I)&&I in M.attrs&&!(M.props&&I in M.props)){let O=M.attrs[I];if(O&&d.isReactiveState(O))O=O.value,M.props[I]=O,delete M.attrs[I];else if(O&&typeof O=="object"&&"value"in O&&!(O instanceof Node))try{const B=O.value;M.props[I]=(W==="select"||W==="option")&&I==="value"?String(B):B,delete M.attrs[I]}catch{}else{const B=typeof O;if(I==="disabled")(O===""||B==="boolean"||B==="string"&&(O==="true"||O==="false")||O==null||B==="number")&&(M.props[I]=O,delete M.attrs[I]);else if(O===""||B==="string"||B==="number"||B==="boolean"||O==null){const D=(W==="select"||W==="option")&&I==="value"?String(O):O;M.props[I]=D,delete M.attrs[I]}}}}if(l.includes("-")||!!n?.__customElements?.has?.(l)){if(M.isCustomElement=!0,x&&M.attrs){const I=new Set(["id","name","data-key","key"]);for(const O of x)if(O in M.attrs&&!(M.props&&O in M.props)){const B=O.includes("-")?d.toCamel(O):O,D=M.attrs[O];if(M.props[B]=D,I.has(O)||d.isClassLikeAttr(O))try{const te=d.safeSerializeAttr(M.attrs[O]);te===null?delete M.attrs[O]:M.attrs[O]=te}catch{delete M.attrs[O]}else delete M.attrs[O]}}try{if(M.attrs&&!(M.props&&"modelValue"in M.props)){const I=M.attrs["model-value"]??M.attrs.modelValue;typeof I<"u"&&(M.props.modelValue=I)}}catch{}}}catch{}if($&&Object.keys($).some(z=>z==="model"||z.startsWith("model:")))try{const W=globalThis[Symbol.for("cer.registry")],Z=!!(W&&typeof W.has=="function"&&W.has(l)),K=n,I=!!(K&&(K.__customElements instanceof Set&&K.__customElements.has(l)||Array.isArray(K.__isCustomElements)&&K.__isCustomElements.includes(l)));if(!!(l.includes("-")||I||Z))for(const D of Object.keys($)){if(D!=="model"&&!D.startsWith("model:"))continue;const ce=$[D],te=ce.arg??(D.includes(":")?D.split(":",2)[1]:void 0),U=ce.value,Le=te??"modelValue",He=d.getNestedValue,Qe=d.setNestedValue,pe=n?._state||n;let X;if(typeof U=="string"&&pe)X=He(pe,U);else if(X=U,d.isReactiveState(U))try{U.value}catch{}M.props[Le]=X;try{const ne=d.toKebab(Le);M.attrs||(M.attrs={}),X!=null&&(typeof X=="string"||typeof X=="number"||typeof X=="boolean")&&(M.attrs[ne]=X)}catch{}M.isCustomElement=!0;const xe=`update:${d.toKebab(Le)}`.replace(/-([a-z])/g,(ne,Y)=>Y.toUpperCase()),et="on"+xe.charAt(0).toUpperCase()+xe.slice(1);M.props[et]=function(ne){const Y=ne.detail!==void 0?ne.detail:ne.target?ne.target.value:void 0;if(pe)if(U&&d.isReactiveState(U)){const re=U.value;if(Array.isArray(Y)&&Array.isArray(re)?JSON.stringify([...Y].sort())!==JSON.stringify([...re].sort()):Y!==re){U.value=Y;try{const se=n;if(se){const he=se.requestRender,ye=se._requestRender;typeof he=="function"?he():typeof ye=="function"&&ye()}}catch{}}}else{const re=He(pe||{},typeof U=="string"?U:String(U));if(Array.isArray(Y)&&Array.isArray(re)?JSON.stringify([...Y].sort())!==JSON.stringify([...re].sort()):Y!==re){Qe(pe||{},typeof U=="string"?U:String(U),Y);try{const se=n;if(se){const he=se.requestRender,ye=se._requestRender;typeof he=="function"?he():typeof ye=="function"&&ye()}}catch{}}}},delete $[D]}}catch{}if(Object.keys($).length>0&&(M.directives={...$}),S){const z=E.some(I=>typeof I=="object"&&I.tag!=="#text");let W=E;if(z&&E.length>0){let I=0;for(;I<E.length;){const B=E[I];if(!ie(B)||B.tag!=="#text"||typeof B.children!="string"||B.children.trim()!=="")break;I++}let O=E.length-1;for(;O>=0;){const B=E[O];if(!ie(B)||B.tag!=="#text"||typeof B.children!="string"||B.children.trim()!=="")break;O--}I===0&&O===E.length-1?W=E:I>O?W=[]:W=E.slice(I,O+1)}const Z=ee(j,k,W.length===1&&ie(W[0])&&W[0].tag==="#text"?typeof W[0].children=="string"?W[0].children:"":W.length?W:void 0,T),K=y.pop();K?(j=K.tag,k=K.props,T=K.key,E=K.children,E.push(Z)):(N.push(Z),j=null,k={},T=void 0,E=[])}else _?j?E.push(ee(l,M,void 0,void 0)):N.push(ee(l,M,void 0,void 0)):(j&&y.push({tag:j,props:k,children:E,key:T}),j=l,k=M,E=[])}else if(typeof p[3]<"u"){const l=Number(p[3]),S=r[l],_=`interp-${l}`;L(S,_)}else if(p[4]){const l=p[4],S=j?E:N,_=l.split(/({{\d+}})/);for(const w of _){if(!w)continue;const R=w.match(/^{{(\d+)}}$/);if(R){const $=Number(R[1]),x=r[$],M=`interp-${$}`;L(x,M)}else{const $=`text-${h++}`,x=A();S.push(f(w,$,x))}}}}const g=N.filter(l=>ie(l)&&l.tag==="#text"?typeof l.children=="string"&&l.children.trim()!=="":!0).map(l=>Pe(l));if(g.length===1){const l=g[0];return a&&o&&Re.set(o,l),l}else if(g.length>1){const l=g;return a&&o&&Re.set(o,l),l}return ee("div",{},"","fallback-root")}function xt(e,...r){if(d.isDiscoveryRender$1())return[];const t=r[r.length-1],s=typeof t=="object"&&t&&!Array.isArray(t)?t:void 0;return Ht(e,r,s)}exports.component=jt;exports.html=xt;exports.vdomRenderer=Xe;
22
- //# sourceMappingURL=template-compiler-CDvhsHia.cjs.map