forked from vanjs-org/van
-
Notifications
You must be signed in to change notification settings - Fork 0
/
van-0.11.3.nomodule.min.js
1 lines (1 loc) · 1.2 KB
/
van-0.11.3.nomodule.min.js
1
{let e,t,n,l,d,r,s,i,o,a,u,w,_,c,v;l=Object,d=Object.getPrototypeOf,r=d({}),s=(e,t,n,l)=>(e??(setTimeout(n,l),new Set)).add(t),i={get val(){return this.t},set val(e){let n=this,l=n.t;e!==l&&(n.l===l?t=s(t,n,_):e===n.l&&t.delete(n),n.t=e,n.i.forEach((t=>t(e,l))))},onnew(e){this.i.push(e)}},o=e=>e.nodeType?e:new Text(e),a=(e,...t)=>t.flat(1/0).forEach((t=>e.appendChild(d(t)===i?c(t,(e=>e)):o(t)))),u=new Proxy(((e,...t)=>{let[n,...s]=d(t[0]??0)===r?t:[{},...t],o=document.createElement(e);return l.entries(n).forEach((([e,t])=>{let n=void 0!==o[e]?t=>o[e]=t:t=>o.setAttribute(e,t);d(t)===i?c(t,(e=>(n(e),o))):d(t)===r?c(...t.deps,((...e)=>(n(t.f(...e)),o))):n(t)})),a(o,...s),o}),{get:(t,n)=>t.bind(e,n)}),w=e=>e.o=e.o.filter((e=>e.u?.isConnected)),_=()=>{let n=[...t];t=e,new Set(n.flatMap(w)).forEach((t=>{let{_:n,u:l,v:d}=t,r=d(...n.map((e=>e.t)),l,...n.map((e=>e.l)));r!==l&&(r!=e?l.replaceWith(t.u=o(r)):(l.remove(),t.u=e))})),n.forEach((e=>e.l=e.t))},v={add:a,tags:u,state:e=>({__proto__:i,t:e,l:e,o:[],i:[]}),bind:c=(...t)=>{let l=t.slice(0,-1),d=t[t.length-1],r=d(...l.map((e=>e.t)));if(r==e)return[];let i={_:l,u:o(r),v:d};return l.forEach((t=>{n=s(n,t,(()=>(n.forEach(w),n=e)),1e3),t.o.push(i)})),i.u}},window.van=v;}