jq79 0.4.17 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/jq79.cjs CHANGED
@@ -1,14 +1,14 @@
1
- var Y=Object.defineProperty;var de=Object.getOwnPropertyDescriptor;var pe=Object.getOwnPropertyNames;var he=Object.prototype.hasOwnProperty;var ge=(t,n,e)=>n in t?Y(t,n,{enumerable:!0,configurable:!0,writable:!0,value:e}):t[n]=e;var me=(t,n)=>{for(var e in n)Y(t,e,{get:n[e],enumerable:!0})},ye=(t,n,e,s)=>{if(n&&typeof n=="object"||typeof n=="function")for(let o of pe(n))!he.call(t,o)&&o!==e&&Y(t,o,{get:()=>n[o],enumerable:!(s=de(n,o))||s.enumerable});return t};var be=t=>ye(Y({},"__esModule",{value:!0}),t);var N=(t,n,e)=>ge(t,typeof n!="symbol"?n+"":n,e);var jn={};me(jn,{$:()=>B,$$:()=>tt,$create:()=>et,$reactive:()=>V,C79:()=>q,Component79:()=>q,PendingComponent79:()=>ft,enableHotReload:()=>ue,hotUpdate:()=>ce,parseComponent:()=>_n,renderComponent:()=>an});module.exports=be(jn);function B(t,n){return typeof t=="string"?document.querySelector(t):t.querySelector(n)}function tt(t,n){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(n))}var et=(t,n={})=>{let e=document.createElement(t);for(let[s,o]of Object.entries(n))if(s==="className")e.className=Array.isArray(o)?o.join(" "):o;else if(s==="textContent")e.textContent=o;else if(s==="children")for(let i of o)e.appendChild(i);else e.setAttribute(s,o);return e},Ee=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),jt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Se=new Set(["http:","https:","mailto:"]);function we(t){try{let n=new URL(t,"https://example.com");return Se.has(n.protocol)}catch{return!1}}var Re={"https:":"443","http:":"80"};function $e(t){let n=t.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!n)return null;let[,e,s]=n,o=e.split(".");return o.some(r=>r!=="*"&&!/^[a-z\d-]+$/.test(r))?null:{host:new RegExp(`^${o.map(r=>r==="*"?"[^.]+":r).join("\\.")}$`),port:!s||s==="*"?null:s}}var Ot=t=>{let n=(Array.isArray(t)?t:t.split(",")).map($e).filter(e=>e!==null);return e=>{let s=e.hostname.toLowerCase(),o=e.port||Re[e.protocol]||"";return n.some(i=>i.host.test(s)&&(i.port===null||i.port===o))}};function Te(t,n,e,s){try{return!!t(new URL(n,document.baseURI),e,s)}catch{return!1}}var Nt=512;function Lt(t,n,e,s){if(e>Nt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${Nt} elements`);for(let o of Array.from(t.childNodes))if(o.nodeType===Node.ELEMENT_NODE){let i=xe(o,e,s);i&&n.appendChild(i)}else o.nodeType===Node.TEXT_NODE&&n.appendChild(o.cloneNode())}function xe(t,n,e){let s=t.tagName.toLowerCase();if(!Ee.has(s))return null;let o=document.createElement(s);for(let i of Array.from(t.attributes)){let r=i.name.toLowerCase(),a=jt[s]?.has(r),u=jt["*"]?.has(r);!a&&!u||(r==="href"||r==="src")&&(!we(i.value)||e&&!Te(e,i.value,s,r))||o.setAttribute(r,i.value)}return s==="a"&&o.setAttribute("rel","noopener noreferrer"),Lt(t,o,n+1,e),o}function vt(t,n){let e=document.createElement("template");e.innerHTML=t;let s=document.createElement("div");return Lt(e.content,s,0,n?.allowUrl),s.innerHTML}var Ce=(t,n)=>n.split(".").reduce((e,s)=>e?.[s],t),Mt=t=>{if(Array.isArray(t))return!0;let n=Object.getPrototypeOf(t);return n===Object.prototype||n===null},Dt=(t,n,e)=>{Object.entries(t).forEach(([s,o])=>{let i=n?`${n}.${s}`:s;o&&typeof o=="object"&&Mt(o)?Dt(o,i,e):e(i,o)})},Ae=(t,n)=>t===n||t.startsWith(`${n}.`)||n.startsWith(`${t}.`),ht=Symbol("jq79.raw"),nt=t=>{let n=t;for(;n!==null&&typeof n=="object"&&n[ht];)n=n[ht];return n},qt=Symbol("jq79.store"),G=t=>t!==null&&typeof t=="object"&&t[qt]===!0,z=[],K=t=>{z.push(new Set);try{return t()}finally{z.pop()}},Pt="$__attach",st=Symbol("jq79.alsoWakenBy"),V=t=>{let n=new Map,e=new Set,s=new Set,o=new WeakMap,i=Object.create(null),r=(h,m,$=!1)=>{n.get(h)?.forEach(S=>S(m,h)),e.forEach(S=>S(h,m)),s.forEach(S=>{($||Array.from(S.deps).some(c=>Ae(c,h)))&&S.run()})},a=h=>h!==null&&typeof h=="object"&&Mt(h),u=new Map,p=(h,m)=>{let $=u.get(m);$?.store!==h&&($?.unsubscribe(),u.set(m,{store:h,unsubscribe:h.$onAny((S,c)=>r(`${m}.${S}`,c))}))},d=h=>{u.get(h)?.unsubscribe(),u.delete(h)},g=(h,m)=>{let $=o.get(h);if($)return $;let S=null,c=new Proxy(h,{has(f,l){return Reflect.has(f,l)||typeof l=="string"&&S?.has(l)===!0},get(f,l,T){if(l===ht)return f;if(l===qt)return m==="";if(typeof l!="string")return Reflect.get(f,l,T);if(m===""&&l in i)return i[l];let _=m?`${m}.${l}`:l;z[z.length-1]?.add(_);let j=Reflect.get(f,l,T);if(G(j))return p(j,_),j;let b=nt(j);return a(b)?g(b,_):b},set(f,l,T,_){if(_!==c&&!Object.prototype.hasOwnProperty.call(f,l))return Reflect.set(f,l,T,_);let j=m?`${m}.${l}`:l,b=G(T)?T:nt(T),L=!Object.prototype.hasOwnProperty.call(f,l);if(!L&&Object.is(f[l],b)&&(b===null||typeof b!="object"))return!0;f[l]=b,S?.delete(l),G(b)?p(b,j):d(j);let v=G(b)||!a(b)?b:g(b,j);return r(j,v,L),!0},deleteProperty(f,l){if(typeof l!="string")return Reflect.deleteProperty(f,l);let T=Object.prototype.hasOwnProperty.call(f,l),_=Reflect.deleteProperty(f,l);if(_&&T){let j=m?`${m}.${l}`:l;(S??(S=new Set)).add(l),d(j),r(j,void 0)}return _}});return o.set(h,c),c},E=g(nt(t),"");Object.entries(nt(t)).forEach(([h,m])=>{G(m)&&p(m,h)});let O=(h,m,{immediate:$=!1}={})=>(n.has(h)||n.set(h,new Set),n.get(h).add(m),$&&m(Ce(E,h),h),()=>n.get(h)?.delete(m)),x=(h,{immediate:m=!1}={})=>(e.add(h),m&&Dt(E,"",($,S)=>h($,S)),()=>e.delete(h)),y=(h,m)=>{let $=!1,S=!1,c={deps:new Set,run:()=>{if($){S=!0;return}$=!0;try{let f=0;do{S=!1;let l=new Set;z.push(l);try{h()}finally{z.pop(),c.deps=l}}while(S&&++f<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{$=!1}}};return s.add(c),m?.length?w(c,m):(c.run(),()=>{s.delete(c)})},w=(h,m)=>{let $=m.map(S=>S?.[Pt]?.(h)).filter(Boolean);return h.run(),()=>{s.delete(h),$.forEach(S=>S())}},R=h=>(s.add(h),()=>{s.delete(h)}),A=()=>{u.forEach(({unsubscribe:h})=>h()),u.clear()};return i.$on=O,i.$onAny=x,i.$effect=y,i.$dispose=A,i[Pt]=R,E},I=t=>{let n=[],e=[],s=t[st];return{effect:o=>{n.push(t.$effect(o,s)),e.push(o)},onDispose:o=>{n.push(o)},refresh:()=>{e.forEach(o=>o())},dispose:()=>{n.splice(0).forEach(o=>o()),e.length=0}}};var Wt=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,Ut=/\$:\s*/y,rt=/import(?=\s*\()/y,Ft=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,W=(t,n)=>{let e=t[n],s=n+1;for(;s<t.length;){if(t[s]==="\\"){s+=2;continue}if(t[s]===e)return s+1;s++}return t.length},M=(t,n)=>{let e=t.indexOf(`
2
- `,n);return e===-1?t.length:e},D=(t,n)=>{let e=t.indexOf("*/",n+2);return e===-1?t.length:e+2},ot=(t,n)=>{let e=n;for(;e<t.length;){if(/\s/.test(t[e])){e++;continue}if(t[e]==="/"&&t[e+1]==="/"){e=M(t,e);continue}if(t[e]==="/"&&t[e+1]==="*"){e=D(t,e);continue}break}return e},_e=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),U=(t,n)=>{let e=n-1;for(;e>=0;){let o=t[e];if(/\s/.test(o)){e--;continue}if(o==="/"&&t[e-1]==="*"){let i=t.lastIndexOf("/*",e-2);if(i===-1)return!0;e=i-1;continue}break}if(e<0)return!0;let s=t[e];if(/[\w$]/.test(s)){let o=e;for(;o>0&&/[\w$]/.test(t[o-1]);)o--;return _e.has(t.slice(o,e+1))}return(s==="+"||s==="-")&&t[e-1]===s?!1:!")]}\"'`.".includes(s)},F=(t,n)=>{let e=n+1,s=!1;for(;e<t.length;){let o=t[e];if(o==="\\"){e+=2;continue}if(o===`
3
- `)return e;if(o==="[")s=!0;else if(o==="]")s=!1;else if(o==="/"&&!s){for(e++;e<t.length&&/[a-z]/i.test(t[e]);)e++;return e}e++}return t.length},je=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Ne=(t,n)=>{let e=n-1;for(;e>=0;){let s=t[e];if(/\s/.test(s)){e--;continue}if(s==="/"&&t[e-1]==="*"){let o=t.lastIndexOf("/*",e-2);if(o===-1)return"";e=o-1;continue}return s}return""},It=(t,n)=>{let e=0,s=n;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=W(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=M(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=D(t,s);continue}if(o==="/"&&U(t,s)){s=F(t,s);continue}if("([{".includes(o))e++;else if(")]}".includes(o))e--;else{if(e<=0&&o===";")return s;if(e<=0&&o===`
4
- `){let i=ot(t,s+1);if(!(i<t.length&&(je.test(t.slice(i,i+2))||[",","="].includes(Ne(t,s)))))return s;s=i;continue}}s++}return t.length},Oe=t=>{let n=[],e=0,s=0,o=0,i=a=>{n.push({raw:t.slice(s,a),codeEnd:Math.max(0,o-s)}),s=a+1,o=s},r=0;for(;r<t.length;){let a=t[r];if(a==="'"||a==='"'||a==="`"){r=W(t,r),o=r;continue}if(a==="/"&&t[r+1]==="/"){r=M(t,r);continue}if(a==="/"&&t[r+1]==="*"){r=D(t,r);continue}if(a==="/"&&U(t,r)){r=F(t,r),o=r;continue}if("([{".includes(a))e++;else if(")]}".includes(a))e--;else if(a===","&&e<=0){i(r),r++;continue}/\s/.test(a)||(o=r+1),r++}return i(t.length),n},gt=t=>{let n=t.trim();if(!n.startsWith("{")&&!n.startsWith("["))return at.test(n)?[n]:[];let e=[];for(let s of yt(n.slice(1,Ht(n)))){s.startsWith("...")&&(s=s.slice(3).trim());let o=bt(s);if(o!==-1&&(s=s.slice(0,o).trim()),n.startsWith("{")){let i=mt(s,":");if(i!==-1){e.push(...gt(s.slice(i+1)));continue}}e.push(...gt(s))}return e},Le=t=>{let n=[],e=Oe(t).map(({raw:i,codeEnd:r})=>{let a=i.match(/^\s*/)[0];if(r<=a.length)return{text:i,empty:!0};let u=i.slice(a.length,r),p=i.slice(r),d=bt(u),g=(d===-1?u:u.slice(0,d)).trim(),E=u[0]==="{"||u[0]==="[";E?n.push(...gt(g)):at.test(g)&&n.push(g);let O=lt(u).code;return{text:`${a}${E?`(${O})`:O}${p}`,empty:!1}}),s=[];for(;e.length&&e[e.length-1].empty;)s.unshift(e.pop().text);let o=e.map(i=>i.text).join(",")+s.join("");return o.trimStart().startsWith("(")&&(o=`;${o}`),{vars:n,code:o}},lt=t=>{let n=[],e="",s=0,o=0,i=!0;for(;s<t.length;){let r=t[s],a=t[s+1];if(r==="'"||r==='"'||r==="`"){let u=W(t,s);e+=t.slice(s,u),s=u,i=!1;continue}if(r==="/"&&(a==="/"||a==="*")){let u=a==="/"?M(t,s):D(t,s);e+=t.slice(s,u),s=u;continue}if(r==="/"&&U(t,s)){let u=F(t,s);e+=t.slice(s,u),s=u,i=!1;continue}if(r==="i"&&(s===0||!/[\w$.]/.test(t[s-1]))&&(rt.lastIndex=s,rt.test(t))){e+="$__import",s+=6,i=!1;continue}if(o===0&&i){Wt.lastIndex=s;let u=Wt.exec(t);if(u){let d=s+u[0].length,g=It(t,d),{vars:E,code:O}=Le(t.slice(d,g));n.push(...E),e+=O,s=g,i=!1;continue}Ut.lastIndex=s;let p=Ut.exec(t);if(p){Ft.lastIndex=s;let d=Ft.exec(t);d&&n.push(d[1]);let g=s+p[0].length,E=It(t,g);e+=`$__effect(() => { ${lt(t.slice(g,E)).code} });`,s=E;continue}}"([{".includes(r)?o++:")]}".includes(r)&&(o=Math.max(0,o-1)),r===`
5
- `||r===";"||r==="}"?i=!0:/\s/.test(r)||(i=!1),e+=r,s++}return{vars:n,code:e}},it=/export\s+default(?![\w$])/y,kt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,ve=t=>{let n=[],e=0,s=0;for(let o=0;o<=t.length;o++){let i=t[o];if(i==="{")e++;else if(i==="}")e--;else if(o===t.length||i===","&&e===0){let r=t.slice(s,o).trim();r&&n.push(r),s=o+1}}return n},Pe=(t,n,e)=>{let s=`await $__import(${JSON.stringify(n)})`;if(t===void 0)return s;let o=ve(t),i=[],r=s;if(o.length>1){let a=`$__mod${e}`;i.push(`${a} = ${s}`),r=a}for(let a of o)a.startsWith("{")?i.push(`${a.replace(/\s+as\s+/g,": ")} = ${r}`):a.startsWith("*")?i.push(`${a.replace(/^\*\s*as\s+/,"")} = ${r}`):i.push(`${a} = $__default(${r})`);return`const ${i.join(", ")}`},at=/^[A-Za-z_$][\w$]*$/,Ht=t=>{let n=0,e=0;for(;e<t.length;){let s=t[e];if(s==="'"||s==='"'||s==="`"){e=W(t,e);continue}if(s==="/"&&t[e+1]==="/"){e=M(t,e);continue}if(s==="/"&&t[e+1]==="*"){e=D(t,e);continue}if(s==="/"&&U(t,e)){e=F(t,e);continue}if("([{".includes(s))n++;else if(")]}".includes(s)&&--n===0)return e;e++}return t.length},mt=(t,n)=>{let e=0,s=0;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=W(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=M(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=D(t,s);continue}if(o==="/"&&o!==n&&U(t,s)){s=F(t,s);continue}if("([{".includes(o))e++;else if(")]}".includes(o))e--;else if(e===0&&o===n)return s;s++}return-1},yt=t=>{let n=[],e=0,s=0,o=0;for(;o<=t.length;){let i=t[o];if(i==="'"||i==='"'||i==="`"){o=W(t,o);continue}if(i==="/"&&t[o+1]==="/"){o=M(t,o);continue}if(i==="/"&&t[o+1]==="*"){o=D(t,o);continue}if(i==="/"&&U(t,o)){o=F(t,o);continue}if(i!==void 0&&"([{".includes(i))e++;else if(i!==void 0&&")]}".includes(i))e--;else if(o===t.length||i===","&&e===0){let r=t.slice(s,o).trim();r&&n.push(r),s=o+1}o++}return n},bt=t=>{let n=0;for(;n<t.length;){let e=mt(t.slice(n),"=");if(e===-1)return-1;let s=n+e;if(t[s+1]!=="="&&t[s+1]!==">"&&t[s-1]!=="="&&t[s-1]!=="!")return s;n=s+1}return-1},J=t=>{let n=(t??"").trim();if(!n.startsWith("{"))return null;let e=Ht(n);if(e>=n.length)return null;let s=[];for(let o of yt(n.slice(1,e))){if(o.startsWith("..."))continue;let i=bt(o),r=i===-1?o:o.slice(0,i),a=i===-1?void 0:o.slice(i+1).trim(),u=mt(r,":"),p=(u===-1?r:r.slice(0,u)).trim();if(!at.test(p))continue;let d={name:p};a!==void 0&&(d.default=a);let g=u===-1?"":r.slice(u+1).trim();at.test(g)&&(d.as=g),s.push(d)}return s},Me=t=>{let n=0,e=0,s=!0;for(;n<t.length;){let o=t[n];if(o==="'"||o==='"'||o==="`"){n=W(t,n),s=!1;continue}if(o==="/"&&t[n+1]==="/"){n=M(t,n);continue}if(o==="/"&&t[n+1]==="*"){n=D(t,n);continue}if(o==="/"&&U(t,n)){n=F(t,n),s=!1;continue}if(o==="e"&&e===0&&s&&(n===0||!/[\w$.]/.test(t[n-1]))){it.lastIndex=n;let i=it.exec(t);if(i)return n+i[0].length}"([{".includes(o)?e++:")]}".includes(o)&&(e=Math.max(0,e-1)),o===`
6
- `||o===";"||o==="}"?s=!0:/\s/.test(o)||(s=!1),n++}return-1},De=/^async(?![\w$])/,qe=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,We=t=>{let n=Me(t);if(n===-1)return null;let e=ot(t,n),s=t.slice(e);De.test(s)&&(e=ot(t,e+5));let o=qe.exec(t.slice(e));if(o&&(e=ot(t,e+o[0].length)),t[e]!=="(")return null;let i=0,r=e;for(;r<t.length;){let a=t[r];if(a==="'"||a==='"'||a==="`"){r=W(t,r);continue}if(a==="/"&&t[r+1]==="/"){r=M(t,r);continue}if(a==="/"&&t[r+1]==="*"){r=D(t,r);continue}if(a==="/"&&U(t,r)){r=F(t,r);continue}if("([{".includes(a))i++;else if(")]}".includes(a)&&--i===0)break;r++}return yt(t.slice(e+1,r))[0]??""},Et=t=>{let n=We(t);if(n===null)return null;let e=J(n),s=e?.find(o=>o.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 e},Bt=t=>{let n="",e=0,s=0,o=!0,i=!1,r=0;for(;e<t.length;){let a=t[e],u=t[e+1],p=e===0||!/[\w$.]/.test(t[e-1]);if(a==="'"||a==='"'||a==="`"){let d=W(t,e);n+=t.slice(e,d),e=d,o=!1;continue}if(a==="/"&&(u==="/"||u==="*")){let d=u==="/"?M(t,e):D(t,e);n+=t.slice(e,d),e=d;continue}if(a==="/"&&U(t,e)){let d=F(t,e);n+=t.slice(e,d),e=d,o=!1;continue}if(a==="i"&&p){if(rt.lastIndex=e,rt.test(t)){n+="$__import",e+=6,o=!1;continue}if(s===0&&o){kt.lastIndex=e;let d=kt.exec(t);if(d){n+=Pe(d[1],d[3],r++),e+=d[0].length,o=!1;continue}}}if(a==="e"&&p&&s===0&&o){it.lastIndex=e;let d=it.exec(t);if(d){i=!0,n+="$__exports.default =",e+=d[0].length,o=!1;continue}}"([{".includes(a)?s++:")]}".includes(a)&&(s=Math.max(0,s-1)),a===`
7
- `||a===";"||a==="}"?o=!0:/\s/.test(a)||(o=!1),n+=a,e++}return i?n:null};var Ue="0.4.17",Yt=t=>Object.fromEntries(Array.from(t.attributes).map(n=>[n.name,n.value])),te=t=>({tag:t.tagName.toLowerCase(),attrs:Yt(t),children:Array.from((t instanceof HTMLTemplateElement?t.content:t).childNodes).flatMap(n=>{if(n.nodeType===Node.TEXT_NODE){let e=n.textContent??"";return e?[e]:[]}return n.nodeType===Node.ELEMENT_NODE?[te(n)]:[]})}),zt=new Map,ee=(t,n)=>{let e=`${n.join(",")}|${t}`,s=zt.get(e);if(s===void 0){try{s=new Function("$scope",...n,`with ($scope) { return (${t}
8
- ); }`)}catch{s=null}zt.set(e,s)}return s},C=(t,n,e)=>{let s=ee(t,e?Object.keys(e):[]);if(s)try{return s(n,...e?Object.values(e):[])}catch{return}},Fe=(t,n)=>t.replace(/{{\s*([\s\S]+?)\s*}}/g,(e,s)=>C(s,n)??""),Ie=new Set([":attrs",":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),$t=t=>Ie.has(t)||t.startsWith(":class.")||t.startsWith(":props.")||t===":slot"||t.startsWith(":slot."),ke=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,He=(t,n,e,s)=>{let[o,...i]=n.slice(1).split("."),r=new Set(i);t.addEventListener(o,a=>{if(r.has("self")&&a.target!==t)return;r.has("prevent")&&a.preventDefault(),r.has("stop")&&a.stopPropagation();let u=C(e,s,{$event:a});typeof u=="function"&&u.call(t,a)},{once:r.has("once"),capture:r.has("capture")})},Be=(t,n,e,s)=>{let[o,...i]=n.slice(1).split("."),r=new Set(i),a=u=>{r.has("prevent")&&u.preventDefault(),r.has("stop")&&u.stopPropagation(),r.has("once")&&t.off(o,a),K(()=>{let p=C(e,s,{$event:u});typeof p=="function"&&p(u)})};t.on(o,a)},k=t=>t.replace(/-(\w)/g,(n,e)=>e.toUpperCase()),Tt=t=>t instanceof DocumentFragment?{first:t.firstChild,last:t.lastChild}:{first:t,last:t},ct=({first:t,last:n})=>{for(let e=t;e;){let s=e===n?null:e.nextSibling;e.parentNode?.removeChild(e),e=s}},ze=({first:t,last:n},e)=>{let s=e.nextSibling;for(let o=t;o;){let i=o===n?null:o.nextSibling;e.parentNode.insertBefore(o,s),o=i}},Zt=(t,n)=>{let e=n.replace(/-/g,"").toLowerCase();for(let s=t;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let o of Object.keys(s))if(/^[A-Z]/.test(o)&&o.replace(/-/g,"").toLowerCase()===e)return o;return null},Gt=200,St=0,ne=Symbol("jq79.slots"),Ze=t=>t==="slot"||t.startsWith("slot."),se=t=>t?k(t):"default",xt=t=>Object.keys(t.attrs).find(n=>n===":slot"||n.startsWith(":slot.")),Ge=t=>t==="default"?":slot":`:slot.${t}`,Ke=t=>typeof t!="string"||t.trim()!=="",Ve=t=>{let n={},e=[];t.children.forEach(o=>{let i=typeof o=="object"&&o.tag==="template"?xt(o):void 0;if(typeof o=="string"||i===void 0){e.push(o);return}let r=se(i.slice(6));if(r in n){console.warn(`jq79: two <template ${Ge(r)}> in <${t.tag}>; the second was ignored`);return}n[r]={nodes:o.children,binder:o.attrs[i]||void 0}});let s=e.some(Ke);return s&&"default"in n?console.warn(`jq79: <${t.tag}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(n.default={nodes:e,binder:t.attrs[":slot"]||void 0}),n},Je=(t,n,e)=>{J(n)?.forEach(({name:s,as:o,default:i})=>{let r=o??s;Object.defineProperty(t,r,{enumerable:!0,configurable:!0,get:()=>{let a=e[s]?.();return a===void 0&&i!==void 0?C(i,t):a},set:()=>console.warn(`jq79: "${r}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},Xe=t=>{let n=xt(t);return console.warn(`jq79: <template ${n}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${n}`)},Qe=(t,n)=>{let e=Object.entries(Ve(t));if(!e.length)return null;let s={};return e.forEach(([o,i])=>{s[o]=Ye(i,n)}),s},Ye=(t,n)=>(e,s,o,i)=>{let r=Object.create(n);Je(r,t.binder,e);let a=r[st]??[];Object.defineProperty(r,st,{value:[...a,s]});let u=I(r);return o.onDispose(()=>u.dispose()),Z(t.nodes,r,u,i)},tn=(t,n,e,s)=>{let o=se(t.tag.slice(5)),i=document.createDocumentFragment(),r=document.createComment(t.tag),a=document.createComment(`/${t.tag}`);i.append(r,a);let u=n[ne]?.[o];if(!u)return i.insertBefore(Z(t.children,n,e,s),a),i;let p={};return Object.entries(t.attrs).forEach(([d,g])=>{if(!(d===dt||$t(d)||d.startsWith("@")))if(d.startsWith(":")){let E=g||d.slice(1);p[k(d.slice(1))]=()=>C(E,n)}else p[k(d)]=()=>g}),i.insertBefore(u(p,n,e,s),a),i},Kt=(t,n,e,s,o)=>{let i=document.createComment(t),r=document.createComment(`/${t}`),a=document.createDocumentFragment();a.append(i,r);let u=Qe(n,e),p={},d={},g=[],E=[],O=!1;Object.entries(n.attrs).forEach(([c,f])=>{if(c!==dt){if(c===":props"||c.startsWith(":props.")){O=!0,E.push({expr:f});return}if(!$t(c))if(c.startsWith("@"))g.push([c,f]);else if(c===":model"||c.startsWith(":model.")){let l=c===":model"?"default":k(c.slice(7));d[l]=f||(c===":model"?"model":l)}else if(c.startsWith(":")){let l=k(c.slice(1));p[l]=f||l,E.push({name:l,expr:f||l})}else{let l=k(c),T=JSON.stringify(f);p[l]=T,E.push({name:l,expr:T})}}});let x=c=>c==="default"?":model":`:model.${c}`,y=c=>c==="default"?"model":c,w=c=>`${c}
9
- = $value`;Object.entries(d).forEach(([c,f])=>{let l=y(c);p[l]!==void 0&&console.warn(`jq79: <${n.tag}> binds prop "${l}" through both :${l} and ${x(c)} - ${x(c)} wins`),p[l]=f,ee(w(f),["$value"])===null&&console.warn(`jq79: ${x(c)}="${f}" is not assignable - updates from <${n.tag}> will be dropped`)});let R=()=>{let c={};return E.forEach(({name:f,expr:l})=>{if(f!==void 0)c[f]=C(l,e);else{let T=C(l,e);T!==null&&typeof T=="object"&&Object.assign(c,T)}}),Object.entries(d).forEach(([f,l])=>{c[y(f)]=C(l,e)}),c},A=null,h=null,m=null,$=new Set,S=c=>{if(c==null){if(!e[le]?.has(t)||$.has("unfilled"))return;$.add("unfilled"),console.error(`jq79: <${n.tag}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${t}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}$.has("type")||($.add("type"),console.error(`jq79: <${n.tag}> is ${typeof c}, not a component - nothing renders here`))};return s.effect(()=>{let c=C(t,e),f=c instanceof q?c:null;if(f||S(c),f===h||(m?.dispose(),m=null,A?.destroy(),A=null,h=f,!f))return;let l=new q({template:f.template,scripts:f.scripts,styles:f.styles,modules:f.modules,filename:f.filename,siblings:f.siblings,name:f.name});if(u&&(l.slots=u),Object.keys(d).length){let b=new Set,L=(v,P)=>{b.has(v)||(b.add(v),console.warn(P))};l.on("model:update",(v,P)=>{if(P===null||typeof P!="object"){L("payload",`jq79: model:update expects a { name?, value } payload, got ${P===null?"null":typeof P}`);return}let pt=P.name==null?"default":k(String(P.name)),_t=d[pt];if(_t===void 0){L(pt,`jq79: <${n.tag}> has no ${x(pt)} - bound: ${Object.keys(d).map(x).join(", ")}`);return}K(()=>C(w(_t),e,{$value:P.value}))})}g.forEach(([b,L])=>Be(l,b,L,e));let T=K(R),_=document.createDocumentFragment();if(St>=Gt){console.error(`jq79: <${n.tag}> is ${Gt} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}St++;try{(o?l.renderShadow(T):l.render(T)).mount(_)}finally{St--}r.parentNode.insertBefore(_,r);let j=I(e);if(O){let b=[];j.effect(()=>{let L=R(),v=Object.keys(L);b.forEach(P=>{P in L||(l.data[P]=void 0)}),v.forEach(P=>{l.data[P]=L[P]}),b=v})}else Object.entries(p).forEach(([b,L])=>{j.effect(()=>{l.data[b]=C(L,e)})});m=j,A=l}),s.onDispose(()=>{m?.dispose(),A?.destroy()}),a},en=(t,n)=>{let e=()=>{let s=C(t,n);return s!==null&&typeof s=="object"?s:null};return new Proxy(n,{has(s,o){let i=e();return i!==null&&Reflect.has(i,o)||Reflect.has(s,o)},get(s,o){let i=e();return i!==null&&Reflect.has(i,o)?i[o]:Reflect.get(s,o)},set(s,o,i){let r=e();return r!==null&&Reflect.has(r,o)?(r[o]=i,!0):Reflect.set(s,o,i)}})},Q=t=>typeof t=="string"?t.split(/\s+/).filter(Boolean):Array.isArray(t)?t.flatMap(Q):t!==null&&typeof t=="object"?Object.entries(t).flatMap(([n,e])=>e?Q(n):[]):[],nn=t=>typeof t=="function"?(n,e,s)=>{try{return!!t(n,e,s)}catch{return!1}}:typeof t=="string"||Array.isArray(t)?Ot(t):()=>!1,Ct=(t,n,e,s)=>{let o=t.attrs[":with"],i=o!==void 0?en(o,n):n;if(Ze(t.tag))return tn(t,i,e,s);if(t.tag==="template"&&xt(t)!==void 0)return Xe(t);let r=Zt(i,t.tag);if(r)return Kt(r,t,i,e,s);let a=document.createElement(t.tag);if(a instanceof HTMLUnknownElement||t.tag.includes("-")){let y=!1;e.effect(()=>{if(y)return;let w=Zt(i,t.tag);if(!w)return;y=!0;let R=Kt(w,t,i,e,s),A=Tt(R);e.onDispose(()=>ct(A)),a.replaceWith(R)})}Object.entries(t.attrs).forEach(([y,w])=>{y.startsWith("@")?He(a,y,w,i):y===":model"||y.startsWith(":model.")?a instanceof HTMLUnknownElement||t.tag.includes("-")||console.warn(`jq79: ${y} on <${t.tag}> does nothing - :model binds component tags only (for now)`):$t(y)||a.setAttribute(y,w)});let u=t.attrs[":attrs"];if(u!==void 0){let y=[];e.effect(()=>{y.forEach(R=>a.removeAttribute(R));let w=C(u,i);y=w&&typeof w=="object"?Object.keys(w):[],y.forEach(R=>{let A=w[R];A!=null&&A!==!1&&a.setAttribute(R,String(A))})})}let p=t.attrs[":class"],d=Object.entries(t.attrs).filter(([y])=>y.startsWith(":class.")).map(([y,w])=>[y.slice(7),w]);if(p!==void 0||d.length){let y=new Set(Q(t.attrs.class??"")),w=[];e.effect(()=>{let R=p!==void 0?Q(C(p,i)):[];d.forEach(([A,h])=>{C(h,i)&&R.push(...Q(A))}),w.forEach(A=>{!R.includes(A)&&!y.has(A)&&a.classList.remove(A)}),a.classList.add(...R),w=R})}let g=t.attrs[":text"],E=t.attrs[":html"],O=t.attrs[":html.allowed"];O!==void 0&&E===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),g!==void 0?e.effect(()=>{a.textContent=String(C(g,i)??"")}):E!==void 0?e.effect(()=>{let y=O!==void 0?{allowUrl:nn(C(O,i))}:void 0;a.innerHTML=vt(String(C(E,i)??""),y)}):a instanceof HTMLTemplateElement?a.content.appendChild(Z(t.children,i,e,s)):a.appendChild(Z(t.children,i,e,s));let x=t.attrs[":value"];return x!==void 0&&e.effect(()=>{let y=String(C(x,i)??"");a.value!==y&&(a.value=y)}),[":checked",":selected"].forEach(y=>{let w=t.attrs[y];if(w===void 0)return;let R=y.slice(1);e.effect(()=>{a[R]=!!C(w,i)})}),a},sn=(t,n,e,s)=>{let o=document.createComment("if"),i=document.createDocumentFragment();i.appendChild(o);let r=null,a=null,u=null;return e.effect(()=>{let p=t.find(g=>g.expr===void 0||C(g.expr,n))??null;if(p===a||(u?.dispose(),r&&ct(r),r=null,a=p,!p))return;u=I(n);let d=Ct(p.node,n,u,s);r=Tt(d),o.parentNode.insertBefore(d,o.nextSibling)}),i},X=(t,n,e)=>{Object.defineProperty(t,n,{value:e,writable:!0,enumerable:!0,configurable:!0})},on=t=>{if(t===null||typeof t!="object"||Array.isArray(t))return!1;let n=Object.getPrototypeOf(t);return n===Object.prototype||n===null},rn=(t,n,e,s)=>{let o=t.attrs[":each"].match(ke);if(!o)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,i,r,a]=o,u=t.attrs[":key"],{[":each"]:p,[":key"]:d,...g}=t.attrs,E={...t,attrs:g},O=document.createComment("each"),x=document.createDocumentFragment();x.appendChild(O),(":if"in t.attrs||":elseif"in t.attrs||":else"in t.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let y=[],w=!1;return e.effect(()=>{let R=C(a,n),A=Array.isArray(R)?R.map((f,l)=>[l,f]):on(R)?Object.entries(R):[],h=new Map;y.forEach(f=>{let l=h.get(f.key);l?l.push(f):h.set(f.key,[f])});let m=new Set,$=[],S=A.map(([f,l],T)=>{let _=Object.create(n);X(_,i,l),r&&X(_,r,f),X(_,"$index",T);let j=u!==void 0?C(u,_):f;m.has(j)&&!w&&(w=!0,console.warn(`jq79: duplicate :key in :each "${t.attrs[":each"]}"; duplicates pair up by position`)),m.add(j);let b=h.get(j)?.shift();if(b&&Object.is(b.item,l))return b.scope.$index!==T&&$.push(b),X(b.scope,"$index",T),r&&X(b.scope,r,f),b;b&&(b.fx.dispose(),ct(b.range));let L=I(n),v=Tt(Ct(E,_,L,s));return{key:j,item:l,scope:_,fx:L,range:v}});h.forEach(f=>f.forEach(l=>{l.fx.dispose(),ct(l.range)}));let c=O;S.forEach(f=>{c.nextSibling!==f.range.first&&ze(f.range,c),c=f.range.last}),$.forEach(f=>K(()=>f.fx.refresh())),y=S}),x},Z=(t,n,e,s=!1)=>{let o=document.createDocumentFragment(),i=0;for(;i<t.length;){let r=t[i];if(typeof r=="string"){let a=document.createTextNode(r);r.includes("{{")&&e.effect(()=>{a.textContent=Fe(r,n)}),o.appendChild(a),i++;continue}if(":each"in r.attrs){o.appendChild(rn(r,n,e,s)),i++;continue}if(":if"in r.attrs){let a=[{expr:r.attrs[":if"],node:r}];i++;let u=d=>{let g=i;for(;g<t.length&&typeof t[g]=="string"&&!t[g].trim();)g++;let E=t[g];if(typeof E=="object"&&d in E.attrs)return i=g+1,E};for(let d=u(":elseif");d;d=u(":elseif"))a.push({expr:d.attrs[":elseif"],node:d});let p=u(":else");p&&a.push({node:p}),o.appendChild(sn(a,n,e,s));continue}o.appendChild(Ct(r,n,e,s)),i++}return o},an=(t,n,e=!1)=>Z(t.template,n,I(n),e),ln=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),cn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,oe=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,un=t=>t.split(oe).map((n,e)=>e%2===1?n:n.replace(cn,(s,o,i)=>ln.has(o.toLowerCase())?s:`<${o}${i}></${o}>`)).join(""),fn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,dn=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,pn=t=>t.split(oe).map((n,e)=>e%2===1?n:n.replace(fn,(s,o,i)=>{let r=0,a=i.replace(dn,(u,p,d)=>d===void 0?u:`${p}:props.${r++}="${d}"`);return`<${o}${a}>`})).join(""),dt="data-jq79",hn=t=>{let n=2166136261;for(let e=0;e<t.length;e++)n=Math.imul(n^t.charCodeAt(e),16777619);return(n>>>0).toString(36)},re=(t,n)=>{t.forEach(e=>{typeof e!="string"&&(e.attrs[dt]=n,re(e.children,n))})},gn=(t,n)=>t.split(",").map(e=>{let s=e.trim(),o=s.indexOf("::"),i=o===-1?s:s.slice(0,o),r=o===-1?"":s.slice(o);return`${i}[${dt}="${n}"]${r}`}).join(", "),ie=(t,n)=>{Array.from(t).forEach(e=>{e instanceof CSSStyleRule?e.selectorText=gn(e.selectorText,n):e instanceof CSSGroupingRule&&ie(e.cssRules,n)})},mn=(t,n)=>{/:deep\(|::v-deep|>>>/.test(t)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let e=new CSSStyleSheet;return e.replaceSync(t),ie(e.cssRules,n),Array.from(e.cssRules).map(s=>s.cssText).join(`
10
- `)},yn=/^[A-Z][A-Za-z0-9]*$/,wt=t=>{let n=un(pn(t)),s=new DOMParser().parseFromString(`<template>${n}</template>`,"text/html").querySelector("template"),o=[],i=[];Array.from(s.content.children).forEach(u=>{u.tagName==="TEMPLATE"?i.push(u):o.push(u)});let r=Vt(o,t),a={};return i.forEach(u=>{let p=u.getAttribute("name");if(p===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!yn.test(p)){console.warn(`jq79: <template name="${p}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(p in a){console.warn(`jq79: two <template name="${p}"> in one file; the second was ignored`);return}a[p]=new q({...Vt(Array.from(u.content.children),u.innerHTML),siblings:a,name:p})}),Object.keys(a).length&&(r.siblings=a),r},Vt=(t,n)=>{let e=[],s=[],o=[];t.forEach(r=>{let a={attrs:Yt(r),content:r.textContent??""};r.tagName==="SCRIPT"?e.push(a):r.tagName==="STYLE"?s.push(a):o.push(te(r))}),s.forEach(r=>{"lang"in r.attrs&&console.warn(`jq79: <style lang="${r.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.`)});let i=r=>"scoped"in r.attrs&&!("lang"in r.attrs);if(s.some(i)){let r=hn(n);re(o,r),s.forEach(a=>{i(a)&&(a.scoped=mn(a.content,r))})}return{template:o,scripts:e,styles:s}},At=t=>/\.html?([?#]|$)/.test(t)?Rt(t):import(t),ae=(t,n)=>t?`
11
- //# sourceURL=${t}?jq79-script=${n}`:"",Jt=t=>t.scoped??t.content,ut=new Map,bn=t=>{let n=ut.get(t);if(!n){let e=document.createElement("style");e.textContent=t,document.head.appendChild(e),n={el:e,count:0},ut.set(t,n)}n.count++},En=t=>{let n=ut.get(t);n&&--n.count<=0&&(n.el.remove(),ut.delete(t))},Sn=(t,n,e,s={},o=At,i={})=>{let r={...fe,...s},a=new Proxy(n,{has:(p,d)=>d!=="$__effect"&&d!=="$__import"&&(Reflect.has(p,d)||!(d in globalThis)&&!(d in r))});new Function("$scope","$__effect","$__import",...Object.keys(r),`return (async () => { with ($scope) { ${t} } })()${ae(i.filename,i.index??0)}`)(a,e,o,...Object.values(r)).catch(p=>console.error("jq79: error in :setup script",p))},Xt=(t,n)=>{n?.forEach(({name:e,default:s})=>{t[e]===void 0&&(t[e]=s===void 0?void 0:C(s,t))})},wn=t=>{let n=new Set;return t.forEach(e=>{(Et(e.content)??J(e.attrs[":setup"]))?.forEach(({name:o})=>n.add(o))}),n},Rn=(t,n)=>{if(!t)return null;let e=Object.create(null),s=!1;return Object.entries(t).forEach(([o,i])=>{n.has(o)||(e[o]=i,s=!0)}),s?e:null},le=Symbol("jq79.unfilledProps"),$n=t=>t&&t.default!==void 0?t.default:t,Tn=(t,n,e,s={},o=At,i={})=>{let r={...fe,...s},a={},u=new Function("$__exports","$__default","$__import",...Object.keys(r),`return (async () => { "use strict";
1
+ var et=Object.defineProperty;var me=Object.getOwnPropertyDescriptor;var ye=Object.getOwnPropertyNames;var be=Object.prototype.hasOwnProperty;var Ee=(t,e,n)=>e in t?et(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n;var Se=(t,e)=>{for(var n in e)et(t,n,{get:e[n],enumerable:!0})},we=(t,e,n,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of ye(e))!be.call(t,o)&&o!==n&&et(t,o,{get:()=>e[o],enumerable:!(s=me(e,o))||s.enumerable});return t};var Re=t=>we(et({},"__esModule",{value:!0}),t);var A=(t,e,n)=>Ee(t,typeof e!="symbol"?e+"":e,n);var Wn={};Se(Wn,{$:()=>Z,$$:()=>nt,$create:()=>st,$reactive:()=>Q,C79:()=>W,Component79:()=>W,PendingComponent79:()=>ht,enableHotReload:()=>he,hotUpdate:()=>pe,parseComponent:()=>qn,renderComponent:()=>fn});module.exports=Re(Wn);function Z(t,e){return typeof t=="string"?document.querySelector(t):t.querySelector(e)}function nt(t,e){return Array.from(typeof t=="string"?document.querySelectorAll(t):t.querySelectorAll(e))}var st=(t,e={})=>{let n=document.createElement(t);for(let[s,o]of Object.entries(e))if(s==="className")n.className=Array.isArray(o)?o.join(" "):o;else if(s==="textContent")n.textContent=o;else if(s==="children")for(let r of o)n.appendChild(r);else n.setAttribute(s,o);return n},$e=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),Lt={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Te=new Set(["http:","https:","mailto:"]);function xe(t){try{let e=new URL(t,"https://example.com");return Te.has(e.protocol)}catch{return!1}}var Ce={"https:":"443","http:":"80"};function _e(t){let e=t.trim().toLowerCase().match(/^([a-z\d*][a-z\d.*-]*?)(?::(\d{1,5}|\*))?$/);if(!e)return null;let[,n,s]=e,o=n.split(".");return o.some(i=>i!=="*"&&!/^[a-z\d-]+$/.test(i))?null:{host:new RegExp(`^${o.map(i=>i==="*"?"[^.]+":i).join("\\.")}$`),port:!s||s==="*"?null:s}}var Pt=t=>{let e=(Array.isArray(t)?t:t.split(",")).map(_e).filter(n=>n!==null);return n=>{let s=n.hostname.toLowerCase(),o=n.port||Ce[n.protocol]||"";return e.some(r=>r.host.test(s)&&(r.port===null||r.port===o))}};function Ae(t,e,n,s){try{return!!t(new URL(e,document.baseURI),n,s)}catch{return!1}}var vt=512;function Mt(t,e,n,s){if(n>vt)throw new RangeError(`jq79: sanitizeHTML input nests deeper than ${vt} elements`);for(let o of Array.from(t.childNodes))if(o.nodeType===Node.ELEMENT_NODE){let r=je(o,n,s);r&&e.appendChild(r)}else o.nodeType===Node.TEXT_NODE&&e.appendChild(o.cloneNode())}function je(t,e,n){let s=t.tagName.toLowerCase();if(!$e.has(s))return null;let o=document.createElement(s);for(let r of Array.from(t.attributes)){let i=r.name.toLowerCase(),a=Lt[s]?.has(i),c=Lt["*"]?.has(i);!a&&!c||(i==="href"||i==="src")&&(!xe(r.value)||n&&!Ae(n,r.value,s,i))||o.setAttribute(i,r.value)}return s==="a"&&o.setAttribute("rel","noopener noreferrer"),Mt(t,o,e+1,n),o}function Dt(t,e){let n=document.createElement("template");n.innerHTML=t;let s=document.createElement("div");return Mt(n.content,s,0,e?.allowUrl),s.innerHTML}var Ne=(t,e)=>e.split(".").reduce((n,s)=>n?.[s],t),Wt=t=>{if(Array.isArray(t))return!0;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},kt=(t,e,n)=>{Object.entries(t).forEach(([s,o])=>{let r=e?`${e}.${s}`:s;o&&typeof o=="object"&&Wt(o)?kt(o,r,n):n(r,o)})},Oe=(t,e)=>t===e||t.startsWith(`${e}.`)||e.startsWith(`${t}.`),mt=Symbol("jq79.raw"),ot=t=>{let e=t;for(;e!==null&&typeof e=="object"&&e[mt];)e=e[mt];return e},Ut=Symbol("jq79.store"),J=t=>t!==null&&typeof t=="object"&&t[Ut]===!0,G=[],X=t=>{G.push(new Set);try{return t()}finally{G.pop()}},qt="$__attach",rt=Symbol("jq79.alsoWakenBy"),Q=t=>{let e=new Map,n=new Set,s=new Set,o=new WeakMap,r=Object.create(null),i=(h,E,R=!1)=>{e.get(h)?.forEach(S=>S(E,h)),n.forEach(S=>S(h,E)),s.forEach(S=>{(R||Array.from(S.deps).some(N=>Oe(N,h)))&&S.run()})},a=h=>h!==null&&typeof h=="object"&&Wt(h),c=new Map,d=(h,E)=>{let R=c.get(E);R?.store!==h&&(R?.unsubscribe(),c.set(E,{store:h,unsubscribe:h.$onAny((S,N)=>i(`${E}.${S}`,N))}))},u=h=>{c.get(h)?.unsubscribe(),c.delete(h)},m=(h,E)=>{let R=o.get(h);if(R)return R;let S=null,N=new Proxy(h,{has(f,l){return Reflect.has(f,l)||typeof l=="string"&&S?.has(l)===!0},get(f,l,p){if(l===mt)return f;if(l===Ut)return E==="";if(typeof l!="string")return Reflect.get(f,l,p);if(E===""&&l in r)return r[l];let g=E?`${E}.${l}`:l;G[G.length-1]?.add(g);let C=Reflect.get(f,l,p);if(J(C))return d(C,g),C;let w=ot(C);return a(w)?m(w,g):w},set(f,l,p,g){if(g!==N&&!Object.prototype.hasOwnProperty.call(f,l))return Reflect.set(f,l,p,g);let C=E?`${E}.${l}`:l,w=J(p)?p:ot(p),P=!Object.prototype.hasOwnProperty.call(f,l);if(!P&&Object.is(f[l],w)&&(w===null||typeof w!="object"))return!0;f[l]=w,S?.delete(l),J(w)?d(w,C):u(C);let L=J(w)||!a(w)?w:m(w,C);return i(C,L,P),!0},deleteProperty(f,l){if(typeof l!="string")return Reflect.deleteProperty(f,l);let p=Object.prototype.hasOwnProperty.call(f,l),g=Reflect.deleteProperty(f,l);if(g&&p){let C=E?`${E}.${l}`:l;(S??(S=new Set)).add(l),u(C),i(C,void 0)}return g}});return o.set(h,N),N},b=m(ot(t),"");Object.entries(ot(t)).forEach(([h,E])=>{J(E)&&d(E,h)});let O=(h,E,{immediate:R=!1}={})=>(e.has(h)||e.set(h,new Set),e.get(h).add(E),R&&E(Ne(b,h),h),()=>e.get(h)?.delete(E)),x=(h,{immediate:E=!1}={})=>(n.add(h),E&&kt(b,"",(R,S)=>h(R,S)),()=>n.delete(h)),y=(h,E)=>{let R=!1,S=!1,N={deps:new Set,run:()=>{if(R){S=!0;return}R=!0;try{let f=0;do{S=!1;let l=new Set;G.push(l);try{h()}finally{G.pop(),N.deps=l}}while(S&&++f<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{R=!1}}};return s.add(N),E?.length?$(N,E):(N.run(),()=>{s.delete(N)})},$=(h,E)=>{let R=E.map(S=>S?.[qt]?.(h)).filter(Boolean);return h.run(),()=>{s.delete(h),R.forEach(S=>S())}},T=h=>(s.add(h),()=>{s.delete(h)}),j=()=>{c.forEach(({unsubscribe:h})=>h()),c.clear()};return r.$on=O,r.$onAny=x,r.$effect=y,r.$dispose=j,r[qt]=T,b},B=t=>{let e=[],n=[],s=t[rt];return{effect:o=>{e.push(t.$effect(o,s)),n.push(o)},onDispose:o=>{e.push(o)},refresh:()=>{n.forEach(o=>o())},dispose:()=>{e.splice(0).forEach(o=>o()),n.length=0}}};var Ft=/(?:let|var|const)(?:\s+(?=[A-Za-z_$])|\s*(?=[{[]))/y,It=/\$:\s*/y,at=/import(?=\s*\()/y,Bt=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,U=(t,e)=>{let n=t[e],s=e+1;for(;s<t.length;){if(t[s]==="\\"){s+=2;continue}if(t[s]===n)return s+1;s++}return t.length},D=(t,e)=>{let n=t.indexOf(`
2
+ `,e);return n===-1?t.length:n},q=(t,e)=>{let n=t.indexOf("*/",e+2);return n===-1?t.length:n+2},it=(t,e)=>{let n=e;for(;n<t.length;){if(/\s/.test(t[n])){n++;continue}if(t[n]==="/"&&t[n+1]==="/"){n=D(t,n);continue}if(t[n]==="/"&&t[n+1]==="*"){n=q(t,n);continue}break}return n},Le=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),F=(t,e)=>{let n=e-1;for(;n>=0;){let o=t[n];if(/\s/.test(o)){n--;continue}if(o==="/"&&t[n-1]==="*"){let r=t.lastIndexOf("/*",n-2);if(r===-1)return!0;n=r-1;continue}break}if(n<0)return!0;let s=t[n];if(/[\w$]/.test(s)){let o=n;for(;o>0&&/[\w$]/.test(t[o-1]);)o--;return Le.has(t.slice(o,n+1))}return(s==="+"||s==="-")&&t[n-1]===s?!1:!")]}\"'`.".includes(s)},I=(t,e)=>{let n=e+1,s=!1;for(;n<t.length;){let o=t[n];if(o==="\\"){n+=2;continue}if(o===`
3
+ `)return n;if(o==="[")s=!0;else if(o==="]")s=!1;else if(o==="/"&&!s){for(n++;n<t.length&&/[a-z]/i.test(t[n]);)n++;return n}n++}return t.length},ve=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Pe=(t,e)=>{let n=e-1;for(;n>=0;){let s=t[n];if(/\s/.test(s)){n--;continue}if(s==="/"&&t[n-1]==="*"){let o=t.lastIndexOf("/*",n-2);if(o===-1)return"";n=o-1;continue}return s}return""},Ht=(t,e)=>{let n=0,s=e;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=U(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=D(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=q(t,s);continue}if(o==="/"&&F(t,s)){s=I(t,s);continue}if("([{".includes(o))n++;else if(")]}".includes(o))n--;else{if(n<=0&&o===";")return s;if(n<=0&&o===`
4
+ `){let r=it(t,s+1);if(!(r<t.length&&(ve.test(t.slice(r,r+2))||[",","="].includes(Pe(t,s)))))return s;s=r;continue}}s++}return t.length},Me=t=>{let e=[],n=0,s=0,o=0,r=a=>{e.push({raw:t.slice(s,a),codeEnd:Math.max(0,o-s)}),s=a+1,o=s},i=0;for(;i<t.length;){let a=t[i];if(a==="'"||a==='"'||a==="`"){i=U(t,i),o=i;continue}if(a==="/"&&t[i+1]==="/"){i=D(t,i);continue}if(a==="/"&&t[i+1]==="*"){i=q(t,i);continue}if(a==="/"&&F(t,i)){i=I(t,i),o=i;continue}if("([{".includes(a))n++;else if(")]}".includes(a))n--;else if(a===","&&n<=0){r(i),i++;continue}/\s/.test(a)||(o=i+1),i++}return r(t.length),e},yt=t=>{let e=t.trim();if(!e.startsWith("{")&&!e.startsWith("["))return ct.test(e)?[e]:[];let n=[];for(let s of Et(e.slice(1,Zt(e)))){s.startsWith("...")&&(s=s.slice(3).trim());let o=St(s);if(o!==-1&&(s=s.slice(0,o).trim()),e.startsWith("{")){let r=bt(s,":");if(r!==-1){n.push(...yt(s.slice(r+1)));continue}}n.push(...yt(s))}return n},De=t=>{let e=[],n=Me(t).map(({raw:r,codeEnd:i})=>{let a=r.match(/^\s*/)[0];if(i<=a.length)return{text:r,empty:!0};let c=r.slice(a.length,i),d=r.slice(i),u=St(c),m=(u===-1?c:c.slice(0,u)).trim(),b=c[0]==="{"||c[0]==="[";b?e.push(...yt(m)):ct.test(m)&&e.push(m);let O=ut(c).code;return{text:`${a}${b?`(${O})`:O}${d}`,empty:!1}}),s=[];for(;n.length&&n[n.length-1].empty;)s.unshift(n.pop().text);let o=n.map(r=>r.text).join(",")+s.join("");return o.trimStart().startsWith("(")&&(o=`;${o}`),{vars:e,code:o}},ut=t=>{let e=[],n="",s=0,o=0,r=!0;for(;s<t.length;){let i=t[s],a=t[s+1];if(i==="'"||i==='"'||i==="`"){let c=U(t,s);n+=t.slice(s,c),s=c,r=!1;continue}if(i==="/"&&(a==="/"||a==="*")){let c=a==="/"?D(t,s):q(t,s);n+=t.slice(s,c),s=c;continue}if(i==="/"&&F(t,s)){let c=I(t,s);n+=t.slice(s,c),s=c,r=!1;continue}if(i==="i"&&(s===0||!/[\w$.]/.test(t[s-1]))&&(at.lastIndex=s,at.test(t))){n+="$__import",s+=6,r=!1;continue}if(o===0&&r){Ft.lastIndex=s;let c=Ft.exec(t);if(c){let u=s+c[0].length,m=Ht(t,u),{vars:b,code:O}=De(t.slice(u,m));e.push(...b),n+=O,s=m,r=!1;continue}It.lastIndex=s;let d=It.exec(t);if(d){Bt.lastIndex=s;let u=Bt.exec(t);u&&e.push(u[1]);let m=s+d[0].length,b=Ht(t,m);n+=`$__effect(() => { ${ut(t.slice(m,b)).code} });`,s=b;continue}}"([{".includes(i)?o++:")]}".includes(i)&&(o=Math.max(0,o-1)),i===`
5
+ `||i===";"||i==="}"?r=!0:/\s/.test(i)||(r=!1),n+=i,s++}return{vars:e,code:n}},lt=/export\s+default(?![\w$])/y,zt=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,qe=t=>{let e=[],n=0,s=0;for(let o=0;o<=t.length;o++){let r=t[o];if(r==="{")n++;else if(r==="}")n--;else if(o===t.length||r===","&&n===0){let i=t.slice(s,o).trim();i&&e.push(i),s=o+1}}return e},We=(t,e,n)=>{let s=`await $__import(${JSON.stringify(e)})`;if(t===void 0)return s;let o=qe(t),r=[],i=s;if(o.length>1){let a=`$__mod${n}`;r.push(`${a} = ${s}`),i=a}for(let a of o)a.startsWith("{")?r.push(`${a.replace(/\s+as\s+/g,": ")} = ${i}`):a.startsWith("*")?r.push(`${a.replace(/^\*\s*as\s+/,"")} = ${i}`):r.push(`${a} = $__default(${i})`);return`const ${r.join(", ")}`},ct=/^[A-Za-z_$][\w$]*$/,Zt=t=>{let e=0,n=0;for(;n<t.length;){let s=t[n];if(s==="'"||s==='"'||s==="`"){n=U(t,n);continue}if(s==="/"&&t[n+1]==="/"){n=D(t,n);continue}if(s==="/"&&t[n+1]==="*"){n=q(t,n);continue}if(s==="/"&&F(t,n)){n=I(t,n);continue}if("([{".includes(s))e++;else if(")]}".includes(s)&&--e===0)return n;n++}return t.length},bt=(t,e)=>{let n=0,s=0;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=U(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=D(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=q(t,s);continue}if(o==="/"&&o!==e&&F(t,s)){s=I(t,s);continue}if("([{".includes(o))n++;else if(")]}".includes(o))n--;else if(n===0&&o===e)return s;s++}return-1},Et=t=>{let e=[],n=0,s=0,o=0;for(;o<=t.length;){let r=t[o];if(r==="'"||r==='"'||r==="`"){o=U(t,o);continue}if(r==="/"&&t[o+1]==="/"){o=D(t,o);continue}if(r==="/"&&t[o+1]==="*"){o=q(t,o);continue}if(r==="/"&&F(t,o)){o=I(t,o);continue}if(r!==void 0&&"([{".includes(r))n++;else if(r!==void 0&&")]}".includes(r))n--;else if(o===t.length||r===","&&n===0){let i=t.slice(s,o).trim();i&&e.push(i),s=o+1}o++}return e},St=t=>{let e=0;for(;e<t.length;){let n=bt(t.slice(e),"=");if(n===-1)return-1;let s=e+n;if(t[s+1]!=="="&&t[s+1]!==">"&&t[s-1]!=="="&&t[s-1]!=="!")return s;e=s+1}return-1},K=t=>{let e=(t??"").trim();if(!e.startsWith("{"))return null;let n=Zt(e);if(n>=e.length)return null;let s=[];for(let o of Et(e.slice(1,n))){if(o.startsWith("..."))continue;let r=St(o),i=r===-1?o:o.slice(0,r),a=r===-1?void 0:o.slice(r+1).trim(),c=bt(i,":"),d=(c===-1?i:i.slice(0,c)).trim();if(!ct.test(d))continue;let u={name:d};a!==void 0&&(u.default=a);let m=c===-1?"":i.slice(c+1).trim();ct.test(m)&&(u.as=m),s.push(u)}return s},ke=t=>{let e=0,n=0,s=!0;for(;e<t.length;){let o=t[e];if(o==="'"||o==='"'||o==="`"){e=U(t,e),s=!1;continue}if(o==="/"&&t[e+1]==="/"){e=D(t,e);continue}if(o==="/"&&t[e+1]==="*"){e=q(t,e);continue}if(o==="/"&&F(t,e)){e=I(t,e),s=!1;continue}if(o==="e"&&n===0&&s&&(e===0||!/[\w$.]/.test(t[e-1]))){lt.lastIndex=e;let r=lt.exec(t);if(r)return e+r[0].length}"([{".includes(o)?n++:")]}".includes(o)&&(n=Math.max(0,n-1)),o===`
6
+ `||o===";"||o==="}"?s=!0:/\s/.test(o)||(s=!1),e++}return-1},Ue=/^async(?![\w$])/,Fe=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,Ie=t=>{let e=ke(t);if(e===-1)return null;let n=it(t,e),s=t.slice(n);Ue.test(s)&&(n=it(t,n+5));let o=Fe.exec(t.slice(n));if(o&&(n=it(t,n+o[0].length)),t[n]!=="(")return null;let r=0,i=n;for(;i<t.length;){let a=t[i];if(a==="'"||a==='"'||a==="`"){i=U(t,i);continue}if(a==="/"&&t[i+1]==="/"){i=D(t,i);continue}if(a==="/"&&t[i+1]==="*"){i=q(t,i);continue}if(a==="/"&&F(t,i)){i=I(t,i);continue}if("([{".includes(a))r++;else if(")]}".includes(a)&&--r===0)break;i++}return Et(t.slice(n+1,i))[0]??""},ft=t=>{let e=Ie(t);if(e===null)return null;let n=K(e),s=n?.find(o=>o.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},Gt=t=>{let e="",n=0,s=0,o=!0,r=!1,i=0;for(;n<t.length;){let a=t[n],c=t[n+1],d=n===0||!/[\w$.]/.test(t[n-1]);if(a==="'"||a==='"'||a==="`"){let u=U(t,n);e+=t.slice(n,u),n=u,o=!1;continue}if(a==="/"&&(c==="/"||c==="*")){let u=c==="/"?D(t,n):q(t,n);e+=t.slice(n,u),n=u;continue}if(a==="/"&&F(t,n)){let u=I(t,n);e+=t.slice(n,u),n=u,o=!1;continue}if(a==="i"&&d){if(at.lastIndex=n,at.test(t)){e+="$__import",n+=6,o=!1;continue}if(s===0&&o){zt.lastIndex=n;let u=zt.exec(t);if(u){e+=We(u[1],u[3],i++),n+=u[0].length,o=!1;continue}}}if(a==="e"&&d&&s===0&&o){lt.lastIndex=n;let u=lt.exec(t);if(u){r=!0,e+="$__exports.default =",n+=u[0].length,o=!1;continue}}"([{".includes(a)?s++:")]}".includes(a)&&(s=Math.max(0,s-1)),a===`
7
+ `||a===";"||a==="}"?o=!0:/\s/.test(a)||(o=!1),e+=a,n++}return r?e:null};var Be="0.5.0",se=t=>Object.fromEntries(Array.from(t.attributes).map(e=>[e.name,e.value])),oe=t=>({tag:t.tagName.toLowerCase(),attrs:se(t),children:Array.from((t instanceof HTMLTemplateElement?t.content:t).childNodes).flatMap(e=>{if(e.nodeType===Node.TEXT_NODE){let n=e.textContent??"";return n?[n]:[]}return e.nodeType===Node.ELEMENT_NODE?[oe(e)]:[]})}),Kt=new Map,re=(t,e)=>{let n=`${e.join(",")}|${t}`,s=Kt.get(n);if(s===void 0){try{s=new Function("$scope",...e,`with ($scope) { return (${t}
8
+ ); }`)}catch{s=null}Kt.set(n,s)}return s},_=(t,e,n)=>{let s=re(t,n?Object.keys(n):[]);if(s)try{return s(e,...n?Object.values(n):[])}catch{return}},He=(t,e)=>t.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>_(s,e)??""),ze=new Set([":attrs",":class",":value",":checked",":selected",":if",":elseif",":else",":each",":key",":with",":text",":html",":html.allowed",":props"]),xt=t=>ze.has(t)||t.startsWith(":class.")||t.startsWith(":props.")||t===":slot"||t.startsWith(":slot."),Ze=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,Ge=(t,e,n,s)=>{let[o,...r]=e.slice(1).split("."),i=new Set(r);t.addEventListener(o,a=>{if(i.has("self")&&a.target!==t)return;i.has("prevent")&&a.preventDefault(),i.has("stop")&&a.stopPropagation();let c=_(n,s,{$event:a});typeof c=="function"&&c.call(t,a)},{once:i.has("once"),capture:i.has("capture")})},Ke=(t,e,n,s)=>{let[o,...r]=e.slice(1).split("."),i=new Set(r),a=c=>{i.has("prevent")&&c.preventDefault(),i.has("stop")&&c.stopPropagation(),i.has("once")&&t.off(o,a),X(()=>{let d=_(n,s,{$event:c});typeof d=="function"&&d(c)})};t.on(o,a)},H=t=>t.replace(/-(\w)/g,(e,n)=>n.toUpperCase()),Rt=t=>t.replace(/[A-Z]/g,e=>`-${e.toLowerCase()}`),Ct=t=>t instanceof DocumentFragment?{first:t.firstChild,last:t.lastChild}:{first:t,last:t},dt=({first:t,last:e})=>{for(let n=t;n;){let s=n===e?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},Ve=({first:t,last:e},n)=>{let s=n.nextSibling;for(let o=t;o;){let r=o===e?null:o.nextSibling;n.parentNode.insertBefore(o,s),o=r}},Vt=(t,e)=>{let n=e.replace(/-/g,"").toLowerCase();for(let s=t;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let o of Object.keys(s))if(/^[A-Z]/.test(o)&&o.replace(/-/g,"").toLowerCase()===n)return o;return null},Jt=200,wt=0,ie=Symbol("jq79.slots"),Je=t=>t==="slot"||t.startsWith("slot."),ae=t=>t?H(t):"default",_t=t=>Object.keys(t.attrs).find(e=>e===":slot"||e.startsWith(":slot.")),Xe=t=>t==="default"?":slot":`:slot.${t}`,Qe=t=>typeof t!="string"||t.trim()!=="",Ye=t=>{let e={},n=[];t.children.forEach(o=>{let r=typeof o=="object"&&o.tag==="template"?_t(o):void 0;if(typeof o=="string"||r===void 0){n.push(o);return}let i=ae(r.slice(6));if(i in e){console.warn(`jq79: two <template ${Xe(i)}> in <${t.tag}>; the second was ignored`);return}e[i]={nodes:o.children,binder:o.attrs[r]||void 0}});let s=n.some(Qe);return s&&"default"in e?console.warn(`jq79: <${t.tag}> has both a <template :slot> and content outside it - the <template> is the default slot's content, and the rest was ignored`):s&&(e.default={nodes:n,binder:t.attrs[":slot"]||void 0}),e},tn=(t,e,n)=>{K(e)?.forEach(({name:s,as:o,default:r})=>{let i=o??s;Object.defineProperty(t,i,{enumerable:!0,configurable:!0,get:()=>{let a=n[s]?.();return a===void 0&&r!==void 0?_(r,t):a},set:()=>console.warn(`jq79: "${i}" is a slot prop - it comes from the component, so assigning to it does nothing`)})})},en=t=>{let e=_t(t);return console.warn(`jq79: <template ${e}> fills a slot only as a direct child of a component tag; here it rendered nothing`),document.createComment(`misplaced ${e}`)},nn=(t,e)=>{let n=Object.entries(Ye(t));if(!n.length)return null;let s={};return n.forEach(([o,r])=>{s[o]=sn(r,e)}),s},sn=(t,e)=>(n,s,o,r)=>{let i=Object.create(e);tn(i,t.binder,n);let a=i[rt]??[];Object.defineProperty(i,rt,{value:[...a,s]});let c=B(i);return o.onDispose(()=>c.dispose()),V(t.nodes,i,c,r)},on=(t,e,n,s)=>{let o=ae(t.tag.slice(5)),r=document.createDocumentFragment(),i=document.createComment(t.tag),a=document.createComment(`/${t.tag}`);r.append(i,a);let c=e[ie]?.[o];if(!c)return r.insertBefore(V(t.children,e,n,s),a),r;let d={};return Object.entries(t.attrs).forEach(([u,m])=>{if(!(u===gt||xt(u)||u.startsWith("@")))if(u.startsWith(":")){let b=m||u.slice(1);d[H(u.slice(1))]=()=>_(b,e)}else d[H(u)]=()=>m}),r.insertBefore(c(d,e,n,s),a),r},Xt=(t,e,n,s,o)=>{let r=document.createComment(t),i=document.createComment(`/${t}`),a=document.createDocumentFragment();a.append(r,i);let c=nn(e,n),d={},u={},m=[],b=[],O=!1;Object.entries(e.attrs).forEach(([f,l])=>{if(f!==gt){if(f===":props"||f.startsWith(":props.")){O=!0,b.push({expr:l});return}if(!xt(f))if(f.startsWith("@"))m.push([f,l]);else if(f===":model"||f.startsWith(":model.")){let p=f===":model"?"default":H(f.slice(7));u[p]=l||(f===":model"?"model":p)}else if(f.startsWith(":")){let p=H(f.slice(1));d[p]=l||p,b.push({name:p,expr:l||p})}else{let p=H(f),g=JSON.stringify(l);d[p]=g,b.push({name:p,expr:g})}}});let x=f=>f==="default"?":model":`:model.${f}`,y=f=>f==="default"?"model":f,$=f=>`${f}
9
+ = $value`,T=new Set;Object.entries(u).forEach(([f,l])=>{let p=y(f);d[p]!==void 0&&console.warn(`jq79: <${e.tag}> binds prop "${p}" through both :${p} and ${x(f)} - ${x(f)} wins`),d[p]=l,re($(l),["$value"])===null&&(T.add(f),console.warn(`jq79: ${x(f)}="${l}" is not assignable - updates from <${e.tag}> will be dropped`))});let j=()=>{let f={};return b.forEach(({name:l,expr:p})=>{if(l!==void 0)f[l]=_(p,n);else{let g=_(p,n);g!==null&&typeof g=="object"&&Object.assign(f,g)}}),Object.entries(u).forEach(([l,p])=>{f[y(l)]=_(p,n)}),f},h=null,E=null,R=null,S=new Set,N=f=>{if(f==null){if(!n[de]?.has(t)||S.has("unfilled"))return;S.add("unfilled"),console.error(`jq79: <${e.tag}> is declared as a prop and the parent passed nothing - nothing renders here. Pass it (:${t}="\u2026"), or drop it from the signature to use the one declared in this file.`);return}S.has("type")||(S.add("type"),console.error(`jq79: <${e.tag}> is ${typeof f}, not a component - nothing renders here`))};return s.effect(()=>{let f=_(t,n),l=f instanceof W?f:null;if(l||N(f),l===E||(R?.dispose(),R=null,h?.destroy(),h=null,E=l,!l))return;let p=new W({template:l.template,scripts:l.scripts,styles:l.styles,modules:l.modules,filename:l.filename,siblings:l.siblings,name:l.name});if(c&&(p.slots=c),Object.keys(u).length){let L=new Set;p.modelWriteback=(v,k)=>{let M=v==null?"default":H(String(v)),Ot=u[M];return Ot===void 0?(L.has(M)||(L.add(M),console.warn(`jq79: <${e.tag}> has no ${x(M)} - bound: ${Object.keys(u).map(x).join(", ")}`)),!1):T.has(M)?!1:(X(()=>_($(Ot),n,{$value:k})),!0)}}m.forEach(([L,v])=>Ke(p,L,v,n));let g=Nn(p.scripts),C=ee(X(j),g),w=document.createDocumentFragment();if(wt>=Jt){console.error(`jq79: <${e.tag}> is ${Jt} levels deep inside itself; giving up here. A component that renders itself stops when its data stops - is there a cycle in it?`);return}wt++;try{(o?p.renderShadow(C):p.render(C)).mount(w)}finally{wt--}i.parentNode.insertBefore(w,i);let P=B(n);if(O){let L=[];P.effect(()=>{let v=ee(j(),g),k=Object.keys(v);L.forEach(M=>{M in v||(p.data[M]=void 0)}),k.forEach(M=>{p.data[M]=v[M]}),L=k})}else Object.entries(d).forEach(([L,v])=>{g!==null&&!g.has(L)||P.effect(()=>{p.data[L]=_(v,n)})});R=P,h=p}),s.onDispose(()=>{R?.dispose(),h?.destroy()}),a},rn=(t,e)=>{let n=()=>{let s=_(t,e);return s!==null&&typeof s=="object"?s:null};return new Proxy(e,{has(s,o){let r=n();return r!==null&&Reflect.has(r,o)||Reflect.has(s,o)},get(s,o){let r=n();return r!==null&&Reflect.has(r,o)?r[o]:Reflect.get(s,o)},set(s,o,r){let i=n();return i!==null&&Reflect.has(i,o)?(i[o]=r,!0):Reflect.set(s,o,r)}})},tt=t=>typeof t=="string"?t.split(/\s+/).filter(Boolean):Array.isArray(t)?t.flatMap(tt):t!==null&&typeof t=="object"?Object.entries(t).flatMap(([e,n])=>n?tt(e):[]):[],an=t=>typeof t=="function"?(e,n,s)=>{try{return!!t(e,n,s)}catch{return!1}}:typeof t=="string"||Array.isArray(t)?Pt(t):()=>!1,At=(t,e,n,s)=>{let o=t.attrs[":with"],r=o!==void 0?rn(o,e):e;if(Je(t.tag))return on(t,r,n,s);if(t.tag==="template"&&_t(t)!==void 0)return en(t);let i=Vt(r,t.tag);if(i)return Xt(i,t,r,n,s);let a=document.createElement(t.tag);if(a instanceof HTMLUnknownElement||t.tag.includes("-")){let y=!1;n.effect(()=>{if(y)return;let $=Vt(r,t.tag);if(!$)return;y=!0;let T=Xt($,t,r,n,s),j=Ct(T);n.onDispose(()=>dt(j)),a.replaceWith(T)})}Object.entries(t.attrs).forEach(([y,$])=>{y.startsWith("@")?Ge(a,y,$,r):y===":model"||y.startsWith(":model.")?a instanceof HTMLUnknownElement||t.tag.includes("-")||console.warn(`jq79: ${y} on <${t.tag}> does nothing - :model binds component tags only (for now)`):xt(y)||a.setAttribute(y,$)});let c=t.attrs[":attrs"];if(c!==void 0){let y=[];n.effect(()=>{y.forEach(T=>a.removeAttribute(T));let $=_(c,r);y=$&&typeof $=="object"?Object.keys($):[],y.forEach(T=>{let j=$[T];j!=null&&j!==!1&&a.setAttribute(T,String(j))})})}let d=t.attrs[":class"],u=Object.entries(t.attrs).filter(([y])=>y.startsWith(":class.")).map(([y,$])=>[y.slice(7),$]);if(d!==void 0||u.length){let y=new Set(tt(t.attrs.class??"")),$=[];n.effect(()=>{let T=d!==void 0?tt(_(d,r)):[];u.forEach(([j,h])=>{_(h,r)&&T.push(...tt(j))}),$.forEach(j=>{!T.includes(j)&&!y.has(j)&&a.classList.remove(j)}),a.classList.add(...T),$=T})}let m=t.attrs[":text"],b=t.attrs[":html"],O=t.attrs[":html.allowed"];O!==void 0&&b===void 0&&console.warn("jq79: :html.allowed without :html on the same element does nothing"),m!==void 0?n.effect(()=>{a.textContent=String(_(m,r)??"")}):b!==void 0?n.effect(()=>{let y=O!==void 0?{allowUrl:an(_(O,r))}:void 0;a.innerHTML=Dt(String(_(b,r)??""),y)}):a instanceof HTMLTemplateElement?a.content.appendChild(V(t.children,r,n,s)):a.appendChild(V(t.children,r,n,s));let x=t.attrs[":value"];return x!==void 0&&n.effect(()=>{let y=String(_(x,r)??"");a.value!==y&&(a.value=y)}),[":checked",":selected"].forEach(y=>{let $=t.attrs[y];if($===void 0)return;let T=y.slice(1);n.effect(()=>{a[T]=!!_($,r)})}),a},ln=(t,e,n,s)=>{let o=document.createComment("if"),r=document.createDocumentFragment();r.appendChild(o);let i=null,a=null,c=null;return n.effect(()=>{let d=t.find(m=>m.expr===void 0||_(m.expr,e))??null;if(d===a||(c?.dispose(),i&&dt(i),i=null,a=d,!d))return;c=B(e);let u=At(d.node,e,c,s);i=Ct(u),o.parentNode.insertBefore(u,o.nextSibling)}),r},Y=(t,e,n)=>{Object.defineProperty(t,e,{value:n,writable:!0,enumerable:!0,configurable:!0})},cn=t=>{if(t===null||typeof t!="object"||Array.isArray(t))return!1;let e=Object.getPrototypeOf(t);return e===Object.prototype||e===null},un=(t,e,n,s)=>{let o=t.attrs[":each"].match(Ze);if(!o)return document.createComment(`invalid :each expression "${t.attrs[":each"]}"`);let[,r,i,a]=o,c=t.attrs[":key"],{[":each"]:d,[":key"]:u,...m}=t.attrs,b={...t,attrs:m},O=document.createComment("each"),x=document.createDocumentFragment();x.appendChild(O),(":if"in t.attrs||":elseif"in t.attrs||":else"in t.attrs)&&console.warn("jq79: :if/:elseif/:else on a :each element is ignored; filter the list expression instead");let y=[],$=!1;return n.effect(()=>{let T=_(a,e),j=Array.isArray(T)?T.map((f,l)=>[l,f]):cn(T)?Object.entries(T):[],h=new Map;y.forEach(f=>{let l=h.get(f.key);l?l.push(f):h.set(f.key,[f])});let E=new Set,R=[],S=j.map(([f,l],p)=>{let g=Object.create(e);Y(g,r,l),i&&Y(g,i,f),Y(g,"$index",p);let C=c!==void 0?_(c,g):f;E.has(C)&&!$&&($=!0,console.warn(`jq79: duplicate :key in :each "${t.attrs[":each"]}"; duplicates pair up by position`)),E.add(C);let w=h.get(C)?.shift();if(w&&Object.is(w.item,l))return w.scope.$index!==p&&R.push(w),Y(w.scope,"$index",p),i&&Y(w.scope,i,f),w;w&&(w.fx.dispose(),dt(w.range));let P=B(e),L=Ct(At(b,g,P,s));return{key:C,item:l,scope:g,fx:P,range:L}});h.forEach(f=>f.forEach(l=>{l.fx.dispose(),dt(l.range)}));let N=O;S.forEach(f=>{N.nextSibling!==f.range.first&&Ve(f.range,N),N=f.range.last}),R.forEach(f=>X(()=>f.fx.refresh())),y=S}),x},V=(t,e,n,s=!1)=>{let o=document.createDocumentFragment(),r=0;for(;r<t.length;){let i=t[r];if(typeof i=="string"){let a=document.createTextNode(i);i.includes("{{")&&n.effect(()=>{a.textContent=He(i,e)}),o.appendChild(a),r++;continue}if(":each"in i.attrs){o.appendChild(un(i,e,n,s)),r++;continue}if(":if"in i.attrs){let a=[{expr:i.attrs[":if"],node:i}];r++;let c=u=>{let m=r;for(;m<t.length&&typeof t[m]=="string"&&!t[m].trim();)m++;let b=t[m];if(typeof b=="object"&&u in b.attrs)return r=m+1,b};for(let u=c(":elseif");u;u=c(":elseif"))a.push({expr:u.attrs[":elseif"],node:u});let d=c(":else");d&&a.push({node:d}),o.appendChild(ln(a,e,n,s));continue}o.appendChild(At(i,e,n,s)),r++}return o},fn=(t,e,n=!1)=>V(t.template,e,B(e),n),dn=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),pn=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,jt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,hn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(pn,(s,o,r)=>dn.has(o.toLowerCase())?s:`<${o}${r}></${o}>`)).join(""),le=/<([A-Za-z][\w.-]*)((?:"[^"]*"|'[^']*'|[^>"'])*)>/g,gn=/"[^"]*"|'[^']*'|(^|\s)\.\.\.([A-Za-z_$][\w$.]*)/g,mn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(le,(s,o,r)=>{let i=0,a=r.replace(gn,(c,d,u)=>u===void 0?c:`${d}:props.${i++}="${u}"`);return`<${o}${a}>`})).join(""),yn=/"[^"]*"|'[^']*'|(^|\s)(:[\w.$-]+)/g,bn=/<\/slot\.([\w.$-]+)(\s*)>/gi,En=/^slot\./i,Sn=t=>En.test(t)?`slot.${Rt(t.slice(5))}`:t,wn=t=>t.split(jt).map((e,n)=>n%2===1?e:e.replace(le,(s,o,r)=>{let i=r.replace(yn,(a,c,d)=>d===void 0?a:`${c}${Rt(d)}`);return`<${Sn(o)}${i}>`}).replace(bn,(s,o,r)=>`</slot.${Rt(o)}${r}>`)).join(""),gt="data-jq79",Rn=t=>{let e=2166136261;for(let n=0;n<t.length;n++)e=Math.imul(e^t.charCodeAt(n),16777619);return(e>>>0).toString(36)},ce=(t,e)=>{t.forEach(n=>{typeof n!="string"&&(n.attrs[gt]=e,ce(n.children,e))})},$n=(t,e)=>t.split(",").map(n=>{let s=n.trim(),o=s.indexOf("::"),r=o===-1?s:s.slice(0,o),i=o===-1?"":s.slice(o);return`${r}[${gt}="${e}"]${i}`}).join(", "),ue=(t,e)=>{Array.from(t).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=$n(n.selectorText,e):n instanceof CSSGroupingRule&&ue(n.cssRules,e)})},Tn=(t,e)=>{/:deep\(|::v-deep|>>>/.test(t)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(t),ue(n.cssRules,e),Array.from(n.cssRules).map(s=>s.cssText).join(`
10
+ `)},xn=/^[A-Z][A-Za-z0-9]*$/,$t=t=>{let e=hn(mn(wn(t))),s=new DOMParser().parseFromString(`<template>${e}</template>`,"text/html").querySelector("template"),o=[],r=[];Array.from(s.content.children).forEach(c=>{c.tagName==="TEMPLATE"?r.push(c):o.push(c)});let i=Qt(o,t),a={};return r.forEach(c=>{let d=c.getAttribute("name");if(d===null){console.warn("jq79: a top-level <template> without a name declares nothing and was ignored");return}if(!xn.test(d)){console.warn(`jq79: <template name="${d}"> was ignored - a component name has to be PascalCase, or no tag could ever reference it (only capitalized names resolve as components)`);return}if(d in a){console.warn(`jq79: two <template name="${d}"> in one file; the second was ignored`);return}a[d]=new W({...Qt(Array.from(c.content.children),c.innerHTML),siblings:a,name:d})}),Object.keys(a).length&&(i.siblings=a),i},Qt=(t,e)=>{let n=[],s=[],o=[];t.forEach(i=>{let a={attrs:se(i),content:i.textContent??""};i.tagName==="SCRIPT"?n.push(a):i.tagName==="STYLE"?s.push(a):o.push(oe(i))}),s.forEach(i=>{"lang"in i.attrs&&console.warn(`jq79: <style lang="${i.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.`)});let r=i=>"scoped"in i.attrs&&!("lang"in i.attrs);if(s.some(r)){let i=Rn(e);ce(o,i),s.forEach(a=>{r(a)&&(a.scoped=Tn(a.content,i))})}return{template:o,scripts:n,styles:s}},Nt=t=>/\.html?([?#]|$)/.test(t)?Tt(t):import(t),fe=(t,e)=>t?`
11
+ //# sourceURL=${t}?jq79-script=${e}`:"",Yt=t=>t.scoped??t.content,pt=new Map,Cn=t=>{let e=pt.get(t);if(!e){let n=document.createElement("style");n.textContent=t,document.head.appendChild(n),e={el:n,count:0},pt.set(t,e)}e.count++},_n=t=>{let e=pt.get(t);e&&--e.count<=0&&(e.el.remove(),pt.delete(t))},An=(t,e,n,s={},o=Nt,r={})=>{let i={...ge,...s},a=new Proxy(e,{has:(d,u)=>u!=="$__effect"&&u!=="$__import"&&(Reflect.has(d,u)||!(u in globalThis)&&!(u in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${t} } })()${fe(r.filename,r.index??0)}`)(a,n,o,...Object.values(i)).catch(d=>console.error("jq79: error in :setup script",d))},te=(t,e)=>{e?.forEach(({name:n,default:s})=>{t[n]===void 0&&(t[n]=s===void 0?void 0:_(s,t))})},jn=t=>{let e=new Set;return t.forEach(n=>{(ft(n.content)??K(n.attrs[":setup"]))?.forEach(({name:o})=>e.add(o))}),e},Nn=t=>{let e=null;return t.forEach(n=>{let s=ft(n.content)??K(n.attrs[":setup"]);if(!s)return;let o=e??(e=new Set);s.forEach(({name:r})=>o.add(r))}),e},ee=(t,e)=>{if(e===null)return t;let n={};return Object.keys(t).forEach(s=>{e.has(s)&&(n[s]=t[s])}),n},On=(t,e)=>{if(!t)return null;let n=Object.create(null),s=!1;return Object.entries(t).forEach(([o,r])=>{e.has(o)||(n[o]=r,s=!0)}),s?n:null},de=Symbol("jq79.unfilledProps"),Ln=t=>t&&t.default!==void 0?t.default:t,vn=(t,e,n,s={},o=Nt,r={})=>{let i={...ge,...s},a={},c=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
12
12
  ${t}
13
- ;$__exports.done = true })()${ae(i.filename,i.index??0)}`)(a,$n,o,...Object.values(r)),p=E=>console.error("jq79: error in factory script",E),d=!1,g=()=>{if(d)return;d=!0;let E=a.default;if(typeof E!="function")return;let O=x=>{x&&typeof x=="object"&&Object.assign(n,x)};try{let x=E(n,{$data:n,$props:n,$effect:e,...s});x instanceof Promise?x.then(O).catch(p):O(x)}catch(x){p(x)}};u.then(g,p),a.done&&g()},xn="__JQ79_HMR_ENABLED__",Cn="__JQ79_HMR__",H=null,An=t=>{if(!H||!t.filename)return;let n=H.get(t.filename);n||H.set(t.filename,n=new Set),n.add(new WeakRef(t))},Qt=t=>{try{return new URL(t,document.baseURI).pathname}catch{return t}},ce=(t,n)=>{if(!H)return 0;let e=Qt(t),s=wt(n),o=!1,i=a=>a.name===void 0?s:s.siblings?.[a.name]??null,r=0;for(let[a,u]of H)if(Qt(a)===e){for(let p of u){let d=p.deref();if(!d){u.delete(p);continue}let g=i(d);if(!g){o=!0;continue}d.hotReplace(g)&&r++}u.size||H.delete(a)}return o?0:r},ue=()=>{H??(H=new Map),globalThis[Cn]={update:ce}},Rt=async t=>{let n=await fetch(t);if(!n.ok)throw new Error(`failed to fetch component from ${t}: ${n.status}`);return new q(await n.text(),{filename:t})},q=class{constructor(n,e={}){N(this,"template");N(this,"scripts");N(this,"styles");N(this,"modules");N(this,"filename");N(this,"siblings");N(this,"name");N(this,"slots");N(this,"data",null);N(this,"fx",null);N(this,"content",null);N(this,"startMarker",null);N(this,"endMarker",null);N(this,"styleEls",[]);N(this,"ownsSharedStyles",!1);N(this,"useShadow",!1);N(this,"mountRoot",null);N(this,"resolveMounted",null);N(this,"emitListeners",new Map);let s=typeof n=="string"?wt(n):n;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=e.modules??(typeof n=="string"?void 0:n.modules),this.filename=e.filename??(typeof n=="string"?void 0:n.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),An(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([n,e])=>{e.filename??(e.filename=this.filename),e.modules??(e.modules=this.modules),this.name||(this[n]=e)})}hotReplace(n){let e=typeof n=="string"?wt(n):n,s=this.startMarker,o=!!(s&&this.content),i=o&&s.isConnected,r=i?s.parentNode:null,a=i?this.endMarker.nextSibling:null,u={...this.data},p=this.useShadow;return o&&this.destroy(),this.template=e.template,this.scripts=e.scripts,this.styles=e.styles,this.siblings=e.siblings,this.adoptSiblings(),!o||(this.renderWith(u,p),!r)?!1:(p&&this.styleEls.forEach(d=>r.insertBefore(d,a)),r.insertBefore(this.content,a),this.mountRoot=r,this.resolveMounted?.(),!0)}static fetch(n){if(Array.isArray(n))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new ft(Rt(n))}static fetchAll(n){return Promise.all(n.map(Rt))}on(n,e){return this.emitListeners.has(n)||this.emitListeners.set(n,new Set),this.emitListeners.get(n).add(e),this}off(n,e){return this.emitListeners.get(n)?.delete(e),this}render(n={}){return this.renderWith(n,!1)}renderShadow(n={}){return this.renderWith(n,!0)}renderWith(n,e){this.destroy();let s=wn(this.scripts),o=Rn(this.siblings,s),i=o?Object.assign(Object.create(o),n):{...n},r=new Set([...s].filter(c=>!(c in n)));r.size&&Object.defineProperty(i,le,{value:r}),this.slots&&Object.defineProperty(i,ne,{value:this.slots});let a=V(i),u=I(a);this.data=a,this.fx=u,this.useShadow=e,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let p=this.startMarker,d=(c,f)=>{let l=new CustomEvent(c,{detail:f,bubbles:!0,composed:!0,cancelable:!0});return p===this.startMarker&&this.emitListeners.get(c)?.forEach(T=>T(l,f)),l.cancelBubble||p.dispatchEvent(l),!l.defaultPrevented},g,E=new Promise(c=>{g=c});this.resolveMounted=g;let O=()=>E,x=this.endMarker,y=c=>{let f=[];for(let l=p.nextSibling;l&&l!==x;l=l.nextSibling)l instanceof Element&&(l.matches(c)&&f.push(l),f.push(...Array.from(l.querySelectorAll(c))));return f},w=c=>y(c)[0]??null,R=this.modules,A=c=>R&&c in R?Promise.resolve(R[c]):At(c),h=Object.assign(Object.create(null),{$emit:d,$slots:Object.fromEntries(Object.keys(this.slots??{}).map(c=>[c,!0]))}),m=c=>`await $mounted();${c}`;this.scripts.forEach((c,f)=>{let l={$mounted:O,$self:w,$$self:y,...h,...o},T={filename:this.filename,index:f},_=Bt(c.content);if(_!==null){Xt(a,Et(c.content));let v=":mounted"in c.attrs?m(_):_;Tn(v,a,u.effect,l,A,T);return}let{vars:j,code:b}=lt(c.content);Xt(a,J(c.attrs[":setup"])),j.forEach(v=>{v in a||(a[v]=void 0)});let L=":mounted"in c.attrs?m(b):b;Sn(L,a,u.effect,l,A,T)});let $=document.createDocumentFragment(),S=new Proxy(a,{has:(c,f)=>typeof f=="string"&&f in h||Reflect.has(c,f),get:(c,f,l)=>typeof f=="string"&&f in h&&!Reflect.has(c,f)?h[f]:Reflect.get(c,f,l)});return $.append(this.startMarker,Z(this.template,S,u,e),this.endMarker),this.content=$,e?this.styleEls=this.styles.map(c=>{let f=document.createElement("style");return f.textContent=c.content,f}):(this.styles.forEach(c=>bn(Jt(c))),this.ownsSharedStyles=!0),this}mount(n,e){let s=typeof n=="string"?B(n):n;if(!s)throw new Error(`mount target not found: ${n}`);return(!this.content||e!==void 0)&&this.renderWith(e??{},this.useShadow),this.attach(s)}mountShadow(n,e){let s=typeof n=="string"?B(n):n;if(!s)throw new Error(`mount target not found: ${n}`);return(!this.content||e!==void 0||!this.useShadow)&&this.renderWith(e??{},!0),this.attach(s)}attach(n){this.mountRoot&&this.detach();let e=this.useShadow&&n instanceof Element?n.shadowRoot??n.attachShadow({mode:"open"}):n;return this.useShadow&&this.styleEls.forEach(s=>e.appendChild(s)),e.appendChild(this.content),this.mountRoot=e,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let n=this.startMarker;for(;n;){let e=n.nextSibling;if(this.content.appendChild(n),n===this.endMarker)break;n=e}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(n=>n.parentNode?.removeChild(n)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(n=>En(Jt(n))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}};N(q,"version",Ue);var ft=class{constructor(n){N(this,"chain");this.chain=n}queue(n){return this.chain=this.chain.then(e=>(n(e),e)),this}then(n,e){return this.chain.then(n,e)}catch(n){return this.chain.catch(n)}finally(n){return this.chain.finally(n)}mount(n,e){return this.queue(s=>s.mount(n,e))}mountShadow(n,e){return this.queue(s=>s.mountShadow(n,e))}render(n={}){return this.queue(e=>e.render(n))}renderShadow(n={}){return this.queue(e=>e.renderShadow(n))}on(n,e){return this.queue(s=>s.on(n,e))}off(n,e){return this.queue(s=>s.off(n,e))}detach(){return this.queue(n=>n.detach())}destroy(){return this.queue(n=>n.destroy())}};var _n=t=>new q(t),fe={$:B,$$:tt,$create:et,$reactive:V,Component79:q};typeof globalThis<"u"&&globalThis[xn]&&ue();0&&(module.exports={$,$$,$create,$reactive,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
13
+ ;$__exports.done = true })()${fe(r.filename,r.index??0)}`)(a,Ln,o,...Object.values(i)),d=b=>console.error("jq79: error in factory script",b),u=!1,m=()=>{if(u)return;u=!0;let b=a.default;if(typeof b!="function")return;let O=x=>{x&&typeof x=="object"&&Object.assign(e,x)};try{let x=b(e,{$data:e,$props:e,$effect:n,...s});x instanceof Promise?x.then(O).catch(d):O(x)}catch(x){d(x)}};c.then(m,d),a.done&&m()},Pn="__JQ79_HMR_ENABLED__",Mn="__JQ79_HMR__",z=null,Dn=t=>{if(!z||!t.filename)return;let e=z.get(t.filename);e||z.set(t.filename,e=new Set),e.add(new WeakRef(t))},ne=t=>{try{return new URL(t,document.baseURI).pathname}catch{return t}},pe=(t,e)=>{if(!z)return 0;let n=ne(t),s=$t(e),o=!1,r=a=>a.name===void 0?s:s.siblings?.[a.name]??null,i=0;for(let[a,c]of z)if(ne(a)===n){for(let d of c){let u=d.deref();if(!u){c.delete(d);continue}let m=r(u);if(!m){o=!0;continue}u.hotReplace(m)&&i++}c.size||z.delete(a)}return o?0:i},he=()=>{z??(z=new Map),globalThis[Mn]={update:pe}},Tt=async t=>{let e=await fetch(t);if(!e.ok)throw new Error(`failed to fetch component from ${t}: ${e.status}`);return new W(await e.text(),{filename:t})},W=class{constructor(e,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,"ownsSharedStyles",!1);A(this,"useShadow",!1);A(this,"mountRoot",null);A(this,"resolveMounted",null);A(this,"emitListeners",new Map);let s=typeof e=="string"?$t(e):e;this.template=s.template,this.scripts=s.scripts,this.styles=s.styles,this.modules=n.modules??(typeof e=="string"?void 0:e.modules),this.filename=n.filename??(typeof e=="string"?void 0:e.filename),this.siblings=s.siblings,this.name=s.name,this.adoptSiblings(),Dn(this)}adoptSiblings(){this.siblings&&Object.entries(this.siblings).forEach(([e,n])=>{n.filename??(n.filename=this.filename),n.modules??(n.modules=this.modules),this.name||(this[e]=n)})}hotReplace(e){let n=typeof e=="string"?$t(e):e,s=this.startMarker,o=!!(s&&this.content),r=o&&s.isConnected,i=r?s.parentNode:null,a=r?this.endMarker.nextSibling:null,c={...this.data},d=this.useShadow;return o&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,this.siblings=n.siblings,this.adoptSiblings(),!o||(this.renderWith(c,d),!i)?!1:(d&&this.styleEls.forEach(u=>i.insertBefore(u,a)),i.insertBefore(this.content,a),this.mountRoot=i,this.resolveMounted?.(),!0)}static fetch(e){if(Array.isArray(e))throw new TypeError("Component79.fetch takes one URL; use fetchAll for an array");return new ht(Tt(e))}static fetchAll(e){return Promise.all(e.map(Tt))}on(e,n){return this.emitListeners.has(e)||this.emitListeners.set(e,new Set),this.emitListeners.get(e).add(n),this}off(e,n){return this.emitListeners.get(e)?.delete(n),this}render(e={}){return this.renderWith(e,!1)}renderShadow(e={}){return this.renderWith(e,!0)}renderWith(e,n){this.destroy();let s=jn(this.scripts),o=On(this.siblings,s),r=o?Object.assign(Object.create(o),e):{...e},i=new Set([...s].filter(l=>!(l in e)));i.size&&Object.defineProperty(r,de,{value:i}),this.slots&&Object.defineProperty(r,ie,{value:this.slots});let a=Q(r),c=B(a);this.data=a,this.fx=c,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let d=this.startMarker,u=!1,m=(l,p)=>{l==="model:update"&&!u&&(u=!0,console.warn("jq79: $emit('model:update', \u2026) no longer feeds :model - call $updateModel(value) or $updateModel(name, value) instead"));let g=new CustomEvent(l,{detail:p,bubbles:!0,composed:!0,cancelable:!0});return d===this.startMarker&&this.emitListeners.get(l)?.forEach(C=>C(g,p)),g.cancelBubble||d.dispatchEvent(g),!g.defaultPrevented},b,O=new Promise(l=>{b=l});this.resolveMounted=b;let x=()=>O,y=this.endMarker,$=l=>{let p=[];for(let g=d.nextSibling;g&&g!==y;g=g.nextSibling)g instanceof Element&&(g.matches(l)&&p.push(g),p.push(...Array.from(g.querySelectorAll(l))));return p},T=l=>$(l)[0]??null,j=this.modules,h=l=>j&&l in j?Promise.resolve(j[l]):Nt(l),R=Object.assign(Object.create(null),{$emit:m,$updateModel:(...l)=>{let[p,g]=l.length>1?l:[void 0,l[0]];return d!==this.startMarker?!1:this.modelWriteback?.(p,g)??!1},$slots:Object.fromEntries(Object.keys(this.slots??{}).map(l=>[l,!0]))}),S=l=>`await $mounted();${l}`;this.scripts.forEach((l,p)=>{let g={$mounted:x,$self:T,$$self:$,...R,...o},C={filename:this.filename,index:p},w=Gt(l.content);if(w!==null){te(a,ft(l.content));let k=":mounted"in l.attrs?S(w):w;vn(k,a,c.effect,g,h,C);return}let{vars:P,code:L}=ut(l.content);te(a,K(l.attrs[":setup"])),P.forEach(k=>{k in a||(a[k]=void 0)});let v=":mounted"in l.attrs?S(L):L;An(v,a,c.effect,g,h,C)});let N=document.createDocumentFragment(),f=new Proxy(a,{has:(l,p)=>typeof p=="string"&&p in R||Reflect.has(l,p),get:(l,p,g)=>typeof p=="string"&&p in R&&!Reflect.has(l,p)?R[p]:Reflect.get(l,p,g)});return N.append(this.startMarker,V(this.template,f,c,n),this.endMarker),this.content=N,n?this.styleEls=this.styles.map(l=>{let p=document.createElement("style");return p.textContent=l.content,p}):(this.styles.forEach(l=>Cn(Yt(l))),this.ownsSharedStyles=!0),this}mount(e,n){let s=typeof e=="string"?Z(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0)&&this.renderWith(n??{},this.useShadow),this.attach(s)}mountShadow(e,n){let s=typeof e=="string"?Z(e):e;if(!s)throw new Error(`mount target not found: ${e}`);return(!this.content||n!==void 0||!this.useShadow)&&this.renderWith(n??{},!0),this.attach(s)}attach(e){this.mountRoot&&this.detach();let n=this.useShadow&&e instanceof Element?e.shadowRoot??e.attachShadow({mode:"open"}):e;return this.useShadow&&this.styleEls.forEach(s=>n.appendChild(s)),n.appendChild(this.content),this.mountRoot=n,this.resolveMounted?.(),this}detach(){if(!this.mountRoot||!this.content||!this.startMarker||!this.endMarker)return this;let e=this.startMarker;for(;e;){let n=e.nextSibling;if(this.content.appendChild(e),e===this.endMarker)break;e=n}return this.mountRoot=null,this}destroy(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(e=>e.parentNode?.removeChild(e)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(e=>_n(Yt(e))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}};A(W,"version",Be);var ht=class{constructor(e){A(this,"chain");this.chain=e}queue(e){return this.chain=this.chain.then(n=>(e(n),n)),this}then(e,n){return this.chain.then(e,n)}catch(e){return this.chain.catch(e)}finally(e){return this.chain.finally(e)}mount(e,n){return this.queue(s=>s.mount(e,n))}mountShadow(e,n){return this.queue(s=>s.mountShadow(e,n))}render(e={}){return this.queue(n=>n.render(e))}renderShadow(e={}){return this.queue(n=>n.renderShadow(e))}on(e,n){return this.queue(s=>s.on(e,n))}off(e,n){return this.queue(s=>s.off(e,n))}detach(){return this.queue(e=>e.detach())}destroy(){return this.queue(e=>e.destroy())}};var qn=t=>new W(t),ge={$:Z,$$:nt,$create:st,$reactive:Q,Component79:W};typeof globalThis<"u"&&globalThis[Pn]&&he();0&&(module.exports={$,$$,$create,$reactive,C79,Component79,PendingComponent79,enableHotReload,hotUpdate,parseComponent,renderComponent});
14
14
  //# sourceMappingURL=jq79.cjs.map