/*! * wpbakery page builder v6.0.0 (https://wpbakery.com) * copyright 2011-2019 michael m, wpbakery * license: commercial. more details: http://go.wpbakery.com/licensing */ // jscs:disable // jshint ignore: start /*! * imagesloaded packaged v3.1.8 * javascript is all like "you images are done yet or what?" * mit license */ (function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.eventemitter;i.getlisteners=function(e){var t,n,i=this._getevents();if("object"==typeof e){t={};for(n in i)i.hasownproperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenlisteners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getlistenersasobject=function(e){var t,n=this.getlisteners(e);return n instanceof array&&(t={},t[e]=n),t||n},i.addlistener=function(e,n){var i,r=this.getlistenersasobject(e),o="object"==typeof n;for(i in r)r.hasownproperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addlistener"),i.addoncelistener=function(e,t){return this.addlistener(e,{listener:t,once:!0})},i.once=n("addoncelistener"),i.defineevent=function(e){return this.getlisteners(e),this},i.defineevents=function(e){for(var t=0;e.length>t;t+=1)this.defineevent(e[t]);return this},i.removelistener=function(e,n){var i,r,o=this.getlistenersasobject(e);for(r in o)o.hasownproperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removelistener"),i.addlisteners=function(e,t){return this.manipulatelisteners(!1,e,t)},i.removelisteners=function(e,t){return this.manipulatelisteners(!0,e,t)},i.manipulatelisteners=function(e,t,n){var i,r,o=e?this.removelistener:this.addlistener,s=e?this.removelisteners:this.addlisteners;if("object"!=typeof t||t instanceof regexp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasownproperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeevent=function(e){var t,n=typeof e,i=this._getevents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasownproperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removealllisteners=n("removeevent"),i.emitevent=function(e,t){var n,i,r,o,s=this.getlistenersasobject(e);for(r in s)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);return this},i.trigger=n("emitevent"),i.emit=function(e){var t=array.prototype.slice.call(arguments,1);return this.emitevent(e,t)},i.setoncereturnvalue=function(e){return this._oncereturnvalue=e,this},i._getoncereturnvalue=function(){return this.hasownproperty("_oncereturnvalue")?this._oncereturnvalue:!0},i._getevents=function(){return this._events||(this._events={})},e.noconflict=function(){return r.eventemitter=o,e},"function"==typeof define&&define.amd?define("eventemitter/eventemitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.eventemitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcelement||t,n}var n=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(){var n=t(e);i.handleevent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachevent("on"+n,e[n+i])});var r=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{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventemitter/eventemitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("wolfy87-eventemitter"),require("eventie")):e.imagesloaded=t(e,e.eventemitter,e.eventie)}(window,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.queryselectorall(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getimages(),a&&(this.jqdeferred=new a.deferred);var r=this;settimeout(function(){r.check()})}function f(e){this.img=e}function c(e){this.src=e,v[e]=this}var a=e.jquery,u=e.console,h=u!==void 0,d=object.prototype.tostring;s.prototype=new t,s.prototype.options={},s.prototype.getimages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"img"===n.nodename&&this.addimage(n);var i=n.nodetype;if(i&&(1===i||9===i||11===i))for(var r=n.queryselectorall("img"),o=0,s=r.length;s>o;o++){var f=r[o];this.addimage(f)}}},s.prototype.addimage=function(e){var t=new f(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasanybroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasanybroken=this.hasanybroken||!e.isloaded;var t=this;settimeout(function(){t.emit("progress",t,e),t.jqdeferred&&t.jqdeferred.notify&&t.jqdeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasanybroken?"fail":"done";this.iscomplete=!0;var t=this;settimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqdeferred){var n=t.hasanybroken?"reject":"resolve";t.jqdeferred[n](t)}})},a&&(a.fn.imagesloaded=function(e,t){var n=new s(this,e,t);return n.jqdeferred.promise(a(this))}),f.prototype=new t,f.prototype.check=function(){var e=v[this.img.src]||new c(this.img.src);if(e.isconfirmed)return this.confirm(e.isloaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalwidth)return this.confirm(0!==this.img.naturalwidth,"naturalwidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isloaded,n),!0}),e.check()},f.prototype.confirm=function(e,t){this.isloaded=e,this.emit("confirm",this,t)};var v={};return c.prototype=new t,c.prototype.check=function(){if(!this.ischecked){var e=new image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.ischecked=!0}},c.prototype.handleevent=function(e){var t="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});