/* * Responsively Lazy * https://ivopetkov.com/responsively-lazy/ * Copyright (c) Ivo Petkov * Free to use under the MIT license. */ var responsivelyLazy=void 0!==responsivelyLazy?responsivelyLazy:function(){if(void 0!==window.addEventListener&&void 0!==document.querySelectorAll){var e=-1!==document.cookie.indexOf("ivopetkov-responsively-lazy=debug"),n=null,t=null,A="srcset"in document.createElement("img"),r=null,i=null,o="undefined"!=typeof IntersectionObserver,l=!1,a=function(e){var n=0,t=0,A=e.getAttribute("data-responsively-lazy-threshold");if(null!==A)if("px"===A.substr(-2))n=t=parseInt(A.substr(0,A.length-2),10);else if("%"===A.substr(-1)){var o=parseInt(A.substr(0,A.length-1),10)/100;n=Math.floor(r*o),t=Math.floor(i*o)}var l=e.getBoundingClientRect(),a=l.top,s=l.left,u=l.width,d=l.height;if(0===a&&0===s&&0===u&&0===d)return 0;0===u&&(u=1),0===d&&(d=1);var v=function(e,n,t){return e0?Math.min(t,e+n)-Math.max(0,e):0};return v(s-n,u+2*n,r)*v(a-t,d+2*t,i)/((u+2*n)*(d+2*t))*100},s=function(e,n){for(var t=e.length,A=n;A=5);e++){var t=u[e];0===t[3]&&(t[3]=1,t[2](),n++)}d=!1}},c=0,f=function(e,A){var r=[],i=A.getAttribute("data-responsively-lazy"),o=null;if(null!==i&&(i=i.trim()).length>0){i=i.split(",");for(var l=0;l0&&m[1]===h[h.length-1][1]||h.push([m[0],m[1]])}r=h}var b=A.offsetWidth*(void 0!==window.devicePixelRatio?window.devicePixelRatio:1),w=null;for(l=0;l=b||m[1]===o){w=m;break}}if(null===w&&(w="img"===e?[A.getAttribute("src"),999999]:[null,999999]),void 0===A.responsivelyLazyOption&&(A.responsivelyLazyOption=["",0]),A.responsivelyLazyOption[1]0&&s(t,0),l=!1}else"img"===n?A&&f(n,e):f(n,e)}},g=function(A){if(null!==n&&null!==t){if(e){var r="responsivelyLazy::run";console.time(r)}if(void 0!==A)p(i[o]);else for(var i=document.querySelectorAll("[data-responsively-lazy]"),o=0;o0&&p(t.target)}})),B=function(){for(var e=document.querySelectorAll("[data-responsively-lazy]"),n=0;n{k(),g()}),"complete"===document.readyState&&(k(),g())}else g=function(){};return{run:g}}();