-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathmin.js
More file actions
2 lines (2 loc) · 3.18 KB
/
Copy pathmin.js
File metadata and controls
2 lines (2 loc) · 3.18 KB
1
2
/*! (c) Andrea Giammarchi (ISC) */!function(p){"use strict";
/*! (c) Andrea Giammarchi - @WebReflection (ISC) */if(!("attachShadow"in p)){var v="addEventListener",y="removeEventListener",w="dispatchEvent",g=["display:inline-block","box-sizing:border-box","margin:0","padding:0","background:transparent","visibility:visible","width:100%","height:auto"].join(";"),E="*[data-attachshadow]{padding:0 !important}",x=0,C=Object.defineProperties;T(document).insertBefore(document.createElement("style"),T(document).firstChild).textContent=E,p.attachShadow=function(t){var e=this.ownerDocument.createElement("iframe");this.setAttribute("data-attachshadow",""),e.setAttribute("scrolling","no"),e.setAttribute("allowtransparency","yes"),e.setAttribute("allowfullscreen","yes"),e.setAttribute("frameborder","0"),e.style.cssText=g;var n=new i(this.appendChild(e),t);return"open"===t.mode&&C(this,{shadowRoot:{value:n}}),n}}function T(t){return t.head||t.getElementsByTagName("head")[0]}function D(e,n){return{get:function(){return e()[n]},set:function(t){e()[n]=t}}}function N(t){var e=0;function n(){clearTimeout(e),e=setTimeout(i)}function i(){e=0,t()}this.observe=function(t){t[v]("DOMSubtreeModified",n)}}function i(s,t){function e(){return r}var n={mode:{value:t.mode}},i=s.contentDocument,o=s.contentWindow,a=o.MutationObserver||N,r=i.body||i.createElement("body"),c=i.createDocumentFragment();for(var d in c)if("function"==typeof c[d]&&d in r)n[d]={value:r[d].bind(r)};else switch(d){case"nodeName":case"nodeType":case"tagName":n[d]=D(function(){return c},d);break;case"activeElement":n[d]=D(function(){return i},d);break;default:n[d]=D(e,d)}n.innerHTML=D(e,"innerHTML"),n.textContent=D(e,"textContent"),C(this,n);var h="#shadow-root:"+x+++"."+Math.random()*new Date,u=[],l=(o.Element||o.Node).prototype,f=l[v],m=l[y];function b(){var t;if(T(i=s.contentDocument).appendChild(i.createElement("style")).textContent="html,body{"+g+"}*{margin:0}"+E,function(){var r=i.documentElement;l.attachShadow=p.attachShadow,l[v]=function(t,e,n){var i=this,o=i[h]||(i[h]={s:[],d:[]}),a=o.s.indexOf(e);a<0&&(a=o.s.push(e)-1,o.d[a]=function(t){if(i.contains(t.target)){var e=s.ownerDocument.createEvent("Event");for(var n in e.initEvent(t.type,t.bubbles,t.cancelable),t)try{e[n]=t[n]}catch(t){}s.parentNode[w](e)}},f.call(i,t,e,n),f.call(r,t,o.d[a],n))},l[y]=function(t,e,n){var i=this[h],o=i?i.s.indexOf(e):-1;-1<o&&(m.call(this,t,e,n),m.call(r,t,i.d[o],n),i.s.splice(o,1),i.d.splice(o,1))};for(var t,e=0;e<u.length;e++)t=u[e],l[t[0]].apply(t[1],t[2])}(),r!==i.body){for(;t=r.firstChild;)i.body.appendChild(t);r=i.body}var e=function(t,e,n){var i=e.offsetWidth,o=e.offsetHeight;this.width!==i&&(t.width=(this.width=i)+"px"),this.height!==o&&(t.height=(this.height=o)+"px"),n()}.bind({width:0,height:0},s.style,r,function(){for(var t=0,e=this.length;t<e;t++){var n=this[t].textContent;/:host/.test(n)&&(this[t].textContent=n.replace(/:host/g,"body"))}}.bind(r.getElementsByTagName("style")));new a(e).observe(r,{childList:!0,attributes:!0,subtree:!0}),e()}"complete"!=i.readyState?(s.onload=b,l[v]=function(){u.push([v,this,arguments])},l[y]=function(){u.push([y,this,arguments])},l[w]=function(){u.push([w,this,arguments])}):b()}}((window.Element||window.Node).prototype);