File "jquery.lazy.min.js"
Full Path: /home/aiclgcwq/photonindustriespvt.com/wp-content/plugins/tenweb-speed-optimizer/includes/external/js/jquery.lazy.min.js
File size: 4.81 KB
MIME-type: text/plain
Charset: utf-8
!function(t,e){"use strict";var r=t.jQuery||t.Zepto,a=0,n=!1;function i(i,o){var l=this,u=r.extend({},l.config,o),f={},c=u.name+"-"+ ++a;return l.config=function(t,r){return r===e?u[t]:(u[t]=r,l)},l.addItems=function(t){return f.a&&f.a("string"===r.type(t)?r(t):t),l},l.getItems=function(){return f.g?f.g():{}},l.update=function(t){return f.e&&f.e({},!t),l},l.force=function(t){return f.f&&f.f("string"===r.type(t)?r(t):t),l},l.loadAll=function(){return f.e&&f.e({all:!0},!0),l},l.destroy=function(){r(u.appendScroll).off("."+c,f.e),r(t).off("."+c),f={}},!function a(i,o,l,u,f){var c=0,s=-1,d=-1,A=!1,g="afterLoad",m="load",h="error",b="srcset",v="sizes",$="background-image";function p(){var e,a,n,c;A=t.devicePixelRatio>1,l=y(l),o.delay>=0&&setTimeout(function(){_(!0)},o.delay),(o.delay<0||o.combined)&&(u.e=(e=o.throttle,a=function(t){"resize"===t.type&&(s=d=-1),_(t.all)},c=0,function(t,r){var l=+new Date-c;function u(){c=+new Date,a.call(i,t)}n&&clearTimeout(n),l>e||!o.enableThrottle||r?u():n=setTimeout(u,e-l)}),u.a=function(t){t=y(t),l.push.apply(l,t)},u.g=function(){return l=r(l).filter(function(){return!r(this).data(o.loadedName)})},u.f=function(t){for(var e=0;e<t.length;e++){var r=l.filter(function(){return this===t[e]});r.length&&_(!1,r)}},_(),r(o.appendScroll).on("scroll."+f+" resize."+f,u.e))}function y(t){var a=o.defaultImage,n=o.placeholder,l=o.imageBase,u=o.srcsetAttribute,f=o.loaderAttribute,c=o._f||{};t=r(t).filter(function(){var t=r(this),a=w(this);return!t.data(o.handledName)&&(t.attr(o.attribute)||t.attr(u)||t.attr(f)||e!==c[a])}).data("plugin_"+o.name,i);for(var s=0,d=t.length;s<d;s++){var A=r(t[s]),g=w(t[s]),m=A.attr(o.imageBaseAttribute)||l;"img"===g&&m&&A.attr(u)&&A.attr(u,L(A.attr(u),m)),e===c[g]||A.attr(f)||A.attr(f,c[g]),"img"===g&&a&&!A.attr("src")?A.attr("src",a):"img"!==g&&n&&(!A.css($)||"none"===A.css($))&&A.css($,"url('"+n+"')")}return t}function _(t,e){if(!l.length){o.autoDestroy&&i.destroy();return}for(var a=e||l,n=!1,u=o.imageBase||"",f=o.srcsetAttribute,c=o.handledName,s=0;s<a.length;s++)if(t||e||B(a[s])){var d=r(a[s]),A=w(a[s]),g=d.attr(o.attribute),m=d.attr(o.imageBaseAttribute)||u,h=d.attr(o.loaderAttribute);!d.data(c)&&(!o.visibleOnly||d.is(":visible"))&&((g||d.attr(f))&&("img"===A&&(m+g!==d.attr("src")||d.attr(f)!==d.attr(b))||"img"!==A&&m+g!==d.css($))||h)&&(n=!0,d.data(c,!0),z(d,A,m,h))}n&&(l=r(l).filter(function(){return!r(this).data(c)}))}function z(t,e,a,n){++c;var i=function(){I("onError",t),N(),i=r.noop};I("beforeLoad",t);var l=o.attribute,u=o.srcsetAttribute,f=o.sizesAttribute,s=o.retinaAttribute,d=o.removeAttribute,p=o.loadedName,y=t.attr(s);if(n){var _=function(){d&&t.removeAttr(o.loaderAttribute),t.data(p,!0),I(g,t),setTimeout(N,1),_=r.noop};t.off(h).one(h,i).one(m,_),I(n,t,function(e){e?(t.off(m),_()):(t.off(h),i())})||t.trigger(h)}else{var z=r(new Image);z.one(h,i).one(m,function(){t.hide(),"img"===e?t.attr(v,z.attr(v)).attr(b,z.attr(b)).attr("src",z.attr("src")):t.attr("data-full-bg-image")?t.css($,t.attr("data-full-bg-image")):t.css($,"url('"+z.attr("src")+"')"),t[o.effect](o.effectTime),d&&(t.removeAttr(l+" "+u+" "+s+" "+o.imageBaseAttribute),f!==v&&t.removeAttr(f)),t.data(p,!0),I(g,t),z.remove(),N()});var B=(A&&y?y:t.attr(l))||"";z.attr(v,t.attr(f)).attr(b,t.attr(u)).attr("src",B?a+B:null),z.complete&&z.trigger(m)}}function B(e){var a=e.getBoundingClientRect(),n=o.scrollDirection,i=o.threshold,l=(d>=0?d:d=r(t).height())+i>a.top&&-i<a.bottom,u=(s>=0?s:s=r(t).width())+i>a.left&&-i<a.right;return"vertical"===n?l:"horizontal"===n?u:l&&u}function w(t){return t.tagName.toLowerCase()}function L(t,e){if(e){var r=t.split(",");t="";for(var a=0,n=r.length;a<n;a++)t+=e+r[a].trim()+(a!==n-1?",":"")}return t}function N(){--c,l.length||c||I("onFinishedAll")}function I(t,e,r){return!!(t=o[t])&&(t.apply(i,[].slice.call(arguments,1)),!0)}"event"===o.bind||n?p():r(t).on(m+"."+f,p)}(l,u,i,f,c),u.chainable?i:l}r.fn.Lazy=r.fn.lazy=function(t){return new i(this,t)},r.Lazy=r.lazy=function(t,a,n){if(r.isFunction(a)&&(n=a,a=[]),r.isFunction(n)){t=r.isArray(t)?t:[t],a=r.isArray(a)?a:[a];for(var o=i.prototype.config,l=o._f||(o._f={}),u=0,f=t.length;u<f;u++)(e===o[t[u]]||r.isFunction(o[t[u]]))&&(o[t[u]]=n);for(var c=0,s=a.length;c<s;c++)l[a[c]]=t[0]}},i.prototype.config={name:"lazy",chainable:!0,autoDestroy:!0,bind:"load",threshold:500,visibleOnly:!1,appendScroll:t,scrollDirection:"both",imageBase:null,defaultImage:"data:image/gif;base64,R0lGODlhAQABAIAAAP///wAAACH5BAEAAAAALAAAAAABAAEAAAICRAEAOw==",placeholder:null,delay:-1,combined:!1,attribute:"data-src",srcsetAttribute:"data-srcset",sizesAttribute:"data-sizes",retinaAttribute:"data-retina",loaderAttribute:"data-loader",imageBaseAttribute:"data-imagebase",removeAttribute:!0,handledName:"handled",loadedName:"loaded",effect:"show",effectTime:0,enableThrottle:!0,throttle:250,beforeLoad:e,afterLoad:e,onError:e,onFinishedAll:e},r(t).on("load",function(){n=!0})}(window);