Comparing version 4.4.6 to 4.4.7
@@ -25,3 +25,3 @@ 'use strict'; | ||
const { a: fragment, b: entries, c: direct } = parse(template, values); | ||
const root = fragment.cloneNode(true); | ||
const root = document.importNode(fragment, true); | ||
/** @type {import("./literals.js").Detail[]} */ | ||
@@ -28,0 +28,0 @@ let details = empty; |
@@ -119,2 +119,13 @@ 'use strict'; | ||
/** | ||
* Same as `document.importNode` | ||
* @template T | ||
* @param {T} externalNode | ||
* @param {boolean} deep | ||
* @returns {T} | ||
*/ | ||
importNode(externalNode, deep = false) { | ||
return externalNode.cloneNode(deep); | ||
} | ||
toString() { | ||
@@ -121,0 +132,0 @@ return this[childNodes].join(''); |
@@ -648,3 +648,3 @@ 'use strict'; | ||
const { a: fragment, b: entries, c: direct } = parse(template, values); | ||
const root = fragment.cloneNode(true); | ||
const root = document.importNode(fragment, true); | ||
/** @type {import("./literals.js").Detail[]} */ | ||
@@ -651,0 +651,0 @@ let details = empty; |
@@ -24,3 +24,3 @@ import { PersistentFragment } from './persistent-fragment.js'; | ||
const { a: fragment, b: entries, c: direct } = parse(template, values); | ||
const root = fragment.cloneNode(true); | ||
const root = document.importNode(fragment, true); | ||
/** @type {import("./literals.js").Detail[]} */ | ||
@@ -27,0 +27,0 @@ let details = empty; |
@@ -118,2 +118,13 @@ import { DOCUMENT_NODE } from 'domconstants/constants'; | ||
/** | ||
* Same as `document.importNode` | ||
* @template T | ||
* @param {T} externalNode | ||
* @param {boolean} deep | ||
* @returns {T} | ||
*/ | ||
importNode(externalNode, deep = false) { | ||
return externalNode.cloneNode(deep); | ||
} | ||
toString() { | ||
@@ -120,0 +131,0 @@ return this[childNodes].join(''); |
@@ -647,3 +647,3 @@ | ||
const { a: fragment, b: entries, c: direct } = parse(template, values); | ||
const root = fragment.cloneNode(true); | ||
const root = document.importNode(fragment, true); | ||
/** @type {import("./literals.js").Detail[]} */ | ||
@@ -650,0 +650,0 @@ let details = empty; |
@@ -1,2 +0,2 @@ | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:i}=Object;let o;var c=(e,t,n)=>(o||(o=s()),n?o.setStartAfter(e):o.setStartBefore(e),o.setEndAfter(t),o.deleteContents(),e);const a=({firstChild:e,lastChild:t},n)=>c(e,t,n);let u=!1;const h=(e,t)=>u&&11===e.nodeType?1/t<0?t?a(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,d=e=>document.createComment(e);class f extends((e=>{function t(e){return i(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=d("<>");#t=d("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const v=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},b=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},C=(e,t,n)=>e[n]=t,x=(e,t,n)=>C(e,t,n.slice(1)),w=(e,t,n)=>null==t?(g(e,n),t):C(e,t,n),$=(e,t)=>("function"==typeof t?t(e):t.current=e,t),y=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),O=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o-a],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,h,e);switch(n.length){case 1:n[0].remove();case 0:break;default:c(h(n[0],0),h(n.at(-1),-0),!1)}return r},k=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>w(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",$],["style",(e,t)=>null==t?w(e,t,"style"):C(e.style,t,"cssText")]]),A=(e,r,s)=>{switch(r[0]){case".":return x;case"?":return N;case"@":return v;default:return s||"ownerSVGElement"in e?"ref"===r?$:y:k.get(r)||(r in e?r.startsWith("on")?C:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?w:y:y)}},W=(e,t)=>(e.textContent=null==t?"":t,t),M=(e,t,n)=>({a:e,b:t,c:n}),S=()=>M(null,null,r),E=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var B=e=>(t,n)=>{const{a:s,b:l,c:i}=e(t,n),o=s.cloneNode(!0);let c=r;if(l!==r){c=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:i,c:f}=l[n],p=s===t?e:e=E(o,t=s);c[n]=(a=i,u=p,h=f,d=i===O?[]:i===b?S():null,{v:r,u:a,t:u,n:h,c:d})}}var a,u,h,d;return((e,t)=>({b:e,c:t}))(i?o.firstChild:new f(o),c)};const j=/^(?:plaintext|script|style|textarea|title|xmp)$/i,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||D.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?O:b;r===b&&t.push(i),c.push(M(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(M(e,A(i,t,s),t)),g(i,a),a=`${I}${l++}`}!s&&j.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(M(e||H(i),W,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,M(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case O:s.v=O(s.t,X(s.c,e),s.v);break;case b:const t=e instanceof Y?U(s.c||(s.c=S()),e):(s.c=null,e);t!==s.v&&(s.v=b(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=S()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=S()){return U(e,this)}}const ee=new WeakMap;var te=(e,t)=>{const n=ee.get(e)||l(ee,e,S()),{b:r}=n;return r!==("function"==typeof t?t():t).toDOM(n)&&e.replaceChildren(n.b.valueOf()),e}; | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:i}=Object;let o;var c=(e,t,n)=>(o||(o=s()),n?o.setStartAfter(e):o.setStartBefore(e),o.setEndAfter(t),o.deleteContents(),e);const a=({firstChild:e,lastChild:t},n)=>c(e,t,n);let u=!1;const h=(e,t)=>u&&11===e.nodeType?1/t<0?t?a(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,d=e=>document.createComment(e);class f extends((e=>{function t(e){return i(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=d("<>");#t=d("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const v=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},b=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},C=(e,t,n)=>e[n]=t,x=(e,t,n)=>C(e,t,n.slice(1)),w=(e,t,n)=>null==t?(g(e,n),t):C(e,t,n),$=(e,t)=>("function"==typeof t?t(e):t.current=e,t),y=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),O=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o-a],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,h,e);switch(n.length){case 1:n[0].remove();case 0:break;default:c(h(n[0],0),h(n.at(-1),-0),!1)}return r},k=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>w(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",$],["style",(e,t)=>null==t?w(e,t,"style"):C(e.style,t,"cssText")]]),A=(e,r,s)=>{switch(r[0]){case".":return x;case"?":return N;case"@":return v;default:return s||"ownerSVGElement"in e?"ref"===r?$:y:k.get(r)||(r in e?r.startsWith("on")?C:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?w:y:y)}},W=(e,t)=>(e.textContent=null==t?"":t,t),M=(e,t,n)=>({a:e,b:t,c:n}),S=()=>M(null,null,r),E=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var B=e=>(t,n)=>{const{a:s,b:l,c:i}=e(t,n),o=document.importNode(s,!0);let c=r;if(l!==r){c=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:i,c:f}=l[n],p=s===t?e:e=E(o,t=s);c[n]=(a=i,u=p,h=f,d=i===O?[]:i===b?S():null,{v:r,u:a,t:u,n:h,c:d})}}var a,u,h,d;return((e,t)=>({b:e,c:t}))(i?o.firstChild:new f(o),c)};const j=/^(?:plaintext|script|style|textarea|title|xmp)$/i,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||D.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?O:b;r===b&&t.push(i),c.push(M(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(M(e,A(i,t,s),t)),g(i,a),a=`${I}${l++}`}!s&&j.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(M(e||H(i),W,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,M(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case O:s.v=O(s.t,X(s.c,e),s.v);break;case b:const t=e instanceof Y?U(s.c||(s.c=S()),e):(s.c=null,e);t!==s.v&&(s.v=b(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=S()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=S()){return U(e,this)}}const ee=new WeakMap;var te=(e,t)=>{const n=ee.get(e)||l(ee,e,S()),{b:r}=n;return r!==("function"==typeof t?t():t).toDOM(n)&&e.replaceChildren(n.b.valueOf()),e}; | ||
/*! (c) Andrea Giammarchi - MIT */const ne=e=>(t,...n)=>new Y(e,t,n),re=ne(!1),se=ne(!0);export{Y as Hole,k as attr,re as html,te as render,se as svg}; |
@@ -1,4 +0,4 @@ | ||
var e=e=>function(t){const{constructor:n}=e.createDocumentFragment();const{isArray:r}=Array,{getPrototypeOf:s,getOwnPropertyDescriptor:l}=Object,i=[],o=()=>e.createRange(),a=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:c}=Object;let u;var h=(e,t,n)=>(u||(u=o()),n?u.setStartAfter(e):u.setStartBefore(e),u.setEndAfter(t),u.deleteContents(),e);const d=({firstChild:e,lastChild:t},n)=>h(e,t,n);let f=!1;const p=(e,t)=>f&&11===e.nodeType?1/t<0?t?d(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,g=t=>e.createComment(t);class v extends((e=>{function t(e){return c(e,new.target.prototype)}return t.prototype=e.prototype,t})(n)){#e=g("<>");#t=g("</>");#n=i;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),f=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){d(this,!1)}replaceWith(e){d(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===i&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const b=(e,t,n)=>e.setAttribute(t,n),m=(e,t)=>e.removeAttribute(t);let C;const w=(e,t,n)=>{n=n.slice(1),C||(C=new WeakMap);const s=C.get(e)||a(C,e,{});let l=s[n];return l&&l[0]&&e.removeEventListener(n,...l),l=r(t)?t:[t,!1],s[n]=l,l[0]&&e.addEventListener(n,...l),t},x=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},$=(e,t,n)=>e[n]=t,y=(e,t,n)=>$(e,t,n.slice(1)),N=(e,t,n)=>null==t?(m(e,n),t):$(e,t,n),O=(e,t)=>("function"==typeof t?t(e):t.current=e,t),k=(e,t,n)=>(null==t?m(e,n):b(e,n,t),t),A=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),M=(e,t,n)=>{const{length:r}=t;if(e.data=`[${r}]`,r)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,a=0,c=0,u=null;for(;a<i||c<o;)if(i===a){const t=o<l?c?r(n[c-1],-0).nextSibling:r(n[o-c],0):s;for(;c<o;)e.insertBefore(r(n[c++],1),t)}else if(o===c)for(;a<i;)u&&u.has(t[a])||e.removeChild(r(t[a],-1)),a++;else if(t[a]===n[c])a++,c++;else if(t[i-1]===n[o-1])i--,o--;else if(t[a]===n[o-1]&&n[c]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[c++],1),r(t[a++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=c;for(;e<o;)u.set(n[e],e++)}if(u.has(t[a])){const s=u.get(t[a]);if(c<s&&s<o){let l=a,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-c){const l=r(t[a],0);for(;c<s;)e.insertBefore(r(n[c++],1),l)}else e.replaceChild(r(n[c++],1),r(t[a++],-1))}else a++}else e.removeChild(r(t[a++],-1))}return n})(e.parentNode,n,t,p,e);switch(n.length){case 1:n[0].remove();case 0:break;default:h(p(n[0],0),p(n.at(-1),-0),!1)}return i},W=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?m(e,s):b(e,s,r)}return t}],["class",(e,t)=>N(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",O],["style",(e,t)=>null==t?N(e,t,"style"):$(e.style,t,"cssText")]]),S=(e,t,n)=>{switch(t[0]){case".":return y;case"?":return A;case"@":return w;default:return n||"ownerSVGElement"in e?"ref"===t?O:k:W.get(t)||(t in e?t.startsWith("on")?$:((e,t)=>{let n;do{n=l(e,t)}while(!n&&(e=s(e)));return n})(e,t)?.set?N:k:k)}},E=(e,t)=>(e.textContent=null==t?"":t,t),T=(e,t,n)=>({a:e,b:t,c:n}),B=()=>T(null,null,i),D=(e,t)=>t.reduceRight(j,e),j=(e,t)=>e.childNodes[t];var F=e=>(t,n)=>{const{a:r,b:s,c:l}=e(t,n),o=r.cloneNode(!0);let a=i;if(s!==i){a=[];for(let e,t,n=0;n<s.length;n++){const{a:r,b:l,c:f}=s[n],p=r===t?e:e=D(o,t=r);a[n]=(c=l,u=p,h=f,d=l===M?[]:l===x?B():null,{v:i,u:c,t:u,n:h,c:d})}}var c,u,h,d;return((e,t)=>({b:e,c:t}))(l?o.firstChild:new v(o),a)};const L=/^(?:plaintext|script|style|textarea|title|xmp)$/i,P=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,z=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,H=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,R=/[\x01\x02]/g;let Z,G,V=e.createElement("template");var _=(t,n)=>{if(n)return Z||(Z=e.createElementNS("http://www.w3.org/2000/svg","svg"),G=o(),G.selectNodeContents(Z)),G.createContextualFragment(t);V.innerHTML=t;const{content:r}=V;return V=V.cloneNode(!1),r};const q=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},I=()=>e.createTextNode(""),J=(t,n,s)=>{const l=_(((e,t,n)=>{let r=0;return e.join("").trim().replace(z,((e,t,r,s)=>`<${t}${r.replace(H,"=$2$1").trimEnd()}${s?n||P.test(t)?" /":`></${t}`:""}>`)).replace(R,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,Q,s),s),{length:o}=t;let c=i;if(o>1){const t=[],i=e.createTreeWalker(l,129);let a=0,u=`${Q}${a++}`;for(c=[];a<o;){const e=i.nextNode();if(8===e.nodeType){if(e.data===u){const s=r(n[a-1])?M:x;s===x&&t.push(e),c.push(T(q(e),s,null)),u=`${Q}${a++}`}}else{let t;for(;e.hasAttribute(u);){t||(t=q(e));const n=e.getAttribute(u);c.push(T(t,S(e,n,s),n)),m(e,u),u=`${Q}${a++}`}!s&&L.test(e.localName)&&e.textContent.trim()===`\x3c!--${u}--\x3e`&&(c.push(T(t||q(e),E,null)),u=`${Q}${a++}`)}}for(a=0;a<t.length;a++)t[a].replaceWith(I())}const{childNodes:u}=l;let{length:h}=u;return h<1?(h=1,l.appendChild(I())):1===h&&1!==o&&1!==u[0].nodeType&&(h=0),a(K,t,T(l,c,1===h))},K=new WeakMap,Q="isµ";var U=e=>(t,n)=>K.get(t)||J(t,n,e);const X=F(U(!1)),Y=F(U(!0)),ee=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Y:X)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case M:s.v=M(s.t,te(s.c,e),s.v);break;case x:const t=e instanceof ne?ee(s.c||(s.c=B()),e):(s.c=null,e);t!==s.v&&(s.v=x(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},te=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof ne?t[n]=ee(e[n]||(e[n]=B()),r):e[n]=null}return t};class ne{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=B()){return ee(e,this)}} | ||
var e=e=>function(t){const{constructor:n}=e.createDocumentFragment();const{isArray:r}=Array,{getPrototypeOf:s,getOwnPropertyDescriptor:l}=Object,i=[],o=()=>e.createRange(),a=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:c}=Object;let u;var h=(e,t,n)=>(u||(u=o()),n?u.setStartAfter(e):u.setStartBefore(e),u.setEndAfter(t),u.deleteContents(),e);const d=({firstChild:e,lastChild:t},n)=>h(e,t,n);let f=!1;const p=(e,t)=>f&&11===e.nodeType?1/t<0?t?d(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,g=t=>e.createComment(t);class v extends((e=>{function t(e){return c(e,new.target.prototype)}return t.prototype=e.prototype,t})(n)){#e=g("<>");#t=g("</>");#n=i;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),f=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){d(this,!1)}replaceWith(e){d(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===i&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const b=(e,t,n)=>e.setAttribute(t,n),m=(e,t)=>e.removeAttribute(t);let C;const w=(e,t,n)=>{n=n.slice(1),C||(C=new WeakMap);const s=C.get(e)||a(C,e,{});let l=s[n];return l&&l[0]&&e.removeEventListener(n,...l),l=r(t)?t:[t,!1],s[n]=l,l[0]&&e.addEventListener(n,...l),t},x=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},$=(e,t,n)=>e[n]=t,y=(e,t,n)=>$(e,t,n.slice(1)),N=(e,t,n)=>null==t?(m(e,n),t):$(e,t,n),O=(e,t)=>("function"==typeof t?t(e):t.current=e,t),k=(e,t,n)=>(null==t?m(e,n):b(e,n,t),t),A=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),M=(e,t,n)=>{const{length:r}=t;if(e.data=`[${r}]`,r)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,a=0,c=0,u=null;for(;a<i||c<o;)if(i===a){const t=o<l?c?r(n[c-1],-0).nextSibling:r(n[o-c],0):s;for(;c<o;)e.insertBefore(r(n[c++],1),t)}else if(o===c)for(;a<i;)u&&u.has(t[a])||e.removeChild(r(t[a],-1)),a++;else if(t[a]===n[c])a++,c++;else if(t[i-1]===n[o-1])i--,o--;else if(t[a]===n[o-1]&&n[c]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[c++],1),r(t[a++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=c;for(;e<o;)u.set(n[e],e++)}if(u.has(t[a])){const s=u.get(t[a]);if(c<s&&s<o){let l=a,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-c){const l=r(t[a],0);for(;c<s;)e.insertBefore(r(n[c++],1),l)}else e.replaceChild(r(n[c++],1),r(t[a++],-1))}else a++}else e.removeChild(r(t[a++],-1))}return n})(e.parentNode,n,t,p,e);switch(n.length){case 1:n[0].remove();case 0:break;default:h(p(n[0],0),p(n.at(-1),-0),!1)}return i},W=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?m(e,s):b(e,s,r)}return t}],["class",(e,t)=>N(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",O],["style",(e,t)=>null==t?N(e,t,"style"):$(e.style,t,"cssText")]]),S=(e,t,n)=>{switch(t[0]){case".":return y;case"?":return A;case"@":return w;default:return n||"ownerSVGElement"in e?"ref"===t?O:k:W.get(t)||(t in e?t.startsWith("on")?$:((e,t)=>{let n;do{n=l(e,t)}while(!n&&(e=s(e)));return n})(e,t)?.set?N:k:k)}},E=(e,t)=>(e.textContent=null==t?"":t,t),T=(e,t,n)=>({a:e,b:t,c:n}),B=()=>T(null,null,i),D=(e,t)=>t.reduceRight(j,e),j=(e,t)=>e.childNodes[t];var F=t=>(n,r)=>{const{a:s,b:l,c:o}=t(n,r),a=e.importNode(s,!0);let c=i;if(l!==i){c=[];for(let e,t,n=0;n<l.length;n++){const{a:r,b:s,c:o}=l[n],p=r===t?e:e=D(a,t=r);c[n]=(u=s,h=p,d=o,f=s===M?[]:s===x?B():null,{v:i,u:u,t:h,n:d,c:f})}}var u,h,d,f;return((e,t)=>({b:e,c:t}))(o?a.firstChild:new v(a),c)};const L=/^(?:plaintext|script|style|textarea|title|xmp)$/i,P=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,z=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,H=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,R=/[\x01\x02]/g;let Z,G,V=e.createElement("template");var _=(t,n)=>{if(n)return Z||(Z=e.createElementNS("http://www.w3.org/2000/svg","svg"),G=o(),G.selectNodeContents(Z)),G.createContextualFragment(t);V.innerHTML=t;const{content:r}=V;return V=V.cloneNode(!1),r};const q=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},I=()=>e.createTextNode(""),J=(t,n,s)=>{const l=_(((e,t,n)=>{let r=0;return e.join("").trim().replace(z,((e,t,r,s)=>`<${t}${r.replace(H,"=$2$1").trimEnd()}${s?n||P.test(t)?" /":`></${t}`:""}>`)).replace(R,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,Q,s),s),{length:o}=t;let c=i;if(o>1){const t=[],i=e.createTreeWalker(l,129);let a=0,u=`${Q}${a++}`;for(c=[];a<o;){const e=i.nextNode();if(8===e.nodeType){if(e.data===u){const s=r(n[a-1])?M:x;s===x&&t.push(e),c.push(T(q(e),s,null)),u=`${Q}${a++}`}}else{let t;for(;e.hasAttribute(u);){t||(t=q(e));const n=e.getAttribute(u);c.push(T(t,S(e,n,s),n)),m(e,u),u=`${Q}${a++}`}!s&&L.test(e.localName)&&e.textContent.trim()===`\x3c!--${u}--\x3e`&&(c.push(T(t||q(e),E,null)),u=`${Q}${a++}`)}}for(a=0;a<t.length;a++)t[a].replaceWith(I())}const{childNodes:u}=l;let{length:h}=u;return h<1?(h=1,l.appendChild(I())):1===h&&1!==o&&1!==u[0].nodeType&&(h=0),a(K,t,T(l,c,1===h))},K=new WeakMap,Q="isµ";var U=e=>(t,n)=>K.get(t)||J(t,n,e);const X=F(U(!1)),Y=F(U(!0)),ee=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Y:X)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case M:s.v=M(s.t,te(s.c,e),s.v);break;case x:const t=e instanceof ne?ee(s.c||(s.c=B()),e):(s.c=null,e);t!==s.v&&(s.v=x(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},te=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof ne?t[n]=ee(e[n]||(e[n]=B()),r):e[n]=null}return t};class ne{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=B()){return ee(e,this)}} | ||
/*! (c) Andrea Giammarchi - MIT */const re=e=>(t,...n)=>new ne(e,t,n),se=re(!1),le=re(!0),ie=new WeakMap; | ||
/*! (c) Andrea Giammarchi - MIT */ | ||
const oe=new WeakMap,ae=e=>(t,n)=>{const r=oe.get(t)||a(oe,t,new Map);return r.get(n)||a(r,n,function(t,...n){return new ne(e,t,n).toDOM(this)}.bind(B()))},ce=ae(!1),ue=ae(!0);return t.Hole=ne,t.attr=W,t.html=se,t.htmlFor=ce,t.render=(e,t)=>((e,t,n)=>{const r=ie.get(e)||a(ie,e,B()),{b:s}=r,l=n&&"function"==typeof t?t():t,i=l instanceof ne?l.toDOM(r):l;return s!==i&&e.replaceChildren((r.b=i).valueOf()),e})(e,t,!0),t.svg=le,t.svgFor=ue,t}({});export{e as default}; |
@@ -1,3 +0,3 @@ | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:i}=Object;let o;var c=(e,t,n)=>(o||(o=s()),n?o.setStartAfter(e):o.setStartBefore(e),o.setEndAfter(t),o.deleteContents(),e);const a=({firstChild:e,lastChild:t},n)=>c(e,t,n);let u=!1;const h=(e,t)=>u&&11===e.nodeType?1/t<0?t?a(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,d=e=>document.createComment(e);class f extends((e=>{function t(e){return i(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=d("<>");#t=d("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const b=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},v=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},C=(e,t,n)=>e[n]=t,w=(e,t,n)=>C(e,t,n.slice(1)),x=(e,t,n)=>null==t?(g(e,n),t):C(e,t,n),$=(e,t)=>("function"==typeof t?t(e):t.current=e,t),y=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),O=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o-a],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,h,e);switch(n.length){case 1:n[0].remove();case 0:break;default:c(h(n[0],0),h(n.at(-1),-0),!1)}return r},k=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>x(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",$],["style",(e,t)=>null==t?x(e,t,"style"):C(e.style,t,"cssText")]]),A=(e,r,s)=>{switch(r[0]){case".":return w;case"?":return N;case"@":return b;default:return s||"ownerSVGElement"in e?"ref"===r?$:y:k.get(r)||(r in e?r.startsWith("on")?C:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?x:y:y)}},M=(e,t)=>(e.textContent=null==t?"":t,t),W=(e,t,n)=>({a:e,b:t,c:n}),S=()=>W(null,null,r),E=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var B=e=>(t,n)=>{const{a:s,b:l,c:i}=e(t,n),o=s.cloneNode(!0);let c=r;if(l!==r){c=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:i,c:f}=l[n],p=s===t?e:e=E(o,t=s);c[n]=(a=i,u=p,h=f,d=i===O?[]:i===v?S():null,{v:r,u:a,t:u,n:h,c:d})}}var a,u,h,d;return((e,t)=>({b:e,c:t}))(i?o.firstChild:new f(o),c)};const D=/^(?:plaintext|script|style|textarea|title|xmp)$/i,j=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||j.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?O:v;r===v&&t.push(i),c.push(W(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(W(e,A(i,t,s),t)),g(i,a),a=`${I}${l++}`}!s&&D.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(W(e||H(i),M,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,W(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case O:s.v=O(s.t,X(s.c,e),s.v);break;case v:const t=e instanceof Y?U(s.c||(s.c=S()),e):(s.c=null,e);t!==s.v&&(s.v=v(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=S()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=S()){return U(e,this)}} | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:i}=Object;let o;var c=(e,t,n)=>(o||(o=s()),n?o.setStartAfter(e):o.setStartBefore(e),o.setEndAfter(t),o.deleteContents(),e);const a=({firstChild:e,lastChild:t},n)=>c(e,t,n);let u=!1;const h=(e,t)=>u&&11===e.nodeType?1/t<0?t?a(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,d=e=>document.createComment(e);class f extends((e=>{function t(e){return i(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=d("<>");#t=d("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const b=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},v=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},C=(e,t,n)=>e[n]=t,w=(e,t,n)=>C(e,t,n.slice(1)),x=(e,t,n)=>null==t?(g(e,n),t):C(e,t,n),$=(e,t)=>("function"==typeof t?t(e):t.current=e,t),y=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),O=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o-a],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,h,e);switch(n.length){case 1:n[0].remove();case 0:break;default:c(h(n[0],0),h(n.at(-1),-0),!1)}return r},k=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>x(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",$],["style",(e,t)=>null==t?x(e,t,"style"):C(e.style,t,"cssText")]]),A=(e,r,s)=>{switch(r[0]){case".":return w;case"?":return N;case"@":return b;default:return s||"ownerSVGElement"in e?"ref"===r?$:y:k.get(r)||(r in e?r.startsWith("on")?C:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?x:y:y)}},M=(e,t)=>(e.textContent=null==t?"":t,t),W=(e,t,n)=>({a:e,b:t,c:n}),S=()=>W(null,null,r),E=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var B=e=>(t,n)=>{const{a:s,b:l,c:i}=e(t,n),o=document.importNode(s,!0);let c=r;if(l!==r){c=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:i,c:f}=l[n],p=s===t?e:e=E(o,t=s);c[n]=(a=i,u=p,h=f,d=i===O?[]:i===v?S():null,{v:r,u:a,t:u,n:h,c:d})}}var a,u,h,d;return((e,t)=>({b:e,c:t}))(i?o.firstChild:new f(o),c)};const D=/^(?:plaintext|script|style|textarea|title|xmp)$/i,j=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||j.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?O:v;r===v&&t.push(i),c.push(W(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(W(e,A(i,t,s),t)),g(i,a),a=`${I}${l++}`}!s&&D.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(W(e||H(i),M,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,W(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case O:s.v=O(s.t,X(s.c,e),s.v);break;case v:const t=e instanceof Y?U(s.c||(s.c=S()),e):(s.c=null,e);t!==s.v&&(s.v=v(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=S()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=S()){return U(e,this)}} | ||
/*! (c) Andrea Giammarchi - MIT */const ee=e=>(t,...n)=>new Y(e,t,n),te=ee(!1),ne=ee(!0),re=new WeakMap;var se=(e,t)=>((e,t,n)=>{const r=re.get(e)||l(re,e,S()),{b:s}=r,i=n&&"function"==typeof t?t():t,o=i instanceof Y?i.toDOM(r):i;return s!==o&&e.replaceChildren((r.b=o).valueOf()),e})(e,t,!0) | ||
/*! (c) Andrea Giammarchi - MIT */;const le=new WeakMap,ie=e=>(t,n)=>{const r=le.get(t)||l(le,t,new Map);return r.get(n)||l(r,n,function(t,...n){return new Y(e,t,n).toDOM(this)}.bind(S()))},oe=ie(!1),ce=ie(!0);export{Y as Hole,k as attr,te as html,oe as htmlFor,se as render,ne as svg,ce as svgFor}; |
@@ -1,2 +0,2 @@ | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:i}=Object;let o;var c=(e,t,n)=>(o||(o=s()),n?o.setStartAfter(e):o.setStartBefore(e),o.setEndAfter(t),o.deleteContents(),e);const a=({firstChild:e,lastChild:t},n)=>c(e,t,n);let u=!1;const h=(e,t)=>u&&11===e.nodeType?1/t<0?t?a(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,d=e=>document.createComment(e);class f extends((e=>{function t(e){return i(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=d("<>");#t=d("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const v=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},C=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},b=(e,t,n)=>e[n]=t,x=(e,t,n)=>b(e,t,n.slice(1)),$=(e,t,n)=>null==t?(g(e,n),t):b(e,t,n),w=(e,t)=>("function"==typeof t?t(e):t.current=e,t),y=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),O=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o-a],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,h,e);switch(n.length){case 1:n[0].remove();case 0:break;default:c(h(n[0],0),h(n.at(-1),-0),!1)}return r},A=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>$(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",w],["style",(e,t)=>null==t?$(e,t,"style"):b(e.style,t,"cssText")]]),k=(e,r,s)=>{switch(r[0]){case".":return x;case"?":return N;case"@":return v;default:return s||"ownerSVGElement"in e?"ref"===r?w:y:A.get(r)||(r in e?r.startsWith("on")?b:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?$:y:y)}},W=(e,t)=>(e.textContent=null==t?"":t,t),S=(e,t,n)=>({a:e,b:t,c:n}),E=()=>S(null,null,r),M=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var B=e=>(t,n)=>{const{a:s,b:l,c:i}=e(t,n),o=s.cloneNode(!0);let c=r;if(l!==r){c=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:i,c:f}=l[n],p=s===t?e:e=M(o,t=s);c[n]=(a=i,u=p,h=f,d=i===O?[]:i===C?E():null,{v:r,u:a,t:u,n:h,c:d})}}var a,u,h,d;return((e,t)=>({b:e,c:t}))(i?o.firstChild:new f(o),c)};const j=/^(?:plaintext|script|style|textarea|title|xmp)$/i,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||D.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?O:C;r===C&&t.push(i),c.push(S(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(S(e,k(i,t,s),t)),g(i,a),a=`${I}${l++}`}!s&&j.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(S(e||H(i),W,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,S(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case O:s.v=O(s.t,X(s.c,e),s.v);break;case C:const t=e instanceof Y?U(s.c||(s.c=E()),e):(s.c=null,e);t!==s.v&&(s.v=C(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=E()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=E()){return U(e,this)}} | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:i}=Object;let o;var c=(e,t,n)=>(o||(o=s()),n?o.setStartAfter(e):o.setStartBefore(e),o.setEndAfter(t),o.deleteContents(),e);const a=({firstChild:e,lastChild:t},n)=>c(e,t,n);let u=!1;const h=(e,t)=>u&&11===e.nodeType?1/t<0?t?a(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,d=e=>document.createComment(e);class f extends((e=>{function t(e){return i(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=d("<>");#t=d("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const v=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let i=s[r];return i&&i[0]&&t.removeEventListener(r,...i),i=e(n)?n:[n,!1],s[r]=i,i[0]&&t.addEventListener(r,...i),n},C=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},b=(e,t,n)=>e[n]=t,x=(e,t,n)=>b(e,t,n.slice(1)),$=(e,t,n)=>null==t?(g(e,n),t):b(e,t,n),w=(e,t)=>("function"==typeof t?t(e):t.current=e,t),y=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),O=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let i=t.length,o=l,c=0,a=0,u=null;for(;c<i||a<o;)if(i===c){const t=o<l?a?r(n[a-1],-0).nextSibling:r(n[o-a],0):s;for(;a<o;)e.insertBefore(r(n[a++],1),t)}else if(o===a)for(;c<i;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[i-1]===n[o-1])i--,o--;else if(t[c]===n[o-1]&&n[a]===t[i-1]){const s=r(t[--i],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--o],1),s),t[i]=n[o]}else{if(!u){u=new Map;let e=a;for(;e<o;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<o){let l=c,h=1;for(;++l<i&&l<o&&u.get(t[l])===s+h;)h++;if(h>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,h,e);switch(n.length){case 1:n[0].remove();case 0:break;default:c(h(n[0],0),h(n.at(-1),-0),!1)}return r},A=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>$(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",w],["style",(e,t)=>null==t?$(e,t,"style"):b(e.style,t,"cssText")]]),k=(e,r,s)=>{switch(r[0]){case".":return x;case"?":return N;case"@":return v;default:return s||"ownerSVGElement"in e?"ref"===r?w:y:A.get(r)||(r in e?r.startsWith("on")?b:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?$:y:y)}},W=(e,t)=>(e.textContent=null==t?"":t,t),S=(e,t,n)=>({a:e,b:t,c:n}),E=()=>S(null,null,r),M=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var B=e=>(t,n)=>{const{a:s,b:l,c:i}=e(t,n),o=document.importNode(s,!0);let c=r;if(l!==r){c=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:i,c:f}=l[n],p=s===t?e:e=M(o,t=s);c[n]=(a=i,u=p,h=f,d=i===O?[]:i===C?E():null,{v:r,u:a,t:u,n:h,c:d})}}var a,u,h,d;return((e,t)=>({b:e,c:t}))(i?o.firstChild:new f(o),c)};const j=/^(?:plaintext|script|style|textarea|title|xmp)$/i,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,L=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,P=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,R,Z=document.createElement("template");var G=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),R=s(),R.selectNodeContents(F)),R.createContextualFragment(e);Z.innerHTML=e;const{content:n}=Z;return Z=Z.cloneNode(!1),n};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const i=G(((e,t,n)=>{let r=0;return e.join("").trim().replace(L,((e,t,r,s)=>`<${t}${r.replace(P,"=$2$1").trimEnd()}${s?n||D.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:o}=t;let c=r;if(o>1){const t=[],r=document.createTreeWalker(i,129);let l=0,a=`${I}${l++}`;for(c=[];l<o;){const i=r.nextNode();if(8===i.nodeType){if(i.data===a){const r=e(n[l-1])?O:C;r===C&&t.push(i),c.push(S(H(i),r,null)),a=`${I}${l++}`}}else{let e;for(;i.hasAttribute(a);){e||(e=H(i));const t=i.getAttribute(a);c.push(S(e,k(i,t,s),t)),g(i,a),a=`${I}${l++}`}!s&&j.test(i.localName)&&i.textContent.trim()===`\x3c!--${a}--\x3e`&&(c.push(S(e||H(i),W,null)),a=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:a}=i;let{length:u}=a;return u<1?(u=1,i.appendChild(V())):1===u&&1!==o&&1!==a[0].nodeType&&(u=0),l(q,t,S(i,c,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=B(J(!1)),Q=B(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case O:s.v=O(s.t,X(s.c,e),s.v);break;case C:const t=e instanceof Y?U(s.c||(s.c=E()),e):(s.c=null,e);t!==s.v&&(s.v=C(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=E()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=E()){return U(e,this)}} | ||
/*! (c) Andrea Giammarchi - MIT */const ee=e=>(t,...n)=>new Y(e,t,n).toDOM().valueOf(),te=ee(!1),ne=ee(!0),re=(e,t)=>(e.replaceChildren("function"==typeof t?t():t),e);export{A as attr,te as html,re as render,ne as svg}; |
{ | ||
"name": "uhtml", | ||
"version": "4.4.6", | ||
"version": "4.4.7", | ||
"description": "A micro HTML/SVG render", | ||
@@ -5,0 +5,0 @@ "main": "./cjs/index.js", |
@@ -1,3 +0,3 @@ | ||
function t(){throw new Error("Cycle detected")}const e=Symbol.for("preact-signals");function i(){if(l>1)return void l--;let t,e=!1;for(;void 0!==o;){let i=o;for(o=void 0,h++;void 0!==i;){const n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&p(i))try{i.c()}catch(i){e||(t=i,e=!0)}i=n}}if(h=0,l--,e)throw t}function n(t){if(l>0)return t();l++;try{return t()}finally{i()}}let r,o,s=0;function c(t){if(s>0)return t();const e=r;r=void 0,s++;try{return t()}finally{s--,r=e}}let l=0,h=0,f=0;function u(t){if(void 0===r)return;let e=t.n;return void 0===e||e.t!==r?(e={i:0,S:t,p:r.s,n:void 0,t:r,e:void 0,x:void 0,r:e},void 0!==r.s&&(r.s.n=e),r.s=e,t.n=e,32&r.f&&t.S(e),e):-1===e.i?(e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=r.s,e.n=void 0,r.s.n=e,r.s=e),e):void 0}function a(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function d(t){return new a(t)}function p(t){for(let e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function v(t){for(let e=t.s;void 0!==e;e=e.n){const i=e.S.n;if(void 0!==i&&(e.r=i),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function y(t){let e,i=t.s;for(;void 0!==i;){const t=i.p;-1===i.i?(i.S.U(i),void 0!==t&&(t.n=i.n),void 0!==i.n&&(i.n.p=t)):e=i,i.S.n=i.r,void 0!==i.r&&(i.r=void 0),i=t}t.s=e}function g(t){a.call(this,void 0),this.x=t,this.s=void 0,this.g=f-1,this.f=4}function b(t){return new g(t)}function w(t){const e=t.u;if(t.u=void 0,"function"==typeof e){l++;const n=r;r=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,m(t),e}finally{r=n,i()}}}function m(t){for(let e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,w(t)}function x(t){if(r!==this)throw new Error("Out-of-order effect");y(this),r=t,this.f&=-2,8&this.f&&m(this),i()}function C(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function S(t){const e=new C(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}a.prototype.brand=e,a.prototype.h=function(){return!0},a.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},a.prototype.U=function(t){if(void 0!==this.t){const e=t.e,i=t.x;void 0!==e&&(e.x=i,t.e=void 0),void 0!==i&&(i.e=e,t.x=void 0),t===this.t&&(this.t=i)}},a.prototype.subscribe=function(t){const e=this;return S((function(){const i=e.value,n=32&this.f;this.f&=-33;try{t(i)}finally{this.f|=n}}))},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return this.value+""},a.prototype.toJSON=function(){return this.value},a.prototype.peek=function(){return this.v},Object.defineProperty(a.prototype,"value",{get(){const t=u(this);return void 0!==t&&(t.i=this.i),this.v},set(e){if(r instanceof g&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){h>100&&t(),this.v=e,this.i++,f++,l++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{i()}}}}),(g.prototype=new a).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===f)return!0;if(this.g=f,this.f|=1,this.i>0&&!p(this))return this.f&=-2,!0;const t=r;try{v(this),r=this;const t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return r=t,y(this),this.f&=-2,!0},g.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}a.prototype.S.call(this,t)},g.prototype.U=function(t){if(void 0!==this.t&&(a.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}},g.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}},g.prototype.peek=function(){if(this.h()||t(),16&this.f)throw this.v;return this.v},Object.defineProperty(g.prototype,"value",{get(){1&this.f&&t();const e=u(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),C.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();"function"==typeof t&&(this.u=t)}finally{t()}},C.prototype.S=function(){1&this.f&&t(),this.f|=1,this.f&=-9,w(this),v(this),l++;const e=r;return r=this,x.bind(this,e)},C.prototype.N=function(){2&this.f||(this.f|=2,this.o=o,o=this)},C.prototype.d=function(){this.f|=8,1&this.f||m(this)};const{isArray:N}=Array,{getPrototypeOf:$,getOwnPropertyDescriptor:k}=Object,O=[],W=()=>document.createRange(),M=(t,e,i)=>(t.set(e,i),i),{setPrototypeOf:A}=Object;let E;var j=(t,e,i)=>(E||(E=W()),i?E.setStartAfter(t):E.setStartBefore(t),E.setEndAfter(e),E.deleteContents(),t);const T=({firstChild:t,lastChild:e},i)=>j(t,e,i);let P=!1;const U=(t,e)=>P&&11===t.nodeType?1/e<0?e?T(t,!0):t.lastChild:e?t.valueOf():t.firstChild:t,B=t=>document.createComment(t);class D extends((t=>{function e(t){return A(t,new.target.prototype)}return e.prototype=t.prototype,e})(DocumentFragment)){#t=B("<>");#e=B("</>");#i=O;constructor(t){super(t),this.replaceChildren(this.#t,...t.childNodes,this.#e),P=!0}get firstChild(){return this.#t}get lastChild(){return this.#e}get parentNode(){return this.#t.parentNode}remove(){T(this,!1)}replaceWith(t){T(this,!0).replaceWith(t)}valueOf(){let{firstChild:t,lastChild:e,parentNode:i}=this;if(i===this)this.#i===O&&(this.#i=[...this.childNodes]);else{if(i)for(this.#i=[t];t!==e;)this.#i.push(t=t.nextSibling);this.replaceChildren(...this.#i)}return this}}const R=(t,e,i)=>t.setAttribute(e,i),z=(t,e)=>t.removeAttribute(e);let F;const L=(t,e,i)=>{i=i.slice(1),F||(F=new WeakMap);const n=F.get(t)||M(F,t,{});let r=n[i];return r&&r[0]&&t.removeEventListener(i,...r),r=N(e)?e:[e,!1],n[i]=r,r[0]&&t.addEventListener(i,...r),e},H=(t,e)=>{const{t:i,n:n}=t;let r=!1;switch(typeof e){case"object":if(null!==e){(n||i).replaceWith(t.n=e.valueOf());break}case"undefined":r=!0;default:i.data=r?"":e,n&&(t.n=null,n.replaceWith(i))}return e},Z=(t,e,i)=>t[i]=e,G=(t,e,i)=>Z(t,e,i.slice(1)),J=(t,e,i)=>null==e?(z(t,i),e):Z(t,e,i),V=(t,e)=>("function"==typeof e?e(t):e.current=t,e),_=(t,e,i)=>(null==e?z(t,i):R(t,i,e),e),q=(t,e,i)=>(t.toggleAttribute(i.slice(1),e),e),I=(t,e,i)=>{const{length:n}=e;if(t.data=`[${n}]`,n)return((t,e,i,n,r)=>{const o=i.length;let s=e.length,c=o,l=0,h=0,f=null;for(;l<s||h<c;)if(s===l){const e=c<o?h?n(i[h-1],-0).nextSibling:n(i[c-h],0):r;for(;h<c;)t.insertBefore(n(i[h++],1),e)}else if(c===h)for(;l<s;)f&&f.has(e[l])||t.removeChild(n(e[l],-1)),l++;else if(e[l]===i[h])l++,h++;else if(e[s-1]===i[c-1])s--,c--;else if(e[l]===i[c-1]&&i[h]===e[s-1]){const r=n(e[--s],-1).nextSibling;t.insertBefore(n(i[h++],1),n(e[l++],-1).nextSibling),t.insertBefore(n(i[--c],1),r),e[s]=i[c]}else{if(!f){f=new Map;let t=h;for(;t<c;)f.set(i[t],t++)}if(f.has(e[l])){const r=f.get(e[l]);if(h<r&&r<c){let o=l,u=1;for(;++o<s&&o<c&&f.get(e[o])===r+u;)u++;if(u>r-h){const o=n(e[l],0);for(;h<r;)t.insertBefore(n(i[h++],1),o)}else t.replaceChild(n(i[h++],1),n(e[l++],-1))}else l++}else t.removeChild(n(e[l++],-1))}return i})(t.parentNode,i,e,U,t);switch(i.length){case 1:i[0].remove();case 0:break;default:j(U(i[0],0),U(i.at(-1),-0),!1)}return O},K=new Map([["aria",(t,e)=>{for(const i in e){const n=e[i],r="role"===i?i:`aria-${i}`;null==n?z(t,r):R(t,r,n)}return e}],["class",(t,e)=>J(t,e,null==e?"class":"className")],["data",(t,e)=>{const{dataset:i}=t;for(const t in e)null==e[t]?delete i[t]:i[t]=e[t];return e}],["ref",V],["style",(t,e)=>null==e?J(t,e,"style"):Z(t.style,e,"cssText")]]),Q=(t,e,i)=>{switch(e[0]){case".":return G;case"?":return q;case"@":return L;default:return i||"ownerSVGElement"in t?"ref"===e?V:_:K.get(e)||(e in t?e.startsWith("on")?Z:((t,e)=>{let i;do{i=k(t,e)}while(!i&&(t=$(t)));return i})(t,e)?.set?J:_:_)}},X=(t,e)=>(t.textContent=null==e?"":e,e),Y=(t,e,i)=>({a:t,b:e,c:i}),tt=(t,e,i,n)=>({v:O,u:t,t:e,n:i,c:n}),et=()=>Y(null,null,O),it=(t,e)=>e.reduceRight(nt,t),nt=(t,e)=>t.childNodes[e];var rt=t=>(e,i)=>{const{a:n,b:r,c:o}=t(e,i),s=n.cloneNode(!0);let c=O;if(r!==O){c=[];for(let t,e,i=0;i<r.length;i++){const{a:n,b:o,c:l}=r[i],h=n===e?t:t=it(s,e=n);c[i]=tt(o,h,l,o===I?[]:o===H?et():null)}}return((t,e)=>({b:t,c:e}))(o?s.firstChild:new D(s),c)};const ot=/^(?:plaintext|script|style|textarea|title|xmp)$/i,st=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,ct=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,lt=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,ht=/[\x01\x02]/g;let ft,ut,at=document.createElement("template");var dt=(t,e)=>{if(e)return ft||(ft=document.createElementNS("http://www.w3.org/2000/svg","svg"),ut=W(),ut.selectNodeContents(ft)),ut.createContextualFragment(t);at.innerHTML=t;const{content:i}=at;return at=at.cloneNode(!1),i};const pt=t=>{const e=[];let i;for(;i=t.parentNode;)e.push(e.indexOf.call(i.childNodes,t)),t=i;return e},vt=()=>document.createTextNode(""),yt=(t,e,i)=>{const n=dt(((t,e,i)=>{let n=0;return t.join("").trim().replace(ct,((t,e,n,r)=>`<${e}${n.replace(lt,"=$2$1").trimEnd()}${r?i||st.test(e)?" /":`></${e}`:""}>`)).replace(ht,(t=>""===t?`\x3c!--${e+n++}--\x3e`:e+n++))})(t,bt,i),i),{length:r}=t;let o=O;if(r>1){const t=[],s=document.createTreeWalker(n,129);let c=0,l=`${bt}${c++}`;for(o=[];c<r;){const n=s.nextNode();if(8===n.nodeType){if(n.data===l){const i=N(e[c-1])?I:H;i===H&&t.push(n),o.push(Y(pt(n),i,null)),l=`${bt}${c++}`}}else{let t;for(;n.hasAttribute(l);){t||(t=pt(n));const e=n.getAttribute(l);o.push(Y(t,Q(n,e,i),e)),z(n,l),l=`${bt}${c++}`}!i&&ot.test(n.localName)&&n.textContent.trim()===`\x3c!--${l}--\x3e`&&(o.push(Y(t||pt(n),X,null)),l=`${bt}${c++}`)}}for(c=0;c<t.length;c++)t[c].replaceWith(vt())}const{childNodes:s}=n;let{length:c}=s;return c<1?(c=1,n.appendChild(vt())):1===c&&1!==r&&1!==s[0].nodeType&&(c=0),M(gt,t,Y(n,o,1===c))},gt=new WeakMap,bt="isµ";var wt=t=>(e,i)=>gt.get(e)||yt(e,i,t);const mt=rt(wt(!1)),xt=rt(wt(!0)),Ct=(t,{s:e,t:i,v:n})=>{if(t.a!==i){const{b:r,c:o}=(e?xt:mt)(i,n);t.a=i,t.b=r,t.c=o}for(let{c:e}=t,i=0;i<e.length;i++){const t=n[i],r=e[i];switch(r.u){case I:r.v=I(r.t,St(r.c,t),r.v);break;case H:const e=t instanceof Nt?Ct(r.c||(r.c=et()),t):(r.c=null,t);e!==r.v&&(r.v=H(r,e));break;default:t!==r.v&&(r.v=r.u(r.t,t,r.n,r.v))}}return t.b},St=(t,e)=>{let i=0,{length:n}=e;for(n<t.length&&t.splice(n);i<n;i++){const n=e[i];n instanceof Nt?e[i]=Ct(t[i]||(t[i]=et()),n):t[i]=null}return e};class Nt{constructor(t,e,i){this.s=t,this.t=e,this.v=i}toDOM(t=et()){return Ct(t,this)}} | ||
function t(){throw new Error("Cycle detected")}const e=Symbol.for("preact-signals");function i(){if(l>1)return void l--;let t,e=!1;for(;void 0!==o;){let i=o;for(o=void 0,h++;void 0!==i;){const n=i.o;if(i.o=void 0,i.f&=-3,!(8&i.f)&&p(i))try{i.c()}catch(i){e||(t=i,e=!0)}i=n}}if(h=0,l--,e)throw t}function n(t){if(l>0)return t();l++;try{return t()}finally{i()}}let r,o,s=0;function c(t){if(s>0)return t();const e=r;r=void 0,s++;try{return t()}finally{s--,r=e}}let l=0,h=0,f=0;function u(t){if(void 0===r)return;let e=t.n;return void 0===e||e.t!==r?(e={i:0,S:t,p:r.s,n:void 0,t:r,e:void 0,x:void 0,r:e},void 0!==r.s&&(r.s.n=e),r.s=e,t.n=e,32&r.f&&t.S(e),e):-1===e.i?(e.i=0,void 0!==e.n&&(e.n.p=e.p,void 0!==e.p&&(e.p.n=e.n),e.p=r.s,e.n=void 0,r.s.n=e,r.s=e),e):void 0}function a(t){this.v=t,this.i=0,this.n=void 0,this.t=void 0}function d(t){return new a(t)}function p(t){for(let e=t.s;void 0!==e;e=e.n)if(e.S.i!==e.i||!e.S.h()||e.S.i!==e.i)return!0;return!1}function v(t){for(let e=t.s;void 0!==e;e=e.n){const i=e.S.n;if(void 0!==i&&(e.r=i),e.S.n=e,e.i=-1,void 0===e.n){t.s=e;break}}}function y(t){let e,i=t.s;for(;void 0!==i;){const t=i.p;-1===i.i?(i.S.U(i),void 0!==t&&(t.n=i.n),void 0!==i.n&&(i.n.p=t)):e=i,i.S.n=i.r,void 0!==i.r&&(i.r=void 0),i=t}t.s=e}function g(t){a.call(this,void 0),this.x=t,this.s=void 0,this.g=f-1,this.f=4}function b(t){return new g(t)}function w(t){const e=t.u;if(t.u=void 0,"function"==typeof e){l++;const n=r;r=void 0;try{e()}catch(e){throw t.f&=-2,t.f|=8,m(t),e}finally{r=n,i()}}}function m(t){for(let e=t.s;void 0!==e;e=e.n)e.S.U(e);t.x=void 0,t.s=void 0,w(t)}function x(t){if(r!==this)throw new Error("Out-of-order effect");y(this),r=t,this.f&=-2,8&this.f&&m(this),i()}function C(t){this.x=t,this.u=void 0,this.s=void 0,this.o=void 0,this.f=32}function S(t){const e=new C(t);try{e.c()}catch(t){throw e.d(),t}return e.d.bind(e)}a.prototype.brand=e,a.prototype.h=function(){return!0},a.prototype.S=function(t){this.t!==t&&void 0===t.e&&(t.x=this.t,void 0!==this.t&&(this.t.e=t),this.t=t)},a.prototype.U=function(t){if(void 0!==this.t){const e=t.e,i=t.x;void 0!==e&&(e.x=i,t.e=void 0),void 0!==i&&(i.e=e,t.x=void 0),t===this.t&&(this.t=i)}},a.prototype.subscribe=function(t){const e=this;return S((function(){const i=e.value,n=32&this.f;this.f&=-33;try{t(i)}finally{this.f|=n}}))},a.prototype.valueOf=function(){return this.value},a.prototype.toString=function(){return this.value+""},a.prototype.toJSON=function(){return this.value},a.prototype.peek=function(){return this.v},Object.defineProperty(a.prototype,"value",{get(){const t=u(this);return void 0!==t&&(t.i=this.i),this.v},set(e){if(r instanceof g&&function(){throw new Error("Computed cannot have side-effects")}(),e!==this.v){h>100&&t(),this.v=e,this.i++,f++,l++;try{for(let t=this.t;void 0!==t;t=t.x)t.t.N()}finally{i()}}}}),(g.prototype=new a).h=function(){if(this.f&=-3,1&this.f)return!1;if(32==(36&this.f))return!0;if(this.f&=-5,this.g===f)return!0;if(this.g=f,this.f|=1,this.i>0&&!p(this))return this.f&=-2,!0;const t=r;try{v(this),r=this;const t=this.x();(16&this.f||this.v!==t||0===this.i)&&(this.v=t,this.f&=-17,this.i++)}catch(t){this.v=t,this.f|=16,this.i++}return r=t,y(this),this.f&=-2,!0},g.prototype.S=function(t){if(void 0===this.t){this.f|=36;for(let t=this.s;void 0!==t;t=t.n)t.S.S(t)}a.prototype.S.call(this,t)},g.prototype.U=function(t){if(void 0!==this.t&&(a.prototype.U.call(this,t),void 0===this.t)){this.f&=-33;for(let t=this.s;void 0!==t;t=t.n)t.S.U(t)}},g.prototype.N=function(){if(!(2&this.f)){this.f|=6;for(let t=this.t;void 0!==t;t=t.x)t.t.N()}},g.prototype.peek=function(){if(this.h()||t(),16&this.f)throw this.v;return this.v},Object.defineProperty(g.prototype,"value",{get(){1&this.f&&t();const e=u(this);if(this.h(),void 0!==e&&(e.i=this.i),16&this.f)throw this.v;return this.v}}),C.prototype.c=function(){const t=this.S();try{if(8&this.f)return;if(void 0===this.x)return;const t=this.x();"function"==typeof t&&(this.u=t)}finally{t()}},C.prototype.S=function(){1&this.f&&t(),this.f|=1,this.f&=-9,w(this),v(this),l++;const e=r;return r=this,x.bind(this,e)},C.prototype.N=function(){2&this.f||(this.f|=2,this.o=o,o=this)},C.prototype.d=function(){this.f|=8,1&this.f||m(this)};const{isArray:N}=Array,{getPrototypeOf:$,getOwnPropertyDescriptor:k}=Object,O=[],W=()=>document.createRange(),M=(t,e,i)=>(t.set(e,i),i),{setPrototypeOf:A}=Object;let E;var j=(t,e,i)=>(E||(E=W()),i?E.setStartAfter(t):E.setStartBefore(t),E.setEndAfter(e),E.deleteContents(),t);const T=({firstChild:t,lastChild:e},i)=>j(t,e,i);let P=!1;const U=(t,e)=>P&&11===t.nodeType?1/e<0?e?T(t,!0):t.lastChild:e?t.valueOf():t.firstChild:t,B=t=>document.createComment(t);class D extends((t=>{function e(t){return A(t,new.target.prototype)}return e.prototype=t.prototype,e})(DocumentFragment)){#t=B("<>");#e=B("</>");#i=O;constructor(t){super(t),this.replaceChildren(this.#t,...t.childNodes,this.#e),P=!0}get firstChild(){return this.#t}get lastChild(){return this.#e}get parentNode(){return this.#t.parentNode}remove(){T(this,!1)}replaceWith(t){T(this,!0).replaceWith(t)}valueOf(){let{firstChild:t,lastChild:e,parentNode:i}=this;if(i===this)this.#i===O&&(this.#i=[...this.childNodes]);else{if(i)for(this.#i=[t];t!==e;)this.#i.push(t=t.nextSibling);this.replaceChildren(...this.#i)}return this}}const R=(t,e,i)=>t.setAttribute(e,i),z=(t,e)=>t.removeAttribute(e);let F;const L=(t,e,i)=>{i=i.slice(1),F||(F=new WeakMap);const n=F.get(t)||M(F,t,{});let r=n[i];return r&&r[0]&&t.removeEventListener(i,...r),r=N(e)?e:[e,!1],n[i]=r,r[0]&&t.addEventListener(i,...r),e},H=(t,e)=>{const{t:i,n:n}=t;let r=!1;switch(typeof e){case"object":if(null!==e){(n||i).replaceWith(t.n=e.valueOf());break}case"undefined":r=!0;default:i.data=r?"":e,n&&(t.n=null,n.replaceWith(i))}return e},Z=(t,e,i)=>t[i]=e,G=(t,e,i)=>Z(t,e,i.slice(1)),J=(t,e,i)=>null==e?(z(t,i),e):Z(t,e,i),V=(t,e)=>("function"==typeof e?e(t):e.current=t,e),_=(t,e,i)=>(null==e?z(t,i):R(t,i,e),e),q=(t,e,i)=>(t.toggleAttribute(i.slice(1),e),e),I=(t,e,i)=>{const{length:n}=e;if(t.data=`[${n}]`,n)return((t,e,i,n,r)=>{const o=i.length;let s=e.length,c=o,l=0,h=0,f=null;for(;l<s||h<c;)if(s===l){const e=c<o?h?n(i[h-1],-0).nextSibling:n(i[c-h],0):r;for(;h<c;)t.insertBefore(n(i[h++],1),e)}else if(c===h)for(;l<s;)f&&f.has(e[l])||t.removeChild(n(e[l],-1)),l++;else if(e[l]===i[h])l++,h++;else if(e[s-1]===i[c-1])s--,c--;else if(e[l]===i[c-1]&&i[h]===e[s-1]){const r=n(e[--s],-1).nextSibling;t.insertBefore(n(i[h++],1),n(e[l++],-1).nextSibling),t.insertBefore(n(i[--c],1),r),e[s]=i[c]}else{if(!f){f=new Map;let t=h;for(;t<c;)f.set(i[t],t++)}if(f.has(e[l])){const r=f.get(e[l]);if(h<r&&r<c){let o=l,u=1;for(;++o<s&&o<c&&f.get(e[o])===r+u;)u++;if(u>r-h){const o=n(e[l],0);for(;h<r;)t.insertBefore(n(i[h++],1),o)}else t.replaceChild(n(i[h++],1),n(e[l++],-1))}else l++}else t.removeChild(n(e[l++],-1))}return i})(t.parentNode,i,e,U,t);switch(i.length){case 1:i[0].remove();case 0:break;default:j(U(i[0],0),U(i.at(-1),-0),!1)}return O},K=new Map([["aria",(t,e)=>{for(const i in e){const n=e[i],r="role"===i?i:`aria-${i}`;null==n?z(t,r):R(t,r,n)}return e}],["class",(t,e)=>J(t,e,null==e?"class":"className")],["data",(t,e)=>{const{dataset:i}=t;for(const t in e)null==e[t]?delete i[t]:i[t]=e[t];return e}],["ref",V],["style",(t,e)=>null==e?J(t,e,"style"):Z(t.style,e,"cssText")]]),Q=(t,e,i)=>{switch(e[0]){case".":return G;case"?":return q;case"@":return L;default:return i||"ownerSVGElement"in t?"ref"===e?V:_:K.get(e)||(e in t?e.startsWith("on")?Z:((t,e)=>{let i;do{i=k(t,e)}while(!i&&(t=$(t)));return i})(t,e)?.set?J:_:_)}},X=(t,e)=>(t.textContent=null==e?"":e,e),Y=(t,e,i)=>({a:t,b:e,c:i}),tt=(t,e,i,n)=>({v:O,u:t,t:e,n:i,c:n}),et=()=>Y(null,null,O),it=(t,e)=>e.reduceRight(nt,t),nt=(t,e)=>t.childNodes[e];var rt=t=>(e,i)=>{const{a:n,b:r,c:o}=t(e,i),s=document.importNode(n,!0);let c=O;if(r!==O){c=[];for(let t,e,i=0;i<r.length;i++){const{a:n,b:o,c:l}=r[i],h=n===e?t:t=it(s,e=n);c[i]=tt(o,h,l,o===I?[]:o===H?et():null)}}return((t,e)=>({b:t,c:e}))(o?s.firstChild:new D(s),c)};const ot=/^(?:plaintext|script|style|textarea|title|xmp)$/i,st=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,ct=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,lt=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,ht=/[\x01\x02]/g;let ft,ut,at=document.createElement("template");var dt=(t,e)=>{if(e)return ft||(ft=document.createElementNS("http://www.w3.org/2000/svg","svg"),ut=W(),ut.selectNodeContents(ft)),ut.createContextualFragment(t);at.innerHTML=t;const{content:i}=at;return at=at.cloneNode(!1),i};const pt=t=>{const e=[];let i;for(;i=t.parentNode;)e.push(e.indexOf.call(i.childNodes,t)),t=i;return e},vt=()=>document.createTextNode(""),yt=(t,e,i)=>{const n=dt(((t,e,i)=>{let n=0;return t.join("").trim().replace(ct,((t,e,n,r)=>`<${e}${n.replace(lt,"=$2$1").trimEnd()}${r?i||st.test(e)?" /":`></${e}`:""}>`)).replace(ht,(t=>""===t?`\x3c!--${e+n++}--\x3e`:e+n++))})(t,bt,i),i),{length:r}=t;let o=O;if(r>1){const t=[],s=document.createTreeWalker(n,129);let c=0,l=`${bt}${c++}`;for(o=[];c<r;){const n=s.nextNode();if(8===n.nodeType){if(n.data===l){const i=N(e[c-1])?I:H;i===H&&t.push(n),o.push(Y(pt(n),i,null)),l=`${bt}${c++}`}}else{let t;for(;n.hasAttribute(l);){t||(t=pt(n));const e=n.getAttribute(l);o.push(Y(t,Q(n,e,i),e)),z(n,l),l=`${bt}${c++}`}!i&&ot.test(n.localName)&&n.textContent.trim()===`\x3c!--${l}--\x3e`&&(o.push(Y(t||pt(n),X,null)),l=`${bt}${c++}`)}}for(c=0;c<t.length;c++)t[c].replaceWith(vt())}const{childNodes:s}=n;let{length:c}=s;return c<1?(c=1,n.appendChild(vt())):1===c&&1!==r&&1!==s[0].nodeType&&(c=0),M(gt,t,Y(n,o,1===c))},gt=new WeakMap,bt="isµ";var wt=t=>(e,i)=>gt.get(e)||yt(e,i,t);const mt=rt(wt(!1)),xt=rt(wt(!0)),Ct=(t,{s:e,t:i,v:n})=>{if(t.a!==i){const{b:r,c:o}=(e?xt:mt)(i,n);t.a=i,t.b=r,t.c=o}for(let{c:e}=t,i=0;i<e.length;i++){const t=n[i],r=e[i];switch(r.u){case I:r.v=I(r.t,St(r.c,t),r.v);break;case H:const e=t instanceof Nt?Ct(r.c||(r.c=et()),t):(r.c=null,t);e!==r.v&&(r.v=H(r,e));break;default:t!==r.v&&(r.v=r.u(r.t,t,r.n,r.v))}}return t.b},St=(t,e)=>{let i=0,{length:n}=e;for(n<t.length&&t.splice(n);i<n;i++){const n=e[i];n instanceof Nt?e[i]=Ct(t[i]||(t[i]=et()),n):t[i]=null}return e};class Nt{constructor(t,e,i){this.s=t,this.t=e,this.v=i}toDOM(t=et()){return Ct(t,this)}} | ||
/*! (c) Andrea Giammarchi - MIT */const $t=t=>(e,...i)=>new Nt(t,e,i),kt=$t(!1),Ot=$t(!0),Wt=new WeakMap;var Mt=(t,e,i)=>{const n=Wt.get(t)||M(Wt,t,et()),{b:r}=n,o=i&&"function"==typeof e?e():e,s=o instanceof Nt?o.toDOM(n):o;return r!==s&&t.replaceChildren((n.b=s).valueOf()),t}; | ||
/*! (c) Andrea Giammarchi - MIT */const At=new WeakMap,Et=t=>(e,i)=>{const n=At.get(e)||M(At,e,new Map);return n.get(i)||M(n,i,function(e,...i){return new Nt(t,e,i).toDOM(this)}.bind(et()))},jt=Et(!1),Tt=Et(!0),Pt=new FinalizationRegistry((([t,e,i])=>{i&&console.debug(`Held value ${String(e)} not relevant anymore`),t(e)})),Ut=Object.create(null),Bt=new WeakMap,Dt=t=>t();const Rt=(zt=S,(t,e)=>{let i=Bt.get(t);var n;if(i&&(n=i,Pt.unregister(n),i()),"function"==typeof e){const n=new WeakRef(t);return i=zt((()=>{Mt(n.deref(),e(),!1)})),Bt.set(t,i),((t,e,{debug:i,return:n,token:r=t}=Ut)=>{const o=n||new Proxy(t,Ut),s=[o,[e,t,!!i]];return!1!==r&&s.push(r),Pt.register(...s),o})(i,Dt,{return:t})}return Bt.delete(t),Mt(t,e,!1)});var zt;export{Nt as Hole,a as Signal,K as attr,n as batch,b as computed,S as effect,kt as html,jt as htmlFor,Rt as render,d as signal,Ot as svg,Tt as svgFor,c as untracked}; |
@@ -1,3 +0,3 @@ | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:o}=Object;let i;var a=(e,t,n)=>(i||(i=s()),n?i.setStartAfter(e):i.setStartBefore(e),i.setEndAfter(t),i.deleteContents(),e);const c=({firstChild:e,lastChild:t},n)=>a(e,t,n);let u=!1;const d=(e,t)=>u&&11===e.nodeType?1/t<0?t?c(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,h=e=>document.createComment(e);class f extends((e=>{function t(e){return o(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=h("<>");#t=h("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){c(this,!1)}replaceWith(e){c(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const v=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let o=s[r];return o&&o[0]&&t.removeEventListener(r,...o),o=e(n)?n:[n,!1],s[r]=o,o[0]&&t.addEventListener(r,...o),n},b=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},C=(e,t,n)=>e[n]=t,w=(e,t,n)=>C(e,t,n.slice(1)),x=(e,t,n)=>null==t?(g(e,n),t):C(e,t,n),y=(e,t)=>("function"==typeof t?t(e):t.current=e,t),$=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),k=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let o=t.length,i=l,a=0,c=0,u=null;for(;a<o||c<i;)if(o===a){const t=i<l?c?r(n[c-1],-0).nextSibling:r(n[i-c],0):s;for(;c<i;)e.insertBefore(r(n[c++],1),t)}else if(i===c)for(;a<o;)u&&u.has(t[a])||e.removeChild(r(t[a],-1)),a++;else if(t[a]===n[c])a++,c++;else if(t[o-1]===n[i-1])o--,i--;else if(t[a]===n[i-1]&&n[c]===t[o-1]){const s=r(t[--o],-1).nextSibling;e.insertBefore(r(n[c++],1),r(t[a++],-1).nextSibling),e.insertBefore(r(n[--i],1),s),t[o]=n[i]}else{if(!u){u=new Map;let e=c;for(;e<i;)u.set(n[e],e++)}if(u.has(t[a])){const s=u.get(t[a]);if(c<s&&s<i){let l=a,d=1;for(;++l<o&&l<i&&u.get(t[l])===s+d;)d++;if(d>s-c){const l=r(t[a],0);for(;c<s;)e.insertBefore(r(n[c++],1),l)}else e.replaceChild(r(n[c++],1),r(t[a++],-1))}else a++}else e.removeChild(r(t[a++],-1))}return n})(e.parentNode,n,t,d,e);switch(n.length){case 1:n[0].remove();case 0:break;default:a(d(n[0],0),d(n.at(-1),-0),!1)}return r},O=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>x(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",y],["style",(e,t)=>null==t?x(e,t,"style"):C(e.style,t,"cssText")]]),W=(e,r,s)=>{switch(r[0]){case".":return w;case"?":return N;case"@":return v;default:return s||"ownerSVGElement"in e?"ref"===r?y:$:O.get(r)||(r in e?r.startsWith("on")?C:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?x:$:$)}},M=(e,t)=>(e.textContent=null==t?"":t,t),A=(e,t,n)=>({a:e,b:t,c:n}),S=()=>A(null,null,r),E=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var j=e=>(t,n)=>{const{a:s,b:l,c:o}=e(t,n),i=s.cloneNode(!0);let a=r;if(l!==r){a=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:o,c:f}=l[n],p=s===t?e:e=E(i,t=s);a[n]=(c=o,u=p,d=f,h=o===k?[]:o===b?S():null,{v:r,u:c,t:u,n:d,c:h})}}var c,u,d,h;return((e,t)=>({b:e,c:t}))(o?i.firstChild:new f(i),a)};const B=/^(?:plaintext|script|style|textarea|title|xmp)$/i,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,P=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,R=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,L,H=document.createElement("template");var Z=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),L=s(),L.selectNodeContents(F)),L.createContextualFragment(e);H.innerHTML=e;const{content:n}=H;return H=H.cloneNode(!1),n};const G=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const o=Z(((e,t,n)=>{let r=0;return e.join("").trim().replace(P,((e,t,r,s)=>`<${t}${r.replace(R,"=$2$1").trimEnd()}${s?n||D.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:i}=t;let a=r;if(i>1){const t=[],r=document.createTreeWalker(o,129);let l=0,c=`${I}${l++}`;for(a=[];l<i;){const o=r.nextNode();if(8===o.nodeType){if(o.data===c){const r=e(n[l-1])?k:b;r===b&&t.push(o),a.push(A(G(o),r,null)),c=`${I}${l++}`}}else{let e;for(;o.hasAttribute(c);){e||(e=G(o));const t=o.getAttribute(c);a.push(A(e,W(o,t,s),t)),g(o,c),c=`${I}${l++}`}!s&&B.test(o.localName)&&o.textContent.trim()===`\x3c!--${c}--\x3e`&&(a.push(A(e||G(o),M,null)),c=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:c}=o;let{length:u}=c;return u<1?(u=1,o.appendChild(V())):1===u&&1!==i&&1!==c[0].nodeType&&(u=0),l(q,t,A(o,a,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=j(J(!1)),Q=j(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case k:s.v=k(s.t,X(s.c,e),s.v);break;case b:const t=e instanceof Y?U(s.c||(s.c=S()),e):(s.c=null,e);t!==s.v&&(s.v=b(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=S()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=S()){return U(e,this)}} | ||
const{isArray:e}=Array,{getPrototypeOf:t,getOwnPropertyDescriptor:n}=Object,r=[],s=()=>document.createRange(),l=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:o}=Object;let i;var a=(e,t,n)=>(i||(i=s()),n?i.setStartAfter(e):i.setStartBefore(e),i.setEndAfter(t),i.deleteContents(),e);const c=({firstChild:e,lastChild:t},n)=>a(e,t,n);let u=!1;const d=(e,t)=>u&&11===e.nodeType?1/t<0?t?c(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,h=e=>document.createComment(e);class f extends((e=>{function t(e){return o(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=h("<>");#t=h("</>");#n=r;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),u=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){c(this,!1)}replaceWith(e){c(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===r&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const p=(e,t,n)=>e.setAttribute(t,n),g=(e,t)=>e.removeAttribute(t);let m;const v=(t,n,r)=>{r=r.slice(1),m||(m=new WeakMap);const s=m.get(t)||l(m,t,{});let o=s[r];return o&&o[0]&&t.removeEventListener(r,...o),o=e(n)?n:[n,!1],s[r]=o,o[0]&&t.addEventListener(r,...o),n},b=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},C=(e,t,n)=>e[n]=t,w=(e,t,n)=>C(e,t,n.slice(1)),x=(e,t,n)=>null==t?(g(e,n),t):C(e,t,n),y=(e,t)=>("function"==typeof t?t(e):t.current=e,t),$=(e,t,n)=>(null==t?g(e,n):p(e,n,t),t),N=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),k=(e,t,n)=>{const{length:s}=t;if(e.data=`[${s}]`,s)return((e,t,n,r,s)=>{const l=n.length;let o=t.length,i=l,a=0,c=0,u=null;for(;a<o||c<i;)if(o===a){const t=i<l?c?r(n[c-1],-0).nextSibling:r(n[i-c],0):s;for(;c<i;)e.insertBefore(r(n[c++],1),t)}else if(i===c)for(;a<o;)u&&u.has(t[a])||e.removeChild(r(t[a],-1)),a++;else if(t[a]===n[c])a++,c++;else if(t[o-1]===n[i-1])o--,i--;else if(t[a]===n[i-1]&&n[c]===t[o-1]){const s=r(t[--o],-1).nextSibling;e.insertBefore(r(n[c++],1),r(t[a++],-1).nextSibling),e.insertBefore(r(n[--i],1),s),t[o]=n[i]}else{if(!u){u=new Map;let e=c;for(;e<i;)u.set(n[e],e++)}if(u.has(t[a])){const s=u.get(t[a]);if(c<s&&s<i){let l=a,d=1;for(;++l<o&&l<i&&u.get(t[l])===s+d;)d++;if(d>s-c){const l=r(t[a],0);for(;c<s;)e.insertBefore(r(n[c++],1),l)}else e.replaceChild(r(n[c++],1),r(t[a++],-1))}else a++}else e.removeChild(r(t[a++],-1))}return n})(e.parentNode,n,t,d,e);switch(n.length){case 1:n[0].remove();case 0:break;default:a(d(n[0],0),d(n.at(-1),-0),!1)}return r},O=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?g(e,s):p(e,s,r)}return t}],["class",(e,t)=>x(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",y],["style",(e,t)=>null==t?x(e,t,"style"):C(e.style,t,"cssText")]]),W=(e,r,s)=>{switch(r[0]){case".":return w;case"?":return N;case"@":return v;default:return s||"ownerSVGElement"in e?"ref"===r?y:$:O.get(r)||(r in e?r.startsWith("on")?C:((e,r)=>{let s;do{s=n(e,r)}while(!s&&(e=t(e)));return s})(e,r)?.set?x:$:$)}},M=(e,t)=>(e.textContent=null==t?"":t,t),A=(e,t,n)=>({a:e,b:t,c:n}),S=()=>A(null,null,r),E=(e,t)=>t.reduceRight(T,e),T=(e,t)=>e.childNodes[t];var j=e=>(t,n)=>{const{a:s,b:l,c:o}=e(t,n),i=document.importNode(s,!0);let a=r;if(l!==r){a=[];for(let e,t,n=0;n<l.length;n++){const{a:s,b:o,c:f}=l[n],p=s===t?e:e=E(i,t=s);a[n]=(c=o,u=p,d=f,h=o===k?[]:o===b?S():null,{v:r,u:c,t:u,n:d,c:h})}}var c,u,d,h;return((e,t)=>({b:e,c:t}))(o?i.firstChild:new f(i),a)};const B=/^(?:plaintext|script|style|textarea|title|xmp)$/i,D=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,P=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,R=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,z=/[\x01\x02]/g;let F,L,H=document.createElement("template");var Z=(e,t)=>{if(t)return F||(F=document.createElementNS("http://www.w3.org/2000/svg","svg"),L=s(),L.selectNodeContents(F)),L.createContextualFragment(e);H.innerHTML=e;const{content:n}=H;return H=H.cloneNode(!1),n};const G=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},V=()=>document.createTextNode(""),_=(t,n,s)=>{const o=Z(((e,t,n)=>{let r=0;return e.join("").trim().replace(P,((e,t,r,s)=>`<${t}${r.replace(R,"=$2$1").trimEnd()}${s?n||D.test(t)?" /":`></${t}`:""}>`)).replace(z,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(t,I,s),s),{length:i}=t;let a=r;if(i>1){const t=[],r=document.createTreeWalker(o,129);let l=0,c=`${I}${l++}`;for(a=[];l<i;){const o=r.nextNode();if(8===o.nodeType){if(o.data===c){const r=e(n[l-1])?k:b;r===b&&t.push(o),a.push(A(G(o),r,null)),c=`${I}${l++}`}}else{let e;for(;o.hasAttribute(c);){e||(e=G(o));const t=o.getAttribute(c);a.push(A(e,W(o,t,s),t)),g(o,c),c=`${I}${l++}`}!s&&B.test(o.localName)&&o.textContent.trim()===`\x3c!--${c}--\x3e`&&(a.push(A(e||G(o),M,null)),c=`${I}${l++}`)}}for(l=0;l<t.length;l++)t[l].replaceWith(V())}const{childNodes:c}=o;let{length:u}=c;return u<1?(u=1,o.appendChild(V())):1===u&&1!==i&&1!==c[0].nodeType&&(u=0),l(q,t,A(o,a,1===u))},q=new WeakMap,I="isµ";var J=e=>(t,n)=>q.get(t)||_(t,n,e);const K=j(J(!1)),Q=j(J(!0)),U=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?Q:K)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case k:s.v=k(s.t,X(s.c,e),s.v);break;case b:const t=e instanceof Y?U(s.c||(s.c=S()),e):(s.c=null,e);t!==s.v&&(s.v=b(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},X=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof Y?t[n]=U(e[n]||(e[n]=S()),r):e[n]=null}return t};class Y{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=S()){return U(e,this)}} | ||
/*! (c) Andrea Giammarchi - MIT */const ee=e=>(t,...n)=>new Y(e,t,n),te=ee(!1),ne=ee(!0),re=new WeakMap;var se=(e,t,n)=>{const r=re.get(e)||l(re,e,S()),{b:s}=r,o=n&&"function"==typeof t?t():t,i=o instanceof Y?o.toDOM(r):o;return s!==i&&e.replaceChildren((r.b=i).valueOf()),e}; | ||
/*! (c) Andrea Giammarchi - MIT */const le=new WeakMap,oe=e=>(t,n)=>{const r=le.get(t)||l(le,t,new Map);return r.get(n)||l(r,n,function(t,...n){return new Y(e,t,n).toDOM(this)}.bind(S()))},ie=oe(!1),ae=oe(!0),ce=new FinalizationRegistry((([e,t,n])=>{n&&console.debug(`Held value ${String(t)} not relevant anymore`),e(t)})),ue=Object.create(null),de=new WeakMap,he=e=>e();var fe=e=>(t,n)=>{let r=de.get(t);var s;if(r&&(s=r,ce.unregister(s),r()),"function"==typeof n){const s=new WeakRef(t);return r=e((()=>{se(s.deref(),n(),!1)})),de.set(t,r),((e,t,{debug:n,return:r,token:s=e}=ue)=>{const l=r||new Proxy(e,ue),o=[l,[t,e,!!n]];return!1!==s&&o.push(s),ce.register(...o),l})(r,he,{return:t})}return de.delete(t),se(t,n,!1)};export{Y as Hole,O as attr,te as html,ie as htmlFor,fe as reactive,ne as svg,ae as svgFor}; |
/*! (c) Andrea Giammarchi */ | ||
let e=null;const t=t=>{let n=e;n||(e=new Set);try{t()}finally{if(!n){[e,n]=[null,e];for(const e of n)e._()}}},n=e=>{const t=[...e];return e.clear(),t};class r extends Set{constructor(e){super()._=e}dispose(){for(const e of n(this))e.delete(this),e.dispose?.()}}let s=null;const l=e=>{const t=new r((()=>{const n=s;s=t;try{e()}finally{s=n}}));return t},o=(e,t)=>{const n=l((()=>{t=e(t)}));return s&&s.add(n),n._(),()=>n.dispose()};class i extends Set{constructor(e){super()._=e}get value(){return s&&s.add(this.add(s)),this._}set value(t){if(this._!==t){this._=t;const r=!e;for(const t of n(this))r?t._():e.add(t)}}peek(){return this._}toJSON(){return this.value}valueOf(){return this.value}toString(){return String(this.value)}}const c=e=>new i(e);class a extends i{constructor(e,t){super(t).f=e,this.e=null}get value(){return this.e||(this.e=l((()=>{super.value=this.f(this._)})))._(),super.value}set value(e){throw new Error("computed is read-only")}}const u=(e,t)=>new a(e,t);const{isArray:d}=Array,{getPrototypeOf:h,getOwnPropertyDescriptor:f}=Object,p=[],g=()=>document.createRange(),v=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:m}=Object;let b;var w=(e,t,n)=>(b||(b=g()),n?b.setStartAfter(e):b.setStartBefore(e),b.setEndAfter(t),b.deleteContents(),e);const C=({firstChild:e,lastChild:t},n)=>w(e,t,n);let y=!1;const x=(e,t)=>y&&11===e.nodeType?1/t<0?t?C(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,$=e=>document.createComment(e);class N extends((e=>{function t(e){return m(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=$("<>");#t=$("</>");#n=p;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),y=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){C(this,!1)}replaceWith(e){C(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===p&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const k=(e,t,n)=>e.setAttribute(t,n),O=(e,t)=>e.removeAttribute(t);let S;const W=(e,t,n)=>{n=n.slice(1),S||(S=new WeakMap);const r=S.get(e)||v(S,e,{});let s=r[n];return s&&s[0]&&e.removeEventListener(n,...s),s=d(t)?t:[t,!1],r[n]=s,s[0]&&e.addEventListener(n,...s),t},M=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},_=(e,t,n)=>e[n]=t,A=(e,t,n)=>_(e,t,n.slice(1)),E=(e,t,n)=>null==t?(O(e,n),t):_(e,t,n),T=(e,t)=>("function"==typeof t?t(e):t.current=e,t),j=(e,t,n)=>(null==t?O(e,n):k(e,n,t),t),B=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),D=(e,t,n)=>{const{length:r}=t;if(e.data=`[${r}]`,r)return((e,t,n,r,s)=>{const l=n.length;let o=t.length,i=l,c=0,a=0,u=null;for(;c<o||a<i;)if(o===c){const t=i<l?a?r(n[a-1],-0).nextSibling:r(n[i-a],0):s;for(;a<i;)e.insertBefore(r(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[o-1]===n[i-1])o--,i--;else if(t[c]===n[i-1]&&n[a]===t[o-1]){const s=r(t[--o],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--i],1),s),t[o]=n[i]}else{if(!u){u=new Map;let e=a;for(;e<i;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<i){let l=c,d=1;for(;++l<o&&l<i&&u.get(t[l])===s+d;)d++;if(d>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,x,e);switch(n.length){case 1:n[0].remove();case 0:break;default:w(x(n[0],0),x(n.at(-1),-0),!1)}return p},P=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?O(e,s):k(e,s,r)}return t}],["class",(e,t)=>E(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",T],["style",(e,t)=>null==t?E(e,t,"style"):_(e.style,t,"cssText")]]),R=(e,t,n)=>{switch(t[0]){case".":return A;case"?":return B;case"@":return W;default:return n||"ownerSVGElement"in e?"ref"===t?T:j:P.get(t)||(t in e?t.startsWith("on")?_:((e,t)=>{let n;do{n=f(e,t)}while(!n&&(e=h(e)));return n})(e,t)?.set?E:j:j)}},z=(e,t)=>(e.textContent=null==t?"":t,t),F=(e,t,n)=>({a:e,b:t,c:n}),L=()=>F(null,null,p),H=(e,t)=>t.reduceRight(Z,e),Z=(e,t)=>e.childNodes[t];var G=e=>(t,n)=>{const{a:r,b:s,c:l}=e(t,n),o=r.cloneNode(!0);let i=p;if(s!==p){i=[];for(let e,t,n=0;n<s.length;n++){const{a:r,b:l,c:h}=s[n],f=r===t?e:e=H(o,t=r);i[n]=(c=l,a=f,u=h,d=l===D?[]:l===M?L():null,{v:p,u:c,t:a,n:u,c:d})}}var c,a,u,d;return((e,t)=>({b:e,c:t}))(l?o.firstChild:new N(o),i)};const J=/^(?:plaintext|script|style|textarea|title|xmp)$/i,V=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,q=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,I=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,K=/[\x01\x02]/g;let Q,U,X=document.createElement("template");var Y=(e,t)=>{if(t)return Q||(Q=document.createElementNS("http://www.w3.org/2000/svg","svg"),U=g(),U.selectNodeContents(Q)),U.createContextualFragment(e);X.innerHTML=e;const{content:n}=X;return X=X.cloneNode(!1),n};const ee=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},te=()=>document.createTextNode(""),ne=(e,t,n)=>{const r=Y(((e,t,n)=>{let r=0;return e.join("").trim().replace(q,((e,t,r,s)=>`<${t}${r.replace(I,"=$2$1").trimEnd()}${s?n||V.test(t)?" /":`></${t}`:""}>`)).replace(K,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(e,se,n),n),{length:s}=e;let l=p;if(s>1){const e=[],o=document.createTreeWalker(r,129);let i=0,c=`${se}${i++}`;for(l=[];i<s;){const r=o.nextNode();if(8===r.nodeType){if(r.data===c){const n=d(t[i-1])?D:M;n===M&&e.push(r),l.push(F(ee(r),n,null)),c=`${se}${i++}`}}else{let e;for(;r.hasAttribute(c);){e||(e=ee(r));const t=r.getAttribute(c);l.push(F(e,R(r,t,n),t)),O(r,c),c=`${se}${i++}`}!n&&J.test(r.localName)&&r.textContent.trim()===`\x3c!--${c}--\x3e`&&(l.push(F(e||ee(r),z,null)),c=`${se}${i++}`)}}for(i=0;i<e.length;i++)e[i].replaceWith(te())}const{childNodes:o}=r;let{length:i}=o;return i<1?(i=1,r.appendChild(te())):1===i&&1!==s&&1!==o[0].nodeType&&(i=0),v(re,e,F(r,l,1===i))},re=new WeakMap,se="isµ";var le=e=>(t,n)=>re.get(t)||ne(t,n,e);const oe=G(le(!1)),ie=G(le(!0)),ce=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?ie:oe)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case D:s.v=D(s.t,ae(s.c,e),s.v);break;case M:const t=e instanceof ue?ce(s.c||(s.c=L()),e):(s.c=null,e);t!==s.v&&(s.v=M(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},ae=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof ue?t[n]=ce(e[n]||(e[n]=L()),r):e[n]=null}return t};class ue{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=L()){return ce(e,this)}} | ||
let e=null;const t=t=>{let n=e;n||(e=new Set);try{t()}finally{if(!n){[e,n]=[null,e];for(const e of n)e._()}}},n=e=>{const t=[...e];return e.clear(),t};class r extends Set{constructor(e){super()._=e}dispose(){for(const e of n(this))e.delete(this),e.dispose?.()}}let s=null;const l=e=>{const t=new r((()=>{const n=s;s=t;try{e()}finally{s=n}}));return t},o=(e,t)=>{const n=l((()=>{t=e(t)}));return s&&s.add(n),n._(),()=>n.dispose()};class i extends Set{constructor(e){super()._=e}get value(){return s&&s.add(this.add(s)),this._}set value(t){if(this._!==t){this._=t;const r=!e;for(const t of n(this))r?t._():e.add(t)}}peek(){return this._}toJSON(){return this.value}valueOf(){return this.value}toString(){return String(this.value)}}const c=e=>new i(e);class a extends i{constructor(e,t){super(t).f=e,this.e=null}get value(){return this.e||(this.e=l((()=>{super.value=this.f(this._)})))._(),super.value}set value(e){throw new Error("computed is read-only")}}const u=(e,t)=>new a(e,t);const{isArray:d}=Array,{getPrototypeOf:h,getOwnPropertyDescriptor:f}=Object,p=[],g=()=>document.createRange(),v=(e,t,n)=>(e.set(t,n),n),{setPrototypeOf:m}=Object;let b;var w=(e,t,n)=>(b||(b=g()),n?b.setStartAfter(e):b.setStartBefore(e),b.setEndAfter(t),b.deleteContents(),e);const C=({firstChild:e,lastChild:t},n)=>w(e,t,n);let y=!1;const x=(e,t)=>y&&11===e.nodeType?1/t<0?t?C(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e,$=e=>document.createComment(e);class N extends((e=>{function t(e){return m(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e=$("<>");#t=$("</>");#n=p;constructor(e){super(e),this.replaceChildren(this.#e,...e.childNodes,this.#t),y=!0}get firstChild(){return this.#e}get lastChild(){return this.#t}get parentNode(){return this.#e.parentNode}remove(){C(this,!1)}replaceWith(e){C(this,!0).replaceWith(e)}valueOf(){let{firstChild:e,lastChild:t,parentNode:n}=this;if(n===this)this.#n===p&&(this.#n=[...this.childNodes]);else{if(n)for(this.#n=[e];e!==t;)this.#n.push(e=e.nextSibling);this.replaceChildren(...this.#n)}return this}}const k=(e,t,n)=>e.setAttribute(t,n),O=(e,t)=>e.removeAttribute(t);let S;const W=(e,t,n)=>{n=n.slice(1),S||(S=new WeakMap);const r=S.get(e)||v(S,e,{});let s=r[n];return s&&s[0]&&e.removeEventListener(n,...s),s=d(t)?t:[t,!1],r[n]=s,s[0]&&e.addEventListener(n,...s),t},M=(e,t)=>{const{t:n,n:r}=e;let s=!1;switch(typeof t){case"object":if(null!==t){(r||n).replaceWith(e.n=t.valueOf());break}case"undefined":s=!0;default:n.data=s?"":t,r&&(e.n=null,r.replaceWith(n))}return t},_=(e,t,n)=>e[n]=t,A=(e,t,n)=>_(e,t,n.slice(1)),E=(e,t,n)=>null==t?(O(e,n),t):_(e,t,n),T=(e,t)=>("function"==typeof t?t(e):t.current=e,t),j=(e,t,n)=>(null==t?O(e,n):k(e,n,t),t),B=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),D=(e,t,n)=>{const{length:r}=t;if(e.data=`[${r}]`,r)return((e,t,n,r,s)=>{const l=n.length;let o=t.length,i=l,c=0,a=0,u=null;for(;c<o||a<i;)if(o===c){const t=i<l?a?r(n[a-1],-0).nextSibling:r(n[i-a],0):s;for(;a<i;)e.insertBefore(r(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(r(t[c],-1)),c++;else if(t[c]===n[a])c++,a++;else if(t[o-1]===n[i-1])o--,i--;else if(t[c]===n[i-1]&&n[a]===t[o-1]){const s=r(t[--o],-1).nextSibling;e.insertBefore(r(n[a++],1),r(t[c++],-1).nextSibling),e.insertBefore(r(n[--i],1),s),t[o]=n[i]}else{if(!u){u=new Map;let e=a;for(;e<i;)u.set(n[e],e++)}if(u.has(t[c])){const s=u.get(t[c]);if(a<s&&s<i){let l=c,d=1;for(;++l<o&&l<i&&u.get(t[l])===s+d;)d++;if(d>s-a){const l=r(t[c],0);for(;a<s;)e.insertBefore(r(n[a++],1),l)}else e.replaceChild(r(n[a++],1),r(t[c++],-1))}else c++}else e.removeChild(r(t[c++],-1))}return n})(e.parentNode,n,t,x,e);switch(n.length){case 1:n[0].remove();case 0:break;default:w(x(n[0],0),x(n.at(-1),-0),!1)}return p},P=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?O(e,s):k(e,s,r)}return t}],["class",(e,t)=>E(e,t,null==t?"class":"className")],["data",(e,t)=>{const{dataset:n}=e;for(const e in t)null==t[e]?delete n[e]:n[e]=t[e];return t}],["ref",T],["style",(e,t)=>null==t?E(e,t,"style"):_(e.style,t,"cssText")]]),R=(e,t,n)=>{switch(t[0]){case".":return A;case"?":return B;case"@":return W;default:return n||"ownerSVGElement"in e?"ref"===t?T:j:P.get(t)||(t in e?t.startsWith("on")?_:((e,t)=>{let n;do{n=f(e,t)}while(!n&&(e=h(e)));return n})(e,t)?.set?E:j:j)}},z=(e,t)=>(e.textContent=null==t?"":t,t),F=(e,t,n)=>({a:e,b:t,c:n}),L=()=>F(null,null,p),H=(e,t)=>t.reduceRight(Z,e),Z=(e,t)=>e.childNodes[t];var G=e=>(t,n)=>{const{a:r,b:s,c:l}=e(t,n),o=document.importNode(r,!0);let i=p;if(s!==p){i=[];for(let e,t,n=0;n<s.length;n++){const{a:r,b:l,c:h}=s[n],f=r===t?e:e=H(o,t=r);i[n]=(c=l,a=f,u=h,d=l===D?[]:l===M?L():null,{v:p,u:c,t:a,n:u,c:d})}}var c,a,u,d;return((e,t)=>({b:e,c:t}))(l?o.firstChild:new N(o),i)};const J=/^(?:plaintext|script|style|textarea|title|xmp)$/i,V=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,q=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,I=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,K=/[\x01\x02]/g;let Q,U,X=document.createElement("template");var Y=(e,t)=>{if(t)return Q||(Q=document.createElementNS("http://www.w3.org/2000/svg","svg"),U=g(),U.selectNodeContents(Q)),U.createContextualFragment(e);X.innerHTML=e;const{content:n}=X;return X=X.cloneNode(!1),n};const ee=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},te=()=>document.createTextNode(""),ne=(e,t,n)=>{const r=Y(((e,t,n)=>{let r=0;return e.join("").trim().replace(q,((e,t,r,s)=>`<${t}${r.replace(I,"=$2$1").trimEnd()}${s?n||V.test(t)?" /":`></${t}`:""}>`)).replace(K,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(e,se,n),n),{length:s}=e;let l=p;if(s>1){const e=[],o=document.createTreeWalker(r,129);let i=0,c=`${se}${i++}`;for(l=[];i<s;){const r=o.nextNode();if(8===r.nodeType){if(r.data===c){const n=d(t[i-1])?D:M;n===M&&e.push(r),l.push(F(ee(r),n,null)),c=`${se}${i++}`}}else{let e;for(;r.hasAttribute(c);){e||(e=ee(r));const t=r.getAttribute(c);l.push(F(e,R(r,t,n),t)),O(r,c),c=`${se}${i++}`}!n&&J.test(r.localName)&&r.textContent.trim()===`\x3c!--${c}--\x3e`&&(l.push(F(e||ee(r),z,null)),c=`${se}${i++}`)}}for(i=0;i<e.length;i++)e[i].replaceWith(te())}const{childNodes:o}=r;let{length:i}=o;return i<1?(i=1,r.appendChild(te())):1===i&&1!==s&&1!==o[0].nodeType&&(i=0),v(re,e,F(r,l,1===i))},re=new WeakMap,se="isµ";var le=e=>(t,n)=>re.get(t)||ne(t,n,e);const oe=G(le(!1)),ie=G(le(!0)),ce=(e,{s:t,t:n,v:r})=>{if(e.a!==n){const{b:s,c:l}=(t?ie:oe)(n,r);e.a=n,e.b=s,e.c=l}for(let{c:t}=e,n=0;n<t.length;n++){const e=r[n],s=t[n];switch(s.u){case D:s.v=D(s.t,ae(s.c,e),s.v);break;case M:const t=e instanceof ue?ce(s.c||(s.c=L()),e):(s.c=null,e);t!==s.v&&(s.v=M(s,t));break;default:e!==s.v&&(s.v=s.u(s.t,e,s.n,s.v))}}return e.b},ae=(e,t)=>{let n=0,{length:r}=t;for(r<e.length&&e.splice(r);n<r;n++){const r=t[n];r instanceof ue?t[n]=ce(e[n]||(e[n]=L()),r):e[n]=null}return t};class ue{constructor(e,t,n){this.s=e,this.t=t,this.v=n}toDOM(e=L()){return ce(e,this)}} | ||
/*! (c) Andrea Giammarchi - MIT */const de=e=>(t,...n)=>new ue(e,t,n),he=de(!1),fe=de(!0),pe=new WeakMap;var ge=(e,t,n)=>{const r=pe.get(e)||v(pe,e,L()),{b:s}=r,l=n&&"function"==typeof t?t():t,o=l instanceof ue?l.toDOM(r):l;return s!==o&&e.replaceChildren((r.b=o).valueOf()),e}; | ||
/*! (c) Andrea Giammarchi - MIT */const ve=new WeakMap,me=e=>(t,n)=>{const r=ve.get(t)||v(ve,t,new Map);return r.get(n)||v(r,n,function(t,...n){return new ue(e,t,n).toDOM(this)}.bind(L()))},be=me(!1),we=me(!0),Ce=new FinalizationRegistry((([e,t,n])=>{n&&console.debug(`Held value ${String(t)} not relevant anymore`),e(t)})),ye=Object.create(null),xe=new WeakMap,$e=e=>e();const Ne=(e=>(t,n)=>{let r=xe.get(t);var s;if(r&&(s=r,Ce.unregister(s),r()),"function"==typeof n){const s=new WeakRef(t);return r=e((()=>{ge(s.deref(),n(),!1)})),xe.set(t,r),((e,t,{debug:n,return:r,token:s=e}=ye)=>{const l=r||new Proxy(e,ye),o=[l,[t,e,!!n]];return!1!==s&&o.push(s),Ce.register(...o),l})(r,$e,{return:t})}return xe.delete(t),ge(t,n,!1)})(o);export{a as Computed,ue as Hole,i as Signal,P as attr,t as batch,u as computed,o as effect,he as html,be as htmlFor,Ne as render,c as signal,fe as svg,we as svgFor}; |
@@ -30,2 +30,10 @@ /** @typedef {import("./attribute.js").Attribute} Attribute */ | ||
createTreeWalker(parent: any, accept: any): TreeWalker; | ||
/** | ||
* Same as `document.importNode` | ||
* @template T | ||
* @param {T} externalNode | ||
* @param {boolean} deep | ||
* @returns {T} | ||
*/ | ||
importNode<T>(externalNode: T, deep?: boolean): T; | ||
[documentElement]: any; | ||
@@ -32,0 +40,0 @@ [doctype]: any; |
@@ -5,3 +5,3 @@ export function cloned(node: any): any; | ||
export function asElement({ [nodeType]: type }: { | ||
"__@nodeType@24930": any; | ||
"__@nodeType@24931": any; | ||
}): boolean; | ||
@@ -8,0 +8,0 @@ export function changeParentNode(node: any, parent: any): any; |
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
399481
8125