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