!function(e,t){"function"==typeof define&&define.amd?define(t):"object"==typeof exports?module.exports=t():e.ResizeSensor=t()}("undefined"!=typeof window?window:this,function(){if("undefined"==typeof window)return null;var e=window.requestAnimationFrame||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame||function(e){return window.setTimeout(e,20)};function t(e,t){var i=Object.prototype.toString.call(e),n="[object Array]"===i||"[object NodeList]"===i||"[object HTMLCollection]"===i||"[object Object]"===i||"undefined"!=typeof jQuery&&e instanceof jQuery||"undefined"!=typeof Elements&&e instanceof Elements,o=0,s=e.length;if(n)for(;o
',t.appendChild(t.resizeSensor);var r=window.getComputedStyle(t).getPropertyValue("position");"absolute"!==r&&"relative"!==r&&"fixed"!==r&&(t.style.position="relative");var d,c,h,l=t.resizeSensor.childNodes[0],f=l.childNodes[0],u=t.resizeSensor.childNodes[1],a=i(t),v=a.width,z=a.height,p=!0,w=function(){f.style.width="100000px",f.style.height="100000px",l.scrollLeft=1e5,l.scrollTop=1e5,u.scrollLeft=1e5,u.scrollTop=1e5},g=function(){if(p){if(!l.scrollTop&&!l.scrollLeft)return w(),void(h||(h=e(function(){h=0,g()})));p=!1}w()};t.resizeSensor.resetSensor=g;var y=function(){c=0,d&&(v=a.width,z=a.height,t.resizedAttached&&t.resizedAttached.call(a))},S=function(){a=i(t),(d=a.width!==v||a.height!==z)&&!c&&(c=e(y)),g()},m=function(e,t,i){e.attachEvent?e.attachEvent("on"+t,i):e.addEventListener(t,i)};m(l,"scroll",S),m(u,"scroll",S),e(g)}}(t,s)}),this.detach=function(e){"undefined"!=typeof ResizeObserver?t(o,function(e){r.unobserve(e)}):n.detach(o,e)},this.reset=function(){o.resizeSensor.resetSensor()}};return n.reset=function(e,i){t(e,function(e){e.resizeSensor.resetSensor()})},n.detach=function(e,i){t(e,function(e){e&&(e.resizedAttached&&"function"==typeof i&&(e.resizedAttached.remove(i),e.resizedAttached.length())||e.resizeSensor&&(e.contains(e.resizeSensor)&&e.removeChild(e.resizeSensor),delete e.resizeSensor,delete e.resizedAttached))})},n});