!function(global,factory){"object"==typeof exports&&"undefined"!=typeof module?module.exports=factory():"function"==typeof define&&define.amd?define(factory):global.ResizeObserver=factory()}(this,function(){"use strict";function toFloat(value){return parseFloat(value)||0}function getBordersSize(styles){var positions=Array.prototype.slice.call(arguments,1);return positions.reduce(function(size,position){var value=styles["border-"+position+"-width"];return size+toFloat(value)},0)}function getPaddings(styles){for(var positions=["top","right","bottom","left"],paddings={},i=0,list=positions;i0},ResizeObserverController.prototype.connect_=function(){isBrowser&&!this.connected_&&(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),mutationObserverSupported?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},ResizeObserverController.prototype.disconnect_=function(){isBrowser&&this.connected_&&(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},ResizeObserverController.prototype.onTransitionEnd_=function(ref){var propertyName=ref.propertyName,isReflowProperty=transitionKeys.some(function(key){return!!~propertyName.indexOf(key)});isReflowProperty&&this.refresh()},ResizeObserverController.getInstance=function(){return this.instance_||(this.instance_=new ResizeObserverController),this.instance_},ResizeObserverController.instance_=null;var defineConfigurable=function(target,props){for(var i=0,list=Object.keys(props);i0};var observers="undefined"!=typeof WeakMap?new WeakMap:new MapShim,ResizeObserver$1=function(callback){if(!(this instanceof ResizeObserver$1))throw new TypeError("Cannot call a class as a function");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var controller=ResizeObserverController.getInstance(),observer=new ResizeObserverSPI(callback,controller,this);observers.set(this,observer)};["observe","unobserve","disconnect"].forEach(function(method){ResizeObserver$1.prototype[method]=function(){return(ref=observers.get(this))[method].apply(ref,arguments);var ref}});var index=function(){return"undefined"!=typeof ResizeObserver?ResizeObserver:ResizeObserver$1}();return index});