@jasonshimmy/custom-elements-runtime 0.2.7 → 0.3.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.
@@ -1,4 +1,4 @@
1
- (function(R,ee){typeof exports=="object"&&typeof module<"u"?ee(exports):typeof define=="function"&&define.amd?define(["exports"],ee):(R=typeof globalThis<"u"?globalThis:R||self,ee(R.CustomElementsRuntime={}))})(this,(function(R){"use strict";function ee(e,t){return se(e?t:[],"when-block")}function qe(e,t){return e.map((r,i)=>{const n=typeof r=="object"?r?.key??r?.id??`idx-${i}`:String(r);return se(t(r,i),`each-${n}`)})}function Te(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return De(...e)}}}function De(...e){for(let t=0;t<e.length;t++){const[r,i]=e[t];if(r)return[se(i,`whenChain-branch-${t}`)]}return[se([],"whenChain-empty")]}function se(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class U extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return U.instance||(U.instance=new U),U.instance}emit(t,r){const i=Date.now(),n=this.eventCounters.get(t);if(!n||i-n.window>1e3)this.eventCounters.set(t,{count:1,window:i});else if(n.count++,n.count>50&&n.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(r)}catch(a){console.error(`Error in global event handler for "${t}":`,a)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const i=this.handlers[t];i&&i.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,i){return this.addEventListener(t,r,i),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(i=>{const n=this.on(t,s=>{n(),r(s),i(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,i]of this.eventCounters.entries())t[r]={count:i.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const Y=U.getInstance(),Ie=(e,t)=>Y.emit(e,t),He=(e,t)=>Y.on(e,t),Fe=(e,t)=>Y.off(e,t),Ke=(e,t)=>Y.once(e,t),Ue=(e,t,r)=>Y.listen(e,t,r);function ge(e){let t={...e};const r=[];function i(a){r.push(a),a(t)}function n(){return t}function s(a){const f=typeof a=="function"?a(t):a;t={...t,...f},o()}function o(){r.forEach(a=>a(t))}return{subscribe:i,getState:n,setState:s}}function V(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function H(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]):e}function z(e,t){return typeof t=="string"?t.split(".").reduce((r,i)=>r?.[i],e):t}function oe(e,t,r){const i=String(t).split("."),n=i.pop();if(!n)return;const s=i.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);s[n]=r}function Ve(e,t,r){if(r)for(const[i,n]of Object.entries(r)){let s,o={};if(Array.isArray(n)?(s=n[0],o=n[1]||{}):s=n,t.set(i,{callback:s,options:o,oldValue:z(e,i)}),o.immediate)try{const a=z(e,i);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${i}":`,a)}}}function Je(e,t,r,i){const n=(o,a)=>{if(o===a)return!0;if(typeof o!=typeof a||typeof o!="object"||o===null||a===null)return!1;if(Array.isArray(o)&&Array.isArray(a))return o.length!==a.length?!1:o.every((d,y)=>n(d,a[y]));const f=Object.keys(o),u=Object.keys(a);return f.length!==u.length?!1:f.every(d=>n(o[d],a[d]))},s=t.get(r);if(s&&!n(i,s.oldValue))try{s.callback(i,s.oldValue,e),s.oldValue=i}catch(o){console.error(`Error in watcher for "${r}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&r.startsWith(o+"."))try{const f=z(e,o);n(f,a.oldValue)||(a.callback(f,a.oldValue,e),a.oldValue=f)}catch(f){console.error(`Error in deep watcher for "${o}":`,f)}}function Ze(e,t,r){if(!t.props)return;function i(n,s){return s===Boolean?n==="true":s===Number?Number(n):n}Object.entries(t.props).forEach(([n,s])=>{if(s.type===Function&&typeof e[n]=="function")r[n]=e[n];else{const o=e.getAttribute(V(n));o!==null?r[n]=H(i(o,s.type)):"default"in s&&s.default!==void 0&&(r[n]=H(s.default))}})}function Ge(e,t,r,i){e.onConnected&&!r&&(e.onConnected(t),i(!0))}function Ye(e,t,r,i,n,s,o,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(f=>f()),i(),n(),s(!1),o(null),a(!1)}function Qe(e,t,r,i,n){e.onAttributeChanged&&e.onAttributeChanged(t,r,i,n)}function J(e,t){if(t&&e instanceof HTMLElement){for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))J(r,t)}}function Xe(e,t,r,i,n,s,o,a){if(!s)return;const f=t.includes("lazy"),u=t.includes("trim"),d=t.includes("number"),y=()=>z(s._state||s,e),c=y();let h="text";o instanceof HTMLInputElement?h=i?.type||o.type||"text":o instanceof HTMLSelectElement?h="select":o instanceof HTMLTextAreaElement&&(h="textarea");const k=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,w=k?h==="checkbox"||h==="radio"?"checked":"value":a??"modelValue";if(h==="checkbox")if(Array.isArray(c))r[w]=c.includes(String(o?.getAttribute("value")??i?.value??""));else{const x=o?.getAttribute("true-value")??!0;r[w]=c===x}else if(h==="radio")r[w]=c===(i?.value??"");else if(h==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const x=Array.isArray(c)?c.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(l=>{l.selected=x.includes(l.value)})},0),r[w]=Array.isArray(c)?c:[]}else r[w]=c;else{r[w]=c;try{const x=V(w);i&&(i[x]=c)}catch{}}const b=f||h==="checkbox"||h==="radio"||h==="select"?"change":"input",m=x=>{if(x.isComposing||n._isComposing||x.isTrusted===!1)return;const l=x.target;if(!l||l._modelUpdating)return;let g=l.value;if(h==="checkbox"){const E=y();if(Array.isArray(E)){const S=l.getAttribute("value")??"",A=Array.from(E);if(l.checked)A.includes(S)||A.push(S);else{const T=A.indexOf(S);T>-1&&A.splice(T,1)}g=A}else{const S=l.getAttribute("true-value")??!0,A=l.getAttribute("false-value")??!1;g=l.checked?S:A}}else if(h==="radio")g=l.getAttribute("value")??l.value;else if(h==="select"&&l.multiple)g=Array.from(l.selectedOptions).map(E=>E.value);else if(u&&typeof g=="string"&&(g=g.trim()),d){const E=Number(g);isNaN(E)||(g=E)}const p=s._state||s,_=z(p,e);if(Array.isArray(g)&&Array.isArray(_)?JSON.stringify([...g].sort())!==JSON.stringify([..._].sort()):g!==_){l._modelUpdating=!0;try{oe(p,e,g),s._requestRender&&s._requestRender()}finally{setTimeout(()=>l._modelUpdating=!1,0)}}};k?n[b]=m:n[`update:${V(w)}`]=x=>{const l=s._state||s,g=x.detail!==void 0?x.detail:x.target?.value,p=z(l,e);(Array.isArray(g)&&Array.isArray(p)?JSON.stringify([...g].sort())!==JSON.stringify([...p].sort()):g!==p)&&(oe(l,e,g),s._requestRender&&s._requestRender())},(h==="text"||h==="textarea")&&(n.compositionstart=(()=>n._isComposing=!0),n.compositionend=x=>{n._isComposing=!1;const l=x.target;l&&setTimeout(()=>{const g=l.value,p=s._state||s,_=z(p,e);let C=g;if(u&&(C=C.trim()),d){const S=Number(C);isNaN(S)||(C=S)}if(Array.isArray(C)&&Array.isArray(_)?JSON.stringify([...C].sort())!==JSON.stringify([..._].sort()):C!==_){l._modelUpdating=!0;try{oe(p,e,C),s._requestRender&&s._requestRender()}finally{setTimeout(()=>l._modelUpdating=!1,0)}}},0)})}function je(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function et(e,t,r,i){if(i){if(typeof e=="object"&&e!==null)for(const[n,s]of Object.entries(e))t[n]=s;else if(typeof e=="string")try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){for(const[s,o]of Object.entries(n))t[s]=o;return}}catch{const n=z(i,e);r[e]=n}}}function tt(e,t,r){if(!r)return;const i=z(r,e),n=t.style||"",s=i?"":"none";if(n){const o=n.split(";").filter(Boolean),a=o.findIndex(f=>f.trim().startsWith("display:"));a>=0?o[a]=`display: ${s}`:o.push(`display: ${s}`),t.style=o.join("; ")}else t.style=`display: ${s}`}function rt(e,t,r){if(!r)return;const i=z(r,e);let n=[];typeof i=="string"?n=[i]:Array.isArray(i)?n=i.filter(Boolean):typeof i=="object"&&(n=Object.entries(i).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${n.join(" ")}`.trim():n.join(" ");o&&(t.class=o)}function nt(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=z(r,e)}else i=e;let n="";if(typeof i=="string")n=i;else if(i&&typeof i=="object"){const o=[];for(const[a,f]of Object.entries(i))if(f!=null&&f!==""){const u=a.replace(/[A-Z]/g,c=>`-${c.toLowerCase()}`),d=["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"&&d.includes(u)&&(y=`${f}px`),o.push(`${u}: ${y}`)}n=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+n}function Re(e,t,r,i){const n={},s={...i||{}},o={};for(const[a,f]of Object.entries(e)){const{value:u,modifiers:d,arg:y}=f;if(a==="model"||a.startsWith("model:")){const c=a.split(":"),h=c.length>1?c[1]:y;Xe(typeof u=="string"?u:String(u),d,n,s,o,t,r,h);continue}switch(a){case"bind":et(u,n,s,t);break;case"show":tt(u,s,t);break;case"class":rt(u,s,t);break;case"style":nt(u,s,t);break}}return{props:n,attrs:s,listeners:o}}function me(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const y=o.tag||"node",c=o.props?.attrs?.id??o.props?.attrs?.name??o.props?.attrs?.["data-key"]??"";a=c?`${t}:${y}:${c}`:`${t}:${y}`}let f=a,u=1;for(;s.has(f);)f=`${a}#${u++}`;s.add(f);let d=o.children;return Array.isArray(d)&&(d=me(d,f)),{...o,key:f,children:d}})}const r=e;let i=r.props?.key??r.key??t,n=r.children;return Array.isArray(n)&&(n=me(n,i)),{...r,key:i,children:n}}function it(e,t,r,i){const n=r.directives??{},s=Re(n,i,e,r.attrs),o={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},f=t.props??{},u=o;for(const c in{...f,...u}){const h=f[c],k=u[c];if(h!==k){if(c==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==k&&(e.value=k??"");else if(c==="checked"&&e instanceof HTMLInputElement)e.checked=!!k;else if(c.startsWith("on")&&typeof k=="function"){const $=je(c);typeof h=="function"&&e.removeEventListener($,h),e.addEventListener($,k)}else if(k==null||k===!1)e.removeAttribute(c);else if((r?.isCustomElement??t?.isCustomElement??!1)||c in e)try{e[c]=k}catch{}}}for(const[c,h]of Object.entries(s.listeners||{}))e.addEventListener(c,h);const d=t.attrs??{},y=a;for(const c in{...d,...y}){const h=d[c],k=y[c];h!==k&&(k==null||k===!1?e.removeAttribute(c):e.setAttribute(c,String(k)))}}function M(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const y=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(y.key=e.key),y}if(e.tag==="#anchor"){const y=e,c=Array.isArray(y.children)?y.children:[],h=document.createTextNode(""),k=document.createTextNode("");y.key!=null&&(h.key=`${y.key}:start`,k.key=`${y.key}:end`),y._startNode=h,y._endNode=k;const $=document.createDocumentFragment();$.appendChild(h);for(const w of c){const b=M(w,t);$.appendChild(b)}return $.appendChild(k),$}const i=document.createElement(e.tag);e.key!=null&&(i.key=e.key);const{props:n={},attrs:s={},directives:o={}}=e.props??{},a=Re(o,t,i,s),f={...n,...a.props},u={...s,...a.attrs};for(const y in u){const c=u[y];typeof y!="string"||/\[object Object\]/.test(y)||(typeof c=="boolean"?c&&i.setAttribute(y,""):c!=null&&i.setAttribute(y,c))}for(const y in f){const c=f[y];if(!(typeof y!="string"||/\[object Object\]/.test(y)))if(y==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement))i.value=c??"";else if(y==="checked"&&i instanceof HTMLInputElement)i.checked=!!c;else if(y.startsWith("on")&&typeof c=="function")i.addEventListener(je(y),c);else{if(y.startsWith("on")&&c===void 0)continue;if(c==null||c===!1)i.removeAttribute(y);else if((e.props?.isCustomElement??!1)||y in i)try{i[y]=c}catch{}}}for(const[y,c]of Object.entries(a.listeners||{}))i.addEventListener(y,c);const d=e.props?.ref??(e.props?.props&&e.props.props.ref);typeof e!="string"&&d&&r&&(r[d]=i);try{if(typeof i._applyProps=="function")try{i._applyProps(i._cfg)}catch{}typeof i.requestRender=="function"?i.requestRender():typeof i._render=="function"&&i._render(i._cfg)}catch{}if(Array.isArray(e.children))for(const y of e.children)i.appendChild(M(y,t,r));else typeof e.children=="string"&&(i.textContent=e.children);return i}function st(e,t,r,i,n){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],a=new Map;for(const h of o)h&&h.key!=null&&a.set(h.key,h);const f=new Map;for(const h of s){const k=h.key;k!=null&&f.set(k,h)}const u=new Set;let d=e.firstChild;function y(h,k){let $=h;for(;$&&(u.add($),$!==k);)$=$.nextSibling}function c(h,k,$,w){const b=[];let m=h.nextSibling;for(;m&&m!==k;)b.push(m),m=m.nextSibling;const x=Array.isArray($)?$:[];if(w.some(g=>g&&g.key!=null)||x.some(g=>g&&g.key!=null)){const g=new Map,p=new Map;for(const E of x)E&&E.key!=null&&g.set(E.key,E);for(const E of b){const S=E.key;S!=null&&p.set(S,E)}const _=new Set;let C=h.nextSibling;for(const E of w){let S;if(E.key!=null&&p.has(E.key)){const A=g.get(E.key);S=ae(p.get(E.key),A,E,i),_.add(S),S!==C&&e.contains(S)&&e.insertBefore(S,C)}else S=M(E,i),e.insertBefore(S,C),_.add(S);C=S.nextSibling}for(const E of b)!_.has(E)&&e.contains(E)&&e.removeChild(E)}else{const g=Math.min(x.length,w.length);for(let p=0;p<g;p++){const _=x[p],C=w[p],E=ae(b[p],_,C,i);E!==b[p]&&(e.insertBefore(E,b[p]),e.removeChild(b[p]))}for(let p=g;p<w.length;p++)e.insertBefore(M(w[p],i),k);for(let p=g;p<b.length;p++)e.removeChild(b[p])}}for(const h of r){let k;if(h.tag==="#anchor"){const $=h.key,w=`${$}:start`,b=`${$}:end`;let m=f.get(w),x=f.get(b);const l=Array.isArray(h.children)?h.children:[];if(m||(m=document.createTextNode(""),m.key=w),x||(x=document.createTextNode(""),x.key=b),h._startNode=m,h._endNode=x,!e.contains(m)||!e.contains(x)){e.insertBefore(m,d);for(const g of l)e.insertBefore(M(g,i),d);e.insertBefore(x,d)}else c(m,x,a.get($)?.children,l);y(m,x),d=x.nextSibling;continue}if(h.key!=null&&f.has(h.key)){const $=a.get(h.key);k=ae(f.get(h.key),$,h,i,n),u.add(k),k!==d&&e.contains(k)&&(d&&!e.contains(d)&&(d=null),e.insertBefore(k,d))}else k=M(h,i,n),d&&!e.contains(d)&&(d=null),e.insertBefore(k,d),u.add(k);d=k.nextSibling}for(const h of s)!u.has(h)&&e.contains(h)&&(J(h,n),e.removeChild(h))}function ae(e,t,r,i,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&J(e,n),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const o=document.createTextNode(r);return e.parentNode?.replaceChild(o,e),o}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const o=r,a=Array.isArray(o.children)?o.children:[],f=o._startNode??document.createTextNode(""),u=o._endNode??document.createTextNode("");o.key!=null&&(f.key=`${o.key}:start`,u.key=`${o.key}:end`),o._startNode=f,o._endNode=u;const d=document.createDocumentFragment();d.appendChild(f);for(const y of a){const c=M(y,i);d.appendChild(c)}return d.appendChild(u),e.parentNode?.replaceChild(d,e),f}if(!r){J(e,n);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){J(e,n);const o=M(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),f=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,f.key=`${r.key}:end`),r._startNode=a,r._endNode=f;const u=document.createDocumentFragment();u.appendChild(a);for(const d of o)u.appendChild(M(d,i));return u.appendChild(f),e.parentNode?.replaceChild(u,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return it(o,t.props||{},r.props||{},i),st(o,t.children,r.children,i,n),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),o}J(e,n);const s=M(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function ot(e,t,r,i){let n;Array.isArray(t)?t.length===1?(n=t[0],n&&typeof n=="object"&&n.key==null&&(n={...n,key:"__root__"})):n={tag:"div",key:"__root__",children:t}:(n=t,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=me(n,String(n.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;s&&o?typeof s!="string"&&typeof n!="string"&&s.tag===n.tag&&s.key===n.key?a=ae(o,s,n,r,i):(a=M(n,r,i),e.replaceChild(a,o)):(a=M(n,r,i),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const f=[];for(let u=0;u<e.childNodes.length;u++){const d=e.childNodes[u];d!==a&&d.nodeName!=="STYLE"&&(J(d,i),f.push(d))}f.forEach(u=>e.removeChild(u)),e._prevVNode=n,e._prevDom=a}function ce(e){if(typeof e=="string")return H(e);if(e.tag==="#text")return typeof e.children=="string"?H(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(ce).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([n,s])=>` ${n}="${H(String(s))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([n])=>n!=="attrs"&&n!=="directives"&&n!=="ref"&&n!=="key").map(([n,s])=>` ${n}="${H(String(s))}"`).join(""));const i=Array.isArray(e.children)?e.children.filter(Boolean).map(ce).join(""):typeof e.children=="string"?H(e.children):e.children?ce(e.children):"";return`<${e.tag}${t}${r}>${i}</${e.tag}>`}function ye(e,...t){let r="";for(let i=0;i<e.length;i++)r+=e[i],i<t.length&&(r+=t[i]);return r}function Le(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let le=null;function Be(){return le||(le=new CSSStyleSheet,le.replaceSync(Le(ct))),le}function at(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const ct=ye`
1
+ (function(j,Y){typeof exports=="object"&&typeof module<"u"?Y(exports):typeof define=="function"&&define.amd?define(["exports"],Y):(j=typeof globalThis<"u"?globalThis:j||self,Y(j.CustomElementsRuntime={}))})(this,(function(j){"use strict";function Y(e,t){return O(e?t:[],"when-block")}function Ye(e,t){return e.map((r,i)=>{const n=typeof r=="object"?r?.key??r?.id??`idx-${i}`:String(r);return O(t(r,i),`each-${n}`)})}function We(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return Qe(...e)}}}function Qe(...e){for(let t=0;t<e.length;t++){const[r,i]=e[t];if(r)return[O(i,`whenChain-branch-${t}`)]}return[O([],"whenChain-empty")]}function O(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}function Xe(e,t){return Y(!e,t)}function et(e,t){const r=!e||e.length===0;return Y(r,t)}function tt(e,t){const r=!!(e&&e.length>0);return Y(r,t)}function rt(e,t,r){const i=[];return e.forEach((n,s)=>{t(n,s)&&i.push({item:n,originalIndex:s})}),i.map(({item:n,originalIndex:s},o)=>{const a=typeof n=="object"&&n!=null?n?.key??n?.id??`filtered-${s}`:`filtered-${s}`;return O(r(n,s,o),`each-where-${a}`)})}function nt(e,t){const r=e?.length??0;return r===0&&t.empty?O(t.empty,"switch-length-empty"):r===1&&t.one?O(t.one(e[0]),"switch-length-one"):t.exactly?.[r]?O(t.exactly[r](e),`switch-length-${r}`):r>1&&t.many?O(t.many(e),"switch-length-many"):O([],"switch-length-fallback")}function it(e,t,r){const i=new Map;return e.forEach(n=>{const s=t(n);i.has(s)||i.set(s,[]),i.get(s).push(n)}),Array.from(i.entries()).map(([n,s],o)=>O(r(n,s,o),`each-group-${n}`))}function st(e,t,r,i){const n=r*t,s=Math.min(n+t,e.length);return e.slice(n,s).map((a,c)=>{const u=n+c,m=typeof a=="object"&&a!=null?a?.key??a?.id??`page-${u}`:`page-${u}`;return O(i(a,u,c),`each-page-${m}`)})}function ot(e,t){return e.loading&&t.loading?O(t.loading,"promise-loading"):e.error&&t.error?O(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?O(t.success(e.data),"promise-success"):t.idle?O(t.idle,"promise-idle"):O([],"promise-fallback")}function q(e,t){const r=typeof window<"u"&&window.matchMedia?.(e)?.matches;return Y(!!r,t)}const G={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},_e=["sm","md","lg","xl","2xl"],Ie={sm:e=>q(G.sm,e),md:e=>q(G.md,e),lg:e=>q(G.lg,e),xl:e=>q(G.xl,e),"2xl":e=>q(G["2xl"],e),dark:e=>q(G.dark,e),light:e=>q("(prefers-color-scheme: light)",e),touch:e=>q("(hover: none) and (pointer: coarse)",e),mouse:e=>q("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>q("(prefers-reduced-motion: reduce)",e),highContrast:e=>q("(prefers-contrast: high)",e),portrait:e=>q("(orientation: portrait)",e),landscape:e=>q("(orientation: landscape)",e)};function at(e,t){const r=[];e.includes("dark")?r.push(G.dark):e.includes("light")&&r.push("(prefers-color-scheme: light)");const i=e.filter(o=>_e.includes(o)),n=i[i.length-1];n&&n in G&&r.push(G[n]);const s=r.length>0?r.join(" and "):"all";return q(s,t)}function ct(e){const t=[];return e.base&&t.push(O(e.base,"responsive-base")),_e.forEach(r=>{const i=e[r];i&&t.push(Ie[r](i))}),t}function lt(e){const t=[];let r=null;return{case(i,n){const s=typeof i=="function"?i:o=>o===i;return t.push({condition:s,content:n}),this},when(i,n){return t.push({condition:i,content:n}),this},otherwise(i){return r=i,this},done(){for(let i=0;i<t.length;i++){const{condition:n,content:s}=t[i];if(n(e))return O(s,`switch-case-${i}`)}return O(r||[],"switch-otherwise")}}}const qe=typeof process<"u"&&process.env?.NODE_ENV!=="production";function Q(e,...t){qe&&console.error(e,...t)}function de(e,...t){qe&&console.warn(e,...t)}class re extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return re.instance||(re.instance=new re),re.instance}emit(t,r){const i=Date.now(),n=this.eventCounters.get(t);if(!n||i-n.window>1e3)this.eventCounters.set(t,{count:1,window:i});else if(n.count++,n.count>50&&n.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(o=>{try{o(r)}catch(a){Q(`Error in global event handler for "${t}":`,a)}})}on(t,r){return this.handlers[t]||(this.handlers[t]=new Set),this.handlers[t].add(r),()=>this.off(t,r)}off(t,r){const i=this.handlers[t];i&&i.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,i){return this.addEventListener(t,r,i),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(i=>{const n=this.on(t,s=>{n(),r(s),i(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,i]of this.eventCounters.entries())t[r]={count:i.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const se=re.getInstance(),ft=(e,t)=>se.emit(e,t),ut=(e,t)=>se.on(e,t),dt=(e,t)=>se.off(e,t),pt=(e,t)=>se.once(e,t),ht=(e,t,r)=>se.listen(e,t,r);function Ee(e){let t={...e};const r=[];function i(a){r.push(a),a(t)}function n(){return t}function s(a){const c=typeof a=="function"?a(t):a;t={...t,...c},o()}function o(){r.forEach(a=>a(t))}return{subscribe:i,getState:n,setState:s}}function X(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ee(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"})[t]):e}function K(e,t){return typeof t=="string"?t.split(".").reduce((r,i)=>r?.[i],e):t}function pe(e,t,r){const i=String(t).split("."),n=i.pop();if(!n)return;const s=i.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);s[n]=r}function gt(e,t,r){if(r)for(const[i,n]of Object.entries(r)){let s,o={};if(Array.isArray(n)?(s=n[0],o=n[1]||{}):s=n,t.set(i,{callback:s,options:o,oldValue:K(e,i)}),o.immediate)try{const a=K(e,i);s(a,void 0,e)}catch(a){Q(`Error in immediate watcher for "${i}":`,a)}}}function mt(e,t,r,i){const n=(o,a)=>{if(o===a)return!0;if(typeof o!=typeof a||typeof o!="object"||o===null||a===null)return!1;if(Array.isArray(o)&&Array.isArray(a))return o.length!==a.length?!1:o.every((m,T)=>n(m,a[T]));const c=Object.keys(o),u=Object.keys(a);return c.length!==u.length?!1:c.every(m=>n(o[m],a[m]))},s=t.get(r);if(s&&!n(i,s.oldValue))try{s.callback(i,s.oldValue,e),s.oldValue=i}catch(o){Q(`Error in watcher for "${r}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&r.startsWith(o+"."))try{const c=K(e,o);n(c,a.oldValue)||(a.callback(c,a.oldValue,e),a.oldValue=c)}catch(c){Q(`Error in deep watcher for "${o}":`,c)}}function yt(e,t,r){if(!t.props)return;function i(n,s){return s===Boolean?n==="true":s===Number?Number(n):n}Object.entries(t.props).forEach(([n,s])=>{if(s.type===Function&&typeof e[n]=="function")r[n]=e[n];else{const o=X(n),a=e.getAttribute(o);if(typeof e[n]<"u")try{const c=e[n];s.type===Boolean&&typeof c=="boolean"||s.type===Number&&typeof c=="number"||s.type===Function&&typeof c=="function"?r[n]=c:r[n]=ee(i(String(c),s.type))}catch{r[n]=e[n]}else a!==null?r[n]=ee(i(a,s.type)):"default"in s&&s.default!==void 0&&(r[n]=ee(s.default))}})}function bt(e,t,r,i){e.onConnected&&!r&&(e.onConnected(t),i(!0))}function wt(e,t,r,i,n,s,o,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(c=>c()),i(),n(),s(!1),o(null),a(!1)}function xt(e,t,r,i,n){e.onAttributeChanged&&e.onAttributeChanged(t,r,i,n)}function ne(e,t){if(t&&e instanceof HTMLElement){for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))ne(r,t)}}function vt(e,t,r,i,n,s,o,a){if(!s)return;const c=t.includes("lazy"),u=t.includes("trim"),m=t.includes("number"),T=()=>K(s._state||s,e),p=T();let l="text";o instanceof HTMLInputElement?l=i?.type||o.type||"text":o instanceof HTMLSelectElement?l="select":o instanceof HTMLTextAreaElement&&(l="textarea");const w=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,d=w?l==="checkbox"||l==="radio"?"checked":"value":a??"modelValue";if(l==="checkbox")if(Array.isArray(p))r[d]=p.includes(String(o?.getAttribute("value")??i?.value??""));else{const x=o?.getAttribute("true-value")??!0;r[d]=p===x}else if(l==="radio")r[d]=p===(i?.value??"");else if(l==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const x=Array.isArray(p)?p.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(f=>{f.selected=x.includes(f.value)})},0),r[d]=Array.isArray(p)?p:[]}else r[d]=p;else{r[d]=p;try{const x=X(d);i&&(i[x]=p)}catch{}}const g=c||l==="checkbox"||l==="radio"||l==="select"?"change":"input",y=x=>{if(x.isComposing||n._isComposing)return;const f=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(x.isTrusted===!1&&!f)return;const b=x.target;if(!b||b._modelUpdating)return;let h=b.value;if(l==="checkbox"){const E=T();if(Array.isArray(E)){const C=b.getAttribute("value")??"",A=Array.from(E);if(b.checked)A.includes(C)||A.push(C);else{const M=A.indexOf(C);M>-1&&A.splice(M,1)}h=A}else{const C=b.getAttribute("true-value")??!0,A=b.getAttribute("false-value")??!1;h=b.checked?C:A}}else if(l==="radio")h=b.getAttribute("value")??b.value;else if(l==="select"&&b.multiple)h=Array.from(b.selectedOptions).map(E=>E.value);else if(u&&typeof h=="string"&&(h=h.trim()),m){const E=Number(h);isNaN(E)||(h=E)}const _=s._state||s,S=K(_,e);if(Array.isArray(h)&&Array.isArray(S)?JSON.stringify([...h].sort())!==JSON.stringify([...S].sort()):h!==S){b._modelUpdating=!0;try{if(pe(_,e,h),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,h),b){const E=`update:${X(d)}`,C=new CustomEvent(E,{detail:h,bubbles:!0,composed:!0});b.dispatchEvent(C)}}finally{setTimeout(()=>b._modelUpdating=!1,0)}}};if(w){if(n[g]){const x=n[g];o&&o.removeEventListener(g,x)}n[g]=y}else{const x=`update:${X(d)}`;if(n[x]){const f=n[x];o&&o.removeEventListener(x,f)}n[x]=f=>{const b=s._state||s,h=f.detail!==void 0?f.detail:f.target?.value,_=K(b,e);if(Array.isArray(h)&&Array.isArray(_)?JSON.stringify([...h].sort())!==JSON.stringify([..._].sort()):h!==_){pe(b,e,h),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,h);const $=f.target;if($){$[d]=h;try{const E=X(d);typeof h=="boolean"?h?$.setAttribute(E,"true"):$.setAttribute(E,"false"):$.setAttribute(E,String(h))}catch{}queueMicrotask(()=>{typeof $._applyProps=="function"&&$._applyProps($._cfg),typeof $._requestRender=="function"&&$._requestRender()})}}}}(l==="text"||l==="textarea")&&(n.compositionstart=(()=>n._isComposing=!0),n.compositionend=x=>{n._isComposing=!1;const f=x.target;f&&setTimeout(()=>{const b=f.value,h=s._state||s,_=K(h,e);let S=b;if(u&&(S=S.trim()),m){const E=Number(S);isNaN(E)||(S=E)}if(Array.isArray(S)&&Array.isArray(_)?JSON.stringify([...S].sort())!==JSON.stringify([..._].sort()):S!==_){f._modelUpdating=!0;try{pe(h,e,S),s._requestRender&&s._requestRender(),s._triggerWatchers&&s._triggerWatchers(e,S)}finally{setTimeout(()=>f._modelUpdating=!1,0)}}},0)})}function ze(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function kt(e,t,r,i){if(typeof e=="object"&&e!==null)for(const[n,s]of Object.entries(e))n.startsWith("data-")||n.startsWith("aria-")||n==="class"?r[n]=s:t[n]=s;else if(typeof e=="string"){if(!i)return;try{const n=he(e,i);if(typeof n=="object"&&n!==null){for(const[s,o]of Object.entries(n))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?r[s]=o:t[s]=o;return}else{r[e]=n;return}}catch{const n=K(i,e);r[e]=n}}}function _t(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=he(e,r)}else i=e;const n=t.style||"";let s=n;if(i){if(n){const o=n.split(";").map(c=>c.trim()).filter(Boolean),a=o.findIndex(c=>c.startsWith("display:"));a>=0&&o[a]==="display: none"&&(o.splice(a,1),s=o.length>0?o.join("; ")+";":"")}}else if(n){const o=n.split(";").filter(Boolean),a=o.findIndex(c=>c.trim().startsWith("display:"));a>=0?o[a]="display: none":o.push("display: none"),s=o.join("; ")}else s="display: none";s!==n&&(s?t.style=s:delete t.style)}function he(e,t){if([/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i].some(i=>i.test(e))){de("Potentially dangerous expression blocked:",e);return}if(e.trim().startsWith("{")&&e.trim().endsWith("}"))try{const i=Object.keys(t),n=i.map(a=>t[a]),s=e.replace(/ctx\./g,"");if(s.length>1e3){de("Expression too long, blocked for security:",e);return}return new Function(...i,`return ${s}`)(...n)}catch(i){de("Failed to evaluate expression:",e,i);return}if(e.startsWith("ctx.")){const i=e.slice(4);return K(t,i)}return K(t,e)}function Et(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=he(e,r)}else i=e;let n=[];typeof i=="string"?n=[i]:Array.isArray(i)?n=i.filter(Boolean):typeof i=="object"&&i!==null&&(n=Object.entries(i).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",o=s?`${s} ${n.join(" ")}`.trim():n.join(" ");o&&(t.class=o)}function St(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=he(e,r)}else i=e;let n="";if(typeof i=="string")n=i;else if(i&&typeof i=="object"){const o=[];for(const[a,c]of Object.entries(i))if(c!=null&&c!==""){const u=a.replace(/[A-Z]/g,p=>`-${p.toLowerCase()}`),m=["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 T=String(c);typeof c=="number"&&m.includes(u)&&(T=`${c}px`),o.push(`${u}: ${T}`)}n=o.join("; ")+(o.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+n}function He(e,t,r,i){const n={},s={...i||{}},o={};for(const[a,c]of Object.entries(e)){const{value:u,modifiers:m,arg:T}=c;if(a==="model"||a.startsWith("model:")){const p=a.split(":"),l=p.length>1?p[1]:T;vt(typeof u=="string"?u:String(u),m,n,s,o,t,r,l);continue}switch(a){case"bind":kt(u,n,s,t);break;case"show":_t(u,s,t);break;case"class":Et(u,s,t);break;case"style":St(u,s,t);break}}return{props:n,attrs:s,listeners:o}}function Se(e,t){if(Array.isArray(e)){const s=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const T=o.tag||"node",l=[o.props?.attrs?.id,o.props?.attrs?.name,o.props?.attrs?.["data-key"],o.props?.props?.id,o.props?.props?.name,o.props?.props?.dataKey,o.props?.props?.["data-key"]].find(w=>w!=null)??"";a=l?`${t}:${T}:${l}`:`${t}:${T}`}let c=a,u=1;for(;s.has(c);)c=`${a}#${u++}`;s.add(c);let m=o.children;return Array.isArray(m)&&(m=Se(m,c)),{...o,key:c,children:m}})}const r=e;let i=r.props?.key??r.key??t,n=r.children;return Array.isArray(n)&&(n=Se(n,i)),{...r,key:i,children:n}}function Ne(e,t,r,i){const n=r.directives??{},s=He(n,i,e,r.attrs),o={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},c=t.props??{},u=o,m=r?.isCustomElement??t?.isCustomElement??!1;let T=!1;for(const w in{...c,...u}){const v=c[w],d=u[w];if(v!==d)if(T=!0,w==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==d&&(e.value=d??"");else if(w==="checked"&&e instanceof HTMLInputElement)e.checked=!!d;else if(w.startsWith("on")&&typeof d=="function"){const g=ze(w);typeof v=="function"&&e.removeEventListener(g,v),e.addEventListener(g,d)}else if(d==null)e.removeAttribute(w);else if((r?.isCustomElement??t?.isCustomElement??!1)||w in e)try{e[w]=d}catch{}else d===!1&&e.removeAttribute(w)}for(const[w,v]of Object.entries(s.listeners||{}))e.addEventListener(w,v);const p=t.attrs??{},l=a;for(const w in{...p,...l}){const v=p[w],d=l[w];if(v!==d)if(T=!0,d==null||d===!1){if(e.removeAttribute(w),w==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement)try{e.value=""}catch{}else if(e instanceof HTMLSelectElement)try{e.value=""}catch{}else if(e instanceof HTMLProgressElement)try{e.value=0}catch{}}if(w==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(w==="disabled")try{e.disabled=!1}catch{}}else{if(w==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=d??""}catch{e.setAttribute(w,String(d))}continue}else if(e instanceof HTMLSelectElement){try{e.value=d??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(d)}catch{}continue}}if(w==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!d}catch{}continue}if(w==="style"){e.setAttribute(w,String(d));continue}if(!(e.namespaceURI==="http://www.w3.org/2000/svg")&&w in e)try{e[w]=d}catch{e.setAttribute(w,String(d))}else e.setAttribute(w,String(d))}}if(m&&T)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function N(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const p=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(p.key=e.key),p}if(e.tag==="#anchor"){const p=e,l=Array.isArray(p.children)?p.children:[],w=document.createTextNode(""),v=document.createTextNode("");p.key!=null&&(w.key=`${p.key}:start`,v.key=`${p.key}:end`),p._startNode=w,p._endNode=v;const d=document.createDocumentFragment();d.appendChild(w);for(const g of l){const y=N(g,t);d.appendChild(y)}return d.appendChild(v),d}const i=document.createElement(e.tag);e.key!=null&&(i.key=e.key);const{props:n={},attrs:s={},directives:o={}}=e.props??{},a=He(o,t,i,s),c={...n,...a.props},u={...s,...a.attrs},m=i.namespaceURI==="http://www.w3.org/2000/svg";for(const p in u){const l=u[p];if(!(typeof p!="string"||/\[object Object\]/.test(p))){if(typeof l=="boolean")l&&i.setAttribute(p,"");else if(l!=null)if(!m&&p==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement||i instanceof HTMLProgressElement))try{i instanceof HTMLProgressElement?i.value=Number(l):i.value=l??""}catch{i.setAttribute(p,String(l))}else if(!m&&p==="checked"&&i instanceof HTMLInputElement)try{i.checked=!!l}catch{i.setAttribute(p,String(l))}else if(!m&&p in i)try{i[p]=l}catch{i.setAttribute(p,String(l))}else i.setAttribute(p,String(l))}}for(const p in c){const l=c[p];if(!(typeof p!="string"||/\[object Object\]/.test(p)))if(p==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement))i.value=l??"";else if(p==="checked"&&i instanceof HTMLInputElement)i.checked=!!l;else if(p.startsWith("on")&&typeof l=="function")i.addEventListener(ze(p),l);else{if(p.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)i.removeAttribute(p);else if((e.props?.isCustomElement??!1)||p in i)try{i[p]=l}catch{}}}for(const[p,l]of Object.entries(a.listeners||{}))i.addEventListener(p,l);const T=e.props?.ref??(e.props?.props&&e.props.props.ref);typeof e!="string"&&T&&r&&(r[T]=i);try{if(typeof i._applyProps=="function")try{i._applyProps(i._cfg)}catch{}typeof i.requestRender=="function"?i.requestRender():typeof i._render=="function"&&i._render(i._cfg)}catch{}if(Array.isArray(e.children))for(const p of e.children)i.appendChild(N(p,t,r));else typeof e.children=="string"&&(i.textContent=e.children);try{if(i instanceof HTMLSelectElement&&u&&u.hasOwnProperty("value"))try{i.value=u.value??""}catch{}}catch{}return i}function $t(e,t,r,i,n){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),o=Array.isArray(t)?t:[],a=new Map;for(const l of o)l&&l.key!=null&&a.set(l.key,l);const c=new Map;for(const l of s){const w=l.key;w!=null&&c.set(w,l)}const u=new Set;let m=e.firstChild;function T(l,w){let v=l;for(;v&&(u.add(v),v!==w);)v=v.nextSibling}function p(l,w,v,d){const g=[];let y=l.nextSibling;for(;y&&y!==w;)g.push(y),y=y.nextSibling;const x=Array.isArray(v)?v:[];if(d.some(b=>b&&b.key!=null)||x.some(b=>b&&b.key!=null)){const b=new Map,h=new Map;for(const $ of x)$&&$.key!=null&&b.set($.key,$);for(const $ of g){const E=$.key;E!=null&&h.set(E,$)}const _=new Set;let S=l.nextSibling;for(const $ of d){let E;if($.key!=null&&h.has($.key)){const C=b.get($.key);E=ge(h.get($.key),C,$,i),_.add(E),E!==S&&e.contains(E)&&e.insertBefore(E,S)}else E=N($,i),e.insertBefore(E,S),_.add(E);S=E.nextSibling}for(const $ of g)!_.has($)&&e.contains($)&&e.removeChild($)}else{const b=Math.min(x.length,d.length);for(let h=0;h<b;h++){const _=x[h],S=d[h],$=ge(g[h],_,S,i);$!==g[h]&&(e.insertBefore($,g[h]),e.removeChild(g[h]))}for(let h=b;h<d.length;h++)e.insertBefore(N(d[h],i),w);for(let h=b;h<g.length;h++)e.removeChild(g[h])}}for(const l of r){let w;if(l.tag==="#anchor"){const v=l.key,d=`${v}:start`,g=`${v}:end`;let y=c.get(d),x=c.get(g);const f=Array.isArray(l.children)?l.children:[];if(y||(y=document.createTextNode(""),y.key=d),x||(x=document.createTextNode(""),x.key=g),l._startNode=y,l._endNode=x,!e.contains(y)||!e.contains(x)){e.insertBefore(y,m);for(const b of f)e.insertBefore(N(b,i),m);e.insertBefore(x,m)}else p(y,x,a.get(v)?.children,f);T(y,x),m=x.nextSibling;continue}if(l.key!=null&&c.has(l.key)){const v=a.get(l.key);w=ge(c.get(l.key),v,l,i,n),u.add(w),w!==m&&e.contains(w)&&(m&&!e.contains(m)&&(m=null),e.insertBefore(w,m))}else w=N(l,i,n),m&&!e.contains(m)&&(m=null),e.insertBefore(w,m),u.add(w);m=w.nextSibling}for(const l of s)!u.has(l)&&e.contains(l)&&(ne(l,n),e.removeChild(l))}function ge(e,t,r,i,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&ne(e,n),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const o=document.createTextNode(r);return e.parentNode?.replaceChild(o,e),o}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const o=r,a=Array.isArray(o.children)?o.children:[],c=o._startNode??document.createTextNode(""),u=o._endNode??document.createTextNode("");o.key!=null&&(c.key=`${o.key}:start`,u.key=`${o.key}:end`),o._startNode=c,o._endNode=u;const m=document.createDocumentFragment();m.appendChild(c);for(const T of a){const p=N(T,i);m.appendChild(p)}return m.appendChild(u),e.parentNode?.replaceChild(m,e),c}if(!r){ne(e,n);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){ne(e,n);const o=N(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),c=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,c.key=`${r.key}:end`),r._startNode=a,r._endNode=c;const u=document.createDocumentFragment();u.appendChild(a);for(const m of o)u.appendChild(N(m,i));return u.appendChild(c),e.parentNode?.replaceChild(u,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return Ne(o,t.props||{},r.props||{},i),$t(o,t.children,r.children,i,n),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),o}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&(t.tag&&String(t.tag).includes("-")||r.props&&r.props.isCustomElement||t.props&&t.props.isCustomElement))try{const a=e;return Ne(a,t.props||{},r.props||{},i),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=a),a}catch{}ne(e,n);const s=N(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function Ct(e,t,r,i){let n;Array.isArray(t)?t.length===1?(n=t[0],n&&typeof n=="object"&&n.key==null&&(n={...n,key:"__root__"})):n={tag:"div",key:"__root__",children:t}:(n=t,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=Se(n,String(n.key??"root"));const s=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;s&&o?typeof s!="string"&&typeof n!="string"&&s.tag===n.tag&&s.key===n.key?a=ge(o,s,n,r,i):(a=N(n,r,i),e.replaceChild(a,o)):(a=N(n,r,i),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const c=[];for(let u=0;u<e.childNodes.length;u++){const m=e.childNodes[u];m!==a&&m.nodeName!=="STYLE"&&(ne(m,i),c.push(m))}c.forEach(u=>e.removeChild(u)),e._prevVNode=n,e._prevDom=a}function me(e){if(typeof e=="string")return ee(e);if(e.tag==="#text")return typeof e.children=="string"?ee(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(me).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([n,s])=>` ${n}="${ee(String(s))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([n])=>n!=="attrs"&&n!=="directives"&&n!=="ref"&&n!=="key").map(([n,s])=>` ${n}="${ee(String(s))}"`).join(""));const i=Array.isArray(e.children)?e.children.filter(Boolean).map(me).join(""):typeof e.children=="string"?ee(e.children):e.children?me(e.children):"";return`<${e.tag}${t}${r}>${i}</${e.tag}>`}function $e(e,...t){let r="";for(let i=0;i<e.length;i++)r+=e[i],i<t.length&&(r+=t[i]);return r}function De(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let ye=null;function Ue(){return ye||(ye=new CSSStyleSheet,ye.replaceSync(De(Tt))),ye}function At(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Tt=$e`
2
2
  :host, *, ::before, ::after {
3
3
  all: isolate;
4
4
  box-sizing: border-box;
@@ -56,33 +56,33 @@
56
56
  sup { top: -.5em }
57
57
  [disabled], [aria-disabled=true] { cursor: not-allowed }
58
58
  [hidden] { display: none }
59
- `,lt=Object.fromEntries(Object.entries({neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}}).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,i])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${i})`]))])),be={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;","grid-cols-1":"grid-template-columns:repeat(1,minmax(0,1fr));","grid-cols-2":"grid-template-columns:repeat(2,minmax(0,1fr));","grid-cols-3":"grid-template-columns:repeat(3,minmax(0,1fr));","grid-cols-4":"grid-template-columns:repeat(4,minmax(0,1fr));","grid-cols-5":"grid-template-columns:repeat(5,minmax(0,1fr));","grid-cols-6":"grid-template-columns:repeat(6,minmax(0,1fr));","grid-cols-7":"grid-template-columns:repeat(7,minmax(0,1fr));","grid-cols-8":"grid-template-columns:repeat(8,minmax(0,1fr));","grid-cols-9":"grid-template-columns:repeat(9,minmax(0,1fr));","grid-cols-10":"grid-template-columns:repeat(10,minmax(0,1fr));","grid-cols-11":"grid-template-columns:repeat(11,minmax(0,1fr));","grid-cols-12":"grid-template-columns:repeat(12,minmax(0,1fr));","grid-rows-1":"grid-template-rows:repeat(1,minmax(0,1fr));","grid-rows-2":"grid-template-rows:repeat(2,minmax(0,1fr));","grid-rows-3":"grid-template-rows:repeat(3,minmax(0,1fr));","grid-rows-4":"grid-template-rows:repeat(4,minmax(0,1fr));","grid-rows-5":"grid-template-rows:repeat(5,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-7":"grid-template-rows:repeat(7,minmax(0,1fr));","grid-rows-8":"grid-template-rows:repeat(8,minmax(0,1fr));","grid-rows-9":"grid-template-rows:repeat(9,minmax(0,1fr));","grid-rows-10":"grid-template-rows:repeat(10,minmax(0,1fr));","grid-rows-11":"grid-template-rows:repeat(11,minmax(0,1fr));","grid-rows-12":"grid-template-rows:repeat(12,minmax(0,1fr));","col-span-1":"grid-column:span 1 / span 1;","col-span-2":"grid-column:span 2 / span 2;","col-span-3":"grid-column:span 3 / span 3;","col-span-4":"grid-column:span 4 / span 4;","col-span-5":"grid-column:span 5 / span 5;","col-span-6":"grid-column:span 6 / span 6;","col-span-7":"grid-column:span 7 / span 7;","col-span-8":"grid-column:span 8 / span 8;","col-span-9":"grid-column:span 9 / span 9;","col-span-10":"grid-column:span 10 / span 10;","col-span-11":"grid-column:span 11 / span 11;","col-span-12":"grid-column:span 12 / span 12;","row-span-1":"grid-row:span 1 / span 1;","row-span-2":"grid-row:span 2 / span 2;","row-span-3":"grid-row:span 3 / span 3;","row-span-4":"grid-row:span 4 / span 4;","row-span-6":"grid-row:span 6 / span 6;","row-span-7":"grid-row:span 7 / span 7;","row-span-8":"grid-row:span 8 / span 8;","row-span-9":"grid-row:span 9 / span 9;","row-span-10":"grid-row:span 10 / span 10;","row-span-11":"grid-row:span 11 / span 11;","row-span-12":"grid-row:span 12 / span 12;",absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",border:"border-width:1px;","border-2":"border-width:2px;","border-4":"border-width:4px;","border-6":"border-width:6px;","border-8":"border-width:8px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-xl":"border-radius:0.75rem;","rounded-2xl":"border-radius:1rem;","rounded-3xl":"border-radius:1.5rem;","rounded-4xl":"border-radius:2rem;","rounded-full":"border-radius:9999px;","shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:ui-sans-serif,system-ui,sans-serif;","font-serif":"font-family:ui-serif,Georgia,serif;","font-mono":"font-family:ui-monospace,SFMono-Regular,monospace;","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},ft="0.25rem",Oe={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function W(e,t){let r=0,i=0;for(let n=0;n<e.length;n++){const s=e[n];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")i++;else if(s===")"&&i>0)i--;else if(r===0&&i===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const ut={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${W(e,":hover")}{${t}}`,focus:(e,t)=>`${W(e,":focus")}{${t}}`,active:(e,t)=>`${W(e,":active")}{${t}}`,disabled:(e,t)=>`${W(e,":disabled")}{${t}}`,visited:(e,t)=>`${W(e,":visited")}{${t}}`,checked:(e,t)=>`${W(e,":checked")}{${t}}`,first:(e,t)=>`${W(e,":first-child")}{${t}}`,last:(e,t)=>`${W(e,":last-child")}{${t}}`,odd:(e,t)=>`${W(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${W(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${W(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${W(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},we={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},xe=["sm","md","lg","xl","2xl"];function ke(e){const t=e.startsWith("-"),i=(t?e.slice(1):e).split("-");if(i.length<2)return null;const n=i.slice(0,-1).join("-"),s=i[i.length-1],o=parseFloat(s);if(Number.isNaN(o)||!Oe[n])return null;const a=t?"-":"";return Oe[n].map(f=>`${f}:calc(${a}${ft} * ${o});`).join("")}function Pe(e){const t=e.replace("#",""),r=parseInt(t,16),i=r>>16&255,n=r>>8&255,s=r&255;return`${i} ${n} ${s}`}function dt(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,i,n="DEFAULT"]=t,s=lt[i]?.[n];if(!s)return null;if(r==="shadow")return`--ce-shadow-color:${s};`;const a={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[r];return a?`${a}:${s};`:null}function pt(e){const[t,r]=e.split("/");if(!r)return{base:t};const i=parseInt(r,10);return isNaN(i)||i<0||i>100?{base:t}:{base:t,opacity:i/100}}function ve(e){const{base:t,opacity:r}=pt(e),i=dt(t);if(i){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=Pe(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return i}const n=fe(t);if(n&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const o=Pe(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return n}function $e(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function fe(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const n=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(n){const s=n[1].trim();let o=n[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const i=e.slice(0,t);let n=e.slice(t+2,-1);n=n.replace(/_/g," ");const s={bg:"background-color",text:"color",shadow:"box-shadow",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top","border-b":"border-bottom","border-l":"border-left","border-r":"border-right","border-x":"border-inline","border-y":"border-block",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",weight:"font-weight",leading:"line-height",z:"z-index"};if(i==="rotate")return`transform:rotate(${n});`;const o=s[i]??i.replace(/_/g,"-");if(o&&n)return`${o}:${n};`}return null}function ht(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function gt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function mt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let i;for(;i=t.exec(e);){const n=i[2].split(/\s+/).filter(Boolean);n.length&&r.push(...n)}return r.filter(Boolean)}const Ne=new Map,yt=16;function bt(e){const t=Date.now(),r=Ne.get(e);if(r&&t-r.timestamp<yt)return r.css;const i=mt(e),n=new Set(i),s=[],o=[],a=[],f=[],u={};function d(w,b=!1){const m=(b?"dark|":"")+w;if(m in u)return u[m];const x=k(w,b);return u[m]=x,x}function y(w){const b=w.some(x=>xe.includes(x)),m=w.includes("dark");return w.length===0?1:!b&&!m?2:b&&!m?3:4}function c(w){const b=[];let m="",x=0,l=0;for(let g=0;g<w.length;g++){const p=w[g];p==="["?x++:p==="]"&&x>0?x--:p==="("?l++:p===")"&&l>0&&l--,p===":"&&x===0&&l===0?(b.push(m),m=""):m+=p}return m&&b.push(m),b}function h(w){switch(w){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function k(w,b=!1){const m=c(w);let x=!1;const l=m.find(v=>(v.startsWith("!")&&(x=!0,v=v.slice(1)),be[v]||ke(v)||$e(v)||ve(v)||fe(v)));if(!l)return null;const g=l.replace(/^!/,""),p=be[g]??ke(g)??$e(g)??ve(g)??fe(g);if(!p)return null;const _=m.indexOf(l);let C=_>=0?m.slice(0,_):[];b&&(C=C.filter(v=>v!=="dark"));const E=`.${gt(w)}`,S="__SUBJECT__",A=x?p.replace(/;$/," !important;"):p;let T=S;const ne=[];for(const v of C)v.startsWith("group-")?(T=`.group:${v.slice(6)} ${T}`,ne.push(v)):v.startsWith("peer-")&&(T=T.replace(S,`.peer:${v.slice(5)}~${S}`),ne.push(v));C=C.filter(v=>!ne.includes(v));const ie=[],Ce=[];let D=null;for(const v of C){if(v==="dark"||xe.includes(v))continue;const P=ht(v);if(P){D=P;continue}const O=h(v);if(O){D?Ce.push(O):ie.push(O);continue}const N=ut[v];typeof N=="function"&&(T=N(T,A).split("{")[0])}function K(v,P){if(!P)return v;let O=0,N=0;if(v.length&&(v[0]===">"||v[0]==="+"||v[0]==="~"||v[0]===" ")){let j=1;for(;j<v.length&&v[j]===" ";)j++;for(;j<v.length;j++){const B=v[j];if(B==="["?O++:B==="]"&&O>0?O--:B==="("?N++:B===")"&&N>0&&N--,O===0&&N===0&&(v[j]===">"||v[j]==="+"||v[j]==="~"||v[j]===" "))return v.slice(0,j)+P+v.slice(j)}return v+P}for(let j=0;j<v.length;j++){const B=v[j];if(B==="["?O++:B==="]"&&O>0?O--:B==="("?N++:B===")"&&N>0&&N--,O===0&&N===0&&(B===">"||B==="+"||B==="~"||B===" "))return v.slice(0,j)+P+v.slice(j)}return v+P}const X=ie.join(""),Z=Ce.join("");if(D)if(D.includes("&")){const v=D.indexOf("&"),P=D.slice(0,v),O=D.slice(v+1),N=S+X,j=T;if(ie.length===0)T=j.replace(S,P+N+Z+O);else{const B=K(O,Z);T=j.replace(S,P+N+B)}}else T=T.replace(S,`${D}${S+X}`),Z&&(T=T.replace(S,`${S}${Z}`));else T=S+X+Z;T=T.replace(new RegExp(S,"g"),E);let L=`${T}{${A}}`;const G=C.filter(v=>xe.includes(v)),I=G.length?G[G.length-1]:null,he=C.includes("dark");return b&&I?L=`@media (prefers-color-scheme: dark) and ${we[I]}{${L}}`:b?L=`@media (prefers-color-scheme: dark){${L}}`:he&&I?L=`@media (prefers-color-scheme: dark) and ${we[I]}{${L}}`:he?L=`@media (prefers-color-scheme: dark){${L}}`:I&&(L=`@media ${we[I]}{${L}}`),L}for(const w of n){const b=c(w),m=b.find(p=>be[p]||ke(p)||$e(p)||ve(p)||fe(p));if(!m)continue;const x=b.indexOf(m),l=x>=0?b.slice(0,x):[],g=y(l);if(g===4){const p=d(w,!0);p&&f.push(p)}else{const p=d(w);p&&(g===1?s.push(p):g===2?o.push(p):g===3&&a.push(p))}}const $=[...s,...o,...a,...f].join("");return Ne.set(e,{css:$,timestamp:t}),$}const te=[];function wt(e,t,r,i,n,s,o,a){if(e){te.push(r);try{if(t.loadingTemplate&&r.isLoading){Q(e,t.loadingTemplate(r),r,i,n);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&Q(e,t.errorTemplate(r.error,r),r,i,n);return}const f=t.render(r);if(f instanceof Promise){s(!0),f.then(u=>{s(!1),o(null),Q(e,u,r,i,n),a(e.innerHTML)}).catch(u=>{s(!1),o(u),t.errorTemplate&&Q(e,t.errorTemplate(u,r),r,i,n)}),t.loadingTemplate&&Q(e,t.loadingTemplate(r),r,i,n);return}Q(e,f,r,i,n),a(e.innerHTML)}finally{te.pop()}}}function Q(e,t,r,i,n){e&&(ot(e,Array.isArray(t)?t:[t],r,i),n(e.innerHTML))}function xt(e,t,r,i,n,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(n(r+1),r>10){o(null);return}}else n(0);const f=setTimeout(()=>{i(Date.now()),e(),o(null)},0);o(f)}function kt(e,t,r,i,n,s){if(!e)return;const o=bt(i);if(!t.style&&(!o||o.trim()==="")){s(null),e.adoptedStyleSheets=[Be()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let f=at(`${a}
59
+ `,jt=Object.fromEntries(Object.entries({neutral:{50:"#fafafa",100:"#f4f4f5",200:"#e4e4e7",300:"#d4d4d8",400:"#9f9fa9",500:"#71717b",600:"#52525c",700:"#3f3f46",800:"#27272a",900:"#18181b",950:"#09090b"},primary:{50:"#eff6ff",100:"#dbeafe",200:"#bfdbfe",300:"#93c5fd",400:"#60a5fa",500:"#3b82f6",600:"#2563eb",700:"#1d4ed8",800:"#1e40af",900:"#1e3a8a",950:"#172554"},secondary:{50:"#eef2ff",100:"#e0e7ff",200:"#c7d2fe",300:"#a5b4fc",400:"#818cf8",500:"#6366f1",600:"#4f46e5",700:"#4338ca",800:"#3730a3",900:"#312e81",950:"#1e1b4b"},success:{50:"#f0fdf4",100:"#dcfce7",200:"#bbf7d0",300:"#86efac",400:"#4ade80",500:"#22c55e",600:"#16a34a",700:"#15803d",800:"#166534",900:"#14532d",950:"#052e16"},info:{50:"#f0f9ff",100:"#e0f2fe",200:"#bae6fd",300:"#7dd3fc",400:"#38bdf8",500:"#0ea5e9",600:"#0284c7",700:"#0369a1",800:"#075985",900:"#0c4a6e",950:"#082f49"},warning:{50:"#fffbeb",100:"#fef3c7",200:"#fde68a",300:"#fcd34d",400:"#fbbf24",500:"#f59e0b",600:"#d97706",700:"#b45309",800:"#92400e",900:"#78350f",950:"#451a03"},error:{50:"#fef2f2",100:"#fee2e2",200:"#fecaca",300:"#fca5a5",400:"#f87171",500:"#ef4444",600:"#dc2626",700:"#b91c1c",800:"#991b1b",900:"#7f1d1d",950:"#450a0a"},white:{DEFAULT:"#ffffff"},black:{DEFAULT:"#000000"},transparent:{DEFAULT:"transparent"},current:{DEFAULT:"currentColor"}}).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,i])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${i})`]))])),Ce={block:"display:block;",inline:"display:inline;","inline-block":"display:inline-block;",flex:"display:flex;","inline-flex":"display:inline-flex;",grid:"display:grid;",hidden:"display:none;","w-full":"width:100%;","w-screen":"width:100dvw;","h-full":"height:100%;","h-screen":"height:100dvw;","max-w-full":"max-width:100%;","max-h-full":"max-height:100%;","min-w-0":"min-width:0;","min-h-0":"min-height:0;","m-auto":"margin:auto;","mx-auto":"margin-inline:auto;","my-auto":"margin-block:auto;","overflow-auto":"overflow:auto;","overflow-hidden":"overflow:hidden;","overflow-visible":"overflow:visible;","overflow-scroll":"overflow:scroll;","pointer-events-none":"pointer-events:none;","pointer-events-auto":"pointer-events:auto;","sr-only":"position:absolute;width:1px;height:1px;padding:0;margin:-1px;overflow:hidden;clip:rect(0,0,0,0);white-space:nowrap;border-width:0;","not-sr-only":"position:static;width:auto;height:auto;padding:0;margin:0;overflow:visible;clip:auto;white-space:normal;","grid-cols-1":"grid-template-columns:repeat(1,minmax(0,1fr));","grid-cols-2":"grid-template-columns:repeat(2,minmax(0,1fr));","grid-cols-3":"grid-template-columns:repeat(3,minmax(0,1fr));","grid-cols-4":"grid-template-columns:repeat(4,minmax(0,1fr));","grid-cols-5":"grid-template-columns:repeat(5,minmax(0,1fr));","grid-cols-6":"grid-template-columns:repeat(6,minmax(0,1fr));","grid-cols-7":"grid-template-columns:repeat(7,minmax(0,1fr));","grid-cols-8":"grid-template-columns:repeat(8,minmax(0,1fr));","grid-cols-9":"grid-template-columns:repeat(9,minmax(0,1fr));","grid-cols-10":"grid-template-columns:repeat(10,minmax(0,1fr));","grid-cols-11":"grid-template-columns:repeat(11,minmax(0,1fr));","grid-cols-12":"grid-template-columns:repeat(12,minmax(0,1fr));","grid-rows-1":"grid-template-rows:repeat(1,minmax(0,1fr));","grid-rows-2":"grid-template-rows:repeat(2,minmax(0,1fr));","grid-rows-3":"grid-template-rows:repeat(3,minmax(0,1fr));","grid-rows-4":"grid-template-rows:repeat(4,minmax(0,1fr));","grid-rows-5":"grid-template-rows:repeat(5,minmax(0,1fr));","grid-rows-6":"grid-template-rows:repeat(6,minmax(0,1fr));","grid-rows-7":"grid-template-rows:repeat(7,minmax(0,1fr));","grid-rows-8":"grid-template-rows:repeat(8,minmax(0,1fr));","grid-rows-9":"grid-template-rows:repeat(9,minmax(0,1fr));","grid-rows-10":"grid-template-rows:repeat(10,minmax(0,1fr));","grid-rows-11":"grid-template-rows:repeat(11,minmax(0,1fr));","grid-rows-12":"grid-template-rows:repeat(12,minmax(0,1fr));","col-span-1":"grid-column:span 1 / span 1;","col-span-2":"grid-column:span 2 / span 2;","col-span-3":"grid-column:span 3 / span 3;","col-span-4":"grid-column:span 4 / span 4;","col-span-5":"grid-column:span 5 / span 5;","col-span-6":"grid-column:span 6 / span 6;","col-span-7":"grid-column:span 7 / span 7;","col-span-8":"grid-column:span 8 / span 8;","col-span-9":"grid-column:span 9 / span 9;","col-span-10":"grid-column:span 10 / span 10;","col-span-11":"grid-column:span 11 / span 11;","col-span-12":"grid-column:span 12 / span 12;","row-span-1":"grid-row:span 1 / span 1;","row-span-2":"grid-row:span 2 / span 2;","row-span-3":"grid-row:span 3 / span 3;","row-span-4":"grid-row:span 4 / span 4;","row-span-6":"grid-row:span 6 / span 6;","row-span-7":"grid-row:span 7 / span 7;","row-span-8":"grid-row:span 8 / span 8;","row-span-9":"grid-row:span 9 / span 9;","row-span-10":"grid-row:span 10 / span 10;","row-span-11":"grid-row:span 11 / span 11;","row-span-12":"grid-row:span 12 / span 12;",absolute:"position:absolute;",relative:"position:relative;",fixed:"position:fixed;",sticky:"position:sticky;","font-bold":"font-weight:700;","font-semibold":"font-weight:600;","font-medium":"font-weight:500;","font-light":"font-weight:300;",underline:"text-decoration-line:underline;",overline:"text-decoration-line:overline;","line-through":"text-decoration-line:line-through;","no-underline":"text-decoration-line:none;",italic:"font-style:italic;","not-italic":"font-style:normal;",uppercase:"text-transform:uppercase;",lowercase:"text-transform:lowercase;",capitalize:"text-transform:capitalize;","normal-case":"text-transform:none;","text-left":"text-align:left;","text-center":"text-align:center;","text-right":"text-align:right;","text-xs":"font-size:0.75rem;line-height:calc(1 / 0.75)","text-sm":"font-size:0.875rem;line-height:calc(1.25 / 0.875)","text-base":"font-size:1rem;line-height:calc(1.5 / 1)","text-lg":"font-size:1.125rem;line-height:calc(1.75 / 1.125)","text-xl":"font-size:1.25rem;line-height:calc(1.75 / 1.25)","text-2xl":"font-size:1.5rem;line-height:calc(2 / 1.5)","text-3xl":"font-size:1.875rem;line-height:calc(2.25 / 1.875)","text-4xl":"font-size:2.25rem;line-height:calc(2.5 / 2.25)","text-5xl":"font-size:3rem;line-height:1","text-6xl":"font-size:3.75rem;line-height:1","text-7xl":"font-size:4.5rem;line-height:1","text-8xl":"font-size:6rem;line-height:1",border:"border-width:1px;","border-2":"border-width:2px;","border-4":"border-width:4px;","border-6":"border-width:6px;","border-8":"border-width:8px;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-xl":"border-radius:0.75rem;","rounded-2xl":"border-radius:1rem;","rounded-3xl":"border-radius:1.5rem;","rounded-4xl":"border-radius:2rem;","rounded-full":"border-radius:9999px;","shadow-none":"--ce-shadow-color: rgb(0 0 0 / 0);box-shadow:0 0 var(--ce-shadow-color, #0000);","shadow-xs":"--ce-shadow-color: rgb(0 0 0 / 0.05);box-shadow:0 1px 2px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.05));","shadow-sm":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 1px 3px 0 var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 1px 2px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-md":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 4px 6px -1px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 2px 4px -2px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-lg":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 10px 15px -3px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 4px 6px -4px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-xl":"--ce-shadow-color: rgb(0 0 0 / 0.1);box-shadow:0 20px 25px -5px var(--ce-shadow-color, rgb(0 0 0 / 0.1)),0 8px 10px -6px var(--ce-shadow-color, rgb(0 0 0 / 0.1));","shadow-2xl":"--ce-shadow-color: rgb(0 0 0 / 0.25);box-shadow:0 25px 50px -12px var(--ce-shadow-color, rgb(0 0 0 / 0.25));",truncate:"overflow:hidden;text-overflow:ellipsis;white-space:nowrap;",visible:"visibility:visible;",invisible:"visibility:hidden;","items-center":"align-items:center;","items-start":"align-items:flex-start;","items-end":"align-items:flex-end;","items-baseline":"align-items:baseline;","items-stretch":"align-items:stretch;","justify-center":"justify-content:center;","justify-start":"justify-content:flex-start;","justify-between":"justify-content:space-between;","justify-around":"justify-content:space-around;","justify-evenly":"justify-content:space-evenly;","justify-end":"justify-content:flex-end;","flex-wrap":"flex-wrap:wrap;","flex-nowrap":"flex-wrap:nowrap;","flex-wrap-reverse":"flex-wrap:wrap-reverse;","content-center":"align-content:center;","content-start":"align-content:flex-start;","content-end":"align-content:flex-end;","content-between":"align-content:space-between;","content-around":"align-content:space-around;","content-stretch":"align-content:stretch;","self-auto":"align-self:auto;","self-start":"align-self:flex-start;","self-end":"align-self:flex-end;","self-center":"align-self:center;","self-stretch":"align-self:stretch;","flex-1":"flex:1 1 0%;","flex-auto":"flex:1 1 auto;","flex-initial":"flex:0 1 auto;","flex-none":"flex:0 0 auto;","flex-col":"flex-direction:column;","flex-row":"flex-direction:row;",grow:"flex-grow:1;",shrink:"flex-shrink:1;","grow-0":"flex-grow:0;","shrink-0":"flex-shrink:0;","font-sans":"font-family:ui-sans-serif,system-ui,sans-serif;","font-serif":"font-family:ui-serif,Georgia,serif;","font-mono":"font-family:ui-monospace,SFMono-Regular,monospace;","line-clamp-1":"display:-webkit-box;-webkit-line-clamp:1;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-2":"display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-3":"display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;","line-clamp-4":"display:-webkit-box;-webkit-line-clamp:4;-webkit-box-orient:vertical;overflow:hidden;",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:ease-in-out;","transition-all":"transition-property:all;","transition-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-shadow":"transition-property:box-shadow;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","transition-none":"transition-property:none;","cursor-auto":"cursor:auto;","cursor-default":"cursor:default;","cursor-pointer":"cursor:pointer;","cursor-wait":"cursor:wait;","cursor-text":"cursor:text;","cursor-move":"cursor:move;","cursor-help":"cursor:help;","cursor-not-allowed":"cursor:not-allowed;","z-0":"z-index:0;","z-10":"z-index:10;","z-20":"z-index:20;","z-30":"z-index:30;","z-40":"z-index:40;","z-50":"z-index:50;"},Lt="0.25rem",Fe={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function D(e,t){let r=0,i=0;for(let n=0;n<e.length;n++){const s=e[n];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")i++;else if(s===")"&&i>0)i--;else if(r===0&&i===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const Rt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${D(e,":hover")}{${t}}`,focus:(e,t)=>`${D(e,":focus")}{${t}}`,active:(e,t)=>`${D(e,":active")}{${t}}`,disabled:(e,t)=>`${D(e,":disabled")}{${t}}`,visited:(e,t)=>`${D(e,":visited")}{${t}}`,checked:(e,t)=>`${D(e,":checked")}{${t}}`,first:(e,t)=>`${D(e,":first-child")}{${t}}`,last:(e,t)=>`${D(e,":last-child")}{${t}}`,odd:(e,t)=>`${D(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${D(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${D(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${D(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},Ae={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Te=["sm","md","lg","xl","2xl"];function je(e){const t=e.startsWith("-"),i=(t?e.slice(1):e).split("-");if(i.length<2)return null;const n=i.slice(0,-1).join("-"),s=i[i.length-1],o=parseFloat(s);if(Number.isNaN(o)||!Fe[n])return null;const a=t?"-":"";return Fe[n].map(c=>`${c}:calc(${a}${Lt} * ${o});`).join("")}function Ke(e){const t=e.replace("#",""),r=parseInt(t,16),i=r>>16&255,n=r>>8&255,s=r&255;return`${i} ${n} ${s}`}function Ot(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,i,n="DEFAULT"]=t,s=jt[i]?.[n];if(!s)return null;if(r==="shadow")return`--ce-shadow-color:${s};`;const a={bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",outline:"outline-color",caret:"caret-color",accent:"accent-color",fill:"fill",stroke:"stroke"}[r];return a?`${a}:${s};`:null}function Pt(e){const[t,r]=e.split("/");if(!r)return{base:t};const i=parseInt(r,10);return isNaN(i)||i<0||i>100?{base:t}:{base:t,opacity:i/100}}function Le(e){const{base:t,opacity:r}=Pt(e),i=Ot(t);if(i){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(i);if(s){const o=Ke(s[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return i}const n=be(t);if(n&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const o=Ke(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return n}function Re(e){const t=/^opacity-(\d{1,3})$/.exec(e);if(!t)return null;const r=parseInt(t[1],10);return r<0||r>100?null:`opacity:${r/100};`}function be(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const n=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(n){const s=n[1].trim();let o=n[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${s}:${o};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const i=e.slice(0,t);let n=e.slice(t+2,-1);n=n.replace(/_/g," ");const s={bg:"background-color",text:"color",shadow:"box-shadow",p:"padding",px:"padding-inline",py:"padding-block",m:"margin",mx:"margin-inline",my:"margin-block",w:"width",h:"height","min-w":"min-width","max-w":"max-width","min-h":"min-height","max-h":"max-height","border-t":"border-top","border-b":"border-bottom","border-l":"border-left","border-r":"border-right","border-x":"border-inline","border-y":"border-block",transition:"transition-property",ease:"transition-timing-function",delay:"transition-delay",duration:"transition-duration",list:"list-style",break:"word-break",flex:"flex-direction",items:"align-items",justify:"justify-content",whitespace:"white-space",select:"user-select",content:"align-content",self:"align-self",basis:"flex-basis",tracking:"letter-spacing",scroll:"scroll-behavior",weight:"font-weight",leading:"line-height",z:"z-index"};if(i==="rotate")return`transform:rotate(${n});`;const o=s[i]??i.replace(/_/g,"-");if(o&&n)return`${o}:${n};`}return null}function Mt(e){if(e.startsWith("[")&&e.endsWith("]")){const r=e.slice(1,-1);return r.includes("&")?r:e}const t=e.indexOf("-[");if(t>0&&e.endsWith("]")){const r=e.slice(t+2,-1).replace(/_/g,"-");return r.includes("&")?r:e.replace(/_/g,"-")}return null}function Bt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Wt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let i;for(;i=t.exec(e);){const n=i[2].split(/\s+/).filter(Boolean);n.length&&r.push(...n)}return r.filter(Boolean)}const Je=new Map,It=16;function qt(e){const t=Date.now(),r=Je.get(e);if(r&&t-r.timestamp<It)return r.css;const i=Wt(e),n=new Set(i),s=[],o=[],a=[],c=[],u={};function m(d,g=!1){const y=(g?"dark|":"")+d;if(y in u)return u[y];const x=w(d,g);return u[y]=x,x}function T(d){const g=d.some(x=>Te.includes(x)),y=d.includes("dark");return d.length===0?1:!g&&!y?2:g&&!y?3:4}function p(d){const g=[];let y="",x=0,f=0;for(let b=0;b<d.length;b++){const h=d[b];h==="["?x++:h==="]"&&x>0?x--:h==="("?f++:h===")"&&f>0&&f--,h===":"&&x===0&&f===0?(g.push(y),y=""):y+=h}return y&&g.push(y),g}function l(d){switch(d){case"hover":return":hover";case"focus":return":focus";case"active":return":active";case"visited":return":visited";case"disabled":return":disabled";case"checked":return":checked";case"first":return":first-child";case"last":return":last-child";case"odd":return":nth-child(odd)";case"even":return":nth-child(even)";case"focus-within":return":focus-within";case"focus-visible":return":focus-visible";default:return null}}function w(d,g=!1){const y=p(d);let x=!1;const f=y.find(k=>(k.startsWith("!")&&(x=!0,k=k.slice(1)),Ce[k]||je(k)||Re(k)||Le(k)||be(k)));if(!f)return null;const b=f.replace(/^!/,""),h=Ce[b]??je(b)??Re(b)??Le(b)??be(b);if(!h)return null;const _=y.indexOf(f);let S=_>=0?y.slice(0,_):[];g&&(S=S.filter(k=>k!=="dark"));const $=`.${Bt(d)}`,E="__SUBJECT__",C=x?h.replace(/;$/," !important;"):h;let A=E;const M=[];for(const k of S)k.startsWith("group-")?(A=`.group:${k.slice(6)} ${A}`,M.push(k)):k.startsWith("peer-")&&(A=A.replace(E,`.peer:${k.slice(5)}~${E}`),M.push(k));S=S.filter(k=>!M.includes(k));const ie=[],fe=[];let B=null;for(const k of S){if(k==="dark"||Te.includes(k))continue;const I=Mt(k);if(I){B=I;continue}const P=l(k);if(P){B?fe.push(P):ie.push(P);continue}const W=Rt[k];typeof W=="function"&&(A=W(A,C).split("{")[0])}function V(k,I){if(!I)return k;let P=0,W=0;if(k.length&&(k[0]===">"||k[0]==="+"||k[0]==="~"||k[0]===" ")){let L=1;for(;L<k.length&&k[L]===" ";)L++;for(;L<k.length;L++){const R=k[L];if(R==="["?P++:R==="]"&&P>0?P--:R==="("?W++:R===")"&&W>0&&W--,P===0&&W===0&&(k[L]===">"||k[L]==="+"||k[L]==="~"||k[L]===" "))return k.slice(0,L)+I+k.slice(L)}return k+I}for(let L=0;L<k.length;L++){const R=k[L];if(R==="["?P++:R==="]"&&P>0?P--:R==="("?W++:R===")"&&W>0&&W--,P===0&&W===0&&(R===">"||R==="+"||R==="~"||R===" "))return k.slice(0,L)+I+k.slice(L)}return k+I}const U=ie.join(""),F=fe.join("");if(B)if(B.includes("&")){const k=B.indexOf("&"),I=B.slice(0,k),P=B.slice(k+1),W=E+U,L=A;if(ie.length===0)A=L.replace(E,I+W+F+P);else{const R=V(P,F);A=L.replace(E,I+W+R)}}else A=A.replace(E,`${B}${E+U}`),F&&(A=A.replace(E,`${E}${F}`));else A=E+U+F;A=A.replace(new RegExp(E,"g"),$);let z=`${A}{${C}}`;const H=S.filter(k=>Te.includes(k)),Z=H.length?H[H.length-1]:null,ue=S.includes("dark");return g&&Z?z=`@media (prefers-color-scheme: dark) and ${Ae[Z]}{${z}}`:g?z=`@media (prefers-color-scheme: dark){${z}}`:ue&&Z?z=`@media (prefers-color-scheme: dark) and ${Ae[Z]}{${z}}`:ue?z=`@media (prefers-color-scheme: dark){${z}}`:Z&&(z=`@media ${Ae[Z]}{${z}}`),z}for(const d of n){const g=p(d),y=g.find(h=>Ce[h]||je(h)||Re(h)||Le(h)||be(h));if(!y)continue;const x=g.indexOf(y),f=x>=0?g.slice(0,x):[],b=T(f);if(b===4){const h=m(d,!0);h&&c.push(h)}else{const h=m(d);h&&(b===1?s.push(h):b===2?o.push(h):b===3&&a.push(h))}}const v=[...s,...o,...a,...c].join("");return Je.set(e,{css:v,timestamp:t}),v}const ae=[];function zt(e,t,r,i,n,s,o,a){if(e){ae.push(r);try{if(t.loadingTemplate&&r.isLoading){oe(e,t.loadingTemplate(r),r,i,n);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&oe(e,t.errorTemplate(r.error,r),r,i,n);return}const c=t.render(r);if(c instanceof Promise){s(!0),c.then(u=>{s(!1),o(null),oe(e,u,r,i,n),a(e.innerHTML)}).catch(u=>{s(!1),o(u),t.errorTemplate&&oe(e,t.errorTemplate(u,r),r,i,n)}),t.loadingTemplate&&oe(e,t.loadingTemplate(r),r,i,n);return}oe(e,c,r,i,n),a(e.innerHTML)}finally{ae.pop()}}}function oe(e,t,r,i,n){e&&(Ct(e,Array.isArray(t)?t:[t],r,i),n(e.innerHTML))}function Ht(e,t,r,i,n,s,o){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(n(r+1),r>10){o(null);return}}else n(0);const c=setTimeout(()=>{i(Date.now()),e(),o(null)},0);o(c)}function Nt(e,t,r,i,n,s){if(!e)return;const o=qt(i);if(!t.style&&(!o||o.trim()==="")){s(null),e.adoptedStyleSheets=[Ue()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let c=At(`${a}
60
60
  ${o}
61
- `);f=Le(f);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==f)&&u.replaceSync(f),e.adoptedStyleSheets=[Be(),u],s(u)}const ue=new Map,ze=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[ze]||(e[ze]=ue)}function _e(e,t,r){let i=V(e);i.includes("-")||(i=`cer-${i}`);let n;typeof t=="function"?n={...r,render:t}:n=t,typeof n.onError!="function"&&(n.onError=(s,o)=>{console.error(`[${i}] Error:`,s,o)});try{const s=new Set(["refs","requestRender","error","hasError","isLoading","emit"]),o=[];if(n.state&&typeof n.state=="object"&&Object.keys(n.state).forEach(a=>{s.has(a)&&o.push(a)}),n.props&&typeof n.props=="object"&&Object.keys(n.props).forEach(a=>{s.has(a)&&o.push(a)}),n.computed&&typeof n.computed=="object"&&Object.keys(n.computed).forEach(a=>{s.has(a)&&o.push(a)}),o.length>0){const a=Array.from(new Set(o));console.warn(`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`)}}catch{}if(ue.set(i,n),typeof window<"u")if(!customElements.get(i))customElements.define(i,vt(i,n));else try{document.querySelectorAll(i).forEach(s=>{try{typeof s._cfg<"u"&&(s._cfg=n),typeof s._render=="function"&&s._render(n)}catch{}})}catch{}}function vt(e,t){if(!t.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=ue.get(e)||t;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(n,s,o)=>{const a=new CustomEvent(n,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const i=ue.get(e)||t;Object.keys(i).forEach(n=>{const s=i[n];typeof s=="function"&&(this.context[n]=(...o)=>s(...o,this.context))}),this._applyComputed(i),this._initializing=!1,this._initWatchers(i),this._render(i)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),Ge(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Ye(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,i,n){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),Qe(t,r,i,n,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(V):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([i,n])=>{Object.defineProperty(this.context,i,{get:()=>{const s=n(this.context);return H(s)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{wt(this.shadowRoot,r,this.context,this._refs,i=>{this._lastHtmlStringForJitCSS=i,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(i)},i=>{this._templateLoading=i,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(i)},i=>{this._templateError=i,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(i)},i=>this._applyStyle(r,i))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{xt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})})}_applyStyle(r,i){this._runLogicWithinErrorBoundary(r,()=>{kt(this.shadowRoot,r,this.context,i,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(r,i){this._hasError&&(this._hasError=!1);try{i()}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(n,this.context))}}_initContext(r){try{let i=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(a,f,u){const d=Reflect.get(a,f,u);return typeof d=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...c){const h=d.apply(a,c);if(!n._initializing){const k=o||"root";n._triggerWatchers(k,a),n._render(r)}return h}:d},set(a,f,u){if(a[f]=u,!n._initializing){const d=o?`${o}.${String(f)}`:String(f);n._triggerWatchers(d,u),n._render(r)}return!0},deleteProperty(a,f){if(delete a[f],!n._initializing){const u=o?`${o}.${String(f)}`:String(f);n._triggerWatchers(u,void 0),n._render(r)}return!0}}):s&&typeof s=="object"?(Object.keys(s).forEach(a=>{const f=o?`${o}.${a}`:a;s[a]=i(s[a],f)}),new Proxy(s,{set(a,f,u){const d=o?`${o}.${String(f)}`:String(f);return a[f]=i(u,d),n._initializing||(n._triggerWatchers(d,a[f]),n._render(r)),!0},get(a,f,u){return Reflect.get(a,f,u)}})):s};const n=this;return i({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Ve(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,i){Je(this.context,this._watchers,r,i)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Ze(this,r,this.context)}catch(i){this._hasError=!0,r.onError&&r.onError(i,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(i,this.context))}})}}}function re(e,t={},r,i){const n=i??t.key;return{tag:e,key:n,props:t,children:r}}function de(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function pe(e){return typeof e=="object"&&e!==null&&"tag"in e&&!de(e)}function $t(e,t){return e.key!=null?e:{...e,key:t}}function _t(e,t=[],r={}){const i={},n={},s={},o=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=o.exec(e);){const f=a[1],u=a[2],d=(a[4]||a[6])??"",y=d.match(/^{{(\d+)}}$/);let c=y?t[Number(y[1])]??null:d;y||(c==="true"?c=!0:c==="false"?c=!1:c==="null"?c=null:isNaN(Number(c))||(c=Number(c)));const h=["model","bind","show","class","style"];if(f===":"){const[k,$]=u.split(":"),[w,...b]=k.split(".");if(h.includes(w)){const m=[...b],x=w==="model"&&$?`model:${$}`:w;s[x]={value:c,modifiers:m,arg:$}}else n[u]=c}else if(f==="@"){const k="on"+u.charAt(0).toUpperCase()+u.slice(1);i[k]=typeof c=="function"?c:typeof r[c]=="function"?r[c]:void 0}else u==="ref"?i.ref=c:n[u]=c}return{props:i,attrs:n,directives:s}}function St(e,t,r){const i=te.length>0?te[te.length-1]:void 0,n=r??i;function s(l,g){return re("#text",{},l,g)}let o="";for(let l=0;l<e.length;l++)o+=e[l],l<t.length&&(o+=`{{${l}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,f=[];let u,d=[],y=null,c={},h,k=0,$=[];function w(l){!l||typeof l!="object"||de(l)||(l.props||l.attrs?(l.props&&(c.props||(c.props={}),Object.assign(c.props,l.props)),l.attrs&&(c.attrs||(c.attrs={}),Object.keys(l.attrs).forEach(g=>{if(g==="style"&&c.attrs.style){const p=c.attrs.style.replace(/;?\s*$/,""),_=l.attrs.style.replace(/^;?\s*/,"");c.attrs.style=p+"; "+_}else if(g==="class"&&c.attrs.class){const p=c.attrs.class.trim().split(/\s+/).filter(Boolean),_=l.attrs.class.trim().split(/\s+/).filter(Boolean),C=[...new Set([...p,..._])];c.attrs.class=C.join(" ")}else c.attrs[g]=l.attrs[g]}))):(c.props||(c.props={}),Object.assign(c.props,l)))}function b(l,g){const p=y?d:$;if(de(l)){const _=l.key??g;let C=l.children;p.push({...l,key:_,children:C});return}if(pe(l)){p.push($t(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let _=0;_<l.length;_++){const C=l[_];de(C)||pe(C)||Array.isArray(C)?b(C,`${g}-${_}`):C!==null&&typeof C=="object"?w(C):p.push(s(String(C),`${g}-${_}`))}return}if(l!==null&&typeof l=="object"){w(l);return}p.push(s(String(l),g))}const m=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;u=a.exec(o);)if(u[1]){const l=u[1],g=u[0][1]==="/",p=u[0][u[0].length-2]==="/"||m.has(l),{props:_,attrs:C,directives:E}=_t(u[2]||"",t,n),S={props:{},attrs:{}};for(const A in _)S.props[A]=_[A];for(const A in C)S.attrs[A]=C[A];if(E&&Object.keys(E).some(A=>A==="model"||A.startsWith("model:")))try{const A=Symbol.for("cer.registry"),T=globalThis[A],ne=!!(T&&typeof T.has=="function"&&T.has(l)),ie=!!(n&&(n.__customElements instanceof Set&&n.__customElements.has(l)||Array.isArray(n.__isCustomElements)&&n.__isCustomElements.includes(l)));if(!!(l.includes("-")||ie||ne))for(const K of Object.keys(E)){if(K!=="model"&&!K.startsWith("model:"))continue;const X=E[K],Z=X.arg??(K.includes(":")?K.split(":",2)[1]:void 0),L=X.value,G=Z??"modelValue",I=z,he=oe,v=n?n._state||n:void 0;let P;typeof L=="string"&&n?P=I(v,L):P=L,S.props[G]=P;try{const j=V(G);S.attrs||(S.attrs={}),P!==void 0&&(S.attrs[j]=P)}catch{}S.isCustomElement=!0;const O=`update:${V(G)}`,N="on"+O.charAt(0).toUpperCase()+O.slice(1);S.props[N]=function(j){const B=j.detail!==void 0?j.detail:j.target?j.target.value:void 0;if(!v)return;const Ae=I(v,typeof L=="string"?L:String(L));(Array.isArray(B)&&Array.isArray(Ae)?JSON.stringify([...B].sort())!==JSON.stringify([...Ae].sort()):B!==Ae)&&(he(v,typeof L=="string"?L:String(L),B),n?.requestRender?n.requestRender():n?._requestRender&&n._requestRender())},delete E[K]}}catch{}if(Object.keys(E).length>0&&(S.directives={...E}),g){const A=re(y,c,d.length===1&&pe(d[0])&&d[0].tag==="#text"?typeof d[0].children=="string"?d[0].children:"":d.length?d:void 0,h),T=f.pop();T?(y=T.tag,c=T.props,h=T.key,d=T.children,d.push(A)):($.push(A),y=null,c={},h=void 0,d=[])}else p?y?d.push(re(l,S,void 0,void 0)):$.push(re(l,S,void 0,void 0)):(y&&f.push({tag:y,props:c,children:d,key:h}),y=l,c=S,d=[])}else if(typeof u[3]<"u"){const l=Number(u[3]),g=t[l],p=`interp-${l}`;b(g,p)}else if(u[4]){const l=u[4],g=y?d:$,p=l.split(/({{\d+}})/);for(const _ of p){if(!_)continue;const C=_.match(/^{{(\d+)}}$/);if(C){const E=Number(C[1]),S=t[E],A=`interp-${E}`;b(S,A)}else{const E=`text-${k++}`;g.push(s(_,E))}}}const x=$.filter(l=>pe(l)&&l.tag==="#text"?typeof l.children=="string"&&l.children.trim()!=="":!0);return x.length===1?x[0]:x.length>1?x:re("div",{},"","fallback-root")}function F(e,...t){const r=t[t.length-1],i=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return St(e,t,i)}const Se=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},q=(e,t)=>{for(const r of e){const i=[],n=r.path.replace(/:[^/]+/g,a=>(i.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${n}$`),o=t.match(s);if(o){const a={};return i.forEach((f,u)=>{a[f]=o[u+1]}),{route:r,params:a}}}return{route:null,params:{}}},Ee={};async function Me(e){if(e.component)return e.component;if(e.load){if(Ee[e.path])return Ee[e.path];try{const t=await e.load();return Ee[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function We(e){const{routes:t,base:r="",initialUrl:i}=e;let n,s,o,a,f,u,d;const y=async($,w)=>{const b=t.find(m=>q([m],$.path).route!==null);if(b?.beforeEnter)try{const m=await b.beforeEnter($,w);return typeof m=="string"?(await k(m,!0),!1):m!==!1}catch(m){return console.error("beforeEnter error",m),!1}return!0},c=async($,w)=>{const b=t.find(m=>q([m],$.path).route!==null);if(b?.onEnter)try{const m=await b.onEnter($,w);return typeof m=="string"?(await k(m,!0),!1):m!==!1}catch(m){return console.error("onEnter error",m),!1}return!0},h=($,w)=>{const b=t.find(m=>q([m],$.path).route!==null);if(b?.afterEnter)try{b.afterEnter($,w)}catch(m){console.error("afterEnter error",m)}},k=async($,w=!1)=>{try{const b={path:$.replace(r,"")||"/",query:{}},m=q(t,b.path);if(!m)throw new Error(`No route found for ${b.path}`);const x=o.getState(),l={path:b.path,params:m.params,query:b.query};if(!await y(l,x)||!await c(l,x))return;typeof window<"u"&&typeof document<"u"&&(w?window.history.replaceState({},"",r+$):window.history.pushState({},"",r+$)),o.setState(l),h(l,x)}catch(b){console.error("Navigation error:",b)}};if(typeof window<"u"&&typeof document<"u"){n=()=>{const w=new URL(window.location.href),b=w.pathname.replace(r,"")||"/",m=Se(w.search);return{path:b,query:m}},s=n();const $=q(t,s.path);o=ge({path:s.path,params:$.params,query:s.query}),a=async(w=!1)=>{const b=n();await k(b.path,w)},window.addEventListener("popstate",()=>a(!0)),f=w=>k(w,!1),u=w=>k(w,!0),d=()=>window.history.back()}else{n=()=>{const b=new URL(i||"/","http://localhost"),m=b.pathname.replace(r,"")||"/",x=Se(b.search);return{path:m,query:x}},s=n();const $=q(t,s.path);o=ge({path:s.path,params:$.params,query:s.query}),a=async()=>{const b=n();await w(b.path)};const w=async b=>{try{const m={path:b.replace(r,"")||"/",query:{}},x=q(t,m.path);if(!x)throw new Error(`No route found for ${m.path}`);const l=o.getState(),g={path:m.path,params:x.params,query:m.query},p=t.find(_=>q([_],g.path).route!==null);if(p?.beforeEnter)try{const _=await p.beforeEnter(g,l);if(typeof _=="string"){await w(_);return}if(_===!1)return}catch{return}if(p?.onEnter)try{const _=await p.onEnter(g,l);if(typeof _=="string"){await w(_);return}if(_===!1)return}catch{return}if(o.setState(g),p?.afterEnter)try{p.afterEnter(g,l)}catch{}}catch{}};f=async b=>w(b),u=async b=>w(b),d=()=>{}}return{store:o,push:f,replace:u,back:d,subscribe:o.subscribe,matchRoute:$=>q(t,$),getCurrent:()=>o.getState(),resolveRouteComponent:Me}}function Et(e,t){return q(e,t)}function Ct(e){const t=We(e);return _e("router-view",{async render(){if(!t)return F`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:i}=r,n=t.matchRoute(i);if(!n.route)return F`<div>Not found</div>`;try{const s=await t.resolveRouteComponent(n.route);if(typeof s=="string")return{tag:s,props:{},children:[]};if(typeof s=="function"){const o=s(),a=o instanceof Promise?await o:o;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return F`<div>Invalid route component</div>`}catch{return F`<div>Invalid route component</div>`}},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),_e("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},class:{type:String,default:""},style:{type:String,default:ye`
61
+ `);c=De(c);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==c)&&u.replaceSync(c),e.adoptedStyleSheets=[Ue(),u],s(u)}class Dt{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,r){const i=r||t.toString();this.pendingUpdates.set(i,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const r of t)try{r()}catch(i){typeof console<"u"&&console.error&&console.error("Error in batched update:",i)}}get pendingCount(){return this.pendingUpdates.size}}const Ut=new Dt;function ce(e,t){Ut.schedule(e,t)}const we=new Map,Ve=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[Ve]||(e[Ve]=we)}function Oe(e,t,r){let i=X(e);i.includes("-")||(i=`cer-${i}`);let n;typeof t=="function"?n={...r,render:t}:n=t,typeof n.onError!="function"&&(n.onError=(s,o)=>{Q(`[${i}] Error:`,s,o)});try{const s=new Set(["refs","requestRender","error","hasError","isLoading","emit"]),o=[];if(n.state&&typeof n.state=="object"&&Object.keys(n.state).forEach(a=>{s.has(a)&&o.push(a)}),n.props&&typeof n.props=="object"&&Object.keys(n.props).forEach(a=>{s.has(a)&&o.push(a)}),n.computed&&typeof n.computed=="object"&&Object.keys(n.computed).forEach(a=>{s.has(a)&&o.push(a)}),o.length>0){const a=Array.from(new Set(o));de(`[${i}] Reserved runtime context keys used in component config: ${a.join(", ")}. These names are provided by the runtime (for example: refs, error, emit). Rename your state/prop/computed keys (e.g. 'error' -> 'errorMessage') to avoid collisions and TypeScript type conflicts.`)}}catch{}if(we.set(i,n),typeof window<"u")if(!customElements.get(i))customElements.define(i,Ft(i,n));else try{document.querySelectorAll(i).forEach(s=>{try{typeof s._cfg<"u"&&(s._cfg=n),typeof s._render=="function"&&s._render(n)}catch{}})}catch{}}function Ft(e,t){if(!t.render)throw new Error("Component must have a render function");return typeof window>"u"?class{constructor(){}}:class extends HTMLElement{context;_refs={};_listeners=[];_watchers=new Map;_renderTimeoutId=null;_mounted=!1;_hasError=!1;_initializing=!0;_componentId;_styleSheet=null;_lastHtmlStringForJitCSS="";get lastHtmlStringForJitCSS(){return this._lastHtmlStringForJitCSS}get isLoading(){return this._templateLoading}get lastError(){return this._templateError}_cfg;_lastRenderTime=0;_renderCount=0;_templateLoading=!1;_templateError=null;constructor(){super(),this.attachShadow({mode:"open"}),this._cfg=we.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_triggerWatchers",{value:(n,s)=>this._triggerWatchers(n,s),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(n,s,o)=>{const a=new CustomEvent(n,{detail:s,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const i=we.get(e)||t;Object.keys(i).forEach(n=>{const s=i[n];typeof s=="function"&&(this.context[n]=(...o)=>s(...o,this.context))}),this._applyComputed(i),i.props&&Object.keys(i.props).forEach(n=>{let s=this[n];Object.defineProperty(this,n,{get(){return s},set(o){const a=s;s=o,this.context[n]=o,this._initializing||(this._applyProps(i),a!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(i),this._render(i)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),bt(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{wt(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,i,n){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),xt(t,r,i,n,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(X):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([i,n])=>{Object.defineProperty(this.context,i,{get:()=>{const s=n(this.context);return ee(s)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{zt(this.shadowRoot,r,this.context,this._refs,i=>{this._lastHtmlStringForJitCSS=i,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(i)},i=>{this._templateLoading=i,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(i)},i=>{this._templateError=i,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(i)},i=>this._applyStyle(r,i))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{ce(()=>{Ht(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})},this._componentId)})}_applyStyle(r,i){this._runLogicWithinErrorBoundary(r,()=>{Nt(this.shadowRoot,r,this.context,i,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(r,i){this._hasError&&(this._hasError=!1);try{i()}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(n,this.context))}}_initContext(r){try{let i=function(s,o=""){return Array.isArray(s)?new Proxy(s,{get(a,c,u){const m=Reflect.get(a,c,u);return typeof m=="function"&&typeof c=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(c)?function(...p){const l=m.apply(a,p);if(!n._initializing){const w=o||"root";n._triggerWatchers(w,a),ce(()=>n._render(r),n._componentId)}return l}:m},set(a,c,u){if(a[c]=u,!n._initializing){const m=o?`${o}.${String(c)}`:String(c);n._triggerWatchers(m,u),ce(()=>n._render(r),n._componentId)}return!0},deleteProperty(a,c){if(delete a[c],!n._initializing){const u=o?`${o}.${String(c)}`:String(c);n._triggerWatchers(u,void 0),ce(()=>n._render(r),n._componentId)}return!0}}):s&&typeof s=="object"?(Object.keys(s).forEach(a=>{const c=o?`${o}.${a}`:a;s[a]=i(s[a],c)}),new Proxy(s,{set(a,c,u){const m=o?`${o}.${String(c)}`:String(c);return a[c]=i(u,m),n._initializing||(n._triggerWatchers(m,a[c]),ce(()=>n._render(r),n._componentId)),!0},get(a,c,u){return Reflect.get(a,c,u)}})):s};const n=this;return i({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{gt(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,i){mt(this.context,this._watchers,r,i)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{yt(this,r,this.context)}catch(i){this._hasError=!0,r.onError&&r.onError(i,this.context),r.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=r.errorFallback(i,this.context))}})}}}function le(e,t={},r,i){const n=i??t.key;return{tag:e,key:n,props:t,children:r}}function xe(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ve(e){return typeof e=="object"&&e!==null&&"tag"in e&&!xe(e)}function Kt(e,t){return e.key!=null?e:{...e,key:t}}function Jt(e,t=[],r={}){const i={},n={},s={},o=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let c;for(;c=a.exec(e);){const u=c[1],m=c[2],T=(c[4]||c[6])??"",p=T.match(/^{{(\d+)}}$/);let l=p?t[Number(p[1])]??null:T;p||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const w=["model","bind","show","class","style"];if(u===":"){const[v,d]=m.split(":"),[g,...y]=v.split(".");if(w.includes(g)){const x=[...y],f=g==="model"&&d?`model:${d}`:g;s[f]={value:l,modifiers:x,arg:d}}else n[m]=l,o.push(m)}else if(u==="@"){const[v,...d]=m.split("."),g=d,y=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0;if(y){const x=b=>{if(g.includes("prevent")&&b.preventDefault(),g.includes("stop")&&b.stopPropagation(),!(g.includes("self")&&b.target!==b.currentTarget))return g.includes("once")&&b.currentTarget?.removeEventListener(v,x),y(b)},f="on"+v.charAt(0).toUpperCase()+v.slice(1);i[f]=x}}else m==="ref"?i.ref=l:n[m]=l}return{props:i,attrs:n,directives:s,bound:o}}function Vt(e,t,r){const i=ae.length>0?ae[ae.length-1]:void 0,n=r??i;function s(f,b){return le("#text",{},f,b)}let o="";for(let f=0;f<e.length;f++)o+=e[f],f<t.length&&(o+=`{{${f}}}`);const a=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,c=[];let u,m=[],T=null,p={},l,w=0,v=[];function d(f){!f||typeof f!="object"||xe(f)||(f.props||f.attrs?(f.props&&(p.props||(p.props={}),Object.assign(p.props,f.props)),f.attrs&&(p.attrs||(p.attrs={}),Object.keys(f.attrs).forEach(b=>{if(b==="style"&&p.attrs.style){const h=p.attrs.style.replace(/;?\s*$/,""),_=f.attrs.style.replace(/^;?\s*/,"");p.attrs.style=h+"; "+_}else if(b==="class"&&p.attrs.class){const h=p.attrs.class.trim().split(/\s+/).filter(Boolean),_=f.attrs.class.trim().split(/\s+/).filter(Boolean),S=[...new Set([...h,..._])];p.attrs.class=S.join(" ")}else p.attrs[b]=f.attrs[b]}))):(p.props||(p.props={}),Object.assign(p.props,f)))}function g(f,b){const h=T?m:v;if(xe(f)){const _=f.key??b;let S=f.children;h.push({...f,key:_,children:S});return}if(ve(f)){h.push(Kt(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let _=0;_<f.length;_++){const S=f[_];xe(S)||ve(S)||Array.isArray(S)?g(S,`${b}-${_}`):S!==null&&typeof S=="object"?d(S):h.push(s(String(S),`${b}-${_}`))}return}if(f!==null&&typeof f=="object"){d(f);return}h.push(s(String(f),b))}const y=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;u=a.exec(o);)if(!(u[0].startsWith("<!--")&&u[0].endsWith("-->"))){if(u[1]){const f=u[1],b=u[0][1]==="/",h=u[0][u[0].length-2]==="/"||y.has(f),{props:_,attrs:S,directives:$,bound:E}=Jt(u[2]||"",t,n),C={props:{},attrs:{}};for(const A in _)C.props[A]=_[A];for(const A in S)C.attrs[A]=S[A];if(C.attrs&&Object.prototype.hasOwnProperty.call(C.attrs,"key")&&!(C.props&&Object.prototype.hasOwnProperty.call(C.props,"key")))try{C.props.key=C.attrs.key}catch{}try{const A={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},M=f.toLowerCase(),ie=A[M]??[];if(C.attrs)for(const B of ie)E&&E.includes(B)&&B in C.attrs&&!(C.props&&B in C.props)&&(C.props[B]=C.attrs[B],delete C.attrs[B]);if((f.includes("-")||!!n?.__customElements?.has?.(f))&&E&&C.attrs){const B=new Set(["id","name","data-key","key"]);for(const V of E)if(V in C.attrs&&!(C.props&&V in C.props)){const U=V.includes("-")?V.split("-").map((F,z)=>z===0?F:F.charAt(0).toUpperCase()+F.slice(1)).join(""):V;C.props[U]=C.attrs[V],B.has(V)||delete C.attrs[V]}C.isCustomElement=!0}}catch{}if($&&Object.keys($).some(A=>A==="model"||A.startsWith("model:")))try{const A=Symbol.for("cer.registry"),M=globalThis[A],ie=!!(M&&typeof M.has=="function"&&M.has(f)),fe=!!(n&&(n.__customElements instanceof Set&&n.__customElements.has(f)||Array.isArray(n.__isCustomElements)&&n.__isCustomElements.includes(f)));if(!!(f.includes("-")||fe||ie))for(const U of Object.keys($)){if(U!=="model"&&!U.startsWith("model:"))continue;const F=$[U],z=F.arg??(U.includes(":")?U.split(":",2)[1]:void 0),H=F.value,Z=z??"modelValue",ue=K,k=pe,I=n?n._state||n:void 0;let P;typeof H=="string"&&n?P=ue(I,H):P=H,C.props[Z]=P;try{const R=X(Z);C.attrs||(C.attrs={}),P!==void 0&&(C.attrs[R]=P)}catch{}C.isCustomElement=!0;const W=`update:${X(Z)}`,L="on"+W.charAt(0).toUpperCase()+W.slice(1);C.props[L]=function(R){const ke=R.detail!==void 0?R.detail:R.target?R.target.value:void 0;if(!I)return;const Be=ue(I,typeof H=="string"?H:String(H));(Array.isArray(ke)&&Array.isArray(Be)?JSON.stringify([...ke].sort())!==JSON.stringify([...Be].sort()):ke!==Be)&&(k(I,typeof H=="string"?H:String(H),ke),n?.requestRender?n.requestRender():n?._requestRender&&n._requestRender())},delete $[U]}}catch{}if(Object.keys($).length>0&&(C.directives={...$}),b){const A=le(T,p,m.length===1&&ve(m[0])&&m[0].tag==="#text"?typeof m[0].children=="string"?m[0].children:"":m.length?m:void 0,l),M=c.pop();M?(T=M.tag,p=M.props,l=M.key,m=M.children,m.push(A)):(v.push(A),T=null,p={},l=void 0,m=[])}else h?T?m.push(le(f,C,void 0,void 0)):v.push(le(f,C,void 0,void 0)):(T&&c.push({tag:T,props:p,children:m,key:l}),T=f,p=C,m=[])}else if(typeof u[3]<"u"){const f=Number(u[3]),b=t[f],h=`interp-${f}`;g(b,h)}else if(u[4]){const f=u[4],b=T?m:v,h=f.split(/({{\d+}})/);for(const _ of h){if(!_)continue;const S=_.match(/^{{(\d+)}}$/);if(S){const $=Number(S[1]),E=t[$],C=`interp-${$}`;g(E,C)}else{const $=`text-${w++}`;b.push(s(_,$))}}}}const x=v.filter(f=>ve(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0);return x.length===1?x[0]:x.length>1?x:le("div",{},"","fallback-root")}function te(e,...t){const r=t[t.length-1],i=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return Vt(e,t,i)}const Pe=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},J=(e,t)=>{for(const r of e){const i=[],n=r.path.replace(/:[^/]+/g,a=>(i.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${n}$`),o=t.match(s);if(o){const a={};return i.forEach((c,u)=>{a[c]=o[u+1]}),{route:r,params:a}}}return{route:null,params:{}}},Me={};async function Ge(e){if(e.component)return e.component;if(e.load){if(Me[e.path])return Me[e.path];try{const t=await e.load();return Me[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function Ze(e){const{routes:t,base:r="",initialUrl:i}=e;let n,s,o,a,c,u,m;const T=async(v,d)=>{const g=t.find(y=>J([y],v.path).route!==null);if(g?.beforeEnter)try{const y=await g.beforeEnter(v,d);return typeof y=="string"?(await w(y,!0),!1):y!==!1}catch(y){return Q("beforeEnter error",y),!1}return!0},p=async(v,d)=>{const g=t.find(y=>J([y],v.path).route!==null);if(g?.onEnter)try{const y=await g.onEnter(v,d);return typeof y=="string"?(await w(y,!0),!1):y!==!1}catch(y){return Q("onEnter error",y),!1}return!0},l=(v,d)=>{const g=t.find(y=>J([y],v.path).route!==null);if(g?.afterEnter)try{g.afterEnter(v,d)}catch(y){Q("afterEnter error",y)}},w=async(v,d=!1)=>{try{const g={path:v.replace(r,"")||"/",query:{}},y=J(t,g.path);if(!y)throw new Error(`No route found for ${g.path}`);const x=o.getState(),f={path:g.path,params:y.params,query:g.query};if(!await T(f,x)||!await p(f,x))return;typeof window<"u"&&typeof document<"u"&&(d?window.history.replaceState({},"",r+v):window.history.pushState({},"",r+v)),o.setState(f),l(f,x)}catch(g){Q("Navigation error:",g)}};if(typeof window<"u"&&typeof document<"u"){n=()=>{const d=new URL(window.location.href),g=d.pathname.replace(r,"")||"/",y=Pe(d.search);return{path:g,query:y}},s=n();const v=J(t,s.path);o=Ee({path:s.path,params:v.params,query:s.query}),a=async(d=!1)=>{const g=n();await w(g.path,d)},window.addEventListener("popstate",()=>a(!0)),c=d=>w(d,!1),u=d=>w(d,!0),m=()=>window.history.back()}else{n=()=>{const g=new URL(i||"/","http://localhost"),y=g.pathname.replace(r,"")||"/",x=Pe(g.search);return{path:y,query:x}},s=n();const v=J(t,s.path);o=Ee({path:s.path,params:v.params,query:s.query}),a=async()=>{const g=n();await d(g.path)};const d=async g=>{try{const y={path:g.replace(r,"")||"/",query:{}},x=J(t,y.path);if(!x)throw new Error(`No route found for ${y.path}`);const f=o.getState(),b={path:y.path,params:x.params,query:y.query},h=t.find(_=>J([_],b.path).route!==null);if(h?.beforeEnter)try{const _=await h.beforeEnter(b,f);if(typeof _=="string"){await d(_);return}if(_===!1)return}catch{return}if(h?.onEnter)try{const _=await h.onEnter(b,f);if(typeof _=="string"){await d(_);return}if(_===!1)return}catch{return}if(o.setState(b),h?.afterEnter)try{h.afterEnter(b,f)}catch{}}catch{}};c=async g=>d(g),u=async g=>d(g),m=()=>{}}return{store:o,push:c,replace:u,back:m,subscribe:o.subscribe,matchRoute:v=>J(t,v),getCurrent:()=>o.getState(),resolveRouteComponent:Ge}}function Gt(e,t){return J(e,t)}function Zt(e){const t=Ze(e);return Oe("router-view",{async render(){if(!t)return te`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:i}=r,n=t.matchRoute(i);if(!n.route)return te`<div>Not found</div>`;try{const s=await t.resolveRouteComponent(n.route);if(typeof s=="string")return{tag:s,props:{},children:[]};if(typeof s=="function"){const o=s(),a=o instanceof Promise?await o:o;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return te`<div>Invalid route component</div>`}catch{return te`<div>Invalid route component</div>`}},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),Oe("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},class:{type:String,default:""},style:{type:String,default:$e`
62
62
  [aria-disabled="true"] {
63
63
  pointer-events: none;
64
64
  opacity: 0.5;
65
65
  }
66
- `}},style:r=>r.style,render:r=>{const i=t.getCurrent(),n=r.to,s=r.exact,o=r.exactActiveClass,a=r.activeClass,f=r.ariaCurrentValue,u=r.tag,d=r.disabled,y=r.external,c=i.path===n,h=s?c:i&&typeof i.path=="string"?i.path.startsWith(n):!1,k=c?`aria-current="${f}"`:"",$=(r.class||"").split(/\s+/).filter(Boolean),w={};for(const g of $)w[g]=!0;const b={...w,[a]:h,[o]:c},m=u==="button",x=d?m?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",l=y&&(u==="a"||!u)?'target="_blank" rel="noopener noreferrer"':"";return F`
67
- ${Te().when(m,F`
66
+ `}},style:r=>r.style,render:r=>{const i=t.getCurrent(),n=r.to,s=r.exact,o=r.exactActiveClass,a=r.activeClass,c=r.ariaCurrentValue,u=r.tag,m=r.disabled,T=r.external,p=i.path===n,l=s?p:i&&typeof i.path=="string"?i.path.startsWith(n):!1,w=p?`aria-current="${c}"`:"",v=(r.class||"").split(/\s+/).filter(Boolean),d={};for(const b of v)d[b]=!0;const g={...d,[a]:l,[o]:p},y=u==="button",x=m?y?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",f=T&&(u==="a"||!u)?'target="_blank" rel="noopener noreferrer"':"";return te`
67
+ ${We().when(y,te`
68
68
  <button
69
69
  part="button"
70
- :class="${b}"
71
- ${k}
70
+ :class="${g}"
71
+ ${w}
72
72
  ${x}
73
- ${l}
73
+ ${f}
74
74
  @click="navigate"
75
75
  ><slot></slot></button>
76
- `).otherwise(F`
76
+ `).otherwise(te`
77
77
  <a
78
78
  part="link"
79
79
  href="${n}"
80
- :class="${b}"
81
- ${k}
80
+ :class="${g}"
81
+ ${w}
82
82
  ${x}
83
- ${l}
83
+ ${f}
84
84
  @click="navigate"
85
85
  ><slot></slot></a>
86
86
  `).done()}
87
- `},navigate:(r,i)=>{if(i.disabled){r.preventDefault();return}i.external&&(i.tag==="a"||!i.tag)||(r.preventDefault(),i.replace?t.replace(i.to):t.push(i.to))}}),t}R.GlobalEventBus=U,R.component=_e,R.createStore=ge,R.css=ye,R.each=qe,R.emit=Ie,R.eventBus=Y,R.html=F,R.initRouter=Ct,R.listen=Ue,R.match=Te,R.matchRoute=q,R.matchRouteSSR=Et,R.off=Fe,R.on=He,R.once=Ke,R.parseQuery=Se,R.renderToString=ce,R.resolveRouteComponent=Me,R.useRouter=We,R.when=ee,Object.defineProperty(R,Symbol.toStringTag,{value:"Module"})}));
87
+ `},navigate:(r,i)=>{if(i.disabled){r.preventDefault();return}i.external&&(i.tag==="a"||!i.tag)||(r.preventDefault(),i.replace?t.replace(i.to):t.push(i.to))}}),t}j.GlobalEventBus=re,j.anchorBlock=O,j.component=Oe,j.createStore=Ee,j.css=$e,j.each=Ye,j.eachGroup=it,j.eachPage=st,j.eachWhere=rt,j.emit=ft,j.eventBus=se,j.html=te,j.initRouter=Zt,j.listen=ht,j.match=We,j.matchRoute=J,j.matchRouteSSR=Gt,j.mediaVariants=G,j.off=dt,j.on=ut,j.once=pt,j.parseQuery=Pe,j.renderToString=me,j.resolveRouteComponent=Ge,j.responsive=Ie,j.responsiveOrder=_e,j.responsiveSwitch=ct,j.switchOn=lt,j.switchOnLength=nt,j.switchOnPromise=ot,j.unless=Xe,j.useRouter=Ze,j.when=Y,j.whenEmpty=et,j.whenMedia=q,j.whenNotEmpty=tt,j.whenVariants=at,Object.defineProperty(j,Symbol.toStringTag,{value:"Module"})}));
88
88
  //# sourceMappingURL=custom-elements-runtime.umd.js.map