1(function(root,factory){'use strict';if(typeof define==='function'&&define.amd){define([],factory);} 2else if(typeof exports==='object'){module.exports=factory();} 3else{root.dBlazy=factory();}})(this,function(){'use strict';var dBlazy={};if(!Element.prototype.matches){Element.prototype.matches=Element.prototype.msMatchesSelector||Element.prototype.webkitMatchesSelector;} 4dBlazy.matches=function(elem,selector){if(elem.matches(selector)){return true;} 5return false;};dBlazy.pixelRatio=function(){return window.devicePixelRatio||1;};dBlazy.windowWidth=function(){return window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth||window.screen.width;};dBlazy.activeWidth=function(dataset,mobileFirst){var me=this;var keys=Object.keys(dataset);var xs=keys[0];var xl=keys[keys.length-1];var pr=(me.windowWidth()*me.pixelRatio());var ww=mobileFirst?me.windowWidth():pr;var mw=function(w){return mobileFirst?parseInt(w)<=ww:parseInt(w)>=ww;};var data=keys.filter(mw).map(function(v){return dataset[v];})[mobileFirst?'pop':'shift']();return typeof data==='undefined'?dataset[ww>=xl?xl:xs]:data;};dBlazy.equal=function(el,str){return el!==null&&el.nodeName.toLowerCase()===str;};dBlazy.closest=function(el,selector){var parent;while(el){parent=el.parentElement;if(parent&&parent.matches(selector)){return parent;} 6el=parent;} 7return null;};dBlazy.extend=Object.assign||function(out){out=out||{};for(var i=1,len=arguments.length;i<len;i++){if(!arguments[i]){continue;} 8for(var key in arguments[i]){if(Object.prototype.hasOwnProperty.call(arguments[i],key)){out[key]=arguments[i][key];}}} 9return out;};dBlazy.forEach=function(collection,callback,scope){var proto=Object.prototype;if(proto.toString.call(collection)==='[object Object]'){for(var prop in collection){if(proto.hasOwnProperty.call(collection,prop)){callback.call(scope,collection[prop],prop,collection);}}} 10else if(collection){for(var i=0,len=collection.length;i<len;i++){callback.call(scope,collection[i],i,collection);}}};dBlazy.hasClass=function(el,name){if(el.classList){return el.classList.contains(name);} 11else{return el.className.indexOf(name)!==-1;}};dBlazy.setAttr=function(el,attr,remove){if(el.hasAttribute('data-'+attr)){var dataAttr=el.getAttribute('data-'+attr);if(attr==='src'){el.src=dataAttr;} 12else{el.setAttribute(attr,dataAttr);} 13if(remove){el.removeAttribute('data-'+attr);}}};dBlazy.setAttrs=function(el,attrs,remove){var me=this;me.forEach(attrs,function(src){me.setAttr(el,src,remove);});};dBlazy.setAttrsWithSources=function(el,attr,remove){var me=this;var parent=el.parentNode||null;var isPicture=parent&&me.equal(parent,'picture');var targets=isPicture?parent.getElementsByTagName('source'):el.getElementsByTagName('source');attr=attr||(isPicture?'srcset':'src');if(targets.length){me.forEach(targets,function(source){me.setAttr(source,attr,remove);});}};dBlazy.updateBg=function(el,mobileFirst){var me=this;var backgrounds=me.parse(el.getAttribute('data-backgrounds'));if(backgrounds){var bg=me.activeWidth(backgrounds,mobileFirst);if(bg&&bg!=='undefined'){el.style.backgroundImage='url("'+bg.src+'")';if(bg.ratio&&!el.classList.contains('b-noratio')){el.style.paddingBottom=bg.ratio+'%';}}}};dBlazy.removeAttrs=function(el,attrs){this.forEach(attrs,function(attr){el.removeAttribute('data-'+attr);});};dBlazy.on=function(elm,eventName,childEl,callback){elm.addEventListener(eventName,function(event){var t=event.target;event.delegateTarget=elm;while(t&&t!==this){if(dBlazy.matches(t,childEl)){callback.call(t,event);} 14t=t.parentNode;}});};dBlazy.bindEvent=function(el,type,fn,params){var defaults={capture:false,passive:true};var extraParams=params?this.extend(defaults,params):defaults;if(el.attachEvent){el.attachEvent('on'+type,fn,extraParams);} 15else{el.addEventListener(type,fn,extraParams);}};dBlazy.unbindEvent=function(el,type,fn,params){var defaults={capture:false,passive:true};var extraParams=params?this.extend(defaults,params):defaults;if(el.detachEvent){el.detachEvent('on'+type,fn,extraParams);} 16else{el.removeEventListener(type,fn,extraParams);}};dBlazy.once=function(fn){var result;var ran=false;return function proxy(){if(ran){return result;} 17ran=true;result=fn.apply(this,arguments);fn=null;return result;};};dBlazy.parse=function(str){try{return JSON.parse(str);} 18catch(e){return false;}};dBlazy.animate=function(el,animation){var me=this;var props=['animation','animation-duration','animation-delay','animation-iteration-count'];animation=animation||el.dataset.animation;el.classList.add('animated',animation);me.forEach(['Duration','Delay','IterationCount'],function(key){if('animation'+key in el.dataset){el.style['animation'+key]=el.dataset['animation'+key];}});function animationEnd(){me.removeAttrs(el,props);el.classList.add('is-b-animated');el.classList.remove('animated',animation);me.forEach(props,function(key){el.style.removeProperty(key);});me.unbindEvent(el,'animationend',animationEnd);} 19me.bindEvent(el,'animationend',animationEnd);};dBlazy.throttle=function(fn,minDelay,scope){var lastCall=0;return function(){var now=+new Date();if(now-lastCall<minDelay){return;} 20lastCall=now;fn.apply(scope,arguments);};};dBlazy.resize=function(c,t){window.onresize=function(){window.clearTimeout(t);t=window.setTimeout(c,200);};return c;};dBlazy.trigger=function(elm,eventName,custom,param){var event;var data={detail:custom||{}};if(typeof param==='undefined'){data.bubbles=true;data.cancelable=true;} 21if(typeof window.CustomEvent==='function'){event=new CustomEvent(eventName,data);} 22else{event=document.createEvent('CustomEvent');event.initCustomEvent(eventName,true,true,data);} 23elm.dispatchEvent(event);};return dBlazy;});
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.