jq79 0.7.10 → 0.7.11
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.cjs +16 -16
- package/dist/jq79.cjs.map +1 -1
- package/dist/jq79.global.js +16 -16
- package/dist/jq79.global.js.map +1 -1
- package/dist/jq79.js +16 -16
- package/dist/jq79.js.map +1 -1
- package/dist/precompile.cjs +12 -12
- package/dist/precompile.cjs.map +1 -1
- package/dist/precompile.js +14 -14
- package/dist/precompile.js.map +1 -1
- package/dist/transform.d.ts +5 -0
- package/package.json +1 -1
- package/src/jq79.ts +75 -3
- package/src/transform.ts +100 -0
package/dist/jq79.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
var Ls=Object.defineProperty;var Ds=(e,t,n)=>t in e?Ls(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var M=(e,t,n)=>Ds(e,typeof t!="symbol"?t+"":t,n);function Pe(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function rt(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var ot=(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},Is=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Qt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},qs=new Set(["http:","https:","mailto:"]);function Hs(e){try{let t=new URL(e,"https://example.com");return qs.has(t.protocol)}catch{return!1}}var Ws={"https:":"443","http:":"80"};function Fs(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 Yt=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(Fs).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||Ws[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function Us(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var Xt=512;function Jt(e,t,n,s){if(n>Xt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${Xt} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=Bs(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function Bs(e,t,n){let s=e.tagName.toLowerCase();if(!Is.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),a=Qt[s]?.has(o),l=Qt["*"]?.has(o);!a&&!l||(o==="href"||o==="src")&&(!Hs(i.value)||n&&!Us(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),Jt(e,r,t+1,n),r}function it(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return Jt(n.content,s,0,t?.allowUrl),s.innerHTML}var Ks=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),De=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},an=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&De(r)?an(r,i,n):n(i,r)})},zs=(e,t)=>{e.own===null?e.own=t:e.own!==t&&(e.ownMany??(e.ownMany=new Set)).add(t)},Gs=(e,t)=>{e.deep===null?e.deep=t:e.deep!==t&&(e.deepMany??(e.deepMany=new Set)).add(t)},Vs=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},Zs=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},Te=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Ce=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},en=" keys",at=e=>e?`${e}.${en}`:en,tn=".length",nn=(e,t)=>({children:null,own:null,ownMany:null,deep:null,deepMany:null,parent:e,segment:t}),Qs=e=>e.own===null&&e.deep===null&&!e.ownMany?.size&&!e.deepMany?.size&&!e.children?.size,ct=Symbol("jq79.raw"),V=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ct];)t=t[ct];return t},ln=Symbol("jq79.store"),ge=e=>e!==null&&typeof e=="object"&&e[ln]===!0,dt=null,ue=[],Y=null,$e=e=>{ue.push(new Set);let t=Y;Y=null;try{return e()}finally{ue.pop(),Y=t}},Xs=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},sn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},Ys=0,lt=new Set,rn="$__attach",on="$__holds",Ie=Symbol("jq79.alsoWakenBy"),ft=Symbol("jq79.owner"),Me=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=nn(null,""),a=(u,c)=>{let m=o;return u.split(".").forEach(h=>{let w=m.children??(m.children=new Map),g=w.get(h);g||(g=nn(m,h),w.set(h,g)),m=g}),c.deep?Gs(m,c):zs(m,c),m},l=(u,c)=>{c.deep?Zs(u,c):Vs(u,c);let m=u;for(;m?.parent&&Qs(m);)m.parent.children.delete(m.segment),m=m.parent},f=u=>{let c=o;for(let m of u.split("."))if(c=c.children?.get(m),!c)return;return c},d=u=>{let c=new Set,m=E=>{let T=E.children?[...E.children.values()]:[];for(;T.length;){let R=T.pop();Te(R,k=>c.add(k)),Ce(R,k=>c.add(k)),R.children?.forEach(k=>T.push(k))}},h=o,w=u.split("."),g="";for(let E=0;E<w.length-1;E++){if(h=h.children?.get(w[E]),!h)return c;g=g?`${g}.${w[E]}`:w[E],Ce(h,R=>c.add(R));let T=x.get(g);T&&Te(h,R=>{T.store[on](R)||c.add(R)}),E===w.length-2&&w[E+1]==="length"&&(Te(h,R=>c.add(R)),m(h))}return h=h.children?.get(w[w.length-1]),h&&(Te(h,E=>c.add(E)),Ce(h,E=>c.add(E)),m(h)),c},p=(u,c,m)=>{if(c===m)return!1;for(let h=c;h<m;h++){let w=u.charCodeAt(h);if(w<48||w>57)return!1}return!0},S=(u,c)=>{if(u.deep||c.size<2)return c;let m=new Set;c.forEach(g=>{g.endsWith(tn)&&m.add(g.slice(0,-tn.length))});let h=new Set;if(c.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 c;let w=new Set;return c.forEach(g=>{h.has(g)||w.add(g)}),w},O=u=>{let c=null,m=null,h=null,w=lt,g=N=>h?h.has(N):c===N,E=N=>{let K=a(N,u);h?h.set(N,K):c===null?(c=N,m=K):(h=new Map([[c,m],[N,K]]),c=m=null)},T=N=>{if(h){h.forEach((K,F)=>{N.has(F)||(l(K,u),h.delete(F))});return}c!==null&&!N.has(c)&&(l(m,u),c=m=null)},R=()=>{h?h.forEach(N=>l(N,u)):m&&l(m,u),h=null,c=m=null},k=N=>{if(N.size===w.size){let F=!0;if(N.forEach(he=>{F&&(F=w.has(he))}),F)return}w=N;let K=S(u,N);T(K),K.forEach(F=>{g(F)||E(F)})};return u.reindex.add(k),k(u.deps),()=>{u.reindex.delete(k),R(),w=lt}},I=u=>{let c=f(u);if(c){let m=new Set;Te(c,h=>m.add(h)),Ce(c,h=>m.add(h)),j(m)}},z=u=>I(at(u)),j=u=>{let c=Array.from(u),m=!0;for(let h=1;m&&h<c.length;h++)m=c[h-1].order<c[h].order;m||c.sort((h,w)=>h.order-w.order),c.forEach(h=>{s.has(h)&&h.run()})},b=(u,c,m=!1)=>{t.get(u)?.forEach(h=>h(c,u)),n.forEach(h=>h(u,c)),m?s.forEach(h=>h.run()):j(d(u))},H=(u,c)=>u!==c&&u!==null&&c!==null&&typeof u=="object"&&typeof c=="object"&&!ge(u)&&!ge(c)&&De(u)&&De(c)&&Array.isArray(u)===Array.isArray(c),D=null,L=-1,U=(u,c)=>{let m=c.length>u.length,h=m?u:c,w=m?c:u,g=0;for(;g<h.length&&Object.is(V(h[g]),V(w[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(V(h[E]),V(w[E+1])))return L;return g},se=(u,c)=>{if(Array.isArray(c)){let T=u.length,R=c.length,k=T!==R;if(!T||!R)return D;let N=Math.max(T,R);if(Math.abs(T-R)===1){let F=U(u,c);if(F!==L){let he=[];for(let st=F;st<N;st++)he.push(String(st));return{keys:he,exact:!0,keysChanged:k}}}let K=[];for(let F=0;F<N;F++)if(!Object.is(V(u[F]),V(c[F]))&&(K.push(String(F)),K.length*2>=N))return D;return{keys:K,exact:!1,keysChanged:k}}let m=Object.keys(u),h=Object.keys(c),w=new Set([...m,...h]);if(!w.size)return D;let g=[];w.forEach(T=>{Object.is(V(u[T]),V(c[T]))||g.push(T)});let E=m.length!==h.length||m.some((T,R)=>T!==h[R]);return g.length*2>=w.size?D:{keys:g,exact:!1,keysChanged:E}},v=(u,c,m,h)=>{let w=new Set,g=T=>{let R=f(T);R&&(Te(R,k=>w.add(k)),Ce(R,k=>w.add(k)))},E=se(c,m);if(!E)return b(u,h);if(t.get(u)?.forEach(T=>T(h,u)),n.forEach(T=>T(u,h)),g(u),E.keys.forEach(T=>{let R=`${u}.${T}`,k=t.get(R);if(k){let N=V(m[T]),K=A(N)?G(N,R):N;k.forEach(F=>F(K,R))}E.exact?g(R):d(R).forEach(N=>w.add(N))}),E.keysChanged&&g(at(u)),Array.isArray(m)&&c.length!==m.length){let T=`${u}.length`;t.get(T)?.forEach(R=>R(m.length,T)),g(T)}j(w)},A=u=>u!==null&&typeof u=="object"&&De(u),x=new Map,q=(u,c)=>{let m=x.get(c);m?.store!==u&&(m?.unsubscribe(),x.set(c,{store:u,unsubscribe:u.$onAny((h,w)=>b(`${c}.${h}`,w))}))},J=u=>{x.get(u)?.unsubscribe(),x.delete(u)},G=(u,c)=>{let m=r.get(u);if(m)return m;let h=null,w=new Proxy(u,{has(g,E){return Reflect.has(g,E)||typeof E=="string"&&h?.has(E)===!0},ownKeys(g){return ue[ue.length-1]?.add(at(c)),Y!==null&&Y.home!==s&&W(Y),Reflect.ownKeys(g)},get(g,E,T){if(E===ct)return g;if(E===ln)return c==="";if(typeof E!="string")return Reflect.get(g,E,T);if(c===""&&E in i)return i[E];let R=c?`${c}.${E}`:E;ue[ue.length-1]?.add(R),Y!==null&&Y.home!==s&&W(Y);let k=Reflect.get(g,E,T);if(ge(k))return q(k,R),k;let N=V(k);return A(N)?G(N,R):N},set(g,E,T,R){if(R!==w&&!Object.prototype.hasOwnProperty.call(g,E))return Reflect.set(g,E,T,R);let k=c?`${c}.${E}`:E,N=ge(T)?T:V(T),K=!Object.prototype.hasOwnProperty.call(g,E);if(!K&&Object.is(g[E],N)&&(N===null||typeof N!="object"))return!0;let F=g[E];g[E]=N,h?.delete(E),ge(N)?q(N,k):J(k);let he=ge(N)||!A(N)?N:G(N,k);return!K&&H(F,N)?v(k,F,N,he):b(k,he,K),!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=c?`${c}.${E}`:E;(h??(h=new Set)).add(E),J(k),b(k,void 0),z(c)}return R}});return r.set(u,w),w},Z=G(V(e),"");Object.entries(V(e)).forEach(([u,c])=>{ge(c)&&q(c,u)});let y=(u,c,{immediate:m=!1}={})=>(t.has(u)||t.set(u,new Set),t.get(u).add(c),m&&c(Ks(Z,u),u),()=>t.get(u)?.delete(c)),P=(u,{immediate:c=!1}={})=>(n.add(u),c&&an(Z,"",(m,h)=>u(m,h)),()=>n.delete(u)),C=(u,{deep:c=!1,alsoWakenBy:m}={})=>{let h=!1,w=!1,g={deps:lt,reindex:new Set,deep:c,order:Ys++,home:s,adopted:null,read:null,run:()=>{if(h){w=!0;return}h=!0;try{let R=0;do{w=!1,g.read=null;let k=new Set;ue.push(k);let N=Y;Y=g;try{u()}finally{ue.pop(),Y=N,g.deps=k}}while(w&&++R<100);w&&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&&Xs(g),g.reindex.forEach(R=>R(g.deps))}}};s.add(g);let E=O(g),T=()=>{s.delete(g),E(),sn(g)};return m?.length?Q(g,m,T):(g.run(),dt=g,T)},Q=(u,c,m)=>{let h=c.map(w=>w?.[rn]?.(u)).filter(Boolean);return u.run(),dt=u,()=>{m(),h.forEach(w=>w())}},$=u=>{s.add(u);let c=O(u);return()=>{s.delete(u),c()}},W=u=>{(u.read??(u.read=new Set)).add(s),!(u.adopted?.has(s)||s.has(u))&&(u.adopted??(u.adopted=new Map)).set(s,$(u))},B=()=>{x.forEach(({unsubscribe:u})=>u()),x.clear(),s.forEach(u=>{u.home===s&&sn(u)})};return i.$on=y,i.$onAny=P,i.$effect=C,i.$dispose=B,i[rn]=$,i[on]=u=>s.has(u),Z},ut=class{constructor(t,n){M(this,"scope",t);M(this,"disposers",null);M(this,"runs",null);M(this,"children",null);M(this,"owners",null);M(this,"options");let s=t[Ie];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[ft];!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(dt)}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]()}},me=(e,t=!1)=>new ut(e,t),pt=e=>{let t=Me({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 cn=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,dn=/\$:\s*/y,He=/import(?=\s*\()/y,un=/\$:\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},ee=(e,t)=>{let n=e.indexOf(`
|
|
2
|
-
`,t);return n===-1?e.length:n},
|
|
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},
|
|
4
|
-
`){let i=
|
|
5
|
-
`||o===";"||o==="}"?i=!0:/\s/.test(o)||(i=!1),n+=o,s++}return{vars:t,code:n}},
|
|
6
|
-
`||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},
|
|
7
|
-
`||a===";"||a==="}"?r=!0:/\s/.test(a)||(r=!1),t+=a,n++}return i?t:null},
|
|
8
|
-
= $value`,
|
|
9
|
-
); }
|
|
10
|
-
);`},
|
|
11
|
-
${t}`,
|
|
12
|
-
;$__state.done = true })()`,
|
|
1
|
+
var Vs=Object.defineProperty;var Zs=(e,t,n)=>t in e?Vs(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var A=(e,t,n)=>Zs(e,typeof t!="symbol"?t+"":t,n);function Ce(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function ct(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var dt=(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},Qs=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),on={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Xs=new Set(["http:","https:","mailto:"]);function Ys(e){try{let t=new URL(e,"https://example.com");return Xs.has(t.protocol)}catch{return!1}}var Js={"https:":"443","http:":"80"};function er(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 ln=e=>{let t=(Array.isArray(e)?e:e.split(",")).map(er).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),r=n.port||Js[n.protocol]||"";return t.some(i=>i.host.test(s)&&(i.port===null||i.port===r))}};function tr(e,t,n,s){try{return!!e(new URL(t,document.baseURI),n,s)}catch{return!1}}var an=512;function cn(e,t,n,s){if(n>an)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${an} elements`);for(let r of Array.from(e.childNodes))if(r.nodeType===Node.ELEMENT_NODE){let i=nr(r,n,s);i&&t.appendChild(i)}else r.nodeType===Node.TEXT_NODE&&t.appendChild(r.cloneNode())}function nr(e,t,n){let s=e.tagName.toLowerCase();if(!Qs.has(s))return null;let r=document.createElement(s);for(let i of Array.from(e.attributes)){let o=i.name.toLowerCase(),a=on[s]?.has(o),l=on["*"]?.has(o);!a&&!l||(o==="href"||o==="src")&&(!Ys(i.value)||n&&!tr(n,i.value,s,o))||r.setAttribute(o,i.value)}return s==="a"&&r.setAttribute("rel","noopener noreferrer"),cn(e,r,t+1,n),r}function ut(e,t){let n=document.createElement("template");n.innerHTML=e;let s=document.createElement("div");return cn(n.content,s,0,t?.allowUrl),s.innerHTML}var sr=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),Ie=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},mn=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let i=t?`${t}.${s}`:s;r&&typeof r=="object"&&Ie(r)?mn(r,i,n):n(i,r)})},rr=(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)},ir=(e,t)=>{e.own===t?e.own=null:e.ownMany?.delete(t)&&e.ownMany.size===0&&(e.ownMany=null)},ar=(e,t)=>{e.deep===t?e.deep=null:e.deepMany?.delete(t)&&e.deepMany.size===0&&(e.deepMany=null)},$e=(e,t)=>{e.own!==null&&t(e.own),e.ownMany?.forEach(t)},Ae=(e,t)=>{e.deep!==null&&t(e.deep),e.deepMany?.forEach(t)},dn=" keys",ft=e=>e?`${e}.${dn}`:dn,un=".length",fn=(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,ht=Symbol("jq79.raw"),V=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ht];)t=t[ht];return t},yn=Symbol("jq79.store"),me=e=>e!==null&&typeof e=="object"&&e[yn]===!0,gt=null,fe=[],Y=null,Re=e=>{fe.push(new Set);let t=Y;Y=null;try{return e()}finally{fe.pop(),Y=t}},cr=e=>{e.adopted.forEach((t,n)=>{e.read?.has(n)||(t(),e.adopted.delete(n))})},pn=e=>{e.adopted?.forEach(t=>t()),e.adopted=null},dr=0,pt=new Set,hn="$__attach",gn="$__holds",qe=Symbol("jq79.alsoWakenBy"),yt=Symbol("jq79.owner"),Me=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,i=Object.create(null),o=fn(null,""),a=(f,u)=>{let m=o;return f.split(".").forEach(h=>{let S=m.children??(m.children=new Map),g=S.get(h);g||(g=fn(m,h),S.set(h,g)),m=g}),u.deep?or(m,u):rr(m,u),m},l=(f,u)=>{u.deep?ar(f,u):ir(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();$e(R,k=>u.add(k)),Ae(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],Ae(h,R=>u.add(R));let T=x.get(g);T&&$e(h,R=>{T.store[gn](R)||u.add(R)}),E===S.length-2&&S[E+1]==="length"&&($e(h,R=>u.add(R)),m(h))}return h=h.children?.get(S[S.length-1]),h&&($e(h,E=>u.add(E)),Ae(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},w=(f,u)=>{if(f.deep||u.size<2)return u;let m=new Set;u.forEach(g=>{g.endsWith(un)&&m.add(g.slice(0,-un.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},_=f=>{let u=null,m=null,h=null,S=pt,g=N=>h?h.has(N):u===N,E=N=>{let K=a(N,f);h?h.set(N,K):u===null?(u=N,m=K):(h=new Map([[u,m],[N,K]]),u=m=null)},T=N=>{if(h){h.forEach((K,F)=>{N.has(F)||(l(K,f),h.delete(F))});return}u!==null&&!N.has(u)&&(l(m,f),u=m=null)},R=()=>{h?h.forEach(N=>l(N,f)):m&&l(m,f),h=null,u=m=null},k=N=>{if(N.size===S.size){let F=!0;if(N.forEach(ge=>{F&&(F=S.has(ge))}),F)return}S=N;let K=w(f,N);T(K),K.forEach(F=>{g(F)||E(F)})};return f.reindex.add(k),k(f.deps),()=>{f.reindex.delete(k),R(),S=pt}},I=f=>{let u=c(f);if(u){let m=new Set;$e(u,h=>m.add(h)),Ae(u,h=>m.add(h)),j(m)}},z=f=>I(ft(f)),j=f=>{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),u.forEach(h=>{s.has(h)&&h.run()})},b=(f,u,m=!1)=>{t.get(f)?.forEach(h=>h(u,f)),n.forEach(h=>h(f,u)),m?s.forEach(h=>h.run()):j(d(f))},H=(f,u)=>f!==u&&f!==null&&u!==null&&typeof f=="object"&&typeof u=="object"&&!me(f)&&!me(u)&&Ie(f)&&Ie(u)&&Array.isArray(f)===Array.isArray(u),D=null,L=-1,U=(f,u)=>{let m=u.length>f.length,h=m?f:u,S=m?u:f,g=0;for(;g<h.length&&Object.is(V(h[g]),V(S[g]));)g++;for(let E=g;E<h.length;E++)if(!Object.is(V(h[E]),V(S[E+1])))return L;return g},se=(f,u)=>{if(Array.isArray(u)){let T=f.length,R=u.length,k=T!==R;if(!T||!R)return D;let N=Math.max(T,R);if(Math.abs(T-R)===1){let F=U(f,u);if(F!==L){let ge=[];for(let lt=F;lt<N;lt++)ge.push(String(lt));return{keys:ge,exact:!0,keysChanged:k}}}let K=[];for(let F=0;F<N;F++)if(!Object.is(V(f[F]),V(u[F]))&&(K.push(String(F)),K.length*2>=N))return D;return{keys:K,exact:!1,keysChanged:k}}let m=Object.keys(f),h=Object.keys(u),S=new Set([...m,...h]);if(!S.size)return D;let g=[];S.forEach(T=>{Object.is(V(f[T]),V(u[T]))||g.push(T)});let E=m.length!==h.length||m.some((T,R)=>T!==h[R]);return g.length*2>=S.size?D:{keys:g,exact:!1,keysChanged:E}},P=(f,u,m,h)=>{let S=new Set,g=T=>{let R=c(T);R&&($e(R,k=>S.add(k)),Ae(R,k=>S.add(k)))},E=se(u,m);if(!E)return b(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 N=V(m[T]),K=M(N)?G(N,R):N;k.forEach(F=>F(K,R))}E.exact?g(R):d(R).forEach(N=>S.add(N))}),E.keysChanged&&g(ft(f)),Array.isArray(m)&&u.length!==m.length){let T=`${f}.length`;t.get(T)?.forEach(R=>R(m.length,T)),g(T)}j(S)},M=f=>f!==null&&typeof f=="object"&&Ie(f),x=new Map,q=(f,u)=>{let m=x.get(u);m?.store!==f&&(m?.unsubscribe(),x.set(u,{store:f,unsubscribe:f.$onAny((h,S)=>b(`${u}.${h}`,S))}))},ee=f=>{x.get(f)?.unsubscribe(),x.delete(f)},G=(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 fe[fe.length-1]?.add(ft(u)),Y!==null&&Y.home!==s&&W(Y),Reflect.ownKeys(g)},get(g,E,T){if(E===ht)return g;if(E===yn)return u==="";if(typeof E!="string")return Reflect.get(g,E,T);if(u===""&&E in i)return i[E];let R=u?`${u}.${E}`:E;fe[fe.length-1]?.add(R),Y!==null&&Y.home!==s&&W(Y);let k=Reflect.get(g,E,T);if(me(k))return q(k,R),k;let N=V(k);return M(N)?G(N,R):N},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,N=me(T)?T:V(T),K=!Object.prototype.hasOwnProperty.call(g,E);if(!K&&Object.is(g[E],N)&&(N===null||typeof N!="object"))return!0;let F=g[E];g[E]=N,h?.delete(E),me(N)?q(N,k):ee(k);let ge=me(N)||!M(N)?N:G(N,k);return!K&&H(F,N)?P(k,F,N,ge):b(k,ge,K),!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),ee(k),b(k,void 0),z(u)}return R}});return r.set(f,S),S},Z=G(V(e),"");Object.entries(V(e)).forEach(([f,u])=>{me(u)&&q(u,f)});let y=(f,u,{immediate:m=!1}={})=>(t.has(f)||t.set(f,new Set),t.get(f).add(u),m&&u(sr(Z,f),f),()=>t.get(f)?.delete(u)),v=(f,{immediate:u=!1}={})=>(n.add(f),u&&mn(Z,"",(m,h)=>f(m,h)),()=>n.delete(f)),C=(f,{deep:u=!1,alsoWakenBy:m}={})=>{let h=!1,S=!1,g={deps:pt,reindex:new Set,deep:u,order:dr++,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;fe.push(k);let N=Y;Y=g;try{f()}finally{fe.pop(),Y=N,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&&cr(g),g.reindex.forEach(R=>R(g.deps))}}};s.add(g);let E=_(g),T=()=>{s.delete(g),E(),pn(g)};return m?.length?Q(g,m,T):(g.run(),gt=g,T)},Q=(f,u,m)=>{let h=u.map(S=>S?.[hn]?.(f)).filter(Boolean);return f.run(),gt=f,()=>{m(),h.forEach(S=>S())}},$=f=>{s.add(f);let u=_(f);return()=>{s.delete(f),u()}},W=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))},B=()=>{x.forEach(({unsubscribe:f})=>f()),x.clear(),s.forEach(f=>{f.home===s&&pn(f)})};return i.$on=y,i.$onAny=v,i.$effect=C,i.$dispose=B,i[hn]=$,i[gn]=f=>s.has(f),Z},mt=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[qe];this.options=n||s?{deep:n,alsoWakenBy:s}:void 0,this.ownedBy(t)}ownedBy(t){let n=t[yt];!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(gt)}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]()}},ye=(e,t=!1)=>new mt(e,t),Et=e=>{let t=Me({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 He=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,En=/\$:\s*/y,We=/import(?=\s*\()/y,wn=/\$:\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},te=(e,t)=>{let n=e.indexOf(`
|
|
2
|
+
`,t);return n===-1?e.length:n},ne=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},le=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=te(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=ne(e,n);continue}break}return n},ur=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 ur.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},fr=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,pr=(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""},bt=(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=te(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ne(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=le(e,s+1);if(!(i<e.length&&(fr.test(e.slice(i,i+2))||[",","="].includes(pr(e,s)))))return s;s=i;continue}}s++}return e.length},Sn=e=>{let t=[],n=0,s=0,r=0,i=a=>{t.push({raw:e.slice(s,a),codeEnd:Math.max(0,r-s)}),s=a+1,r=s},o=0;for(;o<e.length;){let a=e[o];if(a==="'"||a==='"'||a==="`"){o=re(e,o),r=o;continue}if(a==="/"&&e[o+1]==="/"){o=te(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=ne(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o),r=o;continue}if("([{".includes(a))n++;else if(")]}".includes(a))n--;else if(a===","&&n<=0){i(o),o++;continue}/\s/.test(a)||(r=o+1),o++}return i(e.length),t},Fe=e=>{let t=e.trim();if(!t.startsWith("{")&&!t.startsWith("["))return Ke.test(t)?[t]:[];let n=[];for(let s of $t(t.slice(1,bn(t)))){s.startsWith("...")&&(s=s.slice(3).trim());let r=Ge(s);if(r!==-1&&(s=s.slice(0,r).trim()),t.startsWith("{")){let i=Tt(s,":");if(i!==-1){n.push(...Fe(s.slice(i+1)));continue}}n.push(...Fe(s))}return n},hr=e=>{let t=[],n=Sn(e).map(({raw:i,codeEnd:o})=>{let a=i.match(/^\s*/)[0];if(o<=a.length)return{text:i,empty:!0};let l=i.slice(a.length,o),c=i.slice(o),d=Ge(l),p=(d===-1?l:l.slice(0,d)).trim(),w=l[0]==="{"||l[0]==="[";w?t.push(...Fe(p)):Ke.test(p)&&t.push(p);let _=ze(l).code;return{text:`${a}${w?`(${_})`:_}${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],a=e[s+1];if(o==="'"||o==='"'||o==="`"){let l=re(e,s);n+=e.slice(s,l),s=l,i=!1;continue}if(o==="/"&&(a==="/"||a==="*")){let l=a==="/"?te(e,s):ne(e,s);n+=e.slice(s,l),s=l;continue}if(o==="/"&&oe(e,s)){let l=ie(e,s);n+=e.slice(s,l),s=l,i=!1;continue}if(o==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(We.lastIndex=s,We.test(e))){n+="$__import",s+=6,i=!1;continue}if(r===0&&i){He.lastIndex=s;let l=He.exec(e);if(l){let d=s+l[0].length,p=bt(e,d),{vars:w,code:_}=hr(e.slice(d,p));t.push(...w),n+=_,s=p,i=!1;continue}En.lastIndex=s;let c=En.exec(e);if(c){wn.lastIndex=s;let d=wn.exec(e);d&&t.push(d[1]);let p=s+c[0].length,w=bt(e,p);n+=`$__effect(() => { ${ze(e.slice(p,w)).code} });`,s=w;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}},Ue=/export\s+default(?![\w$])/y,Be=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,gr=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},mr=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=gr(e),i=[],o=s;if(r.length>1){let a=`$__mod${n}`;i.push(`${a} = ${s}`),o=a}for(let a of r)a.startsWith("{")?i.push(`${a.replace(/\s+as\s+/g,": ")} = ${o}`):a.startsWith("*")?i.push(`${a.replace(/^\*\s*as\s+/,"")} = ${o}`):i.push(`${a} = $__default(${o})`);return`const ${i.join(", ")}`},Ke=/^[A-Za-z_$][\w$]*$/,bn=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=te(e,n);continue}if(s==="/"&&e[n+1]==="*"){n=ne(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},Tt=(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=te(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=ne(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},$t=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=te(e,r);continue}if(i==="/"&&e[r+1]==="*"){r=ne(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},Ge=e=>{let t=0;for(;t<e.length;){let n=Tt(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},ke=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=bn(t);if(n>=t.length)return null;let s=[];for(let r of $t(t.slice(1,n))){if(r.startsWith("..."))continue;let i=Ge(r),o=i===-1?r:r.slice(0,i),a=i===-1?void 0:r.slice(i+1).trim(),l=Tt(o,":"),c=(l===-1?o:o.slice(0,l)).trim();if(!Ke.test(c))continue;let d={name:c};a!==void 0&&(d.default=a);let p=l===-1?"":o.slice(l+1).trim();Ke.test(p)&&(d.as=p),s.push(d)}return s},yr=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=te(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=ne(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]))){Ue.lastIndex=t;let i=Ue.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},Er=/^async(?![\w$])/,wr=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Sr=e=>{let t=yr(e);if(t===-1)return null;let n=le(e,t),s=e.slice(n);Er.test(s)&&(n=le(e,n+5));let r=wr.exec(e.slice(n));if(r&&(n=le(e,n+r[0].length)),e[n]!=="(")return null;let i=0,o=n;for(;o<e.length;){let a=e[o];if(a==="'"||a==='"'||a==="`"){o=re(e,o);continue}if(a==="/"&&e[o+1]==="/"){o=te(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=ne(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o);continue}if("([{".includes(a))i++;else if(")]}".includes(a)&&--i===0)break;o++}return $t(e.slice(n+1,o))[0]??""},_e=e=>{let t=Sr(e);if(t===null)return null;let n=ke(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},Tn=e=>{let t="",n=0,s=0,r=!0,i=!1,o=0;for(;n<e.length;){let a=e[n],l=e[n+1],c=n===0||!/[\w$.]/.test(e[n-1]);if(a==="'"||a==='"'||a==="`"){let d=re(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(a==="/"&&(l==="/"||l==="*")){let d=l==="/"?te(e,n):ne(e,n);t+=e.slice(n,d),n=d;continue}if(a==="/"&&oe(e,n)){let d=ie(e,n);t+=e.slice(n,d),n=d,r=!1;continue}if(a==="i"&&c){if(We.lastIndex=n,We.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){Be.lastIndex=n;let d=Be.exec(e);if(d){t+=mr(d[1],d[3],o++),n+=d[0].length,r=!1;continue}}}if(a==="e"&&c&&s===0&&r){Ue.lastIndex=n;let d=Ue.exec(e);if(d){i=!0,t+="$__exports.default =",n+=d[0].length,r=!1;continue}}"([{".includes(a)?s++:")]}".includes(a)&&(s=Math.max(0,s-1)),a===`
|
|
7
|
+
`||a===";"||a==="}"?r=!0:/\s/.test(a)||(r=!1),t+=a,n++}return i?t:null},br=new Set(["true","false","null","undefined","this","typeof","instanceof","in","new","void","delete","of","await","yield","NaN","Infinity","arguments","case","do","else","return"]),Tr=new Set(["function","class","let","const","var","eval","with"]),$r=new Set(["$scope","$r","$t"]),Rr=/^(?:\+\+|--|=>|\*\*=|<<=|>>>=|>>=|&&=|\|\|=|\?\?=|[+\-*/%&|^]=(?!=))/,xr=/^(?:>>>|===|!==|\*\*|<<|>>|==|!=|<=|>=|&&|\|\||\?\?|\?\.)/,Nr=e=>/[A-Za-z_$]/.test(e),Pr=/^(?:0[xXbBoO][\da-fA-F_]+|\d[\d_]*(?:\.[\d_]*)?(?:[eE][+-]?\d+)?)n?/,Rt=e=>{let t=new Set,n=[0],s=[],r=!1,i="",o=0;for(;o<e.length;){let a=e[o];if(/\s/.test(a)){o++;continue}if(a==="/"&&e[o+1]==="/"){o=te(e,o);continue}if(a==="/"&&e[o+1]==="*"){o=ne(e,o);continue}if(a==="/"&&oe(e,o)){o=ie(e,o),i="value";continue}if(a==='"'||a==="'"){o=re(e,o),i="value";continue}if(a==="`"){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,w=d+=2;for(;d<e.length&&p>0;)e[d]==="{"?p++:e[d]==="}"&&p--,d++;let _=Rt(e.slice(w,d-1));if(_===null)return null;_.forEach(I=>t.add(I));continue}d++}o=d,i="value";continue}if(/\d/.test(a)&&i!=="."&&i!=="?."){let d=Pr.exec(e.slice(o));o+=d?d[0].length:1,i="value";continue}if(Nr(a)){let d=o;for(;d<e.length&&/[\w$]/.test(e[d]);)d++;let p=e.slice(o,d);if(o=d,Tr.has(p))return null;if(i==="."||i==="?."){i="value";continue}if(br.has(p)){i=p==="this"?"value":"op";continue}if($r.has(p))return null;let w=o;for(;w<e.length&&/\s/.test(e[w]);)w++;if(e[w]==="(")return null;e[w]===":"&&e[w+1]!==":"&&s[s.length-1]==="{"&&n[n.length-1]===0||t.add(p),i="value";continue}let l=e.slice(o);if(Rr.test(l))return null;let c=xr.exec(l);if(c){(c[0]==="&&"||c[0]==="||"||c[0]==="??")&&(r=!0),i=c[0]==="?."?"?.":"op",o+=c[0].length;continue}if(a==="=")return null;a==="("||a==="["||a==="{"?(s.push(a),n.push(0)):a===")"||a==="]"||a==="}"?(s.pop(),n.length>1&&n.pop()):a==="?"?(n[n.length-1]++,r=!0):a===":"&&n[n.length-1]>0&&n[n.length-1]--,i=a,o++}return r&&t.size>1?null:[...t]},wt=/(?:await\s+)?(?:import\s*\(|(\$importAll)\s*\(\s*\[|(C79|Component79)\s*\.\s*(fetch|fetchAll|importAll)\s*\(\s*(\[)?)/y,St=/(["'])([^"'\n\\]+)\1/y,vr=/^(?:(?:if|for|while|with)\b[\s\S]*\)|[\s\S]*\b(?:else|do))$/,Cr=(e,t)=>{wt.lastIndex=0;let n=wt.exec(e);if(!n)return[];let[,s,r,i,o]=n;if(t.has(s??r??""))return[];let a=s!==void 0||o!==void 0;if(i!==void 0&&i==="fetch"===a)return[];let l=r===void 0?"component":i==="importAll"?"page":"fetch",c=[],d=le(e,wt.lastIndex);for(;;){St.lastIndex=d;let p=St.exec(e);if(!p)return c;let w=le(e,St.lastIndex),_=e[w];if(!a)return _===")"||_===","?[{spec:p[2],kind:l}]:[];if(_!==","&&_!=="]"||(c.push({spec:p[2],kind:l}),_==="]"))return c;d=le(e,w+1)}},$n=e=>{let t=[];for(let o=le(e,0);o<e.length;o=le(e,o+1)){let a=bt(e,o);t.push(e.slice(o,a).trim().replace(/^export\s+(?!default\b)/,"")),o=a}let n=o=>{He.lastIndex=0;let a=He.exec(o);return a?Sn(o.slice(a[0].length)).map(({raw:l})=>{let c=l.trim(),d=Ge(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:a})=>Fe(a).forEach(l=>s.add(l))));let r=[],i=!1;for(let o of t){if(!i){Be.lastIndex=0;let a=Be.exec(o);if(a)/^type\s/.test(a[1]??"")||r.push({spec:a[3],kind:"component"});else{let l=n(o);for(let c of l?l.map(({init:d})=>d):[o])r.push(...Cr(c,s))}}i=vr.test(o)}return r};var ae=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),Ve=e=>e.replace(/[A-Z]/g,t=>`-${t.toLowerCase()}`),Ar=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),Mr=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,Nt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,kr=e=>e.split(Nt).map((t,n)=>n%2===1?t:t.replace(Mr,(s,r,i)=>Ar.has(r.toLowerCase())?s:`<${r}${i}></${r}>`)).join(""),xn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,_r=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,Or=e=>e.split(Nt).map((t,n)=>n%2===1?t:t.replace(xn,(s,r,i)=>{let o=0,a=i.replace(_r,(l,c,d)=>d===void 0?l:`${c}:props.${o++}="${d}"`);return`<${r}${a}>`})).join(""),jr=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,Lr=/<\/slot\.([\w.$-]+)(\s*)>/gi,Dr=/^slot\./i,Ir=e=>Dr.test(e)?`slot.${Ve(e.slice(5))}`:e,Oe=":jq79-component",Nn=/^[A-Z]/,qr="c79-",je=e=>`${qr}${Ve(e[0].toLowerCase()+e.slice(1))}`,Hr=e=>Nn.test(e)?je(e):Ir(e),Wr=/<\/([A-Z][\w.-]*)(\s*)>/g,Fr=/\/\s*$/,Ur=(e,t)=>{if(!Nn.test(e))return t;let n=` ${Oe}="${e}"`,s=Fr.exec(t);return s?`${t.slice(0,s.index)}${n}${s[0]}`:`${t}${n}`},Br=e=>e.split(Nt).map((t,n)=>n%2===1?t:t.replace(xn,(s,r,i)=>{let o=i.replace(jr,(a,l,c)=>c===void 0?a:`${l}${Ve(c)}`);return`<${Hr(r)}${Ur(r,o)}>`}).replace(Lr,(s,r,i)=>`</slot.${Ve(r)}${i}>`).replace(Wr,(s,r,i)=>`</${je(r)}${i}>`)).join(""),Pn=e=>kr(Or(Br(e))),vn=/^[A-Z][A-Za-z0-9]*$/,xt=/{{\s*([\s\S]+?)\s*}}/g,Rn=new Map,Pt=e=>{let t=Rn.get(e);if(t)return t;let n=[],s=0;xt.lastIndex=0;for(let r=xt.exec(e);r;r=xt.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)),Rn.set(e,n),n},vt=new Set([":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),Ee=e=>vt.has(e)||e.startsWith(":class.")||e.startsWith(":props.")||e===":slot"||e.startsWith(":slot."),Cn=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ze=e=>e==="slot"||e.startsWith("slot."),Ct=e=>e?ae(e):"default",At=e=>`${e}
|
|
8
|
+
= $value`,Mt=["$scope","$r"],An=e=>`with ($scope) { return (${e}
|
|
9
|
+
); }`,Mn=(e,t)=>{let n=Rt(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
|
+
);`},Qe=(e,t)=>`${e.join(",")}
|
|
11
|
+
${t}`,kt=e=>`await $mounted();${e}`,kn=e=>["$scope","$__effect","$__import","$__state",...e],_n=e=>`return (async () => { with ($scope) { ${e} }
|
|
12
|
+
;$__state.done = true })()`,On=e=>["$__exports","$__default","$__import",...e],jn=e=>`return (async () => { "use strict";
|
|
13
13
|
${e}
|
|
14
|
-
;$__exports.done = true })()`,
|
|
14
|
+
;$__exports.done = true })()`,Ln=e=>{let t=e.attrs[":setup"];return t===void 0?null:t.trim()===""?[]:ke(t)},Dn=(e,t)=>{let n=new Set;return e.forEach(s=>{(_e(s.content)??t(s))?.forEach(({name:i})=>n.add(i))}),n};var In="__jq79precompiled",qn="jq79-precompiled",Hn=(e,t)=>`function anonymous(${e.join(",")}
|
|
15
15
|
) {
|
|
16
16
|
${t}
|
|
17
|
-
}`;var kr="0.7.10",ns=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),ss="http://www.w3.org/1999/xhtml",rs=e=>{let t=ns(e),n=e.namespaceURI,s=t[Oe];delete t[Oe];let r=n!==null&&n!==ss;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?[rs(i)]:[]})}},Ze=new Map,Ve=new Map,Ut=!1,_t,Ne=class extends Error{constructor(n,s){super(`${n}. ${s}`);M(this,"reason",n);M(this,"hint",s)}},Or=()=>new Ne("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),_r=(e,t)=>{let n=globalThis[Mn];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))Ve.set(ze(s,r),i);return Ve.size===0?void 0:Ve.get(ze(e,t))},Bt=(e,t,n="")=>{let s=_r(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(_t!==void 0)return jr(e,t,n,_t);if(Ut)throw Or();return new Function(...e,t+n)},os=()=>{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}},On="__jq79built",jr=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${On} = ${kn(e,t)}${n}`;let i,o=l=>{i=l.error??new SyntaxError(l.message),l.preventDefault()};window.addEventListener("error",o);try{(document.head??document.documentElement).append(r)}finally{window.removeEventListener("error",o),r.remove()}let a=r[On];if(typeof a=="function")return Ve.set(ze(e,t),a),a;throw i!==void 0?i:new Ne("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},_n=new Set,Lr=(e,t)=>{_n.has(e)||(_n.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},vt=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},is=(e,t)=>{try{return Bt([...xt,...t],Tn(e))}catch(n){return n instanceof Ne&&Lr(e,n),null}},Dr=(e,t)=>{if(!le.scopedNames)return null;let n=$n(e,t);if(n===null)return null;try{return Bt([...xt,...t],n)}catch{return null}},as=(e,t,n)=>{let s=Ze.get(e);if(s===void 0){let r=Dr(t,n);s=r?{fn:r,scoped:!0}:{fn:is(t,n),scoped:!1},Ze.set(e,s)}return s},ls=(e,t)=>`${t.join(",")}|${e}`,Ir=(e,t)=>as(ls(e,t),e,t).fn,qr=(e,t,n)=>{let s=is(t,n);return Ze.set(e,{fn:s,scoped:!1}),s},Hr=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,Wr=100,we=new Map,Kt=new Set,Qe=0,jt=!1,Lt=new Set,Fr=()=>{jt=!1,!(Qe>0)&&(we.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(Kt.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 = () => {}".`))}),we.clear())},cs=()=>{jt||Qe>0||!we.size||(jt=!0,queueMicrotask(Fr))},ds=e=>{Qe++;let t=()=>{Qe--,cs()};e.then(t,t)},Ur=(e,t)=>{if(Lt.has(e))return;Lt.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.`)},us=(e,t,n)=>{if(!(n instanceof ReferenceError))return Ur(e,n);let s=Hr.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;Kt.has(i)||we.has(i)||we.size>=Wr||(we.set(i,{name:r,expr:e,scope:t}),cs())},fs=(e,t,n)=>{let s=n?Object.keys(n):[],r=ls(e,s),{fn:i,scoped:o}=as(r,e,s);if(!i)return;let a=n?Object.values(n):[];if(!o)return i(t,vt,...a);try{return i(t,vt,...a)}catch(l){if(!(l instanceof ReferenceError))throw l;let f=qr(r,e,s);if(!f)throw l;return f(t,vt,...a)}},_=(e,t,n)=>{try{return fs(e,t,n)}catch(s){us(e,t,s);return}},ps=(e,t,n)=>{try{return fs(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;us(e,t,s);return}},hs=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(_(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(_(s.expr,t)??"");return n},gs=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,a=>{if(o.has("self")&&a.target!==e)return;o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation();let l=ps(n,s,{$event:a});typeof l=="function"&&l.call(e,a)},{once:o.has("once"),capture:o.has("capture")})},Br=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),a=l=>{o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation(),o.has("once")&&e.off(r,a),$e(()=>{let f=ps(n,s,{$event:l});typeof f=="function"&&f(l)})};e.on(r,a)},zt=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},nt=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Kr=e=>{e.forEach(t=>{if(t.first===t.last)return nt(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},zr=(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},Gr=({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}},jn=(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},Ee=null,Xe=null,ms=new WeakSet,Vr=e=>{let t={memo:Ee,base:Xe};return Ee=new Map,Xe=e,t},Zr=e=>{Ee=e.memo,Xe=e.base},Ln=(e,t)=>e.component!==void 0?Dn(t,e.component):e.tag.includes("-")?Dn(t,e.tag):null,X=e=>e.component??e.tag,Dn=(e,t)=>{if(!Ee)return jn(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===Xe){if(Ee.has(t))return Ee.get(t);let r=jn(s,t);return Ee.set(t,r),r}if(!ms.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},Qr=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()},Xr=(e,t)=>{let n=Qr(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)"}.`)},In=100,Pt=0,ys=Symbol("jq79.slots"),Le=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),Yr=e=>e==="default"?":slot":`:slot.${e}`,Jr=e=>typeof e!="string"||e.trim()!=="",eo=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?Le(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=$t(i.slice(6));if(o in t){console.warn(`jq79: two <template ${Yr(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(Jr);return s&&"default"in t?console.warn(`jq79: <${X(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},to=(e,t,n)=>{Ae(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let a=n[s]?.();return a===void 0&&i!==void 0?_(i,e):a},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},no=e=>{let t=Le(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}`)},so=(e,t)=>{let n=Object.entries(eo(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=ro(i,t)}),s},ro=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);to(o,e.binder,n);let a=o[Ie]??[];Object.defineProperty(o,Ie,{value:[...a,s]});let l=me(o);return l.ownedBy(s),r.onDispose(()=>l.dispose()),be(e.nodes,o,l,i)},oo=(e,t,n,s)=>{let r=$t(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),a=document.createComment(`/${e.tag}`);i.append(o,a);let l=t[ys]?.[r];if(!l)return i.insertBefore(be(e.children,t,n,s),a),i;let f={};return Object.entries(e.attrs).forEach(([d,p])=>{if(!(d===ve||ye(d)||d.startsWith("@")))if(d.startsWith(":")){let S=p||d.slice(1);f[ae(d.slice(1))]=()=>_(S,t)}else f[ae(d)]=()=>p}),i.insertBefore(l(f,t,n,s),a),i},Es="data-c79-box",io=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(_e(e));s.setAttribute(Es,"");let r=t.attrs[ve];return r!==void 0&&s.setAttribute(ve,r),n||zo(),s},qn=new WeakSet,ao=(e,t)=>{if(e.ns===void 0||qn.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;qn.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${X(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}`)},Hn=(e,t,n,s,r)=>{let i=io(e,t,r),o=!(i instanceof DocumentFragment),a=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),a);let l=so(t,n),f={},d={},p=[],S=[],O=!1;Object.entries(t.attrs).forEach(([v,A])=>{if(v!==ve){if(v===":props"||v.startsWith(":props.")){O=!0,S.push({expr:A});return}if(!ye(v))if(v.startsWith("@"))p.push([v,A]);else if(v===":model"||v.startsWith(":model.")){let x=v===":model"?"default":ae(v.slice(7));d[x]=A||(v===":model"?"model":x)}else if(v.startsWith(":")){let x=ae(v.slice(1));f[x]=A||x,S.push({name:x,expr:A||x})}else{let x=ae(v),q=JSON.stringify(A);f[x]=q,S.push({name:x,expr:q})}}});let I=v=>v==="default"?":model":`:model.${v}`,z=v=>v==="default"?"model":v,j=new Set;Object.entries(d).forEach(([v,A])=>{let x=z(v);f[x]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${x}" through both :${x} and ${I(v)} - ${I(v)} wins`),f[x]=A,Ir(Rt(A),["$value"])===null&&(j.add(v),console.warn(`jq79: ${I(v)}="${A}" is not assignable - updates from <${X(t)}> will be dropped`))});let b=()=>{let v={};return S.forEach(({name:A,expr:x})=>{if(A!==void 0)v[A]=_(x,n);else{let q=_(x,n);q!==null&&typeof q=="object"&&Object.assign(v,q)}}),Object.entries(d).forEach(([A,x])=>{v[z(A)]=_(x,n)}),v},H=null,D=null,L=null,U=new Set,se=v=>{if(v==null){if(!n[Os]?.has(e)||U.has("unfilled"))return;U.add("unfilled"),console.error(`jq79: <${X(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}U.has("type")||(U.add("type"),console.error(`jq79: <${X(t)}> is ${typeof v}, not a component - nothing renders here`))};return s.effect(()=>{let v=_(e,n),A=v instanceof de?v:null;if(A||se(v),A===D||(L?.dispose(),L=null,H?.destroy(),H=null,D=A,!A))return;ao(t,A);let x=new de({template:A.template,scripts:A.scripts,styles:A.styles,modules:A.modules,filename:A.filename,siblings:A.siblings,name:A.name});if(l&&(x.slots=l),Object.keys(d).length){let P=new Set;x.modelWriteback=(C,Q)=>{let $=C==null?"default":ae(String(C)),W=d[$];return W===void 0?(P.has($)||(P.add($),console.warn(`jq79: <${X(t)}> has no ${I($)} - bound: ${Object.keys(d).map(I).join(", ")}`)),!1):j.has($)?!1:($e(()=>_(Rt(W),n,{$value:Q})),!0)}}p.forEach(([P,C])=>Br(x,P,C,n));let q=Xo(x.scripts);Yo(t,e,Object.keys(f),q);let J=Yn($e(b),q),G=document.createDocumentFragment();if(Pt>=In){console.error(`jq79: <${X(t)}> is ${In} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Pt++;try{(r?x.renderShadow(J):x.render(J)).mount(G)}finally{Pt--}let Z=n[tt];Z&&x.holdOwner(Z.owner),a?a.parentNode.insertBefore(G,a):i.appendChild(G);let y=me(n,!0);if(O){let P=[];y.effect(()=>{let C=Yn(b(),q),Q=Object.keys(C);P.forEach($=>{$ in C||(x.data[$]=void 0)}),Q.forEach($=>{x.data[$]=C[$]}),P=Q})}else Object.entries(f).forEach(([P,C])=>{q!==null&&!q.has(P)||y.effect(()=>{x.data[P]=_(C,n)})});L=y,H=x}),s.onDispose(()=>{L?.dispose(),H?.destroy()}),i},lo=(e,t)=>{let n=()=>{let s=_(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)}})},pe=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(pe):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?pe(t):[]):[],co=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?Yt(e):()=>!1,uo=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"]),ws=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),fo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Wn=new Map,po=(e,t)=>{let n=`${e} ${t}`,s=Wn.get(n);if(s!==void 0)return s;let r=fo[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,a]=r;i=new DOMParser().parseFromString(`<${o}><${a} ${t}="x"/></${o}>`,"text/html").querySelector(a)?.getAttributeNames().find(f=>f.toLowerCase()===t)??t}return Wn.set(n,i),i},Ss=(e,t)=>{let n=e.namespaceURI;if(n===null||n===ss)return t;let s=t.replace(/-/g,"").toLowerCase(),r=po(n,s);return r===s?t:r},bs=(e,t,n)=>{let s=uo.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},le={cloneSkeletons:!0,scopedNames:!0},ho=new Set([":text",":html",":value",":checked",":selected"]),go=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||ho.has(e)?!0:e.startsWith(":")?e===":model"?!1:!ye(e)&&!e.includes("."):e!==Oe,Ts=e=>{if(e.component||e.tag.includes("-")||Ke(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!go(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||Ts(t))},$s=(e,t,n)=>{let s=ws(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(!ye(p))if(p.startsWith(":")){let O=p.slice(1);n.push({kind:"attr",path:t,name:Ss(s,O),expr:S||ae(O)})}else s.setAttribute(p,S)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(pe(e.attrs.class??""))});let o=e.attrs[":text"],a=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):a!==void 0?n.push({kind:"html",path:t,expr:a}):e.children.forEach((p,S)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,S],parts:bt(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild($s(p,[...t,S],n))});let l=e.attrs[":value"];l!==void 0&&n.push({kind:"value",path:t,expr:l});let f=e.attrs[":checked"];f!==void 0&&n.push({kind:"checked",path:t,expr:f});let d=e.attrs[":selected"];return d!==void 0&&n.push({kind:"selected",path:t,expr:d}),s},mo=3,Rs=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:Rs(n)),0),Fn=new WeakMap,Un=new WeakSet,yo=e=>{let t=Fn.get(e);if(t!==void 0)return t;if(!Un.has(e))return Un.add(e),null;let n=null;if(Ts(e)&&Rs(e)>=mo){let s=[];n={skeleton:$s(e,[],s),ops:s}}return Fn.set(e,n),n},Eo=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},wo=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:Eo(s,r.path);if(r.kind==="text"){let o=i,a=r.parts;n.effect(()=>{let l=hs(a,t);o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="event")gs(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:a,expr:l}=r;n.effect(()=>bs(o,a,_(l,t)))}else if(r.kind==="class"){let o=i,{classExpr:a,toggles:l,staticClasses:f}=r,d=[];n.effect(()=>{let p=a!==void 0?pe(_(a,t)):[];l?.forEach(([S,O])=>{_(O,t)&&p.push(...pe(S))}),d.forEach(S=>{!p.includes(S)&&!f.has(S)&&o.classList.remove(S)}),o.classList.add(...p),d=p})}else if(r.kind==="textContent"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(_(a,t)??"");o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="html"){let o=i,{expr:a}=r;n.effect(()=>{o.innerHTML=it(String(_(a,t)??""))})}else if(r.kind==="value"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(_(a,t)??"");o.value!==l&&(o.value=l)})}else if(r.kind==="checked"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!_(a,t);o.checked!==l&&(o.checked=l)})}else if(r.kind==="selected"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!_(a,t);o.selected!==l&&(o.selected=l)})}else{let o=r}}return s},Gt=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?lo(r,t):t;if(Ke(e.tag))return oo(e,i,n,s);if(e.tag==="template"&&Le(e)!==void 0)return no(e);let o=Ln(e,i);if(o)return Hn(o,e,i,n,s);if(le.cloneSkeletons){let b=yo(e);if(b)return wo(b,i,n)}let a=ws(e);if(e.component!==void 0&&i[tt]?.count===0)throw Xr(e.component,i);let l=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(l){let b=!1;n.effect(()=>{if(b)return;let H=Ln(e,i);if(!H)return;b=!0;let D=Hn(H,e,i,n,s),L=zt(D);n.onDispose(()=>nt(L)),a.replaceWith(D)})}for(let b in e.attrs){let H=e.attrs[b];if(b.startsWith("@"))gs(a,b,H,i);else if(b===":model"||b.startsWith(":model."))l||console.warn(`jq79: ${b} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!ye(b))if(b.startsWith(":"))if(l)a.setAttribute(b,H);else{let D=b.slice(1),L=H||ae(D),U=Ss(a,D);n.effect(()=>bs(a,U,_(L,i)))}else a.setAttribute(b,H)}let f=e.attrs[":class"],d=null;for(let b in e.attrs)b.startsWith(":class.")&&(d??(d=[])).push([b.slice(7),e.attrs[b]]);if(f!==void 0||d){let b=new Set(pe(e.attrs.class??"")),H=[];n.effect(()=>{let D=f!==void 0?pe(_(f,i)):[];d?.forEach(([L,U])=>{_(U,i)&&D.push(...pe(L))}),H.forEach(L=>{!D.includes(L)&&!b.has(L)&&a.classList.remove(L)}),a.classList.add(...D),H=D})}let p=e.attrs[":text"],S=e.attrs[":html"],O=e.attrs[":html.allowed"];O!==void 0&&S===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let b=String(_(p,i)??"");a.textContent!==b&&(a.textContent=b)}):S!==void 0?n.effect(()=>{let b=O!==void 0?{allowUrl:co(_(O,i))}:void 0;a.innerHTML=it(String(_(S,i)??""),b)}):a instanceof HTMLTemplateElement?be(e.children,i,n,s,a.content):be(e.children,i,n,s,a);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let b=String(_(I,i)??"");a.value!==b&&(a.value=b)});let z=e.attrs[":checked"];z!==void 0&&n.effect(()=>{let b=!!_(z,i);a.checked!==b&&(a.checked=b)});let j=e.attrs[":selected"];return j!==void 0&&n.effect(()=>{let b=!!_(j,i);a.selected!==b&&(a.selected=b)}),a},So=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,a=null,l=null;return n.effect(()=>{let f=e.find(p=>p.expr===void 0||_(p.expr,t))??null;if(f===a||(l?.dispose(),o&&nt(o),o=null,a=f,!f))return;l=me(t);let d=Gt(f.node,t,l,s);o=zt(d),r.parentNode.insertBefore(d,r.nextSibling)}),n.onDispose(()=>l?.dispose()),i},Re=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},bo=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,a=n.length;for(;o<a;){let l=o+a>>1;e[n[l]]<i?o=l+1:a=l}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},To=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},xs=(e,t)=>typeof e=="string"?t.some(n=>Kn(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Kn(n,s)))||e.children.some(n=>xs(n,t)),Ns=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("-")||Ke(e.tag)||e.children.some(Ns)),Bn=/[A-Za-z0-9_$]/,$o=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Kn=(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(!Bn.test(s)&&!Bn.test(r))return!0}return!1},Ct=new WeakMap,Ro=e=>{let t=Ct.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(bn);if(!n)return Ct.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],a=o===s,l=o!==void 0&&!a&&$o.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:f,[":key"]:d,...p}=e.attrs,S={...e,attrs:p},O=["$index",...r?[r]:[]],I=xs(S,O),z=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),j=o!==void 0&&Ns(S),b={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:a,keyProp:l,itemNode:S,readsPosition:I,namesComponent:z,nestsScopes:j};return Ct.set(e,b),b},xo=(e,t,n,s)=>{let r=Ro(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:a,keyExpr:l,keyIsItem:f,keyProp:d,itemNode:p,readsPosition:S,namesComponent:O,nestsScopes:I}=r,z=document.createComment("each"),j=document.createDocumentFragment();j.appendChild(z),(":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 b=[],H=!1;return n.effect(()=>{let D=Vr(t);try{let L=_(a,t),U=Array.isArray(L),se=U?null:To(L)?Object.keys(L):[],v=U?L.length:se.length,A=new Map;b.forEach(($,W)=>{$.pos=W;let B=A.get($.key);B?B.push($):A.set($.key,[$])});let x=new Set,q=[],J=[],G=[],Z=[],y;for(let $=0;$<v;$++){let W=U?$:se[$],B=U?L[$]:L[W],u=W;f?u=B:d!==void 0&&B!==null&&typeof B=="object"?u=B[d]:l!==void 0&&(y===void 0?(y=Object.create(t),Re(y,i,B),o&&Re(y,o,W),Re(y,"$index",$)):(y[i]=B,o&&(y[o]=W),y.$index=$),u=_(l,y)),x.has(u)&&!H&&(H=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),x.add(u);let c=A.get(u)?.shift();if(c&&Object.is(c.item,B)){let g=c.scope;g.$index!==$&&(S&&q.push(c),g.$index=$),o&&g[o]!==W&&(g[o]=W),G.push(c),Z.push(c.pos);continue}if(c&&l!==void 0){let g=c.scope;g[i]=B,g.$index!==$&&(g.$index=$),o&&g[o]!==W&&(g[o]=W),c.item=B,J.push(c),G.push(c),Z.push(c.pos);continue}c&&(c.fx.dispose(),nt(c.range));let m=Object.create(t);Re(m,i,B),o&&Re(m,o,W),Re(m,"$index",$),O||ms.add(m);let h=me(t);I&&Object.defineProperty(m,ft,{value:h});let w=zt(Gt(p,m,h,s));G.push({key:u,item:B,scope:m,fx:h,range:w,pos:$}),Z.push(-1)}let P=new Set;A.forEach($=>$.forEach(W=>P.add(W))),P.size&&(P.forEach($=>{$.dead=!0,$.fx.dispose()}),Kr(zr(b,$=>$.dead===!0)));let C=z,Q=bo(Z);G.forEach(($,W)=>{!Q[W]&&C.nextSibling!==$.range.first&&Gr($.range,C),C=$.range.last}),q.forEach($=>$e(()=>$.fx.refresh())),J.forEach($=>$e(()=>$.fx.rerun())),b=G}finally{Zr(D)}}),n.onDispose(()=>b.forEach(D=>D.fx.dispose())),j},vs=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Mt=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 <${X(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},No=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${X(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 <${X(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`)},vo=[":if",":elseif",":else",":each"],Po=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=vo.find(s=>s in e.attrs);if(n!==void 0){if(Le(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${Le(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`)}},Co=[...Tt,":model",":slot"].map(e=>e.slice(1)),Mo={":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'},Ao=e=>{for(let t in e.attrs){let n=Mo[t];n!==void 0&&console.warn(`jq79: ${n}`)}},ko=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||ye(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=Co.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`)}},Ps=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Po(s,t),Ao(s),ko(s),Ps(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(Mt(r),":if"in r.attrs){s++;let i=a=>{let l=vs(e,s),f=e[l];if(typeof f=="object"&&a in f.attrs)return s=l+1,f};for(let a=i(":elseif");a;a=i(":elseif"))Mt(a);let o=i(":else");o&&Mt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&No(r,n),n=!1,s++}},zn=new WeakMap,Oo=(e,t,n)=>{let s=zn.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=f=>{let d=vs(e,i),p=e[d];if(typeof p=="object"&&f in p.attrs)return i=d+1,p};for(let f=o(":elseif");f;f=o(":elseif"))r.push({expr:f.attrs[":elseif"],node:f});let a=o(":else");a&&r.push({node:a});let l={branches:r,next:i};return zn.set(t,l),l},be=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let a=e[o];if(typeof a=="string"){let l=document.createTextNode(a);if(a.includes("{{")){let f=bt(a);n.effect(()=>{let d=hs(f,t);l.textContent!==d&&(l.textContent=d)})}i.appendChild(l),o++;continue}if(":each"in a.attrs){i.appendChild(xo(a,t,n,s)),o++;continue}if(":if"in a.attrs){let l=Oo(e,a,o);i.appendChild(So(l.branches,t,n,s)),o=l.next;continue}i.appendChild(Gt(a,t,n,s)),o++}return i},xi=(e,t,n=!1)=>be(e.template,t,me(t),n),ve="data-jq79",_o=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)},Cs=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[ve]=t,Cs(n.children,t))})},jo=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),i=r===-1?s:s.slice(0,r),o=r===-1?"":s.slice(r);return`${i}[${ve}="${t}"]${o}`}).join(", "),Ms=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=jo(n.selectorText,t):n instanceof CSSGroupingRule&&Ms(n.cssRules,t)})},Lo=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Do=/[a-z]/,Io=e=>e.replace(Lo,(t,n,s)=>Do.test(s)?`${n}${_e(s)}`:t),qo=/^\s*@(media|supports|container|layer|scope|document)\b/i,Ho=/^\s*@/,Wo=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Ho.test(s)?Io(n):n,n=""},a=f=>{o(),t+=f,s+=f},l=(f,d)=>{o(),t+=f,s="",d!==void 0?r.push(d):f==="}"&&r.pop()};for(let f=0;f<e.length;){let d=e[f];if(d==="/"&&e[f+1]==="*"){let p=e.indexOf("*/",f+2),S=p===-1?e.length:p+2;a(e.slice(f,S)),f=S}else if(d==='"'||d==="'"){let p=f+1;for(;p<e.length&&e[p]!==d;)p+=e[p]==="\\"?2:1;a(e.slice(f,Math.min(p+1,e.length))),f=p+1}else d==="{"?(l("{",qo.test(s)),f++):d==="}"||d===";"?(l(d),f++):(n+=d,s+=d,f++)}return o(),t},Fo=(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=new CSSStyleSheet;return n.replaceSync(e),Ms(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
|
18
|
-
`)},
|
|
19
|
-
//# sourceURL=${e}?jq79-script=${t}`:"",ks=(e,t,n)=>{try{return Bt(e,t,Ko(n.filename,n.index??0))}catch(s){throw s instanceof Ne?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}},Zn=e=>e.scoped??e.content,je=`:where([${Es}]) { display: contents }`,Vt=()=>Ut&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,Je=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},Zt=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},It=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},Ge=null,qt=null,zo=()=>{if(Vt()){Zt(document,qt??(qt=Je(je)));return}Ge?.isConnected||(Ge=document.createElement("style"),Ge.textContent=je,document.head.appendChild(Ge))},et=new Map,Go=e=>{let t=et.get(e);if(!t){if(Vt()){let n=Je(e);Zt(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}}et.set(e,t)}t.count++},Vo=e=>{let t=et.get(e);t&&--t.count<=0&&(t.sheet?It(document,t.sheet):t.el?.remove(),et.delete(e))},Zo=(e,t,n,s={},r=Ye,i={})=>{let o={...js,...s},a=new Proxy(t,{has:(d,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(d,p)||!(p in globalThis)&&!(p in o))}),l={},f=ks(Rn(Object.keys(o)),xn(e),i)(a,n,r,l,...Object.values(o));return f.catch(d=>console.error("jq79: error in :setup script",d)),ds(f),{settled:f,sync:l.done===!0}},Qn=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:_(s,e))})},Ht=e=>{let t=Pn(e);return!t&&e.attrs[":setup"]!==void 0&&Qo(e,e.attrs[":setup"]),t},Xn=new WeakSet,Qo=(e,t)=>{t.trim()==="_"||Xn.has(e)||(Xn.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`))},Xo=e=>{let t=null;return e.forEach(n=>{let s=ke(n.content)??Ht(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},Yn=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},Jn=new WeakMap,Yo=(e,t,n,s)=>{if(s===null)return;let r=Jn.get(e)??new Set;Jn.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`))})},Jo=(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},Os=Symbol("jq79.unfilledProps"),tt=Symbol("jq79.pendingScripts"),ei=e=>e&&e.default!==void 0?e.default:e,ti=(e,t,n,s={},r=Ye,i={})=>{let o={...js,...s},a={},l=ks(Nn(Object.keys(o)),vn(e),i)(a,ei,r,...Object.values(o)),f=I=>console.error("jq79: error in factory script",I),d=!1,p,S=()=>{if(d)return p;d=!0;let I=a.default;if(typeof I!="function")return;let z=j=>{j&&typeof j=="object"&&Object.assign(t,j)};try{let j=I(t,{$data:t,$props:t,$effect:n,...s});j instanceof Promise?p=j.then(z).catch(f):z(j)}catch(j){f(j)}return p},O=l.then(S,f);return ds(O),a.done&&S(),{settled:O,sync:a.done===!0&&p===void 0}},ni="__JQ79_HMR_ENABLED__",si="__JQ79_HMR__",Se=null,ri=e=>{if(!Se||!e.filename)return;let t=Se.get(e.filename);t||Se.set(e.filename,t=new Set),t.add(new WeakRef(e))},At=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},oi=(e,t)=>{if(!Se)return 0;let n=At(e),s=Dt(t);ne?.forEach((a,l)=>{At(l)===n&&ne.set(l,Promise.resolve(t))});let r=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,o=0;for(let[a,l]of Se)if(At(a)===n){for(let f of l){let d=f.deref();if(!d){l.delete(f);continue}let p=i(d);if(!p){r=!0;continue}d.hotReplace(p)&&o++}l.size||Se.delete(a)}return r?0:o},ii=()=>{Se??(Se=new Map),globalThis[si]={update:oi}},es=3e3,ai=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${es/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.`)},es);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},li=e=>{if(As.test(e))return e;let t=import.meta.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},ne=new Map,ci=e=>{try{return new URL(e,document.baseURI).href.replace(/#.*$/,"")}catch{return e}},ts=e=>Promise.all([fetch(e).then(t=>{if(!t.ok)throw new Error(`failed to fetch component from ${e}: ${t.status}`);return t.text()}),_s?.then(()=>pi(e))]).then(([t])=>t),di=e=>{if(!ne)return ts(e);let t=ci(e),n=ne.get(t);if(!n){n=ts(e),ne.set(t,n);let s=n;s.catch(()=>{ne?.get(t)===s&&ne.delete(t)})}return n},Wt=async e=>{let t=li(e),n=await di(t);return new de(n,{filename:t})},_s,ui="/jq79-sw.js",fi=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")})},pi=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(An,""),new Promise((n,s)=>{let r=document.createElement("script"),i=os();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)})},ce=class ce{constructor(t,n={}){M(this,"template");M(this,"scripts");M(this,"styles");M(this,"modules");M(this,"filename");M(this,"siblings");M(this,"name");M(this,"slots");M(this,"modelWriteback");M(this,"data",null);M(this,"fx",null);M(this,"content",null);M(this,"startMarker",null);M(this,"endMarker",null);M(this,"styleEls",[]);M(this,"shadowCss",null);M(this,"shadowSheets",[]);M(this,"sheetRoot",null);M(this,"ownsSharedStyles",!1);M(this,"useShadow",!1);M(this,"mountRoot",null);M(this,"resolveMounted",null);M(this,"renderDone",!1);M(this,"held",0);M(this,"onPaint",null);M(this,"destroyHooks",null);M(this,"attachHooks",null);M(this,"detachHooks",null);M(this,"onPage",!1);M(this,"emitListeners",new Map);let s=typeof t=="string"?Dt(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(),ri(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"?Dt(t):t;Kt.clear(),we.clear(),Lt.clear();let s=this.startMarker,r=!!(s&&this.content),i=r&&s.isConnected,o=i?s.parentNode:null,a=i?this.endMarker.nextSibling:null,l={...this.data},f=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(l,f),!o)?!1:(f&&this.placeShadowStyles(o,a),o.insertBefore(this.content,a),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=le.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(le,s)?typeof r=="boolean"?le[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(le).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(le).join(", ")}`)}le.scopedNames!==n&&Ze.clear()}return{...le}}static safeEval(t={}){Ut=!0;let n=[];if(t.nonce){let r=os();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."))):_t=r}let s=t.worker??(t.nonce?!1:ui);return s!==!1&&n.push(_s??(_s=fi(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?ne=null:t===!0&&(ne??(ne=new Map)),!!ne}static clearCache(){ne?.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new Ft(Wt(t))}static fetchAll(t){return Promise.all(t.map(Wt))}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=>Ye(Vn(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=Cn(this.scripts,Ht),r=Jo(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(y=>!(y in t)));o.size&&Object.defineProperty(i,Os,{value:o}),this.slots&&Object.defineProperty(i,ys,{value:this.slots}),Object.defineProperty(i,tt,{value:{count:0,owner:this}});let a=Me(i),l=me(a);this.data=a,this.fx=l,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let f=this.startMarker,d=!1,p=(y,P)=>{y==="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 C=new CustomEvent(y,{detail:P,bubbles:!0,composed:!0,cancelable:!0});return f===this.startMarker&&this.emitListeners.get(y)?.forEach(Q=>Q(C,P)),C.cancelBubble||f.dispatchEvent(C),!C.defaultPrevented},S,O=new Promise(y=>{S=y});this.resolveMounted=S,this.renderDone=!1,this.held=0;let I=y=>{if(typeof y!="function")throw new TypeError("jq79: $destroyed expects a function");return f!==this.startMarker?(xe(y,"$destroyed"),()=>{}):kt(this.destroyHooks??(this.destroyHooks=[]),y)},z=(y,{immediate:P=!0}={})=>{if(typeof y!="function")throw new TypeError("jq79: $attached expects a function");if(f!==this.startMarker)return()=>{};this.watchPage();let C=kt(this.attachHooks??(this.attachHooks=[]),y);return P&&this.onPage&&xe(y,"$attached"),C},j=y=>{if(typeof y!="function")throw new TypeError("jq79: $detached expects a function");return f!==this.startMarker?(xe(y,"$detached"),()=>{}):(this.watchPage(),kt(this.detachHooks??(this.detachHooks=[]),y))},b=y=>{let P=pt(y);return I(()=>P.$dispose()),P},H=this.endMarker,D=(y=>{let P=[];for(let C=f.nextSibling;C&&C!==H;C=C.nextSibling)C instanceof Element&&(C.matches(y)&&P.push(C),P.push(...Array.from(C.querySelectorAll(y))));return P}),L=(y=>D(y)[0]??null),U=this.modules,se=y=>U&&y in U?Promise.resolve(U[y]):Ye(Vn(y,this.filename)),v=y=>{if(!Array.isArray(y))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(y.map(se))},x=Object.assign(Object.create(null),{$emit:p,$updateModel:(...y)=>{let[P,C]=y.length>1?y:[void 0,y[0]];return f!==this.startMarker?!1:this.modelWriteback?.(P,C)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(y=>[y,!0]))}),q=[],J=!0;this.scripts.forEach((y,P)=>{let C;q.push(new Promise(w=>{C=w}));let Q=!1,$=()=>{Q=!0,C()},B={$mounted:()=>($(),O),$destroyed:I,$attached:z,$detached:j,$computed:b,$self:L,$$self:D,...x,$importAll:v,...r},u={filename:this.filename,index:P},c=":mounted"in y.attrs,m=gn(y.content),h=(()=>{if(m!==null){c&&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."),Qn(a,ke(y.content));let T=c?Nt(m):m;return ti(T,a,R=>l.effect(R),B,se,u)}let{vars:w,code:g}=Ue(y.content);Qn(a,Ht(y)),w.forEach(T=>{T in a||(a[T]=void 0)});let E=c?Nt(g):g;return Zo(E,a,T=>l.effect(T),B,se,u)})();if(h.sync)h.settled.then($,$);else{let w=i[tt];w.count++;let g=()=>{w.count--,$()};h.settled.then(g,g)}!h.sync&&!Q&&(J=!1)});let G=document.createDocumentFragment(),Z=new Proxy(a,{has:(y,P)=>typeof P=="string"&&P in x||Reflect.has(y,P),get:(y,P,C)=>typeof P=="string"&&P in x&&!Reflect.has(y,P)?x[P]:Reflect.get(y,P,C)});if(G.append(this.startMarker,this.endMarker),this.content=G,J?(this.endMarker.parentNode.insertBefore(be(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(q).then(()=>{f===this.startMarker&&(this.endMarker.parentNode.insertBefore(be(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted(),ce.settleAttached())}),ai(this,q)),n)if(Vt())this.shadowCss=[...this.styles.map(y=>y.content),je];else{let y=document.createElement("style");y.textContent=je,this.styleEls=[...this.styles.map(P=>{let C=document.createElement("style");return C.textContent=P.content,C}),y]}else this.styles.forEach(y=>Go(Zn(y))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?Pe(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"?Pe(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(),ce.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){fe.has(this)||(fe.add(this),this.onPage=this.isOnPage(),this.onPage||ce.queueSettle())}static queueSettle(){Ot||(Ot=!0,queueMicrotask(()=>{Ot=!1,ce.settleAttached()}))}static settleAttached(){if(fe.size===0)return;let t=[...fe].filter(n=>!n.onPage&&n.isOnPage());ce.inDocumentOrder(t).forEach(n=>{n.onPage||!fe.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>xe(s,"$attached")))})}notifyDetached(){if(fe.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=ce.inDocumentOrder([...fe].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=>xe(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=>It(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===je?qt??(qt=Je(s)):Je(s))),this.shadowSheets.forEach(s=>Zt(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(),fe.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>xe(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!==qt&&It(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>Vo(Zn(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};M(ce,"version",kr);var de=ce,Ft=class{constructor(t){M(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 Ni=e=>new de(e),xe=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},kt=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),fe=new Set,Ot=!1,js={$:Pe,$$:rt,$create:ot,$reactive:Me,$toRaw:V,Component79:de,C79:de};typeof globalThis<"u"&&globalThis[ni]&&ii();export{Pe as $,rt as $$,pt as $computed,ot as $create,Me as $reactive,V as $toRaw,de as C79,de as Component79,Ft as PendingComponent79,ii as enableHotReload,oi as hotUpdate,Ni as parseComponent,xi as renderComponent};
|
|
17
|
+
}`;var Kr="0.7.11",us=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),fs="http://www.w3.org/1999/xhtml",ps=e=>{let t=us(e),n=e.namespaceURI,s=t[Oe];delete t[Oe];let r=n!==null&&n!==fs;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?[ps(i)]:[]})}},Je=new Map,Ye=new Map,Qt=!1,Ht,Pe=class extends Error{constructor(n,s){super(`${n}. ${s}`);A(this,"reason",n);A(this,"hint",s)}},zr=()=>new Pe("was not precompiled","Safe mode never builds code at runtime: the component's precompiled functions did not reach the page."),Gr=(e,t)=>{let n=globalThis[In];if(Array.isArray(n)&&n.length>0)for(let[s,r,i]of n.splice(0))Ye.set(Qe(s,r),i);return Ye.size===0?void 0:Ye.get(Qe(e,t))},Xt=(e,t,n="")=>{let s=Gr(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(Ht!==void 0)return Vr(e,t,n,Ht);if(Qt)throw zr();return new Function(...e,t+n)},Yt=()=>{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}},Wn="__jq79built",Vr=(e,t,n,s)=>{let r=document.createElement("script");r.setAttribute("nonce",s),r.textContent=`document.currentScript.${Wn} = ${Hn(e,t)}${n}`;let i,o=l=>{i=l.error??new SyntaxError(l.message),l.preventDefault()};window.addEventListener("error",o);try{(document.head??document.documentElement).append(r)}finally{window.removeEventListener("error",o),r.remove()}let a=r[Wn];if(typeof a=="function")return Ye.set(Qe(e,t),a),a;throw i!==void 0?i:new Pe("could not be built","The page's CSP refused a <script> carrying the nonce jq79 read from the page.")},Fn=new Set,Zr=(e,t)=>{Fn.has(e)||(Fn.add(e),console.error(`jq79: safeEval() is on, and "${e}" ${t.reason}, so it rendered as nothing. ${t.hint}`))},_t=(e,t)=>{if(!(t in e)){if(t in globalThis)return globalThis[t];throw new ReferenceError(`${t} is not defined`)}},hs=(e,t)=>{try{return Xt([...Mt,...t],An(e))}catch(n){return n instanceof Pe&&Zr(e,n),null}},Qr=(e,t)=>{if(!ce.scopedNames)return null;let n=Mn(e,t);if(n===null)return null;try{return Xt([...Mt,...t],n)}catch{return null}},gs=(e,t,n)=>{let s=Je.get(e);if(s===void 0){let r=Qr(t,n);s=r?{fn:r,scoped:!0}:{fn:hs(t,n),scoped:!1},Je.set(e,s)}return s},ms=(e,t)=>`${t.join(",")}|${e}`,Xr=(e,t)=>gs(ms(e,t),e,t).fn,Yr=(e,t,n)=>{let s=hs(t,n);return Je.set(e,{fn:s,scoped:!1}),s},Jr=/^(?:([\w$]+) is not defined|Can't find variable: ([\w$]+))/,eo=100,Se=new Map,Jt=new Set,et=0,Wt=!1,Ft=new Set,to=()=>{Wt=!1,!(et>0)&&(Se.forEach(({name:e,expr:t,scope:n},s)=>{e in n||(Jt.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 = () => {}".`))}),Se.clear())},ys=()=>{Wt||et>0||!Se.size||(Wt=!0,queueMicrotask(to))},Es=e=>{et++;let t=()=>{et--,ys()};e.then(t,t)},no=(e,t)=>{if(Ft.has(e))return;Ft.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.`)},ws=(e,t,n)=>{if(!(n instanceof ReferenceError))return no(e,n);let s=Jr.exec(n.message),r=s?.[1]??s?.[2];if(!r)return;let i=`${r}|${e}`;Jt.has(i)||Se.has(i)||Se.size>=eo||(Se.set(i,{name:r,expr:e,scope:t}),ys())},Ss=(e,t,n)=>{let s=n?Object.keys(n):[],r=ms(e,s),{fn:i,scoped:o}=gs(r,e,s);if(!i)return;let a=n?Object.values(n):[];if(!o)return i(t,_t,...a);try{return i(t,_t,...a)}catch(l){if(!(l instanceof ReferenceError))throw l;let c=Yr(r,e,s);if(!c)throw l;return c(t,_t,...a)}},O=(e,t,n)=>{try{return Ss(e,t,n)}catch(s){ws(e,t,s);return}},bs=(e,t,n)=>{try{return Ss(e,t,n)}catch(s){if(!(s instanceof ReferenceError))throw s;ws(e,t,s);return}},Ts=(e,t)=>{if(e.length===1){let s=e[0];return typeof s=="string"?s:String(O(s.expr,t)??"")}let n="";for(let s of e)n+=typeof s=="string"?s:String(O(s.expr,t)??"");return n},$s=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i);e.addEventListener(r,a=>{if(o.has("self")&&a.target!==e)return;o.has("prevent")&&a.preventDefault(),o.has("stop")&&a.stopPropagation();let l=bs(n,s,{$event:a});typeof l=="function"&&l.call(e,a)},{once:o.has("once"),capture:o.has("capture")})},so=(e,t,n,s)=>{let[r,...i]=t.slice(1).split("."),o=new Set(i),a=l=>{o.has("prevent")&&l.preventDefault(),o.has("stop")&&l.stopPropagation(),o.has("once")&&e.off(r,a),Re(()=>{let c=bs(n,s,{$event:l});typeof c=="function"&&c(l)})};e.on(r,a)},en=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},at=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},ro=e=>{e.forEach(t=>{if(t.first===t.last)return at(t);if(!t.first.parentNode)return;let s=document.createRange();s.setStartBefore(t.first),s.setEndAfter(t.last),s.deleteContents()})},oo=(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},io=({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}},Un=(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},we=null,tt=null,Rs=new WeakSet,ao=e=>{let t={memo:we,base:tt};return we=new Map,tt=e,t},lo=e=>{we=e.memo,tt=e.base},Bn=(e,t)=>e.component!==void 0?Kn(t,e.component):e.tag.includes("-")?Kn(t,e.tag):null,X=e=>e.component??e.tag,Kn=(e,t)=>{if(!we)return Un(e,t);let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s)){if(s===tt){if(we.has(t))return we.get(t);let r=Un(s,t);return we.set(t,r),r}if(!Rs.has(s)){for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r}}return null},co=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()},uo=(e,t)=>{let n=co(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)"}.`)},zn=100,Ot=0,xs=Symbol("jq79.slots"),De=e=>Object.keys(e.attrs).find(t=>t===":slot"||t.startsWith(":slot.")),fo=e=>e==="default"?":slot":`:slot.${e}`,po=e=>typeof e!="string"||e.trim()!=="",ho=e=>{let t={},n=[];e.children.forEach(r=>{let i=typeof r=="object"&&r.tag==="template"?De(r):void 0;if(typeof r=="string"||i===void 0){n.push(r);return}let o=Ct(i.slice(6));if(o in t){console.warn(`jq79: two <template ${fo(o)}> in <${X(e)}>; the second was ignored`);return}t[o]={nodes:r.children,binder:r.attrs[i]||void 0}});let s=n.some(po);return s&&"default"in t?console.warn(`jq79: <${X(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},go=(e,t,n)=>{ke(t)?.forEach(({name:s,as:r,default:i})=>{let o=r??s;Object.defineProperty(e,o,{enumerable:!0,configurable:!0,get:()=>{let a=n[s]?.();return a===void 0&&i!==void 0?O(i,e):a},set:()=>console.warn(`jq79: "${o}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},mo=e=>{let t=De(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}`)},yo=(e,t)=>{let n=Object.entries(ho(e));if(!n.length)return null;let s={};return n.forEach(([r,i])=>{s[r]=Eo(i,t)}),s},Eo=(e,t)=>(n,s,r,i)=>{let o=Object.create(t);go(o,e.binder,n);let a=o[qe]??[];Object.defineProperty(o,qe,{value:[...a,s]});let l=ye(o);return l.ownedBy(s),r.onDispose(()=>l.dispose()),Te(e.nodes,o,l,i)},wo=(e,t,n,s)=>{let r=Ct(e.tag.slice(5)),i=document.createDocumentFragment(),o=document.createComment(e.tag),a=document.createComment(`/${e.tag}`);i.append(o,a);let l=t[xs]?.[r];if(!l)return i.insertBefore(Te(e.children,t,n,s),a),i;let c={};return Object.entries(e.attrs).forEach(([d,p])=>{if(!(d===ve||Ee(d)||d.startsWith("@")))if(d.startsWith(":")){let w=p||d.slice(1);c[ae(d.slice(1))]=()=>O(w,t)}else c[ae(d)]=()=>p}),i.insertBefore(l(c,t,n,s),a),i},Ns="data-c79-box",So=(e,t,n)=>{if(t.ns!==void 0)return document.createDocumentFragment();let s=document.createElement(je(e));s.setAttribute(Ns,"");let r=t.attrs[ve];return r!==void 0&&s.setAttribute(ve,r),n||oi(),s},Gn=new WeakSet,bo=(e,t)=>{if(e.ns===void 0||Gn.has(e))return;let n=t.template.find(r=>typeof r=="object");if(n===void 0||n.ns!==void 0)return;Gn.add(e);let s=e.ns==="http://www.w3.org/1998/Math/MathML"?"<math>":"<svg>";console.warn(`jq79: <${X(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}`)},Vn=(e,t,n,s,r)=>{let i=So(e,t,r),o=!(i instanceof DocumentFragment),a=o?null:document.createComment(`/${e}`);o||i.append(document.createComment(e),a);let l=yo(t,n),c={},d={},p=[],w=[],_=!1;Object.entries(t.attrs).forEach(([P,M])=>{if(P!==ve){if(P===":props"||P.startsWith(":props.")){_=!0,w.push({expr:M});return}if(!Ee(P))if(P.startsWith("@"))p.push([P,M]);else if(P===":model"||P.startsWith(":model.")){let x=P===":model"?"default":ae(P.slice(7));d[x]=M||(P===":model"?"model":x)}else if(P.startsWith(":")){let x=ae(P.slice(1));c[x]=M||x,w.push({name:x,expr:M||x})}else{let x=ae(P),q=JSON.stringify(M);c[x]=q,w.push({name:x,expr:q})}}});let I=P=>P==="default"?":model":`:model.${P}`,z=P=>P==="default"?"model":P,j=new Set;Object.entries(d).forEach(([P,M])=>{let x=z(P);c[x]!==void 0&&console.warn(`jq79: <${X(t)}> binds prop "${x}" through both :${x} and ${I(P)} - ${I(P)} wins`),c[x]=M,Xr(At(M),["$value"])===null&&(j.add(P),console.warn(`jq79: ${I(P)}="${M}" is not assignable - updates from <${X(t)}> will be dropped`))});let b=()=>{let P={};return w.forEach(({name:M,expr:x})=>{if(M!==void 0)P[M]=O(x,n);else{let q=O(x,n);q!==null&&typeof q=="object"&&Object.assign(P,q)}}),Object.entries(d).forEach(([M,x])=>{P[z(M)]=O(x,n)}),P},H=null,D=null,L=null,U=new Set,se=P=>{if(P==null){if(!n[Ws]?.has(e)||U.has("unfilled"))return;U.add("unfilled"),console.error(`jq79: <${X(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}U.has("type")||(U.add("type"),console.error(`jq79: <${X(t)}> is ${typeof P}, not a component - nothing renders here`))};return s.effect(()=>{let P=O(e,n),M=P instanceof ue?P:null;if(M||se(P),M===D||(L?.dispose(),L=null,H?.destroy(),H=null,D=M,!M))return;bo(t,M);let x=new ue({template:M.template,scripts:M.scripts,styles:M.styles,modules:M.modules,filename:M.filename,siblings:M.siblings,name:M.name});if(l&&(x.slots=l),Object.keys(d).length){let v=new Set;x.modelWriteback=(C,Q)=>{let $=C==null?"default":ae(String(C)),W=d[$];return W===void 0?(v.has($)||(v.add($),console.warn(`jq79: <${X(t)}> has no ${I($)} - bound: ${Object.keys(d).map(I).join(", ")}`)),!1):j.has($)?!1:(Re(()=>O(At(W),n,{$value:Q})),!0)}}p.forEach(([v,C])=>so(x,v,C,n));let q=di(x.scripts);ui(t,e,Object.keys(c),q);let ee=os(Re(b),q),G=document.createDocumentFragment();if(Ot>=zn){console.error(`jq79: <${X(t)}> is ${zn} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}Ot++;try{(r?x.renderShadow(ee):x.render(ee)).mount(G)}finally{Ot--}let Z=n[ot];Z&&x.holdOwner(Z.owner),a?a.parentNode.insertBefore(G,a):i.appendChild(G);let y=ye(n,!0);if(_){let v=[];y.effect(()=>{let C=os(b(),q),Q=Object.keys(C);v.forEach($=>{$ in C||(x.data[$]=void 0)}),Q.forEach($=>{x.data[$]=C[$]}),v=Q})}else Object.entries(c).forEach(([v,C])=>{q!==null&&!q.has(v)||y.effect(()=>{x.data[v]=O(C,n)})});L=y,H=x}),s.onDispose(()=>{L?.dispose(),H?.destroy()}),i},To=(e,t)=>{let n=()=>{let s=O(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)}})},he=e=>typeof e=="string"?e.split(/\s+/).filter(Boolean):Array.isArray(e)?e.flatMap(he):e!==null&&typeof e=="object"?Object.entries(e).flatMap(([t,n])=>n?he(t):[]):[],$o=e=>typeof e=="function"?(t,n,s)=>{try{return!!e(t,n,s)}catch{return!1}}:typeof e=="string"||Array.isArray(e)?ln(e):()=>!1,Ro=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"]),Ps=e=>e.ns===void 0?document.createElement(e.tag):document.createElementNS(e.ns,e.tag),xo={"http://www.w3.org/2000/svg":["svg","feGaussianBlur"],"http://www.w3.org/1998/Math/MathML":["math","mi"]},Zn=new Map,No=(e,t)=>{let n=`${e} ${t}`,s=Zn.get(n);if(s!==void 0)return s;let r=xo[e],i=t;if(r!==void 0&&typeof DOMParser<"u"&&/^[a-z][a-z0-9]*$/.test(t)){let[o,a]=r;i=new DOMParser().parseFromString(`<${o}><${a} ${t}="x"/></${o}>`,"text/html").querySelector(a)?.getAttributeNames().find(c=>c.toLowerCase()===t)??t}return Zn.set(n,i),i},vs=(e,t)=>{let n=e.namespaceURI;if(n===null||n===fs)return t;let s=t.replace(/-/g,"").toLowerCase(),r=No(n,s);return r===s?t:r},Cs=(e,t,n)=>{let s=Ro.has(t);(s?!n:n==null)?e.removeAttribute(t):e.setAttribute(t,s?"":String(n))},ce={cloneSkeletons:!0,scopedNames:!0},Po=new Set([":text",":html",":value",":checked",":selected"]),vo=e=>e.startsWith("@")||e===":class"||e.startsWith(":class.")||Po.has(e)?!0:e.startsWith(":")?e===":model"?!1:!Ee(e)&&!e.includes("."):e!==Oe,As=e=>{if(e.component||e.tag.includes("-")||Ze(e.tag)||e.tag==="template"||e.ns===void 0&&document.createElement(e.tag)instanceof HTMLUnknownElement)return!1;for(let t in e.attrs)if(!vo(t))return!1;return e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?!0:e.children.every(t=>typeof t=="string"||As(t))},Ms=(e,t,n)=>{let s=Ps(e),r,i=null;for(let p in e.attrs){let w=e.attrs[p];if(p.startsWith("@"))n.push({kind:"event",path:t,attr:p,expr:w});else if(p===":class")r=w;else if(p.startsWith(":class."))(i??(i=[])).push([p.slice(7),w]);else if(!Ee(p))if(p.startsWith(":")){let _=p.slice(1);n.push({kind:"attr",path:t,name:vs(s,_),expr:w||ae(_)})}else s.setAttribute(p,w)}(r!==void 0||i)&&n.push({kind:"class",path:t,classExpr:r,toggles:i,staticClasses:new Set(he(e.attrs.class??""))});let o=e.attrs[":text"],a=e.attrs[":html"];o!==void 0?n.push({kind:"textContent",path:t,expr:o}):a!==void 0?n.push({kind:"html",path:t,expr:a}):e.children.forEach((p,w)=>{if(typeof p=="string"){p.includes("{{")?(n.push({kind:"text",path:[...t,w],parts:Pt(p)}),s.appendChild(document.createTextNode(""))):s.appendChild(document.createTextNode(p));return}s.appendChild(Ms(p,[...t,w],n))});let l=e.attrs[":value"];l!==void 0&&n.push({kind:"value",path:t,expr:l});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},Co=3,ks=e=>e.attrs[":text"]!==void 0||e.attrs[":html"]!==void 0?1:1+e.children.reduce((t,n)=>t+(typeof n=="string"?0:ks(n)),0),Qn=new WeakMap,Xn=new WeakSet,Ao=e=>{let t=Qn.get(e);if(t!==void 0)return t;if(!Xn.has(e))return Xn.add(e),null;let n=null;if(As(e)&&ks(e)>=Co){let s=[];n={skeleton:Ms(e,[],s),ops:s}}return Qn.set(e,n),n},Mo=(e,t)=>{let n=e;for(let s=0;s<t.length;s++)n=n.childNodes[t[s]];return n},ko=(e,t,n)=>{let s=e.skeleton.cloneNode(!0);for(let r of e.ops){let i=r.path.length===0?s:Mo(s,r.path);if(r.kind==="text"){let o=i,a=r.parts;n.effect(()=>{let l=Ts(a,t);o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="event")$s(i,r.attr,r.expr,t);else if(r.kind==="attr"){let o=i,{name:a,expr:l}=r;n.effect(()=>Cs(o,a,O(l,t)))}else if(r.kind==="class"){let o=i,{classExpr:a,toggles:l,staticClasses:c}=r,d=[];n.effect(()=>{let p=a!==void 0?he(O(a,t)):[];l?.forEach(([w,_])=>{O(_,t)&&p.push(...he(w))}),d.forEach(w=>{!p.includes(w)&&!c.has(w)&&o.classList.remove(w)}),o.classList.add(...p),d=p})}else if(r.kind==="textContent"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(O(a,t)??"");o.textContent!==l&&(o.textContent=l)})}else if(r.kind==="html"){let o=i,{expr:a}=r;n.effect(()=>{o.innerHTML=ut(String(O(a,t)??""))})}else if(r.kind==="value"){let o=i,{expr:a}=r;n.effect(()=>{let l=String(O(a,t)??"");o.value!==l&&(o.value=l)})}else if(r.kind==="checked"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!O(a,t);o.checked!==l&&(o.checked=l)})}else if(r.kind==="selected"){let o=i,{expr:a}=r;n.effect(()=>{let l=!!O(a,t);o.selected!==l&&(o.selected=l)})}else{let o=r}}return s},tn=(e,t,n,s)=>{let r=e.attrs[":with"],i=r!==void 0?To(r,t):t;if(Ze(e.tag))return wo(e,i,n,s);if(e.tag==="template"&&De(e)!==void 0)return mo(e);let o=Bn(e,i);if(o)return Vn(o,e,i,n,s);if(ce.cloneSkeletons){let b=Ao(e);if(b)return ko(b,i,n)}let a=Ps(e);if(e.component!==void 0&&i[ot]?.count===0)throw uo(e.component,i);let l=e.ns===void 0&&(e.component!==void 0||e.tag.includes("-"));if(l){let b=!1;n.effect(()=>{if(b)return;let H=Bn(e,i);if(!H)return;b=!0;let D=Vn(H,e,i,n,s),L=en(D);n.onDispose(()=>at(L)),a.replaceWith(D)})}for(let b in e.attrs){let H=e.attrs[b];if(b.startsWith("@"))$s(a,b,H,i);else if(b===":model"||b.startsWith(":model."))l||console.warn(`jq79: ${b} on <${X(e)}> does nothing - :model binds component tags only (for now)`);else if(!Ee(b))if(b.startsWith(":"))if(l)a.setAttribute(b,H);else{let D=b.slice(1),L=H||ae(D),U=vs(a,D);n.effect(()=>Cs(a,U,O(L,i)))}else a.setAttribute(b,H)}let c=e.attrs[":class"],d=null;for(let b in e.attrs)b.startsWith(":class.")&&(d??(d=[])).push([b.slice(7),e.attrs[b]]);if(c!==void 0||d){let b=new Set(he(e.attrs.class??"")),H=[];n.effect(()=>{let D=c!==void 0?he(O(c,i)):[];d?.forEach(([L,U])=>{O(U,i)&&D.push(...he(L))}),H.forEach(L=>{!D.includes(L)&&!b.has(L)&&a.classList.remove(L)}),a.classList.add(...D),H=D})}let p=e.attrs[":text"],w=e.attrs[":html"],_=e.attrs[":html.allowed"];_!==void 0&&w===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),p!==void 0?n.effect(()=>{let b=String(O(p,i)??"");a.textContent!==b&&(a.textContent=b)}):w!==void 0?n.effect(()=>{let b=_!==void 0?{allowUrl:$o(O(_,i))}:void 0;a.innerHTML=ut(String(O(w,i)??""),b)}):a instanceof HTMLTemplateElement?Te(e.children,i,n,s,a.content):Te(e.children,i,n,s,a);let I=e.attrs[":value"];I!==void 0&&n.effect(()=>{let b=String(O(I,i)??"");a.value!==b&&(a.value=b)});let z=e.attrs[":checked"];z!==void 0&&n.effect(()=>{let b=!!O(z,i);a.checked!==b&&(a.checked=b)});let j=e.attrs[":selected"];return j!==void 0&&n.effect(()=>{let b=!!O(j,i);a.selected!==b&&(a.selected=b)}),a},_o=(e,t,n,s)=>{let r=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(r);let o=null,a=null,l=null;return n.effect(()=>{let c=e.find(p=>p.expr===void 0||O(p.expr,t))??null;if(c===a||(l?.dispose(),o&&at(o),o=null,a=c,!c))return;l=ye(t);let d=tn(c.node,t,l,s);o=en(d),r.parentNode.insertBefore(d,r.nextSibling)}),n.onDispose(()=>l?.dispose()),i},xe=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},Oo=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,a=n.length;for(;o<a;){let l=o+a>>1;e[n[l]]<i?o=l+1:a=l}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},jo=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},_s=(e,t)=>typeof e=="string"?t.some(n=>Jn(e,n)):Object.values(e.attrs).some(n=>t.some(s=>Jn(n,s)))||e.children.some(n=>_s(n,t)),Os=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("-")||Ze(e.tag)||e.children.some(Os)),Yn=/[A-Za-z0-9_$]/,Lo=/^[A-Za-z_$][\w$]*\.[A-Za-z_$][\w$]*$/,Jn=(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(!Yn.test(s)&&!Yn.test(r))return!0}return!1},jt=new WeakMap,Do=e=>{let t=jt.get(e);if(t!==void 0)return t;let n=e.attrs[":each"].match(Cn);if(!n)return jt.set(e,null),null;let[,s,r,i]=n,o=e.attrs[":key"],a=o===s,l=o!==void 0&&!a&&Lo.test(o)&&o.startsWith(`${s}.`)?o.slice(s.length+1):void 0,{[":each"]:c,[":key"]:d,...p}=e.attrs,w={...e,attrs:p},_=["$index",...r?[r]:[]],I=_s(w,_),z=/^[A-Z]/.test(s)||r!==void 0&&/^[A-Z]/.test(r),j=o!==void 0&&Os(w),b={itemName:s,atName:r,listExpr:i,keyExpr:o,keyIsItem:a,keyProp:l,itemNode:w,readsPosition:I,namesComponent:z,nestsScopes:j};return jt.set(e,b),b},Io=(e,t,n,s)=>{let r=Do(e);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let{itemName:i,atName:o,listExpr:a,keyExpr:l,keyIsItem:c,keyProp:d,itemNode:p,readsPosition:w,namesComponent:_,nestsScopes:I}=r,z=document.createComment("each"),j=document.createDocumentFragment();j.appendChild(z),(":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 b=[],H=!1;return n.effect(()=>{let D=ao(t);try{let L=O(a,t),U=Array.isArray(L),se=U?null:jo(L)?Object.keys(L):[],P=U?L.length:se.length,M=new Map;b.forEach(($,W)=>{$.pos=W;let B=M.get($.key);B?B.push($):M.set($.key,[$])});let x=new Set,q=[],ee=[],G=[],Z=[],y;for(let $=0;$<P;$++){let W=U?$:se[$],B=U?L[$]:L[W],f=W;c?f=B:d!==void 0&&B!==null&&typeof B=="object"?f=B[d]:l!==void 0&&(y===void 0?(y=Object.create(t),xe(y,i,B),o&&xe(y,o,W),xe(y,"$index",$)):(y[i]=B,o&&(y[o]=W),y.$index=$),f=O(l,y)),x.has(f)&&!H&&(H=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),x.add(f);let u=M.get(f)?.shift();if(u&&Object.is(u.item,B)){let g=u.scope;g.$index!==$&&(w&&q.push(u),g.$index=$),o&&g[o]!==W&&(g[o]=W),G.push(u),Z.push(u.pos);continue}if(u&&l!==void 0){let g=u.scope;g[i]=B,g.$index!==$&&(g.$index=$),o&&g[o]!==W&&(g[o]=W),u.item=B,ee.push(u),G.push(u),Z.push(u.pos);continue}u&&(u.fx.dispose(),at(u.range));let m=Object.create(t);xe(m,i,B),o&&xe(m,o,W),xe(m,"$index",$),_||Rs.add(m);let h=ye(t);I&&Object.defineProperty(m,yt,{value:h});let S=en(tn(p,m,h,s));G.push({key:f,item:B,scope:m,fx:h,range:S,pos:$}),Z.push(-1)}let v=new Set;M.forEach($=>$.forEach(W=>v.add(W))),v.size&&(v.forEach($=>{$.dead=!0,$.fx.dispose()}),ro(oo(b,$=>$.dead===!0)));let C=z,Q=Oo(Z);G.forEach(($,W)=>{!Q[W]&&C.nextSibling!==$.range.first&&io($.range,C),C=$.range.last}),q.forEach($=>Re(()=>$.fx.refresh())),ee.forEach($=>Re(()=>$.fx.rerun())),b=G}finally{lo(D)}}),n.onDispose(()=>b.forEach(D=>D.fx.dispose())),j},js=(e,t)=>{let n=t;for(;n<e.length&&typeof e[n]=="string"&&!e[n].trim();)n++;return n},Lt=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 <${X(e)}> - only ${r[0]} applies; the branches of a chain are sibling elements, one directive each`)},qo=(e,t)=>{let n=":elseif"in e.attrs?":elseif":":else";console.warn(t?`jq79: a second ${n} on <${X(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 <${X(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`)},Ho=[":if",":elseif",":else",":each"],Wo=(e,t)=>{if(e.tag!=="template"||e.ns!==void 0)return;let n=Ho.find(s=>s in e.attrs);if(n!==void 0){if(De(e)!==void 0){if(t?.component===void 0)return;console.warn(`jq79: ${n} on <template ${De(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`)}},Fo=[...vt,":model",":slot"].map(e=>e.slice(1)),Uo={":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'},Bo=e=>{for(let t in e.attrs){let n=Uo[t];n!==void 0&&console.warn(`jq79: ${n}`)}},Ko=e=>{if(!(e.component!==void 0||e.tag.includes("-")))for(let t in e.attrs){if(!t.startsWith(":")||Ee(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=Fo.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`)}},Ls=(e,t)=>{e.forEach(s=>{typeof s!="string"&&(Wo(s,t),Bo(s),Ko(s),Ls(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(Lt(r),":if"in r.attrs){s++;let i=a=>{let l=js(e,s),c=e[l];if(typeof c=="object"&&a in c.attrs)return s=l+1,c};for(let a=i(":elseif");a;a=i(":elseif"))Lt(a);let o=i(":else");o&&Lt(o),n=o!==void 0;continue}(":elseif"in r.attrs||":else"in r.attrs)&&qo(r,n),n=!1,s++}},es=new WeakMap,zo=(e,t,n)=>{let s=es.get(t);if(s)return s;let r=[{expr:t.attrs[":if"],node:t}],i=n+1,o=c=>{let d=js(e,i),p=e[d];if(typeof p=="object"&&c in p.attrs)return i=d+1,p};for(let c=o(":elseif");c;c=o(":elseif"))r.push({expr:c.attrs[":elseif"],node:c});let a=o(":else");a&&r.push({node:a});let l={branches:r,next:i};return es.set(t,l),l},Te=(e,t,n,s=!1,r)=>{let i=r??document.createDocumentFragment(),o=0;for(;o<e.length;){let a=e[o];if(typeof a=="string"){let l=document.createTextNode(a);if(a.includes("{{")){let c=Pt(a);n.effect(()=>{let d=Ts(c,t);l.textContent!==d&&(l.textContent=d)})}i.appendChild(l),o++;continue}if(":each"in a.attrs){i.appendChild(Io(a,t,n,s)),o++;continue}if(":if"in a.attrs){let l=zo(e,a,o);i.appendChild(_o(l.branches,t,n,s)),o=l.next;continue}i.appendChild(tn(a,t,n,s)),o++}return i},qi=(e,t,n=!1)=>Te(e.template,t,ye(t),n),ve="data-jq79",Go=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)},Ds=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[ve]=t,Ds(n.children,t))})},Vo=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),i=r===-1?s:s.slice(0,r),o=r===-1?"":s.slice(r);return`${i}[${ve}="${t}"]${o}`}).join(", "),Is=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Vo(n.selectorText,t):n instanceof CSSGroupingRule&&Is(n.cssRules,t)})},Zo=/(^|[\s>+~,(])([A-Z][A-Za-z0-9]*)(?![\w-])/g,Qo=/[a-z]/,Xo=e=>e.replace(Zo,(t,n,s)=>Qo.test(s)?`${n}${je(s)}`:t),Yo=/^\s*@(media|supports|container|layer|scope|document)\b/i,Jo=/^\s*@/,ei=e=>{let t="",n="",s="",r=[],i=()=>r.length===0||r[r.length-1],o=()=>{t+=i()&&!Jo.test(s)?Xo(n):n,n=""},a=c=>{o(),t+=c,s+=c},l=(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),w=p===-1?e.length:p+2;a(e.slice(c,w)),c=w}else if(d==='"'||d==="'"){let p=c+1;for(;p<e.length&&e[p]!==d;)p+=e[p]==="\\"?2:1;a(e.slice(c,Math.min(p+1,e.length))),c=p+1}else d==="{"?(l("{",Yo.test(s)),c++):d==="}"||d===";"?(l(d),c++):(n+=d,s+=d,c++)}return o(),t},ti=(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=new CSSStyleSheet;return n.replaceSync(e),Is(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
|
|
18
|
+
`)},Ut=e=>{let t=Pn(e),s=new DOMParser().parseFromString(`<template>${t}</template>`,"text/html").querySelector("template"),r=[],i=[];Array.from(s.content.children).forEach(l=>{l.tagName==="TEMPLATE"?i.push(l):r.push(l)});let o=ts(r,e),a={};return i.forEach(l=>{let c=l.getAttribute("name");if(c===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!vn.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 a){console.warn(`jq79: two <template name="${c}"> in one file; the second was ignored`);return}a[c]=new ue({...ts(Array.from(l.content.children),l.innerHTML),siblings:a,name:c})}),Object.keys(a).length&&(o.siblings=a),o},ni=/^(?:text|application)\/(?:x-)?typescript$/i,si=e=>"lang"in e?`lang="${e.lang}"`:ni.test(e.type?.trim()??"")?`type="${e.type}"`:null,ts=(e,t)=>{let n=[],s=[],r=[];e.forEach(o=>{let a={attrs:us(o),content:o.textContent??""};o.tagName==="SCRIPT"?n.push(a):o.tagName==="STYLE"?s.push(a):r.push(ps(o))}),n.forEach(o=>{let a=si(o.attrs);a&&console.warn(`jq79: <script ${a}> 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=ei(o.content))});let i=o=>"scoped"in o.attrs&&!("lang"in o.attrs);if(s.some(i)){let o=Go(t);Ds(r,o),s.forEach(a=>{i(a)&&(a.scoped=ti(a.content,o))})}return Ls(r),{template:r,scripts:n,styles:s}},qs=/\.html?([?#]|$)/,nt=e=>qs.test(e)?Vt(e):import(e),nn=/^(?:\.\.?\/|\/|[a-z][a-z0-9+.-]*:)/i,Bt=(e,t)=>{if(!nn.test(e))return e;try{return new URL(e,new URL(t??"",document.baseURI)).href}catch{return e}},ri=(e,t)=>e?`
|
|
19
|
+
//# sourceURL=${e}?jq79-script=${t}`:"",Hs=(e,t,n)=>{try{return Xt(e,t,ri(n.filename,n.index??0))}catch(s){throw s instanceof Pe?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}},ns=e=>e.scoped??e.content,Le=`:where([${Ns}]) { display: contents }`,sn=()=>Qt&&typeof Document<"u"&&"adoptedStyleSheets"in Document.prototype,st=e=>{let t=new CSSStyleSheet;return t.replaceSync(e),t},rn=(e,t)=>{e.adoptedStyleSheets.includes(t)||(e.adoptedStyleSheets=[...e.adoptedStyleSheets,t])},Kt=(e,t)=>{e.adoptedStyleSheets=e.adoptedStyleSheets.filter(n=>n!==t)},Xe=null,zt=null,oi=()=>{if(sn()){rn(document,zt??(zt=st(Le)));return}Xe?.isConnected||(Xe=document.createElement("style"),Xe.textContent=Le,document.head.appendChild(Xe))},rt=new Map,ii=e=>{let t=rt.get(e);if(!t){if(sn()){let n=st(e);rn(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}}rt.set(e,t)}t.count++},ai=e=>{let t=rt.get(e);t&&--t.count<=0&&(t.sheet?Kt(document,t.sheet):t.el?.remove(),rt.delete(e))},li=(e,t,n,s={},r=nt,i={})=>{let o={...Gs,...s},a=new Proxy(t,{has:(d,p)=>p!=="$__effect"&&p!=="$__import"&&p!=="$__state"&&(Reflect.has(d,p)||!(p in globalThis)&&!(p in o))}),l={},c=Hs(kn(Object.keys(o)),_n(e),i)(a,n,r,l,...Object.values(o));return c.catch(d=>console.error("jq79: error in :setup script",d)),Es(c),{settled:c,sync:l.done===!0}},ss=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:O(s,e))})},Gt=e=>{let t=Ln(e);return!t&&e.attrs[":setup"]!==void 0&&ci(e,e.attrs[":setup"]),t},rs=new WeakSet,ci=(e,t)=>{t.trim()==="_"||rs.has(e)||(rs.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`))},di=e=>{let t=null;return e.forEach(n=>{let s=_e(n.content)??Gt(n);if(!s)return;let r=t??(t=new Set);s.forEach(({name:i})=>r.add(i))}),t},os=(e,t)=>{if(t===null)return e;let n={};return Object.keys(e).forEach(s=>{t.has(s)&&(n[s]=e[s])}),n},is=new WeakMap,ui=(e,t,n,s)=>{if(s===null)return;let r=is.get(e)??new Set;is.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`))})},fi=(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},Ws=Symbol("jq79.unfilledProps"),ot=Symbol("jq79.pendingScripts"),pi=e=>e&&e.default!==void 0?e.default:e,hi=(e,t,n,s={},r=nt,i={})=>{let o={...Gs,...s},a={},l=Hs(On(Object.keys(o)),jn(e),i)(a,pi,r,...Object.values(o)),c=I=>console.error("jq79: error in factory script",I),d=!1,p,w=()=>{if(d)return p;d=!0;let I=a.default;if(typeof I!="function")return;let z=j=>{j&&typeof j=="object"&&Object.assign(t,j)};try{let j=I(t,{$data:t,$props:t,$effect:n,...s});j instanceof Promise?p=j.then(z).catch(c):z(j)}catch(j){c(j)}return p},_=l.then(w,c);return Es(_),a.done&&w(),{settled:_,sync:a.done===!0&&p===void 0}},gi="__JQ79_HMR_ENABLED__",mi="__JQ79_HMR__",be=null,yi=e=>{if(!be||!e.filename)return;let t=be.get(e.filename);t||be.set(e.filename,t=new Set),t.add(new WeakRef(e))},Dt=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},Ei=(e,t)=>{if(!be)return 0;let n=Dt(e),s=Ut(t);J?.forEach((a,l)=>{Dt(l)===n&&J.set(l,Promise.resolve(t))});let r=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,o=0;for(let[a,l]of be)if(Dt(a)===n){for(let c of l){let d=c.deref();if(!d){l.delete(c);continue}let p=i(d);if(!p){r=!0;continue}d.hotReplace(p)&&o++}l.size||be.delete(a)}return r?0:o},wi=()=>{be??(be=new Map),globalThis[mi]={update:Ei}},as=3e3,Si=(e,t)=>{let n=setTimeout(()=>{console.warn(`jq79: ${e.name?`<${e.name}>`:"a component"}${e.filename?` (${e.filename})`:""} has been waiting ${as/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.`)},as);n?.unref?.(),Promise.all(t).then(()=>clearTimeout(n))},Fs=e=>{if(nn.test(e))return e;let t=import.meta.resolve;if(typeof t!="function")return e;try{return t(e)}catch{return e}},J=new Map,Us=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()}),zs?.then(()=>Pi(e))]).then(([t])=>t),Bs=e=>{if(!J)return ls(e);let t=Us(e),n=J.get(t);if(!n){n=ls(e),J.set(t,n);let s=n;s.catch(()=>{J?.get(t)===s&&J.delete(t)})}return n},Vt=async e=>{let t=Fs(e),n=await Bs(t);return new ue(n,{filename:t})},cs=new WeakSet,ds=new Set,bi=e=>{if(ds.has(e))return;ds.add(e);let t=document.createElement("link");t.rel="modulepreload";let n=Yt();n&&t.setAttribute("nonce",n),t.href=e,document.head.append(t)},Ti=/<script\b(?:"[^"]*"|'[^']*'|[^>"'])*>([\s\S]*?)<\/script\s*>/gi,it=new Set,Ks=(e,t,n)=>{for(let{spec:s,kind:r}of $n(e)){if(r==="component"&&n&&s in n)continue;let i=Fs(r==="fetch"?s:Bt(s,r==="component"?t:void 0));r==="fetch"||qs.test(i)?J&&Bs(i).then(o=>$i(o,i),()=>{}):nn.test(i)&&bi(i)}},$i=(e,t)=>{let n=Us(t);if(!it.has(n)){it.add(n);for(let[,s]of e.matchAll(Ti))Ks(s,t,void 0)}},Ri=(e,t,n)=>{for(let s of e)cs.has(s)||(cs.add(s),Ks(s.content,t,n))},zs,xi="/jq79-sw.js",Ni=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")})},Pi=e=>{let t=new URL(e,document.baseURI);return t.hash="",t.searchParams.set(qn,""),new Promise((n,s)=>{let r=document.createElement("script"),i=Yt();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)})},de=class de{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"?Ut(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(),yi(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"?Ut(t):t;Jt.clear(),Se.clear(),Ft.clear();let s=this.startMarker,r=!!(s&&this.content),i=r&&s.isConnected,o=i?s.parentNode:null,a=i?this.endMarker.nextSibling:null,l={...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(l,c),!o)?!1:(c&&this.placeShadowStyles(o,a),o.insertBefore(this.content,a),this.mountRoot=o,this.settleMounted(),!0)}static debug(t){if(t){let n=ce.scopedNames;for(let s in t){let r=t[s];Object.prototype.hasOwnProperty.call(ce,s)?typeof r=="boolean"?ce[s]=r:console.warn(`jq79: Component79.debug ignored "${s}" - the flags are booleans, and the ones it knows are: ${Object.keys(ce).join(", ")}`):console.warn(`jq79: Component79.debug does not know "${s}" - the flags it has are: ${Object.keys(ce).join(", ")}`)}ce.scopedNames!==n&&Je.clear()}return{...ce}}static safeEval(t={}){Qt=!0;let n=[];if(t.nonce){let r=Yt();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."))):Ht=r}let s=t.worker??(t.nonce?!1:xi);return s!==!1&&n.push(zs??(zs=Ni(s))),Promise.all(n).then(()=>{})}static cache(t){return t===!1?(J=null,it.clear()):t===!0&&(J??(J=new Map)),!!J}static clearCache(){J?.clear(),it.clear()}static fetch(t){if(Array.isArray(t))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new Zt(Vt(t))}static fetchAll(t){return Promise.all(t.map(Vt))}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=>nt(Bt(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=Dn(this.scripts,Gt),r=fi(this.siblings,s),i=r?Object.assign(Object.create(r),t):{...t},o=new Set([...s].filter(y=>!(y in t)));o.size&&Object.defineProperty(i,Ws,{value:o}),this.slots&&Object.defineProperty(i,xs,{value:this.slots}),Object.defineProperty(i,ot,{value:{count:0,owner:this}});let a=Me(i),l=ye(a);this.data=a,this.fx=l,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let c=this.startMarker,d=!1,p=(y,v)=>{y==="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 C=new CustomEvent(y,{detail:v,bubbles:!0,composed:!0,cancelable:!0});return c===this.startMarker&&this.emitListeners.get(y)?.forEach(Q=>Q(C,v)),C.cancelBubble||c.dispatchEvent(C),!C.defaultPrevented},w,_=new Promise(y=>{w=y});this.resolveMounted=w,this.renderDone=!1,this.held=0;let I=y=>{if(typeof y!="function")throw new TypeError("jq79: $destroyed expects a function");return c!==this.startMarker?(Ne(y,"$destroyed"),()=>{}):It(this.destroyHooks??(this.destroyHooks=[]),y)},z=(y,{immediate:v=!0}={})=>{if(typeof y!="function")throw new TypeError("jq79: $attached expects a function");if(c!==this.startMarker)return()=>{};this.watchPage();let C=It(this.attachHooks??(this.attachHooks=[]),y);return v&&this.onPage&&Ne(y,"$attached"),C},j=y=>{if(typeof y!="function")throw new TypeError("jq79: $detached expects a function");return c!==this.startMarker?(Ne(y,"$detached"),()=>{}):(this.watchPage(),It(this.detachHooks??(this.detachHooks=[]),y))},b=y=>{let v=Et(y);return I(()=>v.$dispose()),v},H=this.endMarker,D=(y=>{let v=[];for(let C=c.nextSibling;C&&C!==H;C=C.nextSibling)C instanceof Element&&(C.matches(y)&&v.push(C),v.push(...Array.from(C.querySelectorAll(y))));return v}),L=(y=>D(y)[0]??null),U=this.modules,se=y=>U&&y in U?Promise.resolve(U[y]):nt(Bt(y,this.filename)),P=y=>{if(!Array.isArray(y))throw new TypeError("$importAll takes an array; use import() for one");return Promise.all(y.map(se))},x=Object.assign(Object.create(null),{$emit:p,$updateModel:(...y)=>{let[v,C]=y.length>1?y:[void 0,y[0]];return c!==this.startMarker?!1:this.modelWriteback?.(v,C)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(y=>[y,!0]))}),q=[],ee=!0;Ri(this.scripts,this.filename,this.modules),this.scripts.forEach((y,v)=>{let C;q.push(new Promise(S=>{C=S}));let Q=!1,$=()=>{Q=!0,C()},B={$mounted:()=>($(),_),$destroyed:I,$attached:z,$detached:j,$computed:b,$self:L,$$self:D,...x,$importAll:P,...r},f={filename:this.filename,index:v},u=":mounted"in y.attrs,m=Tn(y.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."),ss(a,_e(y.content));let T=u?kt(m):m;return hi(T,a,R=>l.effect(R),B,se,f)}let{vars:S,code:g}=ze(y.content);ss(a,Gt(y)),S.forEach(T=>{T in a||(a[T]=void 0)});let E=u?kt(g):g;return li(E,a,T=>l.effect(T),B,se,f)})();if(h.sync)h.settled.then($,$);else{let S=i[ot];S.count++;let g=()=>{S.count--,$()};h.settled.then(g,g)}!h.sync&&!Q&&(ee=!1)});let G=document.createDocumentFragment(),Z=new Proxy(a,{has:(y,v)=>typeof v=="string"&&v in x||Reflect.has(y,v),get:(y,v,C)=>typeof v=="string"&&v in x&&!Reflect.has(y,v)?x[v]:Reflect.get(y,v,C)});if(G.append(this.startMarker,this.endMarker),this.content=G,ee?(this.endMarker.parentNode.insertBefore(Te(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted()):(Promise.all(q).then(()=>{c===this.startMarker&&(this.endMarker.parentNode.insertBefore(Te(this.template,Z,l,n),this.endMarker),this.renderDone=!0,this.settleMounted(),de.settleAttached())}),Si(this,q)),n)if(sn())this.shadowCss=[...this.styles.map(y=>y.content),Le];else{let y=document.createElement("style");y.textContent=Le,this.styleEls=[...this.styles.map(v=>{let C=document.createElement("style");return C.textContent=v.content,C}),y]}else this.styles.forEach(y=>ii(ns(y))),this.ownsSharedStyles=!0;return this}mount(t,n){let s=typeof t=="string"?Ce(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"?Ce(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(),de.settleAttached(),this}isOnPage(){return this.renderDone&&this.startMarker?.isConnected===!0}watchPage(){pe.has(this)||(pe.add(this),this.onPage=this.isOnPage(),this.onPage||de.queueSettle())}static queueSettle(){qt||(qt=!0,queueMicrotask(()=>{qt=!1,de.settleAttached()}))}static settleAttached(){if(pe.size===0)return;let t=[...pe].filter(n=>!n.onPage&&n.isOnPage());de.inDocumentOrder(t).forEach(n=>{n.onPage||!pe.has(n)||(n.onPage=!0,n.attachHooks?.slice().forEach(s=>Ne(s,"$attached")))})}notifyDetached(){if(pe.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=de.inDocumentOrder([...pe].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=>Ne(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=>Kt(this.sheetRoot,s)),this.shadowSheets.length===0&&(this.shadowSheets=this.shadowCss.map(s=>s===Le?zt??(zt=st(s)):st(s))),this.shadowSheets.forEach(s=>rn(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(),pe.delete(this),this.attachHooks=null,this.detachHooks=null,this.onPage=!1;let t=this.destroyHooks;this.destroyHooks=null,t?.forEach(s=>Ne(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!==zt&&Kt(this.sheetRoot,s)}),this.shadowCss=null,this.shadowSheets=[],this.sheetRoot=null,this.ownsSharedStyles&&(this.styles.forEach(s=>ai(ns(s))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.renderDone=!1,this.data=null,this.resolveMounted=null,this}};A(de,"version",Kr);var ue=de,Zt=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 Hi=e=>new ue(e),Ne=(e,t)=>{try{e()}catch(n){console.error(`jq79: error in a ${t} hook`,n)}},It=(e,t)=>(e.push(t),()=>{let n=e.indexOf(t);n!==-1&&e.splice(n,1)}),pe=new Set,qt=!1,Gs={$:Ce,$$:ct,$create:dt,$reactive:Me,$toRaw:V,Component79:ue,C79:ue};typeof globalThis<"u"&&globalThis[gi]&&wi();export{Ce as $,ct as $$,Et as $computed,dt as $create,Me as $reactive,V as $toRaw,ue as C79,ue as Component79,Zt as PendingComponent79,wi as enableHotReload,Ei as hotUpdate,Hi as parseComponent,qi as renderComponent};
|
|
20
20
|
//# sourceMappingURL=jq79.js.map
|