jq79 0.7.14 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jq79.js CHANGED
@@ -1,19 +1,21 @@
1
- var dr=Object.defineProperty;var ur=(e,t,n)=>t in e?dr(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var k=(e,t,n)=>ur(e,typeof t!="symbol"?t+"":t,n);function ke(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function gt(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var mt=(e,t={})=>{let n=document.createElement(e);for(let[s,r]of Object.entries(t))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let i of r)n.appendChild(i);else n.setAttribute(s,r);return n},fr=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),hn={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},pr=new Set(["http:","https:","mailto:"]);function hr(e){try{let t=new URL(e,"https://example.com");return pr.has(t.protocol)}catch{return!1}}var gr={"https:":"443","http:":"80"};function mr(e){let t=e.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!t)return null;let[,n,s]=t,r=n.split(".");return r.some(o=>o!=="*"&&!/^[a-z\d-]+$/.test(o))?null:{host:new RegExp(`^${r.map(o=>o==="*"?"[^.]+":o).join("\\.")}$`),port:!s||s==="*"?null:s}}var mn=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(mr).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||gr[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function yr(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var gn=512;function yn(e,t,n,s){if(n>gn)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${gn} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=Er(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Er(e,t,n){let s=e.tagName.toLowerCase();if(!fr.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),l=hn[s]?.has(o),a=hn["*"]?.has(o);!l&&!a||(o==="href"||o==="src")&&(!hr(i.value)||n&&!yr(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),yn(e,r,t+1,n),r}function yt(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return yn(n.content,s,0,t?.allowUrl),s.innerHTML}var wr=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),qe=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},vn=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&qe(r)?vn(r,i,n):n(i,r)})},Sr=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},br=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},Tr=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},$r=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},xe=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Oe=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},En=" keys",Et=e=>e?`${e}.${En}`:En,wn=".length",Sn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),Rr=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,St=Symbol("jq79.raw"),Q=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[St];)t=t[St];return t},Pn=Symbol("jq79.store"),Ee=e=>e!==null&&typeof e=="object"&&e[Pn]===!0,bt=null,pe=[],Y=null,Ne=e=>{pe.push(new Set);let t=Y;Y=null;try{return e()}finally{pe.pop(),Y=t}},xr=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},bn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},Nr=0,he=0,ae=null,He=!1,Tn=(e,t)=>{let n=ae??(ae=new Map);for(let s of e)He&&s===Y?s.run():n.has(s)||n.set(s,t)},Cn=()=>{for(let e=0;ae?.size;e++){if(e===100){console.error(`jq79: ${He?"a write":"a $batch"} kept waking effects for 100 rounds (an effect writes what it reads); giving up on it settling`),ae.clear();return}let t=ae;ae=new Map,Array.from(t.keys()).sort((s,r)=>s.order-r.order).forEach(s=>{t.get(s).has(s)&&s.run()})}},We=e=>{he++===0&&(ae=null);try{return e()}finally{if(he===1)try{Cn()}finally{he=0,ae=null}else he--}},$n=()=>{he=1,He=!0},Rn=()=>{try{ae&&Cn()}finally{he=0,ae=null,He=!1}},wt=new Set,xn="$__attach",Nn="$__holds",Be=Symbol("jq79.alsoWakenBy"),$t=Symbol("jq79.owner"),ve=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=Sn(null,""),l=(f,d)=>{let m=o;return f.split(".").forEach(h=>{let b=m.children??(m.children=new Map),g=b.get(h);g||(g=Sn(m,h),b.set(h,g)),m=g}),d.deep?br(m,d):Sr(m,d),m},a=(f,d)=>{d.deep?$r(f,d):Tr(f,d);let m=f;for(;m?.parent&&Rr(m);)m.parent.children.delete(m.segment),m=m.parent},c=f=>{let d=o;for(let m of f.split("."))if(d=d.children?.get(m),!d)return;return d},u=f=>{let d=new Set,m=E=>{let $=E.children?[...E.children.values()]:[];for(;$.length;){let x=$.pop();xe(x,P=>d.add(P)),Oe(x,P=>d.add(P)),x.children?.forEach(P=>$.push(P))}},h=o,b=f.split("."),g="";for(let E=0;E<b.length-1;E++){if(h=h.children?.get(b[E]),!h)return d;g=g?`${g}.${b[E]}`:b[E],Oe(h,x=>d.add(x));let $=T.get(g);$&&xe(h,x=>{$.store[Nn](x)||d.add(x)}),E===b.length-2&&b[E+1]==="length"&&(xe(h,x=>d.add(x)),m(h))}return h=h.children?.get(b[b.length-1]),h&&(xe(h,E=>d.add(E)),Oe(h,E=>d.add(E)),m(h)),d},p=(f,d,m)=>{if(d===m)return!1;for(let h=d;h<m;h++){let b=f.charCodeAt(h);if(b<48||b>57)return!1}return!0},S=(f,d)=>{if(f.deep||d.size<2)return d;let m=new Set;d.forEach(g=>{g.endsWith(wn)&&m.add(g.slice(0,-wn.length))});let h=new Set;if(d.forEach(g=>{let E=0,$="";for(let x=g.indexOf(".");x!==-1;x=g.indexOf(".",x+1)){let P=g.slice(0,x);(!(E>0&&p(g,E,x))||m.has($))&&h.add(P),$=P,E=x+1}}),!h.size)return d;let b=new Set;return d.forEach(g=>{h.has(g)||b.add(g)}),b},M=f=>{let d=null,m=null,h=null,b=wt,g=C=>h?h.has(C):d===C,E=C=>{let Z=l(C,f);h?h.set(C,Z):d===null?(d=C,m=Z):(h=new Map([[d,m],[C,Z]]),d=m=null)},$=C=>{if(h){h.forEach((Z,U)=>{C.has(U)||(a(Z,f),h.delete(U))});return}d!==null&&!C.has(d)&&(a(m,f),d=m=null)},x=()=>{h?h.forEach(C=>a(C,f)):m&&a(m,f),h=null,d=m=null},P=C=>{if(C.size===b.size){let U=!0;if(C.forEach(ye=>{U&&(U=b.has(ye))}),U)return}b=C;let Z=S(f,C);$(Z),Z.forEach(U=>{g(U)||E(U)})};return f.reindex.add(P),P(f.deps),()=>{f.reindex.delete(P),x(),b=wt}},H=f=>{let d=c(f);if(d){let m=new Set;xe(d,h=>m.add(h)),Oe(d,h=>m.add(h)),D(m)}},I=f=>H(Et(f)),D=f=>{if(he)return Tn(f,s);let d=Array.from(f),m=!0;for(let h=1;m&&h<d.length;h++)m=d[h-1].order<d[h].order;m||d.sort((h,b)=>h.order-b.order),$n();try{for(let h of d)s.has(h)&&h.run()}finally{Rn()}},R=(f,d,m=!1)=>{if(t.get(f)?.forEach(h=>h(d,f)),n.forEach(h=>h(f,d)),m)if(he)Tn(s,s);else{$n();try{s.forEach(h=>h.run())}finally{Rn()}}else D(u(f))},j=(f,d)=>f!==d&&f!==null&&d!==null&&typeof f=="object"&&typeof d=="object"&&!Ee(f)&&!Ee(d)&&qe(f)&&qe(d)&&Array.isArray(f)===Array.isArray(d),O=null,W=-1,z=(f,d)=>{let m=d.length>f.length,h=m?f:d,b=m?d:f,g=0;for(;g<h.length&&Object.is(Q(h[g]),Q(b[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(Q(h[E]),Q(b[E+1])))return W;return g},G=(f,d)=>{if(Array.isArray(d)){let $=f.length,x=d.length,P=$!==x;if(!$||!x)return O;let C=Math.max($,x);if(Math.abs($-x)===1){let U=z(f,d);if(U!==W){let ye=[];for(let ht=U;ht<C;ht++)ye.push(String(ht));return{keys:ye,exact:!0,keysChanged:P}}}let Z=[];for(let U=0;U<C;U++)if(!Object.is(Q(f[U]),Q(d[U]))&&(Z.push(String(U)),Z.length*2>=C))return O;return{keys:Z,exact:!1,keysChanged:P}}let m=Object.keys(f),h=Object.keys(d),b=new Set([...m,...h]);if(!b.size)return O;let g=[];b.forEach($=>{Object.is(Q(f[$]),Q(d[$]))||g.push($)});let E=m.length!==h.length||m.some(($,x)=>$!==h[x]);return g.length*2>=b.size?O:{keys:g,exact:!1,keysChanged:E}},X=(f,d,m,h)=>{let b=new Set,g=$=>{let x=c($);x&&(xe(x,P=>b.add(P)),Oe(x,P=>b.add(P)))},E=G(d,m);if(!E)return R(f,h);if(t.get(f)?.forEach($=>$(h,f)),n.forEach($=>$(f,h)),g(f),E.keys.forEach($=>{let x=`${f}.${$}`,P=t.get(x);if(P){let C=Q(m[$]),Z=y(C)?B(C,x):C;P.forEach(U=>U(Z,x))}E.exact?g(x):u(x).forEach(C=>b.add(C))}),E.keysChanged&&g(Et(f)),Array.isArray(m)&&d.length!==m.length){let $=`${f}.length`;t.get($)?.forEach(x=>x(m.length,$)),g($)}D(b)},y=f=>f!==null&&typeof f=="object"&&qe(f),T=new Map,N=(f,d)=>{let m=T.get(d);m?.store!==f&&(m?.unsubscribe(),T.set(d,{store:f,unsubscribe:f.$onAny((h,b)=>R(`${d}.${h}`,b))}))},q=f=>{T.get(f)?.unsubscribe(),T.delete(f)},B=(f,d)=>{let m=r.get(f);if(m)return m;let h=null,b=new Proxy(f,{has(g,E){return Reflect.has(g,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(g){return pe[pe.length-1]?.add(Et(d)),Y!==null&&Y.home!==s&&V(Y),Reflect.ownKeys(g)},get(g,E,$){if(E===St)return g;if(E===Pn)return d==="";if(typeof E!="string")return Reflect.get(g,E,$);if(d===""&&E in i)return i[E];let x=d?`${d}.${E}`:E;pe[pe.length-1]?.add(x),Y!==null&&Y.home!==s&&V(Y);let P=Reflect.get(g,E,$);if(Ee(P))return N(P,x),P;let C=Q(P);return y(C)?B(C,x):C},set(g,E,$,x){if(x!==b&&!Object.prototype.hasOwnProperty.call(g,E))return Reflect.set(g,E,$,x);let P=d?`${d}.${E}`:E,C=Ee($)?$:Q($),Z=!Object.prototype.hasOwnProperty.call(g,E);if(!Z&&Object.is(g[E],C)&&(C===null||typeof C!="object"))return!0;let U=g[E];g[E]=C,h?.delete(E),Ee(C)?N(C,P):q(P);let ye=Ee(C)||!y(C)?C:B(C,P);return!Z&&j(U,C)?X(P,U,C,ye):R(P,ye,Z),!0},deleteProperty(g,E){if(typeof E!="string")return Reflect.deleteProperty(g,E);let $=Object.prototype.hasOwnProperty.call(g,E),x=Reflect.deleteProperty(g,E);if(x&&$){let P=d?`${d}.${E}`:E;(h??(h=new Set)).add(E),q(P),R(P,void 0),I(d)}return x}});return r.set(f,b),b},K=B(Q(e),"");Object.entries(Q(e)).forEach(([f,d])=>{Ee(d)&&N(d,f)});let w=(f,d,{immediate:m=!1}={})=>(t.has(f)||t.set(f,new Set),t.get(f).add(d),m&&d(wr(K,f),f),()=>t.get(f)?.delete(d)),A=(f,{immediate:d=!1}={})=>(n.add(f),d&&vn(K,"",(m,h)=>f(m,h)),()=>n.delete(f)),v=(f,{deep:d=!1,alsoWakenBy:m}={})=>{let h=!1,b=!1,g={deps:wt,reindex:new Set,deep:d,order:Nr++,home:s,adopted:null,read:null,run:()=>{if(h){b=!0;return}h=!0;try{let x=0;do{b=!1,g.read=null;let P=new Set;pe.push(P);let C=Y;Y=g;try{f()}finally{pe.pop(),Y=C,g.deps=P}}while(b&&++x<100);b&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{h=!1,g.adopted&&xr(g),g.reindex.forEach(x=>x(g.deps))}}};s.add(g);let E=M(g),$=()=>{s.delete(g),E(),bn(g)};return m?.length?_(g,m,$):(g.run(),bt=g,$)},_=(f,d,m)=>{let h=d.map(b=>b?.[xn]?.(f)).filter(Boolean);return f.run(),bt=f,()=>{m(),h.forEach(b=>b())}},F=f=>{s.add(f);let d=M(f);return()=>{s.delete(f),d()}},V=f=>{(f.read??(f.read=new Set)).add(s),!(f.adopted?.has(s)||s.has(f))&&(f.adopted??(f.adopted=new Map)).set(s,F(f))},te=()=>{T.forEach(({unsubscribe:f})=>f()),T.clear(),s.forEach(f=>{f.home===s&&bn(f)})};return i.$on=w,i.$onAny=A,i.$effect=v,i.$dispose=te,i[xn]=F,i[Nn]=f=>s.has(f),K},Tt=class{constructor(t,n){k(this,"scope",t);k(this,"disposers",null);k(this,"runs",null);k(this,"children",null);k(this,"owners",null);k(this,"options");let s=t[Be];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[$t];!n||this.owners?.includes(n)||((this.owners??(this.owners=[])).push(n),(n.children??(n.children=new Set)).add(this))}effect(t){(this.disposers??(this.disposers=[])).push(this.scope.$effect(t,this.options)),(this.runs??(this.runs=[])).push(bt)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t.run())}rerun(){let t=this.runs?[...this.runs]:null,n=this.children?[...this.children]:null;t?.forEach(s=>{this.runs&&s.run()}),n?.forEach(s=>s.rerun())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,this.children=null,this.owners?.forEach(n=>n.children?.delete(this)),this.owners=null,t)for(let n=0;n<t.length;n++)t[n]()}},we=(e,t=!1)=>new Tt(e,t),Rt=e=>{let t=ve({value:void 0});t.$effect(()=>{let s;try{s=e()}catch(r){console.error("jq79: error in $computed, keeping its last value",r);return}t.value=s});let n=(s,r)=>(console.warn(`jq79: a $computed is read-only - the write to ${String(r)} was ignored`),!0);return new Proxy(t,{set:n,deleteProperty:n,defineProperty:n})};var Fe=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,Mn=/\$:\s*/y,Ue=/import(?=\s*\()/y,An=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,re=(e,t)=>{let n=e[t],s=t+1;for(;s<e.length;){if(e[s]==="\\"){s+=2;continue}if(e[s]===n)return s+1;s++}return e.length},ne=(e,t)=>{let n=e.indexOf(`
2
- `,t);return n===-1?e.length:n},se=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},ce=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=ne(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=se(e,n);continue}break}return n},vr=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),oe=(e,t)=>{let n=t-1;for(;n>=0;){let r=e[n];if(/\s/.test(r)){n--;continue}if(r==="/"&&e[n-1]==="*"){let i=e.lastIndexOf("/*",n-2);if(i===-1)return!0;n=i-1;continue}break}if(n<0)return!0;let s=e[n];if(/[\w$]/.test(s)){let r=n;for(;r>0&&/[\w$]/.test(e[r-1]);)r--;return vr.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},ie=(e,t)=>{let n=t+1,s=!1;for(;n<e.length;){let r=e[n];if(r==="\\"){n+=2;continue}if(r===`
3
- `)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<e.length&&/[a-z]/i.test(e[n]);)n++;return n}n++}return e.length},Pr=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Cr=(e,t)=>{let n=t-1;for(;n>=0;){let s=e[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&e[n-1]==="*"){let r=e.lastIndexOf("/*",n-2);if(r===-1)return"";n=r-1;continue}return s}return""},vt=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ne(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=se(e,s);continue}if(r==="/"&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
4
- `){let i=ce(e,s+1);if(!(i<e.length&&(Pr.test(e.slice(i,i+2))||[",","="].includes(Cr(e,s)))))return s;s=i;continue}}s++}return e.length},kn=e=>{let t=[],n=0,s=0,r=0,i=l=>{t.push({raw:e.slice(s,l),codeEnd:Math.max(0,r-s)}),s=l+1,r=s},o=0;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=re(e,o),r=o;continue}if(l==="/"&&e[o+1]==="/"){o=ne(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=se(e,o);continue}if(l==="/"&&oe(e,o)){o=ie(e,o),r=o;continue}if("([{".includes(l))n++;else if(")]}".includes(l))n--;else if(l===","&&n<=0){i(o),o++;continue}/\s/.test(l)||(r=o+1),o++}return i(e.length),t},ze=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Ve.test(t)?[t]:[];let n=[];for(let s of Ct(t.slice(1,On(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=Qe(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=Pt(s,":");if(i!==-1){n.push(...ze(s.slice(i+1)));continue}}n.push(...ze(s))}return n},Mr=e=>{let t=[],n=kn(e).map(({raw:i,codeEnd:o})=>{let l=i.match(/^\s*/)[0];if(o<=l.length)return{text:i,empty:!0};let a=i.slice(l.length,o),c=i.slice(o),u=Qe(a),p=(u===-1?a:a.slice(0,u)).trim(),S=a[0]==="{"||a[0]==="[";S?t.push(...ze(p)):Ve.test(p)&&t.push(p);let M=Ze(a).code;return{text:`${l}${S?`(${M})`:M}${c}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(i=>i.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},Ze=e=>{let t=[],n="",s=0,r=0,i=!0;for(;s<e.length;){let o=e[s],l=e[s+1];if(o==="'"||o==='"'||o==="`"){let a=re(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="/"&&(l==="/"||l==="*")){let a=l==="/"?ne(e,s):se(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&oe(e,s)){let a=ie(e,s);n+=e.slice(s,a),s=a,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(Ue.lastIndex=s,Ue.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){Fe.lastIndex=s;let a=Fe.exec(e);if(a){let u=s+a[0].length,p=vt(e,u),{vars:S,code:M}=Mr(e.slice(u,p));t.push(...S),n+=M,s=p,i=!1;continue}Mn.lastIndex=s;let c=Mn.exec(e);if(c){An.lastIndex=s;let u=An.exec(e);u&&t.push(u[1]);let p=s+c[0].length,S=vt(e,p);n+=`$__effect(() => { ${Ze(e.slice(p,S)).code} });`,s=S;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
5
- `||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},Ke=/export\s+default(?![\w$])/y,Ge=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,Ar=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let i=e[r];if(i==="{")n++;else if(i==="}")n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},kr=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=Ar(e),i=[],o=s;if(r.length>1){let l=`$__mod${n}`;i.push(`${l} = ${s}`),o=l}for(let l of r)l.startsWith("{")?i.push(`${l.replace(/\s+as\s+/g,": ")} = ${o}`):l.startsWith("*")?i.push(`${l.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${l} = $__default(${o})`);return`const ${i.join(", ")}`},Ve=/^[A-Za-z_$][\w$]*$/,On=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=re(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=ne(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=se(e,n);continue}if(s==="/"&&oe(e,n)){n=ie(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},Pt=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=ne(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=se(e,s);continue}if(r==="/"&&r!==t&&oe(e,s)){s=ie(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},Ct=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let i=e[r];if(i==="'"||i==='"'||i==="`"){r=re(e,r);continue}if(i==="/"&&e[r+1]==="/"){r=ne(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=se(e,r);continue}if(i==="/"&&oe(e,r)){r=ie(e,r);continue}if(i!==void 0&&"([{".includes(i))n++;else if(i!==void 0&&")]}".includes(i))n--;else if(r===e.length||i===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},Qe=e=>{let t=0;for(;t<e.length;){let n=Pt(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},_e=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=On(t);if(n>=t.length)return null;let s=[];for(let r of Ct(t.slice(1,n))){if(r.startsWith("..."))continue;let i=Qe(r),o=i===-1?r:r.slice(0,i),l=i===-1?void 0:r.slice(i+1).trim(),a=Pt(o,":"),c=(a===-1?o:o.slice(0,a)).trim();if(!Ve.test(c))continue;let u={name:c};l!==void 0&&(u.default=l);let p=a===-1?"":o.slice(a+1).trim();Ve.test(p)&&(u.as=p),s.push(u)}return s},Or=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=re(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=ne(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=se(e,t);continue}if(r==="/"&&oe(e,t)){t=ie(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){Ke.lastIndex=t;let i=Ke.exec(e);if(i)return t+i[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
6
- `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},_r=/^async(?![\w$])/,jr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Lr=e=>{let t=Or(e);if(t===-1)return null;let n=ce(e,t),s=e.slice(n);_r.test(s)&&(n=ce(e,n+5));let r=jr.exec(e.slice(n));if(r&&(n=ce(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let l=e[o];if(l==="'"||l==='"'||l==="`"){o=re(e,o);continue}if(l==="/"&&e[o+1]==="/"){o=ne(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=se(e,o);continue}if(l==="/"&&oe(e,o)){o=ie(e,o);continue}if("([{".includes(l))i++;else if(")]}".includes(l)&&--i===0)break;o++}return Ct(e.slice(n+1,o))[0]??""},Xe=e=>{let t=Lr(e);if(t===null)return null;let n=_e(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},_n=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let l=e[n],a=e[n+1],c=n===0||!/[\w$.]/.test(e[n-1]);if(l==="'"||l==='"'||l==="`"){let u=re(e,n);t+=e.slice(n,u),n=u,r=!1;continue}if(l==="/"&&(a==="/"||a==="*")){let u=a==="/"?ne(e,n):se(e,n);t+=e.slice(n,u),n=u;continue}if(l==="/"&&oe(e,n)){let u=ie(e,n);t+=e.slice(n,u),n=u,r=!1;continue}if(l==="i"&&c){if(Ue.lastIndex=n,Ue.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){Ge.lastIndex=n;let u=Ge.exec(e);if(u){t+=kr(u[1],u[3],o++),n+=u[0].length,r=!1;continue}}}if(l==="e"&&c&&s===0&&r){Ke.lastIndex=n;let u=Ke.exec(e);if(u){i=!0,t+="$__exports.default =",n+=u[0].length,r=!1;continue}}"([{".includes(l)?s++:")]}".includes(l)&&(s=Math.max(0,s-1)),l===`
7
- `||l===";"||l==="}"?r=!0:/\s/.test(l)||(r=!1),t+=l,n++}return i?t:null},Dr=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),Ir=new Set(["function","class","let","const","var","eval","with"]),qr=new Set(["$scope","$r","$t"]),Hr=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,Wr=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Br=e=>/[A-Za-z_$]/.test(e),Fr=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,Mt=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let l=e[o];if(/\s/.test(l)){o++;continue}if(l==="/"&&e[o+1]==="/"){o=ne(e,o);continue}if(l==="/"&&e[o+1]==="*"){o=se(e,o);continue}if(l==="/"&&oe(e,o)){o=ie(e,o),i="value";continue}if(l==='"'||l==="'"){o=re(e,o),i="value";continue}if(l==="`"){let u=o+1;for(;u<e.length;){if(e[u]==="\\"){u+=2;continue}if(e[u]==="`"){u++;break}if(e[u]==="$"&&e[u+1]==="{"){let p=1,S=u+=2;for(;u<e.length&&p>0;)e[u]==="{"?p++:e[u]==="}"&&p--,u++;let M=Mt(e.slice(S,u-1));if(M===null)return null;M.forEach(H=>t.add(H));continue}u++}o=u,i="value";continue}if(/\d/.test(l)&&i!=="."&&i!=="?."){let u=Fr.exec(e.slice(o));o+=u?u[0].length:1,i="value";continue}if(Br(l)){let u=o;for(;u<e.length&&/[\w$]/.test(e[u]);)u++;let p=e.slice(o,u);if(o=u,Ir.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(Dr.has(p)){i=p==="this"?"value":"op";continue}if(qr.has(p))return null;let S=o;for(;S<e.length&&/\s/.test(e[S]);)S++;if(e[S]==="(")return null;e[S]===":"&&e[S+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let a=e.slice(o);if(Hr.test(a))return null;let c=Wr.exec(a);if(c){(c[0]==="&&"||c[0]==="||"||c[0]==="??")&&(r=!0),i=c[0]==="?."?"?.":"op",o+=c[0].length;continue}if(l==="=")return null;l==="("||l==="["||l==="{"?(s.push(l),n.push(0)):l===")"||l==="]"||l==="}"?(s.pop(),n.length>1&&n.pop()):l==="?"?(n[n.length-1]++,r=!0):l===":"&&n[n.length-1]>0&&n[n.length-1]--,i=l,o++}return r&&t.size>1?null:[...t]},xt=/(?:await\s+)?(?:import\s*\(|(\$importAll)\s*\(\s*\[|(C79|Component79)\s*\.\s*(fetch|fetchAll|importAll)\s*\(\s*(\[)?)/y,Nt=/(["'])([^"'\n\\]+)\1/y,Ur=/^(?:(?:if|for|while|with)\b[\s\S]*\)|[\s\S]*\b(?:else|do))$/,zr=(e,t)=>{xt.lastIndex=0;let n=xt.exec(e);if(!n)return[];let[,s,r,i,o]=n;if(t.has(s??r??""))return[];let l=s!==void 0||o!==void 0;if(i!==void 0&&i==="fetch"===l)return[];let a=r===void 0?"component":i==="importAll"?"page":"fetch",c=[],u=ce(e,xt.lastIndex);for(;;){Nt.lastIndex=u;let p=Nt.exec(e);if(!p)return c;let S=ce(e,Nt.lastIndex),M=e[S];if(!l)return M===")"||M===","?[{spec:p[2],kind:a}]:[];if(M!==","&&M!=="]"||(c.push({spec:p[2],kind:a}),M==="]"))return c;u=ce(e,S+1)}},jn=e=>{let t=[];for(let o=ce(e,0);o<e.length;o=ce(e,o+1)){let l=vt(e,o);t.push(e.slice(o,l).trim().replace(/^export\s+(?!default\b)/,"")),o=l}let n=o=>{Fe.lastIndex=0;let l=Fe.exec(o);return l?kn(o.slice(l[0].length)).map(({raw:a})=>{let c=a.trim(),u=Qe(c);return u===-1?{target:c,init:""}:{target:c.slice(0,u).trim(),init:c.slice(u+1).trim()}}):null},s=new Set;t.forEach(o=>n(o)?.forEach(({target:l})=>ze(l).forEach(a=>s.add(a))));let r=[],i=!1;for(let o of t){if(!i){Ge.lastIndex=0;let l=Ge.exec(o);if(l)/^type\s/.test(l[1]??"")||r.push({spec:l[3],kind:"component"});else{let a=n(o);for(let c of a?a.map(({init:u})=>u):[o])r.push(...zr(c,s))}}i=Ur.test(o)}return r};var le=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Ye=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Kr=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Gr=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,kt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Vr=e=>e.split(kt).map((t,n)=>n%2===1?t:t.replace(Gr,(s,r,i)=>Kr.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),Dn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,Zr=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,Qr=e=>e.split(kt).map((t,n)=>n%2===1?t:t.replace(Dn,(s,r,i)=>{let o=0,l=i.replace(Zr,(a,c,u)=>u===void 0?a:`${c}:props.${o++}="${u}"`);return`<${r}${l}>`})).join(""),Xr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,Yr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Jr=/^slot\./i,eo=e=>Jr.test(e)?`slot.${Ye(e.slice(5))}`:e,je=":jq79-component",In=/^[A-Z]/,to="c79-",Le=e=>`${to}${Ye(e[0].toLowerCase()+e.slice(1))}`,no=e=>In.test(e)?Le(e):eo(e),so=/<\/([A-Z][\w.-]*)(\s*)>/g,ro=/\/\s*$/,oo=(e,t)=>{if(!In.test(e))return t;let n=` ${je}="${e}"`,s=ro.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},io=e=>e.split(kt).map((t,n)=>n%2===1?t:t.replace(Dn,(s,r,i)=>{let o=i.replace(Xr,(l,a,c)=>c===void 0?l:`${a}${Ye(c)}`);return`<${no(r)}${oo(r,o)}>`}).replace(Yr,(s,r,i)=>`</slot.${Ye(r)}${i}>`).replace(so,(s,r,i)=>`</${Le(r)}${i}>`)).join(""),qn=e=>Vr(Qr(io(e))),Hn=/^[A-Z][A-Za-z0-9]*$/,At=/{{\s*([\s\S]+?)\s*}}/g,Ln=new Map,Ot=e=>{let t=Ln.get(e);if(t)return t;let n=[],s=0;At.lastIndex=0;for(let r=At.exec(e);r;r=At.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),Ln.set(e,n),n},_t=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":window",":with",":text",":html",":html.allowed",":props"]),Se=e=>_t.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Wn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Je=e=>e==="slot"||e.startsWith("slot."),jt=e=>e?le(e):"default",Lt=e=>`${e}
8
- = $value`,Dt=["$scope","$r"],Bn=e=>`with ($scope) { return (${e}
9
- ); }`,Fn=(e,t)=>{let n=Mt(e);if(n===null)return null;let s=n.filter(i=>!t.includes(i));return`${s.length===0?"":`let $t; ${s.map(i=>`const ${i} = ($t = $scope.${i}) !== undefined ? $t : $r($scope, ${JSON.stringify(i)});`).join(" ")}`} return (${e}
10
- );`},et=(e,t)=>`${e.join(",")}
11
- ${t}`,It=e=>`await $mounted();${e}`,Un=e=>["$scope","$__effect","$__import","$__state",...e],zn=e=>`return (async () => { with ($scope) { ${e} }
12
- ;$__state.done = true })()`,Kn=e=>["$__exports","$__default","$__import",...e],Gn=e=>`return (async () => { "use strict";
1
+ var $r=Object.defineProperty;var Tr=(e,t,n)=>t in e?$r(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var A=(e,t,n)=>Tr(e,typeof t!="symbol"?t+"":t,n);function Oe(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function Tt(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var Rt=(e,t={})=>{let n=document.createElement(e);for(let[s,r]of Object.entries(t))if(s==="className")n.className=Array.isArray(r)?r.join(" "):r;else if(s==="textContent")n.textContent=r;else if(s==="children")for(let l of r)n.appendChild(l);else n.setAttribute(s,r);return n},Rr=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Nn={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},xr=new Set(["http:","https:","mailto:"]);function Nr(e){try{let t=new URL(e,"https://example.com");return xr.has(t.protocol)}catch{return!1}}var vr={"https:":"443","http:":"80"};function Pr(e){let t=e.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!t)return null;let[,n,s]=t,r=n.split(".");return r.some(o=>o!=="*"&&!/^[a-z\d-]+$/.test(o))?null:{host:new RegExp(`^${r.map(o=>o==="*"?"[^.]+":o).join("\\.")}$`),port:!s||s==="*"?null:s}}var Pn=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(Pr).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||vr[n.protocol]||"";return t.some(l=>l.host.test(s)&&(l.port===null||l.port===r))}};function kr(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var vn=512;function kn(e,t,n,s){if(n>vn)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${vn} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let l=Cr(r,n,s);l&&t.appendChild(l)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Cr(e,t,n){let s=e.tagName.toLowerCase();if(!Rr.has(s))return null;let r=document.createElement(s);for(let l of Array.from(e.attributes)){let o=l.name.toLowerCase(),i=Nn[s]?.has(o),a=Nn["*"]?.has(o);!i&&!a||(o==="href"||o==="src")&&(!Nr(l.value)||n&&!kr(n,l.value,s,o))||r.setAttribute(o,l.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),kn(e,r,t+1,n),r}function Be(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return kn(n.content,s,0,t?.allowUrl),s.innerHTML}var Mr=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),Ke=new WeakSet,Ct=e=>{let t=Q(e);return t!==null&&typeof t=="object"&&!de(t)&&Ke.add(t),t},Ue=e=>{if(Ke.has(e))return!1;if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},Hn=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let l=t?`${t}.${s}`:s;r&&typeof r=="object"&&Ue(r)?Hn(r,l,n):n(l,r)})},Ar=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},Or=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},_r=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},jr=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},Re=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},_e=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},Cn=" keys",xt=e=>e?`${e}.${Cn}`:Cn,Mn=".length",An=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),Lr=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,vt=Symbol("jq79.raw"),Q=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[vt];)t=t[vt];return t},qn=Symbol("jq79.store"),de=e=>e!==null&&typeof e=="object"&&e[qn]===!0,Pt=null,he=[],Y=null,xe=e=>{he.push(new Set);let t=Y;Y=null;try{return e()}finally{he.pop(),Y=t}},Dr=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},On=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},Ir=0,ge=0,se=null,ze=!1,_n=(e,t)=>{let n=se??(se=new Map);for(let s of e)ze&&s===Y?s.run():n.has(s)||n.set(s,t)},Fn=()=>{for(let e=0;se?.size;e++){if(e===100){console.error(`jq79: ${ze?"a write":"a $batch"} kept waking effects for 100 rounds (an effect writes what it reads); giving up on it settling`),se.clear();return}let t=se;se=new Map,Array.from(t.keys()).sort((s,r)=>s.order-r.order).forEach(s=>{t.get(s).has(s)&&s.run()})}},Ne=e=>{ge++===0&&(se=null);try{return e()}finally{if(ge===1)try{Fn()}finally{ge=0,se=null}else ge--}},Mt=()=>Promise.resolve(),jn=()=>{ge=1,ze=!0},Ln=()=>{try{se&&Fn()}finally{ge=0,se=null,ze=!1}},Nt=new Set,Dn="$__attach",In="$__holds",Ge=Symbol("jq79.alsoWakenBy"),At=Symbol("jq79.owner"),ve=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,l=Object.create(null),o=An(null,""),i=(f,u)=>{let m=o;return f.split(".").forEach(h=>{let S=m.children??(m.children=new Map),g=S.get(h);g||(g=An(m,h),S.set(h,g)),m=g}),u.deep?Or(m,u):Ar(m,u),m},a=(f,u)=>{u.deep?jr(f,u):_r(f,u);let m=f;for(;m?.parent&&Lr(m);)m.parent.children.delete(m.segment),m=m.parent},c=f=>{let u=o;for(let m of f.split("."))if(u=u.children?.get(m),!u)return;return u},d=f=>{let u=new Set,m=E=>{let T=E.children?[...E.children.values()]:[];for(;T.length;){let R=T.pop();Re(R,k=>u.add(k)),_e(R,k=>u.add(k)),R.children?.forEach(k=>T.push(k))}},h=o,S=f.split("."),g="";for(let E=0;E<S.length-1;E++){if(h=h.children?.get(S[E]),!h)return u;g=g?`${g}.${S[E]}`:S[E],_e(h,R=>u.add(R));let T=$.get(g);T&&Re(h,R=>{T.store[In](R)||u.add(R)}),E===S.length-2&&S[E+1]==="length"&&(Re(h,R=>u.add(R)),m(h))}return h=h.children?.get(S[S.length-1]),h&&(Re(h,E=>u.add(E)),_e(h,E=>u.add(E)),m(h)),u},p=(f,u,m)=>{if(u===m)return!1;for(let h=u;h<m;h++){let S=f.charCodeAt(h);if(S<48||S>57)return!1}return!0},b=(f,u)=>{if(f.deep||u.size<2)return u;let m=new Set;u.forEach(g=>{g.endsWith(Mn)&&m.add(g.slice(0,-Mn.length))});let h=new Set;if(u.forEach(g=>{let E=0,T="";for(let R=g.indexOf(".");R!==-1;R=g.indexOf(".",R+1)){let k=g.slice(0,R);(!(E>0&&p(g,E,R))||m.has(T))&&h.add(k),T=k,E=R+1}}),!h.size)return u;let S=new Set;return u.forEach(g=>{h.has(g)||S.add(g)}),S},C=f=>{let u=null,m=null,h=null,S=Nt,g=v=>h?h.has(v):u===v,E=v=>{let Z=i(v,f);h?h.set(v,Z):u===null?(u=v,m=Z):(h=new Map([[u,m],[v,Z]]),u=m=null)},T=v=>{if(h){h.forEach((Z,F)=>{v.has(F)||(a(Z,f),h.delete(F))});return}u!==null&&!v.has(u)&&(a(m,f),u=m=null)},R=()=>{h?h.forEach(v=>a(v,f)):m&&a(m,f),h=null,u=m=null},k=v=>{if(v.size===S.size){let F=!0;if(v.forEach(ye=>{F&&(F=S.has(ye))}),F)return}S=v;let Z=b(f,v);T(Z),Z.forEach(F=>{g(F)||E(F)})};return f.reindex.add(k),k(f.deps),()=>{f.reindex.delete(k),R(),S=Nt}},O=f=>{let u=c(f);if(u){let m=new Set;Re(u,h=>m.add(h)),_e(u,h=>m.add(h)),L(m)}},D=f=>O(xt(f)),L=f=>{if(ge)return _n(f,s);let u=Array.from(f),m=!0;for(let h=1;m&&h<u.length;h++)m=u[h-1].order<u[h].order;m||u.sort((h,S)=>h.order-S.order),jn();try{for(let h of u)s.has(h)&&h.run()}finally{Ln()}},x=(f,u,m=!1)=>{if(t.get(f)?.forEach(h=>h(u,f)),n.forEach(h=>h(f,u)),m)if(ge)_n(s,s);else{jn();try{s.forEach(h=>h.run())}finally{Ln()}}else L(d(f))},I=(f,u)=>f!==u&&f!==null&&u!==null&&typeof f=="object"&&typeof u=="object"&&!de(f)&&!de(u)&&Ue(f)&&Ue(u)&&Array.isArray(f)===Array.isArray(u),H=null,K=-1,G=(f,u)=>{let m=u.length>f.length,h=m?f:u,S=m?u:f,g=0;for(;g<h.length&&Object.is(Q(h[g]),Q(S[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(Q(h[E]),Q(S[E+1])))return K;return g},z=(f,u)=>{if(Array.isArray(u)){let T=f.length,R=u.length,k=T!==R;if(!T||!R)return H;let v=Math.max(T,R);if(Math.abs(T-R)===1){let F=G(f,u);if(F!==K){let ye=[];for(let $t=F;$t<v;$t++)ye.push(String($t));return{keys:ye,exact:!0,keysChanged:k}}}let Z=[];for(let F=0;F<v;F++)if(!Object.is(Q(f[F]),Q(u[F]))&&(Z.push(String(F)),Z.length*2>=v))return H;return{keys:Z,exact:!1,keysChanged:k}}let m=Object.keys(f),h=Object.keys(u),S=new Set([...m,...h]);if(!S.size)return H;let g=[];S.forEach(T=>{Object.is(Q(f[T]),Q(u[T]))||g.push(T)});let E=m.length!==h.length||m.some((T,R)=>T!==h[R]);return g.length*2>=S.size?H:{keys:g,exact:!1,keysChanged:E}},J=(f,u,m,h)=>{let S=new Set,g=T=>{let R=c(T);R&&(Re(R,k=>S.add(k)),_e(R,k=>S.add(k)))},E=z(u,m);if(!E)return x(f,h);if(t.get(f)?.forEach(T=>T(h,f)),n.forEach(T=>T(f,h)),g(f),E.keys.forEach(T=>{let R=`${f}.${T}`,k=t.get(R);if(k){let v=Q(m[T]),Z=y(v)?W(v,R):v;k.forEach(F=>F(Z,R))}E.exact?g(R):d(R).forEach(v=>S.add(v))}),E.keysChanged&&g(xt(f)),Array.isArray(m)&&u.length!==m.length){let T=`${f}.length`;t.get(T)?.forEach(R=>R(m.length,T)),g(T)}L(S)},y=f=>f!==null&&typeof f=="object"&&Ue(f),$=new Map,N=(f,u)=>{let m=$.get(u);m?.store!==f&&(m?.unsubscribe(),$.set(u,{store:f,unsubscribe:f.$onAny((h,S)=>x(`${u}.${h}`,S))}))},q=f=>{$.get(f)?.unsubscribe(),$.delete(f)},W=(f,u)=>{let m=r.get(f);if(m)return m;let h=null,S=new Proxy(f,{has(g,E){return Reflect.has(g,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(g){return he[he.length-1]?.add(xt(u)),Y!==null&&Y.home!==s&&V(Y),Reflect.ownKeys(g)},get(g,E,T){if(E===vt)return g;if(E===qn)return u==="";if(typeof E!="string")return Reflect.get(g,E,T);if(u===""&&E in l)return l[E];let R=u?`${u}.${E}`:E;he[he.length-1]?.add(R),Y!==null&&Y.home!==s&&V(Y);let k=Reflect.get(g,E,T);if(de(k))return N(k,R),k;let v=Q(k);return y(v)?W(v,R):v},set(g,E,T,R){if(R!==S&&!Object.prototype.hasOwnProperty.call(g,E))return Reflect.set(g,E,T,R);let k=u?`${u}.${E}`:E,v=de(T)?T:Q(T),Z=!Object.prototype.hasOwnProperty.call(g,E);if(!Z&&Object.is(g[E],v)&&(v===null||typeof v!="object"))return!0;let F=g[E];F!==null&&typeof F=="object"&&Ke.has(F)&&v!==null&&typeof v=="object"&&!de(v)&&Ke.add(v),g[E]=v,h?.delete(E),de(v)?N(v,k):q(k);let ye=de(v)||!y(v)?v:W(v,k);return!Z&&I(F,v)?J(k,F,v,ye):x(k,ye,Z),!0},deleteProperty(g,E){if(typeof E!="string")return Reflect.deleteProperty(g,E);let T=Object.prototype.hasOwnProperty.call(g,E),R=Reflect.deleteProperty(g,E);if(R&&T){let k=u?`${u}.${E}`:E;(h??(h=new Set)).add(E),q(k),x(k,void 0),D(u)}return R}});return r.set(f,S),S},U=W(Q(e),"");Object.entries(Q(e)).forEach(([f,u])=>{de(u)&&N(u,f)});let w=(f,u,{immediate:m=!1}={})=>(t.has(f)||t.set(f,new Set),t.get(f).add(u),m&&u(Mr(U,f),f),()=>t.get(f)?.delete(u)),M=(f,{immediate:u=!1}={})=>(n.add(f),u&&Hn(U,"",(m,h)=>f(m,h)),()=>n.delete(f)),P=(f,{deep:u=!1,alsoWakenBy:m}={})=>{let h=!1,S=!1,g={deps:Nt,reindex:new Set,deep:u,order:Ir++,home:s,adopted:null,read:null,run:()=>{if(h){S=!0;return}h=!0;try{let R=0;do{S=!1,g.read=null;let k=new Set;he.push(k);let v=Y;Y=g;try{f()}finally{he.pop(),Y=v,g.deps=k}}while(S&&++R<100);S&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{h=!1,g.adopted&&Dr(g),g.reindex.forEach(R=>R(g.deps))}}};s.add(g);let E=C(g),T=()=>{s.delete(g),E(),On(g)};return m?.length?_(g,m,T):(g.run(),Pt=g,T)},_=(f,u,m)=>{let h=u.map(S=>S?.[Dn]?.(f)).filter(Boolean);return f.run(),Pt=f,()=>{m(),h.forEach(S=>S())}},B=f=>{s.add(f);let u=C(f);return()=>{s.delete(f),u()}},V=f=>{(f.read??(f.read=new Set)).add(s),!(f.adopted?.has(s)||s.has(f))&&(f.adopted??(f.adopted=new Map)).set(s,B(f))},ne=()=>{$.forEach(({unsubscribe:f})=>f()),$.clear(),s.forEach(f=>{f.home===s&&On(f)})};return l.$on=w,l.$onAny=M,l.$effect=P,l.$dispose=ne,l[Dn]=B,l[In]=f=>s.has(f),U},kt=class{constructor(t,n){A(this,"scope",t);A(this,"disposers",null);A(this,"runs",null);A(this,"children",null);A(this,"owners",null);A(this,"options");let s=t[Ge];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[At];!n||this.owners?.includes(n)||((this.owners??(this.owners=[])).push(n),(n.children??(n.children=new Set)).add(this))}effect(t){(this.disposers??(this.disposers=[])).push(this.scope.$effect(t,this.options)),(this.runs??(this.runs=[])).push(Pt)}onDispose(t){(this.disposers??(this.disposers=[])).push(t)}refresh(){this.runs?.forEach(t=>t.run())}rerun(){let t=this.runs?[...this.runs]:null,n=this.children?[...this.children]:null;t?.forEach(s=>{this.runs&&s.run()}),n?.forEach(s=>s.rerun())}dispose(){let t=this.disposers;if(this.disposers=null,this.runs=null,this.children=null,this.owners?.forEach(n=>n.children?.delete(this)),this.owners=null,t)for(let n=0;n<t.length;n++)t[n]()}},Ee=(e,t=!1)=>new kt(e,t),Ot=e=>{let t=ve({value:void 0}),n=null;t.$effect(()=>{n??(n=Y);let l;try{l=e()}catch(o){console.error("jq79: error in $computed, keeping its last value",o);return}t.value=l});let s=(l,o)=>(console.warn(`jq79: a $computed is read-only - the write to ${String(o)} was ignored`),!0),r=(l,o)=>{let i=o==="value"&&n&&Y!==n?se?.get(n):void 0;return i&&(se.delete(n),i.has(n)&&n.run()),l[o]};return new Proxy(t,{get:r,set:s,deleteProperty:s,defineProperty:s})};var Ve=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,Wn=/\$:\s*/y,Ze=/import(?=\s*\()/y,Bn=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,ie=(e,t)=>{let n=e[t],s=t+1;for(;s<e.length;){if(e[s]==="\\"){s+=2;continue}if(e[s]===n)return s+1;s++}return e.length},re=(e,t)=>{let n=e.indexOf(`
2
+ `,t);return n===-1?e.length:n},oe=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},ue=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=re(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=oe(e,n);continue}break}return n},Hr=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),le=(e,t)=>{let n=t-1;for(;n>=0;){let r=e[n];if(/\s/.test(r)){n--;continue}if(r==="/"&&e[n-1]==="*"){let l=e.lastIndexOf("/*",n-2);if(l===-1)return!0;n=l-1;continue}break}if(n<0)return!0;let s=e[n];if(/[\w$]/.test(s)){let r=n;for(;r>0&&/[\w$]/.test(e[r-1]);)r--;return Hr.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},ae=(e,t)=>{let n=t+1,s=!1;for(;n<e.length;){let r=e[n];if(r==="\\"){n+=2;continue}if(r===`
3
+ `)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<e.length&&/[a-z]/i.test(e[n]);)n++;return n}n++}return e.length},qr=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Fr=(e,t)=>{let n=t-1;for(;n>=0;){let s=e[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&e[n-1]==="*"){let r=e.lastIndexOf("/*",n-2);if(r===-1)return"";n=r-1;continue}return s}return""},Lt=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=ie(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=oe(e,s);continue}if(r==="/"&&le(e,s)){s=ae(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
4
+ `){let l=ue(e,s+1);if(!(l<e.length&&(qr.test(e.slice(l,l+2))||[",","="].includes(Fr(e,s)))))return s;s=l;continue}}s++}return e.length},Un=e=>{let t=[],n=0,s=0,r=0,l=i=>{t.push({raw:e.slice(s,i),codeEnd:Math.max(0,r-s)}),s=i+1,r=s},o=0;for(;o<e.length;){let i=e[o];if(i==="'"||i==='"'||i==="`"){o=ie(e,o),r=o;continue}if(i==="/"&&e[o+1]==="/"){o=re(e,o);continue}if(i==="/"&&e[o+1]==="*"){o=oe(e,o);continue}if(i==="/"&&le(e,o)){o=ae(e,o),r=o;continue}if("([{".includes(i))n++;else if(")]}".includes(i))n--;else if(i===","&&n<=0){l(o),o++;continue}/\s/.test(i)||(r=o+1),o++}return l(e.length),t},Qe=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Je.test(t)?[t]:[];let n=[];for(let s of It(t.slice(1,Kn(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=tt(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let l=Dt(s,":");if(l!==-1){n.push(...Qe(s.slice(l+1)));continue}}n.push(...Qe(s))}return n},Wr=e=>{let t=[],n=Un(e).map(({raw:l,codeEnd:o})=>{let i=l.match(/^\s*/)[0];if(o<=i.length)return{text:l,empty:!0};let a=l.slice(i.length,o),c=l.slice(o),d=tt(a),p=(d===-1?a:a.slice(0,d)).trim(),b=a[0]==="{"||a[0]==="[";b?t.push(...Qe(p)):Je.test(p)&&t.push(p);let C=et(a).code;return{text:`${i}${b?`(${C})`:C}${c}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let r=n.map(l=>l.text).join(",")+s.join("");return r.trimStart().startsWith("(")&&(r=`;${r}`),{vars:t,code:r}},et=e=>{let t=[],n="",s=0,r=0,l=!0;for(;s<e.length;){let o=e[s],i=e[s+1];if(o==="'"||o==='"'||o==="`"){let a=ie(e,s);n+=e.slice(s,a),s=a,l=!1;continue}if(o==="/"&&(i==="/"||i==="*")){let a=i==="/"?re(e,s):oe(e,s);n+=e.slice(s,a),s=a;continue}if(o==="/"&&le(e,s)){let a=ae(e,s);n+=e.slice(s,a),s=a,l=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(Ze.lastIndex=s,Ze.test(e))){n+="$__import",s+=6,l=!1;continue}if(r===0&&l){Ve.lastIndex=s;let a=Ve.exec(e);if(a){let d=s+a[0].length,p=Lt(e,d),{vars:b,code:C}=Wr(e.slice(d,p));t.push(...b),n+=C,s=p,l=!1;continue}Wn.lastIndex=s;let c=Wn.exec(e);if(c){Bn.lastIndex=s;let d=Bn.exec(e);d&&t.push(d[1]);let p=s+c[0].length,b=Lt(e,p);n+=`$__effect(() => { ${et(e.slice(p,b)).code} });`,s=b;continue}}"([{".includes(o)?r++:")]}".includes(o)&&(r=Math.max(0,r-1)),o===`
5
+ `||o===";"||o==="}"?l=!0:/\s/.test(o)||(l=!1),n+=o,s++}return{vars:t,code:n}},Xe=/export\s+default(?![\w$])/y,Ye=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,Br=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let l=e[r];if(l==="{")n++;else if(l==="}")n--;else if(r===e.length||l===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}}return t},Ur=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=Br(e),l=[],o=s;if(r.length>1){let i=`$__mod${n}`;l.push(`${i} = ${s}`),o=i}for(let i of r)i.startsWith("{")?l.push(`${i.replace(/\s+as\s+/g,": ")} = ${o}`):i.startsWith("*")?l.push(`${i.replace(/^\*\s*as\s+/,"")} = ${o}`):l.push(`${i} = $__default(${o})`);return`const ${l.join(", ")}`},Je=/^[A-Za-z_$][\w$]*$/,Kn=e=>{let t=0,n=0;for(;n<e.length;){let s=e[n];if(s==="'"||s==='"'||s==="`"){n=ie(e,n);continue}if(s==="/"&&e[n+1]==="/"){n=re(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=oe(e,n);continue}if(s==="/"&&le(e,n)){n=ae(e,n);continue}if("([{".includes(s))t++;else if(")]}".includes(s)&&--t===0)return n;n++}return e.length},Dt=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=ie(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=re(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=oe(e,s);continue}if(r==="/"&&r!==t&&le(e,s)){s=ae(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},It=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let l=e[r];if(l==="'"||l==='"'||l==="`"){r=ie(e,r);continue}if(l==="/"&&e[r+1]==="/"){r=re(e,r);continue}if(l==="/"&&e[r+1]==="*"){r=oe(e,r);continue}if(l==="/"&&le(e,r)){r=ae(e,r);continue}if(l!==void 0&&"([{".includes(l))n++;else if(l!==void 0&&")]}".includes(l))n--;else if(r===e.length||l===","&&n===0){let o=e.slice(s,r).trim();o&&t.push(o),s=r+1}r++}return t},tt=e=>{let t=0;for(;t<e.length;){let n=Dt(e.slice(t),"=");if(n===-1)return-1;let s=t+n;if(e[s+1]!=="="&&e[s+1]!==">"&&e[s-1]!=="="&&e[s-1]!=="!")return s;t=s+1}return-1},je=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=Kn(t);if(n>=t.length)return null;let s=[];for(let r of It(t.slice(1,n))){if(r.startsWith("..."))continue;let l=tt(r),o=l===-1?r:r.slice(0,l),i=l===-1?void 0:r.slice(l+1).trim(),a=Dt(o,":"),c=(a===-1?o:o.slice(0,a)).trim();if(!Je.test(c))continue;let d={name:c};i!==void 0&&(d.default=i);let p=a===-1?"":o.slice(a+1).trim();Je.test(p)&&(d.as=p),s.push(d)}return s},Kr=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=ie(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=re(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=oe(e,t);continue}if(r==="/"&&le(e,t)){t=ae(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){Xe.lastIndex=t;let l=Xe.exec(e);if(l)return t+l[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
6
+ `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},zr=/^async(?![\w$])/,Gr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Vr=e=>{let t=Kr(e);if(t===-1)return null;let n=ue(e,t),s=e.slice(n);zr.test(s)&&(n=ue(e,n+5));let r=Gr.exec(e.slice(n));if(r&&(n=ue(e,n+r[0].length)),e[n]!=="(")return null;let l=0,o=n;for(;o<e.length;){let i=e[o];if(i==="'"||i==='"'||i==="`"){o=ie(e,o);continue}if(i==="/"&&e[o+1]==="/"){o=re(e,o);continue}if(i==="/"&&e[o+1]==="*"){o=oe(e,o);continue}if(i==="/"&&le(e,o)){o=ae(e,o);continue}if("([{".includes(i))l++;else if(")]}".includes(i)&&--l===0)break;o++}return It(e.slice(n+1,o))[0]??""},nt=e=>{let t=Vr(e);if(t===null)return null;let n=je(t),s=n?.find(r=>r.name.startsWith("$"))?.name;if(s)throw new Error(`jq79: the factory signature is (props, ctx), so \`${s}\` can't be destructured from the first parameter. Write \`export default (props, { ${s} }) => \u2026\`, or \`_\` in place of props if the component takes none.`);return n},zn=e=>{let t="",n=0,s=0,r=!0,l=!1,o=0;for(;n<e.length;){let i=e[n],a=e[n+1],c=n===0||!/[\w$.]/.test(e[n-1]);if(i==="'"||i==='"'||i==="`"){let d=ie(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(i==="/"&&(a==="/"||a==="*")){let d=a==="/"?re(e,n):oe(e,n);t+=e.slice(n,d),n=d;continue}if(i==="/"&&le(e,n)){let d=ae(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(i==="i"&&c){if(Ze.lastIndex=n,Ze.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){Ye.lastIndex=n;let d=Ye.exec(e);if(d){t+=Ur(d[1],d[3],o++),n+=d[0].length,r=!1;continue}}}if(i==="e"&&c&&s===0&&r){Xe.lastIndex=n;let d=Xe.exec(e);if(d){l=!0,t+="$__exports.default =",n+=d[0].length,r=!1;continue}}"([{".includes(i)?s++:")]}".includes(i)&&(s=Math.max(0,s-1)),i===`
7
+ `||i===";"||i==="}"?r=!0:/\s/.test(i)||(r=!1),t+=i,n++}return l?t:null},Zr=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),Qr=new Set(["function","class","let","const","var","eval","with"]),Xr=new Set(["$scope","$r","$t"]),Yr=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,Jr=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,eo=e=>/[A-Za-z_$]/.test(e),to=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,Ht=e=>{let t=new Set,n=[0],s=[],r=!1,l="",o=0;for(;o<e.length;){let i=e[o];if(/\s/.test(i)){o++;continue}if(i==="/"&&e[o+1]==="/"){o=re(e,o);continue}if(i==="/"&&e[o+1]==="*"){o=oe(e,o);continue}if(i==="/"&&le(e,o)){o=ae(e,o),l="value";continue}if(i==='"'||i==="'"){o=ie(e,o),l="value";continue}if(i==="`"){let d=o+1;for(;d<e.length;){if(e[d]==="\\"){d+=2;continue}if(e[d]==="`"){d++;break}if(e[d]==="$"&&e[d+1]==="{"){let p=1,b=d+=2;for(;d<e.length&&p>0;)e[d]==="{"?p++:e[d]==="}"&&p--,d++;let C=Ht(e.slice(b,d-1));if(C===null)return null;C.forEach(O=>t.add(O));continue}d++}o=d,l="value";continue}if(/\d/.test(i)&&l!=="."&&l!=="?."){let d=to.exec(e.slice(o));o+=d?d[0].length:1,l="value";continue}if(eo(i)){let d=o;for(;d<e.length&&/[\w$]/.test(e[d]);)d++;let p=e.slice(o,d);if(o=d,Qr.has(p))return null;if(l==="."||l==="?."){l="value";continue}if(Zr.has(p)){l=p==="this"?"value":"op";continue}if(Xr.has(p))return null;let b=o;for(;b<e.length&&/\s/.test(e[b]);)b++;if(e[b]==="(")return null;e[b]===":"&&e[b+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),l="value";continue}let a=e.slice(o);if(Yr.test(a))return null;let c=Jr.exec(a);if(c){(c[0]==="&&"||c[0]==="||"||c[0]==="??")&&(r=!0),l=c[0]==="?."?"?.":"op",o+=c[0].length;continue}if(i==="=")return null;i==="("||i==="["||i==="{"?(s.push(i),n.push(0)):i===")"||i==="]"||i==="}"?(s.pop(),n.length>1&&n.pop()):i==="?"?(n[n.length-1]++,r=!0):i===":"&&n[n.length-1]>0&&n[n.length-1]--,l=i,o++}return r&&t.size>1?null:[...t]},_t=/(?:await\s+)?(?:import\s*\(|(\$importAll)\s*\(\s*\[|(C79|Component79)\s*\.\s*(fetch|fetchAll|importAll)\s*\(\s*(\[)?)/y,jt=/(["'])([^"'\n\\]+)\1/y,no=/^(?:(?:if|for|while|with)\b[\s\S]*\)|[\s\S]*\b(?:else|do))$/,so=(e,t)=>{_t.lastIndex=0;let n=_t.exec(e);if(!n)return[];let[,s,r,l,o]=n;if(t.has(s??r??""))return[];let i=s!==void 0||o!==void 0;if(l!==void 0&&l==="fetch"===i)return[];let a=r===void 0?"component":l==="importAll"?"page":"fetch",c=[],d=ue(e,_t.lastIndex);for(;;){jt.lastIndex=d;let p=jt.exec(e);if(!p)return c;let b=ue(e,jt.lastIndex),C=e[b];if(!i)return C===")"||C===","?[{spec:p[2],kind:a}]:[];if(C!==","&&C!=="]"||(c.push({spec:p[2],kind:a}),C==="]"))return c;d=ue(e,b+1)}},Gn=e=>{let t=[];for(let o=ue(e,0);o<e.length;o=ue(e,o+1)){let i=Lt(e,o);t.push(e.slice(o,i).trim().replace(/^export\s+(?!default\b)/,"")),o=i}let n=o=>{Ve.lastIndex=0;let i=Ve.exec(o);return i?Un(o.slice(i[0].length)).map(({raw:a})=>{let c=a.trim(),d=tt(c);return d===-1?{target:c,init:""}:{target:c.slice(0,d).trim(),init:c.slice(d+1).trim()}}):null},s=new Set;t.forEach(o=>n(o)?.forEach(({target:i})=>Qe(i).forEach(a=>s.add(a))));let r=[],l=!1;for(let o of t){if(!l){Ye.lastIndex=0;let i=Ye.exec(o);if(i)/^type\s/.test(i[1]??"")||r.push({spec:i[3],kind:"component"});else{let a=n(o);for(let c of a?a.map(({init:d})=>d):[o])r.push(...so(c,s))}}l=no.test(o)}return r};var ce=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),st=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),ro=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),oo=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Ft=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,io=e=>e.split(Ft).map((t,n)=>n%2===1?t:t.replace(oo,(s,r,l)=>ro.has(r.toLowerCase())?s:`<${r}${l}></${r}>`)).join(""),Zn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,lo=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,ao=e=>e.split(Ft).map((t,n)=>n%2===1?t:t.replace(Zn,(s,r,l)=>{let o=0,i=l.replace(lo,(a,c,d)=>d===void 0?a:`${c}:props.${o++}="${d}"`);return`<${r}${i}>`})).join(""),co=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,uo=/<\/slot\.([\w.$-]+)(\s*)>/gi,fo=/^slot\./i,po=e=>fo.test(e)?`slot.${st(e.slice(5))}`:e,Le=":jq79-component",Qn=/^[A-Z]/,ho="c79-",De=e=>`${ho}${st(e[0].toLowerCase()+e.slice(1))}`,go=e=>Qn.test(e)?De(e):po(e),mo=/<\/([A-Z][\w.-]*)(\s*)>/g,yo=/\/\s*$/,Eo=(e,t)=>{if(!Qn.test(e))return t;let n=` ${Le}="${e}"`,s=yo.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},wo=e=>e.split(Ft).map((t,n)=>n%2===1?t:t.replace(Zn,(s,r,l)=>{let o=l.replace(co,(i,a,c)=>c===void 0?i:`${a}${st(c)}`);return`<${go(r)}${Eo(r,o)}>`}).replace(uo,(s,r,l)=>`</slot.${st(r)}${l}>`).replace(mo,(s,r,l)=>`</${De(r)}${l}>`)).join(""),Xn=e=>io(ao(wo(e))),Yn=/^[A-Z][A-Za-z0-9]*$/,qt=/{{\s*([\s\S]+?)\s*}}/g,Vn=new Map,rt=e=>{let t=Vn.get(e);if(t)return t;let n=[],s=0;qt.lastIndex=0;for(let r=qt.exec(e);r;r=qt.exec(e))r.index>s&&n.push(e.slice(s,r.index)),n.push({expr:r[1]}),s=r.index+r[0].length;return s<e.length&&n.push(e.slice(s)),Vn.set(e,n),n},Wt=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":window",":with",":text",":html",":html.allowed",":props"]),we=e=>Wt.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Jn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,ot=e=>e==="slot"||e.startsWith("slot."),Bt=e=>e?ce(e):"default",Ut=e=>`${e}
8
+ = $value`,Kt=["$scope","$r"],es=e=>`with ($scope) { return (${e}
9
+ ); }`,ts=(e,t)=>{let n=Ht(e);if(n===null)return null;let s=n.filter(l=>!t.includes(l));return`${s.length===0?"":`let $t; ${s.map(l=>`const ${l} = ($t = $scope.${l}) !== undefined ? $t : $r($scope, ${JSON.stringify(l)});`).join(" ")}`} return (${e}
10
+ );`},it=(e,t)=>`${e.join(",")}
11
+ ${t}`,zt=e=>`await $mounted();${e}`,ns=e=>["$scope","$__effect","$__import","$__state",...e],ss=e=>`return (async () => { with ($scope) { ${e} }
12
+ ;$__state.done = true })()`,rs=e=>["$__exports","$__default","$__import",...e],os=e=>`return (async () => { "use strict";
13
13
  ${e}
14
- ;$__exports.done = true })()`,Vn=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:_e(t)},Zn=(e,t,n=Xe)=>{let s=new Set;return e.forEach(r=>{(n(r.content)??t(r))?.forEach(({name:o})=>s.add(o))}),s};var Qn="__jq79precompiled",Xn="jq79-precompiled",Yn=(e,t)=>`function anonymous(${e.join(",")}
14
+ ;$__exports.done = true })()`,is=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:je(t)},ls=(e,t,n=nt)=>{let s=new Set;return e.forEach(r=>{(n(r.content)??t(r))?.forEach(({name:o})=>s.add(o))}),s};var as="__jq79precompiled",cs="jq79-precompiled",ds=(e,t)=>`function anonymous(${e.join(",")}
15
15
  ) {
16
16
  ${t}
17
- }`;var lo="0.7.14",Rs=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),xs="http://www.w3.org/1999/xhtml",Ns=e=>{let t=Rs(e),n=e.namespaceURI,s=t[je];delete t[je];let r=n!==null&&n!==xs;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(i=>{if(i.nodeType===Node.TEXT_NODE){let o=i.textContent??"";return o?[o]:[]}return i.nodeType===Node.ELEMENT_NODE?[Ns(i)]:[]})}},rt=new Map,st=new Map,sn=!1,Kt,Me=class extends Error{constructor(n,s){super(`${n}. ${s}`);k(this,"reason",n);k(this,"hint",s)}},ao=()=>new Me("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),co=(e,t)=>{let n=globalThis[Qn];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))st.set(et(s,r),i);return st.size===0?void 0:st.get(et(e,t))},rn=(e,t,n="")=>{let s=co(e,t);if(s===null)throw new SyntaxError("jq79: this code did not compile when it was precompiled");if(s!==void 0)return s;if(Kt!==void 0)return uo(e,t,n,Kt);if(sn)throw ao();return new Function(...e,t+n)},on=()=>{if(!(typeof document>"u"))for(let e of Array.from(document.querySelectorAll("script[nonce]"))){let t=e.nonce||e.getAttribute("nonce");if(t)return t}},Jn="__jq79built",uo=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${Jn} = ${Yn(e,t)}${n}`;let i,o=a=>{i=a.error??new SyntaxError(a.message),a.preventDefault()};window.addEventListener("error",o);try{(document.head??document.documentElement).append(r)}finally{window.removeEventListener("error",o),r.remove()}let l=r[Jn];if(typeof l=="function")return st.set(et(e,t),l),l;throw i!==void 0?i:new Me("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},es=new Set,fo=(e,t)=>{es.has(e)||(es.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},qt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},vs=(e,t)=>{try{return rn([...Dt,...t],Bn(e))}catch(n){return n instanceof Me&&fo(e,n),null}},po=(e,t)=>{if(!de.scopedNames)return null;let n=Fn(e,t);if(n===null)return null;try{return rn([...Dt,...t],n)}catch{return null}},Ps=(e,t,n)=>{let s=rt.get(e);if(s===void 0){let r=po(t,n);s=r?{fn:r,scoped:!0}:{fn:vs(t,n),scoped:!1},rt.set(e,s)}return s},Cs=(e,t)=>`${t.join(",")}|${e}`,ho=(e,t)=>Ps(Cs(e,t),e,t).fn,go=(e,t,n)=>{let s=vs(t,n);return rt.set(e,{fn:s,scoped:!1}),s},mo=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,yo=100,Te=new Map,ln=new Set,ot=0,Gt=!1,Vt=new Set,Eo=()=>{Gt=!1,!(ot>0)&&(Te.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(ln.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),Te.clear())},Ms=()=>{Gt||ot>0||!Te.size||(Gt=!0,queueMicrotask(Eo))},As=e=>{ot++;let t=()=>{ot--,Ms()};e.then(t,t)},wo=(e,t)=>{if(Vt.has(e))return;Vt.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},ks=(e,t,n)=>{if(!(n instanceof ReferenceError))return wo(e,n);let s=mo.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;ln.has(i)||Te.has(i)||Te.size>=yo||(Te.set(i,{name:r,expr:e,scope:t}),Ms())},Os=(e,t,n)=>{let s=n?Object.keys(n):[],r=Cs(e,s),{fn:i,scoped:o}=Ps(r,e,s);if(!i)return;let l=n?Object.values(n):[];if(!o)return i(t,qt,...l);try{return i(t,qt,...l)}catch(a){if(!(a instanceof ReferenceError))throw a;let c=go(r,e,s);if(!c)throw a;return c(t,qt,...l)}},L=(e,t,n)=>{try{return Os(e,t,n)}catch(s){ks(e,t,s);return}},_s=(e,t,n)=>{try{return Os(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;ks(e,t,s);return}},js=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(L(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(L(s.expr,t)??"");return n},Ls=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,l=>{if(o.has("self")&&l.target!==e)return;o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation();let a=_s(n,s,{$event:l});typeof a=="function"&&a.call(e,l)},{once:o.has("once"),capture:o.has("capture")})},So=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),l=a=>{o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation(),o.has("once")&&e.off(r,l),Ne(()=>{let c=_s(n,s,{$event:a});typeof c=="function"&&c(a)})};e.on(r,l)},an=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},ft=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},bo=e=>{e.forEach(t=>{if(t.first===t.last)return ft(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},To=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},$o=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let i=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=i}},ts=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},be=null,it=null,Ds=new WeakSet,Ro=e=>{let t={memo:be,base:it};return be=new Map,it=e,t},xo=e=>{be=e.memo,it=e.base},ns=(e,t)=>e.component!==void 0?ss(t,e.component):e.tag.includes("-")?ss(t,e.tag):null,J=e=>e.component??e.tag,ss=(e,t)=>{if(!be)return ts(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===it){if(be.has(t))return be.get(t);let r=ts(s,t);return be.set(t,r),r}if(!Ds.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},No=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},vo=(e,t)=>{let n=No(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},rs=100,Ht=0,Is=Symbol("jq79.slots"),Ie=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Po=e=>e==="default"?":slot":`:slot.${e}`,Co=e=>typeof e!="string"||e.trim()!=="",Mo=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Ie(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=jt(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Po(o)}> in <${J(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Co);return s&&"default"in t?console.warn(`jq79: <${J(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},Ao=(e,t,n)=>{_e(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let l=n[s]?.();return l===void 0&&i!==void 0?L(i,e):l},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},ko=e=>{let t=Ie(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},Oo=(e,t)=>{let n=Object.entries(Mo(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=_o(i,t)}),s},_o=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);Ao(o,e.binder,n);let l=o[Be]??[];Object.defineProperty(o,Be,{value:[...l,s]});let a=we(o);return a.ownedBy(s),r.onDispose(()=>a.dispose()),Re(e.nodes,o,a,i)},jo=(e,t,n,s)=>{let r=jt(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),l=document.createComment(`/${e.tag}`);i.append(o,l);let a=t[Is]?.[r];if(!a)return i.insertBefore(Re(e.children,t,n,s),l),i;let c={};return Object.entries(e.attrs).forEach(([u,p])=>{if(!(u===Ae||Se(u)||u.startsWith("@")))if(u.startsWith(":")){let S=p||u.slice(1);c[le(u.slice(1))]=()=>L(S,t)}else c[le(u)]=()=>p}),i.insertBefore(a(c,t,n,s),l),i},qs="data-c79-box",Lo=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(Le(e));s.setAttribute(qs,"");let r=t.attrs[Ae];return r!==void 0&&s.setAttribute(Ae,r),n||Ri(),s},os=new WeakSet,Do=(e,t)=>{if(e.ns===void 0||os.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;os.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${J(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},is=(e,t,n,s,r)=>{let i=Lo(e,t,r),o=!(i instanceof DocumentFragment),l=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),l);let a=Oo(t,n),c={},u={},p=[],S=[],M=!1,H;Object.entries(t.attrs).forEach(([y,T])=>{if(y!==Ae){if(y===":props"||y.startsWith(":props.")){M=!0,S.push({expr:T});return}if(Se(y)){_i.has(y)&&(H??(H=[])).push(y.slice(1));return}if(y.startsWith("@"))p.push([y,T]);else if(y===":model"||y.startsWith(":model.")){let N=y===":model"?"default":le(y.slice(7));u[N]=T||(y===":model"?"model":N)}else if(y.startsWith(":")){let N=le(y.slice(1));c[N]=T||N,S.push({name:N,expr:T||N})}else{let N=le(y),q=JSON.stringify(T);c[N]=q,S.push({name:N,expr:q})}}});let I=y=>y==="default"?":model":`:model.${y}`,D=y=>y==="default"?"model":y,R=new Set;Object.entries(u).forEach(([y,T])=>{let N=D(y);c[N]!==void 0&&console.warn(`jq79: <${J(t)}> binds prop "${N}" through both :${N} and ${I(y)} - ${I(y)} wins`),c[N]=T,ho(Lt(T),["$value"])===null&&(R.add(y),console.warn(`jq79: ${I(y)}="${T}" is not assignable - updates from <${J(t)}> will be dropped`))});let j=()=>{let y={};return S.forEach(({name:T,expr:N})=>{if(T!==void 0)y[T]=L(N,n);else{let q=L(N,n);q!==null&&typeof q=="object"&&Object.assign(y,q)}}),Object.entries(u).forEach(([T,N])=>{y[D(T)]=L(N,n)}),y},O=null,W=null,z=null,G=new Set,X=y=>{if(y==null){if(!n[sr]?.has(e)||G.has("unfilled"))return;G.add("unfilled"),console.error(`jq79: <${J(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}G.has("type")||(G.add("type"),console.error(`jq79: <${J(t)}> is ${typeof y}, not a component - nothing renders here`))};return s.effect(()=>{let y=L(e,n),T=y instanceof fe?y:null;if(T||X(y),T===W||(z?.dispose(),z=null,O?.destroy(),O=null,W=T,!T))return;Do(t,T);let N=new fe({template:T.template,scripts:T.scripts,styles:T.styles,modules:T.modules,filename:T.filename,siblings:T.siblings,name:T.name});if(a&&(N.slots=a),Object.keys(u).length){let v=new Set;N.modelWriteback=(_,F)=>{let V=_==null?"default":le(String(_)),te=u[V];return te===void 0?(v.has(V)||(v.add(V),console.warn(`jq79: <${J(t)}> has no ${I(V)} - bound: ${Object.keys(u).map(I).join(", ")}`)),!1):R.has(V)?!1:(Ne(()=>L(Lt(te),n,{$value:F})),!0)}}p.forEach(([v,_])=>So(N,v,_,n));let q=ki(N.scripts);Oi(t,e,Object.keys(c),q),H&&ji(t,e,H,q);let B=ys(Ne(j),q),K=document.createDocumentFragment();if(Ht>=rs){console.error(`jq79: <${J(t)}> is ${rs} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Ht++;try{(r?N.renderShadow(B):N.render(B)).mount(K)}finally{Ht--}let w=n[dt];w&&N.holdOwner(w.owner),l?l.parentNode.insertBefore(K,l):i.appendChild(K);let A=we(n,!0);if(M){let v=[];A.effect(()=>{let _=ys(j(),q),F=Object.keys(_);v.forEach(V=>{V in _||(N.data[V]=void 0)}),F.forEach(V=>{N.data[V]=_[V]}),v=F})}else Object.entries(c).forEach(([v,_])=>{q!==null&&!q.has(v)||A.effect(()=>{N.data[v]=L(_,n)})});z=A,O=N}),s.onDispose(()=>{z?.dispose(),O?.destroy()}),i},Io=(e,t)=>{let n=()=>{let s=L(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let i=n();return i!==null&&Reflect.has(i,r)||Reflect.has(s,r)},get(s,r){let i=n();return i!==null&&Reflect.has(i,r)?i[r]:Reflect.get(s,r)},set(s,r,i){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=i,!0):Reflect.set(s,r,i)}})},me=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(me):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?me(t):[]):[],qo=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?mn(e):()=>!1,Ho=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),cn=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),Wo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},ls=new Map,Bo=(e,t)=>{let n=`${e} ${t}`,s=ls.get(n);if(s!==void 0)return s;let r=Wo[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,l]=r;i=new DOMParser().parseFromString(`<${o}><${l} ${t}="x"/></${o}>`,"text/html").querySelector(l)?.getAttributeNames().find(c=>c.toLowerCase()===t)??t}return ls.set(n,i),i},Hs=(e,t)=>{let n=e.namespaceURI;if(n===null||n===xs)return t;let s=t.replace(/-/g,"").toLowerCase(),r=Bo(n,s);return r===s?t:r},Ws=(e,t,n)=>{let s=Ho.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},de={cloneSkeletons:!0,scopedNames:!0},Fo=new Set([":text",":html",":value",":checked",":selected"]),Uo=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||Fo.has(e)?!0:e.startsWith(":")?e===":model"?!1:!Se(e)&&!e.includes("."):e!==je,Bs=e=>{if(e.component||e.tag.includes("-")||Je(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!Uo(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Bs(t))},Fs=(e,t,n)=>{let s=cn(e),r,i=null;for(let p in e.attrs){let S=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:S});else if(p===":class")r=S;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),S]);else if(!Se(p))if(p.startsWith(":")){let M=p.slice(1);n.push({kind:"attr",path:t,name:Hs(s,M),expr:S||le(M)})}else s.setAttribute(p,S)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(me(e.attrs.class??""))});let o=e.attrs[":text"],l=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):l!==void 0?n.push({kind:"html",path:t,expr:l}):e.children.forEach((p,S)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,S],parts:Ot(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(Fs(p,[...t,S],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let c=e.attrs[":checked"];c!==void 0&&n.push({kind:"checked",path:t,expr:c});let u=e.attrs[":selected"];return u!==void 0&&n.push({kind:"selected",path:t,expr:u}),s},zo=3,Us=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:Us(n)),0),as=new WeakMap,cs=new WeakSet,Ko=e=>{let t=as.get(e);if(t!==void 0)return t;if(!cs.has(e))return cs.add(e),null;let n=null;if(Bs(e)&&Us(e)>=zo){let s=[];n={skeleton:Fs(e,[],s),ops:s}}return as.set(e,n),n},Go=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},Vo=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:Go(s,r.path);if(r.kind==="text"){let o=i,l=r.parts;n.effect(()=>{let a=js(l,t);o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="event")Ls(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:l,expr:a}=r;n.effect(()=>Ws(o,l,L(a,t)))}else if(r.kind==="class"){let o=i,{classExpr:l,toggles:a,staticClasses:c}=r,u=[];n.effect(()=>{let p=l!==void 0?me(L(l,t)):[];a?.forEach(([S,M])=>{L(M,t)&&p.push(...me(S))}),u.forEach(S=>{!p.includes(S)&&!c.has(S)&&o.classList.remove(S)}),o.classList.add(...p),u=p})}else if(r.kind==="textContent"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(L(l,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=i,{expr:l}=r;n.effect(()=>{o.innerHTML=yt(String(L(l,t)??""))})}else if(r.kind==="value"){let o=i,{expr:l}=r;n.effect(()=>{let a=String(L(l,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!L(l,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=i,{expr:l}=r;n.effect(()=>{let a=!!L(l,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},dn=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?Io(r,t):t;if(Je(e.tag))return jo(e,i,n,s);if(e.tag==="template"&&Ie(e)!==void 0)return ko(e);let o=ns(e,i);if(o)return is(o,e,i,n,s);if(de.cloneSkeletons){let R=Ko(e);if(R)return Vo(R,i,n)}let l=cn(e);if(e.component!==void 0&&i[dt]?.count===0)throw vo(e.component,i);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let R=!1;n.effect(()=>{if(R)return;let j=ns(e,i);if(!j)return;R=!0;let O=is(j,e,i,n,s),W=an(O);n.onDispose(()=>ft(W)),l.replaceWith(O)})}for(let R in e.attrs){let j=e.attrs[R];if(R.startsWith("@"))Ls(l,R,j,i);else if(R===":model"||R.startsWith(":model."))a||console.warn(`jq79: ${R} on <${J(e)}> does nothing - :model binds component tags only (for now)`);else if(!Se(R))if(R.startsWith(":"))if(a)l.setAttribute(R,j);else{let O=R.slice(1),W=j||le(O),z=Hs(l,O);n.effect(()=>Ws(l,z,L(W,i)))}else l.setAttribute(R,j)}let c=e.attrs[":class"],u=null;for(let R in e.attrs)R.startsWith(":class.")&&(u??(u=[])).push([R.slice(7),e.attrs[R]]);if(c!==void 0||u){let R=new Set(me(e.attrs.class??"")),j=[];n.effect(()=>{let O=c!==void 0?me(L(c,i)):[];u?.forEach(([W,z])=>{L(z,i)&&O.push(...me(W))}),j.forEach(W=>{!O.includes(W)&&!R.has(W)&&l.classList.remove(W)}),l.classList.add(...O),j=O})}let p=e.attrs[":text"],S=e.attrs[":html"],M=e.attrs[":html.allowed"];M!==void 0&&S===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let R=String(L(p,i)??"");l.textContent!==R&&(l.textContent=R)}):S!==void 0?n.effect(()=>{let R=M!==void 0?{allowUrl:qo(L(M,i))}:void 0;l.innerHTML=yt(String(L(S,i)??""),R)}):l instanceof HTMLTemplateElement?Re(e.children,i,n,s,l.content):Re(e.children,i,n,s,l);let H=e.attrs[":value"];H!==void 0&&n.effect(()=>{let R=String(L(H,i)??"");l.value!==R&&(l.value=R)});let I=e.attrs[":checked"];I!==void 0&&n.effect(()=>{let R=!!L(I,i);l.checked!==R&&(l.checked=R)});let D=e.attrs[":selected"];return D!==void 0&&n.effect(()=>{let R=!!L(D,i);l.selected!==R&&(l.selected=R)}),l},Zo=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,l=null,a=null;return n.effect(()=>{let c=e.find(p=>p.expr===void 0||L(p.expr,t))??null;if(c===l||(a?.dispose(),o&&ft(o),o=null,l=c,!c))return;a=we(t);let u=dn(c.node,t,a,s);o=an(u),r.parentNode.insertBefore(u,r.nextSibling)}),n.onDispose(()=>a?.dispose()),i},Pe=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},Qo=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let i=e[r];if(i<0)continue;let o=0,l=n.length;for(;o<l;){let a=o+l>>1;e[n[a]]<i?o=a+1:l=a}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},Xo=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},zs=(e,t)=>typeof e=="string"?t.some(n=>us(e,n)):Object.values(e.attrs).some(n=>t.some(s=>us(n,s)))||e.children.some(n=>zs(n,t)),Ks=e=>typeof e!="string"&&(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs||":each"in e.attrs||e.component!==void 0||e.tag.includes("-")||Je(e.tag)||e.children.some(Ks)),ds=/[A-Za-z0-9_$]/,Yo=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,us=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!ds.test(s)&&!ds.test(r))return!0}return!1},Wt=new WeakMap,Jo=e=>{let t=Wt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Wn);if(!n)return Wt.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],l=o===s,a=o!==void 0&&!l&&Yo.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:c,[":key"]:u,[":window"]:p,...S}=e.attrs,M={...e,attrs:S},H=["$index",...r?[r]:[]],I=zs(M,H),D=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),R=o!==void 0&&Ks(M),j={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:l,keyProp:a,itemNode:M,readsPosition:I,namesComponent:D,nestsScopes:R,windowExpr:p};return Wt.set(e,j),j},tt=8,ei=/^(auto|scroll|overlay)$/,ti=e=>{for(let t=e;t;t=t instanceof ShadowRoot?t.host:t.parentNode)if(!(!(t instanceof HTMLElement)||t===document.body||t===document.documentElement)&&ei.test(getComputedStyle(t).overflowY))return t;return null},ni=(e,t,n,s,r)=>{let i=()=>{let y=e.component!==void 0||e.tag.includes("-")?document.createElement("div"):cn(e);return y.setAttribute("aria-hidden","true"),y.setAttribute("style","height: 0px; margin: 0; padding: 0; border: 0; list-style: none; visibility: hidden"),y},o=i(),l=i(),a=ve({start:0,count:-1}),c=0,u=0,p=null,S=!1,M=0,H=null,I=null,D=y=>Math.ceil(y/c)+1+2*tt,R=(y,T)=>{y=Math.max(0,Math.min(y,Math.max(0,u-T))),(a.start!==y||a.count!==T)&&We(()=>{a.start=y,a.count=T})},j=()=>{let y=o.getBoundingClientRect().top;if(p){let T=p.getBoundingClientRect(),N=p.scrollTop;return{listTop:y-T.top-p.clientTop+N,scrollTop:N,height:p.clientHeight||window.innerHeight}}return{listTop:y+window.scrollY,scrollTop:window.scrollY,height:window.innerHeight}},O=()=>{if(M=0,!(c>0)||!o.isConnected)return;let{listTop:y,scrollTop:T,height:N}=j();R(Math.floor((T-y)/c)-tt,D(N))},W=()=>{M||(M=typeof requestAnimationFrame=="function"?requestAnimationFrame(O):setTimeout(O,16))},z=(y,{block:T="nearest"}={})=>{if(G(),c>0&&o.isConnected){let{listTop:B,scrollTop:K,height:w}=j(),A=B+y*c,v=A+c,_=K;T==="start"?_=A:T==="end"?_=v-w:T==="center"?_=A-(w-c)/2:A<K?_=A:v>K+w&&(_=v-w),_!==K&&(p?p.scrollTop=_:window.scrollTo(window.scrollX,_)),O()}let N=a.count>0?a.count:D(window.innerHeight||800);(y<a.start||y>=a.start+N)&&R(y-tt,N);let q=r().find(B=>B.scope.$index===y);return q?q.range.first:null},G=()=>{S||!o.isConnected||(S=!0,I=o.parentElement,p=ti(o.parentNode),(p??window).addEventListener("scroll",W,{passive:!0}),window.addEventListener("resize",W),p&&typeof ResizeObserver=="function"&&(H=new ResizeObserver(W),H.observe(p)),I&&Object.defineProperty(I,"$scrollTo",{value:z,configurable:!0,writable:!0}),O())};s.onDispose(()=>{M&&(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout)(M),S&&((p??window).removeEventListener("scroll",W),window.removeEventListener("resize",W),H?.disconnect(),I&&I.$scrollTo===z&&delete I.$scrollTo)});let X=!1;return{top:o,bottom:l,range:y=>{u=y;let T=Number(L(t,n)),N=c;if(c=T>0?T:0,c&&c!==N&&S&&o.isConnected){let{listTop:w,scrollTop:A,height:v}=j(),_=Q(a);_.count=D(v),_.start=Math.max(0,Math.floor((A-w)/c)-tt)}if(!c)return o.style.height=l.style.height="0px",[0,y];let q=a.count>0?a.count:D(window.innerHeight||800),B=Math.max(0,Math.min(a.start,y-q)),K=Math.min(y,B+q);return o.style.height=`${B*c}px`,l.style.height=`${(y-K)*c}px`,[B,K]},settled:()=>{S||X||(X=!0,queueMicrotask(()=>{X=!1,G()}))}}},si=(e,t,n,s)=>{let r=Jo(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:l,keyExpr:a,keyIsItem:c,keyProp:u,itemNode:p,readsPosition:S,namesComponent:M,nestsScopes:H,windowExpr:I}=r,D=document.createComment("each"),R=document.createDocumentFragment();R.appendChild(D);let j=I===void 0?null:ni(p,I,t,n,()=>O);j&&R.append(j.top,j.bottom),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let O=[],W=!1;return n.effect(()=>{let z=Ro(t);try{let G=L(l,t),X=Array.isArray(G),y=X?null:Xo(G)?Object.keys(G):[],T=X?G.length:y.length,[N,q]=j?j.range(T):[0,T],B=new Map;O.forEach((d,m)=>{d.pos=m;let h=B.get(d.key);h?h.push(d):B.set(d.key,[d])});let K=new Set,w=[],A=[],v=[],_=[],F;for(let d=N;d<q;d++){let m=X?d:y[d],h=X?G[d]:G[m],b=m;c?b=h:u!==void 0&&h!==null&&typeof h=="object"?b=h[u]:a!==void 0&&(F===void 0?(F=Object.create(t),Pe(F,i,h),o&&Pe(F,o,m),Pe(F,"$index",d)):(F[i]=h,o&&(F[o]=m),F.$index=d),b=L(a,F)),K.has(b)&&!W&&(W=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),K.add(b);let g=B.get(b)?.shift();if(g&&Object.is(g.item,h)){let P=g.scope;P.$index!==d&&(S&&w.push(g),P.$index=d),o&&P[o]!==m&&(P[o]=m),v.push(g),_.push(g.pos);continue}if(g&&a!==void 0){let P=g.scope;P[i]=h,P.$index!==d&&(P.$index=d),o&&P[o]!==m&&(P[o]=m),g.item=h,A.push(g),v.push(g),_.push(g.pos);continue}g&&(g.fx.dispose(),ft(g.range));let E=Object.create(t);Pe(E,i,h),o&&Pe(E,o,m),Pe(E,"$index",d),M||Ds.add(E);let $=we(t);H&&Object.defineProperty(E,$t,{value:$});let x=an(dn(p,E,$,s));v.push({key:b,item:h,scope:E,fx:$,range:x,pos:d}),_.push(-1)}let V=new Set;B.forEach(d=>d.forEach(m=>V.add(m))),V.size&&(V.forEach(d=>{d.dead=!0,d.fx.dispose()}),bo(To(O,d=>d.dead===!0)));let te=j?j.top:D,f=Qo(_);v.forEach((d,m)=>{!f[m]&&te.nextSibling!==d.range.first&&$o(d.range,te),te=d.range.last}),w.forEach(d=>Ne(()=>d.fx.refresh())),A.forEach(d=>Ne(()=>d.fx.rerun())),O=v}finally{xo(z)}j?.settled()}),n.onDispose(()=>O.forEach(z=>z.fx.dispose())),R},Gs=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Bt=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${J(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},ri=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${J(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${J(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},oi=[":if",":elseif",":else",":each"],ii=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=oi.find(s=>s in e.attrs);if(n!==void 0){if(Ie(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Ie(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},li=[..._t,":model",":slot"].map(e=>e.slice(1)),ai={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},ci=e=>{for(let t in e.attrs){let n=ai[t];n!==void 0&&console.warn(`jq79: ${n}`)}},di=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||Se(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1);if(n.includes(".")){console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". Dotted modifiers belong to an event: if you meant @${n}, that is the spelling`);continue}let s=li.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},Vs=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(ii(s,t),ci(s),di(s),Vs(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(Bt(r),":if"in r.attrs){s++;let i=l=>{let a=Gs(e,s),c=e[a];if(typeof c=="object"&&l in c.attrs)return s=a+1,c};for(let l=i(":elseif");l;l=i(":elseif"))Bt(l);let o=i(":else");o&&Bt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&ri(r,n),n=!1,s++}},fs=new WeakMap,ui=(e,t,n)=>{let s=fs.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=c=>{let u=Gs(e,i),p=e[u];if(typeof p=="object"&&c in p.attrs)return i=u+1,p};for(let c=o(":elseif");c;c=o(":elseif"))r.push({expr:c.attrs[":elseif"],node:c});let l=o(":else");l&&r.push({node:l});let a={branches:r,next:i};return fs.set(t,a),a},Re=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let l=e[o];if(typeof l=="string"){let a=document.createTextNode(l);if(l.includes("{{")){let c=Ot(l);n.effect(()=>{let u=js(c,t);a.textContent!==u&&(a.textContent=u)})}i.appendChild(a),o++;continue}if(":each"in l.attrs){i.appendChild(si(l,t,n,s)),o++;continue}if(":if"in l.attrs){let a=ui(e,l,o);i.appendChild(Zo(a.branches,t,n,s)),o=a.next;continue}i.appendChild(dn(l,t,n,s)),o++}return i},cl=(e,t,n=!1)=>Re(e.template,t,we(t),n),Ae="data-jq79",fi=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},Zs=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ae]=t,Zs(n.children,t))})},pi=/^:(before|after|first-line|first-letter)(?![\w-])/i,Qs=(e,t)=>{let n=0;for(let s=0;s<e.length;s++){let r=e[s];if(r==="\\")s++;else if(r==='"'||r==="'")for(s++;s<e.length&&e[s]!==r;)s+=e[s]==="\\"?2:1;else if(r==="("||r==="[")n++;else if(r===")"||r==="]")n--;else if(n===0&&t(s))return}},hi=(e,t)=>{let n=e.length;return Qs(e,s=>e[s]!==":"||e[s+1]!==":"&&!pi.test(e.slice(s))?!1:(n=s,!0)),`${e.slice(0,n)}[${Ae}="${t}"]${e.slice(n)}`},gi=(e,t)=>{let n=Xs(e),s=n.match(/^\s*/)[0],r=n.match(/\s*$/)[0],i=n.slice(s.length,n.length-r.length);if(!i)return e;let o=[],l=0;return Qs(i,a=>{i[a]===","&&(o.push(i.slice(l,a)),l=a+1)}),o.push(i.slice(l)),s+o.map(a=>a.trim()&&hi(a.trim(),t)).join(", ")+r},Xs=e=>{let t="";for(let n=0;n<e.length;){let s=e[n];if(s==="/"&&e[n+1]==="*"){let r=e.indexOf("*/",n+2);n=r===-1?e.length:r+2}else if(s==='"'||s==="'"){let r=n+1;for(;r<e.length&&e[r]!==s;)r+=e[r]==="\\"?2:1;t+=e.slice(n,r+1),n=r+1}else s==="\\"?(t+=e.slice(n,n+2),n+=2):(t+=s,n++)}return t},mi=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,yi=/[a-z]/,Ei=e=>e.replace(mi,(t,n,s)=>yi.test(s)?`${n}${Le(s)}`:t),Ys=/^\s*@(media|supports|container|layer|scope|document)\b/i,Js=/^\s*@/,wi=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Js.test(s)?Ei(n):n,n=""},l=c=>{o(),t+=c,s+=c},a=(c,u)=>{o(),t+=c,s="",u!==void 0?r.push(u):c==="}"&&r.pop()};for(let c=0;c<e.length;){let u=e[c];if(u==="/"&&e[c+1]==="*"){let p=e.indexOf("*/",c+2),S=p===-1?e.length:p+2;l(e.slice(c,S)),c=S}else if(u==='"'||u==="'"){let p=c+1;for(;p<e.length&&e[p]!==u;)p+=e[p]==="\\"?2:1;l(e.slice(c,Math.min(p+1,e.length))),c=p+1}else u==="{"?(a("{",Ys.test(s)),c++):u==="}"||u===";"?(a(u),c++):(n+=u,s+=u,c++)}return o(),t},Si=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n="",s="",r=[],i=()=>r.length===0||r[r.length-1];for(let o=0;o<e.length;){let l=e[o],a=l;if(l==="/"&&e[o+1]==="*"){let c=e.indexOf("*/",o+2);a=e.slice(o,c===-1?e.length:c+2)}else if(l==='"'||l==="'"){let c=o+1;for(;c<e.length&&e[c]!==l;)c+=e[c]==="\\"?2:1;a=e.slice(o,c+1)}else l==="\\"&&(a=e.slice(o,o+2));if(o+=a.length,!i())n+=a,a==="{"?r.push(!1):a==="}"&&r.pop();else if(a==="{"){let c=Xs(s),u=Js.test(c);n+=(u?s:gi(s,t))+"{",r.push(u&&Ys.test(c)),s=""}else a==="}"||a===";"?(n+=s+a,s="",a==="}"&&r.pop()):s+=a}return n+s},Zt=e=>{let t=qn(e),s=new DOMParser().parseFromString(`<template>${t}</template>`,"text/html").querySelector("template"),r=[],i=[];Array.from(s.content.children).forEach(a=>{a.tagName==="TEMPLATE"?i.push(a):r.push(a)});let o=ps(r,e),l={};return i.forEach(a=>{let c=a.getAttribute("name");if(c===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!Hn.test(c)){console.warn(`jq79: <template name="${c}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(c in l){console.warn(`jq79: two <template name="${c}"> in one file; the second was ignored`);return}l[c]=new fe({...ps(Array.from(a.content.children),a.innerHTML),siblings:l,name:c})}),Object.keys(l).length&&(o.siblings=l),o},bi=/^(?:text|application)\/(?:x-)?typescript$/i,Ti=e=>"lang"in e?`lang="${e.lang}"`:bi.test(e.type?.trim()??"")?`type="${e.type}"`:null,ps=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let l={attrs:Rs(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(l):o.tagName==="STYLE"?s.push(l):r.push(Ns(o))}),n.forEach(o=>{let l=Ti(o.attrs);l&&console.warn(`jq79: <script ${l}> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its types were never stripped: the script will throw, or - for a plain \`let x: T = ...\` - silently fail to declare x.`)}),s.forEach(o=>{"lang"in o.attrs&&console.warn(`jq79: <style lang="${o.attrs.lang}"> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its styles were left uncompiled and the browser will ignore them.`)}),s.forEach(o=>{"lang"in o.attrs||(o.content=wi(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=fi(t);Zs(r,o),s.forEach(l=>{i(l)&&(l.scoped=Si(l.content,o))})}return Vs(r),{template:r,scripts:n,styles:s}},er=/\.html?([?#]|$)/,lt=e=>er.test(e)?tn(e):import(e),un=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,Qt=(e,t)=>{if(!un.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},$i=(e,t)=>e?`
18
- //# sourceURL=${e}?jq79-script=${t}`:"",tr=(e,t,n)=>{try{return rn(e,t,$i(n.filename,n.index??0))}catch(s){throw s instanceof Me?new Error(`jq79: safeEval() is on, and script ${n.index??0} of ${n.filename??"a component built from a string"} ${s.reason}. ${s.hint}`):s}},hs=e=>e.scoped??e.content,De=`:where([${qs}]) { display: contents }`,fn=()=>sn&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,at=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},pn=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},Xt=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},nt=null,Yt=null,Ri=()=>{if(fn()){pn(document,Yt??(Yt=at(De)));return}nt?.isConnected||(nt=document.createElement("style"),nt.textContent=De,document.head.appendChild(nt))},ct=new Map,xi=e=>{let t=ct.get(e);if(!t){if(fn()){let n=at(e);pn(document,n),t={sheet:n,count:0}}else{let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0}}ct.set(e,t)}t.count++},Ni=e=>{let t=ct.get(e);t&&--t.count<=0&&(t.sheet?Xt(document,t.sheet):t.el?.remove(),ct.delete(e))},vi=(e,t,n,s={},r=lt,i={})=>{let o={...cr,...s},l=new Proxy(t,{has:(u,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(u,p)||!(p in globalThis)&&!(p in o))}),a={},c=tr(Un(Object.keys(o)),zn(e),i)(l,n,r,a,...Object.values(o));return c.catch(u=>console.error("jq79: error in :setup script",u)),As(c),{settled:c,sync:a.done===!0}},gs=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:L(s,e))})},pt=e=>{let t=new Map;return n=>{if(t.has(n))return t.get(n);let s=e(n);return t.set(n,s),s}},nr=e=>(e?.forEach(t=>Object.freeze(t)),e&&Object.freeze(e),e),Pi=pt(_n),Jt=pt(e=>nr(Xe(e))),Ci=pt(e=>{let t=Ze(e);return Object.freeze(t.vars),Object.freeze(t)}),Mi=pt(e=>nr(Vn({attrs:{":setup":e},content:""}))),en=e=>{let t=e.attrs[":setup"],n=t===void 0?null:Mi(t);return!n&&e.attrs[":setup"]!==void 0&&Ai(e,e.attrs[":setup"]),n},ms=new WeakSet,Ai=(e,t)=>{t.trim()==="_"||ms.has(e)||(ms.add(e),console.warn(`jq79: :setup="${t}" is not a props pattern, so this component declares no signature and takes whatever a parent passes - write the props it takes ("{ a, b }"), a bare :setup for none, or "_" to stay open on purpose`))},ki=e=>{let t=null;return e.forEach(n=>{let s=Jt(n.content)??en(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},ys=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},Es=new WeakMap,Oi=(e,t,n,s)=>{if(s===null)return;let r=Es.get(e)??new Set;Es.set(e,r),n.forEach(i=>{s.has(i)||r.has(i)||(r.add(i),console.warn(`jq79: :${i} is not declared by <${t}> - add it to the :setup signature, or drop it`))})},_i=new Set([":value",":checked",":selected",":text",":html",":class"]),ws=new WeakSet,ji=(e,t,n,s)=>{if(s===null||ws.has(e))return;let r=n.filter(i=>s.has(i));r.length&&(ws.add(e),r.forEach(i=>console.warn(`jq79: :${i} on <${t}> is a directive, not a prop - <${t}> never receives its "${i}". Rename the prop (${r.map(o=>`:${o}`).join(", ")} are reserved on a component tag), or use :model for a value that goes both ways`)))},Li=(e,t)=>{if(!e)return null;let n=Object.create(null),s=!1;return Object.entries(e).forEach(([r,i])=>{t.has(r)||(n[r]=i,s=!0)}),s?n:null},sr=Symbol("jq79.unfilledProps"),dt=Symbol("jq79.pendingScripts"),Di=e=>e&&e.default!==void 0?e.default:e,Ii=(e,t,n,s={},r=lt,i={})=>{let o={...cr,...s},l={},a=tr(Kn(Object.keys(o)),Gn(e),i)(l,Di,r,...Object.values(o)),c=H=>console.error("jq79: error in factory script",H),u=!1,p,S=()=>{if(u)return p;u=!0;let H=l.default;if(typeof H!="function")return;let I=D=>{D&&typeof D=="object"&&Object.assign(t,D)};try{let D=H(t,{$data:t,$props:t,$effect:n,...s});D instanceof Promise?p=D.then(I).catch(c):I(D)}catch(D){c(D)}return p},M=a.then(S,c);return As(M),l.done&&S(),{settled:M,sync:l.done===!0&&p===void 0}},qi="__JQ79_HMR_ENABLED__",Hi="__JQ79_HMR__",$e=null,Wi=e=>{if(!$e||!e.filename)return;let t=$e.get(e.filename);t||$e.set(e.filename,t=new Set),t.add(new WeakRef(e))},Ft=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},Bi=(e,t)=>{if(!$e)return 0;let n=Ft(e),s=Zt(t);ee?.forEach((l,a)=>{Ft(a)===n&&ee.set(a,Promise.resolve(t))});let r=!1,i=l=>l.name===void 0?s:s.siblings?.[l.name]??null,o=0;for(let[l,a]of $e)if(Ft(l)===n){for(let c of a){let u=c.deref();if(!u){a.delete(c);continue}let p=i(u);if(!p){r=!0;continue}u.hotReplace(p)&&o++}a.size||$e.delete(l)}return r?0:o},Fi=()=>{$e??($e=new Map),globalThis[Hi]={update:Bi}},Ss=3e3,Ui=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${Ss/1e3}s for a :setup script and has rendered nothing. The template waits until every script returns or calls $mounted() - add an await $mounted() above the slow part to render first and fill in after.`)},Ss);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},rr=e=>{if(un.test(e))return e;let t=import.meta.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},ee=new Map,or=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},bs=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),ar?.then(()=>Xi(e))]).then(([t])=>t),ir=e=>{if(!ee)return bs(e);let t=or(e),n=ee.get(t);if(!n){n=bs(e),ee.set(t,n);let s=n;s.catch(()=>{ee?.get(t)===s&&ee.delete(t)})}return n},tn=async e=>{let t=rr(e),n=await ir(t);return new fe(n,{filename:t})},Ts=new WeakSet,$s=new Set,zi=e=>{if($s.has(e))return;$s.add(e);let t=document.createElement("link");t.rel="modulepreload";let n=on();n&&t.setAttribute("nonce",n),t.href=e,document.head.append(t)},Ki=/<script\b(?:"[^"]*"|'[^']*'|[^>"'])*>([\s\S]*?)<\/script\s*>/gi,ut=new Set,lr=(e,t,n)=>{for(let{spec:s,kind:r}of jn(e)){if(r==="component"&&n&&s in n)continue;let i=rr(r==="fetch"?s:Qt(s,r==="component"?t:void 0));r==="fetch"||er.test(i)?ee&&ir(i).then(o=>Gi(o,i),()=>{}):un.test(i)&&zi(i)}},Gi=(e,t)=>{let n=or(t);if(!ut.has(n)){ut.add(n);for(let[,s]of e.matchAll(Ki))lr(s,t,void 0)}},Vi=(e,t,n)=>{for(let s of e)Ts.has(s)||(Ts.add(s),lr(s.content,t,n))},ar,Zi="/jq79-sw.js",Qi=async e=>{let t=typeof navigator>"u"?void 0:navigator.serviceWorker;if(!t)throw new Error("jq79: safeEval() compiles components in a service worker, and this page can't have one - service workers need https (or localhost). Precompile with the jq79/vite plugin instead, or use safeEval({ nonce: true }) on a page whose server issues a nonce.");let n;try{n=await t.register(e)}catch(s){throw new Error(`jq79: safeEval() couldn't register its service worker at ${e} (${s.message}). Serve jq79-sw.js from the jq79 package at your site's root, or pass its URL: safeEval({ worker: "/path/jq79-sw.js" }).`)}await t.ready,!t.controller&&await new Promise(s=>{t.addEventListener("controllerchange",()=>s(),{once:!0}),t.controller?s():n.active?.postMessage("jq79:claim")})},Xi=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(Xn,""),new Promise((n,s)=>{let r=document.createElement("script"),i=on();i&&r.setAttribute("nonce",i),r.src=t.href,r.onload=()=>{r.remove(),n()},r.onerror=()=>{r.remove(),s(new Error(`jq79: the precompiled functions of ${e} did not load, and safeEval() can't render it without them`))},document.head.append(r)})},ue=class ue{constructor(t,n={}){k(this,"template");k(this,"scripts");k(this,"styles");k(this,"modules");k(this,"filename");k(this,"siblings");k(this,"name");k(this,"slots");k(this,"modelWriteback");k(this,"data",null);k(this,"fx",null);k(this,"content",null);k(this,"startMarker",null);k(this,"endMarker",null);k(this,"styleEls",[]);k(this,"shadowCss",null);k(this,"shadowSheets",[]);k(this,"sheetRoot",null);k(this,"ownsSharedStyles",!1);k(this,"useShadow",!1);k(this,"mountRoot",null);k(this,"resolveMounted",null);k(this,"renderDone",!1);k(this,"held",0);k(this,"onPaint",null);k(this,"destroyHooks",null);k(this,"attachHooks",null);k(this,"detachHooks",null);k(this,"onPage",!1);k(this,"emitListeners",new Map);let s=typeof t=="string"?Zt(t):t;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof t=="string"?void 0:t.modules),this.filename=n.filename??(typeof t=="string"?void 0:t.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),Wi(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([t,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[t]=n)})}hotReplace(t){let n=typeof t=="string"?Zt(t):t;ln.clear(),Te.clear(),Vt.clear();let s=this.startMarker,r=!!(s&&this.content),i=r&&s.isConnected,o=i?s.parentNode:null,l=i?this.endMarker.nextSibling:null,a={...this.data},c=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!r||(this.renderWith(a,c),!o)?!1:(c&&this.placeShadowStyles(o,l),o.insertBefore(this.content,l),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=de.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(de,s)?typeof r=="boolean"?de[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(de).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(de).join(", ")}`)}de.scopedNames!==n&&rt.clear()}return{...de}}static safeEval(t={}){sn=!0;let n=[];if(t.nonce){let r=on();r===void 0?n.push(Promise.reject(new Error("jq79: safeEval({ nonce: true }) found no nonce on this page - no <script> carries one. The nonce belongs on the script that loads the page, the one the CSP names."))):Kt=r}let s=t.worker??(t.nonce?!1:Zi);return s!==!1&&n.push(ar??(ar=Qi(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?(ee=null,ut.clear()):t===!0&&(ee??(ee=new Map)),!!ee}static clearCache(){ee?.clear(),ut.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new nn(tn(t))}static fetchAll(t){return Promise.all(t.map(tn))}static importAll(t){if(!Array.isArray(t))throw new TypeError("Component79.importAll takes an array; use import() for one");return Promise.all(t.map(n=>lt(Qt(n,void 0))))}on(t,n){return this.emitListeners.has(t)||this.emitListeners.set(t,new Set),this.emitListeners.get(t).add(n),this}off(t,n){return this.emitListeners.get(t)?.delete(n),this}render(t={}){return this.renderWith(t,!1)}renderShadow(t={}){return this.renderWith(t,!0)}renderWith(t,n){this.destroy();let s=Zn(this.scripts,en,Jt),r=Li(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(w=>!(w in t)));o.size&&Object.defineProperty(i,sr,{value:o}),this.slots&&Object.defineProperty(i,Is,{value:this.slots}),Object.defineProperty(i,dt,{value:{count:0,owner:this}});let l=ve(i),a=we(l);this.data=l,this.fx=a,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let c=this.startMarker,u=!1,p=(w,A)=>{w==="model:update"&&!u&&(u=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let v=new CustomEvent(w,{detail:A,bubbles:!0,composed:!0,cancelable:!0});return c===this.startMarker&&this.emitListeners.get(w)?.forEach(_=>_(v,A)),v.cancelBubble||c.dispatchEvent(v),!v.defaultPrevented},S,M=new Promise(w=>{S=w});this.resolveMounted=S,this.renderDone=!1,this.held=0;let H=w=>{if(typeof w!="function")throw new TypeError("jq79: $destroyed expects a function");return c!==this.startMarker?(Ce(w,"$destroyed"),()=>{}):Ut(this.destroyHooks??(this.destroyHooks=[]),w)},I=(w,{immediate:A=!0}={})=>{if(typeof w!="function")throw new TypeError("jq79: $attached expects a function");if(c!==this.startMarker)return()=>{};this.watchPage();let v=Ut(this.attachHooks??(this.attachHooks=[]),w);return A&&this.onPage&&Ce(w,"$attached"),v},D=w=>{if(typeof w!="function")throw new TypeError("jq79: $detached expects a function");return c!==this.startMarker?(Ce(w,"$detached"),()=>{}):(this.watchPage(),Ut(this.detachHooks??(this.detachHooks=[]),w))},R=w=>{let A=Rt(w);return H(()=>A.$dispose()),A},j=this.endMarker,O=(w=>{let A=[];for(let v=c.nextSibling;v&&v!==j;v=v.nextSibling)v instanceof Element&&(v.matches(w)&&A.push(v),A.push(...Array.from(v.querySelectorAll(w))));return A}),W=(w=>O(w)[0]??null),z=this.modules,G=w=>z&&w in z?Promise.resolve(z[w]):lt(Qt(w,this.filename)),X=w=>{if(!Array.isArray(w))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(w.map(G))},T=Object.assign(Object.create(null),{$emit:p,$updateModel:(...w)=>{let[A,v]=w.length>1?w:[void 0,w[0]];return c!==this.startMarker?!1:this.modelWriteback?.(A,v)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(w=>[w,!0]))}),N=[],q=!0;Vi(this.scripts,this.filename,this.modules),this.scripts.forEach((w,A)=>{let v;N.push(new Promise(b=>{v=b}));let _=!1,F=()=>{_=!0,v()},te={$mounted:()=>(F(),M),$destroyed:H,$attached:I,$detached:D,$computed:R,$self:W,$$self:O,...T,$importAll:X,...r},f={filename:this.filename,index:A},d=":mounted"in w.attrs,m=Pi(w.content),h=(()=>{if(m!==null){d&&console.warn("jq79: :mounted on a factory script renders the template before the factory has returned, so none of its bindings exist yet - await $mounted() inside the factory instead."),gs(l,Jt(w.content));let $=d?It(m):m;return Ii($,l,x=>a.effect(x),te,G,f)}let{vars:b,code:g}=Ci(w.content);gs(l,en(w)),b.forEach($=>{$ in l||(l[$]=void 0)});let E=d?It(g):g;return vi(E,l,$=>a.effect($),te,G,f)})();if(h.sync)h.settled.then(F,F);else{let b=i[dt];b.count++;let g=()=>{b.count--,F()};h.settled.then(g,g)}!h.sync&&!_&&(q=!1)});let B=document.createDocumentFragment(),K=new Proxy(l,{has:(w,A)=>typeof A=="string"&&A in T||Reflect.has(w,A),get:(w,A,v)=>typeof A=="string"&&A in T&&!Reflect.has(w,A)?T[A]:Reflect.get(w,A,v)});if(B.append(this.startMarker,this.endMarker),this.content=B,q?(this.endMarker.parentNode.insertBefore(Re(this.template,K,a,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(N).then(()=>{c===this.startMarker&&(this.endMarker.parentNode.insertBefore(Re(this.template,K,a,n),this.endMarker),this.renderDone=!0,this.settleMounted(),ue.settleAttached())}),Ui(this,N)),n)if(fn())this.shadowCss=[...this.styles.map(w=>w.content),De];else{let w=document.createElement("style");w.textContent=De,this.styleEls=[...this.styles.map(A=>{let v=document.createElement("style");return v.textContent=A.content,v}),w]}else this.styles.forEach(w=>xi(hs(w))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?ke(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(t,n){let s=typeof t=="string"?ke(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(t){this.mountRoot&&this.detach();let n=this.useShadow&&t instanceof Element?t.shadowRoot??t.attachShadow({mode:"open"}):t;return this.useShadow&&this.placeShadowStyles(n,null),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),ue.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){ge.has(this)||(ge.add(this),this.onPage=this.isOnPage(),this.onPage||ue.queueSettle())}static queueSettle(){zt||(zt=!0,queueMicrotask(()=>{zt=!1,ue.settleAttached()}))}static settleAttached(){if(ge.size===0)return;let t=[...ge].filter(n=>!n.onPage&&n.isOnPage());ue.inDocumentOrder(t).forEach(n=>{n.onPage||!ge.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>Ce(s,"$attached")))})}notifyDetached(){if(ge.size===0)return;let t=[];if(this.startMarker?.isConnected){let n=new Set;for(let r=this.startMarker;r&&(n.add(r),r!==this.endMarker);r=r.nextSibling);let s=r=>{for(;r;r=r.parentNode)if(n.has(r))return!0;return!1};t=ue.inDocumentOrder([...ge].filter(r=>r.onPage&&s(r.startMarker)))}else this.onPage&&(t=[this]);t.forEach(n=>{n.onPage&&(n.onPage=!1,n.detachHooks?.slice().forEach(s=>Ce(s,"$detached")))})}static inDocumentOrder(t){return t.sort((n,s)=>n.startMarker.compareDocumentPosition(s.startMarker)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}placeShadowStyles(t,n){if(this.shadowCss&&typeof ShadowRoot<"u"&&t instanceof ShadowRoot){this.sheetRoot&&this.sheetRoot!==t&&this.shadowSheets.forEach(s=>Xt(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===De?Yt??(Yt=at(s)):at(s))),this.shadowSheets.forEach(s=>pn(t,s)),this.sheetRoot=t;return}this.shadowCss&&this.styleEls.length===0&&(this.styleEls=this.shadowCss.map(s=>{let r=document.createElement("style");return r.textContent=s,r})),this.styleEls.forEach(s=>t.insertBefore(s,n))}settleMounted(){if(!this.renderDone||this.held>0)return;let t=this.onPaint;this.onPaint=null,t?.(),this.mountRoot&&this.resolveMounted?.()}holdOwner(t){this.renderDone&&this.held===0||(t.held++,this.onPaint=()=>{t.held--,t.settleMounted()})}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;this.notifyDetached();let t=this.startMarker;for(;t;){let n=t.nextSibling;if(this.content.appendChild(t),t===this.endMarker)break;t=n}return this.mountRoot=null,this}destroy(){this.notifyDetached(),ge.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>Ce(s,"$destroyed")),this.resolveMounted=null;let n=this.onPaint;return this.onPaint=null,n?.(),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(s=>s.parentNode?.removeChild(s)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(s=>{s!==Yt&&Xt(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>Ni(hs(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};k(ue,"version",lo);var fe=ue,nn=class{constructor(t){k(this,"chain");this.chain=t}queue(t){return this.chain=this.chain.then(n=>(t(n),n)),this}then(t,n){return this.chain.then(t,n)}catch(t){return this.chain.catch(t)}finally(t){return this.chain.finally(t)}mount(t,n){return this.queue(s=>s.mount(t,n))}mountShadow(t,n){return this.queue(s=>s.mountShadow(t,n))}render(t={}){return this.queue(n=>n.render(t))}renderShadow(t={}){return this.queue(n=>n.renderShadow(t))}on(t,n){return this.queue(s=>s.on(t,n))}off(t,n){return this.queue(s=>s.off(t,n))}detach(){return this.queue(t=>t.detach())}destroy(){return this.queue(t=>t.destroy())}};var dl=e=>new fe(e),Ce=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},Ut=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),ge=new Set,zt=!1,cr={$:ke,$$:gt,$create:mt,$reactive:ve,$toRaw:Q,$batch:We,Component79:fe,C79:fe};typeof globalThis<"u"&&globalThis[qi]&&Fi();export{ke as $,gt as $$,We as $batch,Rt as $computed,mt as $create,ve as $reactive,Q as $toRaw,fe as C79,fe as Component79,nn as PendingComponent79,Fi as enableHotReload,Bi as hotUpdate,dl as parseComponent,cl as renderComponent};
17
+ }`;var So="0.8.0",Hs=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),qs="http://www.w3.org/1999/xhtml",Fs=e=>{let t=Hs(e),n=e.namespaceURI,s=t[Le];delete t[Le];let r=n!==null&&n!==qs;return{tag:r?e.tagName:e.tagName.toLowerCase(),attrs:t,...s===void 0?{}:{component:s},...r?{ns:n}:{},children:Array.from((e instanceof HTMLTemplateElement?e.content:e).childNodes).flatMap(l=>{if(l.nodeType===Node.TEXT_NODE){let o=l.textContent??"";return o?[o]:[]}return l.nodeType===Node.ELEMENT_NODE?[Fs(l)]:[]})}},dt=new Map,ct=new Map,fn=!1,Jt,Me=class extends Error{constructor(n,s){super(`${n}. ${s}`);A(this,"reason",n);A(this,"hint",s)}},bo=()=>new Me("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),$o=(e,t)=>{let n=globalThis[as];if(Array.isArray(n)&&n.length>0)for(let[s,r,l]of n.splice(0))ct.set(it(s,r),l);return ct.size===0?void 0:ct.get(it(e,t))},wt=(e,t,n="")=>{let s=$o(e,t);if(s===null)throw new SyntaxError("jq79: this code did not compile when it was precompiled");if(s!==void 0)return s;if(Jt!==void 0)return To(e,t,n,Jt);if(fn)throw bo();return new Function(...e,t+n)},pn=()=>{if(!(typeof document>"u"))for(let e of Array.from(document.querySelectorAll("script[nonce]"))){let t=e.nonce||e.getAttribute("nonce");if(t)return t}},us="__jq79built",To=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${us} = ${ds(e,t)}${n}`;let l,o=a=>{l=a.error??new SyntaxError(a.message),a.preventDefault()};window.addEventListener("error",o);try{(document.head??document.documentElement).append(r)}finally{window.removeEventListener("error",o),r.remove()}let i=r[us];if(typeof i=="function")return ct.set(it(e,t),i),i;throw l!==void 0?l:new Me("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},fs=new Set,Ro=(e,t)=>{fs.has(e)||(fs.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},Ce=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},Ws=(e,t)=>{try{return wt([...Kt,...t],es(e))}catch(n){return n instanceof Me&&Ro(e,n),null}},xo=(e,t)=>{if(!X.scopedNames)return null;let n=ts(e,t);if(n===null)return null;try{return wt([...Kt,...t],n)}catch{return null}},hn=(e,t,n)=>{let s=dt.get(e);if(s===void 0){let r=xo(t,n);s=r?{fn:r,scoped:!0}:{fn:Ws(t,n),scoped:!1},dt.set(e,s)}return s},Ie=(e,t)=>`${t.join(",")}|${e}`,No=(e,t)=>hn(Ie(e,t),e,t).fn,Bs=(e,t,n)=>{let s=Ws(t,n);return dt.set(e,{fn:s,scoped:!1}),s},vo=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,Po=100,be=new Map,gn=new Set,ut=0,en=!1,tn=new Set,ko=()=>{en=!1,!(ut>0)&&(be.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(gn.add(s),console.warn(`jq79: ${e} is not defined - evaluating "${t}". Template expressions resolve against the component store: a top-level let/var/const in a :setup script, a declared prop, or a global. Note a "function name() {}" declaration is not on the store - write "const name = () => {}".`))}),be.clear())},Us=()=>{en||ut>0||!be.size||(en=!0,queueMicrotask(ko))},Ks=e=>{ut++;let t=()=>{ut--,Us()};e.then(t,t)},Co=(e,t)=>{if(tn.has(e))return;tn.add(e);let n=t?.message||String(t);console.error(`jq79: ${n} - evaluating "${e}". The expression rendered as nothing. If the value arrives later, guard it - "a?.b", or :if on the element.`)},mn=(e,t,n)=>{if(!(n instanceof ReferenceError))return Co(e,n);let s=vo.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let l=`${r}|${e}`;gn.has(l)||be.has(l)||be.size>=Po||(be.set(l,{name:r,expr:e,scope:t}),Us())},zs=(e,t,n)=>{let s=n?Object.keys(n):[],r=Ie(e,s),{fn:l,scoped:o}=hn(r,e,s);if(!l)return;let i=n?Object.values(n):[];if(!o)return l(t,Ce,...i);try{return l(t,Ce,...i)}catch(a){if(!(a instanceof ReferenceError))throw a;let c=Bs(r,e,s);if(!c)throw a;return c(t,Ce,...i)}},He=[],Mo=(e,t,n)=>{try{let{fn:s,scoped:r}=hn(e,t,He);if(!s)return;if(!r)return s(n,Ce);try{return s(n,Ce)}catch(l){if(!(l instanceof ReferenceError))throw l;let o=Bs(e,t,He);if(!o)throw l;return o(n,Ce)}}catch(s){mn(t,n,s);return}},j=(e,t,n)=>{try{return zs(e,t,n)}catch(s){mn(e,t,s);return}},Gs=(e,t,n)=>{try{return zs(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;mn(e,t,s);return}},nn=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(j(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(j(s.expr,t)??"");return n},yn=(e,t,n,s)=>{if(!X.cachedSetters){s.effect(()=>{let l=nn(t,n);e.textContent!==l&&(e.textContent=l)});return}let r=e.data;s.effect(()=>{let l=nn(t,n);l!==r&&(e.data=r=l)})},ps=new Map,Ao=e=>{if(!X.cachedSetters)return rt(e);let t=ps.get(e);return t||ps.set(e,t=rt(e)),t},hs=(e,t,n,s)=>{let r=Gs(t,n,{$event:s});typeof r=="function"&&r.call(e,s)},En=(e,t,n,s)=>{let[r,...l]=t.slice(1).split("."),o=new Set(l);e.addEventListener(r,i=>{o.has("self")&&i.target!==e||(o.has("prevent")&&i.preventDefault(),o.has("stop")&&i.stopPropagation(),X.batchHandlers?Ne(()=>hs(e,n,s,i)):hs(e,n,s,i))},{once:o.has("once"),capture:o.has("capture")})},Oo=(e,t,n,s)=>{let[r,...l]=t.slice(1).split("."),o=new Set(l),i=a=>{o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation(),o.has("once")&&e.off(r,i);let c=()=>{let d=Gs(n,s,{$event:a});typeof d=="function"&&d(a)};xe(X.batchHandlers?()=>Ne(c):c)};e.on(r,i)},wn=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},St=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},_o=e=>{e.forEach(t=>{if(t.first===t.last)return St(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},jo=(e,t)=>{let n=[],s=null;return e.forEach(r=>{if(!t(r)){s=null;return}s&&s.last.nextSibling===r.range.first?s.last=r.range.last:n.push(s={first:r.range.first,last:r.range.last})}),n},Lo=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let l=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=l}},gs=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Se=null,ft=null,Vs=new WeakSet,Do=e=>{let t={memo:Se,base:ft};return Se=new Map,ft=e,t},Io=e=>{Se=e.memo,ft=e.base},ms=(e,t)=>e.component!==void 0?ys(t,e.component):e.tag.includes("-")?ys(t,e.tag):null,ee=e=>e.component??e.tag,ys=(e,t)=>{if(!Se)return gs(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===ft){if(Se.has(t))return Se.get(t);let r=gs(s,t);return Se.set(t,r),r}if(!Vs.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Ho=e=>{let t=new Set;for(let n=e;n&&n!==Object.prototype;n=Object.getPrototypeOf(n))for(let s of Object.keys(n))/^[A-Z]/.test(s)&&t.add(s);return[...t].sort()},qo=(e,t)=>{let n=Ho(t);return new Error(`jq79: <${e}> is not defined - no component of that name is in scope, and nothing renders here. Import it in a :setup script, declare it as a prop, or add a <template name="${e}"> to this file. In scope: ${n.length?n.join(", "):"(none)"}.`)},Es=100,Gt=0,Zs=Symbol("jq79.slots"),Fe=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Fo=e=>e==="default"?":slot":`:slot.${e}`,Wo=e=>typeof e!="string"||e.trim()!=="",Bo=e=>{let t={},n=[];e.children.forEach(r=>{let l=typeof r=="object"&&r.tag==="template"?Fe(r):void 0;if(typeof r=="string"||l===void 0){n.push(r);return}let o=Bt(l.slice(6));if(o in t){console.warn(`jq79: two <template ${Fo(o)}> in <${ee(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[l]||void 0}});let s=n.some(Wo);return s&&"default"in t?console.warn(`jq79: <${ee(e)}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(t.default={nodes:n,binder:e.attrs[":slot"]||void 0}),t},Uo=(e,t,n)=>{je(t)?.forEach(({name:s,as:r,default:l})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let i=n[s]?.();return i===void 0&&l!==void 0?j(l,e):i},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},Ko=e=>{let t=Fe(e);return console.warn(`jq79: <template ${t}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${t}`)},zo=(e,t)=>{let n=Object.entries(Bo(e));if(!n.length)return null;let s={};return n.forEach(([r,l])=>{s[r]=Go(l,t)}),s},Go=(e,t)=>(n,s,r,l)=>{let o=Object.create(t);Uo(o,e.binder,n);let i=o[Ge]??[];Object.defineProperty(o,Ge,{value:[...i,s]});let a=Ee(o);return a.ownedBy(s),r.onDispose(()=>a.dispose()),Te(e.nodes,o,a,l)},Vo=(e,t,n,s)=>{let r=Bt(e.tag.slice(5)),l=document.createDocumentFragment(),o=document.createComment(e.tag),i=document.createComment(`/${e.tag}`);l.append(o,i);let a=t[Zs]?.[r];if(!a)return l.insertBefore(Te(e.children,t,n,s),i),l;let c={};return Object.entries(e.attrs).forEach(([d,p])=>{if(!(d===Ae||we(d)||d.startsWith("@")))if(d.startsWith(":")){let b=p||d.slice(1);c[ce(d.slice(1))]=()=>j(b,t)}else c[ce(d)]=()=>p}),l.insertBefore(a(c,t,n,s),i),l},Qs="data-c79-box",Zo=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(De(e));s.setAttribute(Qs,"");let r=t.attrs[Ae];return r!==void 0&&s.setAttribute(Ae,r),n||Wi(),s},ws=new WeakSet,Qo=(e,t)=>{if(e.ns===void 0||ws.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;ws.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${ee(e)}> is used inside ${s} and its template starts with <${n.tag.toLowerCase()}>, which is parsed as HTML - it renders and never draws. A component's template decides its own namespace, so root it at ${s}`)},Ss=(e,t,n,s,r)=>{let l=Zo(e,t,r),o=!(l instanceof DocumentFragment),i=o?null:document.createComment(`/${e}`);o||l.append(document.createComment(e),i);let a=zo(t,n),c={},d={},p=[],b=[],C=!1,O;Object.entries(t.attrs).forEach(([y,$])=>{if(y!==Ae){if(y===":props"||y.startsWith(":props.")){C=!0,b.push({expr:$});return}if(we(y)){Yi.has(y)&&(O??(O=[])).push(y.slice(1));return}if(y.startsWith("@"))p.push([y,$]);else if(y===":model"||y.startsWith(":model.")){let N=y===":model"?"default":ce(y.slice(7));d[N]=$||(y===":model"?"model":N)}else if(y.startsWith(":")){let N=ce(y.slice(1));c[N]=$||N,b.push({name:N,expr:$||N})}else{let N=ce(y),q=JSON.stringify($);c[N]=q,b.push({name:N,expr:q})}}});let D=y=>y==="default"?":model":`:model.${y}`,L=y=>y==="default"?"model":y,x=new Set;Object.entries(d).forEach(([y,$])=>{let N=L(y);c[N]!==void 0&&console.warn(`jq79: <${ee(t)}> binds prop "${N}" through both :${N} and ${D(y)} - ${D(y)} wins`),c[N]=$,No(Ut($),["$value"])===null&&(x.add(y),console.warn(`jq79: ${D(y)}="${$}" is not assignable - updates from <${ee(t)}> will be dropped`))});let I=()=>{let y={};return b.forEach(({name:$,expr:N})=>{if($!==void 0)y[$]=j(N,n);else{let q=j(N,n);q!==null&&typeof q=="object"&&Object.assign(y,q)}}),Object.entries(d).forEach(([$,N])=>{y[L($)]=j(N,n)}),y},H=null,K=null,G=null,z=new Set,J=y=>{if(y==null){if(!n[gr]?.has(e)||z.has("unfilled"))return;z.add("unfilled"),console.error(`jq79: <${ee(t)}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${e}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}z.has("type")||(z.add("type"),console.error(`jq79: <${ee(t)}> is ${typeof y}, not a component - nothing renders here`))};return s.effect(()=>{let y=j(e,n),$=y instanceof pe?y:null;if($||J(y),$===K||(G?.dispose(),G=null,H?.destroy(),H=null,K=$,!$))return;Qo(t,$);let N=new pe({template:$.template,scripts:$.scripts,styles:$.styles,modules:$.modules,filename:$.filename,siblings:$.siblings,name:$.name});if(a&&(N.slots=a),Object.keys(d).length){let P=new Set;N.modelWriteback=(_,B)=>{let V=_==null?"default":ce(String(_)),ne=d[V];return ne===void 0?(P.has(V)||(P.add(V),console.warn(`jq79: <${ee(t)}> has no ${D(V)} - bound: ${Object.keys(d).map(D).join(", ")}`)),!1):x.has(V)?!1:(xe(()=>j(Ut(ne),n,{$value:B})),!0)}}p.forEach(([P,_])=>Oo(N,P,_,n));let q=Qi(N.scripts);Xi(t,e,Object.keys(c),q),O&&Ji(t,e,O,q);let W=As(xe(I),q),U=document.createDocumentFragment();if(Gt>=Es){console.error(`jq79: <${ee(t)}> is ${Es} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Gt++;try{(r?N.renderShadow(W):N.render(W)).mount(U)}finally{Gt--}let w=n[yt];w&&N.holdOwner(w.owner),i?i.parentNode.insertBefore(U,i):l.appendChild(U);let M=Ee(n,!0);if(C){let P=[];M.effect(()=>{let _=As(I(),q),B=Object.keys(_);P.forEach(V=>{V in _||(N.data[V]=void 0)}),B.forEach(V=>{N.data[V]=_[V]}),P=B})}else Object.entries(c).forEach(([P,_])=>{q!==null&&!q.has(P)||M.effect(()=>{N.data[P]=j(_,n)})});G=M,H=N}),s.onDispose(()=>{G?.dispose(),H?.destroy()}),l},Xo=(e,t)=>{let n=()=>{let s=j(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let l=n();return l!==null&&Reflect.has(l,r)||Reflect.has(s,r)},get(s,r){let l=n();return l!==null&&Reflect.has(l,r)?l[r]:Reflect.get(s,r)},set(s,r,l){let o=n();return o!==null&&Reflect.has(o,r)?(o[r]=l,!0):Reflect.set(s,r,l)}})},pt=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(pt):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?pt(t):[]):[],We=(e,t)=>{if(typeof e=="string"){if(e&&!/\s/.test(e))t.push(e);else if(e)for(let n of e.split(/\s+/))n&&t.push(n)}else if(Array.isArray(e))for(let n of e)We(n,t);else if(e!==null&&typeof e=="object")for(let n in e)e[n]&&We(n,t)},Xs=(e,t)=>{if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0},Ys=(e,t,n,s,r,l)=>{let o=[];l.effect(()=>{let i=[];if(t!==void 0&&We(j(t,r),i),n)for(let[a,c]of n)j(c,r)&&We(a,i);if(!X.cachedSetters)o.forEach(a=>{!i.includes(a)&&!s.has(a)&&e.classList.remove(a)}),e.classList.add(...i);else if(!Xs(o,i)){for(let a of o)!i.includes(a)&&!s.has(a)&&e.classList.remove(a);for(let a of i)o.includes(a)||e.classList.add(a)}o=i})},Yo=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Pn(e):()=>!1,Jo=new Set(["allowfullscreen","async","autofocus","autoplay","checked","controls","default","defer","disabled","formnovalidate","inert","ismap","itemscope","loop","multiple","muted","nomodule","novalidate","open","playsinline","readonly","required","reversed","selected"]),Sn=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),ei={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},bs=new Map,ti=(e,t)=>{let n=`${e} ${t}`,s=bs.get(n);if(s!==void 0)return s;let r=ei[e],l=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,i]=r;l=new DOMParser().parseFromString(`<${o}><${i} ${t}="x"/></${o}>`,"text/html").querySelector(i)?.getAttributeNames().find(c=>c.toLowerCase()===t)??t}return bs.set(n,l),l},Js=(e,t)=>{let n=e.namespaceURI;if(n===null||n===qs)return t;let s=t.replace(/-/g,"").toLowerCase(),r=ti(n,s);return r===s?t:r},bn=(e,t,n)=>{let s=Jo.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},X={cloneSkeletons:!0,scopedNames:!0,batchHandlers:!0,cachedSetters:!0,compileSkeletons:!0},ni=new Set([":text",":html",":value",":checked",":selected"]),si=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||ni.has(e)?!0:e.startsWith(":")?e===":model"?!1:!we(e)&&!e.includes("."):e!==Le,er=e=>{if(e.component||e.tag.includes("-")||ot(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!si(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||er(t))},tr=(e,t,n)=>{let s=Sn(e),r,l=null;for(let p in e.attrs){let b=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:b});else if(p===":class")r=b;else if(p.startsWith(":class."))(l??(l=[])).push([p.slice(7),b]);else if(!we(p))if(p.startsWith(":")){let C=p.slice(1);n.push({kind:"attr",path:t,name:Js(s,C),expr:b||ce(C)})}else s.setAttribute(p,b)}(r!==void 0||l)&&n.push({kind:"class",path:t,classExpr:r,toggles:l,staticClasses:new Set(pt(e.attrs.class??""))});let o=e.attrs[":text"],i=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):i!==void 0?n.push({kind:"html",path:t,expr:i}):e.children.forEach((p,b)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,b],parts:rt(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(tr(p,[...t,b],n))});let a=e.attrs[":value"];a!==void 0&&n.push({kind:"value",path:t,expr:a});let c=e.attrs[":checked"];c!==void 0&&n.push({kind:"checked",path:t,expr:c});let d=e.attrs[":selected"];return d!==void 0&&n.push({kind:"selected",path:t,expr:d}),s},ri=3,nr=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:nr(n)),0),$s=new WeakMap,Ts=new WeakSet,oi=e=>{let t=$s.get(e);if(t!==void 0)return t;if(!Ts.has(e))return Ts.add(e),null;let n=null;if(er(e)&&nr(e)>=ri){let s=[];n={skeleton:tr(e,[],s),ops:s}}return $s.set(e,n),n},ii=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},li=["r","s","fx","o","K","h"],ai={ev:Mo,evalExpr:j,bindText:yn,bindEvent:En,renderText:nn,bindClassNames:(e,t,n,s)=>{for(let r of t)!n.includes(r)&&!s.has(r)&&e.classList.remove(r);for(let r of n)t.includes(r)||e.classList.add(r)},collectClassNames:(e,t)=>We(e,t),sameNames:(e,t)=>Xs(e,t),applyAttr:(e,t,n)=>bn(e,t,n),sanitizeHTML:e=>Be(e)},Rs=new Map,ci=e=>{let t=[],n=new Map([["","r"]]),s=0,r=o=>{let i=o.join("."),a=n.get(i);if(a)return a;let c=o.slice(0,-1),d=o[o.length-1],p=`${r(c)}.firstChild`,b=d;for(let O=d-1;O>=0;O--){let D=n.get([...c,O].join("."));if(D){p=D,b=d-O;break}}for(let O=0;O<b;O++)p+=".nextSibling";let C=`n${s++}`;return t.push(`const ${C} = ${p}`),n.set(i,C),C},l=(o,i)=>t.push(`{ ${o}; fx.effect(() => { ${i} }) }`);return e.forEach((o,i)=>{let a=r(o.path),c=`o[${i}]`;if(o.kind==="text"){let[d]=o.parts;o.parts.length===1&&typeof d!="string"?l(`const t${i} = ${a}, e${i} = ${c}.parts[0].expr, k${i} = K[${i}]; let last${i} = t${i}.data`,`{ const v = h.ev(k${i}, e${i}, s); const x = v == null ? "" : String(v); if (x !== last${i}) t${i}.data = last${i} = x }`):l(`const t${i} = ${a}, p${i} = ${c}.parts; let last${i} = t${i}.data`,`{ const x = h.renderText(p${i}, s); if (x !== last${i}) t${i}.data = last${i} = x }`)}else if(o.kind==="event")t.push(`h.bindEvent(${a}, ${c}.attr, ${c}.expr, s)`);else if(o.kind==="attr")l(`const el${i} = ${a}, c${i} = ${c}`,`h.applyAttr(el${i}, c${i}.name, h.ev(K[${i}], c${i}.expr, s))`);else if(o.kind==="class")l(`const el${i} = ${a}, c${i} = ${c}, k${i} = K[${i}]; let b${i} = []`,`{ const next = []; if (c${i}.classExpr !== undefined) h.collectClassNames(h.ev(k${i}, c${i}.classExpr, s), next); if (c${i}.toggles) for (const [n, e] of c${i}.toggles) if (h.evalExpr(e, s)) h.collectClassNames(n, next); if (!h.sameNames(b${i}, next)) h.bindClassNames(el${i}, b${i}, next, c${i}.staticClasses); b${i} = next }`);else if(o.kind==="textContent")l(`const el${i} = ${a}, c${i} = ${c}`,`{ const x = String(h.ev(K[${i}], c${i}.expr, s) ?? ""); if (el${i}.textContent !== x) el${i}.textContent = x }`);else if(o.kind==="html")l(`const el${i} = ${a}, c${i} = ${c}`,`el${i}.innerHTML = h.sanitizeHTML(String(h.ev(K[${i}], c${i}.expr, s) ?? ""))`);else if(o.kind==="value")l(`const el${i} = ${a}, c${i} = ${c}`,`{ const x = String(h.ev(K[${i}], c${i}.expr, s) ?? ""); if (el${i}.value !== x) el${i}.value = x }`);else if(o.kind==="checked")l(`const el${i} = ${a}, c${i} = ${c}`,`{ const x = !!h.ev(K[${i}], c${i}.expr, s); if (el${i}.checked !== x) el${i}.checked = x }`);else if(o.kind==="selected")l(`const el${i} = ${a}, c${i} = ${c}`,`{ const x = !!h.ev(K[${i}], c${i}.expr, s); if (el${i}.selected !== x) el${i}.selected = x }`);else{let d=o}}),`"use strict"
18
+ ${t.join(`
19
+ `)}`},di=e=>e.map(t=>{if(t.kind==="text"){let[n]=t.parts;return t.parts.length===1&&typeof n!="string"?Ie(n.expr,He):""}return t.kind==="class"?t.classExpr!==void 0?Ie(t.classExpr,He):"":t.kind==="event"?"":Ie(t.expr,He)}),ui=e=>{let t=ci(e.ops),n=Rs.get(t);if(n===void 0){try{n=wt(li,t)}catch{return null}Rs.set(t,n)}return e.keys=di(e.ops),n},fi=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);if(X.compileSkeletons&&X.cachedSetters&&(e.factory===void 0&&(e.factory=ui(e)),e.factory))return e.factory(s,t,n,e.ops,e.keys,ai),s;for(let r of e.ops){let l=r.path.length===0?s:ii(s,r.path);if(r.kind==="text")yn(l,r.parts,t,n);else if(r.kind==="event")En(l,r.attr,r.expr,t);else if(r.kind==="attr"){let o=l,{name:i,expr:a}=r;n.effect(()=>bn(o,i,j(a,t)))}else if(r.kind==="class")Ys(l,r.classExpr,r.toggles,r.staticClasses,t,n);else if(r.kind==="textContent"){let o=l,{expr:i}=r;n.effect(()=>{let a=String(j(i,t)??"");o.textContent!==a&&(o.textContent=a)})}else if(r.kind==="html"){let o=l,{expr:i}=r;n.effect(()=>{o.innerHTML=Be(String(j(i,t)??""))})}else if(r.kind==="value"){let o=l,{expr:i}=r;n.effect(()=>{let a=String(j(i,t)??"");o.value!==a&&(o.value=a)})}else if(r.kind==="checked"){let o=l,{expr:i}=r;n.effect(()=>{let a=!!j(i,t);o.checked!==a&&(o.checked=a)})}else if(r.kind==="selected"){let o=l,{expr:i}=r;n.effect(()=>{let a=!!j(i,t);o.selected!==a&&(o.selected=a)})}else{let o=r}}return s},$n=(e,t,n,s)=>{let r=e.attrs[":with"],l=r!==void 0?Xo(r,t):t;if(ot(e.tag))return Vo(e,l,n,s);if(e.tag==="template"&&Fe(e)!==void 0)return Ko(e);let o=ms(e,l);if(o)return Ss(o,e,l,n,s);if(X.cloneSkeletons){let x=oi(e);if(x)return fi(x,l,n)}let i=Sn(e);if(e.component!==void 0&&l[yt]?.count===0)throw qo(e.component,l);let a=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(a){let x=!1;n.effect(()=>{if(x)return;let I=ms(e,l);if(!I)return;x=!0;let H=Ss(I,e,l,n,s),K=wn(H);n.onDispose(()=>St(K)),i.replaceWith(H)})}for(let x in e.attrs){let I=e.attrs[x];if(x.startsWith("@"))En(i,x,I,l);else if(x===":model"||x.startsWith(":model."))a||console.warn(`jq79: ${x} on <${ee(e)}> does nothing - :model binds component tags only (for now)`);else if(!we(x))if(x.startsWith(":"))if(a)i.setAttribute(x,I);else{let H=x.slice(1),K=I||ce(H),G=Js(i,H);n.effect(()=>bn(i,G,j(K,l)))}else i.setAttribute(x,I)}let c=e.attrs[":class"],d=null;for(let x in e.attrs)x.startsWith(":class.")&&(d??(d=[])).push([x.slice(7),e.attrs[x]]);(c!==void 0||d)&&Ys(i,c,d,new Set(pt(e.attrs.class??"")),l,n);let p=e.attrs[":text"],b=e.attrs[":html"],C=e.attrs[":html.allowed"];C!==void 0&&b===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let x=String(j(p,l)??"");i.textContent!==x&&(i.textContent=x)}):b!==void 0?n.effect(()=>{let x=C!==void 0?{allowUrl:Yo(j(C,l))}:void 0;i.innerHTML=Be(String(j(b,l)??""),x)}):i instanceof HTMLTemplateElement?Te(e.children,l,n,s,i.content):Te(e.children,l,n,s,i);let O=e.attrs[":value"];O!==void 0&&n.effect(()=>{let x=String(j(O,l)??"");i.value!==x&&(i.value=x)});let D=e.attrs[":checked"];D!==void 0&&n.effect(()=>{let x=!!j(D,l);i.checked!==x&&(i.checked=x)});let L=e.attrs[":selected"];return L!==void 0&&n.effect(()=>{let x=!!j(L,l);i.selected!==x&&(i.selected=x)}),i},pi=(e,t,n,s)=>{let r=document.createComment("if"),l=document.createDocumentFragment();l.appendChild(r);let o=null,i=null,a=null;return n.effect(()=>{let c=e.find(p=>p.expr===void 0||j(p.expr,t))??null;if(c===i||(a?.dispose(),o&&St(o),o=null,i=c,!c))return;a=Ee(t);let d=$n(c.node,t,a,s);o=wn(d),r.parentNode.insertBefore(d,r.nextSibling)}),n.onDispose(()=>a?.dispose()),l},Pe=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},hi=e=>{let t=new Uint8Array(e.length),n=[],s=new Int32Array(e.length).fill(-1);for(let r=0;r<e.length;r++){let l=e[r];if(l<0)continue;let o=0,i=n.length;for(;o<i;){let a=o+i>>1;e[n[a]]<l?o=a+1:i=a}o>0&&(s[r]=n[o-1]),n[o]=r}for(let r=n.length?n[n.length-1]:-1;r!==-1;r=s[r])t[r]=1;return t},gi=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},sr=(e,t)=>typeof e=="string"?t.some(n=>Ns(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Ns(n,s)))||e.children.some(n=>sr(n,t)),rr=e=>typeof e!="string"&&(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs||":each"in e.attrs||e.component!==void 0||e.tag.includes("-")||ot(e.tag)||e.children.some(rr)),xs=/[A-Za-z0-9_$]/,mi=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Ns=(e,t)=>{for(let n=e.indexOf(t);n!==-1;n=e.indexOf(t,n+1)){let s=n===0?"":e[n-1],r=e[n+t.length]??"";if(!xs.test(s)&&!xs.test(r))return!0}return!1},Vt=new WeakMap,yi=e=>{let t=Vt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Jn);if(!n)return Vt.set(e,null),null;let[,s,r,l]=n,o=e.attrs[":key"],i=o===s,a=o!==void 0&&!i&&mi.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:c,[":key"]:d,[":window"]:p,...b}=e.attrs,C={...e,attrs:b},O=["$index",...r?[r]:[]],D=sr(C,O),L=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),x=o!==void 0&&rr(C),I={itemName:s,atName:r,listExpr:l,keyExpr:o,keyIsItem:i,keyProp:a,itemNode:C,readsPosition:D,namesComponent:L,nestsScopes:x,windowExpr:p};return Vt.set(e,I),I},lt=8,Ei=/^(auto|scroll|overlay)$/,wi=e=>{for(let t=e;t;t=t instanceof ShadowRoot?t.host:t.parentNode)if(!(!(t instanceof HTMLElement)||t===document.body||t===document.documentElement)&&Ei.test(getComputedStyle(t).overflowY))return t;return null},Si=(e,t,n,s,r)=>{let l=()=>{let y=e.component!==void 0||e.tag.includes("-")?document.createElement("div"):Sn(e);return y.setAttribute("aria-hidden","true"),y.setAttribute("style","height: 0px; margin: 0; padding: 0; border: 0; list-style: none; visibility: hidden"),y},o=l(),i=l(),a=ve({start:0,count:-1}),c=0,d=0,p=null,b=!1,C=0,O=null,D=null,L=y=>Math.ceil(y/c)+1+2*lt,x=(y,$)=>{y=Math.max(0,Math.min(y,Math.max(0,d-$))),(a.start!==y||a.count!==$)&&Ne(()=>{a.start=y,a.count=$})},I=()=>{let y=o.getBoundingClientRect().top;if(p){let $=p.getBoundingClientRect(),N=p.scrollTop;return{listTop:y-$.top-p.clientTop+N,scrollTop:N,height:p.clientHeight||window.innerHeight}}return{listTop:y+window.scrollY,scrollTop:window.scrollY,height:window.innerHeight}},H=()=>{if(C=0,!(c>0)||!o.isConnected)return;let{listTop:y,scrollTop:$,height:N}=I();x(Math.floor(($-y)/c)-lt,L(N))},K=()=>{C||(C=typeof requestAnimationFrame=="function"?requestAnimationFrame(H):setTimeout(H,16))},G=(y,{block:$="nearest"}={})=>{if(z(),c>0&&o.isConnected){let{listTop:W,scrollTop:U,height:w}=I(),M=W+y*c,P=M+c,_=U;$==="start"?_=M:$==="end"?_=P-w:$==="center"?_=M-(w-c)/2:M<U?_=M:P>U+w&&(_=P-w),_!==U&&(p?p.scrollTop=_:window.scrollTo(window.scrollX,_)),H()}let N=a.count>0?a.count:L(window.innerHeight||800);(y<a.start||y>=a.start+N)&&x(y-lt,N);let q=r().find(W=>W.scope.$index===y);return q?q.range.first:null},z=()=>{b||!o.isConnected||(b=!0,D=o.parentElement,p=wi(o.parentNode),(p??window).addEventListener("scroll",K,{passive:!0}),window.addEventListener("resize",K),p&&typeof ResizeObserver=="function"&&(O=new ResizeObserver(K),O.observe(p)),D&&Object.defineProperty(D,"$scrollTo",{value:G,configurable:!0,writable:!0}),H())};s.onDispose(()=>{C&&(typeof cancelAnimationFrame=="function"?cancelAnimationFrame:clearTimeout)(C),b&&((p??window).removeEventListener("scroll",K),window.removeEventListener("resize",K),O?.disconnect(),D&&D.$scrollTo===G&&delete D.$scrollTo)});let J=!1;return{top:o,bottom:i,range:y=>{d=y;let $=Number(j(t,n)),N=c;if(c=$>0?$:0,c&&c!==N&&b&&o.isConnected){let{listTop:w,scrollTop:M,height:P}=I(),_=Q(a);_.count=L(P),_.start=Math.max(0,Math.floor((M-w)/c)-lt)}if(!c)return o.style.height=i.style.height="0px",[0,y];let q=a.count>0?a.count:L(window.innerHeight||800),W=Math.max(0,Math.min(a.start,y-q)),U=Math.min(y,W+q);return o.style.height=`${W*c}px`,i.style.height=`${(y-U)*c}px`,[W,U]},settled:()=>{b||J||(J=!0,queueMicrotask(()=>{J=!1,z()}))}}},bi=(e,t,n,s)=>{let r=yi(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:l,atName:o,listExpr:i,keyExpr:a,keyIsItem:c,keyProp:d,itemNode:p,readsPosition:b,namesComponent:C,nestsScopes:O,windowExpr:D}=r,L=document.createComment("each"),x=document.createDocumentFragment();x.appendChild(L);let I=D===void 0?null:Si(p,D,t,n,()=>H);I&&x.append(I.top,I.bottom),(":if"in e.attrs||":elseif"in e.attrs||":else"in e.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let H=[],K=!1;return n.effect(()=>{let G=Do(t);try{let z=j(i,t),J=Array.isArray(z),y=J?null:gi(z)?Object.keys(z):[],$=J?z.length:y.length,[N,q]=I?I.range($):[0,$],W=new Map;H.forEach((u,m)=>{u.pos=m;let h=W.get(u.key);h?h.push(u):W.set(u.key,[u])});let U=new Set,w=[],M=[],P=[],_=[],B;for(let u=N;u<q;u++){let m=J?u:y[u],h=J?z[u]:z[m],S=m;c?S=h:d!==void 0&&h!==null&&typeof h=="object"?S=h[d]:a!==void 0&&(B===void 0?(B=Object.create(t),Pe(B,l,h),o&&Pe(B,o,m),Pe(B,"$index",u)):(B[l]=h,o&&(B[o]=m),B.$index=u),S=j(a,B)),U.has(S)&&!K&&(K=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),U.add(S);let g=W.get(S)?.shift();if(g&&Object.is(g.item,h)){let k=g.scope;k.$index!==u&&(b&&w.push(g),k.$index=u),o&&k[o]!==m&&(k[o]=m),P.push(g),_.push(g.pos);continue}if(g&&a!==void 0){let k=g.scope;k[l]=h,k.$index!==u&&(k.$index=u),o&&k[o]!==m&&(k[o]=m),g.item=h,M.push(g),P.push(g),_.push(g.pos);continue}g&&(g.fx.dispose(),St(g.range));let E=Object.create(t);Pe(E,l,h),o&&Pe(E,o,m),Pe(E,"$index",u),C||Vs.add(E);let T=Ee(t);O&&Object.defineProperty(E,At,{value:T});let R=wn($n(p,E,T,s));P.push({key:S,item:h,scope:E,fx:T,range:R,pos:u}),_.push(-1)}let V=new Set;W.forEach(u=>u.forEach(m=>V.add(m))),V.size&&(V.forEach(u=>{u.dead=!0,u.fx.dispose()}),_o(jo(H,u=>u.dead===!0)));let ne=I?I.top:L,f=hi(_);P.forEach((u,m)=>{!f[m]&&ne.nextSibling!==u.range.first&&Lo(u.range,ne),ne=u.range.last}),w.forEach(u=>xe(()=>u.fx.refresh())),M.forEach(u=>xe(()=>u.fx.rerun())),H=P}finally{Io(G)}I?.settled()}),n.onDispose(()=>H.forEach(G=>G.fx.dispose())),x},or=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Zt=e=>{let t=":if"in e.attrs,n=":elseif"in e.attrs,s=":else"in e.attrs;if((t?1:0)+(n?1:0)+(s?1:0)<2)return;let r=[t?":if":null,n?":elseif":null,s?":else":null].filter(Boolean);console.warn(`jq79: ${r.join(" and ")} on the same <${ee(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},$i=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${ee(e)}> - the chain before it already ended with :else, which closes it. One :if, any number of :elseif, at most one :else`:`jq79: ${n} on <${ee(e)}> continues no :if - it renders unconditionally. A chain is :if, then :elseif, then :else, on adjacent siblings: anything but whitespace between them breaks it`)},Ti=[":if",":elseif",":else",":each"],Ri=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=Ti.find(s=>s in e.attrs);if(n!==void 0){if(Fe(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Fe(e)}> is ignored - a slot is filled with its children as written. Put ${n} on the elements inside it, or on the component's tag`);return}console.warn(`jq79: ${n} on a nested <template> shows nothing - a <template>'s children live in its .content and never reach the page. Put ${n} on the elements themselves`)}},xi=[...Wt,":model",":slot"].map(e=>e.slice(1)),Ni={":attrs":':attrs was removed in 0.7 - it now binds an attribute called "attrs". Bind them one at a time (:disabled="x", :title="y"), or :class for classes'},vi=e=>{for(let t in e.attrs){let n=Ni[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Pi=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||we(t)||t===":model"||t.startsWith(":model."))continue;let n=t.slice(1);if(n.includes(".")){console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". Dotted modifiers belong to an event: if you meant @${n}, that is the spelling`);continue}let s=xi.find(r=>n!==r&&n.startsWith(r));s!==void 0&&console.warn(`jq79: ${t} is not a directive - it bound an attribute named "${n}". A ":name" jq79 does not recognize binds that attribute (which is what :src and :disabled are). If you meant :${s}, that is the spelling`)}},ir=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Ri(s,t),vi(s),Pi(s),ir(s.children,s))});let n=!1;for(let s=0;s<e.length;){let r=e[s];if(typeof r=="string"){r.trim()&&(n=!1),s++;continue}if(":each"in r.attrs){n=!1,s++;continue}if(Zt(r),":if"in r.attrs){s++;let l=i=>{let a=or(e,s),c=e[a];if(typeof c=="object"&&i in c.attrs)return s=a+1,c};for(let i=l(":elseif");i;i=l(":elseif"))Zt(i);let o=l(":else");o&&Zt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&$i(r,n),n=!1,s++}},vs=new WeakMap,ki=(e,t,n)=>{let s=vs.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],l=n+1,o=c=>{let d=or(e,l),p=e[d];if(typeof p=="object"&&c in p.attrs)return l=d+1,p};for(let c=o(":elseif");c;c=o(":elseif"))r.push({expr:c.attrs[":elseif"],node:c});let i=o(":else");i&&r.push({node:i});let a={branches:r,next:l};return vs.set(t,a),a},Te=(e,t,n,s=!1,r)=>{let l=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let i=e[o];if(typeof i=="string"){let a=document.createTextNode(i);i.includes("{{")&&yn(a,Ao(i),t,n),l.appendChild(a),o++;continue}if(":each"in i.attrs){l.appendChild(bi(i,t,n,s)),o++;continue}if(":if"in i.attrs){let a=ki(e,i,o);l.appendChild(pi(a.branches,t,n,s)),o=a.next;continue}l.appendChild($n(i,t,n,s)),o++}return l},vl=(e,t,n=!1)=>Te(e.template,t,Ee(t),n),Ae="data-jq79",Ci=e=>{let t=2166136261;for(let n=0;n<e.length;n++)t=Math.imul(t^e.charCodeAt(n),16777619);return(t>>>0).toString(36)},lr=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Ae]=t,lr(n.children,t))})},Mi=/^:(before|after|first-line|first-letter)(?![\w-])/i,ar=(e,t)=>{let n=0;for(let s=0;s<e.length;s++){let r=e[s];if(r==="\\")s++;else if(r==='"'||r==="'")for(s++;s<e.length&&e[s]!==r;)s+=e[s]==="\\"?2:1;else if(r==="("||r==="[")n++;else if(r===")"||r==="]")n--;else if(n===0&&t(s))return}},Ai=(e,t)=>{let n=e.length;return ar(e,s=>e[s]!==":"||e[s+1]!==":"&&!Mi.test(e.slice(s))?!1:(n=s,!0)),`${e.slice(0,n)}[${Ae}="${t}"]${e.slice(n)}`},Oi=(e,t)=>{let n=cr(e),s=n.match(/^\s*/)[0],r=n.match(/\s*$/)[0],l=n.slice(s.length,n.length-r.length);if(!l)return e;let o=[],i=0;return ar(l,a=>{l[a]===","&&(o.push(l.slice(i,a)),i=a+1)}),o.push(l.slice(i)),s+o.map(a=>a.trim()&&Ai(a.trim(),t)).join(", ")+r},cr=e=>{let t="";for(let n=0;n<e.length;){let s=e[n];if(s==="/"&&e[n+1]==="*"){let r=e.indexOf("*/",n+2);n=r===-1?e.length:r+2}else if(s==='"'||s==="'"){let r=n+1;for(;r<e.length&&e[r]!==s;)r+=e[r]==="\\"?2:1;t+=e.slice(n,r+1),n=r+1}else s==="\\"?(t+=e.slice(n,n+2),n+=2):(t+=s,n++)}return t},_i=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,ji=/[a-z]/,Li=e=>e.replace(_i,(t,n,s)=>ji.test(s)?`${n}${De(s)}`:t),dr=/^\s*@(media|supports|container|layer|scope|document)\b/i,ur=/^\s*@/,Di=e=>{let t="",n="",s="",r=[],l=()=>r.length===0||r[r.length-1],o=()=>{t+=l()&&!ur.test(s)?Li(n):n,n=""},i=c=>{o(),t+=c,s+=c},a=(c,d)=>{o(),t+=c,s="",d!==void 0?r.push(d):c==="}"&&r.pop()};for(let c=0;c<e.length;){let d=e[c];if(d==="/"&&e[c+1]==="*"){let p=e.indexOf("*/",c+2),b=p===-1?e.length:p+2;i(e.slice(c,b)),c=b}else if(d==='"'||d==="'"){let p=c+1;for(;p<e.length&&e[p]!==d;)p+=e[p]==="\\"?2:1;i(e.slice(c,Math.min(p+1,e.length))),c=p+1}else d==="{"?(a("{",dr.test(s)),c++):d==="}"||d===";"?(a(d),c++):(n+=d,s+=d,c++)}return o(),t},Ii=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n="",s="",r=[],l=()=>r.length===0||r[r.length-1];for(let o=0;o<e.length;){let i=e[o],a=i;if(i==="/"&&e[o+1]==="*"){let c=e.indexOf("*/",o+2);a=e.slice(o,c===-1?e.length:c+2)}else if(i==='"'||i==="'"){let c=o+1;for(;c<e.length&&e[c]!==i;)c+=e[c]==="\\"?2:1;a=e.slice(o,c+1)}else i==="\\"&&(a=e.slice(o,o+2));if(o+=a.length,!l())n+=a,a==="{"?r.push(!1):a==="}"&&r.pop();else if(a==="{"){let c=cr(s),d=ur.test(c);n+=(d?s:Oi(s,t))+"{",r.push(d&&dr.test(c)),s=""}else a==="}"||a===";"?(n+=s+a,s="",a==="}"&&r.pop()):s+=a}return n+s},sn=e=>{let t=Xn(e),s=new DOMParser().parseFromString(`<template>${t}</template>`,"text/html").querySelector("template"),r=[],l=[];Array.from(s.content.children).forEach(a=>{a.tagName==="TEMPLATE"?l.push(a):r.push(a)});let o=Ps(r,e),i={};return l.forEach(a=>{let c=a.getAttribute("name");if(c===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!Yn.test(c)){console.warn(`jq79: <template name="${c}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(c in i){console.warn(`jq79: two <template name="${c}"> in one file; the second was ignored`);return}i[c]=new pe({...Ps(Array.from(a.content.children),a.innerHTML),siblings:i,name:c})}),Object.keys(i).length&&(o.siblings=i),o},Hi=/^(?:text|application)\/(?:x-)?typescript$/i,qi=e=>"lang"in e?`lang="${e.lang}"`:Hi.test(e.type?.trim()??"")?`type="${e.type}"`:null,Ps=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let i={attrs:Hs(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(i):o.tagName==="STYLE"?s.push(i):r.push(Fs(o))}),n.forEach(o=>{let i=qi(o.attrs);i&&console.warn(`jq79: <script ${i}> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its types were never stripped: the script will throw, or - for a plain \`let x: T = ...\` - silently fail to declare x.`)}),s.forEach(o=>{"lang"in o.attrs&&console.warn(`jq79: <style lang="${o.attrs.lang}"> needs the jq79/vite plugin to compile it. This component didn't go through the bundler, so its styles were left uncompiled and the browser will ignore them.`)}),s.forEach(o=>{"lang"in o.attrs||(o.content=Di(o.content))});let l=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(l)){let o=Ci(t);lr(r,o),s.forEach(i=>{l(i)&&(i.scoped=Ii(i.content,o))})}return ir(r),{template:r,scripts:n,styles:s}},fr=/\.html?([?#]|$)/,ht=e=>fr.test(e)?dn(e):import(e),Tn=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,rn=(e,t)=>{if(!Tn.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},Fi=(e,t)=>e?`
20
+ //# sourceURL=${e}?jq79-script=${t}`:"",pr=(e,t,n)=>{try{return wt(e,t,Fi(n.filename,n.index??0))}catch(s){throw s instanceof Me?new Error(`jq79: safeEval() is on, and script ${n.index??0} of ${n.filename??"a component built from a string"} ${s.reason}. ${s.hint}`):s}},ks=e=>e.scoped??e.content,qe=`:where([${Qs}]) { display: contents }`,Rn=()=>fn&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,gt=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},xn=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},on=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},at=null,ln=null,Wi=()=>{if(Rn()){xn(document,ln??(ln=gt(qe)));return}at?.isConnected||(at=document.createElement("style"),at.textContent=qe,document.head.appendChild(at))},mt=new Map,Bi=e=>{let t=mt.get(e);if(!t){if(Rn()){let n=gt(e);xn(document,n),t={sheet:n,count:0}}else{let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0}}mt.set(e,t)}t.count++},Ui=e=>{let t=mt.get(e);t&&--t.count<=0&&(t.sheet?on(document,t.sheet):t.el?.remove(),mt.delete(e))},Ki=(e,t,n,s={},r=ht,l={})=>{let o={...br,...s},i=new Proxy(t,{has:(d,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(d,p)||!(p in globalThis)&&!(p in o))}),a={},c=pr(ns(Object.keys(o)),ss(e),l)(i,n,r,a,...Object.values(o));return c.catch(d=>console.error("jq79: error in :setup script",d)),Ks(c),{settled:c,sync:a.done===!0}},Cs=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:j(s,e))})},bt=e=>{let t=new Map;return n=>{if(t.has(n))return t.get(n);let s=e(n);return t.set(n,s),s}},hr=e=>(e?.forEach(t=>Object.freeze(t)),e&&Object.freeze(e),e),zi=bt(zn),an=bt(e=>hr(nt(e))),Gi=bt(e=>{let t=et(e);return Object.freeze(t.vars),Object.freeze(t)}),Vi=bt(e=>hr(is({attrs:{":setup":e},content:""}))),cn=e=>{let t=e.attrs[":setup"],n=t===void 0?null:Vi(t);return!n&&e.attrs[":setup"]!==void 0&&Zi(e,e.attrs[":setup"]),n},Ms=new WeakSet,Zi=(e,t)=>{t.trim()==="_"||Ms.has(e)||(Ms.add(e),console.warn(`jq79: :setup="${t}" is not a props pattern, so this component declares no signature and takes whatever a parent passes - write the props it takes ("{ a, b }"), a bare :setup for none, or "_" to stay open on purpose`))},Qi=e=>{let t=null;return e.forEach(n=>{let s=an(n.content)??cn(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:l})=>r.add(l))}),t},As=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},Os=new WeakMap,Xi=(e,t,n,s)=>{if(s===null)return;let r=Os.get(e)??new Set;Os.set(e,r),n.forEach(l=>{s.has(l)||r.has(l)||(r.add(l),console.warn(`jq79: :${l} is not declared by <${t}> - add it to the :setup signature, or drop it`))})},Yi=new Set([":value",":checked",":selected",":text",":html",":class"]),_s=new WeakSet,Ji=(e,t,n,s)=>{if(s===null||_s.has(e))return;let r=n.filter(l=>s.has(l));r.length&&(_s.add(e),r.forEach(l=>console.warn(`jq79: :${l} on <${t}> is a directive, not a prop - <${t}> never receives its "${l}". Rename the prop (${r.map(o=>`:${o}`).join(", ")} are reserved on a component tag), or use :model for a value that goes both ways`)))},el=(e,t)=>{if(!e)return null;let n=Object.create(null),s=!1;return Object.entries(e).forEach(([r,l])=>{t.has(r)||(n[r]=l,s=!0)}),s?n:null},gr=Symbol("jq79.unfilledProps"),yt=Symbol("jq79.pendingScripts"),tl=e=>e&&e.default!==void 0?e.default:e,nl=(e,t,n,s={},r=ht,l={})=>{let o={...br,...s},i={},a=pr(rs(Object.keys(o)),os(e),l)(i,tl,r,...Object.values(o)),c=O=>console.error("jq79: error in factory script",O),d=!1,p,b=()=>{if(d)return p;d=!0;let O=i.default;if(typeof O!="function")return;let D=L=>{L&&typeof L=="object"&&Object.assign(t,L)};try{let L=O(t,{$data:t,$props:t,$effect:n,...s});L instanceof Promise?p=L.then(D).catch(c):D(L)}catch(L){c(L)}return p},C=a.then(b,c);return Ks(C),i.done&&b(),{settled:C,sync:i.done===!0&&p===void 0}},sl="__JQ79_HMR_ENABLED__",rl="__JQ79_HMR__",$e=null,ol=e=>{if(!$e||!e.filename)return;let t=$e.get(e.filename);t||$e.set(e.filename,t=new Set),t.add(new WeakRef(e))},Qt=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},il=(e,t)=>{if(!$e)return 0;let n=Qt(e),s=sn(t);te?.forEach((i,a)=>{Qt(a)===n&&te.set(a,Promise.resolve(t))});let r=!1,l=i=>i.name===void 0?s:s.siblings?.[i.name]??null,o=0;for(let[i,a]of $e)if(Qt(i)===n){for(let c of a){let d=c.deref();if(!d){a.delete(c);continue}let p=l(d);if(!p){r=!0;continue}d.hotReplace(p)&&o++}a.size||$e.delete(i)}return r?0:o},ll=()=>{$e??($e=new Map),globalThis[rl]={update:il}},js=3e3,al=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${js/1e3}s for a :setup script and has rendered nothing. The template waits until every script returns or calls $mounted() - add an await $mounted() above the slow part to render first and fill in after.`)},js);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},mr=e=>{if(Tn.test(e))return e;let t=import.meta.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},te=new Map,yr=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},Ls=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),Sr?.then(()=>gl(e))]).then(([t])=>t),Er=e=>{if(!te)return Ls(e);let t=yr(e),n=te.get(t);if(!n){n=Ls(e),te.set(t,n);let s=n;s.catch(()=>{te?.get(t)===s&&te.delete(t)})}return n},dn=async e=>{let t=mr(e),n=await Er(t);return new pe(n,{filename:t})},Ds=new WeakSet,Is=new Set,cl=e=>{if(Is.has(e))return;Is.add(e);let t=document.createElement("link");t.rel="modulepreload";let n=pn();n&&t.setAttribute("nonce",n),t.href=e,document.head.append(t)},dl=/<script\b(?:"[^"]*"|'[^']*'|[^>"'])*>([\s\S]*?)<\/script\s*>/gi,Et=new Set,wr=(e,t,n)=>{for(let{spec:s,kind:r}of Gn(e)){if(r==="component"&&n&&s in n)continue;let l=mr(r==="fetch"?s:rn(s,r==="component"?t:void 0));r==="fetch"||fr.test(l)?te&&Er(l).then(o=>ul(o,l),()=>{}):Tn.test(l)&&cl(l)}},ul=(e,t)=>{let n=yr(t);if(!Et.has(n)){Et.add(n);for(let[,s]of e.matchAll(dl))wr(s,t,void 0)}},fl=(e,t,n)=>{for(let s of e)Ds.has(s)||(Ds.add(s),wr(s.content,t,n))},Sr,pl="/jq79-sw.js",hl=async e=>{let t=typeof navigator>"u"?void 0:navigator.serviceWorker;if(!t)throw new Error("jq79: safeEval() compiles components in a service worker, and this page can't have one - service workers need https (or localhost). Precompile with the jq79/vite plugin instead, or use safeEval({ nonce: true }) on a page whose server issues a nonce.");let n;try{n=await t.register(e)}catch(s){throw new Error(`jq79: safeEval() couldn't register its service worker at ${e} (${s.message}). Serve jq79-sw.js from the jq79 package at your site's root, or pass its URL: safeEval({ worker: "/path/jq79-sw.js" }).`)}await t.ready,!t.controller&&await new Promise(s=>{t.addEventListener("controllerchange",()=>s(),{once:!0}),t.controller?s():n.active?.postMessage("jq79:claim")})},gl=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(cs,""),new Promise((n,s)=>{let r=document.createElement("script"),l=pn();l&&r.setAttribute("nonce",l),r.src=t.href,r.onload=()=>{r.remove(),n()},r.onerror=()=>{r.remove(),s(new Error(`jq79: the precompiled functions of ${e} did not load, and safeEval() can't render it without them`))},document.head.append(r)})},fe=class fe{constructor(t,n={}){A(this,"template");A(this,"scripts");A(this,"styles");A(this,"modules");A(this,"filename");A(this,"siblings");A(this,"name");A(this,"slots");A(this,"modelWriteback");A(this,"data",null);A(this,"fx",null);A(this,"content",null);A(this,"startMarker",null);A(this,"endMarker",null);A(this,"styleEls",[]);A(this,"shadowCss",null);A(this,"shadowSheets",[]);A(this,"sheetRoot",null);A(this,"ownsSharedStyles",!1);A(this,"useShadow",!1);A(this,"mountRoot",null);A(this,"resolveMounted",null);A(this,"renderDone",!1);A(this,"held",0);A(this,"onPaint",null);A(this,"destroyHooks",null);A(this,"attachHooks",null);A(this,"detachHooks",null);A(this,"onPage",!1);A(this,"emitListeners",new Map);let s=typeof t=="string"?sn(t):t;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof t=="string"?void 0:t.modules),this.filename=n.filename??(typeof t=="string"?void 0:t.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),ol(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([t,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[t]=n)})}hotReplace(t){let n=typeof t=="string"?sn(t):t;gn.clear(),be.clear(),tn.clear();let s=this.startMarker,r=!!(s&&this.content),l=r&&s.isConnected,o=l?s.parentNode:null,i=l?this.endMarker.nextSibling:null,a={...this.data},c=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!r||(this.renderWith(a,c),!o)?!1:(c&&this.placeShadowStyles(o,i),o.insertBefore(this.content,i),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=X.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(X,s)?typeof r=="boolean"?X[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(X).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(X).join(", ")}`)}X.scopedNames!==n&&dt.clear()}return{...X}}static safeEval(t={}){fn=!0;let n=[];if(t.nonce){let r=pn();r===void 0?n.push(Promise.reject(new Error("jq79: safeEval({ nonce: true }) found no nonce on this page - no <script> carries one. The nonce belongs on the script that loads the page, the one the CSP names."))):Jt=r}let s=t.worker??(t.nonce?!1:pl);return s!==!1&&n.push(Sr??(Sr=hl(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?(te=null,Et.clear()):t===!0&&(te??(te=new Map)),!!te}static clearCache(){te?.clear(),Et.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new un(dn(t))}static fetchAll(t){return Promise.all(t.map(dn))}static importAll(t){if(!Array.isArray(t))throw new TypeError("Component79.importAll takes an array; use import() for one");return Promise.all(t.map(n=>ht(rn(n,void 0))))}on(t,n){return this.emitListeners.has(t)||this.emitListeners.set(t,new Set),this.emitListeners.get(t).add(n),this}off(t,n){return this.emitListeners.get(t)?.delete(n),this}render(t={}){return this.renderWith(t,!1)}renderShadow(t={}){return this.renderWith(t,!0)}renderWith(t,n){this.destroy();let s=ls(this.scripts,cn,an),r=el(this.siblings,s),l=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(w=>!(w in t)));o.size&&Object.defineProperty(l,gr,{value:o}),this.slots&&Object.defineProperty(l,Zs,{value:this.slots}),Object.defineProperty(l,yt,{value:{count:0,owner:this}});let i=ve(l),a=Ee(i);this.data=i,this.fx=a,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let c=this.startMarker,d=!1,p=(w,M)=>{w==="model:update"&&!d&&(d=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let P=new CustomEvent(w,{detail:M,bubbles:!0,composed:!0,cancelable:!0});return c===this.startMarker&&this.emitListeners.get(w)?.forEach(_=>_(P,M)),P.cancelBubble||c.dispatchEvent(P),!P.defaultPrevented},b,C=new Promise(w=>{b=w});this.resolveMounted=b,this.renderDone=!1,this.held=0;let O=w=>{if(typeof w!="function")throw new TypeError("jq79: $destroyed expects a function");return c!==this.startMarker?(ke(w,"$destroyed"),()=>{}):Xt(this.destroyHooks??(this.destroyHooks=[]),w)},D=(w,{immediate:M=!0}={})=>{if(typeof w!="function")throw new TypeError("jq79: $attached expects a function");if(c!==this.startMarker)return()=>{};this.watchPage();let P=Xt(this.attachHooks??(this.attachHooks=[]),w);return M&&this.onPage&&ke(w,"$attached"),P},L=w=>{if(typeof w!="function")throw new TypeError("jq79: $detached expects a function");return c!==this.startMarker?(ke(w,"$detached"),()=>{}):(this.watchPage(),Xt(this.detachHooks??(this.detachHooks=[]),w))},x=w=>{let M=Ot(w);return O(()=>M.$dispose()),M},I=this.endMarker,H=(w=>{let M=[];for(let P=c.nextSibling;P&&P!==I;P=P.nextSibling)P instanceof Element&&(P.matches(w)&&M.push(P),M.push(...Array.from(P.querySelectorAll(w))));return M}),K=(w=>H(w)[0]??null),G=this.modules,z=w=>G&&w in G?Promise.resolve(G[w]):ht(rn(w,this.filename)),J=w=>{if(!Array.isArray(w))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(w.map(z))},$=Object.assign(Object.create(null),{$emit:p,$updateModel:(...w)=>{let[M,P]=w.length>1?w:[void 0,w[0]];return c!==this.startMarker?!1:this.modelWriteback?.(M,P)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(w=>[w,!0]))}),N=[],q=!0;fl(this.scripts,this.filename,this.modules),this.scripts.forEach((w,M)=>{let P;N.push(new Promise(S=>{P=S}));let _=!1,B=()=>{_=!0,P()},ne={$mounted:()=>(B(),C),$destroyed:O,$attached:D,$detached:L,$computed:x,$self:K,$$self:H,...$,$importAll:J,...r},f={filename:this.filename,index:M},u=":mounted"in w.attrs,m=zi(w.content),h=(()=>{if(m!==null){u&&console.warn("jq79: :mounted on a factory script renders the template before the factory has returned, so none of its bindings exist yet - await $mounted() inside the factory instead."),Cs(i,an(w.content));let T=u?zt(m):m;return nl(T,i,R=>a.effect(R),ne,z,f)}let{vars:S,code:g}=Gi(w.content);Cs(i,cn(w)),S.forEach(T=>{T in i||(i[T]=void 0)});let E=u?zt(g):g;return Ki(E,i,T=>a.effect(T),ne,z,f)})();if(h.sync)h.settled.then(B,B);else{let S=l[yt];S.count++;let g=()=>{S.count--,B()};h.settled.then(g,g)}!h.sync&&!_&&(q=!1)});let W=document.createDocumentFragment(),U=new Proxy(i,{has:(w,M)=>typeof M=="string"&&M in $||Reflect.has(w,M),get:(w,M,P)=>typeof M=="string"&&M in $&&!Reflect.has(w,M)?$[M]:Reflect.get(w,M,P)});if(W.append(this.startMarker,this.endMarker),this.content=W,q?(this.endMarker.parentNode.insertBefore(Te(this.template,U,a,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(N).then(()=>{c===this.startMarker&&(this.endMarker.parentNode.insertBefore(Te(this.template,U,a,n),this.endMarker),this.renderDone=!0,this.settleMounted(),fe.settleAttached())}),al(this,N)),n)if(Rn())this.shadowCss=[...this.styles.map(w=>w.content),qe];else{let w=document.createElement("style");w.textContent=qe,this.styleEls=[...this.styles.map(M=>{let P=document.createElement("style");return P.textContent=M.content,P}),w]}else this.styles.forEach(w=>Bi(ks(w))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?Oe(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(t,n){let s=typeof t=="string"?Oe(t):t;if(!s)throw new Error(`mount target not found: ${t}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(t){this.mountRoot&&this.detach();let n=this.useShadow&&t instanceof Element?t.shadowRoot??t.attachShadow({mode:"open"}):t;return this.useShadow&&this.placeShadowStyles(n,null),n.appendChild(this.content),this.mountRoot=n,this.settleMounted(),fe.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){me.has(this)||(me.add(this),this.onPage=this.isOnPage(),this.onPage||fe.queueSettle())}static queueSettle(){Yt||(Yt=!0,queueMicrotask(()=>{Yt=!1,fe.settleAttached()}))}static settleAttached(){if(me.size===0)return;let t=[...me].filter(n=>!n.onPage&&n.isOnPage());fe.inDocumentOrder(t).forEach(n=>{n.onPage||!me.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>ke(s,"$attached")))})}notifyDetached(){if(me.size===0)return;let t=[];if(this.startMarker?.isConnected){let n=new Set;for(let r=this.startMarker;r&&(n.add(r),r!==this.endMarker);r=r.nextSibling);let s=r=>{for(;r;r=r.parentNode)if(n.has(r))return!0;return!1};t=fe.inDocumentOrder([...me].filter(r=>r.onPage&&s(r.startMarker)))}else this.onPage&&(t=[this]);t.forEach(n=>{n.onPage&&(n.onPage=!1,n.detachHooks?.slice().forEach(s=>ke(s,"$detached")))})}static inDocumentOrder(t){return t.sort((n,s)=>n.startMarker.compareDocumentPosition(s.startMarker)&Node.DOCUMENT_POSITION_FOLLOWING?-1:1)}placeShadowStyles(t,n){if(this.shadowCss&&typeof ShadowRoot<"u"&&t instanceof ShadowRoot){this.sheetRoot&&this.sheetRoot!==t&&this.shadowSheets.forEach(s=>on(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===qe?ln??(ln=gt(s)):gt(s))),this.shadowSheets.forEach(s=>xn(t,s)),this.sheetRoot=t;return}this.shadowCss&&this.styleEls.length===0&&(this.styleEls=this.shadowCss.map(s=>{let r=document.createElement("style");return r.textContent=s,r})),this.styleEls.forEach(s=>t.insertBefore(s,n))}settleMounted(){if(!this.renderDone||this.held>0)return;let t=this.onPaint;this.onPaint=null,t?.(),this.mountRoot&&this.resolveMounted?.()}holdOwner(t){this.renderDone&&this.held===0||(t.held++,this.onPaint=()=>{t.held--,t.settleMounted()})}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;this.notifyDetached();let t=this.startMarker;for(;t;){let n=t.nextSibling;if(this.content.appendChild(t),t===this.endMarker)break;t=n}return this.mountRoot=null,this}destroy(){this.notifyDetached(),me.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>ke(s,"$destroyed")),this.resolveMounted=null;let n=this.onPaint;return this.onPaint=null,n?.(),this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(s=>s.parentNode?.removeChild(s)),this.styleEls=[],this.sheetRoot&&this.shadowSheets.forEach(s=>{s!==ln&&on(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>Ui(ks(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};A(fe,"version",So);var pe=fe,un=class{constructor(t){A(this,"chain");this.chain=t}queue(t){return this.chain=this.chain.then(n=>(t(n),n)),this}then(t,n){return this.chain.then(t,n)}catch(t){return this.chain.catch(t)}finally(t){return this.chain.finally(t)}mount(t,n){return this.queue(s=>s.mount(t,n))}mountShadow(t,n){return this.queue(s=>s.mountShadow(t,n))}render(t={}){return this.queue(n=>n.render(t))}renderShadow(t={}){return this.queue(n=>n.renderShadow(t))}on(t,n){return this.queue(s=>s.on(t,n))}off(t,n){return this.queue(s=>s.off(t,n))}detach(){return this.queue(t=>t.detach())}destroy(){return this.queue(t=>t.destroy())}};var Pl=e=>new pe(e),ke=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},Xt=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),me=new Set,Yt=!1,br={$:Oe,$$:Tt,$create:Rt,$reactive:ve,$toRaw:Q,$raw:Ct,$batch:Ne,$tick:Mt,Component79:pe,C79:pe};typeof globalThis<"u"&&globalThis[sl]&&ll();export{Oe as $,Tt as $$,Ne as $batch,Ot as $computed,Rt as $create,Ct as $raw,ve as $reactive,Mt as $tick,Q as $toRaw,pe as C79,pe as Component79,un as PendingComponent79,ll as enableHotReload,il as hotUpdate,Pl as parseComponent,vl as renderComponent};
19
21
  //# sourceMappingURL=jq79.js.map