@jasonshimmy/custom-elements-runtime 0.1.16 → 0.1.17
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/dist/custom-elements-runtime.cjs.js +13 -13
- package/dist/custom-elements-runtime.cjs.js.map +1 -1
- package/dist/custom-elements-runtime.es.js +557 -511
- package/dist/custom-elements-runtime.es.js.map +1 -1
- package/dist/custom-elements-runtime.umd.js +13 -13
- package/dist/custom-elements-runtime.umd.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function we(e,t){return U(e?t:[],"when-block")}function ke(e,t){return e.map((r,n)=>{const o=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return U(t(r,n),`each-${o}`)})}function ye(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return $e(...e)}}}function $e(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[U(n,`whenChain-branch-${t}`)]}return[U([],"whenChain-empty")]}function U(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class B extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return B.instance||(B.instance=new B),B.instance}emit(t,r){const n=Date.now(),o=this.eventCounters.get(t);if(!o||n-o.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(o.count++,o.count>50&&(console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`),o.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(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 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 o=this.on(t,s=>{o(),r(s),n(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const P=B.getInstance(),Se=(e,t)=>P.emit(e,t),_e=(e,t)=>P.on(e,t),Ce=(e,t)=>P.off(e,t),Ee=(e,t)=>P.once(e,t),Ae=(e,t,r)=>P.listen(e,t,r);function ee(e){let t={...e};const r=[];function n(a){r.push(a),a(t)}function o(){return t}function s(a){const c=typeof a=="function"?a(t):a;t={...t,...c},i()}function i(){r.forEach(a=>a(t))}return{subscribe:n,getState:o,setState:s}}function se(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function te(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function Te(e,t,r){if(r)for(const[n,o]of Object.entries(r)){let s,i={};if(Array.isArray(o)?(s=o[0],i=o[1]||{}):s=o,t.set(n,{callback:s,options:i,oldValue:re(e,n)}),i.immediate)try{const a=re(e,n);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${n}":`,a)}}}function re(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function je(e,t,r,n){const o=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((y,h)=>o(y,a[h]));const c=Object.keys(i),f=Object.keys(a);return c.length!==f.length?!1:c.every(y=>o(i[y],a[y]))},s=t.get(r);if(s&&!o(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(i){console.error(`Error in watcher for "${r}":`,i)}for(const[i,a]of t.entries())if(a.options.deep&&r.startsWith(i+"."))try{const c=re(e,i);o(c,a.oldValue)||(a.callback(c,a.oldValue,e),a.oldValue=c)}catch(c){console.error(`Error in deep watcher for "${i}":`,c)}}function Le(e,t,r){if(!t.props)return;function n(o,s){return s===Boolean?o==="true":s===Number?Number(o):o}Object.entries(t.props).forEach(([o,s])=>{if(s.type===Function&&typeof e[o]=="function")r[o]=e[o];else{const i=e.getAttribute(se(o));i!==null?r[o]=te(n(i,s.type)):"default"in s&&s.default!==void 0&&(r[o]=te(s.default))}})}function ze(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function Re(e,t,r,n,o,s,i,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(c=>c()),n(),o(),s(!1),i(null),a(!1)}function Be(e,t,r,n,o){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,o)}function M(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))M(r,t)}}function N(e,t){return typeof t=="string"?t.split(".").reduce((r,n)=>r?.[n],e):t}function fe(e,t,r){const n=t.split("."),o=n.pop();if(!o)return;const s=n.reduce((i,a)=>(a in i||(i[a]={}),i[a]),e);s[o]=r}function Me(e,t,r,n,o,s,i){if(!s)return;const a=t.includes("lazy"),c=t.includes("trim"),f=t.includes("number"),y=()=>{const g=s._state||s;return N(g,e)},h=y();let l="text";const v=n?.type;if(i instanceof HTMLInputElement?l=v||i.type||"text":i instanceof HTMLSelectElement?l="select":i instanceof HTMLTextAreaElement&&(l="textarea"),l==="checkbox")if(Array.isArray(h)){const g=i?.getAttribute("value")||n?.value||"",u=h.includes(g);i&&i.checked!==u&&(r.checked=u)}else{const g=i?.getAttribute("true-value")||!0,u=h===g;i&&i.checked!==u&&(r.checked=u)}else if(l==="radio"){const g=n?.value||"",u=h===g;i&&i.checked!==u&&(r.checked=u)}else if(l==="select")if(i&&i.hasAttribute("multiple")){const g=i,u=Array.isArray(h)?h:[];setTimeout(()=>{Array.from(g.options).forEach(p=>{const w=u.includes(p.value);p.selected!==w&&(p.selected=w)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(h)&&(i.value=String(h))},0);else{const g=String(h??"");(!i||i.value!==g)&&(r.value=h)}const x=a||l==="checkbox"||l==="radio"||l==="select"?"change":"input",m=g=>{if(g.isComposing||o._isComposing||g.isTrusted===!1)return;const u=g.target;if(u._modelUpdating)return;const p=y();let w=u.value;if(l==="checkbox")if(Array.isArray(p)){const k=u.getAttribute("value")||"",S=[...p];if(u.checked)S.includes(k)||S.push(k);else{const _=S.indexOf(k);_>-1&&S.splice(_,1)}w=S}else{const k=u.getAttribute("true-value")||!0,S=u.getAttribute("false-value")||!1;w=u.checked?k:S}else if(l==="radio")w=u.getAttribute("value")||u.value;else if(l==="select"&&u.multiple){const k=u;w=Array.from(k.selectedOptions).map(S=>S.value)}else if(c&&(w=w.trim()),f){const k=Number(w);isNaN(k)||(w=k)}const d=s._state||s,b=N(d,e);if(Array.isArray(w)&&Array.isArray(b)?JSON.stringify([...w].sort())!==JSON.stringify([...b].sort()):w!==b){const k=g.target;k._modelUpdating=!0,fe(d,e,w),setTimeout(()=>{k._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(o[x]=m,l==="text"||l==="textarea"){const g=()=>{o._isComposing=!0},u=p=>{o._isComposing=!1;const w=p.target;setTimeout(()=>{if(w){let d=w.value;if(c&&(d=d.trim()),f){const S=Number(d);isNaN(S)||(d=S)}const b=s._state||s,$=N(b,e);(Array.isArray(d)&&Array.isArray($)?JSON.stringify([...d].sort())!==JSON.stringify([...$].sort()):d!==$)&&(w&&(w._modelUpdating=!0,setTimeout(()=>{w._modelUpdating=!1},0)),fe(b,e,d),s._requestRender&&s._requestRender())}},0)};o.compositionstart=g,o.compositionend=u}}function Ne(e,t,r,n){if(n){if(typeof e=="object"&&e!==null)for(const[o,s]of Object.entries(e))t[o]=s;else if(typeof e=="string")try{const o=JSON.parse(e);if(typeof o=="object"&&o!==null){for(const[s,i]of Object.entries(o))t[s]=i;return}}catch{const o=N(n,e);r[e]=o}}}function Oe(e,t,r){if(!r)return;const n=N(r,e),o=t.style||"",s=n?"":"none";if(o){const i=o.split(";").filter(Boolean),a=i.findIndex(c=>c.trim().startsWith("display:"));a>=0?i[a]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function Pe(e,t,r){if(!r)return;const n=N(r,e);let o=[];typeof n=="string"?o=[n]:Array.isArray(n)?o=n.filter(Boolean):typeof n=="object"&&(o=Object.entries(n).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",i=s?`${s} ${o.join(" ")}`.trim():o.join(" ");i&&(t.class=i)}function We(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=N(r,e)}else n=e;let o="";if(typeof n=="string")o=n;else if(n&&typeof n=="object"){const i=[];for(const[a,c]of Object.entries(n))if(c!=null&&c!==""){const f=a.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`),y=["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 h=String(c);typeof c=="number"&&y.includes(f)&&(h=`${c}px`),i.push(`${f}: ${h}`)}o=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+o}function me(e,t,r,n){const o={},s={...n||{}},i={};for(const[a,c]of Object.entries(e)){const{value:f,modifiers:y}=c;switch(a){case"model":Me(typeof f=="string"?f:String(f),y,o,s,i,t,r);break;case"bind":Ne(f,o,s,t);break;case"show":Oe(f,s,t);break;case"class":Pe(f,s,t);break;case"style":We(f,s,t);break}}return{props:o,attrs:s,listeners:i}}function ne(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const h=i.tag||"node",l=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";a=l?`${t}:${h}:${l}`:`${t}:${h}`}let c=a,f=1;for(;s.has(c);)c=`${a}#${f++}`;s.add(c);let y=i.children;return Array.isArray(y)&&(y=ne(y,c)),{...i,key:c,children:y}})}const r=e;let n=r.props?.key??r.key??t,o=r.children;return Array.isArray(o)&&(o=ne(o,n)),{...r,key:n,children:o}}function De(e,t,r,n){const o=r.directives??{},s=me(o,n,e,r.attrs),i={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},c=t.props??{},f=i;for(const l in{...c,...f}){const v=c[l],x=f[l];v!==x&&(l==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)?e.value!==x&&(e.value=x??""):l==="checked"&&e instanceof HTMLInputElement?e.checked=!!x:l.startsWith("on")&&typeof x=="function"?(typeof v=="function"&&e.removeEventListener(l.slice(2).toLowerCase(),v),e.addEventListener(l.slice(2).toLowerCase(),x)):x==null||x===!1?e.removeAttribute(l):e.setAttribute(l,String(x)))}for(const[l,v]of Object.entries(s.listeners||{}))e.addEventListener(l,v);const y=t.attrs??{},h=a;for(const l in{...y,...h}){const v=y[l],x=h[l];v!==x&&(x==null||x===!1?e.removeAttribute(l):e.setAttribute(l,String(x)))}}function L(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:[],v=document.createTextNode(""),x=document.createTextNode("");h.key!=null&&(v.key=`${h.key}:start`,x.key=`${h.key}:end`),h._startNode=v,h._endNode=x;const m=document.createDocumentFragment();m.appendChild(v);for(const g of l){const u=L(g,t);m.appendChild(u)}return m.appendChild(x),m}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:o={},attrs:s={},directives:i={}}=e.props??{},a=me(i,t,n,s),c={...o,...a.props},f={...s,...a.attrs};for(const h in f){const l=f[h];if(typeof h!="string"||/\[object Object\]/.test(h)){typeof window<"u"&&window.console&&console.warn("Skipping invalid attribute key:",h,l);continue}typeof l=="boolean"?l&&n.setAttribute(h,""):l!=null&&n.setAttribute(h,l)}for(const h in c){const l=c[h];if(typeof h!="string"||/\[object Object\]/.test(h)){typeof window<"u"&&window.console&&console.warn("Skipping invalid prop key:",h,l);continue}if(h==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement))n.value=l??"";else if(h==="checked"&&n instanceof HTMLInputElement)n.checked=!!l;else if(h.startsWith("on")&&typeof l=="function")n.addEventListener(h.slice(2).toLowerCase(),l);else{if(h.startsWith("on")&&l===void 0)continue;l==null||l===!1?n.removeAttribute(h):n.setAttribute(h,String(l))}}for(const[h,l]of Object.entries(a.listeners||{}))n.addEventListener(h,l);const y=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&y&&r&&(r[y]=n),Array.isArray(e.children))for(const h of e.children)n.appendChild(L(h,t,r));else typeof e.children=="string"&&(n.textContent=e.children);return n}function He(e,t,r,n,o){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],a=new Map;for(const v of i)v&&v.key!=null&&a.set(v.key,v);const c=new Map;for(const v of s){const x=v.key;x!=null&&c.set(x,v)}const f=new Set;let y=e.firstChild;function h(v,x){let m=v;for(;m&&(f.add(m),m!==x);)m=m.nextSibling}function l(v,x,m,g){const u=[];let p=v.nextSibling;for(;p&&p!==x;)u.push(p),p=p.nextSibling;const w=Array.isArray(m)?m:[];if(g.some(b=>b&&b.key!=null)||w.some(b=>b&&b.key!=null)){const b=new Map,$=new Map;for(const _ of w)_&&_.key!=null&&b.set(_.key,_);for(const _ of u){const C=_.key;C!=null&&$.set(C,_)}const k=new Set;let S=v.nextSibling;for(const _ of g){let C;if(_.key!=null&&$.has(_.key)){const A=b.get(_.key);C=I($.get(_.key),A,_,n),k.add(C),C!==S&&e.contains(C)&&e.insertBefore(C,S)}else C=L(_,n),e.insertBefore(C,S),k.add(C);S=C.nextSibling}for(const _ of u)!k.has(_)&&e.contains(_)&&e.removeChild(_)}else{const b=Math.min(w.length,g.length);for(let $=0;$<b;$++){const k=w[$],S=g[$],_=I(u[$],k,S,n);_!==u[$]&&(e.insertBefore(_,u[$]),e.removeChild(u[$]))}for(let $=b;$<g.length;$++)e.insertBefore(L(g[$],n),x);for(let $=b;$<u.length;$++)e.removeChild(u[$])}}for(const v of r){let x;if(v.tag==="#anchor"){const m=v.key,g=`${m}:start`,u=`${m}:end`;let p=c.get(g),w=c.get(u);const d=Array.isArray(v.children)?v.children:[];if(p||(p=document.createTextNode(""),p.key=g),w||(w=document.createTextNode(""),w.key=u),v._startNode=p,v._endNode=w,!e.contains(p)||!e.contains(w)){e.insertBefore(p,y);for(const b of d)e.insertBefore(L(b,n),y);e.insertBefore(w,y)}else l(p,w,a.get(m)?.children,d);h(p,w),y=w.nextSibling;continue}if(v.key!=null&&c.has(v.key)){const m=a.get(v.key);x=I(c.get(v.key),m,v,n,o),f.add(x),x!==y&&e.contains(x)&&(y&&!e.contains(y)&&(y=null),e.insertBefore(x,y))}else x=L(v,n,o),y&&!e.contains(y)&&(y=null),e.insertBefore(x,y),f.add(x);y=x.nextSibling}for(const v of s)!f.has(v)&&e.contains(v)&&(M(v,o),e.removeChild(v))}function I(e,t,r,n,o){if(t&&typeof t!="string"&&t.props?.ref&&o&&M(e,o),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const i=document.createTextNode(r);return e.parentNode?.replaceChild(i,e),i}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const i=r,a=Array.isArray(i.children)?i.children:[],c=i._startNode??document.createTextNode(""),f=i._endNode??document.createTextNode("");i.key!=null&&(c.key=`${i.key}:start`,f.key=`${i.key}:end`),i._startNode=c,i._endNode=f;const y=document.createDocumentFragment();y.appendChild(c);for(const h of a){const l=L(h,n);y.appendChild(l)}return y.appendChild(f),e.parentNode?.replaceChild(y,e),c}if(!r){M(e,o);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){M(e,o);const i=L(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(r.tag==="#anchor"){const i=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),c=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,c.key=`${r.key}:end`),r._startNode=a,r._endNode=c;const f=document.createDocumentFragment();f.appendChild(a);for(const y of i)f.appendChild(L(y,n));return f.appendChild(c),e.parentNode?.replaceChild(f,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const i=e;return De(i,t.props||{},r.props||{},n),He(i,t.children,r.children,n,o),typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),i}M(e,o);const s=L(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function qe(e,t,r,n){let o;Array.isArray(t)?t.length===1?(o=t[0],o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})):o={tag:"div",key:"__root__",children:t}:(o=t,o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})),o&&typeof o=="object"&&o.tag==="#anchor"&&(o={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[o]}),o=ne(o,String(o.key??"root"));const s=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;s&&i?typeof s!="string"&&typeof o!="string"&&s.tag===o.tag&&s.key===o.key?a=I(i,s,o,r,n):(a=L(o,r,n),e.replaceChild(a,i)):(a=L(o,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const c=[];for(let f=0;f<e.childNodes.length;f++){const y=e.childNodes[f];y!==a&&y.nodeName!=="STYLE"&&(M(y,n),c.push(y))}c.forEach(f=>e.removeChild(f)),e._prevVNode=o,e._prevDom=a}function ae(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function be(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let H=null;function ue(){return H||(H=new CSSStyleSheet,H.replaceSync(be(Fe))),H}function Ie(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const Fe=ae`
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function Le(e,t){return Q(e?t:[],"when-block")}function ze(e,t){return e.map((r,n)=>{const o=typeof r=="object"?r?.key??r?.id??`idx-${n}`:String(r);return Q(t(r,n),`each-${o}`)})}function ke(){const e=[];return{when(t,r){return e.push([t,r]),this},otherwise(t){return e.push([!0,t]),this},done(){return Re(...e)}}}function Re(...e){for(let t=0;t<e.length;t++){const[r,n]=e[t];if(r)return[Q(n,`whenChain-branch-${t}`)]}return[Q([],"whenChain-empty")]}function Q(e,t){const r=e?Array.isArray(e)?e.filter(Boolean):[e].filter(Boolean):[];return{tag:"#anchor",key:t,children:r}}class M extends EventTarget{handlers={};static instance;eventCounters=new Map;static getInstance(){return M.instance||(M.instance=new M),M.instance}emit(t,r){const n=Date.now(),o=this.eventCounters.get(t);if(!o||n-o.window>1e3)this.eventCounters.set(t,{count:1,window:n});else if(o.count++,o.count>50&&(console.error(`Event storm detected for "${t}": ${o.count} events in 1 second. Throttling...`),o.count>100)){console.warn(`Blocking further "${t}" events to prevent infinite loop`);return}this.dispatchEvent(new CustomEvent(t,{detail:r,bubbles:!1,cancelable:!0}));const s=this.handlers[t];s&&s.forEach(i=>{try{i(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 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 o=this.on(t,s=>{o(),r(s),n(s)})})}getActiveEvents(){return Object.keys(this.handlers).filter(t=>this.handlers[t]&&this.handlers[t].size>0)}clear(){this.handlers={}}getHandlerCount(t){return this.handlers[t]?.size||0}getEventStats(){const t={};for(const[r,n]of this.eventCounters.entries())t[r]={count:n.count,handlersCount:this.getHandlerCount(r)};return t}resetEventCounters(){this.eventCounters.clear()}}const H=M.getInstance(),Be=(e,t)=>H.emit(e,t),Pe=(e,t)=>H.on(e,t),Me=(e,t)=>H.off(e,t),Ne=(e,t)=>H.once(e,t),Oe=(e,t,r)=>H.listen(e,t,r);function se(e){let t={...e};const r=[];function n(a){r.push(a),a(t)}function o(){return t}function s(a){const c=typeof a=="function"?a(t):a;t={...t,...c},i()}function i(){r.forEach(a=>a(t))}return{subscribe:n,getState:o,setState:s}}function de(e){return e.replace(/([a-z])([A-Z])/g,"$1-$2").toLowerCase()}function ae(e){return typeof e=="string"?e.replace(/[&<>"']/g,t=>({"&":"&","<":"<",">":">",'"':""","'":"'"})[t]):e}function We(e,t,r){if(r)for(const[n,o]of Object.entries(r)){let s,i={};if(Array.isArray(o)?(s=o[0],i=o[1]||{}):s=o,t.set(n,{callback:s,options:i,oldValue:le(e,n)}),i.immediate)try{const a=le(e,n);s(a,void 0,e)}catch(a){console.error(`Error in immediate watcher for "${n}":`,a)}}}function le(e,t){return t.split(".").reduce((r,n)=>r?.[n],e)}function De(e,t,r,n){const o=(i,a)=>{if(i===a)return!0;if(typeof i!=typeof a||typeof i!="object"||i===null||a===null)return!1;if(Array.isArray(i)&&Array.isArray(a))return i.length!==a.length?!1:i.every((y,p)=>o(y,a[p]));const c=Object.keys(i),f=Object.keys(a);return c.length!==f.length?!1:c.every(y=>o(i[y],a[y]))},s=t.get(r);if(s&&!o(n,s.oldValue))try{s.callback(n,s.oldValue,e),s.oldValue=n}catch(i){console.error(`Error in watcher for "${r}":`,i)}for(const[i,a]of t.entries())if(a.options.deep&&r.startsWith(i+"."))try{const c=le(e,i);o(c,a.oldValue)||(a.callback(c,a.oldValue,e),a.oldValue=c)}catch(c){console.error(`Error in deep watcher for "${i}":`,c)}}function He(e,t,r){if(!t.props)return;function n(o,s){return s===Boolean?o==="true":s===Number?Number(o):o}Object.entries(t.props).forEach(([o,s])=>{if(s.type===Function&&typeof e[o]=="function")r[o]=e[o];else{const i=e.getAttribute(de(o));i!==null?r[o]=ae(n(i,s.type)):"default"in s&&s.default!==void 0&&(r[o]=ae(s.default))}})}function qe(e,t,r,n){e.onConnected&&!r&&(e.onConnected(t),n(!0))}function Ie(e,t,r,n,o,s,i,a){e.onDisconnected&&e.onDisconnected(t),r.forEach(c=>c()),n(),o(),s(!1),i(null),a(!1)}function Fe(e,t,r,n,o){e.onAttributeChanged&&e.onAttributeChanged(t,r,n,o)}function N(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))N(r,t)}}function O(e,t){return typeof t=="string"?t.split(".").reduce((r,n)=>r?.[n],e):t}function ye(e,t,r){const n=t.split("."),o=n.pop();if(!o)return;const s=n.reduce((i,a)=>(a in i||(i[a]={}),i[a]),e);s[o]=r}function Ue(e,t,r,n,o,s,i){if(!s)return;const a=t.includes("lazy"),c=t.includes("trim"),f=t.includes("number"),y=()=>{const g=s._state||s;return O(g,e)},p=y();let l="text";const x=n?.type;if(i instanceof HTMLInputElement?l=x||i.type||"text":i instanceof HTMLSelectElement?l="select":i instanceof HTMLTextAreaElement&&(l="textarea"),l==="checkbox")if(Array.isArray(p)){const g=i?.getAttribute("value")||n?.value||"",u=p.includes(g);i&&i.checked!==u&&(r.checked=u)}else{const g=i?.getAttribute("true-value")||!0,u=p===g;i&&i.checked!==u&&(r.checked=u)}else if(l==="radio"){const g=n?.value||"",u=p===g;i&&i.checked!==u&&(r.checked=u)}else if(l==="select")if(i&&i.hasAttribute("multiple")){const g=i,u=Array.isArray(p)?p:[];setTimeout(()=>{Array.from(g.options).forEach(h=>{const b=u.includes(h.value);h.selected!==b&&(h.selected=b)})},0)}else setTimeout(()=>{i instanceof HTMLSelectElement&&i.value!==String(p)&&(i.value=String(p))},0);else{const g=String(p??"");(!i||i.value!==g)&&(r.value=p)}const w=a||l==="checkbox"||l==="radio"||l==="select"?"change":"input",$=g=>{if(g.isComposing||o._isComposing||g.isTrusted===!1)return;const u=g.target;if(u._modelUpdating)return;const h=y();let b=u.value;if(l==="checkbox")if(Array.isArray(h)){const k=u.getAttribute("value")||"",S=[...h];if(u.checked)S.includes(k)||S.push(k);else{const _=S.indexOf(k);_>-1&&S.splice(_,1)}b=S}else{const k=u.getAttribute("true-value")||!0,S=u.getAttribute("false-value")||!1;b=u.checked?k:S}else if(l==="radio")b=u.getAttribute("value")||u.value;else if(l==="select"&&u.multiple){const k=u;b=Array.from(k.selectedOptions).map(S=>S.value)}else if(c&&(b=b.trim()),f){const k=Number(b);isNaN(k)||(b=k)}const d=s._state||s,v=O(d,e);if(Array.isArray(b)&&Array.isArray(v)?JSON.stringify([...b].sort())!==JSON.stringify([...v].sort()):b!==v){const k=g.target;k._modelUpdating=!0,ye(d,e,b),setTimeout(()=>{k._modelUpdating=!1},0),s._requestRender&&s._requestRender()}};if(o[w]=$,l==="text"||l==="textarea"){const g=()=>{o._isComposing=!0},u=h=>{o._isComposing=!1;const b=h.target;setTimeout(()=>{if(b){let d=b.value;if(c&&(d=d.trim()),f){const S=Number(d);isNaN(S)||(d=S)}const v=s._state||s,m=O(v,e);(Array.isArray(d)&&Array.isArray(m)?JSON.stringify([...d].sort())!==JSON.stringify([...m].sort()):d!==m)&&(b&&(b._modelUpdating=!0,setTimeout(()=>{b._modelUpdating=!1},0)),ye(v,e,d),s._requestRender&&s._requestRender())}},0)};o.compositionstart=g,o.compositionend=u}}function Ke(e,t,r,n){if(n){if(typeof e=="object"&&e!==null)for(const[o,s]of Object.entries(e))t[o]=s;else if(typeof e=="string")try{const o=JSON.parse(e);if(typeof o=="object"&&o!==null){for(const[s,i]of Object.entries(o))t[s]=i;return}}catch{const o=O(n,e);r[e]=o}}}function Ve(e,t,r){if(!r)return;const n=O(r,e),o=t.style||"",s=n?"":"none";if(o){const i=o.split(";").filter(Boolean),a=i.findIndex(c=>c.trim().startsWith("display:"));a>=0?i[a]=`display: ${s}`:i.push(`display: ${s}`),t.style=i.join("; ")}else t.style=`display: ${s}`}function Je(e,t,r){if(!r)return;const n=O(r,e);let o=[];typeof n=="string"?o=[n]:Array.isArray(n)?o=n.filter(Boolean):typeof n=="object"&&(o=Object.entries(n).filter(([,a])=>!!a).flatMap(([a])=>a.split(/\s+/).filter(Boolean)));const s=t.class||"",i=s?`${s} ${o.join(" ")}`.trim():o.join(" ");i&&(t.class=i)}function Ze(e,t,r){let n;if(typeof e=="string"){if(!r)return;n=O(r,e)}else n=e;let o="";if(typeof n=="string")o=n;else if(n&&typeof n=="object"){const i=[];for(const[a,c]of Object.entries(n))if(c!=null&&c!==""){const f=a.replace(/[A-Z]/g,l=>`-${l.toLowerCase()}`),y=["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 p=String(c);typeof c=="number"&&y.includes(f)&&(p=`${c}px`),i.push(`${f}: ${p}`)}o=i.join("; ")+(i.length>0?";":"")}const s=t.style||"";t.style=s+(s&&!s.endsWith(";")?"; ":"")+o}function $e(e,t,r,n){const o={},s={...n||{}},i={};for(const[a,c]of Object.entries(e)){const{value:f,modifiers:y}=c;switch(a){case"model":Ue(typeof f=="string"?f:String(f),y,o,s,i,t,r);break;case"bind":Ke(f,o,s,t);break;case"show":Ve(f,s,t);break;case"class":Je(f,s,t);break;case"style":Ze(f,s,t);break}}return{props:o,attrs:s,listeners:i}}function ce(e,t){if(Array.isArray(e)){const s=new Set;return e.map(i=>{if(!i||typeof i!="object")return i;let a=i.props?.key??i.key;if(!a){const p=i.tag||"node",l=i.props?.attrs?.id??i.props?.attrs?.name??i.props?.attrs?.["data-key"]??"";a=l?`${t}:${p}:${l}`:`${t}:${p}`}let c=a,f=1;for(;s.has(c);)c=`${a}#${f++}`;s.add(c);let y=i.children;return Array.isArray(y)&&(y=ce(y,c)),{...i,key:c,children:y}})}const r=e;let n=r.props?.key??r.key??t,o=r.children;return Array.isArray(o)&&(o=ce(o,n)),{...r,key:n,children:o}}function Qe(e,t,r,n){const o=r.directives??{},s=$e(o,n,e,r.attrs),i={...t.props,...r.props,...s.props},a={...t.attrs,...r.attrs,...s.attrs},c=t.props??{},f=i;for(const l in{...c,...f}){const x=c[l],w=f[l];x!==w&&(l==="value"&&(e instanceof HTMLInputElement||e instanceof HTMLTextAreaElement||e instanceof HTMLSelectElement)?e.value!==w&&(e.value=w??""):l==="checked"&&e instanceof HTMLInputElement?e.checked=!!w:l.startsWith("on")&&typeof w=="function"?(typeof x=="function"&&e.removeEventListener(l.slice(2).toLowerCase(),x),e.addEventListener(l.slice(2).toLowerCase(),w)):w==null||w===!1?e.removeAttribute(l):e.setAttribute(l,String(w)))}for(const[l,x]of Object.entries(s.listeners||{}))e.addEventListener(l,x);const y=t.attrs??{},p=a;for(const l in{...y,...p}){const x=y[l],w=p[l];x!==w&&(w==null||w===!1?e.removeAttribute(l):e.setAttribute(l,String(w)))}}function L(e,t,r){if(typeof e=="string")return document.createTextNode(e);if(e.tag==="#text"){const p=document.createTextNode(typeof e.children=="string"?e.children:"");return e.key!=null&&(p.key=e.key),p}if(e.tag==="#anchor"){const p=e,l=Array.isArray(p.children)?p.children:[],x=document.createTextNode(""),w=document.createTextNode("");p.key!=null&&(x.key=`${p.key}:start`,w.key=`${p.key}:end`),p._startNode=x,p._endNode=w;const $=document.createDocumentFragment();$.appendChild(x);for(const g of l){const u=L(g,t);$.appendChild(u)}return $.appendChild(w),$}const n=document.createElement(e.tag);e.key!=null&&(n.key=e.key);const{props:o={},attrs:s={},directives:i={}}=e.props??{},a=$e(i,t,n,s),c={...o,...a.props},f={...s,...a.attrs};for(const p in f){const l=f[p];if(typeof p!="string"||/\[object Object\]/.test(p)){typeof window<"u"&&window.console&&console.warn("Skipping invalid attribute key:",p,l);continue}typeof l=="boolean"?l&&n.setAttribute(p,""):l!=null&&n.setAttribute(p,l)}for(const p in c){const l=c[p];if(typeof p!="string"||/\[object Object\]/.test(p)){typeof window<"u"&&window.console&&console.warn("Skipping invalid prop key:",p,l);continue}if(p==="value"&&(n instanceof HTMLInputElement||n instanceof HTMLTextAreaElement||n instanceof HTMLSelectElement))n.value=l??"";else if(p==="checked"&&n instanceof HTMLInputElement)n.checked=!!l;else if(p.startsWith("on")&&typeof l=="function")n.addEventListener(p.slice(2).toLowerCase(),l);else{if(p.startsWith("on")&&l===void 0)continue;l==null||l===!1?n.removeAttribute(p):n.setAttribute(p,String(l))}}for(const[p,l]of Object.entries(a.listeners||{}))n.addEventListener(p,l);const y=e.props?.ref??(e.props?.props&&e.props.props.ref);if(typeof e!="string"&&y&&r&&(r[y]=n),Array.isArray(e.children))for(const p of e.children)n.appendChild(L(p,t,r));else typeof e.children=="string"&&(n.textContent=e.children);return n}function Xe(e,t,r,n,o){if(typeof r=="string"){e.textContent!==r&&(e.textContent=r);return}if(!Array.isArray(r))return;const s=Array.from(e.childNodes),i=Array.isArray(t)?t:[],a=new Map;for(const x of i)x&&x.key!=null&&a.set(x.key,x);const c=new Map;for(const x of s){const w=x.key;w!=null&&c.set(w,x)}const f=new Set;let y=e.firstChild;function p(x,w){let $=x;for(;$&&(f.add($),$!==w);)$=$.nextSibling}function l(x,w,$,g){const u=[];let h=x.nextSibling;for(;h&&h!==w;)u.push(h),h=h.nextSibling;const b=Array.isArray($)?$:[];if(g.some(v=>v&&v.key!=null)||b.some(v=>v&&v.key!=null)){const v=new Map,m=new Map;for(const _ of b)_&&_.key!=null&&v.set(_.key,_);for(const _ of u){const E=_.key;E!=null&&m.set(E,_)}const k=new Set;let S=x.nextSibling;for(const _ of g){let E;if(_.key!=null&&m.has(_.key)){const A=v.get(_.key);E=V(m.get(_.key),A,_,n),k.add(E),E!==S&&e.contains(E)&&e.insertBefore(E,S)}else E=L(_,n),e.insertBefore(E,S),k.add(E);S=E.nextSibling}for(const _ of u)!k.has(_)&&e.contains(_)&&e.removeChild(_)}else{const v=Math.min(b.length,g.length);for(let m=0;m<v;m++){const k=b[m],S=g[m],_=V(u[m],k,S,n);_!==u[m]&&(e.insertBefore(_,u[m]),e.removeChild(u[m]))}for(let m=v;m<g.length;m++)e.insertBefore(L(g[m],n),w);for(let m=v;m<u.length;m++)e.removeChild(u[m])}}for(const x of r){let w;if(x.tag==="#anchor"){const $=x.key,g=`${$}:start`,u=`${$}:end`;let h=c.get(g),b=c.get(u);const d=Array.isArray(x.children)?x.children:[];if(h||(h=document.createTextNode(""),h.key=g),b||(b=document.createTextNode(""),b.key=u),x._startNode=h,x._endNode=b,!e.contains(h)||!e.contains(b)){e.insertBefore(h,y);for(const v of d)e.insertBefore(L(v,n),y);e.insertBefore(b,y)}else l(h,b,a.get($)?.children,d);p(h,b),y=b.nextSibling;continue}if(x.key!=null&&c.has(x.key)){const $=a.get(x.key);w=V(c.get(x.key),$,x,n,o),f.add(w),w!==y&&e.contains(w)&&(y&&!e.contains(y)&&(y=null),e.insertBefore(w,y))}else w=L(x,n,o),y&&!e.contains(y)&&(y=null),e.insertBefore(w,y),f.add(w);y=w.nextSibling}for(const x of s)!f.has(x)&&e.contains(x)&&(N(x,o),e.removeChild(x))}function V(e,t,r,n,o){if(t&&typeof t!="string"&&t.props?.ref&&o&&N(e,o),t===r)return e;if(typeof r=="string"){if(e.nodeType===Node.TEXT_NODE)return e.textContent!==r&&(e.textContent=r),e;{const i=document.createTextNode(r);return e.parentNode?.replaceChild(i,e),i}}if(r&&typeof r!="string"&&r.tag==="#anchor"){const i=r,a=Array.isArray(i.children)?i.children:[],c=i._startNode??document.createTextNode(""),f=i._endNode??document.createTextNode("");i.key!=null&&(c.key=`${i.key}:start`,f.key=`${i.key}:end`),i._startNode=c,i._endNode=f;const y=document.createDocumentFragment();y.appendChild(c);for(const p of a){const l=L(p,n);y.appendChild(l)}return y.appendChild(f),e.parentNode?.replaceChild(y,e),c}if(!r){N(e,o);const i=document.createComment("removed");return e.parentNode?.replaceChild(i,e),i}if(!t||typeof t=="string"){N(e,o);const i=L(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),e.parentNode?.replaceChild(i,e),i}if(r.tag==="#anchor"){const i=Array.isArray(r.children)?r.children:[],a=r._startNode??document.createTextNode(""),c=r._endNode??document.createTextNode("");r.key!=null&&(a.key=`${r.key}:start`,c.key=`${r.key}:end`),r._startNode=a,r._endNode=c;const f=document.createDocumentFragment();f.appendChild(a);for(const y of i)f.appendChild(L(y,n));return f.appendChild(c),e.parentNode?.replaceChild(f,e),a}if(typeof t!="string"&&typeof r!="string"&&t.tag===r.tag&&t.key===r.key){const i=e;return Qe(i,t.props||{},r.props||{},n),Xe(i,t.children,r.children,n,o),typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=i),i}N(e,o);const s=L(r,n,o);return typeof r!="string"&&r.props?.ref&&o&&(o[r.props.ref]=s),e.parentNode?.replaceChild(s,e),s}function Ye(e,t,r,n){let o;Array.isArray(t)?t.length===1?(o=t[0],o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})):o={tag:"div",key:"__root__",children:t}:(o=t,o&&typeof o=="object"&&o.key==null&&(o={...o,key:"__root__"})),o&&typeof o=="object"&&o.tag==="#anchor"&&(o={tag:"div",key:"__anchor_root__",props:{attrs:{"data-anchor-block-root":"",key:"__anchor_root__"}},children:[o]}),o=ce(o,String(o.key??"root"));const s=e._prevVNode??null,i=e._prevDom??e.firstChild??null;let a;s&&i?typeof s!="string"&&typeof o!="string"&&s.tag===o.tag&&s.key===o.key?a=V(i,s,o,r,n):(a=L(o,r,n),e.replaceChild(a,i)):(a=L(o,r,n),e.firstChild?e.replaceChild(a,e.firstChild):e.appendChild(a));const c=[];for(let f=0;f<e.childNodes.length;f++){const y=e.childNodes[f];y!==a&&y.nodeName!=="STYLE"&&(N(y,n),c.push(y))}c.forEach(f=>e.removeChild(f)),e._prevVNode=o,e._prevDom=a}function pe(e,...t){let r="";for(let n=0;n<e.length;n++)r+=e[n],n<t.length&&(r+=t[n]);return r}function Se(e){return e.replace(/\/\*[\s\S]*?\*\//g,"").replace(/\s+/g," ").replace(/\s*([{}:;,>+~])\s*/g,"$1").replace(/;}/g,"}").trim()}let U=null;function me(){return U||(U=new CSSStyleSheet,U.replaceSync(Se(et))),U}function Ge(e){return e.replace(/url\s*\(\s*['"]?javascript:[^)]*\)/gi,"").replace(/<script[\s\S]*?>[\s\S]*?<\/script>/gi,"").replace(/expression\s*\([^)]*\)/gi,"")}const et=pe`
|
|
2
2
|
:host, *, ::before, ::after {
|
|
3
3
|
all: isolate;
|
|
4
4
|
box-sizing: border-box;
|
|
@@ -56,33 +56,33 @@
|
|
|
56
56
|
sup { top: -.5em }
|
|
57
57
|
[disabled], [aria-disabled=true] { cursor: not-allowed }
|
|
58
58
|
[hidden] { display: none }
|
|
59
|
-
`,Ke={gray:{50:"var(--color-gray-50, #f9fafb)",100:"var(--color-gray-100, #f3f4f6)",200:"var(--color-gray-200, #e5e7eb)",300:"var(--color-gray-300, #d1d5db)",400:"var(--color-gray-400, #9ca3af)",500:"var(--color-gray-500, #6b7280)",600:"var(--color-gray-600, #4b5563)",700:"var(--color-gray-700, #374151)",800:"var(--color-gray-800, #1f2937)",900:"var(--color-gray-900, #111827)"},neutral:{50:"var(--color-neutral-50, #fafafa)",100:"var(--color-neutral-100, #f5f5f5)",200:"var(--color-neutral-200, #e5e5e5)",300:"var(--color-neutral-300, #d4d4d4)",400:"var(--color-neutral-400, #a3a3a3)",500:"var(--color-neutral-500, #737373)",600:"var(--color-neutral-600, #525252)",700:"var(--color-neutral-700, #404040)",800:"var(--color-neutral-800, #262626)",900:"var(--color-neutral-900, #171717)"},slate:{50:"var(--color-slate-50, #f8fafc)",100:"var(--color-slate-100, #f1f5f9)",200:"var(--color-slate-200, #e2e8f0)",300:"var(--color-slate-300, #cbd5e1)",400:"var(--color-slate-400, #94a3b8)",500:"var(--color-slate-500, #64748b)",600:"var(--color-slate-600, #475569)",700:"var(--color-slate-700, #334155)",800:"var(--color-slate-800, #1e293b)",900:"var(--color-slate-900, #0f172a)"},zinc:{50:"var(--color-zinc-50, #fafafa)",100:"var(--color-zinc-100, #f4f4f5)",200:"var(--color-zinc-200, #e4e4e7)",300:"var(--color-zinc-300, #d4d4d8)",400:"var(--color-zinc-400, #a1a1aa)",500:"var(--color-zinc-500, #71717a)",600:"var(--color-zinc-600, #52525b)",700:"var(--color-zinc-700, #3f3f46)",800:"var(--color-zinc-800, #27272a)",900:"var(--color-zinc-900, #18181b)"},red:{50:"var(--color-red-50, #fef2f2)",100:"var(--color-red-100, #fee2e2)",200:"var(--color-red-200, #fecaca)",300:"var(--color-red-300, #fca5a5)",400:"var(--color-red-400, #f87171)",500:"var(--color-red-500, #ef4444)",600:"var(--color-red-600, #dc2626)",700:"var(--color-red-700, #b91c1c)",800:"var(--color-red-800, #991b1b)",900:"var(--color-red-900, #7f1d1d)"},blue:{50:"var(--color-blue-50, #eff6ff)",100:"var(--color-blue-100, #dbeafe)",200:"var(--color-blue-200, #bfdbfe)",300:"var(--color-blue-300, #93c5fd)",400:"var(--color-blue-400, #60a5fa)",500:"var(--color-blue-500, #3b82f6)",600:"var(--color-blue-600, #2563eb)",700:"var(--color-blue-700, #1d4ed8)",800:"var(--color-blue-800, #1e40af)",900:"var(--color-blue-900, #1e3a8a)"},green:{50:"var(--color-green-50, #f0fdf4)",100:"var(--color-green-100, #dcfce7)",200:"var(--color-green-200, #bbf7d0)",300:"var(--color-green-300, #86efac)",400:"var(--color-green-400, #4ade80)",500:"var(--color-green-500, #22c55e)",600:"var(--color-green-600, #16a34a)",700:"var(--color-green-700, #15803d)",800:"var(--color-green-800, #166534)",900:"var(--color-green-900, #14532d)"},amber:{50:"var(--color-amber-50, #fffbeb)",100:"var(--color-amber-100, #fef3c7)",200:"var(--color-amber-200, #fde68a)",300:"var(--color-amber-300, #fcd34d)",400:"var(--color-amber-400, #fbbf24)",500:"var(--color-amber-500, #f59e0b)",600:"var(--color-amber-600, #d97706)",700:"var(--color-amber-700, #b45309)",800:"var(--color-amber-800, #92400e)",900:"var(--color-amber-900, #78350f)"},indigo:{50:"var(--color-indigo-50, #eef2ff)",100:"var(--color-indigo-100, #e0e7ff)",200:"var(--color-indigo-200, #c7d2fe)",300:"var(--color-indigo-300, #a5b4fc)",400:"var(--color-indigo-400, #818cf8)",500:"var(--color-indigo-500, #6366f1)",600:"var(--color-indigo-600, #4f46e5)",700:"var(--color-indigo-700, #4338ca)",800:"var(--color-indigo-800, #3730a3)",900:"var(--color-indigo-900, #312e81)"},emerald:{50:"var(--color-emerald-50, #ecfdf5)",100:"var(--color-emerald-100, #d1fae5)",200:"var(--color-emerald-200, #a7f3d0)",300:"var(--color-emerald-300, #6ee7b7)",400:"var(--color-emerald-400, #34d399)",500:"var(--color-emerald-500, #10b981)",600:"var(--color-emerald-600, #059669)",700:"var(--color-emerald-700, #047857)",800:"var(--color-emerald-800, #065f46)",900:"var(--color-emerald-900, #064e3b)"},rose:{50:"var(--color-rose-50, #fff1f2)",100:"var(--color-rose-100, #ffe4e6)",200:"var(--color-rose-200, #fecdd3)",300:"var(--color-rose-300, #fda4af)",400:"var(--color-rose-400, #fb7185)",500:"var(--color-rose-500, #f43f5e)",600:"var(--color-rose-600, #e11d48)",700:"var(--color-rose-700, #be123c)",800:"var(--color-rose-800, #9f1239)",900:"var(--color-rose-900, #881337)"},white:{DEFAULT:"var(--color-white, #ffffff)"},black:{DEFAULT:"var(--color-black, #000000)"}},V={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-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-6":"grid-template-rows:repeat(6,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-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-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;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;",rounded:"border-radius:0.25rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-full":"border-radius:9999px;","ring-0":"box-shadow:none;","ring-1":"box-shadow:0 0 0 1px rgba(59,130,246,0.5);","ring-2":"box-shadow:0 0 0 2px rgba(59,130,246,0.5);","ring-4":"box-shadow:0 0 0 4px rgba(59,130,246,0.5);","ring-8":"box-shadow:0 0 0 8px rgba(59,130,246,0.5);","shadow-none":"box-shadow:0 0 #0000;","shadow-xs":"box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);","shadow-sm":"box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);","shadow-md":"box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);","shadow-lg":"box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);","shadow-xl":"box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);","shadow-2xl":"box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",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-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","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;"},Ue="0.25rem",de={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 j(e,t){let r=0;for(let n=0;n<e.length;n++){const o=e[n];if(o==="[")r++;else if(o==="]")r--;else if(r===0&&(o===">"||o==="+"||o==="~"||o===" "))return e.slice(0,n)+t+e.slice(n)}return e+t}const Ve={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${j(e,":hover")}{${t}}`,focus:(e,t)=>`${j(e,":focus")}{${t}}`,active:(e,t)=>`${j(e,":active")}{${t}}`,disabled:(e,t)=>`${j(e,":disabled")}{${t}}`,visited:(e,t)=>`${j(e,":visited")}{${t}}`,checked:(e,t)=>`${j(e,":checked")}{${t}}`,first:(e,t)=>`${j(e,":first-child")}{${t}}`,last:(e,t)=>`${j(e,":last-child")}{${t}}`,odd:(e,t)=>`${j(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${j(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${j(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${j(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},J={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)"},Q=["sm","md","lg","xl","2xl"];function Z(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const o=n.slice(0,-1).join("-"),s=n[n.length-1],i=parseFloat(s);if(Number.isNaN(i)||!de[o])return null;const a=t?"-":"";return de[o].map(c=>`${c}:calc(${a}${Ue} * ${i});`).join("")}function pe(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,o=r>>8&255,s=r&255;return`${n} ${o} ${s}`}function Je(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,o="DEFAULT"]=t,s=Ke[n]?.[o];return s?`${{bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color",placeholder:"placeholder-color",fill:"fill-color",stroke:"stroke-color"}[r]}:${s};`:null}function Qe(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 X(e){const{base:t,opacity:r}=Qe(e),n=Je(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=pe(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}const o=F(t);if(o&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=pe(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}function Y(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 F(e){const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let o=e.slice(t+2,-1);o=o.replace(/_/g," ");const i={bg:"background-color",text:"color",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",shadow:"box-shadow",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",delay:"transition-delay",weight:"font-weight",leading:"line-height",z:"z-index"}[n]??n.replace(/_/g,"-");if(i&&o)return`${i}:${o};`}return null}function he(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 Ze(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function Xe(e){const t=/class\s*=\s*["']([^"']+)["']/g,r=[];let n;for(;n=t.exec(e);){const o=n[1].match(/(?:\[[^\]]+\]:[^\s]+|[^\s]+)/g);o&&r.push(...o)}return r.filter(Boolean)}const ge=new Map,Ye=16;function Ge(e){const t=Date.now(),r=ge.get(e);if(r&&t-r.timestamp<Ye)return r.css;const n=Xe(e),o=new Set(n),s=[],i=[],a=[],c=[],f={};function y(m,g=!1){const u=(g?"dark|":"")+m;if(u in f)return f[u];const p=v(m,g);return f[u]=p,p}function h(m){const g=m.some(p=>Q.includes(p)),u=m.includes("dark");return m.length===0?1:!g&&!u?2:g&&!u?3:4}function l(m){const g=[];let u="",p=0;for(let w=0;w<m.length;w++){const d=m[w];d==="["&&p++,d==="]"&&p>0&&p--,d===":"&&p===0?(g.push(u),u=""):u+=d}return u&&g.push(u),g}function v(m,g=!1){const u=l(m),p=u.find(E=>V[E]||Z(E)||Y(E)||X(E)||F(E));if(!p)return null;const w=V[p]??Z(p)??Y(p)??X(p)??F(p);if(!w)return null;const d=u.indexOf(p);let b=d>=0?u.slice(0,d):[];g&&(b=b.filter(E=>E!=="dark"));const $=b.find(E=>he(E)),k=`.${Ze(m)}`;let S;const _=w;if($){const E=he($);E?E.includes("&")?S=E.replace(/&/g,k):S=`${E}${k}`:S=k}else S=k;for(const E of b){if(Q.includes(E)||E==="dark"||E===$)continue;const ce=Ve[E];typeof ce=="function"&&(S=ce(S,_).replace(/\{.*$/,""))}let C=`${S}{${_}}`;const A=b.filter(E=>Q.includes(E)),T=A.length?A[A.length-1]:null,le=b.includes("dark");return g&&T?C=`@media (prefers-color-scheme: dark) and ${J[T]}{${C}}`:g?C=`@media (prefers-color-scheme: dark){${C}}`:le&&T?C=`@media (prefers-color-scheme: dark) and ${J[T]}{${C}}`:le?C=`@media (prefers-color-scheme: dark){${C}}`:T&&(C=`@media ${J[T]}{${C}}`),C}for(const m of o){const g=m.split(":"),u=g.find(b=>V[b]||Z(b)||Y(b)||X(b)||F(b));if(!u)continue;const p=g.indexOf(u),w=p>=0?g.slice(0,p):[],d=h(w);if(d===4){const b=y(m,!0);b&&c.push(b)}else{const b=y(m);b&&(d===1?s.push(b):d===2?i.push(b):d===3&&a.push(b))}}const x=[...s,...i,...a,...c].join("");return ge.set(e,{css:x,timestamp:t}),x}const D=[];function et(e,t,r,n,o,s,i,a){if(e){D.push(r);try{if(t.loadingTemplate&&r.isLoading){O(e,t.loadingTemplate(r),r,n,o);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&O(e,t.errorTemplate(r.error,r),r,n,o);return}const c=t.render(r);if(c instanceof Promise){s(!0),c.then(f=>{s(!1),i(null),O(e,f,r,n,o),a(e.innerHTML)}).catch(f=>{s(!1),i(f),t.errorTemplate&&O(e,t.errorTemplate(f,r),r,n,o)}),t.loadingTemplate&&O(e,t.loadingTemplate(r),r,n,o);return}O(e,c,r,n,o),a(e.innerHTML)}finally{D.pop()}}}function O(e,t,r,n,o){e&&(qe(e,Array.isArray(t)?t:[t],r,n),o(e.innerHTML))}function tt(e,t,r,n,o,s,i){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(o(r+1),r>10){console.warn("Potential infinite render loop detected. Skipping render."),i(null);return}}else o(0);const c=setTimeout(()=>{n(Date.now()),e(),i(null)},0);i(c)}function rt(e,t,r,n,o,s){if(!e)return;const i=Ge(n);if(!t.style&&(!i||i.trim()==="")){s(null),e.adoptedStyleSheets=[ue()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let c=Ie(`${a}
|
|
59
|
+
`,tt={gray:{50:"var(--color-gray-50, #f9fafb)",100:"var(--color-gray-100, #f3f4f6)",200:"var(--color-gray-200, #e5e7eb)",300:"var(--color-gray-300, #d1d5db)",400:"var(--color-gray-400, #9ca3af)",500:"var(--color-gray-500, #6b7280)",600:"var(--color-gray-600, #4b5563)",700:"var(--color-gray-700, #374151)",800:"var(--color-gray-800, #1f2937)",900:"var(--color-gray-900, #111827)"},neutral:{50:"var(--color-neutral-50, #fafafa)",100:"var(--color-neutral-100, #f5f5f5)",200:"var(--color-neutral-200, #e5e5e5)",300:"var(--color-neutral-300, #d4d4d4)",400:"var(--color-neutral-400, #a3a3a3)",500:"var(--color-neutral-500, #737373)",600:"var(--color-neutral-600, #525252)",700:"var(--color-neutral-700, #404040)",800:"var(--color-neutral-800, #262626)",900:"var(--color-neutral-900, #171717)"},slate:{50:"var(--color-slate-50, #f8fafc)",100:"var(--color-slate-100, #f1f5f9)",200:"var(--color-slate-200, #e2e8f0)",300:"var(--color-slate-300, #cbd5e1)",400:"var(--color-slate-400, #94a3b8)",500:"var(--color-slate-500, #64748b)",600:"var(--color-slate-600, #475569)",700:"var(--color-slate-700, #334155)",800:"var(--color-slate-800, #1e293b)",900:"var(--color-slate-900, #0f172a)"},zinc:{50:"var(--color-zinc-50, #fafafa)",100:"var(--color-zinc-100, #f4f4f5)",200:"var(--color-zinc-200, #e4e4e7)",300:"var(--color-zinc-300, #d4d4d8)",400:"var(--color-zinc-400, #a1a1aa)",500:"var(--color-zinc-500, #71717a)",600:"var(--color-zinc-600, #52525b)",700:"var(--color-zinc-700, #3f3f46)",800:"var(--color-zinc-800, #27272a)",900:"var(--color-zinc-900, #18181b)"},red:{50:"var(--color-red-50, #fef2f2)",100:"var(--color-red-100, #fee2e2)",200:"var(--color-red-200, #fecaca)",300:"var(--color-red-300, #fca5a5)",400:"var(--color-red-400, #f87171)",500:"var(--color-red-500, #ef4444)",600:"var(--color-red-600, #dc2626)",700:"var(--color-red-700, #b91c1c)",800:"var(--color-red-800, #991b1b)",900:"var(--color-red-900, #7f1d1d)"},blue:{50:"var(--color-blue-50, #eff6ff)",100:"var(--color-blue-100, #dbeafe)",200:"var(--color-blue-200, #bfdbfe)",300:"var(--color-blue-300, #93c5fd)",400:"var(--color-blue-400, #60a5fa)",500:"var(--color-blue-500, #3b82f6)",600:"var(--color-blue-600, #2563eb)",700:"var(--color-blue-700, #1d4ed8)",800:"var(--color-blue-800, #1e40af)",900:"var(--color-blue-900, #1e3a8a)"},green:{50:"var(--color-green-50, #f0fdf4)",100:"var(--color-green-100, #dcfce7)",200:"var(--color-green-200, #bbf7d0)",300:"var(--color-green-300, #86efac)",400:"var(--color-green-400, #4ade80)",500:"var(--color-green-500, #22c55e)",600:"var(--color-green-600, #16a34a)",700:"var(--color-green-700, #15803d)",800:"var(--color-green-800, #166534)",900:"var(--color-green-900, #14532d)"},amber:{50:"var(--color-amber-50, #fffbeb)",100:"var(--color-amber-100, #fef3c7)",200:"var(--color-amber-200, #fde68a)",300:"var(--color-amber-300, #fcd34d)",400:"var(--color-amber-400, #fbbf24)",500:"var(--color-amber-500, #f59e0b)",600:"var(--color-amber-600, #d97706)",700:"var(--color-amber-700, #b45309)",800:"var(--color-amber-800, #92400e)",900:"var(--color-amber-900, #78350f)"},indigo:{50:"var(--color-indigo-50, #eef2ff)",100:"var(--color-indigo-100, #e0e7ff)",200:"var(--color-indigo-200, #c7d2fe)",300:"var(--color-indigo-300, #a5b4fc)",400:"var(--color-indigo-400, #818cf8)",500:"var(--color-indigo-500, #6366f1)",600:"var(--color-indigo-600, #4f46e5)",700:"var(--color-indigo-700, #4338ca)",800:"var(--color-indigo-800, #3730a3)",900:"var(--color-indigo-900, #312e81)"},emerald:{50:"var(--color-emerald-50, #ecfdf5)",100:"var(--color-emerald-100, #d1fae5)",200:"var(--color-emerald-200, #a7f3d0)",300:"var(--color-emerald-300, #6ee7b7)",400:"var(--color-emerald-400, #34d399)",500:"var(--color-emerald-500, #10b981)",600:"var(--color-emerald-600, #059669)",700:"var(--color-emerald-700, #047857)",800:"var(--color-emerald-800, #065f46)",900:"var(--color-emerald-900, #064e3b)"},rose:{50:"var(--color-rose-50, #fff1f2)",100:"var(--color-rose-100, #ffe4e6)",200:"var(--color-rose-200, #fecdd3)",300:"var(--color-rose-300, #fda4af)",400:"var(--color-rose-400, #fb7185)",500:"var(--color-rose-500, #f43f5e)",600:"var(--color-rose-600, #e11d48)",700:"var(--color-rose-700, #be123c)",800:"var(--color-rose-800, #9f1239)",900:"var(--color-rose-900, #881337)"},white:{DEFAULT:"var(--color-white, #ffffff)"},black:{DEFAULT:"var(--color-black, #000000)"}},Y={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-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-6":"grid-template-rows:repeat(6,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-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-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;","rounded-none":"border-radius:0;","rounded-xs":"border-radius:0.125rem;",rounded:"border-radius:0.25rem;","rounded-sm":"border-radius:0.25rem;","rounded-md":"border-radius:0.375rem;","rounded-lg":"border-radius:0.5rem;","rounded-full":"border-radius:9999px;","ring-0":"box-shadow:none;","ring-1":"box-shadow:0 0 0 1px rgba(59,130,246,0.5);","ring-2":"box-shadow:0 0 0 2px rgba(59,130,246,0.5);","ring-4":"box-shadow:0 0 0 4px rgba(59,130,246,0.5);","ring-8":"box-shadow:0 0 0 8px rgba(59,130,246,0.5);","shadow-none":"box-shadow:0 0 #0000;","shadow-xs":"box-shadow:0 1px 2px 0 rgb(0 0 0 / 0.05);","shadow-sm":"box-shadow:0 1px 3px 0 rgb(0 0 0 / 0.1), 0 1px 2px -1px rgb(0 0 0 / 0.1);","shadow-md":"box-shadow:0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);","shadow-lg":"box-shadow:0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);","shadow-xl":"box-shadow:0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);","shadow-2xl":"box-shadow:0 25px 50px -12px rgb(0 0 0 / 0.25);",transition:"transition-property:all;transition-duration:150ms;transition-timing-function:cubic-bezier(0.4,0,0.2,1);",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-colors":"transition-property:color,background-color,border-color,text-decoration-color,fill,stroke;","transition-opacity":"transition-property:opacity;","transition-transform":"transition-property:transform;","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;"},rt="0.25rem",be={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 j(e,t){let r=0,n=0;for(let o=0;o<e.length;o++){const s=e[o];if(s==="[")r++;else if(s==="]"&&r>0)r--;else if(s==="(")n++;else if(s===")"&&n>0)n--;else if(r===0&&n===0&&(s===">"||s==="+"||s==="~"||s===" "))return e.slice(0,o)+t+e.slice(o)}return e+t}const G={before:(e,t)=>`${e}::before{${t}}`,after:(e,t)=>`${e}::after{${t}}`,hover:(e,t)=>`${j(e,":hover")}{${t}}`,focus:(e,t)=>`${j(e,":focus")}{${t}}`,active:(e,t)=>`${j(e,":active")}{${t}}`,disabled:(e,t)=>`${j(e,":disabled")}{${t}}`,visited:(e,t)=>`${j(e,":visited")}{${t}}`,checked:(e,t)=>`${j(e,":checked")}{${t}}`,first:(e,t)=>`${j(e,":first-child")}{${t}}`,last:(e,t)=>`${j(e,":last-child")}{${t}}`,odd:(e,t)=>`${j(e,":nth-child(odd)")}{${t}}`,even:(e,t)=>`${j(e,":nth-child(even)")}{${t}}`,"focus-within":(e,t)=>`${j(e,":focus-within")}{${t}}`,"focus-visible":(e,t)=>`${j(e,":focus-visible")}{${t}}`,"group-hover":(e,t)=>`.group:hover ${e}{${t}}`,"group-focus":(e,t)=>`.group:focus ${e}{${t}}`,"group-active":(e,t)=>`.group:active ${e}{${t}}`,"group-disabled":(e,t)=>`.group:disabled ${e}{${t}}`,"peer-hover":(e,t)=>`.peer:hover ~ ${e}{${t}}`,"peer-focus":(e,t)=>`.peer:focus ~ ${e}{${t}}`,"peer-checked":(e,t)=>`.peer:checked ~ ${e}{${t}}`,"peer-disabled":(e,t)=>`.peer:disabled ~ ${e}{${t}}`},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)"},te=["sm","md","lg","xl","2xl"];function re(e){const t=e.startsWith("-"),n=(t?e.slice(1):e).split("-");if(n.length<2)return null;const o=n.slice(0,-1).join("-"),s=n[n.length-1],i=parseFloat(s);if(Number.isNaN(i)||!be[o])return null;const a=t?"-":"";return be[o].map(c=>`${c}:calc(${a}${rt} * ${i});`).join("")}function ve(e){const t=e.replace("#",""),r=parseInt(t,16),n=r>>16&255,o=r>>8&255,s=r&255;return`${n} ${o} ${s}`}function nt(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,o="DEFAULT"]=t,s=tt[n]?.[o];return s?`${{bg:"background-color",decoration:"text-decoration-color",text:"color",border:"border-color",shadow:"box-shadow",outline:"outline-color",caret:"caret-color",accent:"accent-color",placeholder:"placeholder-color",fill:"fill-color",stroke:"stroke-color"}[r]}:${s};`:null}function ot(e){const[t,r]=e.split("/");if(!r)return{base:t};const n=parseInt(r,10);return isNaN(n)||n<0||n>100?{base:t}:{base:t,opacity:n/100}}function ne(e){const{base:t,opacity:r}=ot(e),n=nt(t);if(n){if(r!==void 0){const s=/#([0-9a-f]{6})/i.exec(n);if(s){const i=ve(s[0]);return n.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return n}const o=J(t);if(o&&r!==void 0){const s=/#([0-9a-f]{6})/i.exec(o);if(s){const i=ve(s[0]);return o.replace(/#([0-9a-f]{6})/i,`rgb(${i} / ${r})`)}}return o}function oe(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 J(e){const t=e.indexOf("-["),r=e.endsWith("]");if(t>0&&r){const n=e.slice(0,t);let o=e.slice(t+2,-1);o=o.replace(/_/g," ");const i={bg:"background-color",text:"color",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",shadow:"box-shadow",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",delay:"transition-delay",weight:"font-weight",leading:"line-height",z:"z-index"}[n]??n.replace(/_/g,"-");if(i&&o)return`${i}:${o};`}return null}function xe(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 it(e){return e.replace(/([!"#$%&'()*+,./:;<=>?@[\\\]^`{|}~])/g,"\\$1")}function st(e){const t=/class\s*=\s*["']([^"']+)["']/g,r=[];let n;for(;n=t.exec(e);){const o=n[1].match(/(?:\[[^\]]+\]:[^\s]+|[^\s]+)/g);o&&r.push(...o)}return r.filter(Boolean)}const we=new Map,at=16;function lt(e){const t=Date.now(),r=we.get(e);if(r&&t-r.timestamp<at)return r.css;const n=st(e),o=new Set(n),s=[],i=[],a=[],c=[],f={};function y(g,u=!1){const h=(u?"dark|":"")+g;if(h in f)return f[h];const b=w(g,u);return f[h]=b,b}function p(g){const u=g.some(b=>te.includes(b)),h=g.includes("dark");return g.length===0?1:!u&&!h?2:u&&!h?3:4}function l(g){const u=[];let h="",b=0,d=0;for(let v=0;v<g.length;v++){const m=g[v];m==="["?b++:m==="]"&&b>0?b--:m==="("?d++:m===")"&&d>0&&d--,m===":"&&b===0&&d===0?(u.push(h),h=""):h+=m}return h&&u.push(h),u}function x(g){switch(g){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(g,u=!1){const h=l(g);let b=!1,d=h.find(C=>(C.startsWith("!")&&(b=!0,C=C.slice(1)),Y[C]||re(C)||oe(C)||ne(C)||J(C)));if(!d)return null;const v=d.replace(/^!/,""),m=Y[v]??re(v)??oe(v)??ne(v)??J(v);if(!m)return null;const k=h.indexOf(d);let S=k>=0?h.slice(0,k):[];u&&(S=S.filter(C=>C!=="dark"));const _=S.find(C=>xe(C)),E=`.${it(g)}`,A="__TW_SUBJECT__";let T,F=b?m.replace(/;$/," !important;"):m;if(_){const C=xe(_);C?C.includes("&")?T=C.replace(/&/g,A):T=`${C}${A}`:T=A}else T=A;const Ee=S.filter(C=>C.startsWith("peer-")),Ae=S.filter(C=>C.startsWith("group-")),Te=S.filter(C=>!C.startsWith("group-")&&!C.startsWith("peer-")&&!te.includes(C)&&C!=="dark"&&C!==_);for(const C of Ee){const B=G[C];typeof B=="function"&&(T=B(T,F).replace(/\{.*$/,""))}for(const C of Ae){const B=G[C];typeof B=="function"&&(T=B(T,F).replace(/\{.*$/,""))}for(const C of Te){const B=x(C);if(B)T=T.replace(A,A+B);else{const ge=G[C];if(typeof ge=="function"){const je=ge(A,F).replace(/\{.*$/,"");T=T.replace(A,je)}}}T=T.replace(new RegExp(A,"g"),E);let z=`${T}{${F}}`;const X=S.filter(C=>te.includes(C)),W=X.length?X[X.length-1]:null,he=S.includes("dark");return u&&W?z=`@media (prefers-color-scheme: dark) and ${ee[W]}{${z}}`:u?z=`@media (prefers-color-scheme: dark){${z}}`:he&&W?z=`@media (prefers-color-scheme: dark) and ${ee[W]}{${z}}`:he?z=`@media (prefers-color-scheme: dark){${z}}`:W&&(z=`@media ${ee[W]}{${z}}`),z}for(const g of o){const u=l(g),h=u.find(m=>Y[m]||re(m)||oe(m)||ne(m)||J(m));if(!h)continue;const b=u.indexOf(h),d=b>=0?u.slice(0,b):[],v=p(d);if(v===4){const m=y(g,!0);m&&c.push(m)}else{const m=y(g);m&&(v===1?s.push(m):v===2?i.push(m):v===3&&a.push(m))}}const $=[...s,...i,...a,...c].join("");return we.set(e,{css:$,timestamp:t}),$}const I=[];function ct(e,t,r,n,o,s,i,a){if(e){I.push(r);try{if(t.loadingTemplate&&r.isLoading){D(e,t.loadingTemplate(r),r,n,o);return}if(t.errorTemplate&&r.hasError){r.error instanceof Error&&D(e,t.errorTemplate(r.error,r),r,n,o);return}const c=t.render(r);if(c instanceof Promise){s(!0),c.then(f=>{s(!1),i(null),D(e,f,r,n,o),a(e.innerHTML)}).catch(f=>{s(!1),i(f),t.errorTemplate&&D(e,t.errorTemplate(f,r),r,n,o)}),t.loadingTemplate&&D(e,t.loadingTemplate(r),r,n,o);return}D(e,c,r,n,o),a(e.innerHTML)}finally{I.pop()}}}function D(e,t,r,n,o){e&&(Ye(e,Array.isArray(t)?t:[t],r,n),o(e.innerHTML))}function ft(e,t,r,n,o,s,i){if(s!==null&&clearTimeout(s),Date.now()-t<16){if(o(r+1),r>10){console.warn("Potential infinite render loop detected. Skipping render."),i(null);return}}else o(0);const c=setTimeout(()=>{n(Date.now()),e(),i(null)},0);i(c)}function ut(e,t,r,n,o,s){if(!e)return;const i=lt(n);if(!t.style&&(!i||i.trim()==="")){s(null),e.adoptedStyleSheets=[me()];return}let a="";t.style&&(typeof t.style=="string"?a=t.style:typeof t.style=="function"&&(a=t.style(r)));let c=Ge(`${a}
|
|
60
60
|
${i}
|
|
61
|
-
`);c=be(c);let f=o;f||(f=new CSSStyleSheet),(f.cssRules.length===0||f.toString()!==c)&&f.replaceSync(c),e.adoptedStyleSheets=[ue(),f],s(f)}const nt=new Map;function oe(e,t,r){let n=se(e);n.includes("-")||(n=`cer-${n}`);let o;typeof t=="function"?o={...r,render:t}:o=t,typeof o.onError!="function"&&(o.onError=(s,i)=>{console.error(`[${n}] Error:`,s,i)}),nt.set(n,o),typeof window<"u"&&!customElements.get(n)&&customElements.define(n,ot(o))}function ot(e){if(!e.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=e;const t=this._initContext(e);Object.defineProperty(t,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(t,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=t,this._applyProps(e),Object.defineProperty(this.context,"emit",{value:(r,n,o)=>{this.dispatchEvent(new CustomEvent(r,{detail:n,bubbles:!0,composed:!0,...o||{}}));const s=`on${r.charAt(0).toUpperCase()}${r.slice(1)}`,i=typeof this[s]=="function"?this[s]:void 0,a=typeof this.context[s]=="function"?this.context[s]:void 0,c=typeof e[s]=="function"?e[s]:void 0;i&&i(n,this.context),a&&a!==i&&a(n,this.context),c&&c!==i&&c!==a&&c(n,this.context)},writable:!1,enumerable:!1,configurable:!1}),Object.keys(e).forEach(r=>{const n=e[r];if(typeof n=="function"&&!r.startsWith("on"))this.context[r]=(...o)=>n(...o,this.context);else if(r.startsWith("on")&&r.length>2&&r[2]===r[2].toUpperCase()){const o=r.slice(2,3).toLowerCase()+r.slice(3);this.addEventListener(o,s=>{const i=typeof this[r]=="function"?this[r]:this.context[r];typeof i=="function"&&i(s.detail,this.context)})}}),this._applyComputed(e),this._initializing=!1,this._initWatchers(e),this._render(e)}connectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{ze(e,this.context,this._mounted,t=>{this._mounted=t})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{Re(e,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},t=>{this._templateLoading=t},t=>{this._templateError=t},t=>{this._mounted=t})})}attributeChangedCallback(t,r,n){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),Be(e,t,r,n,this.context)})}static get observedAttributes(){return e.props?Object.keys(e.props).map(se):[]}_applyComputed(t){this._runLogicWithinErrorBoundary(e,()=>{t.computed&&Object.entries(t.computed).forEach(([r,n])=>{Object.defineProperty(this.context,r,{get:()=>{const o=n(this.context);return te(o)},enumerable:!0})})})}_render(t){this._runLogicWithinErrorBoundary(t,()=>{et(this.shadowRoot,t,this.context,this._refs,r=>{this._lastHtmlStringForJitCSS=r,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(r)},r=>{this._templateLoading=r,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(r)},r=>{this._templateError=r,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(r)},r=>this._applyStyle(t,r))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{tt(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})})}_applyStyle(t,r){this._runLogicWithinErrorBoundary(t,()=>{rt(this.shadowRoot,t,this.context,r,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(t,r){this._hasError&&(this._hasError=!1);try{r()}catch(n){this._hasError=!0,t.onError&&t.onError(n,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(n,this.context))}}_initContext(t){try{let r=function(o,s=""){return Array.isArray(o)?new Proxy(o,{get(i,a,c){const f=Reflect.get(i,a,c);return typeof f=="function"&&typeof a=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(a)?function(...h){const l=f.apply(i,h);if(!n._initializing){const v=s||"root";n._triggerWatchers(v,i),n._render(t)}return l}:f},set(i,a,c){if(i[a]=c,!n._initializing){const f=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(f,c),n._render(t)}return!0},deleteProperty(i,a){if(delete i[a],!n._initializing){const c=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(c,void 0),n._render(t)}return!0}}):o&&typeof o=="object"?(Object.keys(o).forEach(i=>{const a=s?`${s}.${i}`:i;o[i]=r(o[i],a)}),new Proxy(o,{set(i,a,c){const f=s?`${s}.${String(a)}`:String(a);return i[a]=r(c,f),n._initializing||(n._triggerWatchers(f,i[a]),n._render(t)),!0},get(i,a,c){return Reflect.get(i,a,c)}})):o};const n=this;return r({...t.state})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{Te(this.context,this._watchers,t.watch||{})})}_triggerWatchers(t,r){je(this.context,this._watchers,t,r)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{try{Le(this,t,this.context)}catch(r){this._hasError=!0,t.onError&&t.onError(r,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(r,this.context))}})}}}function W(e,t={},r,n){const o=n??t.key;return{tag:e,key:o,props:t,children:r}}function K(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function q(e){return typeof e=="object"&&e!==null&&"tag"in e&&!K(e)}function it(e,t){return e.key!=null?e:{...e,key:t}}function st(e,t=[],r={}){const n={},o={},s={},i=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=i.exec(e);){const c=a[1],f=a[2],y=(a[4]||a[6])??"",h=y.match(/^{{(\d+)}}$/);let l=h?t[Number(h[1])]??null:y;h||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const v=["model","bind","show","class","style"];if(c===":"){const[x,...m]=f.split(".");if(v.includes(x)){const g=[...m];s[x]={value:l,modifiers:g}}else o[f]=l}else if(c==="@"){const x="on"+f.charAt(0).toUpperCase()+f.slice(1);n[x]=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0}else f==="ref"?n.ref=l:o[f]=l}return{props:n,attrs:o,directives:s}}function at(e,t,r){const n=D.length>0?D[D.length-1]:void 0,o=r??n;function s(d,b){return W("#text",{},d,b)}let i="";for(let d=0;d<e.length;d++)i+=e[d],d<t.length&&(i+=`{{${d}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,c=[];let f,y=[],h=null,l={},v,x=0,m=[];function g(d){!d||typeof d!="object"||K(d)||(d.props||d.attrs?(d.props&&(l.props||(l.props={}),Object.assign(l.props,d.props)),d.attrs&&(l.attrs||(l.attrs={}),Object.keys(d.attrs).forEach(b=>{if(b==="style"&&l.attrs.style){const $=l.attrs.style.replace(/;?\s*$/,""),k=d.attrs.style.replace(/^;?\s*/,"");l.attrs.style=$+"; "+k}else if(b==="class"&&l.attrs.class){const $=l.attrs.class.trim().split(/\s+/).filter(Boolean),k=d.attrs.class.trim().split(/\s+/).filter(Boolean),S=[...new Set([...$,...k])];l.attrs.class=S.join(" ")}else l.attrs[b]=d.attrs[b]}))):(l.props||(l.props={}),Object.assign(l.props,d)))}function u(d,b){const $=h?y:m;if(K(d)){const k=d.key??b;let S=d.children;$.push({...d,key:k,children:S});return}if(q(d)){$.push(it(d,void 0));return}if(Array.isArray(d)){if(d.length===0)return;for(let k=0;k<d.length;k++){const S=d[k];K(S)||q(S)||Array.isArray(S)?u(S,`${b}-${k}`):S!==null&&typeof S=="object"?g(S):$.push(s(String(S),`${b}-${k}`))}return}if(d!==null&&typeof d=="object"){g(d);return}$.push(s(String(d),b))}const p=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;f=a.exec(i);)if(f[1]){const d=f[1],b=f[0][1]==="/",$=f[0][f[0].length-2]==="/"||p.has(d),{props:k,attrs:S,directives:_}=st(f[2]||"",t,o),C={props:{},attrs:{}};for(const A in k)C.props[A]=k[A];for(const A in S)C.attrs[A]=S[A];if(Object.keys(_).length>0&&(C.directives={..._}),b){const A=W(h,l,y.length===1&&q(y[0])&&y[0].tag==="#text"?typeof y[0].children=="string"?y[0].children:"":y.length?y:void 0,v),T=c.pop();T?(h=T.tag,l=T.props,v=T.key,y=T.children,y.push(A)):(m.push(A),h=null,l={},v=void 0,y=[])}else $?h?y.push(W(d,C,void 0,void 0)):m.push(W(d,C,void 0,void 0)):(h&&c.push({tag:h,props:l,children:y,key:v}),h=d,l=C,y=[])}else if(typeof f[3]<"u"){const d=Number(f[3]),b=t[d],$=`interp-${d}`;u(b,$)}else if(f[4]){const d=f[4],b=h?y:m,$=d.split(/({{\d+}})/);for(const k of $){if(!k)continue;const S=k.match(/^{{(\d+)}}$/);if(S){const _=Number(S[1]),C=t[_],A=`interp-${_}`;u(C,A)}else{const _=`text-${x++}`;b.push(s(k,_))}}}const w=m.filter(d=>q(d)&&d.tag==="#text"?typeof d.children=="string"&&d.children.trim()!=="":!0);return w.length===1?w[0]:w.length>1?w:W("div",{},"","fallback-root")}function R(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return at(e,t,n)}const ie=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},z=(e,t)=>{for(const r of e){const n=[],o=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${o}$`),i=t.match(s);if(i){const a={};return n.forEach((c,f)=>{a[c]=i[f+1]}),{route:r,params:a}}}return{route:null,params:{}}},G={};async function ve(e){if(e.component)return e.component;if(e.load){if(G[e.path])return G[e.path];try{const t=await e.load();return G[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 xe(e){const{routes:t,base:r="",initialUrl:n}=e;let o,s,i,a,c,f,y;const h=async(m,g)=>{const u=t.find(p=>z([p],m.path).route!==null);if(u?.beforeEnter)try{const p=await u.beforeEnter(m,g);return typeof p=="string"?(await x(p,!0),!1):p!==!1}catch(p){return console.error("beforeEnter error",p),!1}return!0},l=async(m,g)=>{const u=t.find(p=>z([p],m.path).route!==null);if(u?.onEnter)try{const p=await u.onEnter(m,g);return typeof p=="string"?(await x(p,!0),!1):p!==!1}catch(p){return console.error("onEnter error",p),!1}return!0},v=(m,g)=>{const u=t.find(p=>z([p],m.path).route!==null);if(u?.afterEnter)try{u.afterEnter(m,g)}catch(p){console.error("afterEnter error",p)}},x=async(m,g=!1)=>{try{const u={path:m.replace(r,"")||"/",query:{}},p=z(t,u.path);if(!p)throw new Error(`No route found for ${u.path}`);const w=i.getState(),d={path:u.path,params:p.params,query:u.query};if(!await h(d,w)||!await l(d,w))return;typeof window<"u"&&typeof document<"u"&&(g?window.history.replaceState({},"",r+m):window.history.pushState({},"",r+m)),i.setState(d),v(d,w)}catch(u){console.error("Navigation error:",u)}};if(typeof window<"u"&&typeof document<"u"){o=()=>{const g=new URL(window.location.href),u=g.pathname.replace(r,"")||"/",p=ie(g.search);return{path:u,query:p}},s=o();const m=z(t,s.path);i=ee({path:s.path,params:m.params,query:s.query}),a=async(g=!1)=>{const u=o();await x(u.path,g)},window.addEventListener("popstate",()=>a(!0)),c=g=>x(g,!1),f=g=>x(g,!0),y=()=>window.history.back()}else{o=()=>{const u=new URL(n||"/","http://localhost"),p=u.pathname.replace(r,"")||"/",w=ie(u.search);return{path:p,query:w}},s=o();const m=z(t,s.path);i=ee({path:s.path,params:m.params,query:s.query}),a=async()=>{const u=o();await g(u.path)};const g=async u=>{try{const p={path:u.replace(r,"")||"/",query:{}},w=z(t,p.path);if(!w)throw new Error(`No route found for ${p.path}`);const d=i.getState(),b={path:p.path,params:w.params,query:p.query},$=t.find(k=>z([k],b.path).route!==null);if($?.beforeEnter)try{const k=await $.beforeEnter(b,d);if(typeof k=="string"){await g(k);return}if(k===!1)return}catch{return}if($?.onEnter)try{const k=await $.onEnter(b,d);if(typeof k=="string"){await g(k);return}if(k===!1)return}catch{return}if(i.setState(b),$?.afterEnter)try{$.afterEnter(b,d)}catch{}}catch{}};c=async u=>g(u),f=async u=>g(u),y=()=>{}}return{store:i,push:c,replace:f,back:y,subscribe:i.subscribe,matchRoute:m=>z(t,m),getCurrent:()=>i.getState(),resolveRouteComponent:ve}}function lt(e,t){return z(e,t)}function ct(e){const t=xe(e);return oe("router-view",{async render(){if(!t)return R`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:n}=r,o=t.matchRoute(n);if(!o.route)return R`<div>Not found</div>`;let s=o.route.component;if(o.route.load){const i=await o.route.load();typeof i.default=="string"&&(s=i.default)}return typeof s=="string"?{tag:s,props:{},children:[]}:R`<div>Invalid route component</div>`},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),oe("router-link",{state:{},props:{to:{type:String,default:""},tag:{type:String,default:"a"},replace:{type:Boolean,default:!1},exact:{type:Boolean,default:!1},activeClass:{type:String,default:"active"},exactActiveClass:{type:String,default:"exact-active"},ariaCurrentValue:{type:String,default:"page"},disabled:{type:Boolean,default:!1},external:{type:Boolean,default:!1},class:{type:String,default:""},style:{type:String,default:ae`
|
|
61
|
+
`);c=Se(c);let f=o;f||(f=new CSSStyleSheet),(f.cssRules.length===0||f.toString()!==c)&&f.replaceSync(c),e.adoptedStyleSheets=[me(),f],s(f)}const dt=new Map;function fe(e,t,r){let n=de(e);n.includes("-")||(n=`cer-${n}`);let o;typeof t=="function"?o={...r,render:t}:o=t,typeof o.onError!="function"&&(o.onError=(s,i)=>{console.error(`[${n}] Error:`,s,i)}),dt.set(n,o),typeof window<"u"&&!customElements.get(n)&&customElements.define(n,pt(o))}function pt(e){if(!e.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=e;const t=this._initContext(e);Object.defineProperty(t,"refs",{value:this._refs,writable:!1,enumerable:!1,configurable:!1}),Object.defineProperty(t,"requestRender",{value:()=>this.requestRender(),writable:!1,enumerable:!1,configurable:!1}),this.context=t,this._applyProps(e),Object.defineProperty(this.context,"emit",{value:(r,n,o)=>{this.dispatchEvent(new CustomEvent(r,{detail:n,bubbles:!0,composed:!0,...o||{}}));const s=`on${r.charAt(0).toUpperCase()}${r.slice(1)}`,i=typeof this[s]=="function"?this[s]:void 0,a=typeof this.context[s]=="function"?this.context[s]:void 0,c=typeof e[s]=="function"?e[s]:void 0;i&&i(n,this.context),a&&a!==i&&a(n,this.context),c&&c!==i&&c!==a&&c(n,this.context)},writable:!1,enumerable:!1,configurable:!1}),Object.keys(e).forEach(r=>{const n=e[r];if(typeof n=="function"&&!r.startsWith("on"))this.context[r]=(...o)=>n(...o,this.context);else if(r.startsWith("on")&&r.length>2&&r[2]===r[2].toUpperCase()){const o=r.slice(2,3).toLowerCase()+r.slice(3);this.addEventListener(o,s=>{const i=typeof this[r]=="function"?this[r]:this.context[r];typeof i=="function"&&i(s.detail,this.context)})}}),this._applyComputed(e),this._initializing=!1,this._initWatchers(e),this._render(e)}connectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{qe(e,this.context,this._mounted,t=>{this._mounted=t})})}disconnectedCallback(){this._runLogicWithinErrorBoundary(e,()=>{Ie(e,this.context,this._listeners,()=>{this._listeners=[]},()=>{this._watchers.clear()},t=>{this._templateLoading=t},t=>{this._templateError=t},t=>{this._mounted=t})})}attributeChangedCallback(t,r,n){this._runLogicWithinErrorBoundary(e,()=>{this._applyProps(e),Fe(e,t,r,n,this.context)})}static get observedAttributes(){return e.props?Object.keys(e.props).map(de):[]}_applyComputed(t){this._runLogicWithinErrorBoundary(e,()=>{t.computed&&Object.entries(t.computed).forEach(([r,n])=>{Object.defineProperty(this.context,r,{get:()=>{const o=n(this.context);return ae(o)},enumerable:!0})})})}_render(t){this._runLogicWithinErrorBoundary(t,()=>{ct(this.shadowRoot,t,this.context,this._refs,r=>{this._lastHtmlStringForJitCSS=r,typeof this.onHtmlStringUpdate=="function"&&this.onHtmlStringUpdate(r)},r=>{this._templateLoading=r,typeof this.onLoadingStateChange=="function"&&this.onLoadingStateChange(r)},r=>{this._templateError=r,typeof this.onErrorStateChange=="function"&&this.onErrorStateChange(r)},r=>this._applyStyle(t,r))})}requestRender(){this._requestRender()}_requestRender(){this._runLogicWithinErrorBoundary(this._cfg,()=>{ft(()=>this._render(this._cfg),this._lastRenderTime,this._renderCount,t=>{this._lastRenderTime=t},t=>{this._renderCount=t},this._renderTimeoutId,t=>{this._renderTimeoutId=t})})}_applyStyle(t,r){this._runLogicWithinErrorBoundary(t,()=>{ut(this.shadowRoot,t,this.context,r,this._styleSheet,n=>{this._styleSheet=n})})}_runLogicWithinErrorBoundary(t,r){this._hasError&&(this._hasError=!1);try{r()}catch(n){this._hasError=!0,t.onError&&t.onError(n,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(n,this.context))}}_initContext(t){try{let r=function(o,s=""){return Array.isArray(o)?new Proxy(o,{get(i,a,c){const f=Reflect.get(i,a,c);return typeof f=="function"&&typeof a=="string"&&["push","pop","shift","unshift","splice","sort","reverse"].includes(a)?function(...p){const l=f.apply(i,p);if(!n._initializing){const x=s||"root";n._triggerWatchers(x,i),n._render(t)}return l}:f},set(i,a,c){if(i[a]=c,!n._initializing){const f=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(f,c),n._render(t)}return!0},deleteProperty(i,a){if(delete i[a],!n._initializing){const c=s?`${s}.${String(a)}`:String(a);n._triggerWatchers(c,void 0),n._render(t)}return!0}}):o&&typeof o=="object"?(Object.keys(o).forEach(i=>{const a=s?`${s}.${i}`:i;o[i]=r(o[i],a)}),new Proxy(o,{set(i,a,c){const f=s?`${s}.${String(a)}`:String(a);return i[a]=r(c,f),n._initializing||(n._triggerWatchers(f,i[a]),n._render(t)),!0},get(i,a,c){return Reflect.get(i,a,c)}})):o};const n=this;return r({...t.state})}catch{return{}}}_initWatchers(t){this._runLogicWithinErrorBoundary(t,()=>{We(this.context,this._watchers,t.watch||{})})}_triggerWatchers(t,r){De(this.context,this._watchers,t,r)}_applyProps(t){this._runLogicWithinErrorBoundary(t,()=>{try{He(this,t,this.context)}catch(r){this._hasError=!0,t.onError&&t.onError(r,this.context),t.errorFallback&&this.shadowRoot&&(this.shadowRoot.innerHTML=t.errorFallback(r,this.context))}})}}}function q(e,t={},r,n){const o=n??t.key;return{tag:e,key:o,props:t,children:r}}function Z(e){return!!e&&typeof e=="object"&&(e.type==="AnchorBlock"||e.tag==="#anchor")}function K(e){return typeof e=="object"&&e!==null&&"tag"in e&&!Z(e)}function ht(e,t){return e.key!=null?e:{...e,key:t}}function gt(e,t=[],r={}){const n={},o={},s={},i=/([:@#]?)([a-zA-Z0-9-:\.]+)=("([^"\\]*(\\.[^"\\]*)*)"|'([^'\\]*(\\.[^'\\]*)*)')/g;let a;for(;a=i.exec(e);){const c=a[1],f=a[2],y=(a[4]||a[6])??"",p=y.match(/^{{(\d+)}}$/);let l=p?t[Number(p[1])]??null:y;p||(l==="true"?l=!0:l==="false"?l=!1:l==="null"?l=null:isNaN(Number(l))||(l=Number(l)));const x=["model","bind","show","class","style"];if(c===":"){const[w,...$]=f.split(".");if(x.includes(w)){const g=[...$];s[w]={value:l,modifiers:g}}else o[f]=l}else if(c==="@"){const w="on"+f.charAt(0).toUpperCase()+f.slice(1);n[w]=typeof l=="function"?l:typeof r[l]=="function"?r[l]:void 0}else f==="ref"?n.ref=l:o[f]=l}return{props:n,attrs:o,directives:s}}function yt(e,t,r){const n=I.length>0?I[I.length-1]:void 0,o=r??n;function s(d,v){return q("#text",{},d,v)}let i="";for(let d=0;d<e.length;d++)i+=e[d],d<t.length&&(i+=`{{${d}}}`);const a=/<\/?([a-zA-Z0-9-]+)((?:\s+[^\s=>/]+(?:\s*=\s*(?:"(?:\\.|[^"])*"|'(?:\\.|[^'])*'|[^\s>]+))?)*)\s*\/?>|{{(\d+)}}|([^<]+)/g,c=[];let f,y=[],p=null,l={},x,w=0,$=[];function g(d){!d||typeof d!="object"||Z(d)||(d.props||d.attrs?(d.props&&(l.props||(l.props={}),Object.assign(l.props,d.props)),d.attrs&&(l.attrs||(l.attrs={}),Object.keys(d.attrs).forEach(v=>{if(v==="style"&&l.attrs.style){const m=l.attrs.style.replace(/;?\s*$/,""),k=d.attrs.style.replace(/^;?\s*/,"");l.attrs.style=m+"; "+k}else if(v==="class"&&l.attrs.class){const m=l.attrs.class.trim().split(/\s+/).filter(Boolean),k=d.attrs.class.trim().split(/\s+/).filter(Boolean),S=[...new Set([...m,...k])];l.attrs.class=S.join(" ")}else l.attrs[v]=d.attrs[v]}))):(l.props||(l.props={}),Object.assign(l.props,d)))}function u(d,v){const m=p?y:$;if(Z(d)){const k=d.key??v;let S=d.children;m.push({...d,key:k,children:S});return}if(K(d)){m.push(ht(d,void 0));return}if(Array.isArray(d)){if(d.length===0)return;for(let k=0;k<d.length;k++){const S=d[k];Z(S)||K(S)||Array.isArray(S)?u(S,`${v}-${k}`):S!==null&&typeof S=="object"?g(S):m.push(s(String(S),`${v}-${k}`))}return}if(d!==null&&typeof d=="object"){g(d);return}m.push(s(String(d),v))}const h=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]);for(;f=a.exec(i);)if(f[1]){const d=f[1],v=f[0][1]==="/",m=f[0][f[0].length-2]==="/"||h.has(d),{props:k,attrs:S,directives:_}=gt(f[2]||"",t,o),E={props:{},attrs:{}};for(const A in k)E.props[A]=k[A];for(const A in S)E.attrs[A]=S[A];if(Object.keys(_).length>0&&(E.directives={..._}),v){const A=q(p,l,y.length===1&&K(y[0])&&y[0].tag==="#text"?typeof y[0].children=="string"?y[0].children:"":y.length?y:void 0,x),T=c.pop();T?(p=T.tag,l=T.props,x=T.key,y=T.children,y.push(A)):($.push(A),p=null,l={},x=void 0,y=[])}else m?p?y.push(q(d,E,void 0,void 0)):$.push(q(d,E,void 0,void 0)):(p&&c.push({tag:p,props:l,children:y,key:x}),p=d,l=E,y=[])}else if(typeof f[3]<"u"){const d=Number(f[3]),v=t[d],m=`interp-${d}`;u(v,m)}else if(f[4]){const d=f[4],v=p?y:$,m=d.split(/({{\d+}})/);for(const k of m){if(!k)continue;const S=k.match(/^{{(\d+)}}$/);if(S){const _=Number(S[1]),E=t[_],A=`interp-${_}`;u(E,A)}else{const _=`text-${w++}`;v.push(s(k,_))}}}const b=$.filter(d=>K(d)&&d.tag==="#text"?typeof d.children=="string"&&d.children.trim()!=="":!0);return b.length===1?b[0]:b.length>1?b:q("div",{},"","fallback-root")}function P(e,...t){const r=t[t.length-1],n=typeof r=="object"&&r&&!Array.isArray(r)?r:void 0;return yt(e,t,n)}const ue=e=>e?typeof URLSearchParams>"u"?{}:Object.fromEntries(new URLSearchParams(e)):{},R=(e,t)=>{for(const r of e){const n=[],o=r.path.replace(/:[^/]+/g,a=>(n.push(a.slice(1)),"([^/]+)")),s=new RegExp(`^${o}$`),i=t.match(s);if(i){const a={};return n.forEach((c,f)=>{a[c]=i[f+1]}),{route:r,params:a}}}return{route:null,params:{}}},ie={};async function _e(e){if(e.component)return e.component;if(e.load){if(ie[e.path])return ie[e.path];try{const t=await e.load();return ie[e.path]=t.default,t.default}catch{throw new Error(`Failed to load component for route: ${e.path}`)}}throw new Error(`No component or loader defined for route: ${e.path}`)}function Ce(e){const{routes:t,base:r="",initialUrl:n}=e;let o,s,i,a,c,f,y;const p=async($,g)=>{const u=t.find(h=>R([h],$.path).route!==null);if(u?.beforeEnter)try{const h=await u.beforeEnter($,g);return typeof h=="string"?(await w(h,!0),!1):h!==!1}catch(h){return console.error("beforeEnter error",h),!1}return!0},l=async($,g)=>{const u=t.find(h=>R([h],$.path).route!==null);if(u?.onEnter)try{const h=await u.onEnter($,g);return typeof h=="string"?(await w(h,!0),!1):h!==!1}catch(h){return console.error("onEnter error",h),!1}return!0},x=($,g)=>{const u=t.find(h=>R([h],$.path).route!==null);if(u?.afterEnter)try{u.afterEnter($,g)}catch(h){console.error("afterEnter error",h)}},w=async($,g=!1)=>{try{const u={path:$.replace(r,"")||"/",query:{}},h=R(t,u.path);if(!h)throw new Error(`No route found for ${u.path}`);const b=i.getState(),d={path:u.path,params:h.params,query:u.query};if(!await p(d,b)||!await l(d,b))return;typeof window<"u"&&typeof document<"u"&&(g?window.history.replaceState({},"",r+$):window.history.pushState({},"",r+$)),i.setState(d),x(d,b)}catch(u){console.error("Navigation error:",u)}};if(typeof window<"u"&&typeof document<"u"){o=()=>{const g=new URL(window.location.href),u=g.pathname.replace(r,"")||"/",h=ue(g.search);return{path:u,query:h}},s=o();const $=R(t,s.path);i=se({path:s.path,params:$.params,query:s.query}),a=async(g=!1)=>{const u=o();await w(u.path,g)},window.addEventListener("popstate",()=>a(!0)),c=g=>w(g,!1),f=g=>w(g,!0),y=()=>window.history.back()}else{o=()=>{const u=new URL(n||"/","http://localhost"),h=u.pathname.replace(r,"")||"/",b=ue(u.search);return{path:h,query:b}},s=o();const $=R(t,s.path);i=se({path:s.path,params:$.params,query:s.query}),a=async()=>{const u=o();await g(u.path)};const g=async u=>{try{const h={path:u.replace(r,"")||"/",query:{}},b=R(t,h.path);if(!b)throw new Error(`No route found for ${h.path}`);const d=i.getState(),v={path:h.path,params:b.params,query:h.query},m=t.find(k=>R([k],v.path).route!==null);if(m?.beforeEnter)try{const k=await m.beforeEnter(v,d);if(typeof k=="string"){await g(k);return}if(k===!1)return}catch{return}if(m?.onEnter)try{const k=await m.onEnter(v,d);if(typeof k=="string"){await g(k);return}if(k===!1)return}catch{return}if(i.setState(v),m?.afterEnter)try{m.afterEnter(v,d)}catch{}}catch{}};c=async u=>g(u),f=async u=>g(u),y=()=>{}}return{store:i,push:c,replace:f,back:y,subscribe:i.subscribe,matchRoute:$=>R(t,$),getCurrent:()=>i.getState(),resolveRouteComponent:_e}}function mt(e,t){return R(e,t)}function bt(e){const t=Ce(e);return fe("router-view",{async render(){if(!t)return P`<div>Router not initialized.</div>`;const r=t.getCurrent(),{path:n}=r,o=t.matchRoute(n);if(!o.route)return P`<div>Not found</div>`;let s=o.route.component;if(o.route.load){const i=await o.route.load();typeof i.default=="string"&&(s=i.default)}return typeof s=="string"?{tag:s,props:{},children:[]}:P`<div>Invalid route component</div>`},onConnected(r){t&&typeof t.subscribe=="function"&&t.subscribe(()=>{typeof r.requestRender=="function"&&r.requestRender()})}}),fe("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:pe`
|
|
62
62
|
[aria-disabled="true"] {
|
|
63
63
|
pointer-events: none;
|
|
64
64
|
opacity: 0.5;
|
|
65
65
|
}
|
|
66
|
-
`}},style:r=>r.style,render:r=>{const n=t.getCurrent(),o=r.to,s=r.exact,i=r.exactActiveClass,a=r.activeClass,c=r.ariaCurrentValue,f=r.tag,y=r.disabled,
|
|
67
|
-
${
|
|
66
|
+
`}},style:r=>r.style,render:r=>{const n=t.getCurrent(),o=r.to,s=r.exact,i=r.exactActiveClass,a=r.activeClass,c=r.ariaCurrentValue,f=r.tag,y=r.disabled,p=r.external,l=n.path===o,x=s?l:n&&typeof n.path=="string"?n.path.startsWith(o):!1,w=l?i:x?a:"",$=l?`aria-current="${c}"`:"",g=f==="button",u=y?g?'disabled aria-disabled="true" tabindex="-1"':'aria-disabled="true" tabindex="-1"':"",h=p&&(f==="a"||!f)?'target="_blank" rel="noopener noreferrer"':"";return P`
|
|
67
|
+
${ke().when(g,P`
|
|
68
68
|
<button
|
|
69
69
|
part="button"
|
|
70
|
-
:class="${r.class} ${
|
|
71
|
-
${
|
|
70
|
+
:class="${r.class} ${w}"
|
|
71
|
+
${$}
|
|
72
72
|
${u}
|
|
73
|
-
${
|
|
73
|
+
${h}
|
|
74
74
|
@click="navigate"
|
|
75
75
|
><slot></slot></button>
|
|
76
|
-
`).otherwise(
|
|
76
|
+
`).otherwise(P`
|
|
77
77
|
<a
|
|
78
78
|
part="link"
|
|
79
79
|
href="${o}"
|
|
80
|
-
:class="${r.class} ${
|
|
81
|
-
${
|
|
80
|
+
:class="${r.class} ${w}"
|
|
81
|
+
${$}
|
|
82
82
|
${u}
|
|
83
|
-
${
|
|
83
|
+
${h}
|
|
84
84
|
@click="navigate"
|
|
85
85
|
><slot></slot></a>
|
|
86
86
|
`).done()}
|
|
87
|
-
`},navigate:(r,n)=>{if(n.disabled){r.preventDefault();return}n.external&&(n.tag==="a"||!n.tag)||(r.preventDefault(),n.replace?t.replace(n.to):t.push(n.to))}}),t}exports.GlobalEventBus=
|
|
87
|
+
`},navigate:(r,n)=>{if(n.disabled){r.preventDefault();return}n.external&&(n.tag==="a"||!n.tag)||(r.preventDefault(),n.replace?t.replace(n.to):t.push(n.to))}}),t}exports.GlobalEventBus=M;exports.component=fe;exports.createStore=se;exports.css=pe;exports.each=ze;exports.emit=Be;exports.eventBus=H;exports.html=P;exports.initRouter=bt;exports.listen=Oe;exports.match=ke;exports.matchRoute=R;exports.matchRouteSSR=mt;exports.off=Me;exports.on=Pe;exports.once=Ne;exports.parseQuery=ue;exports.resolveRouteComponent=_e;exports.useRouter=Ce;exports.when=Le;
|
|
88
88
|
//# sourceMappingURL=custom-elements-runtime.cjs.js.map
|