-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathmin.js
1 lines (1 loc) · 3.38 KB
/
min.js
1
self.wickedElements=function(e){"use strict";var t="function"==typeof Promise?Promise:function(e){var t,n=[],r=0;return e((function(e){t=e,r=1,n.splice(0).forEach(o)})),{then:o};function o(e){return r?setTimeout(e,0,t):n.push(e),this}},n=!0,r=!1,o="querySelectorAll";function a(e){this.observe(e,{subtree:n,childList:n})}var i="querySelectorAll",u=self,l=u.document,c=u.Element,d=u.MutationObserver,s=u.Set,f=u.WeakMap,h=function(e){return i in e},v=[].filter,p=Object.create,g=Object.keys,b=new WeakMap,m=new Set,w=[],y={},S={},O=function(e,t){for(var n=b.get(t),r=0,o=e.length;r<o;r++){var a=e[r],i=a.target,u=a.attributeName,l=a.oldValue,c=i.getAttribute(u);n.attributeChanged(u,l,c)}},A=function(e){var t=new f,u=function(n,r){var o;if(r)for(var a,i=function(e){return e.matches||e.webkitMatchesSelector||e.msMatchesSelector}(n),u=0,l=g.length;u<l;u++)i.call(n,a=g[u])&&(t.has(n)||t.set(n,new s),(o=t.get(n)).has(a)||(o.add(a),e.handle(n,r,a)));else t.has(n)&&(o=t.get(n),t.delete(n),o.forEach((function(t){e.handle(n,r,t)})))},p=function(e){for(var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=0,r=e.length;n<r;n++)u(e[n],t)},g=e.query,b=e.root||l,m=function(e,t,i){var u=function t(r,a,i,u,l){for(var c=0,d=r.length;c<d;c++){var s=r[c];(l||o in s)&&(u?a.has(s)||(a.add(s),i.delete(s),e(s,u)):i.has(s)||(i.add(s),a.delete(s),e(s,u)),l||t(s[o]("*"),a,i,u,n))}},l=new(i||MutationObserver)((function(e){for(var t=new Set,o=new Set,a=0,i=e.length;a<i;a++){var l=e[a],c=l.addedNodes,d=l.removedNodes;u(d,t,o,r,r),u(c,t,o,n,r)}}));return l.add=a,l.add(t||document),l}(u,b,d),w=c.prototype.attachShadow;return w&&(c.prototype.attachShadow=function(e){var t=w.call(this,e);return m.add(t),t}),g.length&&p(b[i](g)),{drop:function(e){for(var n=0,r=e.length;n<r;n++)t.delete(e[n])},flush:function(){for(var e=m.takeRecords(),t=0,n=e.length;t<n;t++)p(v.call(e[t].removedNodes,h),!1),p(v.call(e[t].addedNodes,h),!0)},observer:m,parse:p}}({query:w,handle:function(e,t,n){var r=y[n],o=r.m,a=r.l,i=r.o,u=o.get(e)||function(e,t,n,r){for(var o=p(r,{element:{enumerable:!0,value:e}}),a=0,i=n.length;a<i;a++)e.addEventListener(n[a].t,o,n[a].o);t.set(e,o),o.init&&o.init();var u=r.observedAttributes;if(u){var l=new MutationObserver(O);l.observe(e,{attributes:!0,attributeOldValue:!0,attributeFilter:u.map((function(t){return e.hasAttribute(t)&&o.attributeChanged(t,null,e.getAttribute(t)),t}))}),b.set(l,o)}return o}(e,o,a,i),l=t?"connected":"disconnected";l in u&&u[l]()}}),M=A.drop,k=A.flush,E=A.parse,q=function(e,t){if(-1<w.indexOf(e))throw new Error("duplicated: "+e);k();for(var n=[],r=p(null),o=g(t),a=0,i=o.length;a<i;a++){var u=o[a];if(/^on/.test(u)&&!/Options$/.test(u)){var l=t[u+"Options"]||!1,c=u.toLowerCase(),d=c.slice(2);n.push({t:d,o:l}),r[d]=u,c!==u&&(d=u.slice(2,3).toLowerCase()+u.slice(3),r[d]=u,n.push({t:d,o:l}))}}n.length&&(t.handleEvent=function(e){this[r[e.type]](e)}),w.push(e),y[e]={m:new WeakMap,l:n,o:t},E(document.querySelectorAll(e)),N(e),m.has(e)||S[e]._()},N=function(e){if(!(e in S)){var n,r=new t((function(e){n=e}));S[e]={_:n,$:r}}return S[e].$};return e.define=q,e.defineAsync=function(e,t,n){m.add(e),q(e,{init:function(){m.has(e)&&(m.delete(e),t().then((function(t){var r=t.default;w.splice(w.indexOf(e),1),M(document.querySelectorAll(e)),(n||q)(e,r)})))}})},e.get=function(e){return(y[e]||b).o},e.upgrade=function(e){w.length&&(k(),E([e]))},e.whenDefined=N,Object.defineProperty(e,"__esModule",{value:!0}),e}({});