regor 1.1.4 → 1.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,3 +1,3 @@
1
- "use strict";var jt=Object.defineProperty;var Kr=Object.getOwnPropertyDescriptor;var Wr=Object.getOwnPropertyNames;var Gr=Object.prototype.hasOwnProperty;var Jr=(t,e)=>{for(var n in e)jt(t,n,{get:e[n],enumerable:!0})},Qr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Wr(e))!Gr.call(t,o)&&o!==n&&jt(t,o,{get:()=>e[o],enumerable:!(r=Kr(e,o))||r.enumerable});return t};var Xr=t=>Qr(jt({},"__esModule",{value:!0}),t);var us={};Jr(us,{ComponentHead:()=>Ve,RegorConfig:()=>se,addUnbinder:()=>U,batch:()=>qr,collectRefs:()=>mt,computeMany:()=>_r,computeRef:()=>Br,computed:()=>Hr,createApp:()=>Dr,createComponent:()=>Ur,endBatch:()=>vn,entangle:()=>Et,flatten:()=>J,getBindData:()=>de,html:()=>Tn,isDeepRef:()=>Me,isRaw:()=>Be,isRef:()=>m,markRaw:()=>Pr,observe:()=>C,observeMany:()=>$r,observerCount:()=>Fr,onMounted:()=>zr,onUnmounted:()=>K,pause:()=>Ht,persist:()=>Vr,raw:()=>jr,ref:()=>Ee,removeNode:()=>V,resume:()=>_t,silence:()=>ut,sref:()=>z,startBatch:()=>En,toFragment:()=>Le,toJsonTemplate:()=>Ke,trigger:()=>F,unbind:()=>ne,unref:()=>I,useScope:()=>Tt,warningHandler:()=>Qe,watchEffect:()=>Ae});module.exports=Xr(us);var _=t=>typeof t=="function",B=t=>typeof t=="string",xn=t=>typeof t>"u",Y=t=>t==null||typeof t>"u",$=t=>typeof t!="string"||!t?.trim(),Yr=Object.prototype.toString,$t=t=>Yr.call(t),me=t=>$t(t)==="[object Map]",X=t=>$t(t)==="[object Set]",Ft=t=>$t(t)==="[object Date]",Je=t=>typeof t=="symbol",T=Array.isArray,w=t=>t!==null&&typeof t=="object";var Cn={0:"createApp can't find root element. You must define either a valid `selector` or an `element`. Example: createApp({}, {selector: '#app', html: '...'})",1:t=>`Component template cannot be found. selector: ${t} .`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"persist requires a string key."},k=(t,...e)=>{let n=Cn[t];return new Error(_(n)?n.call(Cn,...e):n)};var Ie=Symbol(":regor");var de=t=>{let e=t[Ie];if(e)return e;let n={unbinders:[],data:{}};return t[Ie]=n,n};var U=(t,e)=>{de(t).unbinders.push(e)};var ot=[],Rn=()=>{let t={onMounted:[],onUnmounted:[]};return ot.push(t),t},Se=t=>{let e=ot[ot.length-1];if(!e&&!t)throw k(2);return e},Sn=t=>{let e=Se();return t&&zt(t),ot.pop(),e},qt=Symbol("csp"),zt=t=>{let e=t,n=e[qt];if(n){let r=Se();if(n===r)return;r.onMounted.length>0&&n.onMounted.push(...r.onMounted),r.onUnmounted.length>0&&n.onUnmounted.push(...r.onUnmounted);return}e[qt]=Se()},st=t=>t[qt];var K=(t,e)=>{Se(e)?.onUnmounted.push(t)};var it=Symbol("ref"),G=Symbol("sref"),at=Symbol("raw");var m=t=>t?.[G]===1;var C=(t,e,n)=>{if(!m(t))throw k(3,"observe");n&&e(t());let o=t(void 0,void 0,0,e);return K(o,!0),o};var ne=t=>{let e=[t];for(;e.length>0;){let n=e.shift();Zr(n);let r=n.childNodes;if(r)for(let o of r)e.push(o)}},Zr=t=>{let e=t[Ie];if(e){for(let n of e.unbinders)n();e.unbinders.splice(0),delete t[Ie]}};var V=t=>{t.remove(),setTimeout(()=>ne(t),1)};var wn={8:t=>`Model binding requires a ref at ${t.outerHTML}`,7:t=>`Model binding is not supported on ${t.tagName} element at ${t.outerHTML}`,0:(t,e)=>`${t} binding expression is missing at ${e.outerHTML}`,1:(t,e,n)=>`invalid ${t} expression: ${e} at ${n.outerHTML}`,2:(t,e)=>`${t} requires object expression at ${e.outerHTML}`,3:(t,e)=>`${t} binder: key is empty on ${e.outerHTML}.`,4:(t,e,n,r)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[r]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},L=(t,...e)=>{let n=wn[t],r=_(n)?n.call(wn,...e):n,o=Qe.warning;o&&(B(r)?o(r):o(r,...r.args))},Qe={warning:console.warn};var pt={},ct={},On=1,An=t=>{let e=(On++).toString();return pt[e]=t,ct[e]=0,e},Kt=t=>{ct[t]+=1},Wt=t=>{--ct[t]===0&&(delete pt[t],delete ct[t])},Nn=t=>pt[t],Gt=()=>On!==1&&Object.keys(pt).length>0,Xe="r-switch",eo=t=>{let e=t.filter(r=>we(r)).map(r=>[...r.querySelectorAll("[r-switch]")].map(o=>o.getAttribute(Xe))),n=new Set;return e.forEach(r=>{r.forEach(o=>o&&n.add(o))}),[...n]},De=(t,e)=>{if(!Gt())return;let n=eo(e);n.length!==0&&(n.forEach(Kt),U(t,()=>{n.forEach(Wt)}))};var Jt=(t,e,n,r)=>{let o=[];for(let s of t){let i=s.cloneNode(!0);n.insertBefore(i,r),o.push(i)}he(e,o)},Qt=Symbol("r-if"),Mn=Symbol("r-else"),Ln=t=>t[Mn]===1,ft=class{p;P;q;K;z;b;T;constructor(e){this.p=e,this.P=e.o.l.if,this.q=He(e.o.l.if),this.K=e.o.l.else,this.z=e.o.l.elseif,this.b=e.o.l.for,this.T=e.o.l.pre}qe(e,n){let r=e.parentElement;for(;r!==null&&r!==document.documentElement;){if(r.hasAttribute(n))return!0;r=r.parentElement}return!1}N(e){let n=e.hasAttribute(this.P),r=ye(e,this.q);for(let o of r)this.x(o);return n}W(e){return e[Qt]?!0:(e[Qt]=!0,ye(e,this.q).forEach(n=>n[Qt]=!0),!1)}x(e){if(e.hasAttribute(this.T)||this.W(e)||this.qe(e,this.b))return;let n=e.getAttribute(this.P);if(!n){L(0,this.P,e);return}e.removeAttribute(this.P),this.k(e,n)}B(e,n,r){let o=Ue(e),s=e.parentNode,i=document.createComment(`__begin__ :${n}${r??""}`);s.insertBefore(i,e),De(i,o),o.forEach(c=>{V(c)}),e.remove(),n!=="if"&&(e[Mn]=1);let a=document.createComment(`__end__ :${n}${r??""}`);return s.insertBefore(a,i.nextSibling),{nodes:o,parent:s,commentBegin:i,commentEnd:a}}pe(e,n){if(!e)return[];let r=e.nextElementSibling;if(e.hasAttribute(this.K)){e.removeAttribute(this.K);let{nodes:o,parent:s,commentBegin:i,commentEnd:a}=this.B(e,"else");return[{mount:()=>{Jt(o,this.p,s,a)},unmount:()=>{ce(i,a)},isTrue:()=>!0,isMounted:!1}]}else{let o=e.getAttribute(this.z);if(!o)return[];e.removeAttribute(this.z);let{nodes:s,parent:i,commentBegin:a,commentEnd:c}=this.B(e,"elseif",` => ${o} `),f=this.p.h.v(o),p=f.value,l=this.pe(r,n),b=[];U(a,()=>{f.stop();for(let v of b)v();b.length=0});let y=C(p,n);return b.push(y),[{mount:()=>{Jt(s,this.p,i,c)},unmount:()=>{ce(a,c)},isTrue:()=>!!p()[0],isMounted:!1}].concat(l)}}k(e,n){let r=e.nextElementSibling,{nodes:o,parent:s,commentBegin:i,commentEnd:a}=this.B(e,"if",` => ${n} `),c=this.p.h.v(n),f=c.value,p=!1,l=this.p.h,b=l.V(),u=()=>{l.C(b,()=>{if(f()[0])p||(Jt(o,this.p,s,a),p=!0),y.forEach(O=>{O.unmount(),O.isMounted=!1});else{ce(i,a),p=!1;let O=!1;for(let A of y)!O&&A.isTrue()?(A.isMounted||(A.mount(),A.isMounted=!0),O=!0):(A.unmount(),A.isMounted=!1)}})},y=this.pe(r,u),v=[];U(i,()=>{c.stop();for(let O of v)O();v.length=0}),u();let h=C(f,u);v.push(h)}};var Ue=t=>{let e=re(t)?t.content.childNodes:[t];return Array.from(e).filter(n=>{let r=n?.tagName;return r!=="SCRIPT"&&r!=="STYLE"})},he=(t,e)=>{for(let n of e)!Ln(n)&&t.G(n)},ye=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},re=t=>t instanceof HTMLTemplateElement,we=t=>t.nodeType===Node.ELEMENT_NODE,Ye=t=>t.nodeType===Node.ELEMENT_NODE,kn=t=>t instanceof HTMLSlotElement,pe=t=>re(t)?t.content.childNodes:t.childNodes,ce=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let r=n.nextSibling;V(n),n=r}},ge=(t,e)=>{Object.defineProperty(t,"value",{get(){return t()},set(n){if(e)throw new Error("value is readonly.");return t(n)},enumerable:!0,configurable:!1})},In=(t,e)=>{if(!t)return!1;if(t.startsWith("["))return t.substring(1,t.length-1);let n=e.length;return t.startsWith(e)?t.substring(n,t.length-n):!1},He=t=>`[${CSS.escape(t)}]`,lt=(t,e)=>(t.startsWith("@")&&(t=e.l.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.l.dynamic)),t),Xt=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},to=/-(\w)/g,P=Xt(t=>t&&t.replace(to,(e,n)=>n?n.toUpperCase():"")),no=/\B([A-Z])/g,_e=Xt(t=>t&&t.replace(no,"-$1").toLowerCase()),Ze=Xt(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Z=[],Dn=t=>{Z.length!==0&&Z[Z.length-1]?.add(t)},Ae=t=>{if(!t)return()=>{};let e={stop:()=>{}};return ro(t,e),K(()=>e.stop(),!0),e.stop},ro=(t,e)=>{if(!t)return;let n=[],r=!1,o=()=>{for(let s of n)s();n=[],r=!0};e.stop=o;try{let s=new Set;if(Z.push(s),t(i=>n.push(i)),r)return;for(let i of[...s]){let a=C(i,()=>{o(),Ae(t)});n.push(a)}}finally{Z.pop()}},ut=t=>{let e=Z.length,n=e>0&&Z[e-1];try{return n&&Z.push(null),t()}finally{n&&Z.pop()}},mt=t=>{try{let e=new Set;return Z.push(e),{value:t(),refs:[...e]}}finally{Z.pop()}};var Be=t=>!!t&&t[at]===1;var F=(t,e,n)=>{if(!m(t))return;let r=t;if(r(void 0,e,1),!n)return;let o=r();if(o){if(T(o)||X(o))for(let s of o)F(s,e,!0);else if(me(o))for(let s of o)F(s[0],e,!0),F(s[1],e,!0);if(w(o))for(let s in o)F(o[s],e,!0)}};function oo(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Pe=(t,e,n)=>{n.forEach(function(r){let o=t[r];oo(e,r,function(...i){let a=o.apply(this,i),c=this[G];for(let f of c)F(f);return a})})},dt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var Un=Array.prototype,Yt=Object.create(Un),so=["push","pop","shift","unshift","splice","sort","reverse"];Pe(Un,Yt,so);var Hn=Map.prototype,yt=Object.create(Hn),io=["set","clear","delete"];dt(yt,"Map");Pe(Hn,yt,io);var _n=Set.prototype,ht=Object.create(_n),ao=["add","clear","delete"];dt(ht,"Set");Pe(_n,ht,ao);var oe={},z=t=>{if(m(t)||Be(t))return t;let e={auto:!0,_value:t},n=c=>w(c)?G in c?!0:T(c)?(Object.setPrototypeOf(c,Yt),!0):X(c)?(Object.setPrototypeOf(c,ht),!0):me(c)?(Object.setPrototypeOf(c,yt),!0):!1:!1,r=n(t),o=new Set,s=(c,f)=>{if(oe.stack&&oe.stack.length){oe.stack[oe.stack.length-1].add(a);return}o.size!==0&&ut(()=>{for(let p of[...o.keys()])o.has(p)&&p(c,f)})},i=c=>{let f=c[G];f||(c[G]=f=new Set),f.add(a)},a=(...c)=>{if(!(2 in c)){let p=c[0],l=c[1];return 0 in c?e._value===p||m(p)&&(p=p(),e._value===p)?p:(n(p)&&i(p),e._value=p,e.auto&&s(p,l),e._value):(Dn(a),e._value)}switch(c[2]){case 0:{let p=c[3];if(!p)return()=>{};let l=b=>{o.delete(b)};return o.add(p),()=>{l(p)}}case 1:{let p=c[1],l=e._value;s(l,p);break}case 2:return o.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return a[G]=1,ge(a,!1),r&&i(t),a};var I=t=>m(t)?t():t;var et=class{E=[];_=new Map;get S(){return this.E.length}J;constructor(e){this.J=e}Q(e){let n=this.J(e.value);n!==void 0&&this._.set(n,e)}X(e){let n=this.J(this.E[e]?.value);n!==void 0&&this._.delete(n)}static Ke(e,n){return{items:[],index:e,value:n,order:-1}}w(e){e.order=this.S,this.E.push(e),this.Q(e)}ze(e,n){let r=this.S;for(let o=e;o<r;++o)this.E[o].order=o+1;n.order=e,this.E.splice(e,0,n),this.Q(n)}I(e){return this.E[e]}Y(e,n){this.X(e),this.E[e]=n,this.Q(n),n.order=e}ce(e){this.X(e),this.E.splice(e,1);let n=this.S;for(let r=e;r<n;++r)this.E[r].order=r}le(e){let n=this.S;for(let r=e;r<n;++r)this.X(r);this.E.splice(e)}Rt(e){return this._.has(e)}We(e){return this._.get(e)?.order??-1}};var Zt=Symbol("r-for"),gt=class t{p;b;Z;T;constructor(e){this.p=e,this.b=e.o.l.for,this.Z=He(this.b),this.T=e.o.l.pre}N(e){let n=e.hasAttribute(this.b),r=ye(e,this.Z);for(let o of r)this.Ge(o);return n}W(e){return e[Zt]?!0:(e[Zt]=!0,ye(e,this.Z).forEach(n=>n[Zt]=!0),!1)}Ge(e){if(e.hasAttribute(this.T)||this.W(e))return;let n=e.getAttribute(this.b);if(!n){L(0,this.b,e);return}e.removeAttribute(this.b),this.Je(e,n)}fe(e){return Y(e)?[]:(_(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(r=>({*[Symbol.iterator](){for(let o=1;o<=r;o++)yield o}}))(e):Object.entries(e))}Je(e,n){let r=this.Qe(n);if(!r?.list){L(1,this.b,n,e);return}let o=this.p.o.l.key,s=this.p.o.l.keyBind,i=e.getAttribute(o)??e.getAttribute(s);e.removeAttribute(o),e.removeAttribute(s);let a=i?x=>I(I(x)?.[i]):x=>x,c=(x,N)=>a(x)===a(N),f=Ue(e),p=e.parentNode;if(!p)return;let l=`${this.b} => ${n}`,b=new Comment(`__begin__ ${l}`);p.insertBefore(b,e),De(b,f),f.forEach(x=>{V(x)}),e.remove();let u=new Comment(`__end__ ${l}`);p.insertBefore(u,b.nextSibling);let y=this.p,v=y.h,S=v.V(),h=(x,N,q)=>{let R=r.createContext(N,x),Q=et.Ke(R.index,N);return v.C(S,()=>{v.w(R.ctx);let ee=q.previousSibling,ke=[];for(let d of f){let M=d.cloneNode(!0);p.insertBefore(M,q),ke.push(M)}for(he(y,ke),ee=ee.nextSibling;ee!==q;)Q.items.push(ee),ee=ee.nextSibling}),Q},O=(x,N)=>{let q=D.I(x).items,R=q[q.length-1].nextSibling;for(let Q of q)V(Q);D.Y(x,h(x,N,R))},A=(x,N)=>{D.w(h(x,N,u))},ve=x=>{for(let N of D.I(x).items)V(N)},We=x=>{let N=D.S;for(let q=x;q<N;++q)D.I(q).index(q)},Pt=x=>{let N=D.S;_(x)&&(x=x());let q=I(x[0]);if(T(q)&&q.length===0){ce(b,u),D.le(0);return}let R=0,Q=Number.MAX_SAFE_INTEGER,ee=N,ke=this.p.o.forGrowThreshold,d=()=>D.S<ee+ke;for(let g of this.fe(x[0])){let H=()=>{if(R<N){let W=D.I(R++);if(c(W.value,g))return;let E=D.We(a(g));if(E>=R&&E-R<10){if(--R,Q=Math.min(Q,R),ve(R),D.ce(R),--N,E>R+1)for(let j=R;j<E-1&&j<N&&!c(D.I(R).value,g);)++j,ve(R),D.ce(R),--N;H();return}d()?(D.ze(R-1,h(R,g,D.I(R-1).items[0])),Q=Math.min(Q,R-1),++N):O(R-1,g)}else A(R++,g)};H()}let M=R;for(N=D.S;R<N;)ve(R++);D.le(M),We(Q)},nt=()=>{Ge=C(ue,Pt)},xe=()=>{rt.stop(),Ge()},rt=v.v(r.list),ue=rt.value,Ge,ie=0,D=new et(a);for(let x of this.fe(ue()[0]))D.w(h(ie++,x,u));U(b,xe),nt()}static Xe=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Qe(e){let n=t.Xe.exec(e);if(!n)return;let r=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),o=r.length>1?r.length-1:-1,s=o!==-1&&(r[o]==="index"||r[o]?.startsWith("#"))?r[o]:"";s&&r.splice(o,1);let i=n[3];if(!i||r.length===0)return;let a=/[{[]/.test(e);return{list:i,createContext:(c,f)=>{let p={},l=I(c);if(!a&&r.length===1)p[r[0]]=c;else if(T(l)){let u=0;for(let y of r)p[y]=l[u++]}else for(let u of r)p[u]=l[u];let b={ctx:p,index:z(-1)};return s&&(b.index=p[s.startsWith("#")?s.substring(1):s]=z(f)),b}}}};var co=(t,e)=>{for(let n of t){let r=n.cloneNode(!0);e.appendChild(r)}},bt=class{p;D;ue;constructor(e){this.p=e,this.D=e.o.l.is,this.ue=He(this.D)+", [is]"}N(e){let n=e.hasAttribute(this.D),r=ye(e,this.ue);for(let o of r)this.x(o);return n}x(e){let n=e.getAttribute(this.D);if(!n){if(n=e.getAttribute("is"),!n||!n.startsWith("regor:"))return;n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.D),this.k(e,n)}B(e,n){let r=Ue(e),o=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);o.insertBefore(s,e),De(s,r),r.forEach(a=>{V(a)}),e.remove();let i=document.createComment(`__end__ dynamic ${n??""}`);return o.insertBefore(i,s.nextSibling),{nodes:r,parent:o,commentBegin:s,commentEnd:i}}k(e,n){let{nodes:r,parent:o,commentBegin:s,commentEnd:i}=this.B(e,` => ${n} `),a=this.p.h.v(n),c=a.value,f=this.p.h,p=f.V(),l={name:""},b=re(e)?r:[...r[0].childNodes],u=()=>{f.C(p,()=>{let h=c()[0];if(w(h)&&(h.name?h=h.name:h=Object.entries(f.me()).filter(A=>A[1]===h)[0]?.[0]),!B(h)||$(h)){ce(s,i);return}if(l.name===h)return;ce(s,i);let O=document.createElement(h);for(let A of e.getAttributeNames())A!==this.D&&O.setAttribute(A,e.getAttribute(A));co(b,O),o.insertBefore(O,i),this.p.G(O),l.name=h})},y=[];U(s,()=>{a.stop();for(let h of y)h();y.length=0}),u();let S=C(c,u);y.push(S)}};var Bn={collectRefObj:!0,onBind:(t,e)=>C(e.value,()=>{let r=e.value(),o=e.context,s=r[0];if(w(s))for(let i of Object.entries(s)){let a=i[0],c=i[1],f=o[a];f!==c&&(m(f)?f(c):o[a]=c)}},!0)};var Pn={collectRefObj:!0,once:!0,onBind:(t,e)=>{let n=e.value(),r=e.context,o=n[0];if(!w(o))return()=>{};for(let s of Object.entries(o)){let i=s[0],a=s[1],c=r[i];c!==a&&(m(c)?c(a):r[i]=a)}return()=>{}}};var be=t=>{st(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Ve=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;de;constructor(e,n,r,o,s){this.props=e,this.de=n,this.ctx=r,this.start=o,this.end=s}emit=(e,n)=>{this.de.dispatchEvent(new CustomEvent(e,{detail:n}))};unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)V(e),e=e.nextSibling;be(this)}};var en=Symbol("scope"),Tt=t=>{try{Rn();let e=t();zt(e);let n={context:e,unmount:()=>be(e),[en]:1};return n[en]=1,n}finally{Sn()}},Vn=t=>w(t)?en in t:!1;var Et=(t,e)=>{if(t===e)return()=>{};let n=C(t,o=>e(o)),r=C(e,o=>t(o));return e(t()),()=>{n(),r()}};var vt=t=>{st(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var jn={collectRefObj:!0,onBind:(t,e,n,r,o,s)=>{if(!r)return()=>{};let i=P(r);return C(e.value,()=>{let c=e.refs[0]??e.value()[0],f=e.context,p=f[r];p!==c&&(m(p)?p(c):f[i]=c)},!0)}};var xt=class{p;ye;constructor(e){this.p=e,this.ye=e.o.l.inherit}N(e){this.Ye(e)}Ye(e){let n=this.p,r=n.h,o=n.o.he,s=n.o.ge,i=r.me(),a=[...o.keys(),...Object.keys(i),...[...o.keys()].map(_e),...[...Object.keys(i)].map(_e)].join(",");if($(a))return;let c=e.querySelectorAll(a),f=e.matches?.(a)?[e,...c]:c;for(let p of f){if(p.hasAttribute(n.T))continue;let l=p.parentNode;if(!l)continue;let b=p.nextSibling,u=P(p.tagName).toUpperCase(),v=i[u]??s.get(u);if(!v)continue;let S=v.template;if(!S)continue;let h=p.parentElement;if(!h)continue;let O=new Comment(" begin component: "+p.tagName),A=new Comment(" end component: "+p.tagName);h.insertBefore(O,p),p.remove();let ve=n.o.l.props,We=n.o.l.propsOnce,Pt=n.o.l.bind,nt=(d,M)=>{let g={},H=d.hasAttribute(ve),W=d.hasAttribute(We);return r.C(M,()=>{r.w(g),H&&n.x(Bn,d,ve),W&&n.x(Pn,d,We);let E=v.props;if(!E||E.length===0)return;E=E.map(P);for(let Ce of E.concat(E.map(_e))){let ae=d.getAttribute(Ce);ae!==null&&(g[P(Ce)]=ae,d.removeAttribute(Ce))}let j=n.ee.be(d,!1);for(let[Ce,ae]of j.entries()){let[Re,Vt]=ae.te;Vt&&E.includes(P(Vt))&&(Re!=="."&&Re!==":"&&Re!==Pt||n.x(jn,d,Ce,!0,Vt,ae.ne))}}),g},xe=[...r.V()],rt=()=>{let d=nt(p,xe),M=new Ve(d,p,xe,O,A),g=Tt(()=>v.context(M)??{}).context;if(M.autoProps){for(let[H,W]of Object.entries(d))if(H in g){let E=g[H];if(E===W)continue;M.entangle&&m(E)&&m(W)?U(O,Et(W,E)):m(E)?E(W):g[H]=I(W)}else g[H]=W;M.onAutoPropsAssigned?.()}return{componentCtx:g,head:M}},{componentCtx:ue,head:Ge}=rt(),ie=[...pe(S)],D=ie.length,x=p.childNodes.length===0,N=d=>{let M=d.parentElement;if(x){for(let E of[...d.childNodes])M.insertBefore(E,d);return}let g=d.name;$(g)&&(g=d.getAttributeNames().filter(E=>E.startsWith("#"))[0],$(g)?g="default":g=g.substring(1));let H=p.querySelector(`template[name='${g}'], template[\\#${g}]`);!H&&g==="default"&&(H=p.querySelector("template:not([name])"),H&&H.getAttributeNames().filter(E=>E.startsWith("#")).length>0&&(H=null));let W=E=>{Ge.enableSwitch&&r.C(xe,()=>{r.w(ue);let j=nt(d,r.V());r.C(xe,()=>{r.w(j);let Ce=r.V(),ae=An(Ce);for(let Re of E)we(Re)&&(Re.setAttribute(Xe,ae),Kt(ae),U(Re,()=>{Wt(ae)}))})})};if(H){let E=[...pe(H)];for(let j of E)M.insertBefore(j,d);W(E)}else{if(g!=="default"){for(let j of[...pe(d)])M.insertBefore(j,d);return}let E=[...pe(p)].filter(j=>!re(j));for(let j of E)M.insertBefore(j,d);W(E)}},q=d=>{if(!we(d))return;let M=d.querySelectorAll("slot");if(kn(d)){N(d),d.remove();return}for(let g of M)N(g),g.remove()};(()=>{for(let d=0;d<D;++d)ie[d]=ie[d].cloneNode(!0),l.insertBefore(ie[d],b),q(ie[d])})(),h.insertBefore(A,b);let Q=()=>{if(!v.inheritAttrs)return;let d=ie.filter(g=>g.nodeType===Node.ELEMENT_NODE);d.length>1&&(d=d.filter(g=>g.hasAttribute(this.ye)));let M=d[0];if(M)for(let g of p.getAttributeNames()){if(g===ve||g===We)continue;let H=p.getAttribute(g);if(g==="class")M.classList.add(...H.split(" "));else if(g==="style"){let W=M.style,E=p.style;for(let j of E)W.setProperty(j,E.getPropertyValue(j))}else M.setAttribute(lt(g,n.o),H)}},ee=()=>{for(let d of p.getAttributeNames())!d.startsWith("@")&&!d.startsWith(n.o.l.on)&&p.removeAttribute(d)},ke=()=>{Q(),ee(),r.w(ue),n.Te(p,!1),ue.$emit=Ge.emit,he(n,ie),U(p,()=>{be(ue)}),U(O,()=>{ne(p)}),vt(ue)};r.C(xe,ke)}}};var tn=class{xe;te=[];ne=[];Ee=[];constructor(e){this.xe=e,this.v()}v(){let e=this.xe,n=e.startsWith(".");n&&(e=":"+e.slice(1));let r=e.indexOf("."),o=this.te=(r<0?e:e.substring(0,r)).split(/[:@]/);if($(o[0])&&(o[0]=n?".":e[0]),r>=0){let s=this.ne=e.slice(r+1).split(".");if(s.includes("camel")){let i=o.length-1;o[i]=P(o[i])}s.includes("prop")&&(o[0]=".")}}},Ct=class{p;Re;constructor(e){this.p=e,this.Re=e.o.Ze()}be(e,n){let r=new Map;if(!Ye(e))return r;let o=this.Re,s=a=>{let c=a.getAttributeNames().filter(f=>o.some(p=>f.startsWith(p)));for(let f of c)r.has(f)||r.set(f,new tn(f)),r.get(f).Ee.push(a)};if(s(e),!n)return r;let i=e.querySelectorAll("*");for(let a of i)s(a);return r}};var Rt={};var St=class{h;ve;Ce;Se;we;ee;o;T;Oe;constructor(e){this.h=e,this.o=e.o,this.Ce=new gt(this),this.ve=new ft(this),this.Se=new bt(this),this.we=new xt(this),this.ee=new Ct(this),this.T=this.o.l.pre,this.Oe=this.o.l.dynamic}et(e){let n=re(e)?[e]:e.querySelectorAll("template");for(let r of n){if(r.hasAttribute(this.T))continue;let o=r.parentNode;if(!o)continue;let s=r.nextSibling;if(r.remove(),!r.content)continue;let i=[...r.content.childNodes];for(let a of i)o.insertBefore(a,s);he(this,i)}}G(e){e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.T)||this.ve.N(e)||this.Ce.N(e)||this.Se.N(e)||(this.we.N(e),this.et(e),this.Te(e,!0))}Te(e,n){let r=this.ee.be(e,n),o=this.o.H;for(let[s,i]of r.entries()){let[a,c]=i.te,f=o[s]??o[a];if(!f){console.error("directive not found:",a);continue}i.Ee.forEach(p=>{this.x(f,p,s,!1,c,i.ne)})}}x(e,n,r,o,s,i){if(n.hasAttribute(this.T))return;let a=n.getAttribute(r);n.removeAttribute(r);let c=f=>{let p=f.getAttribute(Xe);return p||(f.parentElement?c(f.parentElement):null)};if(Gt()){let f=c(n);if(f){this.h.C(Nn(f),()=>{this.k(e,n,a,s,i)});return}}this.k(e,n,a,s,i)}tt(e,n,r){if(e!==Rt)return!1;if($(r))return!0;let o=document.querySelector(r);if(o){let s=n.parentElement;if(!s)return!0;let i=new Comment(`teleported => '${r}'`);s.insertBefore(i,n),n.teleportedFrom=i,i.teleportedTo=n,U(i,()=>{V(n)}),o.appendChild(n)}return!0}k(e,n,r,o,s){if(n.nodeType!==Node.ELEMENT_NODE||r==null||this.tt(e,n,r))return;let i=this.h.v(r,e.isLazy,e.isLazyKey,e.collectRefObj,e.once),a=[];U(n,()=>{i.stop(),p?.stop();for(let S of a)S();a.length=0});let f=In(o,this.Oe),p;f&&(p=this.h.v(P(f),void 0,void 0,void 0,e.once));let l,b=()=>(l=i.value(),l),u,y=()=>p?(u=p.value()[0],u):(u=o,o),v=()=>{if(!e.onChange)return;let S=C(i.value,h=>{let O=l,A=u;e.onChange?.(n,b(),O,y(),A,s)});if(a.push(S),p){let h=C(p.value,O=>{let A=u;e.onChange?.(n,b(),A,y(),A,s)});a.push(h)}};e.once||v(),e.onBind&&a.push(e.onBind(n,i,r,o,p,s)),e.onChange?.(n,b(),void 0,y(),void 0,s)}};var po=9,fo=10,lo=13,uo=32,Te=46,wt=44,mo=39,yo=34,Ot=40,je=41,At=91,Nt=93,nn=63,ho=59,$n=58,go=123,Mt=125,on=43,bo=45,Fn=96,qn=47,To=92,zn=[2,3],Kn=[on,bo],Yn={"-":1,"!":1,"~":1,"+":1,new:1},Zn={"=":2.5,"*=":2.5,"**=":2.5,"/=":2.5,"%=":2.5,"+=":2.5,"-=":2.5,"<<=":2.5,">>=":2.5,">>>=":2.5,"&=":2.5,"^=":2.5,"|=":2.5},Fe={"=>":2,...Zn,"||":3,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"/":12,"%":12,"**":13},er=Object.keys(Zn),Eo=new Set(er),Lt=new Set;Lt.add("=>");er.forEach(t=>Lt.add(t));var vo=new Set(["$","_"]),Wn={true:!0,false:!1,null:null},xo="this";function tr(t){return Math.max(0,...Object.keys(t).map(e=>e.length))}var Co=tr(Yn),Ro=tr(Fe),qe="Expected ",Ne="Unexpected ",an="Unclosed ",So=qe+":",Gn=qe+"expression",wo="missing }",Oo=Ne+"object property",Ao=an+"(",Jn=qe+"comma",Qn=Ne+"token ",No=Ne+"period",rn=qe+"expression after ",Mo="missing unaryOp argument",Lo=an+"[",ko=qe+"exponent (",Io="Variable names cannot start with a number (",Do=an+'quote after "';var $e=t=>t>=48&&t<=57,Xn=t=>Fe[t]||0,sn=class{nt={0:[this.rt],1:[this.ot,this.st,this.it],2:[this.at,this.pt,this.ct,this.Ae,this.lt],3:[this.ft,this.ut,this.mt]};r;e;get M(){return this.r.charAt(this.e)}get f(){return this.r.charCodeAt(this.e)}u(e){return this.r.charCodeAt(this.e)===e}constructor(e){this.r=e,this.e=0}U(e){let n=String.fromCharCode(e);return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!(n in Fe)||vo.has(n)}re(e){return this.U(e)||$e(e)}i(e){return new Error(`${e} at character ${this.e}`)}L(e,n,r){let o=this.nt[e];if(!o)return r;let s={node:r},i=a=>{a.call(this,s)};return n===0?o.forEach(i):o.find(i),s.node}y(){let e=this.f,n=this.r,r=this.e;for(;e===uo||e===po||e===fo||e===lo;)e=n.charCodeAt(++r);this.e=r}parse(){let e=this.oe();return e.length===1?e[0]:{type:0,body:e}}oe(e){let n=[];for(;this.e<this.r.length;){let r=this.f;if(r===ho||r===wt)this.e++;else{let o=this.O();if(o)n.push(o);else if(this.e<this.r.length){if(r===e)break;throw this.i(Ne+'"'+this.M+'"')}}}return n}O(){let e=this.L(0,1)??this.Ne();return this.y(),this.L(1,0,e)}se(){this.y();let e=this.e,n=this.r,r=n.substr(e,Ro),o=r.length;for(;o>0;){if(r in Fe&&(!this.U(this.f)||e+r.length<n.length&&!this.re(n.charCodeAt(e+r.length))))return e+=o,this.e=e,r;r=r.substr(0,--o)}return!1}Ne(){let e,n,r,o,s,i,a,c;if(s=this.j(),!s||(n=this.se(),!n))return s;if(o={value:n,prec:Xn(n),right_a:Lt.has(n)},i=this.j(),!i)throw this.i(rn+n);let f=[s,o,i];for(;n=this.se();){if(r=Xn(n),r===0){this.e-=n.length;break}o={value:n,prec:r,right_a:Lt.has(n)},c=n;let p=l=>o.right_a&&l.right_a?r>l.prec:r<=l.prec;for(;f.length>2&&p(f[f.length-2]);)i=f.pop(),n=f.pop().value,s=f.pop(),e={type:8,operator:n,left:s,right:i},f.push(e);if(e=this.j(),!e)throw this.i(rn+c);f.push(o,e)}for(a=f.length-1,e=f[a];a>1;)e={type:8,operator:f[a-1].value,left:f[a-2],right:e},a-=2;return e}j(){let e,n,r;if(this.y(),r=this.L(2,1),r)return this.L(3,0,r);let o=this.f;if($e(o)||o===Te)return this.dt();if(o===mo||o===yo)r=this.yt();else if(o===At)r=this.ht();else{for(e=this.r.substr(this.e,Co),n=e.length;n>0;){if(Object.prototype.hasOwnProperty.call(Yn,e)&&(!this.U(this.f)||this.e+e.length<this.r.length&&!this.re(this.r.charCodeAt(this.e+e.length)))){this.e+=n;let s=this.j();if(!s)throw this.i(Mo);return this.L(3,0,{type:7,operator:e,argument:s})}e=e.substr(0,--n)}this.U(o)?(r=this.ie(),r.name in Wn?r={type:4,value:Wn[r.name],raw:r.name}:r.name===xo&&(r={type:5})):o===Ot&&(r=this.gt())}return r?(r=this.F(r),this.L(3,0,r)):this.L(3,0,!1)}F(e){this.y();let n=this.f;for(;n===Te||n===At||n===Ot||n===nn;){let r;if(n===nn){if(this.r.charCodeAt(this.e+1)!==Te)break;r=!0,this.e+=2,this.y(),n=this.f}if(this.e++,n===At){if(e={type:3,computed:!0,object:e,property:this.O()},this.y(),n=this.f,n!==Nt)throw this.i(Lo);this.e++}else n===Ot?e={type:6,arguments:this.Me(je),callee:e}:(n===Te||r)&&(r&&this.e--,this.y(),e={type:3,computed:!1,object:e,property:this.ie()});r&&(e.optional=!0),this.y(),n=this.f}return e}dt(){let e="",n;for(;$e(this.f);)e+=this.r.charAt(this.e++);if(this.u(Te))for(e+=this.r.charAt(this.e++);$e(this.f);)e+=this.r.charAt(this.e++);if(n=this.M,n==="e"||n==="E"){for(e+=this.r.charAt(this.e++),n=this.M,(n==="+"||n==="-")&&(e+=this.r.charAt(this.e++));$e(this.f);)e+=this.r.charAt(this.e++);if(!$e(this.r.charCodeAt(this.e-1)))throw this.i(ko+e+this.M+")")}let r=this.f;if(this.U(r))throw this.i(Io+e+this.M+")");if(r===Te||e.length===1&&e.charCodeAt(0)===Te)throw this.i(No);return{type:4,value:parseFloat(e),raw:e}}yt(){let e="",n=this.e,r=this.r.charAt(this.e++),o=!1;for(;this.e<this.r.length;){let s=this.r.charAt(this.e++);if(s===r){o=!0;break}else if(s==="\\")switch(s=this.r.charAt(this.e++),s){case"n":e+=`
2
- `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=s}else e+=s}if(!o)throw this.i(Do+e+'"');return{type:4,value:e,raw:this.r.substring(n,this.e)}}ie(){let e=this.f,n=this.e;if(this.U(e))this.e++;else throw this.i(Ne+this.M);for(;this.e<this.r.length&&(e=this.f,this.re(e));)this.e++;return{type:2,name:this.r.slice(n,this.e)}}Me(e){let n=[],r=!1,o=0;for(;this.e<this.r.length;){this.y();let s=this.f;if(s===e){if(r=!0,this.e++,e===je&&o&&o>=n.length)throw this.i(Qn+String.fromCharCode(e));break}else if(s===wt){if(this.e++,o++,o!==n.length){if(e===je)throw this.i(Qn+",");if(e===Nt)for(let i=n.length;i<o;i++)n.push(null)}}else{if(n.length!==o&&o!==0)throw this.i(Jn);{let i=this.O();if(!i||i.type===0)throw this.i(Jn);n.push(i)}}}if(!r)throw this.i(qe+String.fromCharCode(e));return n}gt(){this.e++;let e=this.oe(je);if(this.u(je))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(Ao)}ht(){return this.e++,{type:9,elements:this.Me(Nt)}}at(e){if(this.u(go)){this.e++;let n=[];for(;!isNaN(this.f);){if(this.y(),this.u(Mt)){this.e++,e.node=this.F({type:10,properties:n});return}let r=this.O();if(!r)break;if(this.y(),r.type===2&&(this.u(wt)||this.u(Mt)))n.push({type:12,computed:!1,key:r,value:r,shorthand:!0});else if(this.u($n)){this.e++;let o=this.O();if(!o)throw this.i(Oo);let s=r.type===9;n.push({type:12,computed:s,key:s?r.elements[0]:r,value:o,shorthand:!1}),this.y()}else r&&n.push(r);this.u(wt)&&this.e++}throw this.i(wo)}}pt(e){let n=this.f;if(Kn.some(r=>r===n&&r===this.r.charCodeAt(this.e+1))){this.e+=2;let r=e.node={type:13,operator:n===on?"++":"--",argument:this.F(this.ie()),prefix:!0};if(!r.argument||!zn.includes(r.argument.type))throw this.i(Ne+r.operator)}}ut(e){if(e.node){let n=this.f;if(Kn.some(r=>r===n&&r===this.r.charCodeAt(this.e+1))){if(!zn.includes(e.node.type))throw this.i(Ne+e.node.operator);this.e+=2,e.node={type:13,operator:n===on?"++":"--",argument:e.node,prefix:!1}}}}ct(e){[0,1,2].every(n=>this.r.charCodeAt(this.e+n)===Te)&&(this.e+=3,e.node={type:14,argument:this.O()})}it(e){if(e.node&&this.u(nn)){this.e++;let n=e.node,r=this.O();if(!r)throw this.i(Gn);if(this.y(),this.u($n)){this.e++;let o=this.O();if(!o)throw this.i(Gn);if(e.node={type:11,test:n,consequent:r,alternate:o},n.operator&&Fe[n.operator]<=.9){let s=n;for(;s.right.operator&&Fe[s.right.operator]<=.9;)s=s.right;e.node.test=s.right,s.right=e.node,e.node=n}}else throw this.i(So)}}rt(e){if(this.y(),this.u(Ot)){let n=this.e;if(this.e++,this.y(),this.u(je)){this.e++;let r=this.se();if(r==="=>"){let o=this.Ne();if(!o)throw this.i(rn+r);e.node={type:15,params:null,body:o};return}}this.e=n}}ot(e){this.Le(e.node)}Le(e){e&&(Object.values(e).forEach(n=>{n&&typeof n=="object"&&this.Le(n)}),e.operator==="=>"&&(e.type=15,e.params=e.left?[e.left]:null,e.body=e.right,e.params&&e.params[0].type===1&&(e.params=e.params[0].expressions),delete e.left,delete e.right,delete e.operator))}st(e){e.node&&this.$(e.node)}$(e){Eo.has(e.operator)?(e.type=16,this.$(e.left),this.$(e.right)):e.operator||Object.values(e).forEach(n=>{n&&typeof n=="object"&&this.$(n)})}mt(e){if(!e.node)return;let n=e.node.type;(n===2||n===3)&&this.u(Fn)&&(e.node={type:17,tag:e.node,quasi:this.Ae(e)})}Ae(e){if(!this.u(Fn))return;let n={type:19,quasis:[],expressions:[]},r="",o="",s=!1,i=this.r.length,a=()=>n.quasis.push({type:18,value:{raw:o,cooked:r},tail:s});for(;this.e<i;){let c=this.r.charAt(++this.e);if(c==="`")return this.e+=1,s=!0,a(),e.node=n,n;if(c==="$"&&this.r.charAt(this.e+1)==="{"){if(this.e+=2,a(),o="",r="",n.expressions.push(...this.oe(Mt)),!this.u(Mt))throw this.i("unclosed ${")}else if(c==="\\")switch(o+=c,c=this.r.charAt(++this.e),o+=c,c){case"n":r+=`
3
- `;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=c}else r+=c,o+=c}throw this.i("Unclosed `")}ft(e){let n=e.node;if(!n||n.operator!=="new"||!n.argument)return;if(!n.argument||![6,3].includes(n.argument.type))throw this.i("Expected new function()");e.node=n.argument;let r=e.node;for(;r.type===3||r.type===6&&r?.callee?.type===3;)r=r.type===3?r.object:r.callee.object;r.type=20}lt(e){if(!this.u(qn))return;let n=++this.e,r=!1;for(;this.e<this.r.length;){if(this.f===qn&&!r){let o=this.r.slice(n,this.e),s="";for(;++this.e<this.r.length;){let a=this.f;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)s+=this.M;else break}let i;try{i=new RegExp(o,s)}catch(a){throw this.i(a.message)}return e.node={type:4,value:i,raw:this.r.slice(n-1,this.e)},e.node=this.F(e.node),e.node}this.u(At)?r=!0:r&&this.u(Nt)&&(r=!1),this.e+=this.u(To)?2:1}throw this.i("Unclosed Regex")}},nr=t=>new sn(t).parse();var Uo={"=>":(t,e)=>{},"=":(t,e)=>{},"*=":(t,e)=>{},"**=":(t,e)=>{},"/=":(t,e)=>{},"%=":(t,e)=>{},"+=":(t,e)=>{},"-=":(t,e)=>{},"<<=":(t,e)=>{},">>=":(t,e)=>{},">>>=":(t,e)=>{},"&=":(t,e)=>{},"^=":(t,e)=>{},"|=":(t,e)=>{},"||":(t,e)=>t()||e(),"??":(t,e)=>t()??e(),"&&":(t,e)=>t()&&e(),"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,in:(t,e)=>t in e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,"**":(t,e)=>t**e},Ho={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},ir=t=>{if(!t?.some(sr))return t;let e=[];return t.forEach(n=>sr(n)?e.push(...n):e.push(n)),e},rr=(...t)=>ir(t),cn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},_o={"++":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(++r),r}return++t[e]},"--":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(--r),r}return--t[e]}},Bo={"++":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(r+1),r}return t[e]++},"--":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(r-1),r}return t[e]--}},or={"=":(t,e,n)=>{let r=t[e];return m(r)?r(n):t[e]=n},"+=":(t,e,n)=>{let r=t[e];return m(r)?r(r()+n):t[e]+=n},"-=":(t,e,n)=>{let r=t[e];return m(r)?r(r()-n):t[e]-=n},"*=":(t,e,n)=>{let r=t[e];return m(r)?r(r()*n):t[e]*=n},"/=":(t,e,n)=>{let r=t[e];return m(r)?r(r()/n):t[e]/=n},"%=":(t,e,n)=>{let r=t[e];return m(r)?r(r()%n):t[e]%=n},"**=":(t,e,n)=>{let r=t[e];return m(r)?r(r()**n):t[e]**=n},"<<=":(t,e,n)=>{let r=t[e];return m(r)?r(r()<<n):t[e]<<=n},">>=":(t,e,n)=>{let r=t[e];return m(r)?r(r()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let r=t[e];return m(r)?r(r()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let r=t[e];return m(r)?r(r()|n):t[e]|=n},"&=":(t,e,n)=>{let r=t[e];return m(r)?r(r()&n):t[e]&=n},"^=":(t,e,n)=>{let r=t[e];return m(r)?r(r()^n):t[e]^=n}},kt=(t,e)=>_(t)?t.bind(e):t,pn=class{m;ke;Ve;Ie;A;De;Ue;constructor(e,n,r,o,s){this.m=T(e)?e:[e],this.ke=n,this.Ve=r,this.Ie=o,this.Ue=!!s}Pe(e,n){if(n&&e in n)return n;for(let r of this.m)if(e in r)return r}2(e,n,r){let o=e.name;if(o==="$root")return this.m[this.m.length-1];if(o==="$parent")return this.m[1];if(o==="$ctx")return[...this.m];if(r&&o in r)return this.A=r[o],kt(I(r[o]),r);for(let i of this.m)if(o in i)return this.A=i[o],kt(I(i[o]),i);let s=this.ke;if(s&&o in s)return this.A=s[o],kt(I(s[o]),s)}5(e,n,r){return this.m[0]}0(e,n,r){return this.Be(n,r,rr,...e.body)}1(e,n,r){return this.R(n,r,(...o)=>o.pop(),...e.expressions)}3(e,n,r){let{obj:o,key:s}=this.ae(e,n,r),i=o?.[s];return this.A=i,kt(I(i),o)}4(e,n,r){return e.value}6(e,n,r){let o=(i,...a)=>_(i)?i(...ir(a)):i,s=this.R(++n,r,o,e.callee,...e.arguments);return this.A=s,s}7(e,n,r){return this.R(n,r,Ho[e.operator],e.argument)}8(e,n,r){let o=Uo[e.operator];switch(e.operator){case"||":case"&&":case"??":return o(()=>this.g(e.left,n,r),()=>this.g(e.right,n,r))}return this.R(n,r,o,e.left,e.right)}9(e,n,r){return this.Be(++n,r,rr,...e.elements)}10(e,n,r){let o={},s=(...i)=>{i.forEach(a=>{Object.assign(o,a)})};return this.R(++n,r,s,...e.properties),o}11(e,n,r){return this.R(n,r,o=>this.g(o?e.consequent:e.alternate,n,r),e.test)}12(e,n,r){let o={},s=p=>p?.type!==15,i=this.Ie??(()=>!1),a=n===0&&this.Ue,c=p=>this._e(a,e.key,n,cn(p,r)),f=p=>this._e(a,e.value,n,cn(p,r));if(e.shorthand){let p=e.key.name;o[p]=s(e.key)&&i(p,n)?c:c()}else if(e.computed){let p=I(c());o[p]=s(e.value)&&i(p,n)?f:f()}else{let p=e.key.type===4?e.key.value:e.key.name;o[p]=s(e.value)&&i(p,n)?()=>f:f()}return o}ae(e,n,r){let o=this.g(e.object,n,r),s=e.computed?this.g(e.property,n,r):e.property.name;return{obj:o,key:s}}13(e,n,r){let o=e.argument,s=e.operator,i=e.prefix?_o:Bo;if(o.type===2){let a=o.name,c=this.Pe(a,r);return Y(c)?void 0:i[s](c,a)}if(o.type===3){let{obj:a,key:c}=this.ae(o,n,r);return i[s](a,c)}}16(e,n,r){let o=e.left,s=e.operator;if(o.type===2){let i=o.name,a=this.Pe(i,r);if(Y(a))return;let c=this.g(e.right,n,r);return or[s](a,i,c)}if(o.type===3){let{obj:i,key:a}=this.ae(o,n,r),c=this.g(e.right,n,r);return or[s](i,a,c)}}14(e,n,r){let o=this.g(e.argument,n,r);return T(o)&&(o.s=ar),o}17(e,n,r){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,r)}19(e,n,r){let o=(...s)=>s.reduce((i,a,c)=>i+=a+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.R(n,r,o,...e.expressions)}18(e,n,r){return e.value.cooked}20(e,n,r){let o=(s,...i)=>new s(...i);return this.R(n,r,o,e.callee,...e.arguments)}15(e,n,r){return(...o)=>{let s=Object.create(r??{}),i=e.params;if(i){let a=0;for(let c of i)s[c.name]=o[a++]}return this.g(e.body,n,s)}}g(e,n,r){let o=I(this[e.type](e,n,r));return this.De=e.type,o}_e(e,n,r,o){let s=this.g(n,r,o);return e&&this.He()?this.A:s}He(){let e=this.De;return(e===2||e===3||e===6)&&m(this.A)}eval(e,n){let{value:r,refs:o}=mt(()=>this.g(e,-1,n)),s={value:r,refs:o};return this.He()&&(s.ref=this.A),s}R(e,n,r,...o){let s=o.map(i=>i&&this.g(i,e,n));return r(...s)}Be(e,n,r,...o){let s=this.Ve;if(!s)return this.R(e,n,r,...o);let i=o.map((a,c)=>a&&(a.type!==15&&s(c,e)?f=>this.g(a,e,cn(f,n)):this.g(a,e,n)));return r(...i)}},ar=Symbol("s"),sr=t=>t?.s===ar,cr=(t,e,n,r,o,s,i)=>new pn(e,n,r,o,i).eval(t,s);var pr={},It=class{m;o;constructor(e,n){this.m=e,this.o=n}w(e){this.m=[e,...this.m]}me(){return this.m.map(n=>n.components).filter(n=>!!n).reverse().reduce((n,r)=>{for(let[o,s]of Object.entries(r))n[o.toUpperCase()]=s;return n},{})}v(e,n,r,o,s){let i=z([]),a=[],c=()=>{for(let u of a)u();a.length=0},f={value:i,stop:c,refs:[],context:this.m[0]};if($(e))return f;let p=this.o.globalContext,l=[],b=(u,y,v,S)=>{try{let h=cr(u,y,p,n,r,S,o);return v&&l.push(...h.refs),{value:h.value,refs:h.refs,ref:h.ref}}catch(h){L(6,`evaluation error: ${e}`,h)}return{value:void 0,refs:[]}};try{let u=pr[e]??nr("["+e+"]");pr[e]=u;let y=this.m,v=()=>{l.splice(0),c();let S=u.elements.map((h,O)=>n?.(O,-1)?{value:A=>b(h,y,!1,{$event:A}).value,refs:[]}:b(h,y,!0));if(!s)for(let h of l){let O=C(h,v);a.push(O)}i(S.map(h=>h.value)),f.refs=S.map(h=>h.ref)};v()}catch(u){L(6,`parse error: ${e}`,u)}return f}V(){return this.m}je=[];Y(e){this.je.push(this.m),this.m=e}C(e,n){try{this.Y(e),n()}finally{this.bt()}}bt(){this.m=this.je.pop()??[]}};var fr="http://www.w3.org/1999/xlink",Po={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function Vo(t){return!!t||t===""}var fn={onChange:(t,e,n,r,o,s)=>{if(r){s&&s.includes("camel")&&(r=P(r)),Dt(t,r,e[0],o);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(T(c)){let f=n?.[a]?.[0],p=c[0],l=c[1];Dt(t,p,l,f)}else if(w(c))for(let f of Object.entries(c)){let p=f[0],l=f[1],b=n?.[a],u=b&&p in b?p:void 0;Dt(t,p,l,u)}else{let f=n?.[a],p=e[a++],l=e[a];Dt(t,p,l,f)}}}},Dt=(t,e,n,r)=>{if(r&&r!==e&&t.removeAttribute(r),Y(e)){L(3,name,t);return}if(!B(e)){L(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){Y(n)?t.removeAttributeNS(fr,e.slice(6,e.length)):t.setAttributeNS(fr,e,n);return}let o=e in Po;Y(n)||o&&!Vo(n)?t.removeAttribute(e):t.setAttribute(e,o?"":n)};var ln={onChange:(t,e,n)=>{let r=e.length;for(let o=0;o<r;++o){let s=e[o],i=n?.[o];if(T(s)){let a=s.length;for(let c=0;c<a;++c)lr(t,s[c],i?.[c])}else lr(t,s,i)}}},lr=(t,e,n)=>{let r=t.classList,o=B(e),s=B(n);if(e&&!o){if(n&&!s)for(let i in n)(!(i in e)||!e[i])&&r.remove(i);for(let i in e)e[i]&&r.add(i)}else o?n!==e&&(s&&r.remove(...n.trim().split(/\s+/)),r.add(...e.trim().split(/\s+/))):n&&s&&r.remove(...n.trim().split(/\s+/))};var ur={onChange:(t,e)=>{let[n,r]=e;_(r)?r(t,n):t.innerHTML=n?.toString()}};function jo(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=fe(t[r],e[r]);return n}function fe(t,e){if(t===e)return!0;let n=Ft(t),r=Ft(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=Je(t),r=Je(e),n||r)return t===e;if(n=T(t),r=T(e),n||r)return n&&r?jo(t,e):!1;if(n=w(t),r=w(e),n||r){if(!n||!r)return!1;let o=Object.keys(t).length,s=Object.keys(e).length;if(o!==s)return!1;for(let i in t){let a=t.hasOwnProperty(i),c=e.hasOwnProperty(i);if(a&&!c||!a&&c||!fe(t[i],e[i]))return!1}}return String(t)===String(e)}function Ut(t,e){return t.findIndex(n=>fe(n,e))}var mr=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Ht=t=>{if(!m(t))throw k(3,"pause");t(void 0,void 0,3)};var _t=t=>{if(!m(t))throw k(3,"resume");t(void 0,void 0,4)};var yr={onChange:(t,e)=>{$o(t,e[0])},onBind:(t,e,n,r,o,s)=>Fo(t,e,s)},$o=(t,e)=>{let n=Tr(t);if(n&&hr(t))T(e)?e=Ut(e,le(t))>-1:X(e)?e=e.has(le(t)):e=Jo(t,e),t.checked=e;else if(n&&gr(t))t.checked=fe(e,le(t));else if(n||Er(t))br(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(vr(t)){let r=t.options,o=r.length,s=t.multiple;for(let i=0;i<o;i++){let a=r[i],c=le(a);if(s)T(e)?a.selected=Ut(e,c)>-1:a.selected=e.has(c);else if(fe(le(a),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else L(7,t)},tt=t=>(m(t)&&(t=t()),_(t)&&(t=t()),t?B(t)?{trim:t.includes("trim"),lazy:t.includes("lazy"),number:t.includes("number"),int:t.includes("int")}:{trim:!!t.trim,lazy:!!t.lazy,number:!!t.number,int:!!t.int}:{trim:!1,lazy:!1,number:!1,int:!1}),hr=t=>t.type==="checkbox",gr=t=>t.type==="radio",br=t=>t.type==="number"||t.type==="range",Tr=t=>t.tagName==="INPUT",Er=t=>t.tagName==="TEXTAREA",vr=t=>t.tagName==="SELECT",Fo=(t,e,n)=>{let r=e.value,o=tt(n?.join(",")),s=tt(r()[1]),i={int:o.int||s.int,lazy:o.lazy||s.lazy,number:o.number||s.number,trim:o.trim||s.trim},a=e.refs[0];if(!a)return L(8,t),()=>{};let c=Tr(t);return c&&hr(t)?zo(t,a):c&&gr(t)?Qo(t,a):c||Er(t)?qo(t,i,a,r):vr(t)?Xo(t,a,r):(L(7,t),()=>{})},dr=/[.,' ·٫]/,qo=(t,e,n,r)=>{let s=e.lazy?"change":"input",i=br(t),a=()=>{!e.trim&&!tt(r()[1]).trim||(t.value=t.value.trim())},c=b=>{let u=b.target;u.composing=1},f=b=>{let u=b.target;u.composing&&(u.composing=0,u.dispatchEvent(new Event(s)))},p=()=>{t.removeEventListener(s,l),t.removeEventListener("change",a),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",f),t.removeEventListener("change",f)},l=b=>{let u=b.target;if(!u||u.composing)return;let y=u.value,v=tt(r()[1]);if(i||v.number||v.int){if(v.int)y=parseInt(y);else{if(dr.test(y[y.length-1])&&y.split(dr).length===2){if(y+="0",y=parseFloat(y),isNaN(y))y="";else if(n()===y)return}y=parseFloat(y)}isNaN(y)&&(y=""),t.value=y}else v.trim&&(y=y.trim());n(y)};return t.addEventListener(s,l),t.addEventListener("change",a),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",f),t.addEventListener("change",f),p},zo=(t,e)=>{let n="change",r=()=>{t.removeEventListener(n,o)},o=()=>{let s=le(t),i=t.checked,a=e();if(T(a)){let c=Ut(a,s),f=c!==-1;i&&!f?a.push(s):!i&&f&&a.splice(c,1)}else X(a)?i?a.add(s):a.delete(s):e(Go(t,i))};return t.addEventListener(n,o),r},le=t=>"_value"in t?t._value:t.value,xr="trueValue",Ko="falseValue",Cr="true-value",Wo="false-value",Go=(t,e)=>{let n=e?xr:Ko;if(n in t)return t[n];let r=e?Cr:Wo;return t.hasAttribute(r)?t.getAttribute(r):e},Jo=(t,e)=>{if(xr in t)return fe(e,t.trueValue);let r=Cr;return t.hasAttribute(r)?fe(e,t.getAttribute(r)):fe(e,!0)},Qo=(t,e)=>{let n="change",r=()=>{t.removeEventListener(n,o)},o=()=>{let s=le(t);e(s)};return t.addEventListener(n,o),r},Xo=(t,e,n)=>{let r="change",o=()=>{t.removeEventListener(r,s)},s=()=>{let a=tt(n()[1]).number,c=Array.prototype.filter.call(t.options,f=>f.selected).map(f=>a?mr(le(f)):le(f));if(t.multiple){let f=e();try{if(Ht(e),X(f)){f.clear();for(let p of c)f.add(p)}else T(f)?(f.splice(0),f.push(...c)):e(c)}finally{_t(e),F(e)}}else e(c[0])};return t.addEventListener(r,s),o};var Yo=["stop","prevent","capture","self","once","left","right","middle","passive"],Zo=t=>{let e={};if($(t))return;let n=t.split(",");for(let r of Yo)e[r]=n.includes(r);return e},mn={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,onBind:(t,e,n,r,o,s)=>{if(o){let p=e.value(),l=I(o.value()[0]);return B(l)?un(t,P(l),()=>e.value()[0],s?.join(",")??p[1]):()=>{}}else if(r){let p=e.value();return un(t,P(r),()=>e.value()[0],s?.join(",")??p[1])}let i=[],a=()=>{i.forEach(p=>p())},c=e.value(),f=c.length;for(let p=0;p<f;++p){let l=c[p];if(_(l)&&(l=l()),w(l))for(let b of Object.entries(l)){let u=b[0],y=()=>{let S=e.value()[p];return _(S)&&(S=S()),S=S[u],_(S)&&(S=S()),S},v=l[u+"_flags"];i.push(un(t,u,y,v))}else L(2,name,t)}return a}},es=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=t.split(".").concat(e.split(","));t=n[0];let r=n[1],o=n.includes("ctrl"),s=n.includes("shift"),i=n.includes("alt"),a=n.includes("meta"),c=f=>!(o&&!f.ctrlKey||s&&!f.shiftKey||i&&!f.altKey||a&&!f.metaKey);return r?[t,f=>c(f)?f.key.toUpperCase()===r.toUpperCase():!1]:[t,c]}return[t,n=>!0]},un=(t,e,n,r)=>{if($(e))return L(5,name,t),()=>{};let o=Zo(r),s=o?{capture:o.capture,passive:o.passive,once:o.once}:void 0,i;[e,i]=es(e,r);let a=p=>{if(!i(p)||!n&&e==="submit"&&o?.prevent)return;let l=n(p);_(l)&&(l=l(p)),_(l)&&l(p)},c=()=>{t.removeEventListener(e,f,s)},f=p=>{if(!o){a(p);return}try{if(o.left&&p.button!==0||o.middle&&p.button!==1||o.right&&p.button!==2||o.self&&p.target!==t)return;o.stop&&p.stopPropagation(),o.prevent&&p.preventDefault(),a(p)}finally{o.once&&c()}};return t.addEventListener(e,f,s),c};var Rr={onChange:(t,e,n,r,o,s)=>{if(r){s&&s.includes("camel")&&(r=P(r)),ze(t,r,e[0]);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(T(c)){let f=c[0],p=c[1];ze(t,f,p)}else if(w(c))for(let f of Object.entries(c)){let p=f[0],l=f[1];ze(t,p,l)}else{let f=e[a++],p=e[a];ze(t,f,p)}}}};function ts(t){return!!t||t===""}var ze=(t,e,n)=>{if(Y(e)){L(3,name,t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(ne),1),t[e]=n??"";return}let r=t.tagName;if(e==="value"&&r!=="PROGRESS"&&!r.includes("-")){t._value=n;let s=r==="OPTION"?t.getAttribute("value"):t.value,i=n??"";s!==i&&(t.value=i),n==null&&t.removeAttribute(e);return}let o=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=ts(n):n==null&&s==="string"?(n="",o=!0):s==="number"&&(n=0,o=!0)}try{t[e]=n}catch(s){o||L(4,e,r,n,s)}o&&t.removeAttribute(e)};var Sr={once:!0,onBind:(t,e,n)=>{let r=e.value()[0],o=T(r),s=e.refs[0];return o?r.push(t):s?s?.(t):e.context[n]=t,()=>{if(o){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}else s?.(null)}}};var wr={onChange:(t,e)=>{let n=de(t).data,r=n._ord;xn(r)&&(r=n._ord=t.style.display),!!e[0]?t.style.display=r:t.style.display="none"}};var hn={onChange:(t,e,n)=>{let r=e.length;for(let o=0;o<r;++o){let s=e[o],i=n?.[o];if(T(s)){let a=s.length;for(let c=0;c<a;++c)Or(t,s[c],i?.[c])}else Or(t,s,i)}}},Or=(t,e,n)=>{let r=t.style,o=B(e);if(e&&!o){if(n&&!B(n))for(let s in n)e[s]==null&&yn(r,s,"");for(let s in e)yn(r,s,e[s])}else{let s=r.display;if(o?n!==e&&(r.cssText=e):n&&t.removeAttribute("style"),"_ord"in de(t).data)return;r.display=s}},Ar=/\s*!important$/;function yn(t,e,n){if(T(n))n.forEach(r=>{yn(t,e,r)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let r=ns(t,e);Ar.test(n)?t.setProperty(_e(r),n.replace(Ar,""),"important"):t[r]=n}}var Nr=["Webkit","Moz","ms"],dn={};function ns(t,e){let n=dn[e];if(n)return n;let r=P(e);if(r!=="filter"&&r in t)return dn[e]=r;r=Ze(r);for(let o=0;o<Nr.length;o++){let s=Nr[o]+r;if(s in t)return dn[e]=s}return e}var J=t=>Mr(I(t)),Mr=(t,e=new WeakMap)=>{if(!t||!w(t))return t;if(T(t))return t.map(J);if(X(t)){let r=new Set;for(let o of t.keys())r.add(J(o));return r}if(me(t)){let r=new Map;for(let o of t)r.set(J(o[0]),J(o[1]));return r}if(e.has(t))return I(e.get(t));let n={...t};e.set(t,n);for(let r of Object.entries(n))n[r[0]]=Mr(I(r[1]),e);return n};var Lr={onChange:(t,e)=>{let n=e[0];t.textContent=X(n)?JSON.stringify(J([...n])):me(n)?JSON.stringify(J([...n])):w(n)?JSON.stringify(J(n)):n?.toString()??""}};var kr={onChange:(t,e)=>{ze(t,"value",e[0])}};var Me=t=>t?.[it]===1;var Ee=t=>{if(Be(t))return t;let e;if(m(t)?(e=t,t=e()):e=z(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[it]=1,T(t)){let n=t.length;for(let r=0;r<n;++r){let o=t[r];Me(o)||(t[r]=Ee(o))}return e}if(!w(t))return e;for(let n of Object.entries(t)){let r=n[1];if(Me(r))continue;let o=n[0];Je(o)||(t[o]=null,t[o]=Ee(r))}return e};var se=class t{static getDefault(){return t.Fe??(t.Fe=new t)}H={};l={};Ze=()=>Object.keys(this.H).filter(e=>e.length===1||!e.startsWith(":"));he=new Map;ge=new Map;static Fe;static Tt="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";forGrowThreshold=10;globalContext;useInterpolation=!0;constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.xt()}xt(){let e={},n=globalThis;for(let r of t.Tt.split(","))e[r]=n[r];return e.ref=Ee,e.sref=z,e.flatten=J,e}addComponent(...e){for(let n of e){if(!n.defaultName){Qe.warning("Registered component's default name is not defined",n);continue}this.he.set(Ze(n.defaultName),n),this.ge.set(Ze(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.H={".":Rr,":":fn,"@":mn,[`${e}on`]:mn,[`${e}bind`]:fn,[`${e}html`]:ur,[`${e}text`]:Lr,[`${e}show`]:wr,[`${e}model`]:yr,":style":hn,[`${e}bind:style`]:hn,":class":ln,[`${e}bind:class`]:ln,":ref":Sr,":value":kr,teleport:Rt},this.l={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,props:":props",propsOnce:":props-once",bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.H,this.l)}};var Bt=(t,e)=>{if(!t)return;let n=(e??se.getDefault()).l;for(let r of ss(t,n.pre))os(r,n.text)},rs=/({{[^]*?}})/g,os=(t,e)=>{let n=t.textContent;if(!n)return;let r=rs,o=n.split(r);if(o.length<=1)return;if(t.parentElement?.childNodes.length===1&&o.length===3){let i=o[1];if($(o[0])&&$(o[2])&&i.startsWith("{{")&&i.endsWith("}}")){let a=t.parentElement;a.setAttribute(e,i.substring(2,i.length-2)),a.innerText="";return}}let s=document.createDocumentFragment();for(let i of o)if(i.startsWith("{{")&&i.endsWith("}}")){let a=document.createElement("span");a.setAttribute(e,i.substring(2,i.length-2)),s.appendChild(a)}else s.appendChild(document.createTextNode(i));t.replaceWith(s)},ss=(t,e)=>{let n=[],r=o=>{if(o.nodeType===Node.TEXT_NODE)o.textContent?.includes("{{")&&n.push(o);else{if(o?.hasAttribute?.(e))return;for(let s of pe(o))r(s)}};return r(t),n};var is="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",as=new Set(is.toUpperCase().split(",")),cs="http://www.w3.org/2000/svg",Ir=(t,e)=>{re(t)?t.content.appendChild(e):t.appendChild(e)},gn=(t,e,n,r)=>{let o=t.t;if(o){let i=n&&as.has(o.toUpperCase())?document.createElementNS(cs,o.toLowerCase()):document.createElement(o),a=t.a;if(a)for(let f of Object.entries(a)){let p=f[0],l=f[1];p.startsWith("#")&&(l=p.substring(1),p="name"),i.setAttribute(lt(p,r),l)}let c=t.c;if(c)for(let f of c)gn(f,i,n,r);Ir(e,i);return}let s=t.d;if(s){let i;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:i=document.createComment(s);break;case Node.TEXT_NODE:i=document.createTextNode(s);break}if(i)Ir(e,i);else throw new Error("unsupported node type.")}},Le=(t,e,n)=>{n??=se.getDefault();let r=document.createDocumentFragment();if(!T(t))return gn(t,r,!!e,n),r;for(let o of t)gn(o,r,!!e,n);return r};var Dr=(t,e={selector:"#app"},n)=>{B(e)&&(e={selector:"#app",template:e}),Vn(t)&&(t=t.context);let r=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!r||!we(r))throw k(0);n||(n=se.getDefault());let o=()=>{for(let a of[...r.childNodes])V(a)},s=a=>{for(let c of a)r.appendChild(c)};if(e.template){let a=document.createRange().createContextualFragment(e.template);o(),s(a.childNodes),e.element=a}else if(e.json){let a=Le(e.json,e.isSVG,n);o(),s(a.childNodes)}return n.useInterpolation&&Bt(r,n),new bn(t,r,n).x(),U(r,()=>{be(t)}),vt(t),{context:t,unmount:()=>{V(r)},unbind:()=>{ne(r)}}},bn=class{Et;$e;o;h;p;constructor(e,n,r){this.Et=e,this.$e=n,this.o=r,this.h=new It([e],r),this.p=new St(this.h)}x(){this.p.G(this.$e)}};var Ke=t=>{if(T(t))return t.map(o=>Ke(o));let e={};if(t.tagName)e.t=t.tagName;else return t.nodeType===Node.COMMENT_NODE&&(e.n=Node.COMMENT_NODE),t.textContent&&(e.d=t.textContent),e;let n=t.getAttributeNames();n.length>0&&(e.a=Object.fromEntries(n.map(o=>[o,t.getAttribute(o)])));let r=pe(t);return r.length>0&&(e.c=[...r].map(o=>Ke(o))),e};var Ur=(t,e=()=>({}),n={})=>{T(n)&&(n={props:n}),B(t)&&(t={template:t});let r=!1;if(t.element){let s=t.element;s.remove(),t.element=s}else if(t.selector){let s=document.querySelector(t.selector);if(!s)throw k(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(t.template);t.element=s}else t.json&&(t.element=Le(t.json,t.isSVG,n.config),r=!0);t.element||(t.element=document.createDocumentFragment()),(n.useInterpolation??!0)&&Bt(t.element);let o=t.element;if(!r&&((t.isSVG??(Ye(o)&&o.hasAttribute?.("isSVG")))||Ye(o)&&o.querySelector("[isSVG]"))){let s=t.element.content,i=s?[...s.childNodes]:[...o.childNodes],a=Ke(i);t.element=Le(a,!0,n.config)}return{context:e,template:t.element,inheritAttrs:n.inheritAttrs??!0,props:n.props,defaultName:n.defaultName}};var Hr=t=>{let e,n={},r=(...o)=>{if(o.length<=2&&0 in o)throw k(4);return e&&!n.isStopped?e(...o):(e=ps(t,n),e(...o))};return r[G]=1,ge(r,!0),r.stop=()=>n.ref?.stop?.(),K(()=>r.stop(),!0),r},ps=(t,e)=>{let n=e.ref??z(null);e.ref=n,e.isStopped=!1;let r=0,o=Ae(()=>{if(r>0){o(),e.isStopped=!0,F(n);return}n(t()),++r});return n.stop=o,n};var _r=(t,e)=>{let n={},r,o=(...s)=>{if(s.length<=2&&0 in s)throw k(4);return r&&!n.isStopped?r(...s):(r=fs(t,e,n),r(...s))};return o[G]=1,ge(o,!0),o.stop=()=>n.ref?.stop?.(),K(()=>o.stop(),!0),o},fs=(t,e,n)=>{let r=n.ref??z(null);n.ref=r,n.isStopped=!1;let o=0,s=a=>{if(o>0){r.stop(),n.isStopped=!0,F(r);return}r(e(...t.map(c=>c()))),++o},i=[];for(let a of t){let c=C(a,s);i.push(c)}return s(null),r.stop=()=>{i.forEach(a=>{a()})},r};var Br=(t,e)=>{let n={},r,o=(...s)=>{if(s.length<=2&&0 in s)throw k(4);return r&&!n.isStopped?r(...s):(r=ls(t,e,n),r(...s))};return o[G]=1,ge(o,!0),o.stop=()=>n.ref?.stop?.(),K(()=>o.stop(),!0),o},ls=(t,e,n)=>{let r=n.ref??z(null);n.ref=r,n.isStopped=!1;let o=0;return r.stop=C(t,s=>{if(o>0){r.stop(),n.isStopped=!0,F(r);return}r(e(s)),++o},!0),r};var Pr=t=>(t[at]=1,t);var Vr=(t,e)=>{if(!e)throw k(5);let r=Me(t)?Ee:a=>a,o=()=>localStorage.setItem(e,JSON.stringify(J(t()))),s=localStorage.getItem(e);if(s!=null)try{t(r(JSON.parse(s)))}catch(a){L(6,`persist: failed to parse data for key ${e}`,a),o()}else o();let i=Ae(o);return K(i,!0),t};var Tn=(t,...e)=>{let n="",r=t,o=e,s=r.length,i=o.length;for(let a=0;a<s;++a)n+=r[a],a<i&&(n+=o[a]);return n},jr=Tn;var $r=(t,e,n)=>{let r=[],o=()=>{e(t.map(i=>i()))};for(let i of t)r.push(C(i,o));n&&o();let s=()=>{for(let i of r)i()};return K(s,!0),s};var Fr=t=>{if(!m(t))throw k(3,"observerCount");return t(void 0,void 0,2)};var qr=t=>{En();try{t()}finally{vn()}},En=()=>{oe.stack||(oe.stack=[]),oe.stack.push(new Set)},vn=()=>{let t=oe.stack;if(!t||t.length===0)return;let e=t.pop();if(t.length){let n=t[t.length-1];for(let r of e)n.add(r);return}delete oe.stack;for(let n of e)try{F(n)}catch(r){console.error(r)}};var zr=t=>{Se()?.onMounted.push(t)};
1
+ "use strict";var $t=Object.defineProperty;var Wr=Object.getOwnPropertyDescriptor;var Gr=Object.getOwnPropertyNames;var Jr=Object.prototype.hasOwnProperty;var Qr=(t,e)=>{for(var n in e)$t(t,n,{get:e[n],enumerable:!0})},Xr=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Gr(e))!Jr.call(t,o)&&o!==n&&$t(t,o,{get:()=>e[o],enumerable:!(r=Wr(e,o))||r.enumerable});return t};var Yr=t=>Xr($t({},"__esModule",{value:!0}),t);var ms={};Qr(ms,{ComponentHead:()=>Pe,RegorConfig:()=>se,addUnbinder:()=>U,batch:()=>zr,collectRefs:()=>dt,computeMany:()=>Br,computeRef:()=>Pr,computed:()=>Hr,createApp:()=>Ur,createComponent:()=>_r,endBatch:()=>xn,entangle:()=>vt,flatten:()=>J,getBindData:()=>de,html:()=>En,isDeepRef:()=>Ae,isRaw:()=>He,isRef:()=>m,markRaw:()=>Vr,observe:()=>R,observeMany:()=>Fr,observerCount:()=>qr,onMounted:()=>Kr,onUnmounted:()=>K,pause:()=>Ht,persist:()=>jr,raw:()=>$r,ref:()=>Ee,removeNode:()=>V,resume:()=>Bt,silence:()=>mt,sref:()=>z,startBatch:()=>vn,toFragment:()=>Ne,toJsonTemplate:()=>ze,trigger:()=>q,unbind:()=>ne,unref:()=>D,useScope:()=>Et,warningHandler:()=>Qe,watchEffect:()=>we});module.exports=Yr(ms);var _=t=>typeof t=="function",H=t=>typeof t=="string",Cn=t=>typeof t>"u",Y=t=>t==null||typeof t>"u",F=t=>typeof t!="string"||!t?.trim(),Zr=Object.prototype.toString,Ft=t=>Zr.call(t),me=t=>Ft(t)==="[object Map]",Q=t=>Ft(t)==="[object Set]",qt=t=>Ft(t)==="[object Date]",Je=t=>typeof t=="symbol",b=Array.isArray,w=t=>t!==null&&typeof t=="object";var Rn={0:"createApp can't find root element. You must define either a valid `selector` or an `element`. Example: createApp({}, {selector: '#app', html: '...'})",1:t=>`Component template cannot be found. selector: ${t} .`,2:"Use composables in scope. usage: useScope(() => new MyApp()).",3:t=>`${t} requires ref source argument`,4:"computed is readonly.",5:"persist requires a string key."},I=(t,...e)=>{let n=Rn[t];return new Error(_(n)?n.call(Rn,...e):n)};var ke=Symbol(":regor");var de=t=>{let e=t[ke];if(e)return e;let n={unbinders:[],data:{}};return t[ke]=n,n};var U=(t,e)=>{de(t).unbinders.push(e)};var st=[],Sn=()=>{let t={onMounted:[],onUnmounted:[]};return st.push(t),t},Ce=t=>{let e=st[st.length-1];if(!e&&!t)throw I(2);return e},wn=t=>{let e=Ce();return t&&Kt(t),st.pop(),e},zt=Symbol("csp"),Kt=t=>{let e=t,n=e[zt];if(n){let r=Ce();if(n===r)return;r.onMounted.length>0&&n.onMounted.push(...r.onMounted),r.onUnmounted.length>0&&n.onUnmounted.push(...r.onUnmounted);return}e[zt]=Ce()},it=t=>t[zt];var K=(t,e)=>{Ce(e)?.onUnmounted.push(t)};var at=Symbol("ref"),W=Symbol("sref"),ct=Symbol("raw");var m=t=>t?.[W]===1;var R=(t,e,n)=>{if(!m(t))throw I(3,"observe");n&&e(t());let o=t(void 0,void 0,0,e);return K(o,!0),o};var ne=t=>{let e=[t];for(;e.length>0;){let n=e.shift();eo(n);let r=n.childNodes;if(r)for(let o of r)e.push(o)}},eo=t=>{let e=t[ke];if(e){for(let n of e.unbinders)n();e.unbinders.splice(0),delete t[ke]}};var V=t=>{t.remove(),setTimeout(()=>ne(t),1)};var On={8:t=>`Model binding requires a ref at ${t.outerHTML}`,7:t=>`Model binding is not supported on ${t.tagName} element at ${t.outerHTML}`,0:(t,e)=>`${t} binding expression is missing at ${e.outerHTML}`,1:(t,e,n)=>`invalid ${t} expression: ${e} at ${n.outerHTML}`,2:(t,e)=>`${t} requires object expression at ${e.outerHTML}`,3:(t,e)=>`${t} binder: key is empty on ${e.outerHTML}.`,4:(t,e,n,r)=>({msg:`Failed setting prop "${t}" on <${e.toLowerCase()}>: value ${n} is invalid.`,args:[r]}),5:(t,e)=>`${t} binding missing event type at ${e.outerHTML}`,6:(t,e)=>({msg:t,args:[e]})},k=(t,...e)=>{let n=On[t],r=_(n)?n.call(On,...e):n,o=Qe.warning;o&&(H(r)?o(r):o(r,...r.args))},Qe={warning:console.warn};var ft={},pt={},An=1,Nn=t=>{let e=(An++).toString();return ft[e]=t,pt[e]=0,e},Wt=t=>{pt[t]+=1},Gt=t=>{--pt[t]===0&&(delete ft[t],delete pt[t])},Mn=t=>ft[t],Jt=()=>An!==1&&Object.keys(ft).length>0,Xe="r-switch",to=t=>{let e=t.filter(r=>Re(r)).map(r=>[...r.querySelectorAll("[r-switch]")].map(o=>o.getAttribute(Xe))),n=new Set;return e.forEach(r=>{r.forEach(o=>o&&n.add(o))}),[...n]},Ie=(t,e)=>{if(!Jt())return;let n=to(e);n.length!==0&&(n.forEach(Wt),U(t,()=>{n.forEach(Gt)}))};var Qt=(t,e,n,r)=>{let o=[];for(let s of t){let i=s.cloneNode(!0);n.insertBefore(i,r),o.push(i)}he(e,o)},Xt=Symbol("r-if"),Ln=Symbol("r-else"),kn=t=>t[Ln]===1,lt=class{p;P;q;K;z;b;T;constructor(e){this.p=e,this.P=e.o.l.if,this.q=Ue(e.o.l.if),this.K=e.o.l.else,this.z=e.o.l.elseif,this.b=e.o.l.for,this.T=e.o.l.pre}qe(e,n){let r=e.parentElement;for(;r!==null&&r!==document.documentElement;){if(r.hasAttribute(n))return!0;r=r.parentElement}return!1}N(e){let n=e.hasAttribute(this.P),r=ye(e,this.q);for(let o of r)this.x(o);return n}W(e){return e[Xt]?!0:(e[Xt]=!0,ye(e,this.q).forEach(n=>n[Xt]=!0),!1)}x(e){if(e.hasAttribute(this.T)||this.W(e)||this.qe(e,this.b))return;let n=e.getAttribute(this.P);if(!n){k(0,this.P,e);return}e.removeAttribute(this.P),this.k(e,n)}B(e,n,r){let o=De(e),s=e.parentNode,i=document.createComment(`__begin__ :${n}${r??""}`);s.insertBefore(i,e),Ie(i,o),o.forEach(c=>{V(c)}),e.remove(),n!=="if"&&(e[Ln]=1);let a=document.createComment(`__end__ :${n}${r??""}`);return s.insertBefore(a,i.nextSibling),{nodes:o,parent:s,commentBegin:i,commentEnd:a}}pe(e,n){if(!e)return[];let r=e.nextElementSibling;if(e.hasAttribute(this.K)){e.removeAttribute(this.K);let{nodes:o,parent:s,commentBegin:i,commentEnd:a}=this.B(e,"else");return[{mount:()=>{Qt(o,this.p,s,a)},unmount:()=>{ae(i,a)},isTrue:()=>!0,isMounted:!1}]}else{let o=e.getAttribute(this.z);if(!o)return[];e.removeAttribute(this.z);let{nodes:s,parent:i,commentBegin:a,commentEnd:c}=this.B(e,"elseif",` => ${o} `),p=this.p.h.v(o),f=p.value,l=this.pe(r,n),g=[];U(a,()=>{p.stop();for(let O of g)O();g.length=0});let y=R(f,n);return g.push(y),[{mount:()=>{Qt(s,this.p,i,c)},unmount:()=>{ae(a,c)},isTrue:()=>!!f()[0],isMounted:!1}].concat(l)}}k(e,n){let r=e.nextElementSibling,{nodes:o,parent:s,commentBegin:i,commentEnd:a}=this.B(e,"if",` => ${n} `),c=this.p.h.v(n),p=c.value,f=!1,l=this.p.h,g=l.V(),u=()=>{l.C(g,()=>{if(p()[0])f||(Qt(o,this.p,s,a),f=!0),y.forEach(M=>{M.unmount(),M.isMounted=!1});else{ae(i,a),f=!1;let M=!1;for(let A of y)!M&&A.isTrue()?(A.isMounted||(A.mount(),A.isMounted=!0),M=!0):(A.unmount(),A.isMounted=!1)}})},y=this.pe(r,u),O=[];U(i,()=>{c.stop();for(let M of O)M();O.length=0}),u();let h=R(p,u);O.push(h)}};var De=t=>{let e=re(t)?t.content.childNodes:[t];return Array.from(e).filter(n=>{let r=n?.tagName;return r!=="SCRIPT"&&r!=="STYLE"})},he=(t,e)=>{for(let n of e)!kn(n)&&t.G(n)},ye=(t,e)=>{let n=t.querySelectorAll(e);return t.matches?.(e)?[t,...n]:n},re=t=>t instanceof HTMLTemplateElement,Re=t=>t.nodeType===Node.ELEMENT_NODE,Ye=t=>t.nodeType===Node.ELEMENT_NODE,In=t=>t instanceof HTMLSlotElement,ce=t=>re(t)?t.content.childNodes:t.childNodes,ae=(t,e)=>{let n=t.nextSibling;for(;n!=null&&n!==e;){let r=n.nextSibling;V(n),n=r}},ge=(t,e)=>{Object.defineProperty(t,"value",{get(){return t()},set(n){if(e)throw new Error("value is readonly.");return t(n)},enumerable:!0,configurable:!1})},Dn=(t,e)=>{if(!t)return!1;if(t.startsWith("["))return t.substring(1,t.length-1);let n=e.length;return t.startsWith(e)?t.substring(n,t.length-n):!1},Ue=t=>`[${CSS.escape(t)}]`,ut=(t,e)=>(t.startsWith("@")&&(t=e.l.on+":"+t.slice(1)),t.includes("[")&&(t=t.replace(/[[\]]/g,e.l.dynamic)),t),Yt=t=>{let e=Object.create(null);return n=>e[n]||(e[n]=t(n))},no=/-(\w)/g,B=Yt(t=>t&&t.replace(no,(e,n)=>n?n.toUpperCase():"")),ro=/\B([A-Z])/g,_e=Yt(t=>t&&t.replace(ro,"-$1").toLowerCase()),Ze=Yt(t=>t&&t.charAt(0).toUpperCase()+t.slice(1));var Z=[],Un=t=>{Z.length!==0&&Z[Z.length-1]?.add(t)},we=t=>{if(!t)return()=>{};let e={stop:()=>{}};return oo(t,e),K(()=>e.stop(),!0),e.stop},oo=(t,e)=>{if(!t)return;let n=[],r=!1,o=()=>{for(let s of n)s();n=[],r=!0};e.stop=o;try{let s=new Set;if(Z.push(s),t(i=>n.push(i)),r)return;for(let i of[...s]){let a=R(i,()=>{o(),we(t)});n.push(a)}}finally{Z.pop()}},mt=t=>{let e=Z.length,n=e>0&&Z[e-1];try{return n&&Z.push(null),t()}finally{n&&Z.pop()}},dt=t=>{try{let e=new Set;return Z.push(e),{value:t(),refs:[...e]}}finally{Z.pop()}};var He=t=>!!t&&t[ct]===1;var q=(t,e,n)=>{if(!m(t))return;let r=t;if(r(void 0,e,1),!n)return;let o=r();if(o){if(b(o)||Q(o))for(let s of o)q(s,e,!0);else if(me(o))for(let s of o)q(s[0],e,!0),q(s[1],e,!0);if(w(o))for(let s in o)q(o[s],e,!0)}};function so(t,e,n){Object.defineProperty(t,e,{value:n,enumerable:!1,writable:!0,configurable:!0})}var Be=(t,e,n)=>{n.forEach(function(r){let o=t[r];so(e,r,function(...i){let a=o.apply(this,i),c=this[W];for(let p of c)q(p);return a})})},yt=(t,e)=>{Object.defineProperty(t,Symbol.toStringTag,{value:e,writable:!1,enumerable:!1,configurable:!0})};var _n=Array.prototype,Zt=Object.create(_n),io=["push","pop","shift","unshift","splice","sort","reverse"];Be(_n,Zt,io);var Hn=Map.prototype,ht=Object.create(Hn),ao=["set","clear","delete"];yt(ht,"Map");Be(Hn,ht,ao);var Bn=Set.prototype,gt=Object.create(Bn),co=["add","clear","delete"];yt(gt,"Set");Be(Bn,gt,co);var oe={},z=t=>{if(m(t)||He(t))return t;let e={auto:!0,_value:t},n=c=>w(c)?W in c?!0:b(c)?(Object.setPrototypeOf(c,Zt),!0):Q(c)?(Object.setPrototypeOf(c,gt),!0):me(c)?(Object.setPrototypeOf(c,ht),!0):!1:!1,r=n(t),o=new Set,s=(c,p)=>{if(oe.stack&&oe.stack.length){oe.stack[oe.stack.length-1].add(a);return}o.size!==0&&mt(()=>{for(let f of[...o.keys()])o.has(f)&&f(c,p)})},i=c=>{let p=c[W];p||(c[W]=p=new Set),p.add(a)},a=(...c)=>{if(!(2 in c)){let f=c[0],l=c[1];return 0 in c?e._value===f||m(f)&&(f=f(),e._value===f)?f:(n(f)&&i(f),e._value=f,e.auto&&s(f,l),e._value):(Un(a),e._value)}switch(c[2]){case 0:{let f=c[3];if(!f)return()=>{};let l=g=>{o.delete(g)};return o.add(f),()=>{l(f)}}case 1:{let f=c[1],l=e._value;s(l,f);break}case 2:return o.size;case 3:{e.auto=!1;break}case 4:e.auto=!0}return e._value};return a[W]=1,ge(a,!1),r&&i(t),a};var D=t=>m(t)?t():t;var et=class{E=[];_=new Map;get S(){return this.E.length}J;constructor(e){this.J=e}Q(e){let n=this.J(e.value);n!==void 0&&this._.set(n,e)}X(e){let n=this.J(this.E[e]?.value);n!==void 0&&this._.delete(n)}static Ke(e,n){return{items:[],index:e,value:n,order:-1}}w(e){e.order=this.S,this.E.push(e),this.Q(e)}ze(e,n){let r=this.S;for(let o=e;o<r;++o)this.E[o].order=o+1;n.order=e,this.E.splice(e,0,n),this.Q(n)}I(e){return this.E[e]}Y(e,n){this.X(e),this.E[e]=n,this.Q(n),n.order=e}ce(e){this.X(e),this.E.splice(e,1);let n=this.S;for(let r=e;r<n;++r)this.E[r].order=r}le(e){let n=this.S;for(let r=e;r<n;++r)this.X(r);this.E.splice(e)}vt(e){return this._.has(e)}We(e){return this._.get(e)?.order??-1}};var en=Symbol("r-for"),bt=class t{p;b;Z;T;constructor(e){this.p=e,this.b=e.o.l.for,this.Z=Ue(this.b),this.T=e.o.l.pre}N(e){let n=e.hasAttribute(this.b),r=ye(e,this.Z);for(let o of r)this.Ge(o);return n}W(e){return e[en]?!0:(e[en]=!0,ye(e,this.Z).forEach(n=>n[en]=!0),!1)}Ge(e){if(e.hasAttribute(this.T)||this.W(e))return;let n=e.getAttribute(this.b);if(!n){k(0,this.b,e);return}e.removeAttribute(this.b),this.Je(e,n)}fe(e){return Y(e)?[]:(_(e)&&(e=e()),Symbol.iterator in Object(e)?e:typeof e=="number"?(r=>({*[Symbol.iterator](){for(let o=1;o<=r;o++)yield o}}))(e):Object.entries(e))}Je(e,n){let r=this.Qe(n);if(!r?.list){k(1,this.b,n,e);return}let o=this.p.o.l.key,s=this.p.o.l.keyBind,i=e.getAttribute(o)??e.getAttribute(s);e.removeAttribute(o),e.removeAttribute(s);let a=i?x=>D(D(x)?.[i]):x=>x,c=(x,L)=>a(x)===a(L),p=De(e),f=e.parentNode;if(!f)return;let l=`${this.b} => ${n}`,g=new Comment(`__begin__ ${l}`);f.insertBefore(g,e),Ie(g,p),p.forEach(x=>{V(x)}),e.remove();let u=new Comment(`__end__ ${l}`);f.insertBefore(u,g.nextSibling);let y=this.p,O=y.h,v=O.V(),h=(x,L,j)=>{let C=r.createContext(L,x),X=et.Ke(C.index,L);return O.C(v,()=>{O.w(C.ctx);let ee=j.previousSibling,Le=[];for(let Ge of p){let d=Ge.cloneNode(!0);f.insertBefore(d,j),Le.push(d)}for(he(y,Le),ee=ee.nextSibling;ee!==j;)X.items.push(ee),ee=ee.nextSibling}),X},M=(x,L)=>{let j=S.I(x).items,C=j[j.length-1].nextSibling;for(let X of j)V(X);S.Y(x,h(x,L,C))},A=(x,L)=>{S.w(h(x,L,u))},Me=x=>{for(let L of S.I(x).items)V(L)},Ke=x=>{let L=S.S;for(let j=x;j<L;++j)S.I(j).index(j)},We=x=>{let L=S.S;_(x)&&(x=x());let j=D(x[0]);if(b(j)&&j.length===0){ae(g,u),S.le(0);return}let C=0,X=Number.MAX_SAFE_INTEGER,ee=L,Le=this.p.o.forGrowThreshold,Ge=()=>S.S<ee+Le;for(let N of this.fe(x[0])){let T=()=>{if(C<L){let P=S.I(C++);if(c(P.value,N))return;let $=S.We(a(N));if($>=C&&$-C<10){if(--C,X=Math.min(X,C),Me(C),S.ce(C),--L,$>C+1)for(let E=C;E<$-1&&E<L&&!c(S.I(C).value,N);)++E,Me(C),S.ce(C),--L;T();return}Ge()?(S.ze(C-1,h(C,N,S.I(C-1).items[0])),X=Math.min(X,C-1),++L):M(C-1,N)}else A(C++,N)};T()}let d=C;for(L=S.S;C<L;)Me(C++);S.le(d),Ke(X)},Vt=()=>{ue=R(rt,We)},nt=()=>{le.stop(),ue()},le=O.v(r.list),rt=le.value,ue,ot=0,S=new et(a);for(let x of this.fe(rt()[0]))S.w(h(ot++,x,u));U(g,nt),Vt()}static Xe=/\{?\[?\(?([^)}\]]+)\)?\]?\}?([^)]+)?\s+\b(?:in|of)\b\s+(.*)\s*$/;Qe(e){let n=t.Xe.exec(e);if(!n)return;let r=(n[1]+(n[2]??"")).split(",").map(c=>c.trim()),o=r.length>1?r.length-1:-1,s=o!==-1&&(r[o]==="index"||r[o]?.startsWith("#"))?r[o]:"";s&&r.splice(o,1);let i=n[3];if(!i||r.length===0)return;let a=/[{[]/.test(e);return{list:i,createContext:(c,p)=>{let f={},l=D(c);if(!a&&r.length===1)f[r[0]]=c;else if(b(l)){let u=0;for(let y of r)f[y]=l[u++]}else for(let u of r)f[u]=l[u];let g={ctx:f,index:z(-1)};return s&&(g.index=f[s.startsWith("#")?s.substring(1):s]=z(p)),g}}}};var po=(t,e)=>{for(let n of t){let r=n.cloneNode(!0);e.appendChild(r)}},Tt=class{p;D;ue;constructor(e){this.p=e,this.D=e.o.l.is,this.ue=Ue(this.D)+", [is]"}N(e){let n=e.hasAttribute(this.D),r=ye(e,this.ue);for(let o of r)this.x(o);return n}x(e){let n=e.getAttribute(this.D);if(!n){if(n=e.getAttribute("is"),!n||!n.startsWith("regor:"))return;n=`'${n.slice(6)}'`,e.removeAttribute("is")}e.removeAttribute(this.D),this.k(e,n)}B(e,n){let r=De(e),o=e.parentNode,s=document.createComment(`__begin__ dynamic ${n??""}`);o.insertBefore(s,e),Ie(s,r),r.forEach(a=>{V(a)}),e.remove();let i=document.createComment(`__end__ dynamic ${n??""}`);return o.insertBefore(i,s.nextSibling),{nodes:r,parent:o,commentBegin:s,commentEnd:i}}k(e,n){let{nodes:r,parent:o,commentBegin:s,commentEnd:i}=this.B(e,` => ${n} `),a=this.p.h.v(n),c=a.value,p=this.p.h,f=p.V(),l={name:""},g=re(e)?r:[...r[0].childNodes],u=()=>{p.C(f,()=>{let h=c()[0];if(w(h)&&(h.name?h=h.name:h=Object.entries(p.me()).filter(A=>A[1]===h)[0]?.[0]),!H(h)||F(h)){ae(s,i);return}if(l.name===h)return;ae(s,i);let M=document.createElement(h);for(let A of e.getAttributeNames())A!==this.D&&M.setAttribute(A,e.getAttribute(A));po(g,M),o.insertBefore(M,i),this.p.G(M),l.name=h})},y=[];U(s,()=>{a.stop();for(let h of y)h();y.length=0}),u();let v=R(c,u);y.push(v)}};var Pn={collectRefObj:!0,onBind:(t,e)=>R(e.value,()=>{let r=e.value(),o=e.context,s=r[0];if(w(s))for(let i of Object.entries(s)){let a=i[0],c=i[1],p=o[a];p!==c&&(m(p)?p(c):o[a]=c)}},!0)};var Vn={collectRefObj:!0,once:!0,onBind:(t,e)=>{let n=e.value(),r=e.context,o=n[0];if(!w(o))return()=>{};for(let s of Object.entries(o)){let i=s[0],a=s[1],c=r[i];c!==a&&(m(c)?c(a):r[i]=a)}return()=>{}}};var be=t=>{it(t)?.onUnmounted?.forEach(n=>{n()}),t.unmounted?.()};var Pe=class{props;start;end;ctx;autoProps=!0;entangle=!0;enableSwitch=!1;onAutoPropsAssigned;de;constructor(e,n,r,o,s){this.props=e,this.de=n,this.ctx=r,this.start=o,this.end=s}emit=(e,n)=>{this.de.dispatchEvent(new CustomEvent(e,{detail:n}))};unmount(){let e=this.start.nextSibling,n=this.end;for(;e&&e!==n;)V(e),e=e.nextSibling;be(this)}};var tn=Symbol("scope"),Et=t=>{try{Sn();let e=t();Kt(e);let n={context:e,unmount:()=>be(e),[tn]:1};return n[tn]=1,n}finally{wn()}},jn=t=>w(t)?tn in t:!1;var vt=(t,e)=>{if(t===e)return()=>{};let n=R(t,o=>e(o)),r=R(e,o=>t(o));return e(t()),()=>{n(),r()}};var xt=t=>{it(t)?.onMounted?.forEach(n=>{n()}),t.mounted?.()};var $n={collectRefObj:!0,onBind:(t,e,n,r,o,s)=>{if(!r)return()=>{};let i=B(r);return R(e.value,()=>{let c=e.refs[0]??e.value()[0],p=e.context,f=p[r];f!==c&&(m(f)?f(c):p[i]=c)},!0)}};var Ct=class{p;ye;constructor(e){this.p=e,this.ye=e.o.l.inherit}N(e){this.Ye(e)}Ye(e){let n=this.p,r=n.h,o=n.o.he,s=n.o.ge,i=r.me(),a=r.Ze(),c=[...o.keys(),...a,...[...o.keys()].map(_e),...a.map(_e)].join(",");if(F(c))return;let p=e.querySelectorAll(c),f=e.matches?.(c)?[e,...p]:p;for(let l of f){if(l.hasAttribute(n.T))continue;let g=l.parentNode;if(!g)continue;let u=l.nextSibling,y=B(l.tagName).toUpperCase(),v=i[y]??s.get(y);if(!v)continue;let h=v.template;if(!h)continue;let M=l.parentElement;if(!M)continue;let A=new Comment(" begin component: "+l.tagName),Me=new Comment(" end component: "+l.tagName);M.insertBefore(A,l),l.remove();let Ke=n.o.l.props,We=n.o.l.propsOnce,Vt=n.o.l.bind,nt=(d,N)=>{let T={},P=d.hasAttribute(Ke),$=d.hasAttribute(We);return r.C(N,()=>{r.w(T),P&&n.x(Pn,d,Ke),$&&n.x(Vn,d,We);let E=v.props;if(!E||E.length===0)return;E=E.map(B);for(let ve of E.concat(E.map(_e))){let ie=d.getAttribute(ve);ie!==null&&(T[B(ve)]=ie,d.removeAttribute(ve))}let G=n.ee.be(d,!1);for(let[ve,ie]of G.entries()){let[xe,jt]=ie.te;jt&&E.includes(B(jt))&&(xe!=="."&&xe!==":"&&xe!==Vt||n.x($n,d,ve,!0,jt,ie.ne))}}),T},le=[...r.V()],rt=()=>{let d=nt(l,le),N=new Pe(d,l,le,A,Me),T=Et(()=>v.context(N)??{}).context;if(N.autoProps){for(let[P,$]of Object.entries(d))if(P in T){let E=T[P];if(E===$)continue;N.entangle&&m(E)&&m($)?U(A,vt($,E)):m(E)?E($):T[P]=D($)}else T[P]=$;N.onAutoPropsAssigned?.()}return{componentCtx:T,head:N}},{componentCtx:ue,head:ot}=rt(),S=[...ce(h)],x=S.length,L=l.childNodes.length===0,j=d=>{let N=d.parentElement;if(L){for(let E of[...d.childNodes])N.insertBefore(E,d);return}let T=d.name;F(T)&&(T=d.getAttributeNames().filter(E=>E.startsWith("#"))[0],F(T)?T="default":T=T.substring(1));let P=l.querySelector(`template[name='${T}'], template[\\#${T}]`);!P&&T==="default"&&(P=l.querySelector("template:not([name])"),P&&P.getAttributeNames().filter(E=>E.startsWith("#")).length>0&&(P=null));let $=E=>{ot.enableSwitch&&r.C(le,()=>{r.w(ue);let G=nt(d,r.V());r.C(le,()=>{r.w(G);let ve=r.V(),ie=Nn(ve);for(let xe of E)Re(xe)&&(xe.setAttribute(Xe,ie),Wt(ie),U(xe,()=>{Gt(ie)}))})})};if(P){let E=[...ce(P)];for(let G of E)N.insertBefore(G,d);$(E)}else{if(T!=="default"){for(let G of[...ce(d)])N.insertBefore(G,d);return}let E=[...ce(l)].filter(G=>!re(G));for(let G of E)N.insertBefore(G,d);$(E)}},C=d=>{if(!Re(d))return;let N=d.querySelectorAll("slot");if(In(d)){j(d),d.remove();return}for(let T of N)j(T),T.remove()};(()=>{for(let d=0;d<x;++d)S[d]=S[d].cloneNode(!0),g.insertBefore(S[d],u),C(S[d])})(),M.insertBefore(Me,u);let ee=()=>{if(!v.inheritAttrs)return;let d=S.filter(T=>T.nodeType===Node.ELEMENT_NODE);d.length>1&&(d=d.filter(T=>T.hasAttribute(this.ye)));let N=d[0];if(N)for(let T of l.getAttributeNames()){if(T===Ke||T===We)continue;let P=l.getAttribute(T);if(T==="class")N.classList.add(...P.split(" "));else if(T==="style"){let $=N.style,E=l.style;for(let G of E)$.setProperty(G,E.getPropertyValue(G))}else N.setAttribute(ut(T,n.o),P)}},Le=()=>{for(let d of l.getAttributeNames())!d.startsWith("@")&&!d.startsWith(n.o.l.on)&&l.removeAttribute(d)},Ge=()=>{ee(),Le(),r.w(ue),n.Te(l,!1),ue.$emit=ot.emit,he(n,S),U(l,()=>{be(ue)}),U(A,()=>{ne(l)}),xt(ue)};r.C(le,Ge)}}};var nn=class{xe;te=[];ne=[];Ee=[];constructor(e){this.xe=e,this.v()}v(){let e=this.xe,n=e.startsWith(".");n&&(e=":"+e.slice(1));let r=e.indexOf("."),o=this.te=(r<0?e:e.substring(0,r)).split(/[:@]/);if(F(o[0])&&(o[0]=n?".":e[0]),r>=0){let s=this.ne=e.slice(r+1).split(".");if(s.includes("camel")){let i=o.length-1;o[i]=B(o[i])}s.includes("prop")&&(o[0]=".")}}},Rt=class{p;Re;constructor(e){this.p=e,this.Re=e.o.et()}be(e,n){let r=new Map;if(!Ye(e))return r;let o=this.Re,s=a=>{let c=a.getAttributeNames().filter(p=>o.some(f=>p.startsWith(f)));for(let p of c)r.has(p)||r.set(p,new nn(p)),r.get(p).Ee.push(a)};if(s(e),!n)return r;let i=e.querySelectorAll("*");for(let a of i)s(a);return r}};var St={};var wt=class{h;ve;Ce;Se;we;ee;o;T;Oe;constructor(e){this.h=e,this.o=e.o,this.Ce=new bt(this),this.ve=new lt(this),this.Se=new Tt(this),this.we=new Ct(this),this.ee=new Rt(this),this.T=this.o.l.pre,this.Oe=this.o.l.dynamic}tt(e){let n=re(e)?[e]:e.querySelectorAll("template");for(let r of n){if(r.hasAttribute(this.T))continue;let o=r.parentNode;if(!o)continue;let s=r.nextSibling;if(r.remove(),!r.content)continue;let i=[...r.content.childNodes];for(let a of i)o.insertBefore(a,s);he(this,i)}}G(e){e.nodeType!==Node.ELEMENT_NODE||e.hasAttribute(this.T)||this.ve.N(e)||this.Ce.N(e)||this.Se.N(e)||(this.we.N(e),this.tt(e),this.Te(e,!0))}Te(e,n){let r=this.ee.be(e,n),o=this.o.H;for(let[s,i]of r.entries()){let[a,c]=i.te,p=o[s]??o[a];if(!p){console.error("directive not found:",a);continue}i.Ee.forEach(f=>{this.x(p,f,s,!1,c,i.ne)})}}x(e,n,r,o,s,i){if(n.hasAttribute(this.T))return;let a=n.getAttribute(r);n.removeAttribute(r);let c=p=>{let f=p.getAttribute(Xe);return f||(p.parentElement?c(p.parentElement):null)};if(Jt()){let p=c(n);if(p){this.h.C(Mn(p),()=>{this.k(e,n,a,s,i)});return}}this.k(e,n,a,s,i)}nt(e,n,r){if(e!==St)return!1;if(F(r))return!0;let o=document.querySelector(r);if(o){let s=n.parentElement;if(!s)return!0;let i=new Comment(`teleported => '${r}'`);s.insertBefore(i,n),n.teleportedFrom=i,i.teleportedTo=n,U(i,()=>{V(n)}),o.appendChild(n)}return!0}k(e,n,r,o,s){if(n.nodeType!==Node.ELEMENT_NODE||r==null||this.nt(e,n,r))return;let i=this.h.v(r,e.isLazy,e.isLazyKey,e.collectRefObj,e.once),a=[];U(n,()=>{i.stop(),f?.stop();for(let v of a)v();a.length=0});let p=Dn(o,this.Oe),f;p&&(f=this.h.v(B(p),void 0,void 0,void 0,e.once));let l,g=()=>(l=i.value(),l),u,y=()=>f?(u=f.value()[0],u):(u=o,o),O=()=>{if(!e.onChange)return;let v=R(i.value,h=>{let M=l,A=u;e.onChange?.(n,g(),M,y(),A,s)});if(a.push(v),f){let h=R(f.value,M=>{let A=u;e.onChange?.(n,g(),A,y(),A,s)});a.push(h)}};e.once||O(),e.onBind&&a.push(e.onBind(n,i,r,o,f,s)),e.onChange?.(n,g(),void 0,y(),void 0,s)}};var fo=9,lo=10,uo=13,mo=32,Te=46,Ot=44,yo=39,ho=34,At=40,Ve=41,Nt=91,Mt=93,rn=63,go=59,Fn=58,bo=123,Lt=125,sn=43,To=45,qn=96,zn=47,Eo=92,Kn=[2,3],Wn=[sn,To],Zn={"-":1,"!":1,"~":1,"+":1,new:1},er={"=":2.5,"*=":2.5,"**=":2.5,"/=":2.5,"%=":2.5,"+=":2.5,"-=":2.5,"<<=":2.5,">>=":2.5,">>>=":2.5,"&=":2.5,"^=":2.5,"|=":2.5},$e={"=>":2,...er,"||":3,"??":3,"&&":4,"|":5,"^":6,"&":7,"==":8,"!=":8,"===":8,"!==":8,"<":9,">":9,"<=":9,">=":9,in:9,"<<":10,">>":10,">>>":10,"+":11,"-":11,"*":12,"/":12,"%":12,"**":13},tr=Object.keys(er),vo=new Set(tr),kt=new Set;kt.add("=>");tr.forEach(t=>kt.add(t));var xo=new Set(["$","_"]),Gn={true:!0,false:!1,null:null},Co="this";function nr(t){return Math.max(0,...Object.keys(t).map(e=>e.length))}var Ro=nr(Zn),So=nr($e),Fe="Expected ",Oe="Unexpected ",cn="Unclosed ",wo=Fe+":",Jn=Fe+"expression",Oo="missing }",Ao=Oe+"object property",No=cn+"(",Qn=Fe+"comma",Xn=Oe+"token ",Mo=Oe+"period",on=Fe+"expression after ",Lo="missing unaryOp argument",ko=cn+"[",Io=Fe+"exponent (",Do="Variable names cannot start with a number (",Uo=cn+'quote after "';var je=t=>t>=48&&t<=57,Yn=t=>$e[t]||0,an=class{rt={0:[this.ot],1:[this.st,this.it,this.at],2:[this.pt,this.ct,this.lt,this.Ae,this.ft],3:[this.ut,this.mt,this.dt]};r;e;get M(){return this.r.charAt(this.e)}get f(){return this.r.charCodeAt(this.e)}m(e){return this.r.charCodeAt(this.e)===e}constructor(e){this.r=e,this.e=0}U(e){let n=String.fromCharCode(e);return e>=65&&e<=90||e>=97&&e<=122||e>=128&&!(n in $e)||xo.has(n)}re(e){return this.U(e)||je(e)}i(e){return new Error(`${e} at character ${this.e}`)}L(e,n,r){let o=this.rt[e];if(!o)return r;let s={node:r},i=a=>{a.call(this,s)};return n===0?o.forEach(i):o.find(i),s.node}y(){let e=this.f,n=this.r,r=this.e;for(;e===mo||e===fo||e===lo||e===uo;)e=n.charCodeAt(++r);this.e=r}parse(){let e=this.oe();return e.length===1?e[0]:{type:0,body:e}}oe(e){let n=[];for(;this.e<this.r.length;){let r=this.f;if(r===go||r===Ot)this.e++;else{let o=this.O();if(o)n.push(o);else if(this.e<this.r.length){if(r===e)break;throw this.i(Oe+'"'+this.M+'"')}}}return n}O(){let e=this.L(0,1)??this.Ne();return this.y(),this.L(1,0,e)}se(){this.y();let e=this.e,n=this.r,r=n.substr(e,So),o=r.length;for(;o>0;){if(r in $e&&(!this.U(this.f)||e+r.length<n.length&&!this.re(n.charCodeAt(e+r.length))))return e+=o,this.e=e,r;r=r.substr(0,--o)}return!1}Ne(){let e,n,r,o,s,i,a,c;if(s=this.j(),!s||(n=this.se(),!n))return s;if(o={value:n,prec:Yn(n),right_a:kt.has(n)},i=this.j(),!i)throw this.i(on+n);let p=[s,o,i];for(;n=this.se();){if(r=Yn(n),r===0){this.e-=n.length;break}o={value:n,prec:r,right_a:kt.has(n)},c=n;let f=l=>o.right_a&&l.right_a?r>l.prec:r<=l.prec;for(;p.length>2&&f(p[p.length-2]);)i=p.pop(),n=p.pop().value,s=p.pop(),e={type:8,operator:n,left:s,right:i},p.push(e);if(e=this.j(),!e)throw this.i(on+c);p.push(o,e)}for(a=p.length-1,e=p[a];a>1;)e={type:8,operator:p[a-1].value,left:p[a-2],right:e},a-=2;return e}j(){let e,n,r;if(this.y(),r=this.L(2,1),r)return this.L(3,0,r);let o=this.f;if(je(o)||o===Te)return this.yt();if(o===yo||o===ho)r=this.ht();else if(o===Nt)r=this.gt();else{for(e=this.r.substr(this.e,Ro),n=e.length;n>0;){if(Object.prototype.hasOwnProperty.call(Zn,e)&&(!this.U(this.f)||this.e+e.length<this.r.length&&!this.re(this.r.charCodeAt(this.e+e.length)))){this.e+=n;let s=this.j();if(!s)throw this.i(Lo);return this.L(3,0,{type:7,operator:e,argument:s})}e=e.substr(0,--n)}this.U(o)?(r=this.ie(),r.name in Gn?r={type:4,value:Gn[r.name],raw:r.name}:r.name===Co&&(r={type:5})):o===At&&(r=this.bt())}return r?(r=this.F(r),this.L(3,0,r)):this.L(3,0,!1)}F(e){this.y();let n=this.f;for(;n===Te||n===Nt||n===At||n===rn;){let r;if(n===rn){if(this.r.charCodeAt(this.e+1)!==Te)break;r=!0,this.e+=2,this.y(),n=this.f}if(this.e++,n===Nt){if(e={type:3,computed:!0,object:e,property:this.O()},this.y(),n=this.f,n!==Mt)throw this.i(ko);this.e++}else n===At?e={type:6,arguments:this.Me(Ve),callee:e}:(n===Te||r)&&(r&&this.e--,this.y(),e={type:3,computed:!1,object:e,property:this.ie()});r&&(e.optional=!0),this.y(),n=this.f}return e}yt(){let e="",n;for(;je(this.f);)e+=this.r.charAt(this.e++);if(this.m(Te))for(e+=this.r.charAt(this.e++);je(this.f);)e+=this.r.charAt(this.e++);if(n=this.M,n==="e"||n==="E"){for(e+=this.r.charAt(this.e++),n=this.M,(n==="+"||n==="-")&&(e+=this.r.charAt(this.e++));je(this.f);)e+=this.r.charAt(this.e++);if(!je(this.r.charCodeAt(this.e-1)))throw this.i(Io+e+this.M+")")}let r=this.f;if(this.U(r))throw this.i(Do+e+this.M+")");if(r===Te||e.length===1&&e.charCodeAt(0)===Te)throw this.i(Mo);return{type:4,value:parseFloat(e),raw:e}}ht(){let e="",n=this.e,r=this.r.charAt(this.e++),o=!1;for(;this.e<this.r.length;){let s=this.r.charAt(this.e++);if(s===r){o=!0;break}else if(s==="\\")switch(s=this.r.charAt(this.e++),s){case"n":e+=`
2
+ `;break;case"r":e+="\r";break;case"t":e+=" ";break;case"b":e+="\b";break;case"f":e+="\f";break;case"v":e+="\v";break;default:e+=s}else e+=s}if(!o)throw this.i(Uo+e+'"');return{type:4,value:e,raw:this.r.substring(n,this.e)}}ie(){let e=this.f,n=this.e;if(this.U(e))this.e++;else throw this.i(Oe+this.M);for(;this.e<this.r.length&&(e=this.f,this.re(e));)this.e++;return{type:2,name:this.r.slice(n,this.e)}}Me(e){let n=[],r=!1,o=0;for(;this.e<this.r.length;){this.y();let s=this.f;if(s===e){if(r=!0,this.e++,e===Ve&&o&&o>=n.length)throw this.i(Xn+String.fromCharCode(e));break}else if(s===Ot){if(this.e++,o++,o!==n.length){if(e===Ve)throw this.i(Xn+",");if(e===Mt)for(let i=n.length;i<o;i++)n.push(null)}}else{if(n.length!==o&&o!==0)throw this.i(Qn);{let i=this.O();if(!i||i.type===0)throw this.i(Qn);n.push(i)}}}if(!r)throw this.i(Fe+String.fromCharCode(e));return n}bt(){this.e++;let e=this.oe(Ve);if(this.m(Ve))return this.e++,e.length===1?e[0]:e.length?{type:1,expressions:e}:!1;throw this.i(No)}gt(){return this.e++,{type:9,elements:this.Me(Mt)}}pt(e){if(this.m(bo)){this.e++;let n=[];for(;!isNaN(this.f);){if(this.y(),this.m(Lt)){this.e++,e.node=this.F({type:10,properties:n});return}let r=this.O();if(!r)break;if(this.y(),r.type===2&&(this.m(Ot)||this.m(Lt)))n.push({type:12,computed:!1,key:r,value:r,shorthand:!0});else if(this.m(Fn)){this.e++;let o=this.O();if(!o)throw this.i(Ao);let s=r.type===9;n.push({type:12,computed:s,key:s?r.elements[0]:r,value:o,shorthand:!1}),this.y()}else r&&n.push(r);this.m(Ot)&&this.e++}throw this.i(Oo)}}ct(e){let n=this.f;if(Wn.some(r=>r===n&&r===this.r.charCodeAt(this.e+1))){this.e+=2;let r=e.node={type:13,operator:n===sn?"++":"--",argument:this.F(this.ie()),prefix:!0};if(!r.argument||!Kn.includes(r.argument.type))throw this.i(Oe+r.operator)}}mt(e){if(e.node){let n=this.f;if(Wn.some(r=>r===n&&r===this.r.charCodeAt(this.e+1))){if(!Kn.includes(e.node.type))throw this.i(Oe+e.node.operator);this.e+=2,e.node={type:13,operator:n===sn?"++":"--",argument:e.node,prefix:!1}}}}lt(e){[0,1,2].every(n=>this.r.charCodeAt(this.e+n)===Te)&&(this.e+=3,e.node={type:14,argument:this.O()})}at(e){if(e.node&&this.m(rn)){this.e++;let n=e.node,r=this.O();if(!r)throw this.i(Jn);if(this.y(),this.m(Fn)){this.e++;let o=this.O();if(!o)throw this.i(Jn);if(e.node={type:11,test:n,consequent:r,alternate:o},n.operator&&$e[n.operator]<=.9){let s=n;for(;s.right.operator&&$e[s.right.operator]<=.9;)s=s.right;e.node.test=s.right,s.right=e.node,e.node=n}}else throw this.i(wo)}}ot(e){if(this.y(),this.m(At)){let n=this.e;if(this.e++,this.y(),this.m(Ve)){this.e++;let r=this.se();if(r==="=>"){let o=this.Ne();if(!o)throw this.i(on+r);e.node={type:15,params:null,body:o};return}}this.e=n}}st(e){this.Le(e.node)}Le(e){e&&(Object.values(e).forEach(n=>{n&&typeof n=="object"&&this.Le(n)}),e.operator==="=>"&&(e.type=15,e.params=e.left?[e.left]:null,e.body=e.right,e.params&&e.params[0].type===1&&(e.params=e.params[0].expressions),delete e.left,delete e.right,delete e.operator))}it(e){e.node&&this.$(e.node)}$(e){vo.has(e.operator)?(e.type=16,this.$(e.left),this.$(e.right)):e.operator||Object.values(e).forEach(n=>{n&&typeof n=="object"&&this.$(n)})}dt(e){if(!e.node)return;let n=e.node.type;(n===2||n===3)&&this.m(qn)&&(e.node={type:17,tag:e.node,quasi:this.Ae(e)})}Ae(e){if(!this.m(qn))return;let n={type:19,quasis:[],expressions:[]},r="",o="",s=!1,i=this.r.length,a=()=>n.quasis.push({type:18,value:{raw:o,cooked:r},tail:s});for(;this.e<i;){let c=this.r.charAt(++this.e);if(c==="`")return this.e+=1,s=!0,a(),e.node=n,n;if(c==="$"&&this.r.charAt(this.e+1)==="{"){if(this.e+=2,a(),o="",r="",n.expressions.push(...this.oe(Lt)),!this.m(Lt))throw this.i("unclosed ${")}else if(c==="\\")switch(o+=c,c=this.r.charAt(++this.e),o+=c,c){case"n":r+=`
3
+ `;break;case"r":r+="\r";break;case"t":r+=" ";break;case"b":r+="\b";break;case"f":r+="\f";break;case"v":r+="\v";break;default:r+=c}else r+=c,o+=c}throw this.i("Unclosed `")}ut(e){let n=e.node;if(!n||n.operator!=="new"||!n.argument)return;if(!n.argument||![6,3].includes(n.argument.type))throw this.i("Expected new function()");e.node=n.argument;let r=e.node;for(;r.type===3||r.type===6&&r?.callee?.type===3;)r=r.type===3?r.object:r.callee.object;r.type=20}ft(e){if(!this.m(zn))return;let n=++this.e,r=!1;for(;this.e<this.r.length;){if(this.f===zn&&!r){let o=this.r.slice(n,this.e),s="";for(;++this.e<this.r.length;){let a=this.f;if(a>=97&&a<=122||a>=65&&a<=90||a>=48&&a<=57)s+=this.M;else break}let i;try{i=new RegExp(o,s)}catch(a){throw this.i(a.message)}return e.node={type:4,value:i,raw:this.r.slice(n-1,this.e)},e.node=this.F(e.node),e.node}this.m(Nt)?r=!0:r&&this.m(Mt)&&(r=!1),this.e+=this.m(Eo)?2:1}throw this.i("Unclosed Regex")}},rr=t=>new an(t).parse();var _o={"=>":(t,e)=>{},"=":(t,e)=>{},"*=":(t,e)=>{},"**=":(t,e)=>{},"/=":(t,e)=>{},"%=":(t,e)=>{},"+=":(t,e)=>{},"-=":(t,e)=>{},"<<=":(t,e)=>{},">>=":(t,e)=>{},">>>=":(t,e)=>{},"&=":(t,e)=>{},"^=":(t,e)=>{},"|=":(t,e)=>{},"||":(t,e)=>t()||e(),"??":(t,e)=>t()??e(),"&&":(t,e)=>t()&&e(),"|":(t,e)=>t|e,"^":(t,e)=>t^e,"&":(t,e)=>t&e,"==":(t,e)=>t==e,"!=":(t,e)=>t!=e,"===":(t,e)=>t===e,"!==":(t,e)=>t!==e,"<":(t,e)=>t<e,">":(t,e)=>t>e,"<=":(t,e)=>t<=e,">=":(t,e)=>t>=e,in:(t,e)=>t in e,"<<":(t,e)=>t<<e,">>":(t,e)=>t>>e,">>>":(t,e)=>t>>>e,"+":(t,e)=>t+e,"-":(t,e)=>t-e,"*":(t,e)=>t*e,"/":(t,e)=>t/e,"%":(t,e)=>t%e,"**":(t,e)=>t**e},Ho={"-":t=>-t,"+":t=>+t,"!":t=>!t,"~":t=>~t,new:t=>t},ar=t=>{if(!t?.some(ir))return t;let e=[];return t.forEach(n=>ir(n)?e.push(...n):e.push(n)),e},or=(...t)=>ar(t),pn=(t,e)=>{if(!t)return e;let n=Object.create(e??{});return n.$event=t,n},Bo={"++":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(++r),r}return++t[e]},"--":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(--r),r}return--t[e]}},Po={"++":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(r+1),r}return t[e]++},"--":(t,e)=>{let n=t[e];if(m(n)){let r=n();return n(r-1),r}return t[e]--}},sr={"=":(t,e,n)=>{let r=t[e];return m(r)?r(n):t[e]=n},"+=":(t,e,n)=>{let r=t[e];return m(r)?r(r()+n):t[e]+=n},"-=":(t,e,n)=>{let r=t[e];return m(r)?r(r()-n):t[e]-=n},"*=":(t,e,n)=>{let r=t[e];return m(r)?r(r()*n):t[e]*=n},"/=":(t,e,n)=>{let r=t[e];return m(r)?r(r()/n):t[e]/=n},"%=":(t,e,n)=>{let r=t[e];return m(r)?r(r()%n):t[e]%=n},"**=":(t,e,n)=>{let r=t[e];return m(r)?r(r()**n):t[e]**=n},"<<=":(t,e,n)=>{let r=t[e];return m(r)?r(r()<<n):t[e]<<=n},">>=":(t,e,n)=>{let r=t[e];return m(r)?r(r()>>n):t[e]>>=n},">>>=":(t,e,n)=>{let r=t[e];return m(r)?r(r()>>>n):t[e]>>>=n},"|=":(t,e,n)=>{let r=t[e];return m(r)?r(r()|n):t[e]|=n},"&=":(t,e,n)=>{let r=t[e];return m(r)?r(r()&n):t[e]&=n},"^=":(t,e,n)=>{let r=t[e];return m(r)?r(r()^n):t[e]^=n}},It=(t,e)=>_(t)?t.bind(e):t,fn=class{u;ke;Ve;Ie;A;De;Ue;constructor(e,n,r,o,s){this.u=b(e)?e:[e],this.ke=n,this.Ve=r,this.Ie=o,this.Ue=!!s}Pe(e,n){if(n&&e in n)return n;for(let r of this.u)if(e in r)return r}2(e,n,r){let o=e.name;if(o==="$root")return this.u[this.u.length-1];if(o==="$parent")return this.u[1];if(o==="$ctx")return[...this.u];if(r&&o in r)return this.A=r[o],It(D(r[o]),r);for(let i of this.u)if(o in i)return this.A=i[o],It(D(i[o]),i);let s=this.ke;if(s&&o in s)return this.A=s[o],It(D(s[o]),s)}5(e,n,r){return this.u[0]}0(e,n,r){return this.Be(n,r,or,...e.body)}1(e,n,r){return this.R(n,r,(...o)=>o.pop(),...e.expressions)}3(e,n,r){let{obj:o,key:s}=this.ae(e,n,r),i=o?.[s];return this.A=i,It(D(i),o)}4(e,n,r){return e.value}6(e,n,r){let o=(i,...a)=>_(i)?i(...ar(a)):i,s=this.R(++n,r,o,e.callee,...e.arguments);return this.A=s,s}7(e,n,r){return this.R(n,r,Ho[e.operator],e.argument)}8(e,n,r){let o=_o[e.operator];switch(e.operator){case"||":case"&&":case"??":return o(()=>this.g(e.left,n,r),()=>this.g(e.right,n,r))}return this.R(n,r,o,e.left,e.right)}9(e,n,r){return this.Be(++n,r,or,...e.elements)}10(e,n,r){let o={},s=(...i)=>{i.forEach(a=>{Object.assign(o,a)})};return this.R(++n,r,s,...e.properties),o}11(e,n,r){return this.R(n,r,o=>this.g(o?e.consequent:e.alternate,n,r),e.test)}12(e,n,r){let o={},s=f=>f?.type!==15,i=this.Ie??(()=>!1),a=n===0&&this.Ue,c=f=>this._e(a,e.key,n,pn(f,r)),p=f=>this._e(a,e.value,n,pn(f,r));if(e.shorthand){let f=e.key.name;o[f]=s(e.key)&&i(f,n)?c:c()}else if(e.computed){let f=D(c());o[f]=s(e.value)&&i(f,n)?p:p()}else{let f=e.key.type===4?e.key.value:e.key.name;o[f]=s(e.value)&&i(f,n)?()=>p:p()}return o}ae(e,n,r){let o=this.g(e.object,n,r),s=e.computed?this.g(e.property,n,r):e.property.name;return{obj:o,key:s}}13(e,n,r){let o=e.argument,s=e.operator,i=e.prefix?Bo:Po;if(o.type===2){let a=o.name,c=this.Pe(a,r);return Y(c)?void 0:i[s](c,a)}if(o.type===3){let{obj:a,key:c}=this.ae(o,n,r);return i[s](a,c)}}16(e,n,r){let o=e.left,s=e.operator;if(o.type===2){let i=o.name,a=this.Pe(i,r);if(Y(a))return;let c=this.g(e.right,n,r);return sr[s](a,i,c)}if(o.type===3){let{obj:i,key:a}=this.ae(o,n,r),c=this.g(e.right,n,r);return sr[s](i,a,c)}}14(e,n,r){let o=this.g(e.argument,n,r);return b(o)&&(o.s=cr),o}17(e,n,r){return this[6]({type:6,callee:e.tag,arguments:[{type:9,elements:e.quasi.quasis},...e.quasi.expressions]},n,r)}19(e,n,r){let o=(...s)=>s.reduce((i,a,c)=>i+=a+e.quasis[c+1].value.cooked,e.quasis[0].value.cooked);return this.R(n,r,o,...e.expressions)}18(e,n,r){return e.value.cooked}20(e,n,r){let o=(s,...i)=>new s(...i);return this.R(n,r,o,e.callee,...e.arguments)}15(e,n,r){return(...o)=>{let s=Object.create(r??{}),i=e.params;if(i){let a=0;for(let c of i)s[c.name]=o[a++]}return this.g(e.body,n,s)}}g(e,n,r){let o=D(this[e.type](e,n,r));return this.De=e.type,o}_e(e,n,r,o){let s=this.g(n,r,o);return e&&this.He()?this.A:s}He(){let e=this.De;return(e===2||e===3||e===6)&&m(this.A)}eval(e,n){let{value:r,refs:o}=dt(()=>this.g(e,-1,n)),s={value:r,refs:o};return this.He()&&(s.ref=this.A),s}R(e,n,r,...o){let s=o.map(i=>i&&this.g(i,e,n));return r(...s)}Be(e,n,r,...o){let s=this.Ve;if(!s)return this.R(e,n,r,...o);let i=o.map((a,c)=>a&&(a.type!==15&&s(c,e)?p=>this.g(a,e,pn(p,n)):this.g(a,e,n)));return r(...i)}},cr=Symbol("s"),ir=t=>t?.s===cr,pr=(t,e,n,r,o,s,i)=>new fn(e,n,r,o,i).eval(t,s);var fr={},Dt=class{u;o;constructor(e,n){this.u=e,this.o=n}w(e){this.u=[e,...this.u]}me(){return this.u.map(n=>n.components).filter(n=>!!n).reverse().reduce((n,r)=>{for(let[o,s]of Object.entries(r))n[o.toUpperCase()]=s;return n},{})}Ze(){let e=[],n=new Set,r=this.u.map(o=>o.components).filter(o=>!!o).reverse();for(let o of r)for(let s of Object.keys(o))n.has(s)||(n.add(s),e.push(s));return e}v(e,n,r,o,s){let i=z([]),a=[],c=()=>{for(let u of a)u();a.length=0},p={value:i,stop:c,refs:[],context:this.u[0]};if(F(e))return p;let f=this.o.globalContext,l=[],g=(u,y,O,v)=>{try{let h=pr(u,y,f,n,r,v,o);return O&&l.push(...h.refs),{value:h.value,refs:h.refs,ref:h.ref}}catch(h){k(6,`evaluation error: ${e}`,h)}return{value:void 0,refs:[]}};try{let u=fr[e]??rr("["+e+"]");fr[e]=u;let y=this.u,O=()=>{l.splice(0),c();let v=u.elements.map((h,M)=>n?.(M,-1)?{value:A=>g(h,y,!1,{$event:A}).value,refs:[]}:g(h,y,!0));if(!s)for(let h of l){let M=R(h,O);a.push(M)}i(v.map(h=>h.value)),p.refs=v.map(h=>h.ref)};O()}catch(u){k(6,`parse error: ${e}`,u)}return p}V(){return this.u}je=[];Y(e){this.je.push(this.u),this.u=e}C(e,n){try{this.Y(e),n()}finally{this.Tt()}}Tt(){this.u=this.je.pop()??[]}};var lr="http://www.w3.org/1999/xlink",Vo={itemscope:2,allowfullscreen:2,formnovalidate:2,ismap:2,nomodule:2,novalidate:2,readonly:2,async:1,autofocus:1,autoplay:1,controls:1,default:1,defer:1,disabled:1,hidden:1,inert:1,loop:1,open:1,required:1,reversed:1,scoped:1,seamless:1,checked:1,muted:1,multiple:1,selected:1};function jo(t){return!!t||t===""}var ln={onChange:(t,e,n,r,o,s)=>{if(r){s&&s.includes("camel")&&(r=B(r)),Ut(t,r,e[0],o);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(b(c)){let p=n?.[a]?.[0],f=c[0],l=c[1];Ut(t,f,l,p)}else if(w(c))for(let p of Object.entries(c)){let f=p[0],l=p[1],g=n?.[a],u=g&&f in g?f:void 0;Ut(t,f,l,u)}else{let p=n?.[a],f=e[a++],l=e[a];Ut(t,f,l,p)}}}},Ut=(t,e,n,r)=>{if(r&&r!==e&&t.removeAttribute(r),Y(e)){k(3,name,t);return}if(!H(e)){k(6,`Attribute key is not string at ${t.outerHTML}`,e);return}if(e.startsWith("xlink:")){Y(n)?t.removeAttributeNS(lr,e.slice(6,e.length)):t.setAttributeNS(lr,e,n);return}let o=e in Vo;Y(n)||o&&!jo(n)?t.removeAttribute(e):t.setAttribute(e,o?"":n)};var un={onChange:(t,e,n)=>{let r=e.length;for(let o=0;o<r;++o){let s=e[o],i=n?.[o];if(b(s)){let a=s.length;for(let c=0;c<a;++c)ur(t,s[c],i?.[c])}else ur(t,s,i)}}},ur=(t,e,n)=>{let r=t.classList,o=H(e),s=H(n);if(e&&!o){if(n&&!s)for(let i in n)(!(i in e)||!e[i])&&r.remove(i);for(let i in e)e[i]&&r.add(i)}else o?n!==e&&(s&&r.remove(...n.trim().split(/\s+/)),r.add(...e.trim().split(/\s+/))):n&&s&&r.remove(...n.trim().split(/\s+/))};var mr={onChange:(t,e)=>{let[n,r]=e;_(r)?r(t,n):t.innerHTML=n?.toString()}};function $o(t,e){if(t.length!==e.length)return!1;let n=!0;for(let r=0;n&&r<t.length;r++)n=pe(t[r],e[r]);return n}function pe(t,e){if(t===e)return!0;let n=qt(t),r=qt(e);if(n||r)return n&&r?t.getTime()===e.getTime():!1;if(n=Je(t),r=Je(e),n||r)return t===e;if(n=b(t),r=b(e),n||r)return n&&r?$o(t,e):!1;if(n=w(t),r=w(e),n||r){if(!n||!r)return!1;let o=Object.keys(t).length,s=Object.keys(e).length;if(o!==s)return!1;for(let i in t){let a=t.hasOwnProperty(i),c=e.hasOwnProperty(i);if(a&&!c||!a&&c||!pe(t[i],e[i]))return!1}}return String(t)===String(e)}function _t(t,e){return t.findIndex(n=>pe(n,e))}var dr=t=>{let e=parseFloat(t);return isNaN(e)?t:e};var Ht=t=>{if(!m(t))throw I(3,"pause");t(void 0,void 0,3)};var Bt=t=>{if(!m(t))throw I(3,"resume");t(void 0,void 0,4)};var hr={onChange:(t,e)=>{Fo(t,e[0])},onBind:(t,e,n,r,o,s)=>qo(t,e,s)},Fo=(t,e)=>{let n=Er(t);if(n&&gr(t))b(e)?e=_t(e,fe(t))>-1:Q(e)?e=e.has(fe(t)):e=Qo(t,e),t.checked=e;else if(n&&br(t))t.checked=pe(e,fe(t));else if(n||vr(t))Tr(t)?t.value!==e?.toString()&&(t.value=e):t.value!==e&&(t.value=e);else if(xr(t)){let r=t.options,o=r.length,s=t.multiple;for(let i=0;i<o;i++){let a=r[i],c=fe(a);if(s)b(e)?a.selected=_t(e,c)>-1:a.selected=e.has(c);else if(pe(fe(a),e)){t.selectedIndex!==i&&(t.selectedIndex=i);return}}!s&&t.selectedIndex!==-1&&(t.selectedIndex=-1)}else k(7,t)},tt=t=>(m(t)&&(t=t()),_(t)&&(t=t()),t?H(t)?{trim:t.includes("trim"),lazy:t.includes("lazy"),number:t.includes("number"),int:t.includes("int")}:{trim:!!t.trim,lazy:!!t.lazy,number:!!t.number,int:!!t.int}:{trim:!1,lazy:!1,number:!1,int:!1}),gr=t=>t.type==="checkbox",br=t=>t.type==="radio",Tr=t=>t.type==="number"||t.type==="range",Er=t=>t.tagName==="INPUT",vr=t=>t.tagName==="TEXTAREA",xr=t=>t.tagName==="SELECT",qo=(t,e,n)=>{let r=e.value,o=tt(n?.join(",")),s=tt(r()[1]),i={int:o.int||s.int,lazy:o.lazy||s.lazy,number:o.number||s.number,trim:o.trim||s.trim},a=e.refs[0];if(!a)return k(8,t),()=>{};let c=Er(t);return c&&gr(t)?Ko(t,a):c&&br(t)?Xo(t,a):c||vr(t)?zo(t,i,a,r):xr(t)?Yo(t,a,r):(k(7,t),()=>{})},yr=/[.,' ·٫]/,zo=(t,e,n,r)=>{let s=e.lazy?"change":"input",i=Tr(t),a=()=>{!e.trim&&!tt(r()[1]).trim||(t.value=t.value.trim())},c=g=>{let u=g.target;u.composing=1},p=g=>{let u=g.target;u.composing&&(u.composing=0,u.dispatchEvent(new Event(s)))},f=()=>{t.removeEventListener(s,l),t.removeEventListener("change",a),t.removeEventListener("compositionstart",c),t.removeEventListener("compositionend",p),t.removeEventListener("change",p)},l=g=>{let u=g.target;if(!u||u.composing)return;let y=u.value,O=tt(r()[1]);if(i||O.number||O.int){if(O.int)y=parseInt(y);else{if(yr.test(y[y.length-1])&&y.split(yr).length===2){if(y+="0",y=parseFloat(y),isNaN(y))y="";else if(n()===y)return}y=parseFloat(y)}isNaN(y)&&(y=""),t.value=y}else O.trim&&(y=y.trim());n(y)};return t.addEventListener(s,l),t.addEventListener("change",a),t.addEventListener("compositionstart",c),t.addEventListener("compositionend",p),t.addEventListener("change",p),f},Ko=(t,e)=>{let n="change",r=()=>{t.removeEventListener(n,o)},o=()=>{let s=fe(t),i=t.checked,a=e();if(b(a)){let c=_t(a,s),p=c!==-1;i&&!p?a.push(s):!i&&p&&a.splice(c,1)}else Q(a)?i?a.add(s):a.delete(s):e(Jo(t,i))};return t.addEventListener(n,o),r},fe=t=>"_value"in t?t._value:t.value,Cr="trueValue",Wo="falseValue",Rr="true-value",Go="false-value",Jo=(t,e)=>{let n=e?Cr:Wo;if(n in t)return t[n];let r=e?Rr:Go;return t.hasAttribute(r)?t.getAttribute(r):e},Qo=(t,e)=>{if(Cr in t)return pe(e,t.trueValue);let r=Rr;return t.hasAttribute(r)?pe(e,t.getAttribute(r)):pe(e,!0)},Xo=(t,e)=>{let n="change",r=()=>{t.removeEventListener(n,o)},o=()=>{let s=fe(t);e(s)};return t.addEventListener(n,o),r},Yo=(t,e,n)=>{let r="change",o=()=>{t.removeEventListener(r,s)},s=()=>{let a=tt(n()[1]).number,c=Array.prototype.filter.call(t.options,p=>p.selected).map(p=>a?dr(fe(p)):fe(p));if(t.multiple){let p=e();try{if(Ht(e),Q(p)){p.clear();for(let f of c)p.add(f)}else b(p)?(p.splice(0),p.push(...c)):e(c)}finally{Bt(e),q(e)}}else e(c[0])};return t.addEventListener(r,s),o};var Zo=["stop","prevent","capture","self","once","left","right","middle","passive"],es=t=>{let e={};if(F(t))return;let n=t.split(",");for(let r of Zo)e[r]=n.includes(r);return e},dn={isLazy:(t,e)=>e===-1&&t%2===0,isLazyKey:(t,e)=>e===0&&!t.endsWith("_flags"),once:!1,collectRefObj:!0,onBind:(t,e,n,r,o,s)=>{if(o){let f=e.value(),l=D(o.value()[0]);return H(l)?mn(t,B(l),()=>e.value()[0],s?.join(",")??f[1]):()=>{}}else if(r){let f=e.value();return mn(t,B(r),()=>e.value()[0],s?.join(",")??f[1])}let i=[],a=()=>{i.forEach(f=>f())},c=e.value(),p=c.length;for(let f=0;f<p;++f){let l=c[f];if(_(l)&&(l=l()),w(l))for(let g of Object.entries(l)){let u=g[0],y=()=>{let v=e.value()[f];return _(v)&&(v=v()),v=v[u],_(v)&&(v=v()),v},O=l[u+"_flags"];i.push(mn(t,u,y,O))}else k(2,name,t)}return a}},ts=(t,e)=>{if(t.startsWith("keydown")||t.startsWith("keyup")||t.startsWith("keypress")){e??="";let n=t.split(".").concat(e.split(","));t=n[0];let r=n[1],o=n.includes("ctrl"),s=n.includes("shift"),i=n.includes("alt"),a=n.includes("meta"),c=p=>!(o&&!p.ctrlKey||s&&!p.shiftKey||i&&!p.altKey||a&&!p.metaKey);return r?[t,p=>c(p)?p.key.toUpperCase()===r.toUpperCase():!1]:[t,c]}return[t,n=>!0]},mn=(t,e,n,r)=>{if(F(e))return k(5,name,t),()=>{};let o=es(r),s=o?{capture:o.capture,passive:o.passive,once:o.once}:void 0,i;[e,i]=ts(e,r);let a=f=>{if(!i(f)||!n&&e==="submit"&&o?.prevent)return;let l=n(f);_(l)&&(l=l(f)),_(l)&&l(f)},c=()=>{t.removeEventListener(e,p,s)},p=f=>{if(!o){a(f);return}try{if(o.left&&f.button!==0||o.middle&&f.button!==1||o.right&&f.button!==2||o.self&&f.target!==t)return;o.stop&&f.stopPropagation(),o.prevent&&f.preventDefault(),a(f)}finally{o.once&&c()}};return t.addEventListener(e,p,s),c};var Sr={onChange:(t,e,n,r,o,s)=>{if(r){s&&s.includes("camel")&&(r=B(r)),qe(t,r,e[0]);return}let i=e.length;for(let a=0;a<i;++a){let c=e[a];if(b(c)){let p=c[0],f=c[1];qe(t,p,f)}else if(w(c))for(let p of Object.entries(c)){let f=p[0],l=p[1];qe(t,f,l)}else{let p=e[a++],f=e[a];qe(t,p,f)}}}};function ns(t){return!!t||t===""}var qe=(t,e,n)=>{if(Y(e)){k(3,name,t);return}if(e==="innerHTML"||e==="textContent"){let s=[...t.childNodes];setTimeout(()=>s.forEach(ne),1),t[e]=n??"";return}let r=t.tagName;if(e==="value"&&r!=="PROGRESS"&&!r.includes("-")){t._value=n;let s=r==="OPTION"?t.getAttribute("value"):t.value,i=n??"";s!==i&&(t.value=i),n==null&&t.removeAttribute(e);return}let o=!1;if(n===""||n==null){let s=typeof t[e];s==="boolean"?n=ns(n):n==null&&s==="string"?(n="",o=!0):s==="number"&&(n=0,o=!0)}try{t[e]=n}catch(s){o||k(4,e,r,n,s)}o&&t.removeAttribute(e)};var wr={once:!0,onBind:(t,e,n)=>{let r=e.value()[0],o=b(r),s=e.refs[0];return o?r.push(t):s?s?.(t):e.context[n]=t,()=>{if(o){let i=r.indexOf(t);i!==-1&&r.splice(i,1)}else s?.(null)}}};var Or={onChange:(t,e)=>{let n=de(t).data,r=n._ord;Cn(r)&&(r=n._ord=t.style.display),!!e[0]?t.style.display=r:t.style.display="none"}};var gn={onChange:(t,e,n)=>{let r=e.length;for(let o=0;o<r;++o){let s=e[o],i=n?.[o];if(b(s)){let a=s.length;for(let c=0;c<a;++c)Ar(t,s[c],i?.[c])}else Ar(t,s,i)}}},Ar=(t,e,n)=>{let r=t.style,o=H(e);if(e&&!o){if(n&&!H(n))for(let s in n)e[s]==null&&hn(r,s,"");for(let s in e)hn(r,s,e[s])}else{let s=r.display;if(o?n!==e&&(r.cssText=e):n&&t.removeAttribute("style"),"_ord"in de(t).data)return;r.display=s}},Nr=/\s*!important$/;function hn(t,e,n){if(b(n))n.forEach(r=>{hn(t,e,r)});else if(n==null&&(n=""),e.startsWith("--"))t.setProperty(e,n);else{let r=rs(t,e);Nr.test(n)?t.setProperty(_e(r),n.replace(Nr,""),"important"):t[r]=n}}var Mr=["Webkit","Moz","ms"],yn={};function rs(t,e){let n=yn[e];if(n)return n;let r=B(e);if(r!=="filter"&&r in t)return yn[e]=r;r=Ze(r);for(let o=0;o<Mr.length;o++){let s=Mr[o]+r;if(s in t)return yn[e]=s}return e}var J=t=>Lr(D(t)),Lr=(t,e=new WeakMap)=>{if(!t||!w(t))return t;if(b(t))return t.map(J);if(Q(t)){let r=new Set;for(let o of t.keys())r.add(J(o));return r}if(me(t)){let r=new Map;for(let o of t)r.set(J(o[0]),J(o[1]));return r}if(e.has(t))return D(e.get(t));let n={...t};e.set(t,n);for(let r of Object.entries(n))n[r[0]]=Lr(D(r[1]),e);return n};var kr={onChange:(t,e)=>{let n=e[0];t.textContent=Q(n)?JSON.stringify(J([...n])):me(n)?JSON.stringify(J([...n])):w(n)?JSON.stringify(J(n)):n?.toString()??""}};var Ir={onChange:(t,e)=>{qe(t,"value",e[0])}};var Ae=t=>t?.[at]===1;var Ee=t=>{if(He(t))return t;let e;if(m(t)?(e=t,t=e()):e=z(t),t instanceof Node||t instanceof Date||t instanceof RegExp||t instanceof Promise||t instanceof Error)return e;if(e[at]=1,b(t)){let n=t.length;for(let r=0;r<n;++r){let o=t[r];Ae(o)||(t[r]=Ee(o))}return e}if(!w(t))return e;for(let n of Object.entries(t)){let r=n[1];if(Ae(r))continue;let o=n[0];Je(o)||(t[o]=null,t[o]=Ee(r))}return e};var se=class t{static getDefault(){return t.Fe??(t.Fe=new t)}H={};l={};et=()=>Object.keys(this.H).filter(e=>e.length===1||!e.startsWith(":"));he=new Map;ge=new Map;static Fe;static xt="Infinity,undefined,NaN,isFinite,isNaN,parseFloat,parseInt,decodeURI,decodeURIComponent,encodeURI,encodeURIComponent,Math,Number,Date,Array,Object,Boolean,String,RegExp,Map,Set,JSON,Intl,BigInt,console";forGrowThreshold=10;globalContext;useInterpolation=!0;constructor(e){if(this.setDirectives("r-"),e){this.globalContext=e;return}this.globalContext=this.Et()}Et(){let e={},n=globalThis;for(let r of t.xt.split(","))e[r]=n[r];return e.ref=Ee,e.sref=z,e.flatten=J,e}addComponent(...e){for(let n of e){if(!n.defaultName){Qe.warning("Registered component's default name is not defined",n);continue}this.he.set(Ze(n.defaultName),n),this.ge.set(Ze(n.defaultName).toLocaleUpperCase(),n)}}setDirectives(e){this.H={".":Sr,":":ln,"@":dn,[`${e}on`]:dn,[`${e}bind`]:ln,[`${e}html`]:mr,[`${e}text`]:kr,[`${e}show`]:Or,[`${e}model`]:hr,":style":gn,[`${e}bind:style`]:gn,":class":un,[`${e}bind:class`]:un,":ref":wr,":value":Ir,teleport:St},this.l={for:`${e}for`,if:`${e}if`,else:`${e}else`,elseif:`${e}else-if`,pre:`${e}pre`,inherit:`${e}inherit`,text:`${e}text`,props:":props",propsOnce:":props-once",bind:`${e}bind`,on:`${e}on`,keyBind:":key",key:"key",is:":is",teleport:`${e}teleport`,dynamic:"_d_"}}updateDirectives(e){e(this.H,this.l)}};var Pt=(t,e)=>{if(!t)return;let n=(e??se.getDefault()).l;for(let r of is(t,n.pre))ss(r,n.text)},os=/({{[^]*?}})/g,ss=(t,e)=>{let n=t.textContent;if(!n)return;let r=os,o=n.split(r);if(o.length<=1)return;if(t.parentElement?.childNodes.length===1&&o.length===3){let i=o[1];if(F(o[0])&&F(o[2])&&i.startsWith("{{")&&i.endsWith("}}")){let a=t.parentElement;a.setAttribute(e,i.substring(2,i.length-2)),a.innerText="";return}}let s=document.createDocumentFragment();for(let i of o)if(i.startsWith("{{")&&i.endsWith("}}")){let a=document.createElement("span");a.setAttribute(e,i.substring(2,i.length-2)),s.appendChild(a)}else s.appendChild(document.createTextNode(i));t.replaceWith(s)},is=(t,e)=>{let n=[],r=o=>{if(o.nodeType===Node.TEXT_NODE)o.textContent?.includes("{{")&&n.push(o);else{if(o?.hasAttribute?.(e))return;for(let s of ce(o))r(s)}};return r(t),n};var as="svg,animate,animateMotion,animateTransform,circle,clipPath,color-profile,defs,desc,discard,ellipse,feBlend,feColorMatrix,feComponentTransfer,feComposite,feConvolveMatrix,feDiffuseLighting,feDisplacementMap,feDistantLight,feDropShadow,feFlood,feFuncA,feFuncB,feFuncG,feFuncR,feGaussianBlur,feImage,feMerge,feMergeNode,feMorphology,feOffset,fePointLight,feSpecularLighting,feSpotLight,feTile,feTurbulence,filter,foreignObject,g,hatch,hatchpath,image,line,linearGradient,marker,mask,mesh,meshgradient,meshpatch,meshrow,metadata,mpath,path,pattern,polygon,polyline,radialGradient,rect,set,solidcolor,stop,switch,symbol,text,textPath,title,tspan,unknown,use,view",cs=new Set(as.toUpperCase().split(",")),ps="http://www.w3.org/2000/svg",Dr=(t,e)=>{re(t)?t.content.appendChild(e):t.appendChild(e)},bn=(t,e,n,r)=>{let o=t.t;if(o){let i=n&&cs.has(o.toUpperCase())?document.createElementNS(ps,o.toLowerCase()):document.createElement(o),a=t.a;if(a)for(let p of Object.entries(a)){let f=p[0],l=p[1];f.startsWith("#")&&(l=f.substring(1),f="name"),i.setAttribute(ut(f,r),l)}let c=t.c;if(c)for(let p of c)bn(p,i,n,r);Dr(e,i);return}let s=t.d;if(s){let i;switch(t.n??Node.TEXT_NODE){case Node.COMMENT_NODE:i=document.createComment(s);break;case Node.TEXT_NODE:i=document.createTextNode(s);break}if(i)Dr(e,i);else throw new Error("unsupported node type.")}},Ne=(t,e,n)=>{n??=se.getDefault();let r=document.createDocumentFragment();if(!b(t))return bn(t,r,!!e,n),r;for(let o of t)bn(o,r,!!e,n);return r};var Ur=(t,e={selector:"#app"},n)=>{H(e)&&(e={selector:"#app",template:e}),jn(t)&&(t=t.context);let r=e.element?e.element:e.selector?document.querySelector(e.selector):null;if(!r||!Re(r))throw I(0);n||(n=se.getDefault());let o=()=>{for(let a of[...r.childNodes])V(a)},s=a=>{for(let c of a)r.appendChild(c)};if(e.template){let a=document.createRange().createContextualFragment(e.template);o(),s(a.childNodes),e.element=a}else if(e.json){let a=Ne(e.json,e.isSVG,n);o(),s(a.childNodes)}return n.useInterpolation&&Pt(r,n),new Tn(t,r,n).x(),U(r,()=>{be(t)}),xt(t),{context:t,unmount:()=>{V(r)},unbind:()=>{ne(r)}}},Tn=class{Rt;$e;o;h;p;constructor(e,n,r){this.Rt=e,this.$e=n,this.o=r,this.h=new Dt([e],r),this.p=new wt(this.h)}x(){this.p.G(this.$e)}};var ze=t=>{if(b(t))return t.map(o=>ze(o));let e={};if(t.tagName)e.t=t.tagName;else return t.nodeType===Node.COMMENT_NODE&&(e.n=Node.COMMENT_NODE),t.textContent&&(e.d=t.textContent),e;let n=t.getAttributeNames();n.length>0&&(e.a=Object.fromEntries(n.map(o=>[o,t.getAttribute(o)])));let r=ce(t);return r.length>0&&(e.c=[...r].map(o=>ze(o))),e};var _r=(t,e={})=>{b(e)&&(e={props:e}),H(t)&&(t={template:t});let n=e.context??(()=>({})),r=!1;if(t.element){let s=t.element;s.remove(),t.element=s}else if(t.selector){let s=document.querySelector(t.selector);if(!s)throw I(1,t.selector);s.remove(),t.element=s}else if(t.template){let s=document.createRange().createContextualFragment(t.template);t.element=s}else t.json&&(t.element=Ne(t.json,t.isSVG,e.config),r=!0);t.element||(t.element=document.createDocumentFragment()),(e.useInterpolation??!0)&&Pt(t.element);let o=t.element;if(!r&&((t.isSVG??(Ye(o)&&o.hasAttribute?.("isSVG")))||Ye(o)&&o.querySelector("[isSVG]"))){let s=t.element.content,i=s?[...s.childNodes]:[...o.childNodes],a=ze(i);t.element=Ne(a,!0,e.config)}return{context:n,template:t.element,inheritAttrs:e.inheritAttrs??!0,props:e.props,defaultName:e.defaultName}};var Hr=t=>{let e,n={},r=(...o)=>{if(o.length<=2&&0 in o)throw I(4);return e&&!n.isStopped?e(...o):(e=fs(t,n),e(...o))};return r[W]=1,ge(r,!0),r.stop=()=>n.ref?.stop?.(),K(()=>r.stop(),!0),r},fs=(t,e)=>{let n=e.ref??z(null);e.ref=n,e.isStopped=!1;let r=0,o=we(()=>{if(r>0){o(),e.isStopped=!0,q(n);return}n(t()),++r});return n.stop=o,n};var Br=(t,e)=>{let n={},r,o=(...s)=>{if(s.length<=2&&0 in s)throw I(4);return r&&!n.isStopped?r(...s):(r=ls(t,e,n),r(...s))};return o[W]=1,ge(o,!0),o.stop=()=>n.ref?.stop?.(),K(()=>o.stop(),!0),o},ls=(t,e,n)=>{let r=n.ref??z(null);n.ref=r,n.isStopped=!1;let o=0,s=a=>{if(o>0){r.stop(),n.isStopped=!0,q(r);return}r(e(...t.map(c=>c()))),++o},i=[];for(let a of t){let c=R(a,s);i.push(c)}return s(null),r.stop=()=>{i.forEach(a=>{a()})},r};var Pr=(t,e)=>{let n={},r,o=(...s)=>{if(s.length<=2&&0 in s)throw I(4);return r&&!n.isStopped?r(...s):(r=us(t,e,n),r(...s))};return o[W]=1,ge(o,!0),o.stop=()=>n.ref?.stop?.(),K(()=>o.stop(),!0),o},us=(t,e,n)=>{let r=n.ref??z(null);n.ref=r,n.isStopped=!1;let o=0;return r.stop=R(t,s=>{if(o>0){r.stop(),n.isStopped=!0,q(r);return}r(e(s)),++o},!0),r};var Vr=t=>(t[ct]=1,t);var jr=(t,e)=>{if(!e)throw I(5);let r=Ae(t)?Ee:a=>a,o=()=>localStorage.setItem(e,JSON.stringify(J(t()))),s=localStorage.getItem(e);if(s!=null)try{t(r(JSON.parse(s)))}catch(a){k(6,`persist: failed to parse data for key ${e}`,a),o()}else o();let i=we(o);return K(i,!0),t};var En=(t,...e)=>{let n="",r=t,o=e,s=r.length,i=o.length;for(let a=0;a<s;++a)n+=r[a],a<i&&(n+=o[a]);return n},$r=En;var Fr=(t,e,n)=>{let r=[],o=()=>{e(t.map(i=>i()))};for(let i of t)r.push(R(i,o));n&&o();let s=()=>{for(let i of r)i()};return K(s,!0),s};var qr=t=>{if(!m(t))throw I(3,"observerCount");return t(void 0,void 0,2)};var zr=t=>{vn();try{t()}finally{xn()}},vn=()=>{oe.stack||(oe.stack=[]),oe.stack.push(new Set)},xn=()=>{let t=oe.stack;if(!t||t.length===0)return;let e=t.pop();if(t.length){let n=t[t.length-1];for(let r of e)n.add(r);return}delete oe.stack;for(let n of e)try{q(n)}catch(r){console.error(r)}};var Kr=t=>{Ce()?.onMounted.push(t)};
@@ -1431,11 +1431,12 @@ var ComponentBinder = class {
1431
1431
  const registeredComponents = binder.__config.__components;
1432
1432
  const registeredComponentsUpperCase = binder.__config.__componentsUpperCase;
1433
1433
  const contextComponents = parser.__getComponents();
1434
+ const contextComponentSelectors = parser.__getComponentSelectors();
1434
1435
  const selector = [
1435
1436
  ...registeredComponents.keys(),
1436
- ...Object.keys(contextComponents),
1437
+ ...contextComponentSelectors,
1437
1438
  ...[...registeredComponents.keys()].map(hyphenate),
1438
- ...[...Object.keys(contextComponents)].map(hyphenate)
1439
+ ...contextComponentSelectors.map(hyphenate)
1439
1440
  ].join(",");
1440
1441
  if (isNullOrWhitespace(selector)) return;
1441
1442
  const list = element.querySelectorAll(selector);
@@ -3421,6 +3422,19 @@ var Parser = class {
3421
3422
  }, {});
3422
3423
  return obj;
3423
3424
  }
3425
+ __getComponentSelectors() {
3426
+ const selectors = [];
3427
+ const seen = /* @__PURE__ */ new Set();
3428
+ const componentsList = this.__contexts.map((x) => x.components).filter((x) => !!x).reverse();
3429
+ for (const components of componentsList) {
3430
+ for (const key of Object.keys(components)) {
3431
+ if (seen.has(key)) continue;
3432
+ seen.add(key);
3433
+ selectors.push(key);
3434
+ }
3435
+ }
3436
+ return selectors;
3437
+ }
3424
3438
  __parse(expression, isLazy, isLazyKey, collectRefObj, once) {
3425
3439
  const value = sref([]);
3426
3440
  const stopObserverList = [];
@@ -4790,9 +4804,10 @@ var toJsonTemplate = (node) => {
4790
4804
  };
4791
4805
 
4792
4806
  // src/app/createComponent.ts
4793
- var createComponent = (template, context = () => ({}), options = {}) => {
4807
+ var createComponent = (template, options = {}) => {
4794
4808
  if (isArray(options)) options = { props: options };
4795
4809
  if (isString(template)) template = { template };
4810
+ const context = options.context ?? (() => ({}));
4796
4811
  let svgHandled = false;
4797
4812
  if (template.element) {
4798
4813
  const element2 = template.element;