jq79 0.4.0 → 0.4.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,11 +1,12 @@
1
- var jq79=(()=>{var I=Object.defineProperty;var De=Object.getOwnPropertyDescriptor;var Pe=Object.getOwnPropertyNames;var ke=Object.prototype.hasOwnProperty;var Fe=(e,t,n)=>t in e?I(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ie=(e,t)=>{for(var n in t)I(e,n,{get:t[n],enumerable:!0})},We=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of Pe(t))!ke.call(e,r)&&r!==n&&I(e,r,{get:()=>t[r],enumerable:!(s=De(t,r))||s.enumerable});return e};var Be=e=>We(I({},"__esModule",{value:!0}),e);var w=(e,t,n)=>Fe(e,typeof t!="symbol"?t+"":t,n);var Nt={};Ie(Nt,{$:()=>j,$$:()=>W,$create:()=>B,$reactive:()=>F,Component79:()=>M,enableHotReload:()=>Oe,hotUpdate:()=>Ae,parseComponent:()=>_t,renderComponent:()=>ut});function j(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function W(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var B=(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 o of r)n.appendChild(o);else n.setAttribute(s,r);return n},Ue=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),te={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},qe=new Set(["http:","https:","mailto:"]);function He(e){try{let t=new URL(e,"https://example.com");return qe.has(t.protocol)}catch{return!1}}function ne(e,t){for(let n of Array.from(e.childNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=ze(n);s&&t.appendChild(s)}else n.nodeType===Node.TEXT_NODE&&t.appendChild(n.cloneNode())}function ze(e){let t=e.tagName.toLowerCase();if(!Ue.has(t))return null;let n=document.createElement(t);for(let s of Array.from(e.attributes)){let r=s.name.toLowerCase(),o=te[t]?.has(r),c=te["*"]?.has(r);!o&&!c||(r==="href"||r==="src")&&!He(s.value)||n.setAttribute(r,s.value)}return t==="a"&&n.setAttribute("rel","noopener noreferrer"),ne(e,n),n}function se(e){let t=new DOMParser().parseFromString(e,"text/html"),n=document.createElement("div");return ne(t.body,n),n.innerHTML}var Ge=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),re=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},oe=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let o=t?`${t}.${s}`:s;r&&typeof r=="object"&&re(r)?oe(r,o,n):n(o,r)})},Ke=(e,t)=>e===t||e.startsWith(`${t}.`)||t.startsWith(`${e}.`),K=Symbol("jq79.raw"),U=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[K];)t=t[K];return t},ie=Symbol("jq79.store"),k=e=>e!==null&&typeof e=="object"&&e[ie]===!0,D=[],ce=e=>{D.push(new Set);try{return e()}finally{D.pop()}},F=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,o=Object.create(null),c=(a,u,g=!1)=>{t.get(a)?.forEach(b=>b(u,a)),n.forEach(b=>b(a,u)),s.forEach(b=>{(g||Array.from(b.deps).some(m=>Ke(m,a)))&&b.run()})},i=a=>a!==null&&typeof a=="object"&&re(a),l=new Map,h=(a,u)=>{let g=l.get(u);g?.store!==a&&(g?.unsubscribe(),l.set(u,{store:a,unsubscribe:a.$onAny((b,m)=>c(`${u}.${b}`,m))}))},f=a=>{l.get(a)?.unsubscribe(),l.delete(a)},p=(a,u)=>{let g=r.get(a);if(g)return g;let b=new Proxy(a,{get(m,S,R){if(S===K)return m;if(S===ie)return u==="";if(typeof S!="string")return Reflect.get(m,S,R);if(u===""&&S in o)return o[S];let C=u?`${u}.${S}`:S;D[D.length-1]?.add(C);let $=Reflect.get(m,S,R);if(k($))return h($,C),$;let x=U($);return i(x)?p(x,C):x},set(m,S,R,C){if(C!==b&&!Object.prototype.hasOwnProperty.call(m,S))return Reflect.set(m,S,R,C);let $=u?`${u}.${S}`:S,x=k(R)?R:U(R),Me=!Object.prototype.hasOwnProperty.call(m,S);m[S]=x,k(x)?h(x,$):f($);let je=k(x)||!i(x)?x:p(x,$);return c($,je,Me),!0}});return r.set(a,b),b},d=p(U(e),"");Object.entries(U(e)).forEach(([a,u])=>{k(u)&&h(u,a)});let E=(a,u,{immediate:g=!1}={})=>(t.has(a)||t.set(a,new Set),t.get(a).add(u),g&&u(Ge(d,a),a),()=>t.get(a)?.delete(u)),y=(a,{immediate:u=!1}={})=>(n.add(a),u&&oe(d,"",(g,b)=>a(g,b)),()=>n.delete(a)),_=a=>{let u={deps:new Set,run:()=>{let g=new Set;D.push(g);try{a()}finally{D.pop(),u.deps=g}}};return s.add(u),u.run(),()=>{s.delete(u)}},N=()=>{l.forEach(({unsubscribe:a})=>a()),l.clear()};return o.$on=E,o.$onAny=y,o.$effect=_,o.$dispose=N,d},P=e=>{let t=[];return{effect:n=>{t.push(e.$effect(n))},onDispose:n=>{t.push(n)},dispose:()=>{t.splice(0).forEach(n=>n())}}};var ae=/(?:let|var|const)\s+([A-Za-z_$][\w$]*)/y,le=/\$:\s*/y,H=/import(?=\s*\()/y,fe=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,L=(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},v=(e,t)=>{let n=e.indexOf(`
2
- `,t);return n===-1?e.length:n},A=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},q=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=v(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=A(e,n);continue}break}return n},Ze=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,Je=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=L(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=v(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=A(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else{if(n<=0&&r===";")return s;if(n<=0&&r===`
3
- `){let o=q(e,s+1);if(o>=e.length||!Ze.test(e.slice(o,o+2)))return s;s=o;continue}}s++}return e.length},de=e=>{let t=[],n="",s=0,r=0,o=!0;for(;s<e.length;){let c=e[s],i=e[s+1];if(c==="'"||c==='"'||c==="`"){let l=L(e,s);n+=e.slice(s,l),s=l,o=!1;continue}if(c==="/"&&(i==="/"||i==="*")){let l=i==="/"?v(e,s):A(e,s);n+=e.slice(s,l),s=l;continue}if(c==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(H.lastIndex=s,H.test(e))){n+="$__import",s+=6,o=!1;continue}if(r===0&&o){ae.lastIndex=s;let l=ae.exec(e);if(l){t.push(l[1]),n+=l[1],s+=l[0].length,o=!1;continue}le.lastIndex=s;let h=le.exec(e);if(h){fe.lastIndex=s;let f=fe.exec(e);f&&t.push(f[1]);let p=s+h[0].length,d=Je(e,p);n+=`$__effect(() => { ${e.slice(p,d)} });`,s=d;continue}}"([{".includes(c)?r++:")]}".includes(c)&&(r=Math.max(0,r-1)),c===`
4
- `||c===";"||c==="}"?o=!0:/\s/.test(c)||(o=!1),n+=c,s++}return{vars:t,code:n}},z=/export\s+default(?![\w$])/y,ue=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,Ve=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let o=e[r];if(o==="{")n++;else if(o==="}")n--;else if(r===e.length||o===","&&n===0){let c=e.slice(s,r).trim();c&&t.push(c),s=r+1}}return t},Xe=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=Ve(e),o=[],c=s;if(r.length>1){let i=`$__mod${n}`;o.push(`${i} = ${s}`),c=i}for(let i of r)i.startsWith("{")?o.push(`${i.replace(/\s+as\s+/g,": ")} = ${c}`):i.startsWith("*")?o.push(`${i.replace(/^\*\s*as\s+/,"")} = ${c}`):o.push(`${i} = $__default(${c})`);return`const ${o.join(", ")}`},Qe=/^[A-Za-z_$][\w$]*$/,pe=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=L(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=v(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=A(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},he=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let o=e[r];if(o==="'"||o==='"'||o==="`"){r=L(e,r);continue}if(o==="/"&&e[r+1]==="/"){r=v(e,r);continue}if(o==="/"&&e[r+1]==="*"){r=A(e,r);continue}if(o!==void 0&&"([{".includes(o))n++;else if(o!==void 0&&")]}".includes(o))n--;else if(r===e.length||o===","&&n===0){let c=e.slice(s,r).trim();c&&t.push(c),s=r+1}r++}return t},Ye=e=>{let t=0;for(;t<e.length;){let n=pe(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},Z=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=0,s=0;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=L(t,s);continue}if("([{".includes(o))n++;else if(")]}".includes(o)&&--n===0)break;s++}if(s>=t.length)return null;let r=[];for(let o of he(t.slice(1,s))){if(o.startsWith("..."))continue;let c=Ye(o),i=c===-1?o:o.slice(0,c),l=c===-1?void 0:o.slice(c+1).trim(),h=pe(i,":"),f=(h===-1?i:i.slice(0,h)).trim();Qe.test(f)&&r.push(l===void 0?{name:f}:{name:f,default:l})}return r},et=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=L(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=v(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=A(e,t);continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){z.lastIndex=t;let o=z.exec(e);if(o)return t+o[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
5
- `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},tt=/^async(?![\w$])/,nt=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,st=e=>{let t=et(e);if(t===-1)return null;let n=q(e,t),s=e.slice(n);tt.test(s)&&(n=q(e,n+5));let r=nt.exec(e.slice(n));if(r&&(n=q(e,n+r[0].length)),e[n]!=="(")return null;let o=0,c=n;for(;c<e.length;){let i=e[c];if(i==="'"||i==='"'||i==="`"){c=L(e,c);continue}if("([{".includes(i))o++;else if(")]}".includes(i)&&--o===0)break;c++}return he(e.slice(n+1,c))[0]??""},me=e=>{let t=st(e);if(t===null)return null;let n=Z(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},ge=e=>{let t="",n=0,s=0,r=!0,o=!1,c=0;for(;n<e.length;){let i=e[n],l=e[n+1],h=n===0||!/[\w$.]/.test(e[n-1]);if(i==="'"||i==='"'||i==="`"){let f=L(e,n);t+=e.slice(n,f),n=f,r=!1;continue}if(i==="/"&&(l==="/"||l==="*")){let f=l==="/"?v(e,n):A(e,n);t+=e.slice(n,f),n=f;continue}if(i==="i"&&h){if(H.lastIndex=n,H.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){ue.lastIndex=n;let f=ue.exec(e);if(f){t+=Xe(f[1],f[3],c++),n+=f[0].length,r=!1;continue}}}if(i==="e"&&h&&s===0&&r){z.lastIndex=n;let f=z.exec(e);if(f){o=!0,t+="$__exports.default =",n+=f[0].length,r=!1;continue}}"([{".includes(i)?s++:")]}".includes(i)&&(s=Math.max(0,s-1)),i===`
6
- `||i===";"||i==="}"?r=!0:/\s/.test(i)||(r=!1),t+=i,n++}return o?t:null};var xe=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),Te=e=>({tag:e.tagName.toLowerCase(),attrs:xe(e),children:Array.from(e.childNodes).flatMap(t=>{if(t.nodeType===Node.TEXT_NODE){let n=t.textContent??"";return n?[n]:[]}return t.nodeType===Node.ELEMENT_NODE?[Te(t)]:[]})}),ye=new Map,rt=(e,t)=>{let n=`${t.join(",")}|${e}`,s=ye.get(n);if(s===void 0){try{s=new Function("$scope",...t,`with ($scope) { return (${e}); }`)}catch{s=null}ye.set(n,s)}return s},T=(e,t,n)=>{let s=rt(e,n?Object.keys(n):[]);if(s)try{return s(t,...n?Object.values(n):[])}catch{return}},ot=(e,t)=>e.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>T(s,t)??""),Ce=new Set([":attrs",":if",":elseif",":else",":each",":key",":with",":text",":html"]),it=/^\s*(\w+)\s+in\s+([\s\S]+)$/,ct=(e,t,n,s)=>{let[r,...o]=t.slice(1).split("."),c=new Set(o);e.addEventListener(r,i=>{if(c.has("self")&&i.target!==e)return;c.has("prevent")&&i.preventDefault(),c.has("stop")&&i.stopPropagation();let l=T(n,s,{$event:i});typeof l=="function"&&l.call(e,i)},{once:c.has("once"),capture:c.has("capture")})},Ee=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),be=(e,t)=>{let n=t.replace(/-/g,"").toLowerCase();for(let s=e;s&&s!==Object.prototype;s=Object.getPrototypeOf(s))for(let r of Object.keys(s))if(/^[A-Z]/.test(r)&&r.replace(/-/g,"").toLowerCase()===n)return r;return null},Se=(e,t,n,s,r)=>{let o=document.createComment(e),c=document.createDocumentFragment();c.appendChild(o);let i={};Object.entries(t.attrs).forEach(([p,d])=>{if(!(p===Y||Ce.has(p)||p.startsWith("@")))if(p.startsWith(":")){let E=Ee(p.slice(1));i[E]=d||E}else i[Ee(p)]=JSON.stringify(d)});let l=null,h=null,f=null;return s.effect(()=>{let p=T(e,n),d=p instanceof M?p:null;if(d===h||(f?.dispose(),f=null,l?.destroy(),l=null,h=d,!d))return;let E=new M({template:d.template,scripts:d.scripts,styles:d.styles,modules:d.modules,filename:d.filename}),y=ce(()=>Object.fromEntries(Object.entries(i).map(([a,u])=>[a,T(u,n)]))),_=document.createDocumentFragment();(r?E.renderShadow(y):E.render(y)).mount(_),o.parentNode.insertBefore(_,o.nextSibling);let N=P(n);Object.entries(i).forEach(([a,u])=>{N.effect(()=>{E.data[a]=T(u,n)})}),f=N,l=E}),s.onDispose(()=>{f?.dispose(),l?.destroy()}),c},at=(e,t)=>{let n=()=>{let s=T(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let o=n();return o!==null&&Reflect.has(o,r)||Reflect.has(s,r)},get(s,r){let o=n();return o!==null&&Reflect.has(o,r)?o[r]:Reflect.get(s,r)},set(s,r,o){let c=n();return c!==null&&Reflect.has(c,r)?(c[r]=o,!0):Reflect.set(s,r,o)}})},X=(e,t,n,s)=>{let r=e.attrs[":with"],o=r!==void 0?at(r,t):t,c=be(o,e.tag);if(c)return Se(c,e,o,n,s);let i=document.createElement(e.tag);if(i instanceof HTMLUnknownElement||e.tag.includes("-")){let p=!1;n.effect(()=>{if(p)return;let d=be(o,e.tag);d&&(p=!0,i.replaceWith(Se(d,e,o,n,s)))})}Object.entries(e.attrs).forEach(([p,d])=>{p.startsWith("@")?ct(i,p,d,o):Ce.has(p)||i.setAttribute(p,d)});let l=e.attrs[":attrs"];if(l!==void 0){let p=[];n.effect(()=>{p.forEach(E=>i.removeAttribute(E));let d=T(l,o);p=d&&typeof d=="object"?Object.keys(d):[],p.forEach(E=>{let y=d[E];y!=null&&y!==!1&&i.setAttribute(E,String(y))})})}let h=e.attrs[":text"],f=e.attrs[":html"];return h!==void 0?n.effect(()=>{i.textContent=String(T(h,o)??"")}):f!==void 0?n.effect(()=>{i.innerHTML=se(String(T(f,o)??""))}):i.appendChild(Q(e.children,o,n,s)),i},lt=(e,t,n,s)=>{let r=document.createComment("if"),o=document.createDocumentFragment();o.appendChild(r);let c=null,i=null,l=null;return n.effect(()=>{let h=e.find(f=>f.expr===void 0||T(f.expr,t))??null;h!==i&&(l?.dispose(),c&&c.parentNode?.removeChild(c),c=null,i=h,h&&(l=P(t),c=X(h.node,t,l,s),r.parentNode.insertBefore(c,r.nextSibling)))}),o},J=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},ft=(e,t,n,s)=>{let r=e.attrs[":each"].match(it);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let[,o,c]=r,i=e.attrs[":key"],{[":each"]:l,[":key"]:h,...f}=e.attrs,p={...e,attrs:f},d=document.createComment("each"),E=document.createDocumentFragment();E.appendChild(d);let y=[];return n.effect(()=>{let _=T(c,t),N=Array.isArray(_)?_:[],a=new Map(y.map(m=>[m.key,m])),u=N.map((m,S)=>{let R=Object.create(t);J(R,o,m),J(R,"$index",S);let C=i!==void 0?T(i,R):S,$=a.get(C);if($&&Object.is($.item,m))return J($.scope,"$index",S),$;$?.fx.dispose(),$?.node.parentNode?.removeChild($.node);let x=P(t);return{key:C,item:m,scope:R,fx:x,node:X(p,R,x,s)}}),g=new Set(u.map(m=>m.key));y.forEach(m=>{g.has(m.key)||(m.fx.dispose(),m.node.parentNode?.removeChild(m.node))});let b=d;u.forEach(m=>{b.nextSibling!==m.node&&d.parentNode.insertBefore(m.node,b.nextSibling),b=m.node}),y=u}),E},Q=(e,t,n,s=!1)=>{let r=document.createDocumentFragment(),o=0;for(;o<e.length;){let c=e[o];if(typeof c=="string"){let i=document.createTextNode(c);c.includes("{{")&&n.effect(()=>{i.textContent=ot(c,t)}),r.appendChild(i),o++;continue}if(":each"in c.attrs){r.appendChild(ft(c,t,n,s)),o++;continue}if(":if"in c.attrs){let i=[{expr:c.attrs[":if"],node:c}];o++;let l=f=>{let p=o;for(;p<e.length&&typeof e[p]=="string"&&!e[p].trim();)p++;let d=e[p];if(typeof d=="object"&&f in d.attrs)return o=p+1,d};for(let f=l(":elseif");f;f=l(":elseif"))i.push({expr:f.attrs[":elseif"],node:f});let h=l(":else");h&&i.push({node:h}),r.appendChild(lt(i,t,n,s));continue}r.appendChild(X(c,t,n,s)),o++}return r},ut=(e,t,n=!1)=>Q(e.template,t,P(t),n),dt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),pt=/<([A-Za-z][\w-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,ht=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,mt=e=>e.split(ht).map((t,n)=>n%2===1?t:t.replace(pt,(s,r,o)=>dt.has(r.toLowerCase())?s:`<${r}${o}></${r}>`)).join(""),Y="data-jq79",gt=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)},_e=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[Y]=t,_e(n.children,t))})},yt=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),o=r===-1?s:s.slice(0,r),c=r===-1?"":s.slice(r);return`${o}[${Y}="${t}"]${c}`}).join(", "),Ne=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=yt(n.selectorText,t):n instanceof CSSGroupingRule&&Ne(n.cssRules,t)})},Et=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Ne(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
7
- `)},V=e=>{let n=new DOMParser().parseFromString(`<template>${mt(e)}</template>`,"text/html").querySelector("template"),s=[],r=[],o=[];Array.from(n.content.children).forEach(i=>{let l={attrs:xe(i),content:i.textContent??""};i.tagName==="SCRIPT"?s.push(l):i.tagName==="STYLE"?r.push(l):o.push(Te(i))}),r.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 c=i=>"scoped"in i.attrs&&!("lang"in i.attrs);if(r.some(c)){let i=gt(e);_e(o,i),r.forEach(l=>{c(l)&&(l.scoped=Et(l.content,i))})}return{template:o,scripts:s,styles:r}},ee=e=>/\.html?([?#]|$)/.test(e)?M.fetch(e):import(e),Le=(e,t)=>e?`
8
- //# sourceURL=${e}?jq79-script=${t}`:"",$e=e=>e.scoped??e.content,G=new Map,bt=e=>{let t=G.get(e);if(!t){let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0},G.set(e,t)}t.count++},St=e=>{let t=G.get(e);t&&--t.count<=0&&(t.el.remove(),G.delete(e))},ve={$:j,$$:W,$create:B,$reactive:F},$t=(e,t,n,s={},r=ee,o={})=>{let c={...ve,...s},i=new Proxy(t,{has:(h,f)=>f!=="$__effect"&&f!=="$__import"&&(Reflect.has(h,f)||!(f in globalThis)&&!(f in c))});new Function("$scope","$__effect","$__import",...Object.keys(c),`return (async () => { with ($scope) { ${e} } })()${Le(o.filename,o.index??0)}`)(i,n,r,...Object.values(c)).catch(h=>console.error("jq79: error in :setup script",h))},we=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:T(s,e))})},wt=e=>e&&e.default!==void 0?e.default:e,Rt=(e,t,n,s={},r=ee,o={})=>{let c={...ve,...s},i={},l=new Function("$__exports","$__default","$__import",...Object.keys(c),`return (async () => { "use strict";
1
+ var jq79=(()=>{var z=Object.defineProperty;var Ue=Object.getOwnPropertyDescriptor;var qe=Object.getOwnPropertyNames;var He=Object.prototype.hasOwnProperty;var ze=(e,t,n)=>t in e?z(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var Ge=(e,t)=>{for(var n in t)z(e,n,{get:t[n],enumerable:!0})},Ke=(e,t,n,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of qe(t))!He.call(e,r)&&r!==n&&z(e,r,{get:()=>t[r],enumerable:!(s=Ue(t,r))||s.enumerable});return e};var Ze=e=>Ke(z({},"__esModule",{value:!0}),e);var T=(e,t,n)=>ze(e,typeof t!="symbol"?t+"":t,n);var Ft={};Ge(Ft,{$:()=>I,$$:()=>G,$create:()=>K,$reactive:()=>q,Component79:()=>F,enableHotReload:()=>We,hotUpdate:()=>Ie,parseComponent:()=>kt,renderComponent:()=>wt});function I(e,t){return typeof e=="string"?document.querySelector(e):e.querySelector(t)}function G(e,t){return Array.from(typeof e=="string"?document.querySelectorAll(e):e.querySelectorAll(t))}var K=(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 o of r)n.appendChild(o);else n.setAttribute(s,r);return n},Je=new Set(["a","b","i","em","strong","p","br","ul","ol","li","blockquote","code","pre","span","div","h1","h2","h3","h4","h5","h6","img"]),ue={a:new Set(["href","title"]),img:new Set(["src","alt"]),"*":new Set(["class"])},Ve=new Set(["http:","https:","mailto:"]);function Xe(e){try{let t=new URL(e,"https://example.com");return Ve.has(t.protocol)}catch{return!1}}function de(e,t){for(let n of Array.from(e.childNodes))if(n.nodeType===Node.ELEMENT_NODE){let s=Qe(n);s&&t.appendChild(s)}else n.nodeType===Node.TEXT_NODE&&t.appendChild(n.cloneNode())}function Qe(e){let t=e.tagName.toLowerCase();if(!Je.has(t))return null;let n=document.createElement(t);for(let s of Array.from(e.attributes)){let r=s.name.toLowerCase(),o=ue[t]?.has(r),i=ue["*"]?.has(r);!o&&!i||(r==="href"||r==="src")&&!Xe(s.value)||n.setAttribute(r,s.value)}return t==="a"&&n.setAttribute("rel","noopener noreferrer"),de(e,n),n}function pe(e){let t=new DOMParser().parseFromString(e,"text/html"),n=document.createElement("div");return de(t.body,n),n.innerHTML}var Ye=(e,t)=>t.split(".").reduce((n,s)=>n?.[s],e),he=e=>{if(Array.isArray(e))return!0;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},me=(e,t,n)=>{Object.entries(e).forEach(([s,r])=>{let o=t?`${t}.${s}`:s;r&&typeof r=="object"&&he(r)?me(r,o,n):n(o,r)})},et=(e,t)=>e===t||e.startsWith(`${t}.`)||t.startsWith(`${e}.`),ee=Symbol("jq79.raw"),Z=e=>{let t=e;for(;t!==null&&typeof t=="object"&&t[ee];)t=t[ee];return t},ge=Symbol("jq79.store"),U=e=>e!==null&&typeof e=="object"&&e[ge]===!0,W=[],te=e=>{W.push(new Set);try{return e()}finally{W.pop()}},q=e=>{let t=new Map,n=new Set,s=new Set,r=new WeakMap,o=Object.create(null),i=(a,u,m=!1)=>{t.get(a)?.forEach(S=>S(u,a)),n.forEach(S=>S(a,u)),s.forEach(S=>{(m||Array.from(S.deps).some(x=>et(x,a)))&&S.run()})},c=a=>a!==null&&typeof a=="object"&&he(a),l=new Map,d=(a,u)=>{let m=l.get(u);m?.store!==a&&(m?.unsubscribe(),l.set(u,{store:a,unsubscribe:a.$onAny((S,x)=>i(`${u}.${S}`,x))}))},f=a=>{l.get(a)?.unsubscribe(),l.delete(a)},p=(a,u)=>{let m=r.get(a);if(m)return m;let S=null,x=new Proxy(a,{has(R,g){return Reflect.has(R,g)||typeof g=="string"&&S?.has(g)===!0},get(R,g,b){if(g===ee)return R;if(g===ge)return u==="";if(typeof g!="string")return Reflect.get(R,g,b);if(u===""&&g in o)return o[g];let w=u?`${u}.${g}`:g;W[W.length-1]?.add(w);let C=Reflect.get(R,g,b);if(U(C))return d(C,w),C;let $=Z(C);return c($)?p($,w):$},set(R,g,b,w){if(w!==x&&!Object.prototype.hasOwnProperty.call(R,g))return Reflect.set(R,g,b,w);let C=u?`${u}.${g}`:g,$=U(b)?b:Z(b),P=!Object.prototype.hasOwnProperty.call(R,g);if(!P&&Object.is(R[g],$)&&($===null||typeof $!="object"))return!0;R[g]=$,S?.delete(g),U($)?d($,C):f(C);let _=U($)||!c($)?$:p($,C);return i(C,_,P),!0},deleteProperty(R,g){if(typeof g!="string")return Reflect.deleteProperty(R,g);let b=Object.prototype.hasOwnProperty.call(R,g),w=Reflect.deleteProperty(R,g);if(w&&b){let C=u?`${u}.${g}`:g;(S??(S=new Set)).add(g),f(C),i(C,void 0)}return w}});return r.set(a,x),x},h=p(Z(e),"");Object.entries(Z(e)).forEach(([a,u])=>{U(u)&&d(u,a)});let y=(a,u,{immediate:m=!1}={})=>(t.has(a)||t.set(a,new Set),t.get(a).add(u),m&&u(Ye(h,a),a),()=>t.get(a)?.delete(u)),E=(a,{immediate:u=!1}={})=>(n.add(a),u&&me(h,"",(m,S)=>a(m,S)),()=>n.delete(a)),v=a=>{let u=!1,m=!1,S={deps:new Set,run:()=>{if(u){m=!0;return}u=!0;try{let x=0;do{m=!1;let R=new Set;W.push(R);try{a()}finally{W.pop(),S.deps=R}}while(m&&++x<100);m&&console.error("jq79: an effect re-woke itself 100 times in a row (it writes what it reads); giving up on it settling")}finally{u=!1}}};return s.add(S),S.run(),()=>{s.delete(S)}},L=()=>{l.forEach(({unsubscribe:a})=>a()),l.clear()};return o.$on=y,o.$onAny=E,o.$effect=v,o.$dispose=L,h},B=e=>{let t=[],n=[];return{effect:s=>{t.push(e.$effect(s)),n.push(s)},onDispose:s=>{t.push(s)},refresh:()=>{n.forEach(s=>s())},dispose:()=>{t.splice(0).forEach(s=>s()),n.length=0}}};var ye=/(?:let|var|const)\s+([A-Za-z_$][\w$]*)/y,Ee=/\$:\s*/y,V=/import(?=\s*\()/y,be=/\$:\s*([A-Za-z_$][\w$]*)\s*=(?!=)/y,j=(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},O=(e,t)=>{let n=e.indexOf(`
2
+ `,t);return n===-1?e.length:n},A=(e,t)=>{let n=e.indexOf("*/",t+2);return n===-1?e.length:n+2},J=(e,t)=>{let n=t;for(;n<e.length;){if(/\s/.test(e[n])){n++;continue}if(e[n]==="/"&&e[n+1]==="/"){n=O(e,n);continue}if(e[n]==="/"&&e[n+1]==="*"){n=A(e,n);continue}break}return n},tt=new Set(["return","typeof","case","in","instanceof","new","delete","void","do","else","yield","await"]),M=(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 o=e.lastIndexOf("/*",n-2);if(o===-1)return!0;n=o-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 tt.has(e.slice(r,n+1))}return(s==="+"||s==="-")&&e[n-1]===s?!1:!")]}\"'`.".includes(s)},D=(e,t)=>{let n=t+1,s=!1;for(;n<e.length;){let r=e[n];if(r==="\\"){n+=2;continue}if(r===`
3
+ `)return n;if(r==="[")s=!0;else if(r==="]")s=!1;else if(r==="/"&&!s){for(n++;n<e.length&&/[a-z]/i.test(e[n]);)n++;return n}n++}return e.length},nt=/^(\?\.|\?\?|&&|\|\||\*\*|[.,+\-*/%&|^<>=?:([])/,st=(e,t)=>{let n=0,s=t;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=j(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=O(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=A(e,s);continue}if(r==="/"&&M(e,s)){s=D(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 o=J(e,s+1);if(o>=e.length||!nt.test(e.slice(o,o+2)))return s;s=o;continue}}s++}return e.length},ne=e=>{let t=[],n="",s=0,r=0,o=!0;for(;s<e.length;){let i=e[s],c=e[s+1];if(i==="'"||i==='"'||i==="`"){let l=j(e,s);n+=e.slice(s,l),s=l,o=!1;continue}if(i==="/"&&(c==="/"||c==="*")){let l=c==="/"?O(e,s):A(e,s);n+=e.slice(s,l),s=l;continue}if(i==="/"&&M(e,s)){let l=D(e,s);n+=e.slice(s,l),s=l,o=!1;continue}if(i==="i"&&(s===0||!/[\w$.]/.test(e[s-1]))&&(V.lastIndex=s,V.test(e))){n+="$__import",s+=6,o=!1;continue}if(r===0&&o){ye.lastIndex=s;let l=ye.exec(e);if(l){t.push(l[1]),n+=l[1],s+=l[0].length,o=!1;continue}Ee.lastIndex=s;let d=Ee.exec(e);if(d){be.lastIndex=s;let f=be.exec(e);f&&t.push(f[1]);let p=s+d[0].length,h=st(e,p);n+=`$__effect(() => { ${ne(e.slice(p,h)).code} });`,s=h;continue}}"([{".includes(i)?r++:")]}".includes(i)&&(r=Math.max(0,r-1)),i===`
5
+ `||i===";"||i==="}"?o=!0:/\s/.test(i)||(o=!1),n+=i,s++}return{vars:t,code:n}},X=/export\s+default(?![\w$])/y,Se=/import\s*(?:([\w$\s,{}*]+?)\s*from\s*)?(["'])([^"'\n]+)\2/y,rt=e=>{let t=[],n=0,s=0;for(let r=0;r<=e.length;r++){let o=e[r];if(o==="{")n++;else if(o==="}")n--;else if(r===e.length||o===","&&n===0){let i=e.slice(s,r).trim();i&&t.push(i),s=r+1}}return t},ot=(e,t,n)=>{let s=`await $__import(${JSON.stringify(t)})`;if(e===void 0)return s;let r=rt(e),o=[],i=s;if(r.length>1){let c=`$__mod${n}`;o.push(`${c} = ${s}`),i=c}for(let c of r)c.startsWith("{")?o.push(`${c.replace(/\s+as\s+/g,": ")} = ${i}`):c.startsWith("*")?o.push(`${c.replace(/^\*\s*as\s+/,"")} = ${i}`):o.push(`${c} = $__default(${i})`);return`const ${o.join(", ")}`},it=/^[A-Za-z_$][\w$]*$/,we=(e,t)=>{let n=0,s=0;for(;s<e.length;){let r=e[s];if(r==="'"||r==='"'||r==="`"){s=j(e,s);continue}if(r==="/"&&e[s+1]==="/"){s=O(e,s);continue}if(r==="/"&&e[s+1]==="*"){s=A(e,s);continue}if(r==="/"&&r!==t&&M(e,s)){s=D(e,s);continue}if("([{".includes(r))n++;else if(")]}".includes(r))n--;else if(n===0&&r===t)return s;s++}return-1},Re=e=>{let t=[],n=0,s=0,r=0;for(;r<=e.length;){let o=e[r];if(o==="'"||o==='"'||o==="`"){r=j(e,r);continue}if(o==="/"&&e[r+1]==="/"){r=O(e,r);continue}if(o==="/"&&e[r+1]==="*"){r=A(e,r);continue}if(o==="/"&&M(e,r)){r=D(e,r);continue}if(o!==void 0&&"([{".includes(o))n++;else if(o!==void 0&&")]}".includes(o))n--;else if(r===e.length||o===","&&n===0){let i=e.slice(s,r).trim();i&&t.push(i),s=r+1}r++}return t},ct=e=>{let t=0;for(;t<e.length;){let n=we(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},se=e=>{let t=(e??"").trim();if(!t.startsWith("{"))return null;let n=0,s=0;for(;s<t.length;){let o=t[s];if(o==="'"||o==='"'||o==="`"){s=j(t,s);continue}if(o==="/"&&t[s+1]==="/"){s=O(t,s);continue}if(o==="/"&&t[s+1]==="*"){s=A(t,s);continue}if(o==="/"&&M(t,s)){s=D(t,s);continue}if("([{".includes(o))n++;else if(")]}".includes(o)&&--n===0)break;s++}if(s>=t.length)return null;let r=[];for(let o of Re(t.slice(1,s))){if(o.startsWith("..."))continue;let i=ct(o),c=i===-1?o:o.slice(0,i),l=i===-1?void 0:o.slice(i+1).trim(),d=we(c,":"),f=(d===-1?c:c.slice(0,d)).trim();it.test(f)&&r.push(l===void 0?{name:f}:{name:f,default:l})}return r},at=e=>{let t=0,n=0,s=!0;for(;t<e.length;){let r=e[t];if(r==="'"||r==='"'||r==="`"){t=j(e,t),s=!1;continue}if(r==="/"&&e[t+1]==="/"){t=O(e,t);continue}if(r==="/"&&e[t+1]==="*"){t=A(e,t);continue}if(r==="/"&&M(e,t)){t=D(e,t),s=!1;continue}if(r==="e"&&n===0&&s&&(t===0||!/[\w$.]/.test(e[t-1]))){X.lastIndex=t;let o=X.exec(e);if(o)return t+o[0].length}"([{".includes(r)?n++:")]}".includes(r)&&(n=Math.max(0,n-1)),r===`
6
+ `||r===";"||r==="}"?s=!0:/\s/.test(r)||(s=!1),t++}return-1},lt=/^async(?![\w$])/,ft=/^function(?![\w$])\s*\*?\s*[A-Za-z_$][\w$]*|^function(?![\w$])\s*\*?/,ut=e=>{let t=at(e);if(t===-1)return null;let n=J(e,t),s=e.slice(n);lt.test(s)&&(n=J(e,n+5));let r=ft.exec(e.slice(n));if(r&&(n=J(e,n+r[0].length)),e[n]!=="(")return null;let o=0,i=n;for(;i<e.length;){let c=e[i];if(c==="'"||c==='"'||c==="`"){i=j(e,i);continue}if(c==="/"&&e[i+1]==="/"){i=O(e,i);continue}if(c==="/"&&e[i+1]==="*"){i=A(e,i);continue}if(c==="/"&&M(e,i)){i=D(e,i);continue}if("([{".includes(c))o++;else if(")]}".includes(c)&&--o===0)break;i++}return Re(e.slice(n+1,i))[0]??""},$e=e=>{let t=ut(e);if(t===null)return null;let n=se(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},xe=e=>{let t="",n=0,s=0,r=!0,o=!1,i=0;for(;n<e.length;){let c=e[n],l=e[n+1],d=n===0||!/[\w$.]/.test(e[n-1]);if(c==="'"||c==='"'||c==="`"){let f=j(e,n);t+=e.slice(n,f),n=f,r=!1;continue}if(c==="/"&&(l==="/"||l==="*")){let f=l==="/"?O(e,n):A(e,n);t+=e.slice(n,f),n=f;continue}if(c==="/"&&M(e,n)){let f=D(e,n);t+=e.slice(n,f),n=f,r=!1;continue}if(c==="i"&&d){if(V.lastIndex=n,V.test(e)){t+="$__import",n+=6,r=!1;continue}if(s===0&&r){Se.lastIndex=n;let f=Se.exec(e);if(f){t+=ot(f[1],f[3],i++),n+=f[0].length,r=!1;continue}}}if(c==="e"&&d&&s===0&&r){X.lastIndex=n;let f=X.exec(e);if(f){o=!0,t+="$__exports.default =",n+=f[0].length,r=!1;continue}}"([{".includes(c)?s++:")]}".includes(c)&&(s=Math.max(0,s-1)),c===`
7
+ `||c===";"||c==="}"?r=!0:/\s/.test(c)||(r=!1),t+=c,n++}return o?t:null};var Ae=e=>Object.fromEntries(Array.from(e.attributes).map(t=>[t.name,t.value])),je=e=>({tag:e.tagName.toLowerCase(),attrs:Ae(e),children:Array.from(e.childNodes).flatMap(t=>{if(t.nodeType===Node.TEXT_NODE){let n=t.textContent??"";return n?[n]:[]}return t.nodeType===Node.ELEMENT_NODE?[je(t)]:[]})}),Te=new Map,dt=(e,t)=>{let n=`${t.join(",")}|${e}`,s=Te.get(n);if(s===void 0){try{s=new Function("$scope",...t,`with ($scope) { return (${e}); }`)}catch{s=null}Te.set(n,s)}return s},N=(e,t,n)=>{let s=dt(e,n?Object.keys(n):[]);if(s)try{return s(t,...n?Object.values(n):[])}catch{return}},pt=(e,t)=>e.replace(/{{\s*([\s\S]+?)\s*}}/g,(n,s)=>N(s,t)??""),Me=new Set([":attrs",":if",":elseif",":else",":each",":key",":with",":text",":html"]),ht=/^\s*\(?\s*(\w+)\s*(?:,\s*(\w+))?\s*\)?\s+in\s+([\s\S]+)$/,mt=(e,t,n,s)=>{let[r,...o]=t.slice(1).split("."),i=new Set(o);e.addEventListener(r,c=>{if(i.has("self")&&c.target!==e)return;i.has("prevent")&&c.preventDefault(),i.has("stop")&&c.stopPropagation();let l=N(n,s,{$event:c});typeof l=="function"&&l.call(e,c)},{once:i.has("once"),capture:i.has("capture")})},Ce=e=>e.replace(/-(\w)/g,(t,n)=>n.toUpperCase()),oe=e=>e instanceof DocumentFragment?{first:e.firstChild,last:e.lastChild}:{first:e,last:e},Q=({first:e,last:t})=>{for(let n=e;n;){let s=n===t?null:n.nextSibling;n.parentNode?.removeChild(n),n=s}},gt=({first:e,last:t},n)=>{let s=n.nextSibling;for(let r=e;r;){let o=r===t?null:r.nextSibling;n.parentNode.insertBefore(r,s),r=o}},Ne=(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=(e,t,n,s,r)=>{let o=document.createComment(e),i=document.createComment(`/${e}`),c=document.createDocumentFragment();c.append(o,i);let l={};Object.entries(t.attrs).forEach(([h,y])=>{if(!(h===ae||Me.has(h)||h.startsWith("@")))if(h.startsWith(":")){let E=Ce(h.slice(1));l[E]=y||E}else l[Ce(h)]=JSON.stringify(y)});let d=null,f=null,p=null;return s.effect(()=>{let h=N(e,n),y=h instanceof F?h:null;if(y===f||(p?.dispose(),p=null,d?.destroy(),d=null,f=y,!y))return;let E=new F({template:y.template,scripts:y.scripts,styles:y.styles,modules:y.modules,filename:y.filename}),v=te(()=>Object.fromEntries(Object.entries(l).map(([u,m])=>[u,N(m,n)]))),L=document.createDocumentFragment();(r?E.renderShadow(v):E.render(v)).mount(L),i.parentNode.insertBefore(L,i);let a=B(n);Object.entries(l).forEach(([u,m])=>{a.effect(()=>{E.data[u]=N(m,n)})}),p=a,d=E}),s.onDispose(()=>{p?.dispose(),d?.destroy()}),c},yt=(e,t)=>{let n=()=>{let s=N(e,t);return s!==null&&typeof s=="object"?s:null};return new Proxy(t,{has(s,r){let o=n();return o!==null&&Reflect.has(o,r)||Reflect.has(s,r)},get(s,r){let o=n();return o!==null&&Reflect.has(o,r)?o[r]:Reflect.get(s,r)},set(s,r,o){let i=n();return i!==null&&Reflect.has(i,r)?(i[r]=o,!0):Reflect.set(s,r,o)}})},ie=(e,t,n,s)=>{let r=e.attrs[":with"],o=r!==void 0?yt(r,t):t,i=Ne(o,e.tag);if(i)return _e(i,e,o,n,s);let c=document.createElement(e.tag);if(c instanceof HTMLUnknownElement||e.tag.includes("-")){let p=!1;n.effect(()=>{if(p)return;let h=Ne(o,e.tag);if(!h)return;p=!0;let y=_e(h,e,o,n,s),E=oe(y);n.onDispose(()=>Q(E)),c.replaceWith(y)})}Object.entries(e.attrs).forEach(([p,h])=>{p.startsWith("@")?mt(c,p,h,o):Me.has(p)||c.setAttribute(p,h)});let l=e.attrs[":attrs"];if(l!==void 0){let p=[];n.effect(()=>{p.forEach(y=>c.removeAttribute(y));let h=N(l,o);p=h&&typeof h=="object"?Object.keys(h):[],p.forEach(y=>{let E=h[y];E!=null&&E!==!1&&c.setAttribute(y,String(E))})})}let d=e.attrs[":text"],f=e.attrs[":html"];return d!==void 0?n.effect(()=>{c.textContent=String(N(d,o)??"")}):f!==void 0?n.effect(()=>{c.innerHTML=pe(String(N(f,o)??""))}):c.appendChild(ce(e.children,o,n,s)),c},Et=(e,t,n,s)=>{let r=document.createComment("if"),o=document.createDocumentFragment();o.appendChild(r);let i=null,c=null,l=null;return n.effect(()=>{let d=e.find(p=>p.expr===void 0||N(p.expr,t))??null;if(d===c||(l?.dispose(),i&&Q(i),i=null,c=d,!d))return;l=B(t);let f=ie(d.node,t,l,s);i=oe(f),r.parentNode.insertBefore(f,r.nextSibling)}),o},H=(e,t,n)=>{Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})},bt=e=>{if(e===null||typeof e!="object"||Array.isArray(e))return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null},St=(e,t,n,s)=>{let r=e.attrs[":each"].match(ht);if(!r)return document.createComment(`invalid :each expression "${e.attrs[":each"]}"`);let[,o,i,c]=r,l=e.attrs[":key"],{[":each"]:d,[":key"]:f,...p}=e.attrs,h={...e,attrs:p},y=document.createComment("each"),E=document.createDocumentFragment();E.appendChild(y),(":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 v=[],L=!1;return n.effect(()=>{let a=N(c,t),u=Array.isArray(a)?a.map((b,w)=>[w,b]):bt(a)?Object.entries(a):[],m=new Map;v.forEach(b=>{let w=m.get(b.key);w?w.push(b):m.set(b.key,[b])});let S=new Set,x=[],R=u.map(([b,w],C)=>{let $=Object.create(t);H($,o,w),i&&H($,i,b),H($,"$index",C);let P=l!==void 0?N(l,$):b;S.has(P)&&!L&&(L=!0,console.warn(`jq79: duplicate :key in :each "${e.attrs[":each"]}"; duplicates pair up by position`)),S.add(P);let _=m.get(P)?.shift();if(_&&Object.is(_.item,w))return _.scope.$index!==C&&x.push(_),H(_.scope,"$index",C),i&&H(_.scope,i,b),_;_&&(_.fx.dispose(),Q(_.range));let fe=B(t),Be=oe(ie(h,$,fe,s));return{key:P,item:w,scope:$,fx:fe,range:Be}});m.forEach(b=>b.forEach(w=>{w.fx.dispose(),Q(w.range)}));let g=y;R.forEach(b=>{g.nextSibling!==b.range.first&&gt(b.range,g),g=b.range.last}),x.forEach(b=>te(()=>b.fx.refresh())),v=R}),E},ce=(e,t,n,s=!1)=>{let r=document.createDocumentFragment(),o=0;for(;o<e.length;){let i=e[o];if(typeof i=="string"){let c=document.createTextNode(i);i.includes("{{")&&n.effect(()=>{c.textContent=pt(i,t)}),r.appendChild(c),o++;continue}if(":each"in i.attrs){r.appendChild(St(i,t,n,s)),o++;continue}if(":if"in i.attrs){let c=[{expr:i.attrs[":if"],node:i}];o++;let l=f=>{let p=o;for(;p<e.length&&typeof e[p]=="string"&&!e[p].trim();)p++;let h=e[p];if(typeof h=="object"&&f in h.attrs)return o=p+1,h};for(let f=l(":elseif");f;f=l(":elseif"))c.push({expr:f.attrs[":elseif"],node:f});let d=l(":else");d&&c.push({node:d}),r.appendChild(Et(c,t,n,s));continue}r.appendChild(ie(i,t,n,s)),o++}return r},wt=(e,t,n=!1)=>ce(e.template,t,B(t),n),Rt=new Set(["area","base","br","col","embed","hr","img","input","link","meta","param","source","track","wbr"]),$t=/<([A-Za-z][\w-]*)((?:"[^"]*"|'[^']*'|[^>"'])*?)\/>/g,xt=/(<script[\s\S]*?<\/script\s*>|<style[\s\S]*?<\/style\s*>)/gi,Tt=e=>e.split(xt).map((t,n)=>n%2===1?t:t.replace($t,(s,r,o)=>Rt.has(r.toLowerCase())?s:`<${r}${o}></${r}>`)).join(""),ae="data-jq79",Ct=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)},De=(e,t)=>{e.forEach(n=>{typeof n!="string"&&(n.attrs[ae]=t,De(n.children,t))})},Nt=(e,t)=>e.split(",").map(n=>{let s=n.trim(),r=s.indexOf("::"),o=r===-1?s:s.slice(0,r),i=r===-1?"":s.slice(r);return`${o}[${ae}="${t}"]${i}`}).join(", "),Pe=(e,t)=>{Array.from(e).forEach(n=>{n instanceof CSSStyleRule?n.selectorText=Nt(n.selectorText,t):n instanceof CSSGroupingRule&&Pe(n.cssRules,t)})},_t=(e,t)=>{/:deep\(|::v-deep|>>>/.test(e)&&console.warn("jq79: :deep()/::v-deep/>>> are not supported in <style scoped>; the rule will be dropped by the browser");let n=new CSSStyleSheet;return n.replaceSync(e),Pe(n.cssRules,t),Array.from(n.cssRules).map(s=>s.cssText).join(`
8
+ `)},re=e=>{let n=new DOMParser().parseFromString(`<template>${Tt(e)}</template>`,"text/html").querySelector("template"),s=[],r=[],o=[];Array.from(n.content.children).forEach(c=>{let l={attrs:Ae(c),content:c.textContent??""};c.tagName==="SCRIPT"?s.push(l):c.tagName==="STYLE"?r.push(l):o.push(je(c))}),r.forEach(c=>{"lang"in c.attrs&&console.warn(`jq79: <style lang="${c.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=c=>"scoped"in c.attrs&&!("lang"in c.attrs);if(r.some(i)){let c=Ct(e);De(o,c),r.forEach(l=>{i(l)&&(l.scoped=_t(l.content,c))})}return{template:o,scripts:s,styles:r}},le=e=>/\.html?([?#]|$)/.test(e)?F.fetch(e):import(e),ke=(e,t)=>e?`
9
+ //# sourceURL=${e}?jq79-script=${t}`:"",ve=e=>e.scoped??e.content,Y=new Map,vt=e=>{let t=Y.get(e);if(!t){let n=document.createElement("style");n.textContent=e,document.head.appendChild(n),t={el:n,count:0},Y.set(e,t)}t.count++},Lt=e=>{let t=Y.get(e);t&&--t.count<=0&&(t.el.remove(),Y.delete(e))},Fe={$:I,$$:G,$create:K,$reactive:q},Ot=(e,t,n,s={},r=le,o={})=>{let i={...Fe,...s},c=new Proxy(t,{has:(d,f)=>f!=="$__effect"&&f!=="$__import"&&(Reflect.has(d,f)||!(f in globalThis)&&!(f in i))});new Function("$scope","$__effect","$__import",...Object.keys(i),`return (async () => { with ($scope) { ${e} } })()${ke(o.filename,o.index??0)}`)(c,n,r,...Object.values(i)).catch(d=>console.error("jq79: error in :setup script",d))},Le=(e,t)=>{t?.forEach(({name:n,default:s})=>{e[n]===void 0&&(e[n]=s===void 0?void 0:N(s,e))})},At=e=>e&&e.default!==void 0?e.default:e,jt=(e,t,n,s={},r=le,o={})=>{let i={...Fe,...s},c={},l=new Function("$__exports","$__default","$__import",...Object.keys(i),`return (async () => { "use strict";
9
10
  ${e}
10
- ;$__exports.done = true })()${Le(o.filename,o.index??0)}`)(i,wt,r,...Object.values(c)),h=d=>console.error("jq79: error in factory script",d),f=!1,p=()=>{if(f)return;f=!0;let d=i.default;if(typeof d!="function")return;let E=y=>{y&&typeof y=="object"&&Object.assign(t,y)};try{let y=d(t,{$data:t,$props:t,$effect:n,...s});y instanceof Promise?y.then(E).catch(h):E(y)}catch(y){h(y)}};l.then(p,h),i.done&&p()},xt="__JQ79_HMR_ENABLED__",Tt="__JQ79_HMR__",O=null,Ct=e=>{if(!O||!e.filename)return;let t=O.get(e.filename);t||O.set(e.filename,t=new Set),t.add(new WeakRef(e))},Re=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},Ae=(e,t)=>{if(!O)return 0;let n=Re(e),s=V(t),r=0;for(let[o,c]of O)if(Re(o)===n){for(let i of c){let l=i.deref();if(!l){c.delete(i);continue}l.hotReplace(s)&&r++}c.size||O.delete(o)}return r},Oe=()=>{O??(O=new Map),globalThis[Tt]={update:Ae}},M=class e{constructor(t,n={}){w(this,"template");w(this,"scripts");w(this,"styles");w(this,"modules");w(this,"filename");w(this,"data",null);w(this,"fx",null);w(this,"content",null);w(this,"startMarker",null);w(this,"endMarker",null);w(this,"styleEls",[]);w(this,"ownsSharedStyles",!1);w(this,"useShadow",!1);w(this,"mountRoot",null);w(this,"resolveMounted",null);w(this,"emitListeners",new Map);let s=typeof t=="string"?V(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),Ct(this)}hotReplace(t){let n=typeof t=="string"?V(t):t,s=this.startMarker,r=!!(s&&this.content),o=r&&s.isConnected,c=o?s.parentNode:null,i=o?this.endMarker.nextSibling:null,l={...this.data},h=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,!r||(this.renderWith(l,h),!c)?!1:(h&&this.styleEls.forEach(f=>c.insertBefore(f,i)),c.insertBefore(this.content,i),this.mountRoot=c,this.resolveMounted?.(),!0)}static async fetch(t){let n=await fetch(t);if(!n.ok)throw new Error(`failed to fetch component from ${t}: ${n.status}`);return new e(await n.text(),{filename:t})}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=F({...t}),r=P(s);this.data=s,this.fx=r,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let o=this.startMarker,c=(a,u)=>{let g=new CustomEvent(a,{detail:u,bubbles:!0,composed:!0}),b=o.dispatchEvent(g);return o===this.startMarker&&this.emitListeners.get(a)?.forEach(m=>m(g,u)),b},i,l=new Promise(a=>{i=a});this.resolveMounted=i;let h=()=>l,f=this.endMarker,p=a=>{let u=[];for(let g=o.nextSibling;g&&g!==f;g=g.nextSibling)g instanceof Element&&(g.matches(a)&&u.push(g),u.push(...Array.from(g.querySelectorAll(a))));return u},d=a=>p(a)[0]??null,E=this.modules,y=a=>E&&a in E?Promise.resolve(E[a]):ee(a),_=a=>`await $mounted();${a}`;this.scripts.forEach((a,u)=>{let g={$emit:c,$mounted:h,$self:d,$$self:p},b={filename:this.filename,index:u},m=ge(a.content);if(m!==null){we(s,me(a.content));let $=":mounted"in a.attrs?_(m):m;Rt($,s,r.effect,g,y,b);return}let{vars:S,code:R}=de(a.content);we(s,Z(a.attrs[":setup"])),S.forEach($=>{$ in s||(s[$]=void 0)});let C=":mounted"in a.attrs?_(R):R;$t(C,s,r.effect,g,y,b)});let N=document.createDocumentFragment();return N.append(this.startMarker,Q(this.template,s,r,n),this.endMarker),this.content=N,n?this.styleEls=this.styles.map(a=>{let u=document.createElement("style");return u.textContent=a.content,u}):(this.styles.forEach(a=>bt($e(a))),this.ownsSharedStyles=!0),this}mount(t,n){let s=typeof t=="string"?j(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"?j(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.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 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(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(t=>t.parentNode?.removeChild(t)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(t=>St($e(t))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}},_t=e=>new M(e);typeof globalThis<"u"&&globalThis[xt]&&Oe();return Be(Nt);})();
11
+ ;$__exports.done = true })()${ke(o.filename,o.index??0)}`)(c,At,r,...Object.values(i)),d=h=>console.error("jq79: error in factory script",h),f=!1,p=()=>{if(f)return;f=!0;let h=c.default;if(typeof h!="function")return;let y=E=>{E&&typeof E=="object"&&Object.assign(t,E)};try{let E=h(t,{$data:t,$props:t,$effect:n,...s});E instanceof Promise?E.then(y).catch(d):y(E)}catch(E){d(E)}};l.then(p,d),c.done&&p()},Mt="__JQ79_HMR_ENABLED__",Dt="__JQ79_HMR__",k=null,Pt=e=>{if(!k||!e.filename)return;let t=k.get(e.filename);t||k.set(e.filename,t=new Set),t.add(new WeakRef(e))},Oe=e=>{try{return new URL(e,document.baseURI).pathname}catch{return e}},Ie=(e,t)=>{if(!k)return 0;let n=Oe(e),s=re(t),r=0;for(let[o,i]of k)if(Oe(o)===n){for(let c of i){let l=c.deref();if(!l){i.delete(c);continue}l.hotReplace(s)&&r++}i.size||k.delete(o)}return r},We=()=>{k??(k=new Map),globalThis[Dt]={update:Ie}},F=class e{constructor(t,n={}){T(this,"template");T(this,"scripts");T(this,"styles");T(this,"modules");T(this,"filename");T(this,"data",null);T(this,"fx",null);T(this,"content",null);T(this,"startMarker",null);T(this,"endMarker",null);T(this,"styleEls",[]);T(this,"ownsSharedStyles",!1);T(this,"useShadow",!1);T(this,"mountRoot",null);T(this,"resolveMounted",null);T(this,"emitListeners",new Map);let s=typeof t=="string"?re(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),Pt(this)}hotReplace(t){let n=typeof t=="string"?re(t):t,s=this.startMarker,r=!!(s&&this.content),o=r&&s.isConnected,i=o?s.parentNode:null,c=o?this.endMarker.nextSibling:null,l={...this.data},d=this.useShadow;return r&&this.destroy(),this.template=n.template,this.scripts=n.scripts,this.styles=n.styles,!r||(this.renderWith(l,d),!i)?!1:(d&&this.styleEls.forEach(f=>i.insertBefore(f,c)),i.insertBefore(this.content,c),this.mountRoot=i,this.resolveMounted?.(),!0)}static async fetch(t){let n=await fetch(t);if(!n.ok)throw new Error(`failed to fetch component from ${t}: ${n.status}`);return new e(await n.text(),{filename:t})}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=q({...t}),r=B(s);this.data=s,this.fx=r,this.useShadow=n,this.startMarker=document.createComment("jq79"),this.endMarker=document.createComment("/jq79");let o=this.startMarker,i=(a,u)=>{let m=new CustomEvent(a,{detail:u,bubbles:!0,composed:!0}),S=o.dispatchEvent(m);return o===this.startMarker&&this.emitListeners.get(a)?.forEach(x=>x(m,u)),S},c,l=new Promise(a=>{c=a});this.resolveMounted=c;let d=()=>l,f=this.endMarker,p=a=>{let u=[];for(let m=o.nextSibling;m&&m!==f;m=m.nextSibling)m instanceof Element&&(m.matches(a)&&u.push(m),u.push(...Array.from(m.querySelectorAll(a))));return u},h=a=>p(a)[0]??null,y=this.modules,E=a=>y&&a in y?Promise.resolve(y[a]):le(a),v=a=>`await $mounted();${a}`;this.scripts.forEach((a,u)=>{let m={$emit:i,$mounted:d,$self:h,$$self:p},S={filename:this.filename,index:u},x=xe(a.content);if(x!==null){Le(s,$e(a.content));let w=":mounted"in a.attrs?v(x):x;jt(w,s,r.effect,m,E,S);return}let{vars:R,code:g}=ne(a.content);Le(s,se(a.attrs[":setup"])),R.forEach(w=>{w in s||(s[w]=void 0)});let b=":mounted"in a.attrs?v(g):g;Ot(b,s,r.effect,m,E,S)});let L=document.createDocumentFragment();return L.append(this.startMarker,ce(this.template,s,r,n),this.endMarker),this.content=L,n?this.styleEls=this.styles.map(a=>{let u=document.createElement("style");return u.textContent=a.content,u}):(this.styles.forEach(a=>vt(ve(a))),this.ownsSharedStyles=!0),this}mount(t,n){let s=typeof t=="string"?I(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"?I(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.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 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(){return this.detach(),this.fx?.dispose(),this.fx=null,this.data?.$dispose(),this.styleEls.forEach(t=>t.parentNode?.removeChild(t)),this.styleEls=[],this.ownsSharedStyles&&(this.styles.forEach(t=>Lt(ve(t))),this.ownsSharedStyles=!1),this.content=null,this.startMarker=null,this.endMarker=null,this.data=null,this.resolveMounted=null,this}},kt=e=>new F(e);typeof globalThis<"u"&&globalThis[Mt]&&We();return Ze(Ft);})();
11
12
  //# sourceMappingURL=jq79.global.js.map