(function(h,a){"use strict";typeof define=="function"&&define.amd?define(["ev-emitter/ev-emitter"],function(m){return a(h,m)}):typeof module=="object"&&module.exports?module.exports=a(h,require("ev-emitter")):h.imagesLoaded=a(h,h.EvEmitter)})(typeof window!="undefined"?window:this,function(h,a){"use strict";function m(t,e){for(var i in e)t[i]=e[i];return t}function n(t,e,i){if(!(this instanceof n))return new n(t,e,i);var o=t;typeof t=="string"&&(o=document.querySelectorAll(t)),o?(this.elements=function(r){return Array.isArray(r)?r:typeof r=="object"&&typeof r.length=="number"?g.call(r):[r]}(o),this.options=m({},this.options),typeof e=="function"?i=e:m(this.options,e),i&&this.on("always",i),this.getImages(),p&&(this.jqDeferred=new p.Deferred),setTimeout(this.check.bind(this))):u.error("Bad element for imagesLoaded "+(o||t))}function s(t){this.img=t}function d(t,e){this.url=t,this.element=e,this.img=new Image}var p=h.jQuery,u=h.console,g=Array.prototype.slice;(n.prototype=Object.create(a.prototype)).options={},n.prototype.getImages=function(){this.images=[],this.elements.forEach(this.addElementImages,this)},n.prototype.addElementImages=function(t){t.nodeName=="IMG"&&this.addImage(t),this.options.background===!0&&this.addElementBackgroundImages(t);var e=t.nodeType;if(e&&f[e]){for(var i=t.querySelectorAll("img"),o=0;o