/*! * imagesLoaded PACKAGED v3.1.8 * JavaScript is all like "You images are done yet or what?" * MIT License */(function(){functione(){}functiont(e,t){for(varn=e.length;n--;)if(e[n].listener===t)returnn;return-1}functionn(e){returnfunction(){returnthis[e].apply(this,arguments)}}vari=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){vart,n,i=this._getEvents();if("object"==typeofe){t={};for(nini)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}elset=i[e]||(i[e]=[]);returnt},i.flattenListeners=function(e){vart,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);returnn},i.getListenersAsObject=function(e){vart,n=this.getListeners(e);returnninstanceofArray&&(t={},t[e]=n),t||n},i.addListener=function(e,n){vari,r=this.getListenersAsObject(e),o="object"==typeofn;for(iinr)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});returnthis},i.on=n("addListener"),i.addOnceListener=function(e,t){returnthis.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){returnthis.getListeners(e),this},i.defineEvents=function(e){for(vart=0;e.length>t;t+=1)this.defineEvent(e[t]);returnthis},i.removeListener=function(e,n){vari,r,o=this.getListenersAsObject(e);for(rino)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));returnthis},i.off=n("removeListener"),i.addListeners=function(e,t){returnthis.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){returnthis.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){vari,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeoft||tinstanceofRegExp)for(i=n.length;i--;)o.call(this,t,n[i]);elsefor(iint)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeofr?o.call(this,i,r):s.call(this,i,r));returnthis},i.removeEvent=function(e){vart,n=typeofe,i=this._getEvents();if("string"===n)deletei[e];elseif("object"===n)for(tini)i.hasOwnProperty(t)&&e.test(t)&&deletei[t];elsedeletethis._events;returnthis},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){varn,i,r,o,s=this.getListenersAsObject(e);for(rins)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);returnthis},i.trigger=n("emitEvent"),i.emit=function(e){vart=Array.prototype.slice.call(arguments,1);returnthis.emitEvent(e,t)},i.setOnceReturnValue=function(e){returnthis._onceReturnValue=e,this},i._getOnceReturnValue=function(){returnthis.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){returnthis._events||(this._events={})},e.noConflict=function(){returnr.EventEmitter=o,e},"function"==typeofdefine&&define.amd?define("eventEmitter/EventEmitter",[],function(){returne}):"object"==typeofmodule&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){functiont(t){varn=e.event;returnn.target=n.target||n.srcElement||t,n}varn=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){varn=t(e);i.handleEvent.call(i,n)}:function(){varn=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});varr=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{deletee[t+n]}catch(i){e[t+n]=void0}});varo={bind:i,unbind:r};"function"==typeofdefine&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeofdefine&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){returnt(e,n,i)}):"object"==typeofexports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(window,function(e,t,n){functioni(e,t){for(varnint)e[n]=t[n];returne}functionr(e){return"[object Array]"===d.call(e)}functiono(e){vart=[];if(r(e))t=e;elseif("number"==typeofe.length)for(varn=0,i=e.length;i>n;n++)t.push(e[n]);elset.push(e);returnt}functions(e,t,n){if(!(thisinstanceofs))returnnews(e,t);"string"==typeofe&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeoft?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=newa.Deferred);varr=this;setTimeout(function(){r.check()})}functionf(e){this.img=e}functionc(e){this.src=e,v[e]=this}vara=e.jQuery,u=e.console,h=u!==void0,d=Object.prototype.toString;s.prototype=newt,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(vare=0,t=this.elements.length;t>e;e++){varn=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);vari=n.nodeType;if(i&&(1===i||9===i||11===i))for(varr=n.querySelectorAll("img"),o=0,s=r.length;s>o;o++){varf=r[o];this.addImage(f)}}},s.prototype.addImage=function(e){vart=newf(e);this.images.push(t)},s.prototype.check=function(){functione(e,r){returnt.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}vart=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)returnthis.complete(),void0;for(varr=0;i>r;r++){varo=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;vart=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){vare=this.hasAnyBroken?"fail":"done";this.isComplete=!0;vart=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){varn=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){varn=news(this,e,t);returnn.jqDeferred.promise(a(this))}),f.prototype=newt,f.prototype.check=function(){vare=v[this.img.src]||newc(this.img.src);if(e.isConfirmed)returnthis.confirm(e.isLoaded,"cached was confirmed"),void0;if(this.img.complete&&void0!==this.img.naturalWidth)returnthis.confirm(0!==this.img.naturalWidth,"naturalWidth"),void0;vart=this;e.on("confirm",function(e,n){returnt.confirm(e.isLoaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};varv={};returnc.prototype=newt,c.prototype.check=function(){if(!this.isChecked){vare=newImage;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},c.prototype.handleEvent=function(e){vart="on"+e.type;this[t]&&this[t](e)},c.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},c.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},c.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit("confirm",this,t)},c.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});