@jasonshimmy/custom-elements-runtime 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +69 -57
- package/dist/custom-elements-runtime.cjs.js +36 -30
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +2534 -1373
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +35 -29
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/dist/directive-enhancements.d.ts +138 -0
- package/dist/directives.d.ts +5 -0
- package/dist/index.d.ts +9 -6
- package/dist/runtime/component.d.ts +39 -2
- package/dist/runtime/event-manager.d.ts +58 -0
- package/dist/runtime/helpers.d.ts +19 -0
- package/dist/runtime/hooks.d.ts +113 -0
- package/dist/runtime/logger.d.ts +16 -0
- package/dist/runtime/props.d.ts +13 -1
- package/dist/runtime/reactive-proxy-cache.d.ts +51 -0
- package/dist/runtime/reactive.d.ts +118 -0
- package/dist/runtime/render.d.ts +2 -2
- package/dist/runtime/scheduler.d.ts +27 -0
- package/dist/runtime/secure-expression-evaluator.d.ts +30 -0
- package/dist/runtime/template-compiler.d.ts +4 -0
- package/dist/runtime/types.d.ts +2 -10
- package/dist/runtime/vdom.d.ts +10 -9
- package/package.json +1 -1
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Ie(e,t){return de(e?t:[],"when-block")}function Ne(e,t){return e.map((r,i)=>{const n=typeof r=="object"?r?.key??r?.id??`idx-${i}`:String(r);return de(t(r,i),`each-${n}`)})}function Oe(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return We(...e)}}}function We(...e){for(let t=0;t<e.length;t++){const[r,i]=e[t];if(r)return[de(i,`whenChain-branch-${t}`)]}return[de([],"whenChain-empty")]}function de(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class V extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return V.instance||(V.instance=new V),V.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 o=this.handlers[t];o&&o.forEach(s=>{try{s(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,o=>{n(),r(o),i(o)})})}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 ee=V.getInstance(),De=(e,t)=>ee.emit(e,t),Ue=(e,t)=>ee.on(e,t),Fe=(e,t)=>ee.off(e,t),Ke=(e,t)=>ee.once(e,t),Je=(e,t,r)=>ee.listen(e,t,r);function Se(e){let t={...e};const r=[];function i(a){r.push(a),a(t)}function n(){return t}function o(a){const f=typeof a=="function"?a(t):a;t={...t,...f},s()}function s(){r.forEach(a=>a(t))}return{subscribe:i,getState:n,setState:o}}function Q(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function J(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function W(e,t){return typeof t=="string"?t.split(".").reduce((r,i)=>r?.[i],e):t}function ce(e,t,r){const i=String(t).split("."),n=i.pop();if(!n)return;const o=i.reduce((s,a)=>(s[a]==null&&(s[a]={}),s[a]),e);o[n]=r}function Ge(e,t,r){if(r)for(const[i,n]of Object.entries(r)){let o,s={};if(Array.isArray(n)?(o=n[0],s=n[1]||{}):o=n,t.set(i,{callback:o,options:s,oldValue:W(e,i)}),s.immediate)try{const a=W(e,i);o(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${i}":`,a)}}}function Ze(e,t,r,i){const n=(s,a)=>{if(s===a)return!0;if(typeof s!=typeof a||typeof s!="object"||s===null||a===null)return!1;if(Array.isArray(s)&&Array.isArray(a))return s.length!==a.length?!1:s.every((h,C)=>n(h,a[C]));const f=Object.keys(s),p=Object.keys(a);return f.length!==p.length?!1:f.every(h=>n(s[h],a[h]))},o=t.get(r);if(o&&!n(i,o.oldValue))try{o.callback(i,o.oldValue,e),o.oldValue=i}catch(s){console.error(`Error in watcher for "${r}":`,s)}for(const[s,a]of t.entries())if(a.options.deep&&r.startsWith(s+"."))try{const f=W(e,s);n(f,a.oldValue)||(a.callback(f,a.oldValue,e),a.oldValue=f)}catch(f){console.error(`Error in deep watcher for "${s}":`,f)}}function Ve(e,t,r){if(!t.props)return;function i(n,o){return o===Boolean?n==="true":o===Number?Number(n):n}Object.entries(t.props).forEach(([n,o])=>{if(o.type===Function&&typeof e[n]=="function")r[n]=e[n];else{const s=Q(n),a=e.getAttribute(s);if(typeof e[n]<"u")try{r[n]=J(i(e[n],o.type))}catch{r[n]=e[n]}else a!==null?r[n]=J(i(a,o.type)):"default"in o&&o.default!==void 0&&(r[n]=J(o.default))}})}function Ye(e,t,r,i){e.onConnected&&!r&&(e.onConnected(t),i(!0))}function Qe(e,t,r,i,n,o,s,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(f=>f()),i(),n(),o(!1),s(null),a(!1)}function Xe(e,t,r,i,n){e.onAttributeChanged&&e.onAttributeChanged(t,r,i,n)}function Y(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))Y(r,t)}}function et(e,t,r,i,n,o,s,a){if(!o)return;const f=t.includes("lazy"),p=t.includes("trim"),h=t.includes("number"),C=()=>W(o._state||o,e),u=C();let c="text";s instanceof HTMLInputElement?c=i?.type||s.type||"text":s instanceof HTMLSelectElement?c="select":s instanceof HTMLTextAreaElement&&(c="textarea");const w=s instanceof HTMLInputElement||s instanceof HTMLTextAreaElement||s instanceof HTMLSelectElement,d=w?c==="checkbox"||c==="radio"?"checked":"value":a??"modelValue";if(c==="checkbox")if(Array.isArray(u))r[d]=u.includes(String(s?.getAttribute("value")??i?.value??""));else{const x=s?.getAttribute("true-value")??!0;r[d]=u===x}else if(c==="radio")r[d]=u===(i?.value??"");else if(c==="select")if(s&&s.hasAttribute("multiple")&&s instanceof HTMLSelectElement){const x=Array.isArray(u)?u.map(String):[];setTimeout(()=>{Array.from(s.options).forEach(l=>{l.selected=x.includes(l.value)})},0),r[d]=Array.isArray(u)?u:[]}else r[d]=u;else{r[d]=u;try{const x=Q(d);i&&(i[x]=u)}catch{}}const g=f||c==="checkbox"||c==="radio"||c==="select"?"change":"input",m=x=>{if(x.isComposing||n._isComposing||x.isTrusted===!1)return;const l=x.target;if(!l||l._modelUpdating)return;let b=l.value;if(c==="checkbox"){const $=C();if(Array.isArray($)){const A=l.getAttribute("value")??"",_=Array.from($);if(l.checked)_.includes(A)||_.push(A);else{const T=_.indexOf(A);T>-1&&_.splice(T,1)}b=_}else{const A=l.getAttribute("true-value")??!0,_=l.getAttribute("false-value")??!1;b=l.checked?A:_}}else if(c==="radio")b=l.getAttribute("value")??l.value;else if(c==="select"&&l.multiple)b=Array.from(l.selectedOptions).map($=>$.value);else if(p&&typeof b=="string"&&(b=b.trim()),h){const $=Number(b);isNaN($)||(b=$)}const y=o._state||o,S=W(y,e);if(Array.isArray(b)&&Array.isArray(S)?JSON.stringify([...b].sort())!==JSON.stringify([...S].sort()):b!==S){l._modelUpdating=!0;try{ce(y,e,b),o._requestRender&&o._requestRender()}finally{setTimeout(()=>l._modelUpdating=!1,0)}}};w?n[g]=m:n[`update:${Q(d)}`]=x=>{const l=o._state||o,b=x.detail!==void 0?x.detail:x.target?.value,y=W(l,e);(Array.isArray(b)&&Array.isArray(y)?JSON.stringify([...b].sort())!==JSON.stringify([...y].sort()):b!==y)&&(ce(l,e,b),o._requestRender&&o._requestRender())},(c==="text"||c==="textarea")&&(n.compositionstart=(()=>n._isComposing=!0),n.compositionend=x=>{n._isComposing=!1;const l=x.target;l&&setTimeout(()=>{const b=l.value,y=o._state||o,S=W(y,e);let E=b;if(p&&(E=E.trim()),h){const A=Number(E);isNaN(A)||(E=A)}if(Array.isArray(E)&&Array.isArray(S)?JSON.stringify([...E].sort())!==JSON.stringify([...S].sort()):E!==S){l._modelUpdating=!0;try{ce(y,e,E),o._requestRender&&o._requestRender()}finally{setTimeout(()=>l._modelUpdating=!1,0)}}},0)})}function Pe(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function tt(e,t,r,i){if(i){if(typeof e=="object"&&e!==null)for(const[n,o]of Object.entries(e))t[n]=o;else if(typeof e=="string")try{const n=JSON.parse(e);if(typeof n=="object"&&n!==null){for(const[o,s]of Object.entries(n))t[o]=s;return}}catch{const n=W(i,e);r[e]=n}}}function rt(e,t,r){if(!r)return;const i=W(r,e),n=t.style||"",o=i?"":"none";if(n){const s=n.split(";").filter(Boolean),a=s.findIndex(f=>f.trim().startsWith("display:"));a>=0?s[a]=`display: ${o}`:s.push(`display: ${o}`),t.style=s.join("; ")}else t.style=`display: ${o}`}function nt(e,t,r){if(!r)return;const i=W(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 o=t.class||"",s=o?`${o} ${n.join(" ")}`.trim():n.join(" ");s&&(t.class=s)}function it(e,t,r){let i;if(typeof e=="string"){if(!r)return;i=W(r,e)}else i=e;let n="";if(typeof i=="string")n=i;else if(i&&typeof i=="object"){const s=[];for(const[a,f]of Object.entries(i))if(f!=null&&f!==""){const p=a.replace(/[A-Z]/g,u=>`-${u.toLowerCase()}`),h=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let C=String(f);typeof f=="number"&&h.includes(p)&&(C=`${f}px`),s.push(`${p}: ${C}`)}n=s.join("; ")+(s.length>0?";":"")}const o=t.style||"";t.style=o+(o&&!o.endsWith(";")?"; ":"")+n}function Be(e,t,r,i){const n={},o={...i||{}},s={};for(const[a,f]of Object.entries(e)){const{value:p,modifiers:h,arg:C}=f;if(a==="model"||a.startsWith("model:")){const u=a.split(":"),c=u.length>1?u[1]:C;et(typeof p=="string"?p:String(p),h,n,o,s,t,r,c);continue}switch(a){case"bind":tt(p,n,o,t);break;case"show":rt(p,o,t);break;case"class":nt(p,o,t);break;case"style":it(p,o,t);break}}return{props:n,attrs:o,listeners:s}}function _e(e,t){if(Array.isArray(e)){const o=new Set;return e.map(s=>{if(!s||typeof s!="object")return s;let a=s.props?.key??s.key;if(!a){const C=s.tag||"node",c=[s.props?.attrs?.id,s.props?.attrs?.name,s.props?.attrs?.["data-key"],s.props?.props?.id,s.props?.props?.name,s.props?.props?.dataKey,s.props?.props?.["data-key"]].find(w=>w!=null)??"";a=c?`${t}:${C}:${c}`:`${t}:${C}`}let f=a,p=1;for(;o.has(f);)f=`${a}#${p++}`;o.add(f);let h=s.children;return Array.isArray(h)&&(h=_e(h,f)),{...s,key:f,children:h}})}const r=e;let i=r.props?.key??r.key??t,n=r.children;return Array.isArray(n)&&(n=_e(n,i)),{...r,key:i,children:n}}function Ae(e,t,r,i){const n=r.directives??{},o=Be(n,i,e,r.attrs),s={...t.props,...r.props,...o.props},a={...t.attrs,...r.attrs,...o.attrs},f=t.props??{},p=s,h=r?.isCustomElement??t?.isCustomElement??!1;let C=!1;for(const w in{...f,...p}){const v=f[w],d=p[w];if(v!==d){if(C=!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=Pe(w);typeof v=="function"&&e.removeEventListener(g,v),e.addEventListener(g,d)}else if(d==null||d===!1)e.removeAttribute(w);else if((r?.isCustomElement??t?.isCustomElement??!1)||w in e)try{e[w]=d}catch{}}}for(const[w,v]of Object.entries(o.listeners||{}))e.addEventListener(w,v);const u=t.attrs??{},c=a;for(const w in{...u,...c}){const v=u[w],d=c[w];if(v!==d)if(C=!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(!(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(h&&C)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 D(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const u=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(u.key=e.key),u}if(e.tag==="#anchor"){const u=e,c=Array.isArray(u.children)?u.children:[],w=document.createTextNode(""),v=document.createTextNode("");u.key!=null&&(w.key=`${u.key}:start`,v.key=`${u.key}:end`),u._startNode=w,u._endNode=v;const d=document.createDocumentFragment();d.appendChild(w);for(const g of c){const m=D(g,t);d.appendChild(m)}return d.appendChild(v),d}const i=document.createElement(e.tag);e.key!=null&&(i.key=e.key);const{props:n={},attrs:o={},directives:s={}}=e.props??{},a=Be(s,t,i,o),f={...n,...a.props},p={...o,...a.attrs},h=i.namespaceURI==="http://www.w3.org/2000/svg";for(const u in p){const c=p[u];if(!(typeof u!="string"||/\[object Object\]/.test(u))){if(typeof c=="boolean")c&&i.setAttribute(u,"");else if(c!=null)if(!h&&u==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement||i instanceof HTMLProgressElement))try{i instanceof HTMLProgressElement?i.value=Number(c):i.value=c??""}catch{i.setAttribute(u,String(c))}else if(!h&&u==="checked"&&i instanceof HTMLInputElement)try{i.checked=!!c}catch{i.setAttribute(u,String(c))}else if(!h&&u in i)try{i[u]=c}catch{i.setAttribute(u,String(c))}else i.setAttribute(u,String(c))}}for(const u in f){const c=f[u];if(!(typeof u!="string"||/\[object Object\]/.test(u)))if(u==="value"&&(i instanceof HTMLInputElement||i instanceof HTMLTextAreaElement||i instanceof HTMLSelectElement))i.value=c??"";else if(u==="checked"&&i instanceof HTMLInputElement)i.checked=!!c;else if(u.startsWith("on")&&typeof c=="function")i.addEventListener(Pe(u),c);else{if(u.startsWith("on")&&c===void 0)continue;if(c==null||c===!1)i.removeAttribute(u);else if((e.props?.isCustomElement??!1)||u in i)try{i[u]=c}catch{}}}for(const[u,c]of Object.entries(a.listeners||{}))i.addEventListener(u,c);const C=e.props?.ref??(e.props?.props&&e.props.props.ref);typeof e!="string"&&C&&r&&(r[C]=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 u of e.children)i.appendChild(D(u,t,r));else typeof e.children=="string"&&(i.textContent=e.children);try{if(i instanceof HTMLSelectElement&&p&&p.hasOwnProperty("value"))try{i.value=p.value??""}catch{}}catch{}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 o=Array.from(e.childNodes),s=Array.isArray(t)?t:[],a=new Map;for(const c of s)c&&c.key!=null&&a.set(c.key,c);const f=new Map;for(const c of o){const w=c.key;w!=null&&f.set(w,c)}const p=new Set;let h=e.firstChild;function C(c,w){let v=c;for(;v&&(p.add(v),v!==w);)v=v.nextSibling}function u(c,w,v,d){const g=[];let m=c.nextSibling;for(;m&&m!==w;)g.push(m),m=m.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,y=new Map;for(const $ of x)$&&$.key!=null&&b.set($.key,$);for(const $ of g){const A=$.key;A!=null&&y.set(A,$)}const S=new Set;let E=c.nextSibling;for(const $ of d){let A;if($.key!=null&&y.has($.key)){const _=b.get($.key);A=le(y.get($.key),_,$,i),S.add(A),A!==E&&e.contains(A)&&e.insertBefore(A,E)}else A=D($,i),e.insertBefore(A,E),S.add(A);E=A.nextSibling}for(const $ of g)!S.has($)&&e.contains($)&&e.removeChild($)}else{const b=Math.min(x.length,d.length);for(let y=0;y<b;y++){const S=x[y],E=d[y],$=le(g[y],S,E,i);$!==g[y]&&(e.insertBefore($,g[y]),e.removeChild(g[y]))}for(let y=b;y<d.length;y++)e.insertBefore(D(d[y],i),w);for(let y=b;y<g.length;y++)e.removeChild(g[y])}}for(const c of r){let w;if(c.tag==="#anchor"){const v=c.key,d=`${v}:start`,g=`${v}:end`;let m=f.get(d),x=f.get(g);const l=Array.isArray(c.children)?c.children:[];if(m||(m=document.createTextNode(""),m.key=d),x||(x=document.createTextNode(""),x.key=g),c._startNode=m,c._endNode=x,!e.contains(m)||!e.contains(x)){e.insertBefore(m,h);for(const b of l)e.insertBefore(D(b,i),h);e.insertBefore(x,h)}else u(m,x,a.get(v)?.children,l);C(m,x),h=x.nextSibling;continue}if(c.key!=null&&f.has(c.key)){const v=a.get(c.key);w=le(f.get(c.key),v,c,i,n),p.add(w),w!==h&&e.contains(w)&&(h&&!e.contains(h)&&(h=null),e.insertBefore(w,h))}else w=D(c,i,n),h&&!e.contains(h)&&(h=null),e.insertBefore(w,h),p.add(w);h=w.nextSibling}for(const c of o)!p.has(c)&&e.contains(c)&&(Y(c,n),e.removeChild(c))}function le(e,t,r,i,n){if(t&&typeof t!="string"&&t.props?.ref&&n&&Y(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 s=document.createTextNode(r);return e.parentNode?.replaceChild(s,e),s}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const s=r,a=Array.isArray(s.children)?s.children:[],f=s._startNode??document.createTextNode(""),p=s._endNode??document.createTextNode("");s.key!=null&&(f.key=`${s.key}:start`,p.key=`${s.key}:end`),s._startNode=f,s._endNode=p;const h=document.createDocumentFragment();h.appendChild(f);for(const C of a){const u=D(C,i);h.appendChild(u)}return h.appendChild(p),e.parentNode?.replaceChild(h,e),f}if(!r){Y(e,n);const s=document.createComment("removed");return e.parentNode?.replaceChild(s,e),s}if(!t||typeof t=="string"){Y(e,n);const s=D(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}if(r.tag==="#anchor"){const s=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 p=document.createDocumentFragment();p.appendChild(a);for(const h of s)p.appendChild(D(h,i));return p.appendChild(f),e.parentNode?.replaceChild(p,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const s=e;return Ae(s,t.props||{},r.props||{},i),st(s,t.children,r.children,i,n),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=s),s}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 Ae(a,t.props||{},r.props||{},i),typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=a),a}catch{}Y(e,n);const o=D(r,i,n);return typeof r!="string"&&r.props?.ref&&n&&(n[r.props.ref]=o),e.parentNode?.replaceChild(o,e),o}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=_e(n,String(n.key??"root"));const o=e._prevVNode??null,s=e._prevDom??e.firstChild??null;let a;o&&s?typeof o!="string"&&typeof n!="string"&&o.tag===n.tag&&o.key===n.key?a=le(s,o,n,r,i):(a=D(n,r,i),e.replaceChild(a,s)):(a=D(n,r,i),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const f=[];for(let p=0;p<e.childNodes.length;p++){const h=e.childNodes[p];h!==a&&h.nodeName!=="STYLE"&&(Y(h,i),f.push(h))}f.forEach(p=>e.removeChild(p)),e._prevVNode=n,e._prevDom=a}function fe(e){if(typeof e=="string")return J(e);if(e.tag==="#text")return typeof e.children=="string"?J(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(fe).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([n,o])=>` ${n}="${J(String(o))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([n])=>n!=="attrs"&&n!=="directives"&&n!=="ref"&&n!=="key").map(([n,o])=>` ${n}="${J(String(o))}"`).join(""));const i=Array.isArray(e.children)?e.children.filter(Boolean).map(fe).join(""):typeof e.children=="string"?J(e.children):e.children?fe(e.children):"";return`<${e.tag}${t}${r}>${i}</${e.tag}>`}function Ce(e,...t){let r="";for(let i=0;i<e.length;i++)r+=e[i],i<t.length&&(r+=t[i]);return r}function ze(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let oe=null;function Te(){return oe||(oe=new CSSStyleSheet,oe.replaceSync(ze(ct))),oe}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=Ce`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});class gt{pendingUpdates=new Map;isFlushScheduled=!1;schedule(t,r){const n=r||t.toString();this.pendingUpdates.set(n,t),this.isFlushScheduled||(this.isFlushScheduled=!0,typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&(window.__vitest__||window.Cypress)?this.flush():queueMicrotask(()=>this.flush()))}flush(){const t=Array.from(this.pendingUpdates.values());this.pendingUpdates.clear(),this.isFlushScheduled=!1;for(const r of t)try{r()}catch(n){typeof console<"u"&&console.error&&console.error("Error in batched update:",n)}}get pendingCount(){return this.pendingUpdates.size}}const mt=new gt;function ue(e,t){mt.schedule(e,t)}const Ve=new WeakSet;class yt{static cache=new WeakMap;static arrayHandlerCache=new WeakMap;static objectHandlerCache=new WeakMap;static getOrCreateProxy(t,r,n=!1){const s=this.cache.get(t);if(s)return s;const i=n?this.getOrCreateArrayHandler(r):this.getOrCreateObjectHandler(r),o=new Proxy(t,i);try{rt.markAsProxy(o)}catch{}return this.cache.set(t,o),o}static getOrCreateArrayHandler(t){if(!this.arrayHandlerCache.has(t)){const r={get:(n,s,i)=>{const o=Reflect.get(n,s,i);return typeof o=="function"&&typeof s=="string"&&["push","pop","shift","unshift","splice","sort","reverse","fill","copyWithin"].includes(s)?function(...u){const m=o.apply(n,u);return t.triggerUpdate(),m}:o},set:(n,s,i)=>(n[s]=t.makeReactiveValue(i),t.triggerUpdate(),!0),deleteProperty:(n,s)=>(delete n[s],t.triggerUpdate(),!0)};this.arrayHandlerCache.set(t,r)}return this.arrayHandlerCache.get(t)}static getOrCreateObjectHandler(t){if(!this.objectHandlerCache.has(t)){const r={get:(n,s,i)=>Reflect.get(n,s,i),set:(n,s,i)=>(n[s]=t.makeReactiveValue(i),t.triggerUpdate(),!0),deleteProperty:(n,s)=>(delete n[s],t.triggerUpdate(),!0)};this.objectHandlerCache.set(t,r)}return this.objectHandlerCache.get(t)}static hasProxy(t){return this.cache.has(t)}static clear(){this.cache=new WeakMap,this.arrayHandlerCache=new WeakMap,this.objectHandlerCache=new WeakMap}static getStats(){return{hasCachedProxies:this.cache instanceof WeakMap}}}class rt{static contextCache=new WeakMap;static createReactiveProxy(t,r,n){try{if(Ve.has(t))return t}catch{}const s=Array.isArray(t);let i=this.contextCache.get(r);i||(i=new WeakMap,this.contextCache.set(r,i));let o=i.get(n);return o||(o={triggerUpdate:r,makeReactiveValue:n},i.set(n,o)),yt.getOrCreateProxy(t,o,s)}static markAsProxy(t){if(t)try{Ve.add(t)}catch{}}}class bt{currentComponent=null;componentDependencies=new Map;componentRenderFunctions=new Map;stateStorage=new Map;stateIndexCounter=new Map;trackingDisabled=!1;lastWarningTime=new Map;setCurrentComponent(t,r){this.currentComponent=t,this.componentRenderFunctions.set(t,r),this.componentDependencies.has(t)||this.componentDependencies.set(t,new Set),this.stateIndexCounter.set(t,0)}clearCurrentComponent(){this.currentComponent=null}disableTracking(){this.trackingDisabled=!0}enableTracking(){this.trackingDisabled=!1}isRenderingComponent(){return this.currentComponent!==null}shouldEmitRenderWarning(){if(!this.currentComponent)return!0;const t=this.currentComponent,r=this.lastWarningTime.get(t)||0,n=Date.now();return n-r<1e3?!1:(this.lastWarningTime.set(t,n),!0)}withoutTracking(t){const r=this.trackingDisabled;this.trackingDisabled=!0;try{return t()}finally{this.trackingDisabled=r}}getOrCreateState(t){if(!this.currentComponent)return new ze(t);const r=this.currentComponent,n=this.stateIndexCounter.get(r)||0,s=`${r}:${n}`;if(this.stateIndexCounter.set(r,n+1),this.stateStorage.has(s))return this.stateStorage.get(s);const i=new ze(t);return this.stateStorage.set(s,i),i}trackDependency(t){this.trackingDisabled||this.currentComponent&&(this.componentDependencies.get(this.currentComponent)?.add(t),t.addDependent(this.currentComponent))}triggerUpdate(t){t.getDependents().forEach(r=>{const n=this.componentRenderFunctions.get(r);n&&ue(n,r)})}cleanup(t){const r=this.componentDependencies.get(t);r&&(r.forEach(n=>n.removeDependent(t)),this.componentDependencies.delete(t)),this.componentRenderFunctions.delete(t);for(const n of Array.from(this.stateStorage.keys()))n.startsWith(t+":")&&this.stateStorage.delete(n);this.stateIndexCounter.delete(t)}}const F=new bt;class ze{_value;dependents=new Set;constructor(t){this._value=this.makeReactive(t)}get value(){return F.trackDependency(this),this._value}set value(t){F.isRenderingComponent()&&F.shouldEmitRenderWarning()&&console.warn(`🚨 State modification detected during render! This can cause infinite loops.
|
|
2
|
+
• Move state updates to event handlers
|
|
3
|
+
• Use useEffect/watch for side effects
|
|
4
|
+
• Ensure computed properties don't modify state`),this._value=this.makeReactive(t),F.triggerUpdate(this)}addDependent(t){this.dependents.add(t)}removeDependent(t){this.dependents.delete(t)}getDependents(){return this.dependents}makeReactive(t){return t===null||typeof t!="object"||t instanceof Node||t instanceof Element||t instanceof HTMLElement?t:rt.createReactiveProxy(t,()=>F.triggerUpdate(this),r=>this.makeReactive(r))}}function wt(e){return F.getOrCreateState(e===void 0?null:e)}function vt(e){const t=new ze(e());return{get value(){return F.trackDependency(t),e()}}}function xt(e,t,r={}){let n=e();r.immediate&&t(n,n);const s=`watch-${Math.random().toString(36).substr(2,9)}`,i=()=>{F.setCurrentComponent(s,i);const o=e();F.clearCurrentComponent(),o!==n&&(t(o,n),n=o)};return F.setCurrentComponent(s,i),e(),F.clearCurrentComponent(),()=>{F.cleanup(s)}}const we=new Map,ve=new Map,xe=new Map,qe=500;function te(e){if(we.has(e))return we.get(e);const t=e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase();return we.size<qe&&we.set(e,t),t}function nt(e){if(ve.has(e))return ve.get(e);const t=e.replace(/-([a-z])/g,(r,n)=>n.toUpperCase());return ve.size<qe&&ve.set(e,t),t}function se(e){if(typeof e=="string"){if(xe.has(e))return xe.get(e);const t=e.replace(/[&<>"']/g,r=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[r]);return t!==e&&xe.size<qe&&xe.set(e,t),t}return e}function B(e,t){if(typeof t=="string"){const r=t.split(".").reduce((n,s)=>n?.[s],e);return r&&typeof r=="object"&&r.constructor&&r.constructor.name==="ReactiveState"?r.value:r}return t}function _e(e,t,r){const n=String(t).split("."),s=n.pop();if(!s)return;const i=n.reduce((o,a)=>(o[a]==null&&(o[a]={}),o[a]),e);i[s]&&typeof i[s]=="object"&&i[s].constructor&&i[s].constructor.name==="ReactiveState"?i[s].value=r:i[s]=r}const st=typeof process<"u"&&process.env?.NODE_ENV!=="production";function ie(e,...t){st&&console.error(e,...t)}function Te(e,...t){st&&console.warn(e,...t)}function kt(e,t,r){if(r)for(const[n,s]of Object.entries(r)){let i,o={};if(Array.isArray(s)?(i=s[0],o=s[1]||{}):i=s,t.set(n,{callback:i,options:o,oldValue:B(e,n)}),o.immediate)try{const a=B(e,n);i(a,void 0,e)}catch(a){ie(`Error in immediate watcher for "${n}":`,a)}}}function Ct(e,t,r,n){const s=(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((g,w)=>s(g,a[w]));const u=Object.keys(o),m=Object.keys(a);return u.length!==m.length?!1:u.every(g=>s(o[g],a[g]))},i=t.get(r);if(i&&!s(n,i.oldValue))try{i.callback(n,i.oldValue,e),i.oldValue=n}catch(o){ie(`Error in watcher for "${r}":`,o)}for(const[o,a]of t.entries())if(a.options.deep&&r.startsWith(o+"."))try{const u=B(e,o);s(u,a.oldValue)||(a.callback(u,a.oldValue,e),a.oldValue=u)}catch(u){ie(`Error in deep watcher for "${o}":`,u)}}function Je(e,t){return t===Boolean?e==="true":t===Number?Number(e):e}function _t(e,t,r){t&&Object.entries(t).forEach(([n,s])=>{const i=te(n),o=e.getAttribute(i);if(s.type===Function&&typeof e[n]=="function")r[n]=e[n];else if(typeof e[n]<"u")try{const a=e[n];s.type===Boolean&&typeof a=="boolean"||s.type===Number&&typeof a=="number"||s.type===Function&&typeof a=="function"?r[n]=a:r[n]=se(Je(String(a),s.type))}catch{r[n]=e[n]}else o!==null?r[n]=se(Je(o,s.type)):"default"in s&&s.default!==void 0&&(r[n]=se(s.default))})}function Et(e,t,r){t.props&&_t(e,t.props,r)}function St(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function $t(e,t,r,n,s,i,o,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(u=>u()),n(),s(),i(!1),o(null),a(!1)}function At(e,t,r,n,s){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,s)}class Rt{static cache=new Map;static maxCacheSize=1e3;static dangerousPatterns=[/constructor/i,/prototype/i,/__proto__/i,/function/i,/eval/i,/import/i,/require/i,/window/i,/document/i,/global/i,/process/i,/setTimeout/i,/setInterval/i,/fetch/i,/XMLHttpRequest/i];static evaluate(t,r){const n=this.cache.get(t);if(n){if(!n.isSecure){Te("Blocked cached dangerous expression:",t);return}return n.evaluator(r)}const s=this.createEvaluator(t);if(this.cache.size>=this.maxCacheSize){const i=this.cache.keys().next().value;i&&this.cache.delete(i)}if(this.cache.set(t,s),!s.isSecure){Te("Blocked dangerous expression:",t);return}return s.evaluator(r)}static createEvaluator(t){if(this.hasDangerousPatterns(t))return{evaluator:()=>{},isSecure:!1};if(t.length>1e3)return{evaluator:()=>{},isSecure:!1};try{return{evaluator:this.createSafeEvaluator(t),isSecure:!0}}catch(r){return Te("Failed to create evaluator for expression:",t,r),{evaluator:()=>{},isSecure:!1}}}static hasDangerousPatterns(t){return this.dangerousPatterns.some(r=>r.test(t))}static createSafeEvaluator(t){if(t.trim().startsWith("{")&&t.trim().endsWith("}"))return this.createObjectEvaluator(t);if(/^ctx\.[a-zA-Z0-9_\.]+$/.test(t.trim())){const r=t.trim().slice(4);return n=>B(n,r)}return t.includes("ctx")||/[+\-*/%<>=&|?:\[\]]/.test(t)?this.createSimpleEvaluator(t):r=>B(r,t)}static createObjectEvaluator(t){const r=t.trim().slice(1,-1),n=this.parseObjectProperties(r);return s=>{const i={};for(const{key:o,value:a}of n)try{if(a.startsWith("ctx.")){const u=a.slice(4);i[o]=B(s,u)}else i[o]=this.evaluateSimpleValue(a,s)}catch{i[o]=void 0}return i}}static parseObjectProperties(t){const r=[],n=t.split(",");for(const s of n){const i=s.indexOf(":");if(i===-1)continue;const o=s.slice(0,i).trim(),a=s.slice(i+1).trim(),u=o.replace(/^['"]|['"]$/g,"");r.push({key:u,value:a})}return r}static createSimpleEvaluator(t){return r=>{try{let n=t;const s=[];n=n.replace(/("[^"\\]*(?:\\.[^"\\]*)*"|'[^'\\]*(?:\\.[^'\\]*)*')/g,w=>`<<#${s.push(w)-1}#>>`);const i=n.match(/ctx\.[\w.]+/g)||[];for(const w of i){const h=w.slice(4),l=B(r,h);if(l===void 0)return;const d=s.push(JSON.stringify(l))-1;n=n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`)}const o=/\b[a-zA-Z_][a-zA-Z0-9_]*(?:\.[a-zA-Z_][a-zA-Z0-9_]*)+\b/g,a=n.match(o)||[];for(const w of a){if(w.startsWith("ctx."))continue;const h=B(r,w);if(h===void 0)return;const l=s.push(JSON.stringify(h))-1;n=n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${l}#>>`)}const u=/\b([a-zA-Z_][a-zA-Z0-9_]*)\b/g;let m;const g=new Set;for(;(m=u.exec(n))!==null;){const w=m[1];if(["true","false","null","undefined"].includes(w)||/^[0-9]+$/.test(w)||w==="ctx"||g.has(w))continue;g.add(w);const h=B(r,w);if(h===void 0)return;const l=JSON.stringify(h),d=s.push(l)-1;w.includes(".")?n=n.replace(new RegExp(w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),"g"),`<<#${d}#>>`):n=n.replace(new RegExp("\\b"+w.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")+"\\b","g"),`<<#${d}#>>`)}n=n.replace(/<<#(\d+)#>>/g,(w,h)=>s[Number(h)]);try{return this.evaluateBasicExpression(n)}catch{return}}catch{return}}}static evaluateBasicExpression(t){const r=this.tokenize(t);let n=0;function s(){return r[n]}function i(c){const p=r[n++];if(c&&!p)throw new Error(`Unexpected token EOF, expected ${c}`);if(c&&p&&p.type!==c&&p.value!==c)throw new Error(`Unexpected token ${p.type}/${p.value}, expected ${c}`);return p}function o(){return a()}function a(){let c=u();if(s()&&s().value==="?"){i("?");const p=o();i(":");const y=o();return c?p:y}return c}function u(){let c=m();for(;s()&&s().value==="||";){i("OP");const p=m();c=c||p}return c}function m(){let c=g();for(;s()&&s().value==="&&";){i("OP");const p=g();c=c&&p}return c}function g(){let c=w();for(;s()&&["==","!=","===","!=="].includes(s().value);){const p=i("OP").value,y=w();switch(p){case"==":c=c==y;break;case"!=":c=c!=y;break;case"===":c=c===y;break;case"!==":c=c!==y;break}}return c}function w(){let c=h();for(;s()&&[">","<",">=","<="].includes(s().value);){const p=i("OP").value,y=h();switch(p){case">":c=c>y;break;case"<":c=c<y;break;case">=":c=c>=y;break;case"<=":c=c<=y;break}}return c}function h(){let c=l();for(;s()&&(s().value==="+"||s().value==="-");){const p=i("OP").value,y=l();c=p==="+"?c+y:c-y}return c}function l(){let c=d();for(;s()&&(s().value==="*"||s().value==="/"||s().value==="%");){const p=i("OP").value,y=d();switch(p){case"*":c=c*y;break;case"/":c=c/y;break;case"%":c=c%y;break}}return c}function d(){return s()&&s().value==="!"?(i("OP"),!d()):s()&&s().value==="-"?(i("OP"),-d()):v()}function v(){const c=s();if(c){if(c.type==="NUMBER")return i("NUMBER"),Number(c.value);if(c.type==="STRING")return i("STRING"),c.value.slice(1,-1);if(c.type==="IDENT")return i("IDENT"),c.value==="true"?!0:c.value==="false"?!1:c.value==="null"?null:void 0;if(c.value==="["){i("PUNC");const p=[];for(;s()&&s().value!=="]";)p.push(o()),s()&&s().value===","&&i("PUNC");return i("PUNC"),p}if(c.value==="("){i("PUNC");const p=o();return i("PUNC"),p}throw new Error("Unexpected token in expression")}}return o()}static tokenize(t){const r=[],n=/\s*(=>|===|!==|==|!=|>=|<=|\|\||&&|[()?:,\[\]]|\+|-|\*|\/|%|>|<|!|\d+\.?\d*|"[^"]*"|'[^']*'|[a-zA-Z_][a-zA-Z0-9_]*|\S)\s*/g;let s;for(;(s=n.exec(t))!==null;){const i=s[1];i&&(/^\d/.test(i)?r.push({type:"NUMBER",value:i}):/^"/.test(i)||/^'/.test(i)?r.push({type:"STRING",value:i}):/^[a-zA-Z_]/.test(i)?r.push({type:"IDENT",value:i}):/^[()?:,\[\]]$/.test(i)?r.push({type:"PUNC",value:i}):r.push({type:"OP",value:i}))}return r}static evaluateSimpleValue(t,r){if(t==="true")return!0;if(t==="false")return!1;if(!isNaN(Number(t)))return Number(t);if(t.startsWith("ctx.")){const n=t.slice(4);return B(r,n)}return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t}static clearCache(){this.cache.clear()}static getCacheSize(){return this.cache.size}}class oe{static cleanupFunctions=new WeakMap;static addListener(t,r,n,s){t.addEventListener(r,n,s);const o={event:r,handler:n,options:s,cleanup:()=>t.removeEventListener(r,n,s),addedAt:Date.now()};this.cleanupFunctions.has(t)||this.cleanupFunctions.set(t,[]);const a=this.cleanupFunctions.get(t);a.push(o),this.cleanupFunctions.get(t).__metaList=a}static removeListener(t,r,n,s){t.removeEventListener(r,n,s);const i=this.cleanupFunctions.get(t);if(i){const o=i.__metaList||null;if(o){const a=o.findIndex(u=>u.event===r&&u.handler===n&&JSON.stringify(u.options)===JSON.stringify(s));if(a>=0){try{o[a].cleanup()}catch{}o.splice(a,1)}o.length===0&&this.cleanupFunctions.delete(t)}else{const a=i.findIndex(()=>!0);a>=0&&(i.splice(a,1),i.length===0&&this.cleanupFunctions.delete(t))}}}static cleanup(t){const r=this.cleanupFunctions.get(t);r&&((r.__metaList||r).forEach(s=>{try{typeof s=="function"?s():s&&typeof s.cleanup=="function"&&s.cleanup()}catch(i){console.error("Error during event cleanup:",i)}}),this.cleanupFunctions.delete(t))}static cleanupAll(){try{this.cleanupFunctions=new WeakMap}catch(t){console.error("Error during global cleanup:",t)}}static hasListeners(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return!!(n&&n.length>0)}static getListenerCount(t){const r=this.cleanupFunctions.get(t),n=r?r.__metaList||r:void 0;return n?n.length:0}}function ce(e,t){if(t&&e instanceof HTMLElement){oe.cleanup(e);for(const r in t)t[r]===e&&delete t[r];for(const r of Array.from(e.childNodes))ce(r,t)}}function pe(e,t,r){if(typeof e=="string")return;const n=e.props?.reactiveRef??(e.props?.props&&e.props.props.reactiveRef),s=e.props?.ref??(e.props?.props&&e.props.props.ref);n?n.value=t:s&&r&&(r[s]=t)}function Tt(e,t,r,n,s,i,o,a){if(!i)return;const u=t.includes("lazy"),m=t.includes("trim"),g=t.includes("number"),w=e&&typeof e=="object"&&"value"in e&&typeof e.value<"u",h=()=>{if(w){const C=e.value;return a&&typeof C=="object"&&C!==null?C[a]:C}return B(i._state||i,e)},l=h();let d="text";o instanceof HTMLInputElement?d=n?.type||o.type||"text":o instanceof HTMLSelectElement?d="select":o instanceof HTMLTextAreaElement&&(d="textarea");const v=o instanceof HTMLInputElement||o instanceof HTMLTextAreaElement||o instanceof HTMLSelectElement,c=v?d==="checkbox"||d==="radio"?"checked":"value":a??"modelValue";if(d==="checkbox")if(Array.isArray(l))r[c]=l.includes(String(o?.getAttribute("value")??n?.value??""));else{const C=o?.getAttribute("true-value")??!0;r[c]=l===C}else if(d==="radio")r[c]=l===(n?.value??"");else if(d==="select")if(o&&o.hasAttribute("multiple")&&o instanceof HTMLSelectElement){const C=Array.isArray(l)?l.map(String):[];setTimeout(()=>{Array.from(o.options).forEach(k=>{k.selected=C.includes(k.value)})},0),r[c]=Array.isArray(l)?l:[]}else r[c]=l;else{r[c]=l;try{const C=te(c);n&&(n[C]=l)}catch{}}const p=u||d==="checkbox"||d==="radio"||d==="select"?"change":"input",y=C=>{if(C.isComposing||s._isComposing)return;const k=typeof globalThis.process<"u"&&globalThis.process.env?.NODE_ENV==="test"||typeof window<"u"&&window.__vitest__;if(C.isTrusted===!1&&!k)return;const f=C.target;if(!f||f._modelUpdating)return;let x=f.value;if(d==="checkbox"){const R=h();if(Array.isArray(R)){const T=f.getAttribute("value")??"",$=Array.from(R);if(f.checked)$.includes(T)||$.push(T);else{const P=$.indexOf(T);P>-1&&$.splice(P,1)}x=$}else{const T=f.getAttribute("true-value")??!0,$=f.getAttribute("false-value")??!1;x=f.checked?T:$}}else if(d==="radio")x=f.getAttribute("value")??f.value;else if(d==="select"&&f.multiple)x=Array.from(f.selectedOptions).map(R=>R.value);else if(m&&typeof x=="string"&&(x=x.trim()),g){const R=Number(x);isNaN(R)||(x=R)}const A=i._state||i,_=h();if(Array.isArray(x)&&Array.isArray(_)?JSON.stringify([...x].sort())!==JSON.stringify([..._].sort()):x!==_){f._modelUpdating=!0;try{if(w)if(a&&typeof e.value=="object"&&e.value!==null){const R={...e.value};R[a]=x,e.value=R}else e.value=x;else _e(A,e,x);if(i._requestRender&&i._requestRender(),i._triggerWatchers){const R=w?"reactiveState":e;i._triggerWatchers(R,x)}if(f){const R=`update:${te(c)}`,T=new CustomEvent(R,{detail:x,bubbles:!0,composed:!0});f.dispatchEvent(T)}}finally{setTimeout(()=>f._modelUpdating=!1,0)}}};if(v){if(s[p]){const C=s[p];o&&oe.removeListener(o,p,C)}s[p]=y}else{const C=`update:${te(c)}`;if(s[C]){const k=s[C];o&&oe.removeListener(o,C,k)}s[C]=k=>{const f=i._state||i,x=k.detail!==void 0?k.detail:k.target?.value,A=B(f,e);if(Array.isArray(x)&&Array.isArray(A)?JSON.stringify([...x].sort())!==JSON.stringify([...A].sort()):x!==A){_e(f,e,x),i._requestRender&&i._requestRender(),i._triggerWatchers&&i._triggerWatchers(e,x);const S=k.target;if(S){S[c]=x;try{const R=te(c);typeof x=="boolean"?x?S.setAttribute(R,"true"):S.setAttribute(R,"false"):S.setAttribute(R,String(x))}catch{}queueMicrotask(()=>{typeof S._applyProps=="function"&&S._applyProps(S._cfg),typeof S._requestRender=="function"&&S._requestRender()})}}}}(d==="text"||d==="textarea")&&(s.compositionstart=(()=>s._isComposing=!0),s.compositionend=C=>{s._isComposing=!1;const k=C.target;k&&setTimeout(()=>{const f=k.value,x=i._state||i,A=B(x,e);let _=f;if(m&&(_=_.trim()),g){const R=Number(_);isNaN(R)||(_=R)}if(Array.isArray(_)&&Array.isArray(A)?JSON.stringify([..._].sort())!==JSON.stringify([...A].sort()):_!==A){k._modelUpdating=!0;try{_e(x,e,_),i._requestRender&&i._requestRender(),i._triggerWatchers&&i._triggerWatchers(e,_)}finally{setTimeout(()=>k._modelUpdating=!1,0)}}},0)})}function it(e){const t=e.slice(2);return t?t.charAt(0).toLowerCase()+t.slice(1):""}function Ot(e,t,r,n){if(typeof e=="object"&&e!==null)for(const[s,i]of Object.entries(e))s.startsWith("data-")||s.startsWith("aria-")||s==="class"?r[s]=i:t[s]=i;else if(typeof e=="string"){if(!n)return;try{const s=ge(e,n);if(typeof s=="object"&&s!==null){for(const[i,o]of Object.entries(s))i.startsWith("data-")||i.startsWith("aria-")||i==="class"?r[i]=o:t[i]=o;return}else{r[e]=s;return}}catch{const s=B(n,e);r[e]=s}}}function Pt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ge(e,r)}else n=e;const s=t.style||"";let i=s;if(n){if(s){const o=s.split(";").map(u=>u.trim()).filter(Boolean),a=o.findIndex(u=>u.startsWith("display:"));a>=0&&o[a]==="display: none"&&(o.splice(a,1),i=o.length>0?o.join("; ")+";":"")}}else if(s){const o=s.split(";").filter(Boolean),a=o.findIndex(u=>u.trim().startsWith("display:"));a>=0?o[a]="display: none":o.push("display: none"),i=o.join("; ")}else i="display: none";i!==s&&(i?t.style=i:delete t.style)}function ge(e,t){return Rt.evaluate(e,t)}function Lt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ge(e,r)}else n=e;let s=[];typeof n=="string"?s=[n]:Array.isArray(n)?s=n.filter(Boolean):typeof n=="object"&&n!==null&&(s=Object.entries(n).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const i=t.class||"",o=i?`${i} ${s.join(" ")}`.trim():s.join(" ");o&&(t.class=o)}function jt(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=ge(e,r)}else n=e;let s="";if(typeof n=="string")s=n;else if(n&&typeof n=="object"){const o=[];for(const[a,u]of Object.entries(n))if(u!=null&&u!==""){const m=a.replace(/[A-Z]/g,h=>`-${h.toLowerCase()}`),g=["width","height","top","right","bottom","left","margin","margin-top","margin-right","margin-bottom","margin-left","padding","padding-top","padding-right","padding-bottom","padding-left","font-size","line-height","border-width","border-radius","min-width","max-width","min-height","max-height"];let w=String(u);typeof u=="number"&&g.includes(m)&&(w=`${u}px`),o.push(`${m}: ${w}`)}s=o.join("; ")+(o.length>0?";":"")}const i=t.style||"";t.style=i+(i&&!i.endsWith(";")?"; ":"")+s}function Mt(e,t,r){let n=e;typeof e=="string"&&r&&(n=ge(e,r)),n&&typeof n=="object"&&n.constructor?.name==="ReactiveState"?t.reactiveRef=n:t.ref=n}function ot(e,t,r,n){const s={},i={...n||{}},o={};for(const[a,u]of Object.entries(e)){const{value:m,modifiers:g,arg:w}=u;if(a==="model"||a.startsWith("model:")){const h=a.split(":"),l=h.length>1?h[1]:w;Tt(m,g,s,i,o,t,r,l);continue}switch(a){case"bind":Ot(m,s,i,t);break;case"show":Pt(m,i,t);break;case"class":Lt(m,i,t);break;case"style":jt(m,i,t);break;case"ref":Mt(m,s,t);break}}return{props:s,attrs:i,listeners:o}}function Ie(e,t){if(Array.isArray(e)){const i=new Set;return e.map(o=>{if(!o||typeof o!="object")return o;let a=o.props?.key??o.key;if(!a){const w=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(d=>d!=null)??"";a=l?`${t}:${w}:${l}`:`${t}:${w}`}let u=a,m=1;for(;i.has(u);)u=`${a}#${m++}`;i.add(u);let g=o.children;return Array.isArray(g)&&(g=Ie(g,u)),{...o,key:u,children:g}})}const r=e;let n=r.props?.key??r.key??t,s=r.children;return Array.isArray(s)&&(s=Ie(s,n)),{...r,key:n,children:s}}function Ze(e,t,r,n){const s=r.directives??{},i=ot(s,n,e,r.attrs),o={...t.props,...r.props,...i.props},a={...t.attrs,...r.attrs,...i.attrs},u=t.props??{},m=o,g=r?.isCustomElement??t?.isCustomElement??!1;let w=!1;for(const d in{...u,...m}){const v=u[d],b=m[d];if(v!==b)if(w=!0,d==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement))e.value!==b&&(e.value=b??"");else if(d==="checked"&&e instanceof HTMLInputElement)e.checked=!!b;else if(d.startsWith("on")&&typeof b=="function"){const c=it(d);typeof v=="function"&&oe.removeListener(e,c,v),oe.addListener(e,c,b)}else if(b==null)e.removeAttribute(d);else if((r?.isCustomElement??t?.isCustomElement??!1)||d in e)try{e[d]=b}catch{}else b===!1&&e.removeAttribute(d)}for(const[d,v]of Object.entries(i.listeners||{}))oe.addListener(e,d,v);const h=t.attrs??{},l=a;for(const d in{...h,...l}){const v=h[d],b=l[d];let c=v,p=b;if(v&&typeof v=="object"&&v.constructor?.name==="ReactiveState"&&(c=v.value),b&&typeof b=="object"&&b.constructor?.name==="ReactiveState"&&(p=b.value),c!==p)if(w=!0,p==null||p===!1){if(e.removeAttribute(d),d==="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(d==="checked"&&e instanceof HTMLInputElement)try{e.checked=!1}catch{}if(d==="disabled")try{e.disabled=!1}catch{}}else{if(d==="value"){if(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement){try{e.value=p??""}catch{e.setAttribute(d,String(p))}continue}else if(e instanceof HTMLSelectElement){try{e.value=p??""}catch{}continue}else if(e instanceof HTMLProgressElement){try{e.value=Number(p)}catch{}continue}}if(d==="checked"&&e instanceof HTMLInputElement){try{e.checked=!!p}catch{}continue}if(d==="style"){e.setAttribute(d,String(p));continue}const y=e.namespaceURI==="http://www.w3.org/2000/svg";if(g&&!y&&d.includes("-")){const C=nt(d);try{e[C]=p}catch{e.setAttribute(d,String(p))}}else if(!y&&d in e)try{e[d]=p}catch{e.setAttribute(d,String(p))}else e.setAttribute(d,String(p))}}if(g&&w)try{if(typeof e._applyProps=="function")try{e._applyProps(e._cfg)}catch{}typeof e.requestRender=="function"?e.requestRender():typeof e._render=="function"&&e._render(e._cfg)}catch{}}function Q(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const h=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(h.key=e.key),h}if(e.tag==="#anchor"){const h=e,l=Array.isArray(h.children)?h.children:[],d=document.createTextNode(""),v=document.createTextNode("");h.key!=null&&(d.key=`${h.key}:start`,v.key=`${h.key}:end`),h._startNode=d,h._endNode=v;const b=document.createDocumentFragment();b.appendChild(d);for(const c of l){const p=Q(c,t);b.appendChild(p)}return b.appendChild(v),b}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:s={},attrs:i={},directives:o={}}=e.props??{},a=ot(o,t,n,i),u={...s,...a.props},m={...i,...a.attrs},g=n.namespaceURI==="http://www.w3.org/2000/svg";for(const h in m){const l=m[h];if(!(typeof h!="string"||/\[object Object\]/.test(h))){if(typeof l=="boolean")l&&n.setAttribute(h,"");else if(l!=null)if(!g&&h==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement||n instanceof HTMLProgressElement))try{n instanceof HTMLProgressElement?n.value=Number(l):n.value=l??""}catch{n.setAttribute(h,String(l))}else if(!g&&h==="checked"&&n instanceof HTMLInputElement)try{n.checked=!!l}catch{n.setAttribute(h,String(l))}else if(!g&&h in n)try{n[h]=l}catch{n.setAttribute(h,String(l))}else if((e.props?.isCustomElement??!1)&&!g&&h.includes("-")){const v=nt(h);try{n[v]=l}catch{n.setAttribute(h,String(l))}}else n.setAttribute(h,String(l))}}for(const h in u){const l=u[h];if(!(typeof h!="string"||/\[object Object\]/.test(h)))if(h==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement)){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;n.value=d??""}else if(h==="checked"&&n instanceof HTMLInputElement){const d=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;n.checked=!!d}else if(h.startsWith("on")&&typeof l=="function")oe.addListener(n,it(h),l);else{if(h.startsWith("on")&&l===void 0)continue;if(l==null||l===!1)n.removeAttribute(h);else if((e.props?.isCustomElement??!1)||h in n)try{const v=typeof l=="object"&&l!==null&&typeof l.value<"u"?l.value:l;n[h]=v}catch{}}}for(const[h,l]of Object.entries(a.listeners||{}))oe.addListener(n,h,l);const w={...e,props:{...e.props,...a.props}};pe(w,n,r);try{if(typeof n._applyProps=="function")try{n._applyProps(n._cfg)}catch{}typeof n.requestRender=="function"?n.requestRender():typeof n._render=="function"&&n._render(n._cfg)}catch{}if(Array.isArray(e.children))for(const h of e.children)n.appendChild(Q(h,t,r));else typeof e.children=="string"&&(n.textContent=e.children);try{if(n instanceof HTMLSelectElement&&m&&m.hasOwnProperty("value"))try{n.value=m.value??""}catch{}}catch{}return n}function Nt(e,t,r,n,s){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const i=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 u=new Map;for(const l of i){const d=l.key;d!=null&&u.set(d,l)}const m=new Set;let g=e.firstChild;function w(l,d){let v=l;for(;v&&(m.add(v),v!==d);)v=v.nextSibling}function h(l,d,v,b){const c=[];let p=l.nextSibling;for(;p&&p!==d;)c.push(p),p=p.nextSibling;const y=Array.isArray(v)?v:[];if(b.some(k=>k&&k.key!=null)||y.some(k=>k&&k.key!=null)){const k=new Map,f=new Map;for(const _ of y)_&&_.key!=null&&k.set(_.key,_);for(const _ of c){const S=_.key;S!=null&&f.set(S,_)}const x=new Set;let A=l.nextSibling;for(const _ of b){let S;if(_.key!=null&&f.has(_.key)){const R=k.get(_.key);S=Ee(f.get(_.key),R,_,n),x.add(S),S!==A&&e.contains(S)&&e.insertBefore(S,A)}else S=Q(_,n),e.insertBefore(S,A),x.add(S);A=S.nextSibling}for(const _ of c)!x.has(_)&&e.contains(_)&&e.removeChild(_)}else{const k=Math.min(y.length,b.length);for(let f=0;f<k;f++){const x=y[f],A=b[f],_=Ee(c[f],x,A,n);_!==c[f]&&(e.insertBefore(_,c[f]),e.removeChild(c[f]))}for(let f=k;f<b.length;f++)e.insertBefore(Q(b[f],n),d);for(let f=k;f<c.length;f++)e.removeChild(c[f])}}for(const l of r){let d;if(l.tag==="#anchor"){const v=l.key,b=`${v}:start`,c=`${v}:end`;let p=u.get(b),y=u.get(c);const C=Array.isArray(l.children)?l.children:[];if(p||(p=document.createTextNode(""),p.key=b),y||(y=document.createTextNode(""),y.key=c),l._startNode=p,l._endNode=y,!e.contains(p)||!e.contains(y)){e.insertBefore(p,g);for(const k of C)e.insertBefore(Q(k,n),g);e.insertBefore(y,g)}else h(p,y,a.get(v)?.children,C);w(p,y),g=y.nextSibling;continue}if(l.key!=null&&u.has(l.key)){const v=a.get(l.key);d=Ee(u.get(l.key),v,l,n,s),m.add(d),d!==g&&e.contains(d)&&(g&&!e.contains(g)&&(g=null),e.insertBefore(d,g))}else d=Q(l,n,s),g&&!e.contains(g)&&(g=null),e.insertBefore(d,g),m.add(d);g=d.nextSibling}for(const l of i)!m.has(l)&&e.contains(l)&&(ce(l,s),e.removeChild(l))}function Ee(e,t,r,n,s){if(t&&typeof t!="string"&&t.props?.ref&&s&&ce(e,s),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:[],u=o._startNode??document.createTextNode(""),m=o._endNode??document.createTextNode("");o.key!=null&&(u.key=`${o.key}:start`,m.key=`${o.key}:end`),o._startNode=u,o._endNode=m;const g=document.createDocumentFragment();g.appendChild(u);for(const w of a){const h=Q(w,n);g.appendChild(h)}return g.appendChild(m),e.parentNode?.replaceChild(g,e),u}if(!r){ce(e,s);const o=document.createComment("removed");return e.parentNode?.replaceChild(o,e),o}if(!t||typeof t=="string"){ce(e,s);const o=Q(r,n,s);return pe(r,o,s),e.parentNode?.replaceChild(o,e),o}if(r.tag==="#anchor"){const o=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),u=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,u.key=`${r.key}:end`),r._startNode=a,r._endNode=u;const m=document.createDocumentFragment();m.appendChild(a);for(const g of o)m.appendChild(Q(g,n));return m.appendChild(u),e.parentNode?.replaceChild(m,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const o=e;return Ze(o,t.props||{},r.props||{},n),Nt(o,t.children,r.children,n,s),pe(r,o,s),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 Ze(a,t.props||{},r.props||{},n),pe(r,a,s),a}catch{}ce(e,s);const i=Q(r,n,s);return pe(r,i,s),e.parentNode?.replaceChild(i,e),i}function Wt(e,t,r,n){let s;Array.isArray(t)?t.length===1?(s=t[0],s&&typeof s=="object"&&s.key==null&&(s={...s,key:"__root__"})):s={tag:"div",key:"__root__",children:t}:(s=t,s&&typeof s=="object"&&s.key==null&&(s={...s,key:"__root__"})),s&&typeof s=="object"&&s.tag==="#anchor"&&(s={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[s]}),s=Ie(s,String(s.key??"root"));const i=e._prevVNode??null,o=e._prevDom??e.firstChild??null;let a;i&&o?typeof i!="string"&&typeof s!="string"&&i.tag===s.tag&&i.key===s.key?a=Ee(o,i,s,r,n):(a=Q(s,r,n),e.replaceChild(a,o)):(a=Q(s,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const u=[];for(let m=0;m<e.childNodes.length;m++){const g=e.childNodes[m];g!==a&&g.nodeName!=="STYLE"&&(ce(g,n),u.push(g))}u.forEach(m=>e.removeChild(m)),e._prevVNode=s,e._prevDom=a}function Se(e){if(typeof e=="string")return se(e);if(e.tag==="#text")return typeof e.children=="string"?se(e.children):"";if(e.tag==="#anchor")return(Array.isArray(e.children)?e.children.filter(Boolean):[]).map(Se).join("");let t="";e.props&&e.props.attrs&&(t=Object.entries(e.props.attrs).map(([s,i])=>` ${s}="${se(String(i))}"`).join(""));let r="";e.props&&(r=Object.entries(e.props).filter(([s])=>s!=="attrs"&&s!=="directives"&&s!=="ref"&&s!=="key").map(([s,i])=>` ${s}="${se(String(i))}"`).join(""));const n=Array.isArray(e.children)?e.children.filter(Boolean).map(Se).join(""):typeof e.children=="string"?se(e.children):e.children?Se(e.children):"";return`<${e.tag}${t}${r}>${n}</${e.tag}>`}function at(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function ct(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let ke=null;function Ge(){return ke||(ke=new CSSStyleSheet,ke.replaceSync(ct(zt))),ke}function Dt(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const zt=at`
|
|
2
5
|
:host, *, ::before, ::after {
|
|
3
6
|
all: isolate;
|
|
4
7
|
box-sizing: border-box;
|
|
@@ -56,33 +59,36 @@
|
|
|
56
59
|
sup { top: -.5em }
|
|
57
60
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
58
61
|
[hidden] { display: none }
|
|
59
|
-
`,lt={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"}},ft=Object.fromEntries(Object.entries(lt).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,i])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${i})`]))])),me={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;"},ut="0.25rem",je={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 N(e,t){let r=0,i=0;for(let n=0;n<e.length;n++){const o=e[n];if(o==="[")r++;else if(o==="]"&&r>0)r--;else if(o==="(")i++;else if(o===")"&&i>0)i--;else if(r===0&&i===0&&(o===">"||o==="+"||o==="~"||o===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const pt={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${N(e,":hover")}{${t}}`,focus:(e,t)=>`${N(e,":focus")}{${t}}`,active:(e,t)=>`${N(e,":active")}{${t}}`,disabled:(e,t)=>`${N(e,":disabled")}{${t}}`,visited:(e,t)=>`${N(e,":visited")}{${t}}`,checked:(e,t)=>`${N(e,":checked")}{${t}}`,first:(e,t)=>`${N(e,":first-child")}{${t}}`,last:(e,t)=>`${N(e,":last-child")}{${t}}`,odd:(e,t)=>`${N(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${N(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${N(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${N(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}}`},ye={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)"},be=["sm","md","lg","xl","2xl"];function we(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("-"),o=i[i.length-1],s=parseFloat(o);if(Number.isNaN(s)||!je[n])return null;const a=t?"-":"";return je[n].map(f=>`${f}:calc(${a}${ut} * ${s});`).join("")}function Le(e){const t=e.replace("#",""),r=parseInt(t,16),i=r>>16&255,n=r>>8&255,o=r&255;return`${i} ${n} ${o}`}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,o=ft[i]?.[n];if(!o)return null;if(r==="shadow")return`--ce-shadow-color:${o};`;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}:${o};`:null}function ht(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 xe(e){const{base:t,opacity:r}=ht(e),i=dt(t);if(i){if(r!==void 0){const o=/#([0-9a-f]{6})/i.exec(i);if(o){const s=Le(o[0]);return i.replace(/#([0-9a-f]{6})/i,`rgb(${s} / ${r})`)}}return i}const n=ue(t);if(n&&r!==void 0){const o=/#([0-9a-f]{6})/i.exec(n);if(o){const s=Le(o[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${s} / ${r})`)}}return n}function ve(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 ue(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 o=n[1].trim();let s=n[2].trim();return s=s.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),s=s.replace(/^'([^']*)'$/g,'"$1"'),`${o}:${s};`}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 o={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 s=o[i]??i.replace(/_/g,"-");if(s&&n)return`${s}:${n};`}return null}function gt(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 mt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function yt(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 Re=new Map,bt=16;function wt(e){const t=Date.now(),r=Re.get(e);if(r&&t-r.timestamp<bt)return r.css;const i=yt(e),n=new Set(i),o=[],s=[],a=[],f=[],p={};function h(d,g=!1){const m=(g?"dark|":"")+d;if(m in p)return p[m];const x=w(d,g);return p[m]=x,x}function C(d){const g=d.some(x=>be.includes(x)),m=d.includes("dark");return d.length===0?1:!g&&!m?2:g&&!m?3:4}function u(d){const g=[];let m="",x=0,l=0;for(let b=0;b<d.length;b++){const y=d[b];y==="["?x++:y==="]"&&x>0?x--:y==="("?l++:y===")"&&l>0&&l--,y===":"&&x===0&&l===0?(g.push(m),m=""):m+=y}return m&&g.push(m),g}function c(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 m=u(d);let x=!1;const l=m.find(k=>(k.startsWith("!")&&(x=!0,k=k.slice(1)),me[k]||we(k)||ve(k)||xe(k)||ue(k)));if(!l)return null;const b=l.replace(/^!/,""),y=me[b]??we(b)??ve(b)??xe(b)??ue(b);if(!y)return null;const S=m.indexOf(l);let E=S>=0?m.slice(0,S):[];g&&(E=E.filter(k=>k!=="dark"));const $=`.${mt(d)}`,A="__SUBJECT__",_=x?y.replace(/;$/," !important;"):y;let T=A;const B=[];for(const k of E)k.startsWith("group-")?(T=`.group:${k.slice(6)} ${T}`,B.push(k)):k.startsWith("peer-")&&(T=T.replace(A,`.peer:${k.slice(5)}~${A}`),B.push(k));E=E.filter(k=>!B.includes(k));const Z=[],te=[];let M=null;for(const k of E){if(k==="dark"||be.includes(k))continue;const P=gt(k);if(P){M=P;continue}const R=c(k);if(R){M?te.push(R):Z.push(R);continue}const O=pt[k];typeof O=="function"&&(T=O(T,_).split("{")[0])}function U(k,P){if(!P)return k;let R=0,O=0;if(k.length&&(k[0]===">"||k[0]==="+"||k[0]==="~"||k[0]===" ")){let j=1;for(;j<k.length&&k[j]===" ";)j++;for(;j<k.length;j++){const L=k[j];if(L==="["?R++:L==="]"&&R>0?R--:L==="("?O++:L===")"&&O>0&&O--,R===0&&O===0&&(k[j]===">"||k[j]==="+"||k[j]==="~"||k[j]===" "))return k.slice(0,j)+P+k.slice(j)}return k+P}for(let j=0;j<k.length;j++){const L=k[j];if(L==="["?R++:L==="]"&&R>0?R--:L==="("?O++:L===")"&&O>0&&O--,R===0&&O===0&&(L===">"||L==="+"||L==="~"||L===" "))return k.slice(0,j)+P+k.slice(j)}return k+P}const q=Z.join(""),I=te.join("");if(M)if(M.includes("&")){const k=M.indexOf("&"),P=M.slice(0,k),R=M.slice(k+1),O=A+q,j=T;if(Z.length===0)T=j.replace(A,P+O+I+R);else{const L=U(R,I);T=j.replace(A,P+O+L)}}else T=T.replace(A,`${M}${A+q}`),I&&(T=T.replace(A,`${A}${I}`));else T=A+q+I;T=T.replace(new RegExp(A,"g"),$);let z=`${T}{${_}}`;const H=E.filter(k=>be.includes(k)),K=H.length?H[H.length-1]:null,re=E.includes("dark");return g&&K?z=`@media (prefers-color-scheme: dark) and ${ye[K]}{${z}}`:g?z=`@media (prefers-color-scheme: dark){${z}}`:re&&K?z=`@media (prefers-color-scheme: dark) and ${ye[K]}{${z}}`:re?z=`@media (prefers-color-scheme: dark){${z}}`:K&&(z=`@media ${ye[K]}{${z}}`),z}for(const d of n){const g=u(d),m=g.find(y=>me[y]||we(y)||ve(y)||xe(y)||ue(y));if(!m)continue;const x=g.indexOf(m),l=x>=0?g.slice(0,x):[],b=C(l);if(b===4){const y=h(d,!0);y&&f.push(y)}else{const y=h(d);y&&(b===1?o.push(y):b===2?s.push(y):b===3&&a.push(y))}}const v=[...o,...s,...a,...f].join("");return Re.set(e,{css:v,timestamp:t}),v}const ie=[];function xt(e,t,r,i,n,o,s,a){if(e){ie.push(r);try{if(t.loadingTemplate&&r.isLoading){X(e,t.loadingTemplate(r),r,i,n);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&X(e,t.errorTemplate(r.error,r),r,i,n);return}const f=t.render(r);if(f instanceof Promise){o(!0),f.then(p=>{o(!1),s(null),X(e,p,r,i,n),a(e.innerHTML)}).catch(p=>{o(!1),s(p),t.errorTemplate&&X(e,t.errorTemplate(p,r),r,i,n)}),t.loadingTemplate&&X(e,t.loadingTemplate(r),r,i,n);return}X(e,f,r,i,n),a(e.innerHTML)}finally{ie.pop()}}}function X(e,t,r,i,n){e&&(ot(e,Array.isArray(t)?t:[t],r,i),n(e.innerHTML))}function vt(e,t,r,i,n,o,s){if(o!==null&&clearTimeout(o),Date.now()-t<16){if(n(r+1),r>10){s(null);return}}else n(0);const f=setTimeout(()=>{i(Date.now()),e(),s(null)},0);s(f)}function kt(e,t,r,i,n,o){if(!e)return;const s=wt(i);if(!t.style&&(!s||s.trim()==="")){o(null),e.adoptedStyleSheets=[Te()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let f=at(`${a}
|
|
60
|
-
|
|
61
|
-
`);f=ze(f);let p=n;p||(p=new CSSStyleSheet),(p.cssRules.length===0||p.toString()!==f)&&p.replaceSync(f),e.adoptedStyleSheets=[Te(),p],o(p)}const he=new Map,Me=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[Me]||(e[Me]=he)}function $e(e,t,r){let i=Q(e);i.includes("-")||(i=`cer-${i}`);let n;typeof t=="function"?n={...r,render:t}:n=t,typeof n.onError!="function"&&(n.onError=(o,s)=>{console.error(`[${i}] Error:`,o,s)});try{const o=new Set(["refs","requestRender","error","hasError","isLoading","emit"]),s=[];if(n.state&&typeof n.state=="object"&&Object.keys(n.state).forEach(a=>{o.has(a)&&s.push(a)}),n.props&&typeof n.props=="object"&&Object.keys(n.props).forEach(a=>{o.has(a)&&s.push(a)}),n.computed&&typeof n.computed=="object"&&Object.keys(n.computed).forEach(a=>{o.has(a)&&s.push(a)}),s.length>0){const a=Array.from(new Set(s));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(he.set(i,n),typeof window<"u")if(!customElements.get(i))customElements.define(i,St(i,n));else try{document.querySelectorAll(i).forEach(o=>{try{typeof o._cfg<"u"&&(o._cfg=n),typeof o._render=="function"&&o._render(n)}catch{}})}catch{}}function St(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=he.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,o,s)=>{const a=new CustomEvent(n,{detail:o,bubbles:!0,composed:!0,...s||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const i=he.get(e)||t;Object.keys(i).forEach(n=>{const o=i[n];typeof o=="function"&&(this.context[n]=(...s)=>o(...s,this.context))}),this._applyComputed(i),this._initializing=!1,this._initWatchers(i),this._render(i)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),Ye(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{Qe(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),Xe(t,r,i,n,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(Q):[]}_applyComputed(r){this._runLogicWithinErrorBoundary(t,()=>{r.computed&&Object.entries(r.computed).forEach(([i,n])=>{Object.defineProperty(this.context,i,{get:()=>{const o=n(this.context);return J(o)},enumerable:!0})})})}_render(r){this._runLogicWithinErrorBoundary(r,()=>{xt(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,()=>{vt(()=>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(o,s=""){return Array.isArray(o)?new Proxy(o,{get(a,f,p){const h=Reflect.get(a,f,p);return typeof h=="function"&&typeof f=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(f)?function(...u){const c=h.apply(a,u);if(!n._initializing){const w=s||"root";n._triggerWatchers(w,a),n._render(r)}return c}:h},set(a,f,p){if(a[f]=p,!n._initializing){const h=s?`${s}.${String(f)}`:String(f);n._triggerWatchers(h,p),n._render(r)}return!0},deleteProperty(a,f){if(delete a[f],!n._initializing){const p=s?`${s}.${String(f)}`:String(f);n._triggerWatchers(p,void 0),n._render(r)}return!0}}):o&&typeof o=="object"?(Object.keys(o).forEach(a=>{const f=s?`${s}.${a}`:a;o[a]=i(o[a],f)}),new Proxy(o,{set(a,f,p){const h=s?`${s}.${String(f)}`:String(f);return a[f]=i(p,h),n._initializing||(n._triggerWatchers(h,a[f]),n._render(r)),!0},get(a,f,p){return Reflect.get(a,f,p)}})):o};const n=this;return i({...r.state})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{Ge(this.context,this._watchers,r.watch||{})})}_triggerWatchers(r,i){Ze(this.context,this._watchers,r,i)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Ve(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 ne(e,t={},r,i){const n=i??t.key;return{tag:e,key:n,props:t,children:r}}function pe(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function ae(e){return typeof e=="object"&&e!==null&&"tag"in e&&!pe(e)}function _t(e,t){return e.key!=null?e:{...e,key:t}}function $t(e,t=[],r={}){const i={},n={},o={},s=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let f;for(;f=a.exec(e);){const p=f[1],h=f[2],C=(f[4]||f[6])??"",u=C.match(/^{{(\d+)}}$/);let c=u?t[Number(u[1])]??null:C;u||(c==="true"?c=!0:c==="false"?c=!1:c==="null"?c=null:isNaN(Number(c))||(c=Number(c)));const w=["model","bind","show","class","style"];if(p===":"){const[v,d]=h.split(":"),[g,...m]=v.split(".");if(w.includes(g)){const x=[...m],l=g==="model"&&d?`model:${d}`:g;o[l]={value:c,modifiers:x,arg:d}}else n[h]=c,s.push(h)}else if(p==="@"){const v="on"+h.charAt(0).toUpperCase()+h.slice(1);i[v]=typeof c=="function"?c:typeof r[c]=="function"?r[c]:void 0}else h==="ref"?i.ref=c:n[h]=c}return{props:i,attrs:n,directives:o,bound:s}}function Et(e,t,r){const i=ie.length>0?ie[ie.length-1]:void 0,n=r??i;function o(l,b){return ne("#text",{},l,b)}let s="";for(let l=0;l<e.length;l++)s+=e[l],l<t.length&&(s+=`{{${l}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,f=[];let p,h=[],C=null,u={},c,w=0,v=[];function d(l){!l||typeof l!="object"||pe(l)||(l.props||l.attrs?(l.props&&(u.props||(u.props={}),Object.assign(u.props,l.props)),l.attrs&&(u.attrs||(u.attrs={}),Object.keys(l.attrs).forEach(b=>{if(b==="style"&&u.attrs.style){const y=u.attrs.style.replace(/;?\s*$/,""),S=l.attrs.style.replace(/^;?\s*/,"");u.attrs.style=y+"; "+S}else if(b==="class"&&u.attrs.class){const y=u.attrs.class.trim().split(/\s+/).filter(Boolean),S=l.attrs.class.trim().split(/\s+/).filter(Boolean),E=[...new Set([...y,...S])];u.attrs.class=E.join(" ")}else u.attrs[b]=l.attrs[b]}))):(u.props||(u.props={}),Object.assign(u.props,l)))}function g(l,b){const y=C?h:v;if(pe(l)){const S=l.key??b;let E=l.children;y.push({...l,key:S,children:E});return}if(ae(l)){y.push(_t(l,void 0));return}if(Array.isArray(l)){if(l.length===0)return;for(let S=0;S<l.length;S++){const E=l[S];pe(E)||ae(E)||Array.isArray(E)?g(E,`${b}-${S}`):E!==null&&typeof E=="object"?d(E):y.push(o(String(E),`${b}-${S}`))}return}if(l!==null&&typeof l=="object"){d(l);return}y.push(o(String(l),b))}const m=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;p=a.exec(s);)if(p[1]){const l=p[1],b=p[0][1]==="/",y=p[0][p[0].length-2]==="/"||m.has(l),{props:S,attrs:E,directives:$,bound:A}=$t(p[2]||"",t,n),_={props:{},attrs:{}};for(const T in S)_.props[T]=S[T];for(const T in E)_.attrs[T]=E[T];if(_.attrs&&Object.prototype.hasOwnProperty.call(_.attrs,"key")&&!(_.props&&Object.prototype.hasOwnProperty.call(_.props,"key")))try{_.props.key=_.attrs.key}catch{}try{const T={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"]},B=l.toLowerCase(),Z=T[B]??[];if(_.attrs)for(const M of Z)A&&A.includes(M)&&M in _.attrs&&!(_.props&&M in _.props)&&(_.props[M]=_.attrs[M],delete _.attrs[M]);if((l.includes("-")||!!n?.__customElements?.has?.(l))&&A&&_.attrs){const M=new Set(["id","name","data-key","key"]);for(const U of A)if(U in _.attrs&&!(_.props&&U in _.props)){const q=U.includes("-")?U.split("-").map((I,z)=>z===0?I:I.charAt(0).toUpperCase()+I.slice(1)).join(""):U;_.props[q]=_.attrs[U],M.has(U)||delete _.attrs[U]}_.isCustomElement=!0}}catch{}if($&&Object.keys($).some(T=>T==="model"||T.startsWith("model:")))try{const T=Symbol.for("cer.registry"),B=globalThis[T],Z=!!(B&&typeof B.has=="function"&&B.has(l)),te=!!(n&&(n.__customElements instanceof Set&&n.__customElements.has(l)||Array.isArray(n.__isCustomElements)&&n.__isCustomElements.includes(l)));if(!!(l.includes("-")||te||Z))for(const q of Object.keys($)){if(q!=="model"&&!q.startsWith("model:"))continue;const I=$[q],z=I.arg??(q.includes(":")?q.split(":",2)[1]:void 0),H=I.value,K=z??"modelValue",re=W,k=ce,P=n?n._state||n:void 0;let R;typeof H=="string"&&n?R=re(P,H):R=H,_.props[K]=R;try{const L=Q(K);_.attrs||(_.attrs={}),R!==void 0&&(_.attrs[L]=R)}catch{}_.isCustomElement=!0;const O=`update:${Q(K)}`,j="on"+O.charAt(0).toUpperCase()+O.slice(1);_.props[j]=function(L){const se=L.detail!==void 0?L.detail:L.target?L.target.value:void 0;if(!P)return;const ge=re(P,typeof H=="string"?H:String(H));(Array.isArray(se)&&Array.isArray(ge)?JSON.stringify([...se].sort())!==JSON.stringify([...ge].sort()):se!==ge)&&(k(P,typeof H=="string"?H:String(H),se),n?.requestRender?n.requestRender():n?._requestRender&&n._requestRender())},delete $[q]}}catch{}if(Object.keys($).length>0&&(_.directives={...$}),b){const T=ne(C,u,h.length===1&&ae(h[0])&&h[0].tag==="#text"?typeof h[0].children=="string"?h[0].children:"":h.length?h:void 0,c),B=f.pop();B?(C=B.tag,u=B.props,c=B.key,h=B.children,h.push(T)):(v.push(T),C=null,u={},c=void 0,h=[])}else y?C?h.push(ne(l,_,void 0,void 0)):v.push(ne(l,_,void 0,void 0)):(C&&f.push({tag:C,props:u,children:h,key:c}),C=l,u=_,h=[])}else if(typeof p[3]<"u"){const l=Number(p[3]),b=t[l],y=`interp-${l}`;g(b,y)}else if(p[4]){const l=p[4],b=C?h:v,y=l.split(/({{\d+}})/);for(const S of y){if(!S)continue;const E=S.match(/^{{(\d+)}}$/);if(E){const $=Number(E[1]),A=t[$],_=`interp-${$}`;g(A,_)}else{const $=`text-${w++}`;b.push(o(S,$))}}}const x=v.filter(l=>ae(l)&&l.tag==="#text"?typeof l.children=="string"&&l.children.trim()!=="":!0);return x.length===1?x[0]:x.length>1?x:ne("div",{},"","fallback-root")}function G(e,...t){const r=t[t.length-1],i=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return Et(e,t,i)}const Ee=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},F=(e,t)=>{for(const r of e){const i=[],n=r.path.replace(/:[^/]+/g,a=>(i.push(a.slice(1)),"([^/]+)")),o=new RegExp(`^${n}$`),s=t.match(o);if(s){const a={};return i.forEach((f,p)=>{a[f]=s[p+1]}),{route:r,params:a}}}return{route:null,params:{}}},ke={};async function He(e){if(e.component)return e.component;if(e.load){if(ke[e.path])return ke[e.path];try{const t=await e.load();return ke[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 qe(e){const{routes:t,base:r="",initialUrl:i}=e;let n,o,s,a,f,p,h;const C=async(v,d)=>{const g=t.find(m=>F([m],v.path).route!==null);if(g?.beforeEnter)try{const m=await g.beforeEnter(v,d);return typeof m=="string"?(await w(m,!0),!1):m!==!1}catch(m){return console.error("beforeEnter error",m),!1}return!0},u=async(v,d)=>{const g=t.find(m=>F([m],v.path).route!==null);if(g?.onEnter)try{const m=await g.onEnter(v,d);return typeof m=="string"?(await w(m,!0),!1):m!==!1}catch(m){return console.error("onEnter error",m),!1}return!0},c=(v,d)=>{const g=t.find(m=>F([m],v.path).route!==null);if(g?.afterEnter)try{g.afterEnter(v,d)}catch(m){console.error("afterEnter error",m)}},w=async(v,d=!1)=>{try{const g={path:v.replace(r,"")||"/",query:{}},m=F(t,g.path);if(!m)throw new Error(`No route found for ${g.path}`);const x=s.getState(),l={path:g.path,params:m.params,query:g.query};if(!await C(l,x)||!await u(l,x))return;typeof window<"u"&&typeof document<"u"&&(d?window.history.replaceState({},"",r+v):window.history.pushState({},"",r+v)),s.setState(l),c(l,x)}catch(g){console.error("Navigation error:",g)}};if(typeof window<"u"&&typeof document<"u"){n=()=>{const d=new URL(window.location.href),g=d.pathname.replace(r,"")||"/",m=Ee(d.search);return{path:g,query:m}},o=n();const v=F(t,o.path);s=Se({path:o.path,params:v.params,query:o.query}),a=async(d=!1)=>{const g=n();await w(g.path,d)},window.addEventListener("popstate",()=>a(!0)),f=d=>w(d,!1),p=d=>w(d,!0),h=()=>window.history.back()}else{n=()=>{const g=new URL(i||"/","http://localhost"),m=g.pathname.replace(r,"")||"/",x=Ee(g.search);return{path:m,query:x}},o=n();const v=F(t,o.path);s=Se({path:o.path,params:v.params,query:o.query}),a=async()=>{const g=n();await d(g.path)};const d=async g=>{try{const m={path:g.replace(r,"")||"/",query:{}},x=F(t,m.path);if(!x)throw new Error(`No route found for ${m.path}`);const l=s.getState(),b={path:m.path,params:x.params,query:m.query},y=t.find(S=>F([S],b.path).route!==null);if(y?.beforeEnter)try{const S=await y.beforeEnter(b,l);if(typeof S=="string"){await d(S);return}if(S===!1)return}catch{return}if(y?.onEnter)try{const S=await y.onEnter(b,l);if(typeof S=="string"){await d(S);return}if(S===!1)return}catch{return}if(s.setState(b),y?.afterEnter)try{y.afterEnter(b,l)}catch{}}catch{}};f=async g=>d(g),p=async g=>d(g),h=()=>{}}return{store:s,push:f,replace:p,back:h,subscribe:s.subscribe,matchRoute:v=>F(t,v),getCurrent:()=>s.getState(),resolveRouteComponent:He}}function Ct(e,t){return F(e,t)}function At(e){const t=qe(e);return $e("router-view",{async render(){if(!t)return G`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:i}=r,n=t.matchRoute(i);if(!n.route)return G`<div>Not found</div>`;try{const o=await t.resolveRouteComponent(n.route);if(typeof o=="string")return{tag:o,props:{},children:[]};if(typeof o=="function"){const s=o(),a=s instanceof Promise?await s:s;return typeof a=="string"?{tag:a,props:{},children:[]}:a}return G`<div>Invalid route component</div>`}catch{return G`<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:Ce`
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
part="button"
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
62
|
+
`,It={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"}},Ht=Object.fromEntries(Object.entries(It).map(([e,t])=>[e,Object.fromEntries(Object.entries(t).map(([r,n])=>[r,`var(--color-${e}${r==="DEFAULT"?"":`-${r}`}, ${n})`]))])),Oe={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;"},Bt="0.25rem",Qe={m:["margin"],mx:["margin-inline"],my:["margin-block"],mt:["margin-top"],mr:["margin-right"],mb:["margin-bottom"],ml:["margin-left"],p:["padding"],px:["padding-inline"],py:["padding-block"],pt:["padding-top"],pr:["padding-right"],pb:["padding-bottom"],pl:["padding-left"],inset:["inset"],"inset-x":["inset-inline"],"inset-y":["inset-block"],h:["height"],w:["width"],"min-h":["min-height"],"min-w":["min-width"],"max-h":["max-height"],"max-w":["max-width"],top:["top"],bottom:["bottom"],left:["left"],right:["right"],gap:["gap"],"gap-x":["column-gap"],"gap-y":["row-gap"]};function G(e,t){let r=0,n=0;for(let s=0;s<e.length;s++){const i=e[s];if(i==="[")r++;else if(i==="]"&&r>0)r--;else if(i==="(")n++;else if(i===")"&&n>0)n--;else if(r===0&&n===0&&(i===">"||i==="+"||i==="~"||i===" "))return e.slice(0,s)+t+e.slice(s)}return e+t}const Ut={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${G(e,":hover")}{${t}}`,focus:(e,t)=>`${G(e,":focus")}{${t}}`,active:(e,t)=>`${G(e,":active")}{${t}}`,disabled:(e,t)=>`${G(e,":disabled")}{${t}}`,visited:(e,t)=>`${G(e,":visited")}{${t}}`,checked:(e,t)=>`${G(e,":checked")}{${t}}`,first:(e,t)=>`${G(e,":first-child")}{${t}}`,last:(e,t)=>`${G(e,":last-child")}{${t}}`,odd:(e,t)=>`${G(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${G(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${G(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${G(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},Pe={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)"},Le=["sm","md","lg","xl","2xl"];function je(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const s=n.slice(0,-1).join("-"),i=n[n.length-1],o=parseFloat(i);if(Number.isNaN(o)||!Qe[s])return null;const a=t?"-":"";return Qe[s].map(u=>`${u}:calc(${a}${Bt} * ${o});`).join("")}function Xe(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,s=r>>8&255,i=r&255;return`${n} ${s} ${i}`}function qt(e){const t=/^(bg|text|border|decoration|shadow|outline|caret|accent|fill|stroke)-([a-z]+)-?(\d{2,3}|DEFAULT)?$/.exec(e);if(!t)return null;const[,r,n,s="DEFAULT"]=t,i=Ht[n]?.[s];if(!i)return null;if(r==="shadow")return`--ce-shadow-color:${i};`;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}:${i};`:null}function Ft(e){const[t,r]=e.split("/");if(!r)return{base:t};const n=parseInt(r,10);return isNaN(n)||n<0||n>100?{base:t}:{base:t,opacity:n/100}}function Me(e){const{base:t,opacity:r}=Ft(e),n=qt(t);if(n){if(r!==void 0){const i=/#([0-9a-f]{6})/i.exec(n);if(i){const o=Xe(i[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return n}const s=$e(t);if(s&&r!==void 0){const i=/#([0-9a-f]{6})/i.exec(s);if(i){const o=Xe(i[0]);return s.replace(/#([0-9a-f]{6})/i,`rgb(${o} / ${r})`)}}return s}function Ne(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 $e(e){if(e.startsWith("[")&&e.endsWith("]")&&!e.includes("-[")){const s=e.slice(1,-1).trim().match(/^([a-zA-Z][a-zA-Z0-9-]*)\s*:(.*)$/);if(s){const i=s[1].trim();let o=s[2].trim();return o=o.replace(/url\('\s*([^']*?)\s*'\)/g,'url("$1")'),o=o.replace(/^'([^']*)'$/g,'"$1"'),`${i}:${o};`}return null}const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let s=e.slice(t+2,-1);s=s.replace(/_/g," ");const i={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(n==="rotate")return`transform:rotate(${s});`;const o=i[n]??n.replace(/_/g,"-");if(o&&s)return`${o}:${s};`}return null}function Kt(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 Vt(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Jt(e){const t=/class\s*=\s*(['"])(.*?)\1/g,r=[];let n;for(;n=t.exec(e);){const s=n[2].split(/\s+/).filter(Boolean);s.length&&r.push(...s)}return r.filter(Boolean)}const Ye=new Map,Zt=16;function Gt(e){const t=Date.now(),r=Ye.get(e);if(r&&t-r.timestamp<Zt)return r.css;const n=Jt(e),s=new Set(n),i=[],o=[],a=[],u=[],m={};function g(b,c=!1){const p=(c?"dark|":"")+b;if(p in m)return m[p];const y=d(b,c);return m[p]=y,y}function w(b){const c=b.some(y=>Le.includes(y)),p=b.includes("dark");return b.length===0?1:!c&&!p?2:c&&!p?3:4}function h(b){const c=[];let p="",y=0,C=0;for(let k=0;k<b.length;k++){const f=b[k];f==="["?y++:f==="]"&&y>0?y--:f==="("?C++:f===")"&&C>0&&C--,f===":"&&y===0&&C===0?(c.push(p),p=""):p+=f}return p&&c.push(p),c}function l(b){switch(b){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 d(b,c=!1){const p=h(b);let y=!1;const C=p.find(E=>(E.startsWith("!")&&(y=!0,E=E.slice(1)),Oe[E]||je(E)||Ne(E)||Me(E)||$e(E)));if(!C)return null;const k=C.replace(/^!/,""),f=Oe[k]??je(k)??Ne(k)??Me(k)??$e(k);if(!f)return null;const x=p.indexOf(C);let A=x>=0?p.slice(0,x):[];c&&(A=A.filter(E=>E!=="dark"));const _=`.${Vt(b)}`,S="__SUBJECT__",R=y?f.replace(/;$/," !important;"):f;let T=S;const $=[];for(const E of A)E.startsWith("group-")?(T=`.group:${E.slice(6)} ${T}`,$.push(E)):E.startsWith("peer-")&&(T=T.replace(S,`.peer:${E.slice(5)}~${S}`),$.push(E));A=A.filter(E=>!$.includes(E));const P=[],U=[];let J=null;for(const E of A){if(E==="dark"||Le.includes(E))continue;const q=Kt(E);if(q){J=q;continue}const z=l(E);if(z){J?U.push(z):P.push(z);continue}const D=Ut[E];typeof D=="function"&&(T=D(T,R).split("{")[0])}function be(E,q){if(!q)return E;let z=0,D=0;if(E.length&&(E[0]===">"||E[0]==="+"||E[0]==="~"||E[0]===" ")){let O=1;for(;O<E.length&&E[O]===" ";)O++;for(;O<E.length;O++){const I=E[O];if(I==="["?z++:I==="]"&&z>0?z--:I==="("?D++:I===")"&&D>0&&D--,z===0&&D===0&&(E[O]===">"||E[O]==="+"||E[O]==="~"||E[O]===" "))return E.slice(0,O)+q+E.slice(O)}return E+q}for(let O=0;O<E.length;O++){const I=E[O];if(I==="["?z++:I==="]"&&z>0?z--:I==="("?D++:I===")"&&D>0&&D--,z===0&&D===0&&(I===">"||I==="+"||I==="~"||I===" "))return E.slice(0,O)+q+E.slice(O)}return E+q}const K=P.join(""),L=U.join("");if(J)if(J.includes("&")){const E=J.indexOf("&"),q=J.slice(0,E),z=J.slice(E+1),D=S+K,O=T;if(P.length===0)T=O.replace(S,q+D+L+z);else{const I=be(z,L);T=O.replace(S,q+D+I)}}else T=T.replace(S,`${J}${S+K}`),L&&(T=T.replace(S,`${S}${L}`));else T=S+K+L;T=T.replace(new RegExp(S,"g"),_);let M=`${T}{${R}}`;const V=A.filter(E=>Le.includes(E)),Z=V.length?V[V.length-1]:null,W=A.includes("dark");return c&&Z?M=`@media (prefers-color-scheme: dark) and ${Pe[Z]}{${M}}`:c?M=`@media (prefers-color-scheme: dark){${M}}`:W&&Z?M=`@media (prefers-color-scheme: dark) and ${Pe[Z]}{${M}}`:W?M=`@media (prefers-color-scheme: dark){${M}}`:Z&&(M=`@media ${Pe[Z]}{${M}}`),M}for(const b of s){const c=h(b),p=c.find(f=>Oe[f]||je(f)||Ne(f)||Me(f)||$e(f));if(!p)continue;const y=c.indexOf(p),C=y>=0?c.slice(0,y):[],k=w(C);if(k===4){const f=g(b,!0);f&&u.push(f)}else{const f=g(b);f&&(k===1?i.push(f):k===2?o.push(f):k===3&&a.push(f))}}const v=[...i,...o,...a,...u].join("");return Ye.set(e,{css:v,timestamp:t}),v}const he=[];function Qt(e,t,r,n,s,i,o,a){if(e){he.push(r);try{const u=t.render(r);if(u instanceof Promise){i(!0),u.then(m=>{i(!1),o(null),et(e,m,r,n,s),a(e.innerHTML)}).catch(m=>{i(!1),o(m)});return}et(e,u,r,n,s),a(e.innerHTML)}finally{he.pop()}}}function et(e,t,r,n,s){e&&(Wt(e,Array.isArray(t)?t:[t],r,n),s(e.innerHTML))}function Xt(e,t,r,n,s,i,o){if(i!==null&&clearTimeout(i),Date.now()-t<16){if(s(r+1),r===15)console.warn(`⚠️ Component is re-rendering rapidly. This might indicate:
|
|
63
|
+
Common causes:
|
|
64
|
+
• Event handler calling a function immediately: @click="\${fn()}" should be @click="\${fn}"
|
|
65
|
+
• State modification during render
|
|
66
|
+
• Missing dependencies in computed/watch
|
|
67
|
+
Component rendering will be throttled to prevent browser freeze.`);else if(r>20){console.error(`🛑 Infinite loop detected in component render:
|
|
68
|
+
• This might be caused by state updates during render
|
|
69
|
+
• Ensure all state modifications are done in event handlers or effects
|
|
70
|
+
Stopping runaway component render to prevent browser freeze`),o(null);return}}else s(0);const m=setTimeout(()=>{n(Date.now()),e(),o(null)},r>10?100:0);o(m)}function Yt(e,t,r,n,s){if(!e)return;const i=Gt(r);if((!i||i.trim()==="")&&!t._computedStyle){s(null),e.adoptedStyleSheets=[Ge()];return}let o="";t._computedStyle&&(o=t._computedStyle);let a=Dt(`${o}
|
|
71
|
+
${i}
|
|
72
|
+
`);a=ct(a);let u=n;u||(u=new CSSStyleSheet),(u.cssRules.length===0||u.toString()!==a)&&u.replaceSync(a),e.adoptedStyleSheets=[Ge(),u],s(u)}let N=null;function er(e){N=e}function tr(){N=null}function rr(){if(!N)throw new Error("useEmit must be called during component render");const e=N.emit;return(t,r)=>e(t,r)}function me(e){e._hookCallbacks||Object.defineProperty(e,"_hookCallbacks",{value:{},writable:!0,enumerable:!1,configurable:!1})}function nr(e){if(!N)throw new Error("useOnConnected must be called during component render");me(N),N._hookCallbacks.onConnected=e}function sr(e){if(!N)throw new Error("useOnDisconnected must be called during component render");me(N),N._hookCallbacks.onDisconnected=e}function ir(e){if(!N)throw new Error("useOnAttributeChanged must be called during component render");me(N),N._hookCallbacks.onAttributeChanged=e}function or(e){if(!N)throw new Error("useOnError must be called during component render");me(N),N._hookCallbacks.onError=e}function ar(e){if(!N)throw new Error("useStyle must be called during component render");me(N);try{const t=e();Object.defineProperty(N,"_computedStyle",{value:t,writable:!0,enumerable:!1,configurable:!0})}catch(t){console.warn("Error in useStyle callback:",t),Object.defineProperty(N,"_computedStyle",{value:"",writable:!0,enumerable:!1,configurable:!0})}}const Re=new Map,tt=Symbol.for("cer.registry");if(typeof window<"u"){const e=globalThis;e[tt]||(e[tt]=Re)}function cr(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=Re.get(e)||t,this._componentId=`${e}-${Math.random().toString(36).substr(2,9)}`;const r=this._initContext(t);Object.defineProperty(r,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_requestRender",{value:()=>this._requestRender(),writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_componentId",{value:this._componentId,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(r,"_triggerWatchers",{value:(s,i)=>this._triggerWatchers(s,i),writable:!1,enumerable:!1,configurable:!1}),this.context=r,Object.defineProperty(this.context,"emit",{value:(s,i,o)=>{const a=new CustomEvent(s,{detail:i,bubbles:!0,composed:!0,...o||{}});return this.dispatchEvent(a),!a.defaultPrevented},writable:!1,enumerable:!1,configurable:!1});const n=Re.get(e)||t;Object.keys(n).forEach(s=>{const i=n[s];typeof i=="function"&&(this.context[s]=(...o)=>i(...o,this.context))}),this._applyComputed(n),n.props&&Object.keys(n.props).forEach(s=>{let i=this[s];Object.defineProperty(this,s,{get(){return i},set(o){const a=i;i=o,this.context[s]=o,this._initializing||(this._applyProps(n),a!==o&&this._requestRender())},enumerable:!0,configurable:!0})}),this._initializing=!1,this._initWatchers(n),this._applyProps(n),this._render(n)}connectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),this._requestRender(),St(t,this.context,this._mounted,r=>{this._mounted=r})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(t,()=>{$t(t,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},r=>{this._templateLoading=r},r=>{this._templateError=r},r=>{this._mounted=r})})}attributeChangedCallback(r,n,s){this._runLogicWithinErrorBoundary(t,()=>{this._applyProps(t),n!==s&&this._requestRender(),At(t,r,n,s,this.context)})}static get observedAttributes(){return t.props?Object.keys(t.props).map(te):[]}_applyComputed(r){}_render(r){this._runLogicWithinErrorBoundary(r,()=>{Qt(this.shadowRoot,r,this.context,this._refs,n=>{this._lastHtmlStringForJitCSS=n,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(n)},n=>{this._templateLoading=n,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(n)},n=>{this._templateError=n,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(n)},n=>this._applyStyle(r,n))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{ue(()=>{Xt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,r=>{this._lastRenderTime=r},r=>{this._renderCount=r},this._renderTimeoutId,r=>{this._renderTimeoutId=r})},this._componentId)})}_applyStyle(r,n){this._runLogicWithinErrorBoundary(r,()=>{Yt(this.shadowRoot,this.context,n,this._styleSheet,s=>{this._styleSheet=s})})}_runLogicWithinErrorBoundary(r,n){this._hasError&&(this._hasError=!1);try{n()}catch(s){this._hasError=!0,r.onError&&r.onError(s,this.context)}}_initContext(r){try{let n=function(i,o=""){return Array.isArray(i)?new Proxy(i,{get(a,u,m){const g=Reflect.get(a,u,m);return typeof g=="function"&&typeof u=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(u)?function(...h){const l=g.apply(a,h);if(!s._initializing){const d=o||"root";s._triggerWatchers(d,a),ue(()=>s._render(r),s._componentId)}return l}:g},set(a,u,m){if(a[u]=m,!s._initializing){const g=o?`${o}.${String(u)}`:String(u);s._triggerWatchers(g,m),ue(()=>s._render(r),s._componentId)}return!0},deleteProperty(a,u){if(delete a[u],!s._initializing){const m=o?`${o}.${String(u)}`:String(u);s._triggerWatchers(m,void 0),ue(()=>s._render(r),s._componentId)}return!0}}):i&&typeof i=="object"?i.constructor&&i.constructor.name==="ReactiveState"?i:(Object.keys(i).forEach(a=>{const u=o?`${o}.${a}`:a;i[a]=n(i[a],u)}),new Proxy(i,{set(a,u,m){const g=o?`${o}.${String(u)}`:String(u);return a[u]=n(m,g),s._initializing||(s._triggerWatchers(g,a[u]),ue(()=>s._render(r),s._componentId)),!0},get(a,u,m){return Reflect.get(a,u,m)}})):i};const s=this;return n({...r.props?Object.fromEntries(Object.entries(r.props).map(([i,o])=>[i,o.default])):{}})}catch{return{}}}_initWatchers(r){this._runLogicWithinErrorBoundary(r,()=>{kt(this.context,this._watchers,{})})}_triggerWatchers(r,n){Ct(this.context,this._watchers,r,n)}_applyProps(r){this._runLogicWithinErrorBoundary(r,()=>{try{Et(this,r,this.context)}catch(n){this._hasError=!0,r.onError&&r.onError(n,this.context)}})}}}function He(e,t){let r=te(e);r.includes("-")||(r=`cer-${r}`);let n={};if(typeof window<"u")try{const a=t.toString().match(/\(\s*{\s*([^}]+)\s*}/);if(a){const m=a[1].split(",").map(g=>g.trim());for(const g of m){const w=g.indexOf("=");if(w!==-1){const h=g.substring(0,w).trim(),l=g.substring(w+1).trim();try{l==="true"?n[h]=!0:l==="false"?n[h]=!1:l==="[]"?n[h]=[]:l==="{}"?n[h]={}:/^\d+$/.test(l)?n[h]=parseInt(l):/^'.*'$/.test(l)||/^".*"$/.test(l)?n[h]=l.slice(1,-1):n[h]=l}catch{n[h]=""}}else{const h=g.split(":")[0].trim();h&&!h.includes("}")&&(n[h]="")}}}}catch{}let s={};const i={props:Object.fromEntries(Object.entries(n).map(([o,a])=>[o,{type:typeof a=="boolean"?Boolean:typeof a=="number"?Number:typeof a=="string"?String:Function,default:a}])),onConnected:o=>{s.onConnected&&s.onConnected()},onDisconnected:o=>{s.onDisconnected&&s.onDisconnected()},onAttributeChanged:(o,a,u,m)=>{s.onAttributeChanged&&s.onAttributeChanged(o,a,u)},onError:(o,a)=>{s.onError&&o&&s.onError(o)},render:o=>{const a=o._componentId||`${r}-${Math.random().toString(36).substr(2,9)}`;F.setCurrentComponent(a,()=>{o.requestRender&&o.requestRender()});try{er(o);const u=Object.keys(n).length>0;let m;if(u){const g={};Object.keys(n).forEach(w=>{g[w]=o[w]??n[w]}),m=t(g)}else m=t();if(o._hookCallbacks){const g=o._hookCallbacks;g.onConnected&&(s.onConnected=g.onConnected),g.onDisconnected&&(s.onDisconnected=g.onDisconnected),g.onAttributeChanged&&(s.onAttributeChanged=g.onAttributeChanged),g.onError&&(s.onError=g.onError),g.style&&(o._styleCallback=g.style)}return m}finally{tr(),F.clearCurrentComponent()}}};Re.set(r,i),typeof window<"u"&&(customElements.get(r)||customElements.define(r,cr(r,i)))}class lr{map=new Map;maxSize;constructor(t){this.maxSize=t}get(t){const r=this.map.get(t);if(r!==void 0)return this.map.delete(t),this.map.set(t,r),r}set(t,r){if(this.map.has(t)&&this.map.delete(t),this.map.set(t,r),this.map.size>this.maxSize){const n=this.map.keys().next().value;n!==void 0&&this.map.delete(n)}}has(t){return this.map.has(t)}clear(){this.map.clear()}}const We=new lr(500);function ur(e,t){if(e==null){console.warn(`⚠️ Event handler for '@${t}' is ${e}. This will prevent the event from working. Use a function reference instead: @${t}="\${functionName}"`);return}typeof e!="function"&&console.warn(`🚨 Potential infinite loop detected! Event handler for '@${t}' appears to be the result of a function call (${typeof e}) instead of a function reference. Change @${t}="\${functionName()}" to @${t}="\${functionName}" to pass the function reference instead of calling it immediately.`),e===void 0&&typeof e!="function"&&console.warn(`💡 Tip: If your event handler function returns undefined, make sure you're passing the function reference, not calling it. Use @${t}="\${fn}" not @${t}="\${fn()}"`)}function de(e,t={},r,n){const s=n??t.key;return{tag:e,key:s,props:t,children:r}}function Ae(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function Ce(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Ae(e)}function fr(e,t){return e.key!=null?e:{...e,key:t}}function dr(e,t=[],r={}){const n={},s={},i={},o=[],a=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let u;for(;u=a.exec(e);){const m=u[1],g=u[2],w=(u[4]||u[6])??"",h=w.match(/^{{(\d+)}}$/);let l=h?t[Number(h[1])]??null:w;h||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const d=["model","bind","show","class","style","ref"];if(m===":"){const[v,b]=g.split(":"),[c,...p]=v.split(".");if(d.includes(c)){const y=[...p],C=c==="model"&&b?`model:${b}`:c;i[C]={value:l,modifiers:y,arg:b}}else{let y=l;y&&typeof y=="object"&&y.constructor?.name==="ReactiveState"&&(y=y.value),s[g]=y,o.push(g)}}else if(m==="@"){const[v,...b]=g.split("."),c=b;ur(l,v);const p=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0;if(p){const y=k=>{if(c.includes("prevent")&&k.preventDefault(),c.includes("stop")&&k.stopPropagation(),!(c.includes("self")&&k.target!==k.currentTarget))return c.includes("once")&&k.currentTarget?.removeEventListener(v,y),p(k)},C="on"+v.charAt(0).toUpperCase()+v.slice(1);n[C]=y}}else g==="ref"?n.ref=l:s[g]=l}return{props:n,attrs:s,directives:i,bound:o}}function pr(e,t,r){const n=he.length>0?he[he.length-1]:void 0,s=r??n,i=!r&&t.length===0,o=i?e.join("<!--TEMPLATE_DELIM-->"):null;if(i&&o){const f=We.get(o);if(f)return f}function a(f,x){return de("#text",{},f,x)}let u="";for(let f=0;f<e.length;f++)u+=e[f],f<t.length&&(u+=`{{${f}}}`);const m=/<!--[\s\S]*?-->|<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,g=[];let w,h=[],l=null,d={},v,b=0,c=[];function p(f){!f||typeof f!="object"||Ae(f)||(f.props||f.attrs?(f.props&&(d.props||(d.props={}),Object.assign(d.props,f.props)),f.attrs&&(d.attrs||(d.attrs={}),Object.keys(f.attrs).forEach(x=>{if(x==="style"&&d.attrs.style){const A=d.attrs.style.replace(/;?\s*$/,""),_=f.attrs.style.replace(/^;?\s*/,"");d.attrs.style=A+"; "+_}else if(x==="class"&&d.attrs.class){const A=d.attrs.class.trim().split(/\s+/).filter(Boolean),_=f.attrs.class.trim().split(/\s+/).filter(Boolean),S=[...new Set([...A,..._])];d.attrs.class=S.join(" ")}else d.attrs[x]=f.attrs[x]}))):(d.props||(d.props={}),Object.assign(d.props,f)))}function y(f,x){const A=l?h:c;if(Ae(f)){const _=f.key??x;let S=f.children;A.push({...f,key:_,children:S});return}if(Ce(f)){A.push(fr(f,void 0));return}if(Array.isArray(f)){if(f.length===0)return;for(let _=0;_<f.length;_++){const S=f[_];Ae(S)||Ce(S)||Array.isArray(S)?y(S,`${x}-${_}`):S!==null&&typeof S=="object"?p(S):A.push(a(String(S),`${x}-${_}`))}return}if(f!==null&&typeof f=="object"){p(f);return}A.push(a(String(f),x))}const C=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;w=m.exec(u);)if(!(w[0].startsWith("<!--")&&w[0].endsWith("-->"))){if(w[1]){const f=w[1],x=w[0][1]==="/",A=w[0][w[0].length-2]==="/"||C.has(f),{props:_,attrs:S,directives:R,bound:T}=dr(w[2]||"",t,s),$={props:{},attrs:{}};for(const P in _)$.props[P]=_[P];for(const P in S)$.attrs[P]=S[P];if($.attrs&&Object.prototype.hasOwnProperty.call($.attrs,"key")&&!($.props&&Object.prototype.hasOwnProperty.call($.props,"key")))try{$.props.key=$.attrs.key}catch{}try{const P={input:["value","checked","disabled","readonly","required","placeholder","maxlength","minlength"],textarea:["value","disabled","readonly","required","placeholder","maxlength","minlength"],select:["value","disabled","required","multiple"],option:["selected","disabled","value"],video:["muted","autoplay","controls","loop","playsinline"],audio:["muted","autoplay","controls","loop"],img:["src","alt","width","height"],button:["type","name","value","disabled","autofocus","form"]},U=f.toLowerCase(),J=P[U]??[];if($.attrs){for(const K of J)if(T&&T.includes(K)&&K in $.attrs&&!($.props&&K in $.props)){let L=$.attrs[K];L&&typeof L=="object"&&L.constructor?.name==="ReactiveState"&&(L=L.value),$.props[K]=L,delete $.attrs[K]}}if((f.includes("-")||!!s?.__customElements?.has?.(f))&&($.isCustomElement=!0,T&&$.attrs)){const K=new Set(["id","name","data-key","key"]);for(const L of T)if(L in $.attrs&&!($.props&&L in $.props)){const M=L.includes("-")?L.split("-").map((Z,W)=>W===0?Z:Z.charAt(0).toUpperCase()+Z.slice(1)).join(""):L;let V=$.attrs[L];V&&typeof V=="object"&&V.constructor?.name==="ReactiveState"&&(V=V.value),$.props[M]=V,K.has(L)||delete $.attrs[L]}}}catch{}if(R&&Object.keys(R).some(P=>P==="model"||P.startsWith("model:")))try{const P=Symbol.for("cer.registry"),U=globalThis[P],J=!!(U&&typeof U.has=="function"&&U.has(f)),be=!!(s&&(s.__customElements instanceof Set&&s.__customElements.has(f)||Array.isArray(s.__isCustomElements)&&s.__isCustomElements.includes(f)));if(!!(f.includes("-")||be||J))for(const M of Object.keys(R)){if(M!=="model"&&!M.startsWith("model:"))continue;const V=R[M],Z=V.arg??(M.includes(":")?M.split(":",2)[1]:void 0),W=V.value,E=Z??"modelValue",q=B,z=_e,D=s?s._state||s:void 0;let O;typeof W=="string"&&s?O=q(D,W):(O=W,O&&typeof O=="object"&&O.constructor?.name==="ReactiveState"&&(O=O.value)),$.props[E]=O;try{const re=te(E);$.attrs||($.attrs={}),O!==void 0&&($.attrs[re]=O)}catch{}$.isCustomElement=!0;const Ke=`update:${te(E)}`.replace(/-([a-z])/g,(re,Y)=>Y.toUpperCase()),pt="on"+Ke.charAt(0).toUpperCase()+Ke.slice(1);$.props[pt]=function(re){const Y=re.detail!==void 0?re.detail:re.target?re.target.value:void 0;if(D)if(W&&typeof W=="object"&&W.constructor?.name==="ReactiveState"){const ae=W.value;(Array.isArray(Y)&&Array.isArray(ae)?JSON.stringify([...Y].sort())!==JSON.stringify([...ae].sort()):Y!==ae)&&(W.value=Y,s?.requestRender?s.requestRender():s?._requestRender&&s._requestRender())}else{const ae=q(D,typeof W=="string"?W:String(W));(Array.isArray(Y)&&Array.isArray(ae)?JSON.stringify([...Y].sort())!==JSON.stringify([...ae].sort()):Y!==ae)&&(z(D,typeof W=="string"?W:String(W),Y),s?.requestRender?s.requestRender():s?._requestRender&&s._requestRender())}},delete R[M]}}catch{}if(Object.keys(R).length>0&&($.directives={...R}),x){const P=de(l,d,h.length===1&&Ce(h[0])&&h[0].tag==="#text"?typeof h[0].children=="string"?h[0].children:"":h.length?h:void 0,v),U=g.pop();U?(l=U.tag,d=U.props,v=U.key,h=U.children,h.push(P)):(c.push(P),l=null,d={},v=void 0,h=[])}else A?l?h.push(de(f,$,void 0,void 0)):c.push(de(f,$,void 0,void 0)):(l&&g.push({tag:l,props:d,children:h,key:v}),l=f,d=$,h=[])}else if(typeof w[3]<"u"){const f=Number(w[3]),x=t[f],A=`interp-${f}`;y(x,A)}else if(w[4]){const f=w[4],x=l?h:c,A=f.split(/({{\d+}})/);for(const _ of A){if(!_)continue;const S=_.match(/^{{(\d+)}}$/);if(S){const R=Number(S[1]),T=t[R],$=`interp-${R}`;y(T,$)}else{const R=`text-${b++}`;x.push(a(_,R))}}}}const k=c.filter(f=>Ce(f)&&f.tag==="#text"?typeof f.children=="string"&&f.children.trim()!=="":!0);if(k.length===1){const f=k[0];return i&&o&&We.set(o,f),f}else if(k.length>1){const f=k;return i&&o&&We.set(o,f),f}return de("div",{},"","fallback-root")}function ne(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return pr(e,t,n)}function ye(e,t){return j(e?t:[],"when-block")}function hr(e,t){return e.map((r,n)=>{const s=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return j(t(r,n),`each-${s}`)})}function lt(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return gr(...e)}}}function gr(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[j(n,`whenChain-branch-${t}`)]}return[j([],"whenChain-empty")]}function j(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}function mr(e,t){return ye(!e,t)}function yr(e,t){const r=!e||e.length===0;return ye(r,t)}function br(e,t){const r=!!(e&&e.length>0);return ye(r,t)}function wr(e,t,r){const n=[];return e.forEach((s,i)=>{t(s,i)&&n.push({item:s,originalIndex:i})}),n.map(({item:s,originalIndex:i},o)=>{const a=typeof s=="object"&&s!=null?s?.key??s?.id??`filtered-${i}`:`filtered-${i}`;return j(r(s,i,o),`each-where-${a}`)})}function vr(e,t){const r=e?.length??0;return r===0&&t.empty?j(t.empty,"switch-length-empty"):r===1&&t.one?j(t.one(e[0]),"switch-length-one"):t.exactly?.[r]?j(t.exactly[r](e),`switch-length-${r}`):r>1&&t.many?j(t.many(e),"switch-length-many"):j([],"switch-length-fallback")}function xr(e,t,r){const n=new Map;return e.forEach(s=>{const i=t(s);n.has(i)||n.set(i,[]),n.get(i).push(s)}),Array.from(n.entries()).map(([s,i],o)=>j(r(s,i,o),`each-group-${s}`))}function kr(e,t,r,n){const s=r*t,i=Math.min(s+t,e.length);return e.slice(s,i).map((a,u)=>{const m=s+u,g=typeof a=="object"&&a!=null?a?.key??a?.id??`page-${m}`:`page-${m}`;return j(n(a,m,u),`each-page-${g}`)})}function Cr(e,t){return e.loading&&t.loading?j(t.loading,"promise-loading"):e.error&&t.error?j(t.error(e.error),"promise-error"):e.data!==void 0&&t.success?j(t.success(e.data),"promise-success"):t.idle?j(t.idle,"promise-idle"):j([],"promise-fallback")}function H(e,t){const r=typeof window<"u"&&window.matchMedia?.(e)?.matches;return ye(!!r,t)}const ee={sm:"(min-width:640px)",md:"(min-width:768px)",lg:"(min-width:1024px)",xl:"(min-width:1280px)","2xl":"(min-width:1536px)",dark:"(prefers-color-scheme: dark)"},Fe=["sm","md","lg","xl","2xl"],ut={sm:e=>H(ee.sm,e),md:e=>H(ee.md,e),lg:e=>H(ee.lg,e),xl:e=>H(ee.xl,e),"2xl":e=>H(ee["2xl"],e),dark:e=>H(ee.dark,e),light:e=>H("(prefers-color-scheme: light)",e),touch:e=>H("(hover: none) and (pointer: coarse)",e),mouse:e=>H("(hover: hover) and (pointer: fine)",e),reducedMotion:e=>H("(prefers-reduced-motion: reduce)",e),highContrast:e=>H("(prefers-contrast: high)",e),portrait:e=>H("(orientation: portrait)",e),landscape:e=>H("(orientation: landscape)",e)};function _r(e,t){const r=[];e.includes("dark")?r.push(ee.dark):e.includes("light")&&r.push("(prefers-color-scheme: light)");const n=e.filter(o=>Fe.includes(o)),s=n[n.length-1];s&&s in ee&&r.push(ee[s]);const i=r.length>0?r.join(" and "):"all";return H(i,t)}function Er(e){const t=[];return e.base&&t.push(j(e.base,"responsive-base")),Fe.forEach(r=>{const n=e[r];n&&t.push(ut[r](n))}),t}function Sr(e){const t=[];let r=null;return{case(n,s){const i=typeof n=="function"?n:o=>o===n;return t.push({condition:i,content:s}),this},when(n,s){return t.push({condition:n,content:s}),this},otherwise(n){return r=n,this},done(){for(let n=0;n<t.length;n++){const{condition:s,content:i}=t[n];if(s(e))return j(i,`switch-case-${n}`)}return j(r||[],"switch-otherwise")}}}class le extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return le.instance||(le.instance=new le),le.instance}emit(t,r){const n=Date.now(),s=this.eventCounters.get(t);if(!s||n-s.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(s.count++,s.count>50&&s.count>100)return;this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const i=this.handlers[t];i&&i.forEach(o=>{try{o(r)}catch(a){ie(`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 n=this.handlers[t];n&&n.delete(r)}offAll(t){delete this.handlers[t]}listen(t,r,n){return this.addEventListener(t,r,n),()=>this.removeEventListener(t,r)}once(t,r){return new Promise(n=>{const s=this.on(t,i=>{s(),r(i),n(i)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const fe=le.getInstance(),$r=(e,t)=>fe.emit(e,t),Ar=(e,t)=>fe.on(e,t),Rr=(e,t)=>fe.off(e,t),Tr=(e,t)=>fe.once(e,t),Or=(e,t,r)=>fe.listen(e,t,r);function Be(e){let t={...e};const r=[];function n(a){r.push(a),a(t)}function s(){return t}function i(a){const u=typeof a=="function"?a(t):a;t={...t,...u},o()}function o(){r.forEach(a=>a(t))}return{subscribe:n,getState:s,setState:i}}const Ue=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},X=(e,t)=>{for(const r of e){const n=[],s=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),i=new RegExp(`^${s}$`),o=t.match(i);if(o){const a={};return n.forEach((u,m)=>{a[u]=o[m+1]}),{route:r,params:a}}}return{route:null,params:{}}},De={};async function ft(e){if(e.component)return e.component;if(e.load){if(De[e.path])return De[e.path];try{const t=await e.load();return De[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 dt(e){const{routes:t,base:r="",initialUrl:n}=e;let s,i,o,a,u,m,g;const w=async(v,b)=>{const c=t.find(p=>X([p],v.path).route!==null);if(c?.beforeEnter)try{const p=await c.beforeEnter(v,b);return typeof p=="string"?(await d(p,!0),!1):p!==!1}catch(p){return ie("beforeEnter error",p),!1}return!0},h=async(v,b)=>{const c=t.find(p=>X([p],v.path).route!==null);if(c?.onEnter)try{const p=await c.onEnter(v,b);return typeof p=="string"?(await d(p,!0),!1):p!==!1}catch(p){return ie("onEnter error",p),!1}return!0},l=(v,b)=>{const c=t.find(p=>X([p],v.path).route!==null);if(c?.afterEnter)try{c.afterEnter(v,b)}catch(p){ie("afterEnter error",p)}},d=async(v,b=!1)=>{try{const c={path:v.replace(r,"")||"/",query:{}},p=X(t,c.path);if(!p)throw new Error(`No route found for ${c.path}`);const y=o.getState(),C={path:c.path,params:p.params,query:c.query};if(!await w(C,y)||!await h(C,y))return;typeof window<"u"&&typeof document<"u"&&(b?window.history.replaceState({},"",r+v):window.history.pushState({},"",r+v)),o.setState(C),l(C,y)}catch(c){ie("Navigation error:",c)}};if(typeof window<"u"&&typeof document<"u"&&typeof n>"u"){s=()=>{const b=new URL(window.location.href),c=b.pathname.replace(r,"")||"/",p=Ue(b.search);return{path:c,query:p}},i=s();const v=X(t,i.path);o=Be({path:i.path,params:v.params,query:i.query}),a=async(b=!1)=>{const c=s();await d(c.path,b)},window.addEventListener("popstate",()=>a(!0)),u=b=>d(b,!1),m=b=>d(b,!0),g=()=>window.history.back()}else{s=()=>{const c=new URL(n||"/","http://localhost"),p=c.pathname.replace(r,"")||"/",y=Ue(c.search);return{path:p,query:y}},i=s();const v=X(t,i.path);o=Be({path:i.path,params:v.params,query:i.query}),a=async()=>{const c=s();await b(c.path)};const b=async c=>{try{const p={path:c.replace(r,"")||"/",query:{}},y=X(t,p.path);if(!y)throw new Error(`No route found for ${p.path}`);const C=o.getState(),k={path:p.path,params:y.params,query:p.query},f=t.find(x=>X([x],k.path).route!==null);if(f?.beforeEnter)try{const x=await f.beforeEnter(k,C);if(typeof x=="string"){await b(x);return}if(x===!1)return}catch{return}if(f?.onEnter)try{const x=await f.onEnter(k,C);if(typeof x=="string"){await b(x);return}if(x===!1)return}catch{return}if(o.setState(k),f?.afterEnter)try{f.afterEnter(k,C)}catch{}}catch{}};u=async c=>b(c),m=async c=>b(c),g=()=>{}}return{store:o,push:u,replace:m,back:g,subscribe:o.subscribe,matchRoute:v=>X(t,v),getCurrent:()=>o.getState(),resolveRouteComponent:ft}}function Pr(e,t){return X(e,t)}function Lr(e){const t=dt(e);return He("router-view",(r={},n={})=>{const{onConnected:s}=n;if(s&&s(()=>{t&&typeof t.subscribe=="function"&&t.subscribe(()=>{})}),!t)return ne`<div>Router not initialized.</div>`;const i=t.getCurrent(),{path:o}=i,a=t.matchRoute(o);return a.route?t.resolveRouteComponent(a.route).then(u=>{if(typeof u=="string")return{tag:u,props:{},children:[]};if(typeof u=="function"){const m=u();return(m instanceof Promise?m:Promise.resolve(m)).then(w=>typeof w=="string"?{tag:w,props:{},children:[]}:w)}return ne`<div>Invalid route component</div>`}).catch(()=>ne`<div>Invalid route component</div>`):ne`<div>Not found</div>`}),He("router-link",(r={},n={})=>{const{to:s="",tag:i="a",replace:o=!1,exact:a=!1,activeClass:u="active",exactActiveClass:m="exact-active",ariaCurrentValue:g="page",disabled:w=!1,external:h=!1,class:l=""}=r,d=t.getCurrent(),v=d.path===s,b=a?v:d&&typeof d.path=="string"?d.path.startsWith(s):!1,c=v?`aria-current="${g}"`:"",p=(l||"").split(/\s+/).filter(Boolean),y={};for(const _ of p)y[_]=!0;const C={...y,[u]:b,[m]:v},k=i==="button",f=w?k?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",x=h&&(i==="a"||!i)?'target="_blank" rel="noopener noreferrer"':"",A=_=>{if(w){_.preventDefault();return}h&&(i==="a"||!i)||(_.preventDefault(),o?t.replace(s):t.push(s))};return ne`
|
|
73
|
+
${lt().when(k,ne`
|
|
74
|
+
<button
|
|
75
|
+
part="button"
|
|
76
|
+
:class="${C}"
|
|
77
|
+
${c}
|
|
78
|
+
${f}
|
|
79
|
+
${x}
|
|
80
|
+
@click="${A}"
|
|
81
|
+
><slot></slot></button>
|
|
82
|
+
`).otherwise(ne`
|
|
83
|
+
<a
|
|
84
|
+
part="link"
|
|
85
|
+
href="${s}"
|
|
86
|
+
:class="${C}"
|
|
87
|
+
${c}
|
|
88
|
+
${f}
|
|
89
|
+
${x}
|
|
90
|
+
@click="${A}"
|
|
91
|
+
><slot></slot></a>
|
|
92
|
+
`).done()}
|
|
93
|
+
`}),t}exports.GlobalEventBus=le;exports.anchorBlock=j;exports.component=He;exports.computed=vt;exports.createStore=Be;exports.css=at;exports.each=hr;exports.eachGroup=xr;exports.eachPage=kr;exports.eachWhere=wr;exports.emit=$r;exports.eventBus=fe;exports.html=ne;exports.initRouter=Lr;exports.listen=Or;exports.match=lt;exports.matchRoute=X;exports.matchRouteSSR=Pr;exports.mediaVariants=ee;exports.off=Rr;exports.on=Ar;exports.once=Tr;exports.parseQuery=Ue;exports.ref=wt;exports.renderToString=Se;exports.resolveRouteComponent=ft;exports.responsive=ut;exports.responsiveOrder=Fe;exports.responsiveSwitch=Er;exports.switchOn=Sr;exports.switchOnLength=vr;exports.switchOnPromise=Cr;exports.unless=mr;exports.useEmit=rr;exports.useOnAttributeChanged=ir;exports.useOnConnected=nr;exports.useOnDisconnected=sr;exports.useOnError=or;exports.useRouter=dt;exports.useStyle=ar;exports.watch=xt;exports.when=ye;exports.whenEmpty=yr;exports.whenMedia=H;exports.whenNotEmpty=br;exports.whenVariants=_r;
|
|
88
94
|
//# sourceMappingURL=custom-elements-runtime.cjs.js.map
|