Comparing version 4.1.20 to 4.1.21
@@ -214,3 +214,3 @@ 'use strict'; | ||
udomdiff(node.parentNode, prev, value, diffFragment, node) : | ||
(drop(prev[0], prev.at(-1), false), empty) | ||
(prev.length && drop(prev[0], prev.at(-1), false), empty) | ||
); | ||
@@ -217,0 +217,0 @@ exports.array = array; |
@@ -640,3 +640,3 @@ 'use strict'; | ||
udomdiff(node.parentNode, prev, value, diffFragment, node) : | ||
(drop(prev[0], prev.at(-1), false), empty) | ||
(prev.length && drop(prev[0], prev.at(-1), false), empty) | ||
); | ||
@@ -643,0 +643,0 @@ |
@@ -200,3 +200,3 @@ import udomdiff from 'udomdiff'; | ||
udomdiff(node.parentNode, prev, value, diffFragment, node) : | ||
(drop(prev[0], prev.at(-1), false), empty) | ||
(prev.length && drop(prev[0], prev.at(-1), false), empty) | ||
); | ||
@@ -203,0 +203,0 @@ |
@@ -639,3 +639,3 @@ | ||
udomdiff(node.parentNode, prev, value, diffFragment, node) : | ||
(drop(prev[0], prev.at(-1), false), empty) | ||
(prev.length && drop(prev[0], prev.at(-1), false), empty) | ||
); | ||
@@ -642,0 +642,0 @@ |
@@ -1,2 +0,2 @@ | ||
const{isArray:e}=Array,t=[],n=()=>document.createRange(),s=(e,t,n)=>(e.set(t,n),n),r=(e,t,n,s="")=>({t:e,p:t,u:n,n:s}),l=e=>({s:e,t:null,n:null,d:t}),{setPrototypeOf:o}=Object;let i;var c=(e,t,s)=>(i||(i=n()),s?i.setStartAfter(e):i.setStartBefore(e),i.setEndAfter(t),i.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;class d extends((e=>{function t(e){return o(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,u=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const f=(e,t)=>t.reduceRight(p,e),p=(e,t)=>e.childNodes[t];var g=e=>(n,s)=>{const{c:r,e:l,l:o}=e(n,s),i=r.cloneNode(!0);let c,a,u=l.length,h=u?l.slice(0):t;for(;u--;){const{t:e,p:n,u:r,n:o}=l[u],d=n===a?c:c=f(i,a=n),p=8===e?r():r;h[u]={v:p(d,s[u],o,t),u:p,t:d,n:o}}return((e,t)=>({n:e,d:t}))(1===o?i.firstChild:new d(i),h)};const m=/^(?: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,x=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,$=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,b=/[\x01\x02]/g;const N=(e,t,n)=>{e.setAttribute(t,n)},w=(e,t)=>{e.removeAttribute(t)},y=()=>j;let C;const A=(t,n,r)=>{r=r.slice(1),C||(C=new WeakMap);const l=C.get(t)||s(C,t,{});let o=l[r];return o&&o[0]&&t.removeEventListener(r,...o),o=e(n)?n:[n,!1],l[r]=o,o[0]&&t.addEventListener(r,...o),n};function W(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const k=()=>W.bind({n:null}),E=(e,t,n)=>e[n]=t,S=(e,t,n)=>E(e,t,n.slice(1)),M=(e,t,n)=>null==t?(w(e,n),t):E(e,t,n),O=(e,t)=>("function"==typeof t?t(e):t.current=e,t),T=(e,t,n)=>(null==t?w(e,n):N(e,n,t),t),B=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),j=(e,n,s,r)=>n.length?((e,t,n,s,r)=>{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?s(n[a-1],-0).nextSibling:s(n[i-a],0):r;for(;a<i;)e.insertBefore(s(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(s(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 r=s(t[--o],-1).nextSibling;e.insertBefore(s(n[a++],1),s(t[c++],-1).nextSibling),e.insertBefore(s(n[--i],1),r),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 r=u.get(t[c]);if(a<r&&r<i){let l=c,h=1;for(;++l<o&&l<i&&u.get(t[l])===r+h;)h++;if(h>r-a){const l=s(t[c],0);for(;a<r;)e.insertBefore(s(n[a++],1),l)}else e.replaceChild(s(n[a++],1),s(t[c++],-1))}else c++}else e.removeChild(s(t[c++],-1))}return n})(e.parentNode,r,n,h,e):(c(r[0],r.at(-1),!1),t),L=new Map([["aria",(e,t)=>{for(const n in t){const s=t[n],r="role"===n?n:`aria-${n}`;null==s?w(e,r):N(e,r,s)}return t}],["class",(e,t)=>M(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?M(e,t,"style"):E(e.style,t,"cssText")]]),z=(e,t,n)=>{switch(t[0]){case".":return S;case"?":return B;case"@":return A;default:return n||"ownerSVGElement"in e?"ref"===t?O:T:L.get(t)||(t in e?t.startsWith("on")?E:M:T)}},F=(e,t)=>(e.textContent=null==t?"":t,t);let R,Z,D=document.createElement("template");var G=(e,t)=>{if(t)return R||(R=document.createElementNS("http://www.w3.org/2000/svg","svg"),Z=n(),Z.selectNodeContents(R)),Z.createContextualFragment(e);D.innerHTML=e;const{content:s}=D;return D=D.cloneNode(!1),s};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},P=(n,l,o)=>{const i=G(((e,t,n)=>{let s=0;return e.join("").trim().replace(x,((e,t,s,r)=>`<${t}${s.replace($,"=$2$1").trimEnd()}${r?n||v.test(t)?" /":`></${t}`:""}>`)).replace(b,(e=>""===e?`\x3c!--${t+s++}--\x3e`:t+s++))})(n,_,o),o),{length:c}=n;let a=!1,u=t;if(c>1){const t=document.createTreeWalker(i,129),n=[];let s=0,h=`${_}${s++}`;for(u=[];s<c;){const i=t.nextNode();if(8===i.nodeType){if(i.data===h){let t=e(l[s-1])?y:k;t===k?n.push(i):a=!0,u.push(r(8,H(i),t)),h=`${_}${s++}`}}else{let e;for(;i.hasAttribute(h);){e||(e=H(i));const t=i.getAttribute(h);u.push(r(2,e,z(i,t,o),t)),w(i,h),h=`${_}${s++}`}m.test(i.localName)&&i.textContent.trim()===`\x3c!--${h}--\x3e`&&(u.push(r(3,e||H(i),F)),h=`${_}${s++}`)}}for(s=0;s<n.length;s++)n[s].replaceWith(document.createTextNode(""))}const h=i.childNodes.length;return s(V,n,((e,t,n)=>({c:e,e:t,l:n}))(i,u,1===h&&a?0:h))},V=new WeakMap,_="isµ";var q=e=>(t,n)=>V.get(t)||P(t,n,e);const I=g(q(!1)),J=g(q(!0)),K=(e,{s:n,t:s,v:r})=>{r.length&&e.s===t&&(e.s=[]);const l=Q(e,r);if(e.t!==s){const{n:t,d:l}=(n?J:I)(s,r);e.t=s,e.n=t,e.d=l}else{const{d:t}=e;for(let e=0;e<l;e++){const n=r[e],s=t[e],{v:l}=s;if(n!==l){const{u:e,t:t,n:r}=s;s.v=e(t,n,r,l)}}}return e.n},Q=({s:n},s)=>{const{length:r}=s;for(let o=0;o<r;o++){const r=s[o];r instanceof U?s[o]=K(n[o]||(n[o]=l(t)),r):e(r)?Q(n[o]||(n[o]=l([])),r):n[o]=null}return r<n.length&&n.splice(r),r};class U{constructor(e,t,n){this.s=e,this.t=t,this.v=n}}const X=new WeakMap;var Y=(e,n)=>{const r=X.get(e)||s(X,e,l(t));return r.n!==K(r,"function"==typeof n?n():n)&&e.replaceChildren(r.n),e}; | ||
const{isArray:e}=Array,t=[],n=()=>document.createRange(),s=(e,t,n)=>(e.set(t,n),n),r=(e,t,n,s="")=>({t:e,p:t,u:n,n:s}),l=e=>({s:e,t:null,n:null,d:t}),{setPrototypeOf:o}=Object;let i;var c=(e,t,s)=>(i||(i=n()),s?i.setStartAfter(e):i.setStartBefore(e),i.setEndAfter(t),i.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;class d extends((e=>{function t(e){return o(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,u=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const f=(e,t)=>t.reduceRight(p,e),p=(e,t)=>e.childNodes[t];var g=e=>(n,s)=>{const{c:r,e:l,l:o}=e(n,s),i=r.cloneNode(!0);let c,a,u=l.length,h=u?l.slice(0):t;for(;u--;){const{t:e,p:n,u:r,n:o}=l[u],d=n===a?c:c=f(i,a=n),p=8===e?r():r;h[u]={v:p(d,s[u],o,t),u:p,t:d,n:o}}return((e,t)=>({n:e,d:t}))(1===o?i.firstChild:new d(i),h)};const m=/^(?: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,x=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,$=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,b=/[\x01\x02]/g;const N=(e,t,n)=>{e.setAttribute(t,n)},w=(e,t)=>{e.removeAttribute(t)},y=()=>j;let C;const A=(t,n,r)=>{r=r.slice(1),C||(C=new WeakMap);const l=C.get(t)||s(C,t,{});let o=l[r];return o&&o[0]&&t.removeEventListener(r,...o),o=e(n)?n:[n,!1],l[r]=o,o[0]&&t.addEventListener(r,...o),n};function W(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const k=()=>W.bind({n:null}),E=(e,t,n)=>e[n]=t,S=(e,t,n)=>E(e,t,n.slice(1)),M=(e,t,n)=>null==t?(w(e,n),t):E(e,t,n),O=(e,t)=>("function"==typeof t?t(e):t.current=e,t),T=(e,t,n)=>(null==t?w(e,n):N(e,n,t),t),B=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),j=(e,n,s,r)=>n.length?((e,t,n,s,r)=>{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?s(n[a-1],-0).nextSibling:s(n[i-a],0):r;for(;a<i;)e.insertBefore(s(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(s(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 r=s(t[--o],-1).nextSibling;e.insertBefore(s(n[a++],1),s(t[c++],-1).nextSibling),e.insertBefore(s(n[--i],1),r),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 r=u.get(t[c]);if(a<r&&r<i){let l=c,h=1;for(;++l<o&&l<i&&u.get(t[l])===r+h;)h++;if(h>r-a){const l=s(t[c],0);for(;a<r;)e.insertBefore(s(n[a++],1),l)}else e.replaceChild(s(n[a++],1),s(t[c++],-1))}else c++}else e.removeChild(s(t[c++],-1))}return n})(e.parentNode,r,n,h,e):(r.length&&c(r[0],r.at(-1),!1),t),L=new Map([["aria",(e,t)=>{for(const n in t){const s=t[n],r="role"===n?n:`aria-${n}`;null==s?w(e,r):N(e,r,s)}return t}],["class",(e,t)=>M(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?M(e,t,"style"):E(e.style,t,"cssText")]]),z=(e,t,n)=>{switch(t[0]){case".":return S;case"?":return B;case"@":return A;default:return n||"ownerSVGElement"in e?"ref"===t?O:T:L.get(t)||(t in e?t.startsWith("on")?E:M:T)}},F=(e,t)=>(e.textContent=null==t?"":t,t);let R,Z,D=document.createElement("template");var G=(e,t)=>{if(t)return R||(R=document.createElementNS("http://www.w3.org/2000/svg","svg"),Z=n(),Z.selectNodeContents(R)),Z.createContextualFragment(e);D.innerHTML=e;const{content:s}=D;return D=D.cloneNode(!1),s};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},P=(n,l,o)=>{const i=G(((e,t,n)=>{let s=0;return e.join("").trim().replace(x,((e,t,s,r)=>`<${t}${s.replace($,"=$2$1").trimEnd()}${r?n||v.test(t)?" /":`></${t}`:""}>`)).replace(b,(e=>""===e?`\x3c!--${t+s++}--\x3e`:t+s++))})(n,_,o),o),{length:c}=n;let a=!1,u=t;if(c>1){const t=document.createTreeWalker(i,129),n=[];let s=0,h=`${_}${s++}`;for(u=[];s<c;){const i=t.nextNode();if(8===i.nodeType){if(i.data===h){let t=e(l[s-1])?y:k;t===k?n.push(i):a=!0,u.push(r(8,H(i),t)),h=`${_}${s++}`}}else{let e;for(;i.hasAttribute(h);){e||(e=H(i));const t=i.getAttribute(h);u.push(r(2,e,z(i,t,o),t)),w(i,h),h=`${_}${s++}`}m.test(i.localName)&&i.textContent.trim()===`\x3c!--${h}--\x3e`&&(u.push(r(3,e||H(i),F)),h=`${_}${s++}`)}}for(s=0;s<n.length;s++)n[s].replaceWith(document.createTextNode(""))}const h=i.childNodes.length;return s(V,n,((e,t,n)=>({c:e,e:t,l:n}))(i,u,1===h&&a?0:h))},V=new WeakMap,_="isµ";var q=e=>(t,n)=>V.get(t)||P(t,n,e);const I=g(q(!1)),J=g(q(!0)),K=(e,{s:n,t:s,v:r})=>{r.length&&e.s===t&&(e.s=[]);const l=Q(e,r);if(e.t!==s){const{n:t,d:l}=(n?J:I)(s,r);e.t=s,e.n=t,e.d=l}else{const{d:t}=e;for(let e=0;e<l;e++){const n=r[e],s=t[e],{v:l}=s;if(n!==l){const{u:e,t:t,n:r}=s;s.v=e(t,n,r,l)}}}return e.n},Q=({s:n},s)=>{const{length:r}=s;for(let o=0;o<r;o++){const r=s[o];r instanceof U?s[o]=K(n[o]||(n[o]=l(t)),r):e(r)?Q(n[o]||(n[o]=l([])),r):n[o]=null}return r<n.length&&n.splice(r),r};class U{constructor(e,t,n){this.s=e,this.t=t,this.v=n}}const X=new WeakMap;var Y=(e,n)=>{const r=X.get(e)||s(X,e,l(t));return r.n!==K(r,"function"==typeof n?n():n)&&e.replaceChildren(r.n),e}; | ||
/*! (c) Andrea Giammarchi - MIT */const ee=e=>(t,...n)=>new U(e,t,n),te=ee(!1),ne=ee(!0);export{U as Hole,L as attr,te as html,Y as render,ne as svg}; |
@@ -1,2 +0,2 @@ | ||
var e=e=>function(t){const{constructor:n}=e.createDocumentFragment(),{isArray:s}=Array,r=[],l=()=>e.createRange(),o=(e,t,n)=>(e.set(t,n),n),i=(e,t,n,s="")=>({t:e,p:t,u:n,n:s}),c=e=>({s:e,t:null,n:null,d:r}),{setPrototypeOf:a}=Object;let u;var h=(e,t,n)=>(u||(u=l()),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;class g extends((e=>{function t(e){return a(e,new.target.prototype)}return t.prototype=e.prototype,t})(n)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,f=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){d(this,!1)}replaceWith(e){d(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const m=(e,t)=>t.reduceRight(v,e),v=(e,t)=>e.childNodes[t];var x=e=>(t,n)=>{const{c:s,e:l,l:o}=e(t,n),i=s.cloneNode(!0);let c,a,u=l.length,h=u?l.slice(0):r;for(;u--;){const{t:e,p:t,u:s,n:o}=l[u],d=t===a?c:c=m(i,a=t),f=8===e?s():s;h[u]={v:f(d,n[u],o,r),u:f,t:d,n:o}}return((e,t)=>({n:e,d:t}))(1===o?i.firstChild:new g(i),h)};const b=/^(?:plaintext|script|style|textarea|title|xmp)$/i,w=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,$=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,N=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,y=/[\x01\x02]/g;const C=(e,t,n)=>{e.setAttribute(t,n)},A=(e,t)=>{e.removeAttribute(t)},W=()=>z;let k;const M=(e,t,n)=>{n=n.slice(1),k||(k=new WeakMap);const r=k.get(e)||o(k,e,{});let l=r[n];return l&&l[0]&&e.removeEventListener(n,...l),l=s(t)?t:[t,!1],r[n]=l,l[0]&&e.addEventListener(n,...l),t};function E(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const S=()=>E.bind({n:null}),O=(e,t,n)=>e[n]=t,T=(e,t,n)=>O(e,t,n.slice(1)),B=(e,t,n)=>null==t?(A(e,n),t):O(e,t,n),F=(e,t)=>("function"==typeof t?t(e):t.current=e,t),j=(e,t,n)=>(null==t?A(e,n):C(e,n,t),t),L=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),z=(e,t,n,s)=>t.length?((e,t,n,s,r)=>{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?s(n[a-1],-0).nextSibling:s(n[i-a],0):r;for(;a<i;)e.insertBefore(s(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(s(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 r=s(t[--o],-1).nextSibling;e.insertBefore(s(n[a++],1),s(t[c++],-1).nextSibling),e.insertBefore(s(n[--i],1),r),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 r=u.get(t[c]);if(a<r&&r<i){let l=c,h=1;for(;++l<o&&l<i&&u.get(t[l])===r+h;)h++;if(h>r-a){const l=s(t[c],0);for(;a<r;)e.insertBefore(s(n[a++],1),l)}else e.replaceChild(s(n[a++],1),s(t[c++],-1))}else c++}else e.removeChild(s(t[c++],-1))}return n})(e.parentNode,s,t,p,e):(h(s[0],s.at(-1),!1),r),H=new Map([["aria",(e,t)=>{for(const n in t){const s=t[n],r="role"===n?n:`aria-${n}`;null==s?A(e,r):C(e,r,s)}return t}],["class",(e,t)=>B(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",F],["style",(e,t)=>null==t?B(e,t,"style"):O(e.style,t,"cssText")]]),R=(e,t,n)=>{switch(t[0]){case".":return T;case"?":return L;case"@":return M;default:return n||"ownerSVGElement"in e?"ref"===t?F:j:H.get(t)||(t in e?t.startsWith("on")?O:B:j)}},Z=(e,t)=>(e.textContent=null==t?"":t,t);let D,G,P=e.createElement("template");var V=(t,n)=>{if(n)return D||(D=e.createElementNS("http://www.w3.org/2000/svg","svg"),G=l(),G.selectNodeContents(D)),G.createContextualFragment(t);P.innerHTML=t;const{content:s}=P;return P=P.cloneNode(!1),s};const _=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},q=(t,n,l)=>{const c=V(((e,t,n)=>{let s=0;return e.join("").trim().replace($,((e,t,s,r)=>`<${t}${s.replace(N,"=$2$1").trimEnd()}${r?n||w.test(t)?" /":`></${t}`:""}>`)).replace(y,(e=>""===e?`\x3c!--${t+s++}--\x3e`:t+s++))})(t,J,l),l),{length:a}=t;let u=!1,h=r;if(a>1){const t=e.createTreeWalker(c,129),r=[];let o=0,d=`${J}${o++}`;for(h=[];o<a;){const e=t.nextNode();if(8===e.nodeType){if(e.data===d){let t=s(n[o-1])?W:S;t===S?r.push(e):u=!0,h.push(i(8,_(e),t)),d=`${J}${o++}`}}else{let t;for(;e.hasAttribute(d);){t||(t=_(e));const n=e.getAttribute(d);h.push(i(2,t,R(e,n,l),n)),A(e,d),d=`${J}${o++}`}b.test(e.localName)&&e.textContent.trim()===`\x3c!--${d}--\x3e`&&(h.push(i(3,t||_(e),Z)),d=`${J}${o++}`)}}for(o=0;o<r.length;o++)r[o].replaceWith(e.createTextNode(""))}const d=c.childNodes.length;return o(I,t,((e,t,n)=>({c:e,e:t,l:n}))(c,h,1===d&&u?0:d))},I=new WeakMap,J="isµ";var K=e=>(t,n)=>I.get(t)||q(t,n,e);const Q=x(K(!1)),U=x(K(!0)),X=(e,{s:t,t:n,v:s})=>{s.length&&e.s===r&&(e.s=[]);const l=Y(e,s);if(e.t!==n){const{n:r,d:l}=(t?U:Q)(n,s);e.t=n,e.n=r,e.d=l}else{const{d:t}=e;for(let e=0;e<l;e++){const n=s[e],r=t[e],{v:l}=r;if(n!==l){const{u:e,t:t,n:s}=r;r.v=e(t,n,s,l)}}}return e.n},Y=({s:e},t)=>{const{length:n}=t;for(let l=0;l<n;l++){const n=t[l];n instanceof ee?t[l]=X(e[l]||(e[l]=c(r)),n):s(n)?Y(e[l]||(e[l]=c([])),n):e[l]=null}return n<e.length&&e.splice(n),n};class ee{constructor(e,t,n){this.s=e,this.t=t,this.v=n}} | ||
var e=e=>function(t){const{constructor:n}=e.createDocumentFragment(),{isArray:s}=Array,r=[],l=()=>e.createRange(),o=(e,t,n)=>(e.set(t,n),n),i=(e,t,n,s="")=>({t:e,p:t,u:n,n:s}),c=e=>({s:e,t:null,n:null,d:r}),{setPrototypeOf:a}=Object;let u;var h=(e,t,n)=>(u||(u=l()),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;class g extends((e=>{function t(e){return a(e,new.target.prototype)}return t.prototype=e.prototype,t})(n)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,f=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){d(this,!1)}replaceWith(e){d(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const m=(e,t)=>t.reduceRight(v,e),v=(e,t)=>e.childNodes[t];var x=e=>(t,n)=>{const{c:s,e:l,l:o}=e(t,n),i=s.cloneNode(!0);let c,a,u=l.length,h=u?l.slice(0):r;for(;u--;){const{t:e,p:t,u:s,n:o}=l[u],d=t===a?c:c=m(i,a=t),f=8===e?s():s;h[u]={v:f(d,n[u],o,r),u:f,t:d,n:o}}return((e,t)=>({n:e,d:t}))(1===o?i.firstChild:new g(i),h)};const b=/^(?:plaintext|script|style|textarea|title|xmp)$/i,w=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,$=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,N=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,y=/[\x01\x02]/g;const C=(e,t,n)=>{e.setAttribute(t,n)},A=(e,t)=>{e.removeAttribute(t)},W=()=>z;let k;const M=(e,t,n)=>{n=n.slice(1),k||(k=new WeakMap);const r=k.get(e)||o(k,e,{});let l=r[n];return l&&l[0]&&e.removeEventListener(n,...l),l=s(t)?t:[t,!1],r[n]=l,l[0]&&e.addEventListener(n,...l),t};function E(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const S=()=>E.bind({n:null}),O=(e,t,n)=>e[n]=t,T=(e,t,n)=>O(e,t,n.slice(1)),B=(e,t,n)=>null==t?(A(e,n),t):O(e,t,n),F=(e,t)=>("function"==typeof t?t(e):t.current=e,t),j=(e,t,n)=>(null==t?A(e,n):C(e,n,t),t),L=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),z=(e,t,n,s)=>t.length?((e,t,n,s,r)=>{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?s(n[a-1],-0).nextSibling:s(n[i-a],0):r;for(;a<i;)e.insertBefore(s(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(s(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 r=s(t[--o],-1).nextSibling;e.insertBefore(s(n[a++],1),s(t[c++],-1).nextSibling),e.insertBefore(s(n[--i],1),r),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 r=u.get(t[c]);if(a<r&&r<i){let l=c,h=1;for(;++l<o&&l<i&&u.get(t[l])===r+h;)h++;if(h>r-a){const l=s(t[c],0);for(;a<r;)e.insertBefore(s(n[a++],1),l)}else e.replaceChild(s(n[a++],1),s(t[c++],-1))}else c++}else e.removeChild(s(t[c++],-1))}return n})(e.parentNode,s,t,p,e):(s.length&&h(s[0],s.at(-1),!1),r),H=new Map([["aria",(e,t)=>{for(const n in t){const s=t[n],r="role"===n?n:`aria-${n}`;null==s?A(e,r):C(e,r,s)}return t}],["class",(e,t)=>B(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",F],["style",(e,t)=>null==t?B(e,t,"style"):O(e.style,t,"cssText")]]),R=(e,t,n)=>{switch(t[0]){case".":return T;case"?":return L;case"@":return M;default:return n||"ownerSVGElement"in e?"ref"===t?F:j:H.get(t)||(t in e?t.startsWith("on")?O:B:j)}},Z=(e,t)=>(e.textContent=null==t?"":t,t);let D,G,P=e.createElement("template");var V=(t,n)=>{if(n)return D||(D=e.createElementNS("http://www.w3.org/2000/svg","svg"),G=l(),G.selectNodeContents(D)),G.createContextualFragment(t);P.innerHTML=t;const{content:s}=P;return P=P.cloneNode(!1),s};const _=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},q=(t,n,l)=>{const c=V(((e,t,n)=>{let s=0;return e.join("").trim().replace($,((e,t,s,r)=>`<${t}${s.replace(N,"=$2$1").trimEnd()}${r?n||w.test(t)?" /":`></${t}`:""}>`)).replace(y,(e=>""===e?`\x3c!--${t+s++}--\x3e`:t+s++))})(t,J,l),l),{length:a}=t;let u=!1,h=r;if(a>1){const t=e.createTreeWalker(c,129),r=[];let o=0,d=`${J}${o++}`;for(h=[];o<a;){const e=t.nextNode();if(8===e.nodeType){if(e.data===d){let t=s(n[o-1])?W:S;t===S?r.push(e):u=!0,h.push(i(8,_(e),t)),d=`${J}${o++}`}}else{let t;for(;e.hasAttribute(d);){t||(t=_(e));const n=e.getAttribute(d);h.push(i(2,t,R(e,n,l),n)),A(e,d),d=`${J}${o++}`}b.test(e.localName)&&e.textContent.trim()===`\x3c!--${d}--\x3e`&&(h.push(i(3,t||_(e),Z)),d=`${J}${o++}`)}}for(o=0;o<r.length;o++)r[o].replaceWith(e.createTextNode(""))}const d=c.childNodes.length;return o(I,t,((e,t,n)=>({c:e,e:t,l:n}))(c,h,1===d&&u?0:d))},I=new WeakMap,J="isµ";var K=e=>(t,n)=>I.get(t)||q(t,n,e);const Q=x(K(!1)),U=x(K(!0)),X=(e,{s:t,t:n,v:s})=>{s.length&&e.s===r&&(e.s=[]);const l=Y(e,s);if(e.t!==n){const{n:r,d:l}=(t?U:Q)(n,s);e.t=n,e.n=r,e.d=l}else{const{d:t}=e;for(let e=0;e<l;e++){const n=s[e],r=t[e],{v:l}=r;if(n!==l){const{u:e,t:t,n:s}=r;r.v=e(t,n,s,l)}}}return e.n},Y=({s:e},t)=>{const{length:n}=t;for(let l=0;l<n;l++){const n=t[l];n instanceof ee?t[l]=X(e[l]||(e[l]=c(r)),n):s(n)?Y(e[l]||(e[l]=c([])),n):e[l]=null}return n<e.length&&e.splice(n),n};class ee{constructor(e,t,n){this.s=e,this.t=t,this.v=n}} | ||
/*! (c) Andrea Giammarchi - MIT */const te=e=>(t,...n)=>new ee(e,t,n),ne=te(!1),se=te(!0),re=new WeakMap;const le=new WeakMap,oe=e=>(t,n)=>{const s=le.get(t)||o(le,t,new Map);return s.get(n)||o(s,n,function(t,...n){return X(this,new ee(e,t,n))}.bind(c(r)))},ie=oe(!1),ce=oe(!0);return t.Hole=ee,t.attr=H,t.html=ne,t.htmlFor=ie,t.render=(e,t)=>{const n=re.get(e)||o(re,e,c(r)),s="function"==typeof t?t():t,{n:l}=n,i=s instanceof ee?X(n,s):s;return l!==i&&e.replaceChildren(n.n=i),e},t.svg=se,t.svgFor=ce,t}({});export{e as default}; |
@@ -1,2 +0,2 @@ | ||
const{isArray:e}=Array,t=[],n=()=>document.createRange(),s=(e,t,n)=>(e.set(t,n),n),r=(e,t,n,s="")=>({t:e,p:t,u:n,n:s}),l=e=>({s:e,t:null,n:null,d:t}),{setPrototypeOf:o}=Object;let i;var c=(e,t,s)=>(i||(i=n()),s?i.setStartAfter(e):i.setStartBefore(e),i.setEndAfter(t),i.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;class d extends((e=>{function t(e){return o(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,u=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const f=(e,t)=>t.reduceRight(p,e),p=(e,t)=>e.childNodes[t];var g=e=>(n,s)=>{const{c:r,e:l,l:o}=e(n,s),i=r.cloneNode(!0);let c,a,u=l.length,h=u?l.slice(0):t;for(;u--;){const{t:e,p:n,u:r,n:o}=l[u],d=n===a?c:c=f(i,a=n),p=8===e?r():r;h[u]={v:p(d,s[u],o,t),u:p,t:d,n:o}}return((e,t)=>({n:e,d:t}))(1===o?i.firstChild:new d(i),h)};const m=/^(?: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,x=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,b=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,w=/[\x01\x02]/g;const $=(e,t,n)=>{e.setAttribute(t,n)},N=(e,t)=>{e.removeAttribute(t)},y=()=>j;let C;const A=(t,n,r)=>{r=r.slice(1),C||(C=new WeakMap);const l=C.get(t)||s(C,t,{});let o=l[r];return o&&o[0]&&t.removeEventListener(r,...o),o=e(n)?n:[n,!1],l[r]=o,o[0]&&t.addEventListener(r,...o),n};function W(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const k=()=>W.bind({n:null}),M=(e,t,n)=>e[n]=t,E=(e,t,n)=>M(e,t,n.slice(1)),S=(e,t,n)=>null==t?(N(e,n),t):M(e,t,n),O=(e,t)=>("function"==typeof t?t(e):t.current=e,t),T=(e,t,n)=>(null==t?N(e,n):$(e,n,t),t),B=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),j=(e,n,s,r)=>n.length?((e,t,n,s,r)=>{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?s(n[a-1],-0).nextSibling:s(n[i-a],0):r;for(;a<i;)e.insertBefore(s(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(s(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 r=s(t[--o],-1).nextSibling;e.insertBefore(s(n[a++],1),s(t[c++],-1).nextSibling),e.insertBefore(s(n[--i],1),r),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 r=u.get(t[c]);if(a<r&&r<i){let l=c,h=1;for(;++l<o&&l<i&&u.get(t[l])===r+h;)h++;if(h>r-a){const l=s(t[c],0);for(;a<r;)e.insertBefore(s(n[a++],1),l)}else e.replaceChild(s(n[a++],1),s(t[c++],-1))}else c++}else e.removeChild(s(t[c++],-1))}return n})(e.parentNode,r,n,h,e):(c(r[0],r.at(-1),!1),t),L=new Map([["aria",(e,t)=>{for(const n in t){const s=t[n],r="role"===n?n:`aria-${n}`;null==s?N(e,r):$(e,r,s)}return t}],["class",(e,t)=>S(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?S(e,t,"style"):M(e.style,t,"cssText")]]),z=(e,t,n)=>{switch(t[0]){case".":return E;case"?":return B;case"@":return A;default:return n||"ownerSVGElement"in e?"ref"===t?O:T:L.get(t)||(t in e?t.startsWith("on")?M:S:T)}},F=(e,t)=>(e.textContent=null==t?"":t,t);let R,Z,D=document.createElement("template");var G=(e,t)=>{if(t)return R||(R=document.createElementNS("http://www.w3.org/2000/svg","svg"),Z=n(),Z.selectNodeContents(R)),Z.createContextualFragment(e);D.innerHTML=e;const{content:s}=D;return D=D.cloneNode(!1),s};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},P=(n,l,o)=>{const i=G(((e,t,n)=>{let s=0;return e.join("").trim().replace(x,((e,t,s,r)=>`<${t}${s.replace(b,"=$2$1").trimEnd()}${r?n||v.test(t)?" /":`></${t}`:""}>`)).replace(w,(e=>""===e?`\x3c!--${t+s++}--\x3e`:t+s++))})(n,_,o),o),{length:c}=n;let a=!1,u=t;if(c>1){const t=document.createTreeWalker(i,129),n=[];let s=0,h=`${_}${s++}`;for(u=[];s<c;){const i=t.nextNode();if(8===i.nodeType){if(i.data===h){let t=e(l[s-1])?y:k;t===k?n.push(i):a=!0,u.push(r(8,H(i),t)),h=`${_}${s++}`}}else{let e;for(;i.hasAttribute(h);){e||(e=H(i));const t=i.getAttribute(h);u.push(r(2,e,z(i,t,o),t)),N(i,h),h=`${_}${s++}`}m.test(i.localName)&&i.textContent.trim()===`\x3c!--${h}--\x3e`&&(u.push(r(3,e||H(i),F)),h=`${_}${s++}`)}}for(s=0;s<n.length;s++)n[s].replaceWith(document.createTextNode(""))}const h=i.childNodes.length;return s(V,n,((e,t,n)=>({c:e,e:t,l:n}))(i,u,1===h&&a?0:h))},V=new WeakMap,_="isµ";var q=e=>(t,n)=>V.get(t)||P(t,n,e);const I=g(q(!1)),J=g(q(!0)),K=(e,{s:n,t:s,v:r})=>{r.length&&e.s===t&&(e.s=[]);const l=Q(e,r);if(e.t!==s){const{n:t,d:l}=(n?J:I)(s,r);e.t=s,e.n=t,e.d=l}else{const{d:t}=e;for(let e=0;e<l;e++){const n=r[e],s=t[e],{v:l}=s;if(n!==l){const{u:e,t:t,n:r}=s;s.v=e(t,n,r,l)}}}return e.n},Q=({s:n},s)=>{const{length:r}=s;for(let o=0;o<r;o++){const r=s[o];r instanceof U?s[o]=K(n[o]||(n[o]=l(t)),r):e(r)?Q(n[o]||(n[o]=l([])),r):n[o]=null}return r<n.length&&n.splice(r),r};class U{constructor(e,t,n){this.s=e,this.t=t,this.v=n}} | ||
const{isArray:e}=Array,t=[],n=()=>document.createRange(),s=(e,t,n)=>(e.set(t,n),n),r=(e,t,n,s="")=>({t:e,p:t,u:n,n:s}),l=e=>({s:e,t:null,n:null,d:t}),{setPrototypeOf:o}=Object;let i;var c=(e,t,s)=>(i||(i=n()),s?i.setStartAfter(e):i.setStartBefore(e),i.setEndAfter(t),i.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;class d extends((e=>{function t(e){return o(e,new.target.prototype)}return t.prototype=e.prototype,t})(DocumentFragment)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,u=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){a(this,!1)}replaceWith(e){a(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const f=(e,t)=>t.reduceRight(p,e),p=(e,t)=>e.childNodes[t];var g=e=>(n,s)=>{const{c:r,e:l,l:o}=e(n,s),i=r.cloneNode(!0);let c,a,u=l.length,h=u?l.slice(0):t;for(;u--;){const{t:e,p:n,u:r,n:o}=l[u],d=n===a?c:c=f(i,a=n),p=8===e?r():r;h[u]={v:p(d,s[u],o,t),u:p,t:d,n:o}}return((e,t)=>({n:e,d:t}))(1===o?i.firstChild:new d(i),h)};const m=/^(?: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,x=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,b=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,w=/[\x01\x02]/g;const $=(e,t,n)=>{e.setAttribute(t,n)},N=(e,t)=>{e.removeAttribute(t)},y=()=>j;let C;const A=(t,n,r)=>{r=r.slice(1),C||(C=new WeakMap);const l=C.get(t)||s(C,t,{});let o=l[r];return o&&o[0]&&t.removeEventListener(r,...o),o=e(n)?n:[n,!1],l[r]=o,o[0]&&t.addEventListener(r,...o),n};function W(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const k=()=>W.bind({n:null}),M=(e,t,n)=>e[n]=t,E=(e,t,n)=>M(e,t,n.slice(1)),S=(e,t,n)=>null==t?(N(e,n),t):M(e,t,n),O=(e,t)=>("function"==typeof t?t(e):t.current=e,t),T=(e,t,n)=>(null==t?N(e,n):$(e,n,t),t),B=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),j=(e,n,s,r)=>n.length?((e,t,n,s,r)=>{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?s(n[a-1],-0).nextSibling:s(n[i-a],0):r;for(;a<i;)e.insertBefore(s(n[a++],1),t)}else if(i===a)for(;c<o;)u&&u.has(t[c])||e.removeChild(s(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 r=s(t[--o],-1).nextSibling;e.insertBefore(s(n[a++],1),s(t[c++],-1).nextSibling),e.insertBefore(s(n[--i],1),r),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 r=u.get(t[c]);if(a<r&&r<i){let l=c,h=1;for(;++l<o&&l<i&&u.get(t[l])===r+h;)h++;if(h>r-a){const l=s(t[c],0);for(;a<r;)e.insertBefore(s(n[a++],1),l)}else e.replaceChild(s(n[a++],1),s(t[c++],-1))}else c++}else e.removeChild(s(t[c++],-1))}return n})(e.parentNode,r,n,h,e):(r.length&&c(r[0],r.at(-1),!1),t),L=new Map([["aria",(e,t)=>{for(const n in t){const s=t[n],r="role"===n?n:`aria-${n}`;null==s?N(e,r):$(e,r,s)}return t}],["class",(e,t)=>S(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?S(e,t,"style"):M(e.style,t,"cssText")]]),z=(e,t,n)=>{switch(t[0]){case".":return E;case"?":return B;case"@":return A;default:return n||"ownerSVGElement"in e?"ref"===t?O:T:L.get(t)||(t in e?t.startsWith("on")?M:S:T)}},F=(e,t)=>(e.textContent=null==t?"":t,t);let R,Z,D=document.createElement("template");var G=(e,t)=>{if(t)return R||(R=document.createElementNS("http://www.w3.org/2000/svg","svg"),Z=n(),Z.selectNodeContents(R)),Z.createContextualFragment(e);D.innerHTML=e;const{content:s}=D;return D=D.cloneNode(!1),s};const H=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},P=(n,l,o)=>{const i=G(((e,t,n)=>{let s=0;return e.join("").trim().replace(x,((e,t,s,r)=>`<${t}${s.replace(b,"=$2$1").trimEnd()}${r?n||v.test(t)?" /":`></${t}`:""}>`)).replace(w,(e=>""===e?`\x3c!--${t+s++}--\x3e`:t+s++))})(n,_,o),o),{length:c}=n;let a=!1,u=t;if(c>1){const t=document.createTreeWalker(i,129),n=[];let s=0,h=`${_}${s++}`;for(u=[];s<c;){const i=t.nextNode();if(8===i.nodeType){if(i.data===h){let t=e(l[s-1])?y:k;t===k?n.push(i):a=!0,u.push(r(8,H(i),t)),h=`${_}${s++}`}}else{let e;for(;i.hasAttribute(h);){e||(e=H(i));const t=i.getAttribute(h);u.push(r(2,e,z(i,t,o),t)),N(i,h),h=`${_}${s++}`}m.test(i.localName)&&i.textContent.trim()===`\x3c!--${h}--\x3e`&&(u.push(r(3,e||H(i),F)),h=`${_}${s++}`)}}for(s=0;s<n.length;s++)n[s].replaceWith(document.createTextNode(""))}const h=i.childNodes.length;return s(V,n,((e,t,n)=>({c:e,e:t,l:n}))(i,u,1===h&&a?0:h))},V=new WeakMap,_="isµ";var q=e=>(t,n)=>V.get(t)||P(t,n,e);const I=g(q(!1)),J=g(q(!0)),K=(e,{s:n,t:s,v:r})=>{r.length&&e.s===t&&(e.s=[]);const l=Q(e,r);if(e.t!==s){const{n:t,d:l}=(n?J:I)(s,r);e.t=s,e.n=t,e.d=l}else{const{d:t}=e;for(let e=0;e<l;e++){const n=r[e],s=t[e],{v:l}=s;if(n!==l){const{u:e,t:t,n:r}=s;s.v=e(t,n,r,l)}}}return e.n},Q=({s:n},s)=>{const{length:r}=s;for(let o=0;o<r;o++){const r=s[o];r instanceof U?s[o]=K(n[o]||(n[o]=l(t)),r):e(r)?Q(n[o]||(n[o]=l([])),r):n[o]=null}return r<n.length&&n.splice(r),r};class U{constructor(e,t,n){this.s=e,this.t=t,this.v=n}} | ||
/*! (c) Andrea Giammarchi - MIT */const X=e=>(t,...n)=>new U(e,t,n),Y=X(!1),ee=X(!0),te=new WeakMap;var ne=(e,n)=>{const r=te.get(e)||s(te,e,l(t)),o="function"==typeof n?n():n,{n:i}=r,c=o instanceof U?K(r,o):o;return i!==c&&e.replaceChildren(r.n=c),e};const se=new WeakMap,re=e=>(n,r)=>{const o=se.get(n)||s(se,n,new Map);return o.get(r)||s(o,r,function(t,...n){return K(this,new U(e,t,n))}.bind(l(t)))},le=re(!1),oe=re(!0);export{U as Hole,L as attr,Y as html,le as htmlFor,ne as render,ee as svg,oe as svgFor}; |
@@ -1,3 +0,3 @@ | ||
const{setPrototypeOf:e}=Object;const{isArray:t}=Array,n=[],r=()=>document.createRange(),s=(e,t,n)=>(e.set(t,n),n);let l;var o=(e,t,n)=>(l||(l=r()),n?l.setStartAfter(e):l.setStartBefore(e),l.setEndAfter(t),l.deleteContents(),e);const i=({firstChild:e,lastChild:t},n)=>o(e,t,n);let c=!1;const a=(e,t)=>c&&11===e.nodeType?1/t<0?t?i(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e;class u extends((t=>{function n(t){return e(t,new.target.prototype)}return n.prototype=t.prototype,n})(DocumentFragment)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,c=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){i(this,!1)}replaceWith(e){i(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const h=(e,t,n,r="")=>({t:e,p:t,u:n,n:r}),d=(e,t)=>t.reduceRight(f,e),f=(e,t)=>e.childNodes[t];const p=/^(?:plaintext|script|style|textarea|title|xmp)$/i,g=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,m=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,x=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,$=/[\x01\x02]/g;const b=(e,t,n)=>{e.setAttribute(t,n)},v=(e,t)=>{e.removeAttribute(t)},N=()=>B;let y;const C=(e,n,r)=>{r=r.slice(1),y||(y=new WeakMap);const l=y.get(e)||s(y,e,{});let o=l[r];return o&&o[0]&&e.removeEventListener(r,...o),o=t(n)?n:[n,!1],l[r]=o,o[0]&&e.addEventListener(r,...o),n};function w(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const A=()=>w.bind({n:null}),W=(e,t,n)=>e[n]=t,k=(e,t,n)=>W(e,t,n.slice(1)),E=(e,t,n)=>null==t?(v(e,n),t):W(e,t,n),S=(e,t)=>("function"==typeof t?t(e):t.current=e,t),O=(e,t,n)=>(null==t?v(e,n):b(e,n,t),t),T=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),B=(e,t,r,s)=>t.length?((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,h=1;for(;++l<o&&l<i&&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,s,t,a,e):(o(s[0],s.at(-1),!1),n),M=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?v(e,s):b(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",S],["style",(e,t)=>null==t?E(e,t,"style"):W(e.style,t,"cssText")]]),j=(e,t,n)=>{switch(t[0]){case".":return k;case"?":return T;case"@":return C;default:return n||"ownerSVGElement"in e?"ref"===t?S:O:M.get(t)||(t in e?t.startsWith("on")?W:E:O)}},L=(e,t)=>(e.textContent=null==t?"":t,t);let z,F,R=document.createElement("template");var Z=(e,t)=>{if(t)return z||(z=document.createElementNS("http://www.w3.org/2000/svg","svg"),F=r(),F.selectNodeContents(z)),F.createContextualFragment(e);R.innerHTML=e;const{content:n}=R;return R=R.cloneNode(!1),n};const D=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},G=(e,r,l)=>{const o=Z(((e,t,n)=>{let r=0;return e.join("").trim().replace(m,((e,t,r,s)=>`<${t}${r.replace(x,"=$2$1").trimEnd()}${s?n||g.test(t)?" /":`></${t}`:""}>`)).replace($,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(e,P,l),l),{length:i}=e;let c=!1,a=n;if(i>1){const e=document.createTreeWalker(o,129),n=[];let s=0,u=`${P}${s++}`;for(a=[];s<i;){const o=e.nextNode();if(8===o.nodeType){if(o.data===u){let e=t(r[s-1])?N:A;e===A?n.push(o):c=!0,a.push(h(8,D(o),e)),u=`${P}${s++}`}}else{let e;for(;o.hasAttribute(u);){e||(e=D(o));const t=o.getAttribute(u);a.push(h(2,e,j(o,t,l),t)),v(o,u),u=`${P}${s++}`}p.test(o.localName)&&o.textContent.trim()===`\x3c!--${u}--\x3e`&&(a.push(h(3,e||D(o),L)),u=`${P}${s++}`)}}for(s=0;s<n.length;s++)n[s].replaceWith(document.createTextNode(""))}const u=o.childNodes.length;return s(H,e,((e,t,n)=>({c:e,e:t,l:n}))(o,a,1===u&&c?0:u))},H=new WeakMap,P="isµ";var V=(e,t)=>(e.replaceChildren("function"==typeof t?t():t),e); | ||
const{setPrototypeOf:e}=Object;const{isArray:t}=Array,n=[],r=()=>document.createRange(),s=(e,t,n)=>(e.set(t,n),n);let l;var o=(e,t,n)=>(l||(l=r()),n?l.setStartAfter(e):l.setStartBefore(e),l.setEndAfter(t),l.deleteContents(),e);const i=({firstChild:e,lastChild:t},n)=>o(e,t,n);let c=!1;const a=(e,t)=>c&&11===e.nodeType?1/t<0?t?i(e,!0):e.lastChild:t?e.valueOf():e.firstChild:e;class u extends((t=>{function n(t){return e(t,new.target.prototype)}return n.prototype=t.prototype,n})(DocumentFragment)){#e;#t;constructor(e){const t=[...e.childNodes];super(e),this.#e=t,this.#t=t.length,c=!0}get firstChild(){return this.#e[0]}get lastChild(){return this.#e.at(-1)}get parentNode(){return this.#e[0].parentNode}remove(){i(this,!1)}replaceWith(e){i(this,!0).replaceWith(e)}valueOf(){return this.childNodes.length!==this.#t&&this.append(...this.#e),this}}const h=(e,t,n,r="")=>({t:e,p:t,u:n,n:r}),d=(e,t)=>t.reduceRight(f,e),f=(e,t)=>e.childNodes[t];const p=/^(?:plaintext|script|style|textarea|title|xmp)$/i,g=/^(?:area|base|br|col|embed|hr|img|input|keygen|link|menuitem|meta|param|source|track|wbr)$/i,m=/<([a-zA-Z0-9]+[a-zA-Z0-9:._-]*)([^>]*?)(\/?)>/g,x=/([^\s\\>"'=]+)\s*=\s*(['"]?)\x01/g,$=/[\x01\x02]/g;const b=(e,t,n)=>{e.setAttribute(t,n)},v=(e,t)=>{e.removeAttribute(t)},N=()=>B;let y;const C=(e,n,r)=>{r=r.slice(1),y||(y=new WeakMap);const l=y.get(e)||s(y,e,{});let o=l[r];return o&&o[0]&&e.removeEventListener(r,...o),o=t(n)?n:[n,!1],l[r]=o,o[0]&&e.addEventListener(r,...o),n};function w(e,t){const n=this.n||(this.n=e);switch(typeof t){case"string":case"number":case"boolean":n!==e&&n.replaceWith(this.n=e),this.n.data=t;break;case"object":case"undefined":null==t?(this.n=e).data="":this.n=t.valueOf(),n.replaceWith(this.n)}return t}const A=()=>w.bind({n:null}),W=(e,t,n)=>e[n]=t,k=(e,t,n)=>W(e,t,n.slice(1)),E=(e,t,n)=>null==t?(v(e,n),t):W(e,t,n),S=(e,t)=>("function"==typeof t?t(e):t.current=e,t),O=(e,t,n)=>(null==t?v(e,n):b(e,n,t),t),T=(e,t,n)=>(e.toggleAttribute(n.slice(1),t),t),B=(e,t,r,s)=>t.length?((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,h=1;for(;++l<o&&l<i&&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,s,t,a,e):(s.length&&o(s[0],s.at(-1),!1),n),M=new Map([["aria",(e,t)=>{for(const n in t){const r=t[n],s="role"===n?n:`aria-${n}`;null==r?v(e,s):b(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",S],["style",(e,t)=>null==t?E(e,t,"style"):W(e.style,t,"cssText")]]),j=(e,t,n)=>{switch(t[0]){case".":return k;case"?":return T;case"@":return C;default:return n||"ownerSVGElement"in e?"ref"===t?S:O:M.get(t)||(t in e?t.startsWith("on")?W:E:O)}},L=(e,t)=>(e.textContent=null==t?"":t,t);let z,F,R=document.createElement("template");var Z=(e,t)=>{if(t)return z||(z=document.createElementNS("http://www.w3.org/2000/svg","svg"),F=r(),F.selectNodeContents(z)),F.createContextualFragment(e);R.innerHTML=e;const{content:n}=R;return R=R.cloneNode(!1),n};const D=e=>{const t=[];let n;for(;n=e.parentNode;)t.push(t.indexOf.call(n.childNodes,e)),e=n;return t},G=(e,r,l)=>{const o=Z(((e,t,n)=>{let r=0;return e.join("").trim().replace(m,((e,t,r,s)=>`<${t}${r.replace(x,"=$2$1").trimEnd()}${s?n||g.test(t)?" /":`></${t}`:""}>`)).replace($,(e=>""===e?`\x3c!--${t+r++}--\x3e`:t+r++))})(e,P,l),l),{length:i}=e;let c=!1,a=n;if(i>1){const e=document.createTreeWalker(o,129),n=[];let s=0,u=`${P}${s++}`;for(a=[];s<i;){const o=e.nextNode();if(8===o.nodeType){if(o.data===u){let e=t(r[s-1])?N:A;e===A?n.push(o):c=!0,a.push(h(8,D(o),e)),u=`${P}${s++}`}}else{let e;for(;o.hasAttribute(u);){e||(e=D(o));const t=o.getAttribute(u);a.push(h(2,e,j(o,t,l),t)),v(o,u),u=`${P}${s++}`}p.test(o.localName)&&o.textContent.trim()===`\x3c!--${u}--\x3e`&&(a.push(h(3,e||D(o),L)),u=`${P}${s++}`)}}for(s=0;s<n.length;s++)n[s].replaceWith(document.createTextNode(""))}const u=o.childNodes.length;return s(H,e,((e,t,n)=>({c:e,e:t,l:n}))(o,a,1===u&&c?0:u))},H=new WeakMap,P="isµ";var V=(e,t)=>(e.replaceChildren("function"==typeof t?t():t),e); | ||
/*! (c) Andrea Giammarchi - MIT */ | ||
const _=e=>{const t=(e=>(t,r)=>{const{c:s,e:l,l:o}=e(t,r),i=s.cloneNode(!0);let c,a,h=l.length,f=h?l.slice(0):n;for(;h--;){const{t:e,p:t,u:s,n:o}=l[h],u=t===a?c:c=d(i,a=t),p=8===e?s():s;f[h]={v:p(u,r[h],o,n),u:p,t:u,n:o}}return{n:1===o?i.firstChild:new u(i),d:f}})((r=e,(e,t)=>H.get(e)||G(e,t,r)));var r;return(e,...n)=>t(e,n).n},q=_(!1),I=_(!0);export{M as attr,q as html,V as render,I as svg}; |
{ | ||
"name": "uhtml", | ||
"version": "4.1.20", | ||
"version": "4.1.21", | ||
"description": "A micro HTML/SVG render", | ||
@@ -30,4 +30,4 @@ "main": "./cjs/index.js", | ||
"linkedom": "^0.16.4", | ||
"rollup": "^4.4.1", | ||
"typescript": "^5.2.2" | ||
"rollup": "^4.6.0", | ||
"typescript": "^5.3.2" | ||
}, | ||
@@ -34,0 +34,0 @@ "module": "./esm/index.js", |
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
139388