var e;if(void 0===t)var t=Symbol("slot");if(void 0===r)var r=Symbol("text");if(void 0===n)var n=Symbol("html");if(void 0===o)var o=Symbol("class");if(void 0===a)var a=Symbol("attribute");if(void 0===i)var i=Symbol("event");if(void 0===v)var v=Symbol("mount");if(void 0===s)var s=Symbol("unmount");if(void 0===f)var f="SLOT";if(void 0===l)var l=new WeakMap;if(void 0===d)var d=new WeakMap;if(void 0===u)var u=new WeakMap;if(void 0===c)var c=new WeakMap;if(void 0===p)var p=new WeakMap;if(void 0===g)var g=new WeakMap;if(void 0===m)var m=new WeakMap;if(void 0===h)var h=new WeakMap;if(void 0===y)var y=new WeakMap;if(void 0===b)var b={set:x,deleteProperty:x};if(void 0===N)var N={set:S,deleteProperty:S};function S(t,r,n,o){R.debug&&console.log("setIndex",arguments);var a=Number.parseInt(r,10),i=!Number.isNaN(a),v=4===arguments.length,s=2===arguments.length;if("length"===r)for(var f=t.length-1,l=n;l<=f;l+=1){var d=t[l],u=p.get(d),h=c.get(d);u&&M(u[0],u[1],h,d),delete t[l]}if(s&&t[r]){var y=t[r],b=p.get(y),N=c.get(y);M(b[0],b[1],N,y),delete t[r]}if(v&&!i)return e=[],Reflect.set(t,r,n,o);if(v){if(!t.includes(n)){var S=m.get(o),x=S.parentNode,w=g.get(o),k=E(n,w),B=k[0],W=k[1],A=t[r],L=null,C=t.length-1;for(l=a+1;l<=C&&!(L=t[l]);l+=1);if(A&&!t.find((function(e,t){return e===A&&t!==a}))){var O=p.get(A),P=c.get(A);M(O[0],O[1],P,W)}if(L){var T=p.get(L)[0];x.insertBefore(B,T)}else{var j=p.get(o)[1];x.insertBefore(B,j)}return e=[],Reflect.set(t,r,W,o)}var H=t.findIndex((function(e,t){return e===n&&t!==a})),I=t[r];if(I&&n!==I){for(var D=p.get(I),q=D[0],F=D[1],_=p.get(n),z=_[0],G=_[1],J=_[1].nextSibling,K=J.parentNode,Q=z;!Q.isSameNode(G);){var U=Q;Q=Q.nextSibling,K.insertBefore(U,q)}K.insertBefore(G,q);for(var V=q;!V.isSameNode(F);){var X=V;V=V.nextSibling,K.insertBefore(X,J)}K.insertBefore(F,J)}~H&&Reflect.set(t,H,I,o),Reflect.set(t,r,n,o)}return e=[],!0}function x(v,s,f,d){var u=l.get(v),c=4===arguments.length,p=2===arguments.length;if(Object.prototype.hasOwnProperty.call(u,s)){var g=u[s],m=g.node,h=g.type;if(h===r&&f!==m.textContent&&(m.textContent=f),h===n&&f!==m.innerHTML&&(m.innerHTML=f),h===o&&k(m,f),h===a&&w(m,g.name,f),h===i&&W(v,f,g,d),h===t){var y=B(v,s,f,g);if(y)return e=[],Reflect.set(v,s,y,d)}}return p&&delete v[s],c&&Reflect.set(v,s,f,d),e=[],!0}function w(e,t,r){return null==r?e.setAttribute(t,r):e.removeAttribute(t)}function k(e,t){if(t){for(var r=e.classList,n=Object.getPrototypeOf(t),o=n===Set.prototype?t.values():n===Array.prototype?t:n===String.prototype?t.split(" "):[],a=r.values(),i=a.length,v=0;v<i;v+=1){var s=a[v];o.includes(s)||r.remove(s)}for(var f=o.length,l=0;l<f;l+=1){var d=o[l];r.contains(d)||r.add(d)}}else e.removeAttribute("class");return null}function M(t,r,n,o){var a=t,i=a;for(a=a.nextSibling,i.remove();!a.isSameNode(r);)!function(){var e=a;a=a.nextSibling,n?Promise.resolve(n.call(o,e)).then((function(){return e.remove()})):e.remove()}();return e=[],r.remove()}function B(t,r,n,o){if(t[r]||n){var a=o.node,i=o.slot,v=o.template,s=u.get(t),f=s[r],l=a.parentNode,d=P(0,r),g=P(1,r),h=null;if(f){var y=t[r];if(Array.isArray(y))for(var b=y.length,N=0;N<b;N+=1){var S=y[N],x=c.get(S),w=p.get(S);w&&M(w[0],w[1],x,S)}else if(y){var k=c.get(y),B=p.get(y);M(B[0],B[1],k,y)}M(f[0],f[1]),delete s[r]}if(s[r]=[d,g],l.insertBefore(d,a),n)if(Array.isArray(n)){for(var W=O(n,v),A=W[0],L=W[1],C=A.length,R=0;R<C;R+=1){var T=A[R];l.insertBefore(T,a)}m.set(L,a),p.set(L,s[r]),h=L}else{var j=E(n,v),H=j[0],I=j[1];l.insertBefore(H,a),h=I}else for(var D=i.childNodes,q=D.length,F=0;F<q;F+=1){var _=D[F];l.insertBefore(_.cloneNode(!0),a)}return l.insertBefore(g,a),e=[],h}}function W(e,t,r,n){var o=r.node,a=r.event,i=d.get(e),v=i[a];if(v&&o.removeEventListener(a,v,v.options),t){var s=t.bind(n);return s.options=t.options,o.addEventListener(a,s,s.options),i[a]=s}}function A(v){var s=(v.content||v).cloneNode(!0),l={};return function e(v,s){for(var d=v.childNodes.length-1,u=0;u<=d;u+=1){var c=v.childNodes[u];if(c.nodeType===Node.ELEMENT_NODE)if(c.children.length&&e(c,s.concat(u)),c.tagName===f||c.dataset.template){var p=c.dataset.key||c.name,g=P(2,p),m=document.querySelector(c.dataset.template);if(void 0===p)throw new Error("Missing `name` or `data-key` for slot.");v.insertBefore(g,c),l[p]={path:s.concat(u),slot:c,template:m,type:t},c.remove()}else for(var h in c.dataset){var y=c.dataset[h],b=null;switch(h){case"text":b={type:r};break;case"class":b={type:o};break;case"unsafeHtml":b={type:n}}h.startsWith("attribute")&&(b={type:a,name:h.slice(9).toLowerCase()}),h.startsWith("event")&&(b={type:i,event:h.slice(5).toLowerCase()}),b&&(delete c.dataset[h],c.removeAttribute(h),b.path=s.concat(u),l[y]=b)}}}(s,[]),h.set(v,s),e=[],y.set(v,l)}function L(t,r){var n=y.get(r),o={};for(var a in n){var i=n[a],v=C(t,i.path);o[a]=Object.assign({node:v},i)}return e=[],o}function C(e,t){for(var r=e,n=t.length-1,o=0;o<=n;o+=1){var a=t[o];r=r.childNodes[a]}return r}function O(t,r){for(var n,o=[],a=[],i=t.length,v=0;v<i;v+=1){var s=E(t[v],r);o.push(s[0]),a.push(s[1])}return n=new Proxy(a,N),g.set(n,r),e=[],[o,n]}function E(t,r){h.get(r)||A(r);var n=h.get(r).cloneNode(!0),o=new Proxy(t,b),a=L(n,r),i=P(0,"proxy"),f=P(1,"proxy"),g=[i,f],m=t[v],y=t[s],N=document.createDocumentFragment();return m&&m.call(o,n),y&&c.set(o,y),N.appendChild(i),N.appendChild(n),N.appendChild(f),p.set(o,g),l.set(t,a),d.set(t,{}),u.set(t,{}),Object.assign(o,t),e=[],[N,o]}function P(e,t){if(R.debug){var r=(0===e?"start":1===e?"end":"anchor")+" "+t;return document.createComment(r)}return document.createTextNode("")}function R(t,r){return e=[],E(t,r)}export{v as mount,s as unmount};export default R;

var e;if(void 0===t)var t=Symbol("slot");if(void 0===r)var r=Symbol("text");if(void 0===n)var n=Symbol("html");if(void 0===o)var o=Symbol("class");if(void 0===a)var a=Symbol("attribute");if(void 0===i)var i=Symbol("event");if(void 0===v)var v=Symbol("mount");if(void 0===s)var s=Symbol("unmount");if(void 0===f)var f="SLOT";if(void 0===l)var l=new WeakMap;if(void 0===d)var d=new WeakMap;if(void 0===u)var u=new WeakMap;if(void 0===c)var c=new WeakMap;if(void 0===p)var p=new WeakMap;if(void 0===g)var g=new WeakMap;if(void 0===m)var m=new WeakMap;if(void 0===h)var h=new WeakMap;if(void 0===y)var y=new WeakMap;if(void 0===b)var b={set:x,deleteProperty:x};if(void 0===N)var N={set:S,deleteProperty:S};function S(t,r,n,o){R.debug&&console.log("setIndex",arguments);var a=Number.parseInt(r,10),i=!Number.isNaN(a),v=4===arguments.length,s=2===arguments.length;if("length"===r)for(var f=t.length-1,l=n;l<=f;l+=1){var d=t[l],u=p.get(d),h=c.get(d);u&&M(u[0],u[1],h,d),delete t[l]}if(s&&t[r]){var y=t[r],b=p.get(y),N=c.get(y);M(b[0],b[1],N,y),delete t[r]}if(v&&!i)return e=[],Reflect.set(t,r,n,o);if(v){if(!t.includes(n)){var S=m.get(o),x=S.parentNode,w=g.get(o),k=E(n,w),B=k[0],W=k[1],A=t[r],L=null,C=t.length-1;for(l=a+1;l<=C&&!(L=t[l]);l+=1);if(A&&!t.find((function(e,t){return e===A&&t!==a}))){var O=p.get(A),P=c.get(A);M(O[0],O[1],P,W)}if(L){var T=p.get(L)[0];x.insertBefore(B,T)}else{var j=p.get(o)[1];x.insertBefore(B,j)}return e=[],Reflect.set(t,r,W,o)}var H=t.findIndex((function(e,t){return e===n&&t!==a})),I=t[r];if(I&&n!==I){for(var D=p.get(I),q=D[0],F=D[1],_=p.get(n),z=_[0],G=_[1],J=_[1].nextSibling,K=J.parentNode,Q=z;!Q.isSameNode(G);){var U=Q;Q=Q.nextSibling,K.insertBefore(U,q)}K.insertBefore(G,q);for(var V=q;!V.isSameNode(F);){var X=V;V=V.nextSibling,K.insertBefore(X,J)}K.insertBefore(F,J)}~H&&Reflect.set(t,H,I,o),Reflect.set(t,r,n,o)}return e=[],!0}function x(v,s,f,d){var u=l.get(v),c=4===arguments.length,p=2===arguments.length;if(Object.prototype.hasOwnProperty.call(u,s)){var g=u[s],m=g.node,h=g.type;if(h===r&&f!==m.textContent&&(m.textContent=f),h===n&&f!==m.innerHTML&&(m.innerHTML=f),h===o&&k(m,f),h===a&&w(m,g.name,f),h===i&&W(v,f,g,d),h===t){var y=B(v,s,f,g);if(y)return e=[],Reflect.set(v,s,y,d)}}return p&&delete v[s],c&&Reflect.set(v,s,f,d),e=[],!0}function w(e,t,r){return null==r?e.setAttribute(t,r):e.removeAttribute(t)}function k(e,t){if(t){for(var r=e.classList,n=Object.getPrototypeOf(t),o=n===Set.prototype?t.values():n===Array.prototype?t:n===String.prototype?t.split(" "):[],a=r.values(),i=a.length,v=0;v<i;v+=1){var s=a[v];o.includes(s)||r.remove(s)}for(var f=o.length,l=0;l<f;l+=1){var d=o[l];r.contains(d)||r.add(d)}}else e.removeAttribute("class");return null}function M(t,r,n,o){var a=t,i=a;for(a=a.nextSibling,i.remove();!a.isSameNode(r);)!function(){var e=a;a=a.nextSibling,n?Promise.resolve(n.call(o,e)).then((function(){return e.remove()})):e.remove()}();return e=[],r.remove()}function B(t,r,n,o){if(t[r]||n){var a=o.node,i=o.slot,v=o.template,s=u.get(t),f=s[r],l=a.parentNode,d=P(0,r),g=P(1,r),h=null;if(f){var y=t[r];if(Array.isArray(y))for(var b=y.length,N=0;N<b;N+=1){var S=y[N],x=c.get(S),w=p.get(S);w&&M(w[0],w[1],x,S)}else if(y){var k=c.get(y),B=p.get(y);M(B[0],B[1],k,y)}M(f[0],f[1]),delete s[r]}if(s[r]=[d,g],l.insertBefore(d,a),n)if(Array.isArray(n)){for(var W=O(n,v),A=W[0],L=W[1],C=A.length,R=0;R<C;R+=1){var T=A[R];l.insertBefore(T,a)}m.set(L,a),p.set(L,s[r]),h=L}else{var j=E(n,v),H=j[0],I=j[1];l.insertBefore(H,a),h=I}else for(var D=i.childNodes,q=D.length,F=0;F<q;F+=1){var _=D[F];l.insertBefore(_.cloneNode(!0),a)}return l.insertBefore(g,a),e=[],h}}function W(e,t,r,n){var o=r.node,a=r.event,i=d.get(e),v=i[a];if(v&&o.removeEventListener(a,v,v.options),t){var s=t.bind(n);return s.options=t.options,o.addEventListener(a,s,s.options),i[a]=s}}function A(v){var s=(v.content||v).cloneNode(!0),l={};return function e(v,s){for(var d=v.childNodes.length-1,u=0;u<=d;u+=1){var c=v.childNodes[u];if(c.nodeType===Node.ELEMENT_NODE)if(c.children.length&&e(c,s.concat(u)),c.tagName===f||c.dataset.template){var p=c.dataset.key||c.name,g=P(2,p),m=document.querySelector(c.dataset.template);if(void 0===p)throw new Error("Missing `name` or `data-key` for slot.");v.insertBefore(g,c),l[p]={path:s.concat(u),slot:c,template:m,type:t},c.remove()}else for(var h in c.dataset){var y=c.dataset[h],b=null;switch(h){case"text":b={type:r};break;case"class":b={type:o};break;case"unsafeHtml":b={type:n}}h.startsWith("attribute")&&(b={type:a,name:h.slice(9).toLowerCase()}),h.startsWith("event")&&(b={type:i,event:h.slice(5).toLowerCase()}),b&&(delete c.dataset[h],c.removeAttribute(h),b.path=s.concat(u),l[y]=b)}}}(s,[]),h.set(v,s),e=[],y.set(v,l)}function L(t,r){var n=y.get(r),o={};for(var a in n){var i=n[a],v=C(t,i.path);o[a]=Object.assign({node:v},i)}return e=[],o}function C(e,t){for(var r=e,n=t.length-1,o=0;o<=n;o+=1){var a=t[o];r=r.childNodes[a]}return r}function O(t,r){for(var n,o=[],a=[],i=t.length,v=0;v<i;v+=1){var s=E(t[v],r);o.push(s[0]),a.push(s[1])}return n=new Proxy(a,N),g.set(n,r),e=[],[o,n]}function E(t,r){h.get(r)||A(r);var n=h.get(r).cloneNode(!0),o=new Proxy(t,b),a=L(n,r),i=P(0,"proxy"),f=P(1,"proxy"),g=[i,f],m=t[v],y=t[s],N=document.createDocumentFragment();return m&&m.call(o,n),y&&c.set(o,y),N.appendChild(i),N.appendChild(n),N.appendChild(f),p.set(o,g),l.set(t,a),d.set(t,{}),u.set(t,{}),Object.assign(o,t),e=[],[N,o]}function P(e,t){if(R.debug){var r=(0===e?"start":1===e?"end":"anchor")+" "+t;return document.createComment(r)}return document.createTextNode("")}function R(t,r){return e=[],E(t,r)}export{v as mount,s as unmount};export default R;
