akkoma/priv/static/packs/extra_polyfills.js

2 lines
12 KiB
JavaScript
Raw Normal View History

2018-09-20 16:10:13 +00:00
(window.webpackJsonp=window.webpackJsonp||[]).push([[33],{733:function(t,e,n){"use strict";n.r(e);n(766),n(765);var i=n(764);n.n(i)()()},764:function(t,e,n){"use strict";var i="bfred-it:object-fit-images",r=/(object-fit|object-position)\s*:\s*([-\w\s%]+)/g,o="undefined"==typeof Image?{style:{"object-position":1}}:new Image,s="object-fit"in o.style,c="object-position"in o.style,a="background-size"in o.style,u="string"==typeof o.currentSrc,l=o.getAttribute,h=o.setAttribute,f=!1;function d(t,e,n){var i="data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='"+(e||1)+"' height='"+(n||0)+"'%3E%3C/svg%3E";l.call(t,"src")!==i&&h.call(t,"src",i)}function g(t,e){t.naturalWidth?e(t):setTimeout(g,100,t,e)}function p(t){var e=function(t){for(var e,n=getComputedStyle(t).fontFamily,i={};null!==(e=r.exec(n));)i[e[1]]=e[2];return i}(t),n=t[i];if(e["object-fit"]=e["object-fit"]||"fill",!n.img){if("fill"===e["object-fit"])return;if(!n.skipTest&&s&&!e["object-position"])return}if(!n.img){n.img=new Image(t.width,t.height),n.img.srcset=l.call(t,"data-ofi-srcset")||t.srcset,n.img.src=l.call(t,"data-ofi-src")||t.src,h.call(t,"data-ofi-src",t.src),t.srcset&&h.call(t,"data-ofi-srcset",t.srcset),d(t,t.naturalWidth||t.width,t.naturalHeight||t.height),t.srcset&&(t.srcset="");try{!function(t){var e={get:function(e){return t[i].img[e||"src"]},set:function(e,n){return t[i].img[n||"src"]=e,h.call(t,"data-ofi-"+n,e),p(t),e}};Object.defineProperty(t,"src",e),Object.defineProperty(t,"currentSrc",{get:function(){return e.get("currentSrc")}}),Object.defineProperty(t,"srcset",{get:function(){return e.get("srcset")},set:function(t){return e.set(t,"srcset")}})}(t)}catch(t){window.console&&console.warn("https://bit.ly/ofi-old-browser")}}!function(t){if(t.srcset&&!u&&window.picturefill){var e=window.picturefill._;t[e.ns]&&t[e.ns].evaled||e.fillImg(t,{reselect:!0}),t[e.ns].curSrc||(t[e.ns].supported=!1,e.fillImg(t,{reselect:!0})),t.currentSrc=t[e.ns].curSrc||t.src}}(n.img),t.style.backgroundImage='url("'+(n.img.currentSrc||n.img.src).replace(/"/g,'\\"')+'")',t.style.backgroundPosition=e["object-position"]||"center",t.style.backgroundRepeat="no-repeat",t.style.backgroundOrigin="content-box",/scale-down/.test(e["object-fit"])?g(n.img,function(){n.img.naturalWidth>t.width||n.img.naturalHeight>t.height?t.style.backgroundSize="contain":t.style.backgroundSize="auto"}):t.style.backgroundSize=e["object-fit"].replace("none","auto").replace("fill","100% 100%"),g(n.img,function(e){d(t,e.naturalWidth,e.naturalHeight)})}function m(t,e){var n=!f&&!t;if(e=e||{},t=t||"img",c&&!e.skipTest||!a)return!1;"img"===t?t=document.getElementsByTagName("img"):"string"==typeof t?t=document.querySelectorAll(t):"length"in t||(t=[t]);for(var r=0;r<t.length;r++)t[r][i]=t[r][i]||{skipTest:e.skipTest},p(t[r]);n&&(document.body.addEventListener("load",function(t){"IMG"===t.target.tagName&&m(t.target,{skipTest:e.skipTest})},!0),f=!0,t="img"),e.watchMQ&&window.addEventListener("resize",m.bind(null,t,{skipTest:e.skipTest}))}m.supportsObjectFit=s,m.supportsObjectPosition=c,function(){function t(t,e){return t[i]&&t[i].img&&("src"===e||"srcset"===e)?t[i].img:t}c||(HTMLImageElement.prototype.getAttribute=function(e){return l.call(t(this,e),e)},HTMLImageElement.prototype.setAttribute=function(e,n){return h.call(t(this,e),e,String(n))})}(),t.exports=m},765:function(t,e,n){(function(n){var i,r,o;r=[],void 0===(o="function"==typeof(i=function(){"use strict";var t,e,i,r,o,s,c,a,u="undefined"!=typeof window?window:void 0!=typeof n?n:this||{},l=u.cancelRequestAnimationFrame&&u.requestAnimationFrame||setTimeout,h=u.cancelRequestAnimationFrame||clearTimeout,f=[],d=0,g=!1,p=7,m=35,b=125,v=0,y=0,_=0,I={get didTimeout(){return!1},timeRemaining:function(){var t=p-(Date.now()-y);return t<0?0:t}},w=(o=function(){p=22,b=66,m=0},a=function(){var t=Date.now()-c;t<99?s=setTimeout(a,99-t):(s=null,o())},function(){c=Date.now(),s||(s=setTimeout(a,99))});function E(){125!=b&&(p=7,b=125,m=35,g&&(g&&(r&&h(r),i&&clearTimeout(i),g=!1),R())),w()}function T(){r=null,i=setTimeout(O,0)}function k(){i=null,l(T)}function R
//# sourceMappingURL=extra_polyfills.js.map