aeec0456270b6362c99457d4998c8d1d83dad5b6
[yaffs-website] / web / modules / contrib / blazy / js / dblazy.min.js
1 /**
2  * @file
3  * Cherries by @toddmotto, @cferdinandi, @adamfschwartz, @daniellmb.
4  */
5 !function(t,e){"use strict";"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():t.dBlazy=e()}(this,function(){"use strict";var t={};return t.matches=function(t,e){var n=Element.prototype;return n.matches||(n.matches=n.matchesSelector||n.mozMatchesSelector||n.msMatchesSelector||n.oMatchesSelector||n.webkitMatchesSelector||function(t){for(var e=(this.document||this.ownerDocument).querySelectorAll(t),n=e.length;--n>=0&&e.item(n)!==this;);return n>-1}),!!t.matches(e)},t.closest=function(e,n){for(;e&&e!==document;e=e.parentNode)if(t.matches(e,n))return e;return null},t.extend=Object.assign||function(t){t=t||{};for(var e=1,n=arguments.length;n>e;e++)if(arguments[e])for(var r in arguments[e])arguments[e].hasOwnProperty(r)&&(t[r]=arguments[e][r]);return t},t.forEach=function(t,e,n){var r=Object.prototype;if("[object Object]"===r.toString.call(t))for(var o in t)r.hasOwnProperty.call(t,o)&&e.call(n,t[o],o,t);else for(var c=0,i=t.length;i>c;c++)e.call(n,t[c],c,t)},t.on=function(e,n,r,o){e.addEventListener(n,function(e){for(var n=e.target;n&&n!==this;)t.matches(n,r)&&o.call(n,e),n=n.parentNode})},t.once=function(t){var e,n=!1;return function(){return n?e:(n=!0,e=t.apply(this,arguments),t=null,e)}},t.parse=function(t){try{return JSON.parse(t)}catch(e){return!1}},t.resize=function(t,e){return window.onresize=function(){window.clearTimeout(e),e=window.setTimeout(t,200)},t},t.trigger=function(t,e,n,r){var o;n=n||{},r=r||"MouseEvents";var c=function(t,e){return e=e||{},o=document.createEvent(e&&"object"==typeof e?"Event":r),o.initEvent(t,!0,!0,e),o};try{o=n?new CustomEvent(e,{detail:n}):c(e)}catch(i){o=c(e,n)}t.dispatchEvent(o)},t});