lib/assets/javascripts/webshims/shims/picture.js in webshims-rails-1.15.6.4 vs lib/assets/javascripts/webshims/shims/picture.js in webshims-rails-1.15.8

- old
+ new

@@ -1,3 +1,7 @@ -/*! respimage - v1.2.1 - 2014-12-23 - Licensed MIT */ -!function(a,b,c){"use strict";function d(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function e(){var b;T=!1,W=a.devicePixelRatio,U={},V={},b=(W||1)*D.xQuant,D.uT||(D.maxX=Math.max(1.3,D.maxX),b=Math.min(b,D.maxX),v.DPR=b),X.width=Math.max(a.innerWidth||0,B.clientWidth),X.height=Math.max(a.innerHeight||0,B.clientHeight),X.vw=X.width/100,X.vh=X.height/100,X.em=v.getEmValue(),X.rem=X.em,p=D.lazyFactor/2,p=p*b+p,r=.1*b,m=.5+.2*b,n=.5+.25*b,q=b+1.3,(o=X.width>X.height)||(p*=.9),J&&(p*=.9)}function f(a,b,c){var d=b*Math.pow(a,2);return o||(d/=1.3),a+=d,a>c}function g(a){if(!a.getBoundingClientRect)return!0;var b,c,d,e,f=a.getBoundingClientRect();return!!((b=f.bottom)>=-9&&(e=f.top)<=X.height+9&&(c=f.right)>=-9&&(d=f.left)<=X.height+9&&(b||c||d||e))}function h(a){var b,c=v.getSet(a),d=!1;"pending"!=c&&(d=!0,c&&(b=v.setRes(c),d=v.applySetCandidate(b,a))),a[v.ns].evaled=d}function i(a,b){return a.res-b.res}function j(a,b,c){var d;return!c&&b&&(c=a[v.ns].sets,c=c&&c[c.length-1]),d=k(b,c),d&&(b=v.makeUrl(b),a[v.ns].curSrc=b,a[v.ns].curCan=d,d.res||cb(d,d.set.sizes)),d}function k(a,b){var c,d,e;if(a&&b)for(e=v.parseSet(b),a=v.makeUrl(a),c=0;c<e.length;c++)if(a==v.makeUrl(e[c].url)){d=e[c];break}return d}function l(a,b){var c,d,e,f,g=a.getElementsByTagName("source");for(c=0,d=g.length;d>c;c++)e=g[c],e[v.ns]=!0,f=e.getAttribute("srcset"),f&&b.push({srcset:f,media:e.getAttribute("media"),type:e.getAttribute("type"),sizes:e.getAttribute("sizes")})}b.createElement("picture");var m,n,o,p,q,r,s,t,u,v={},w=function(){},x=b.createElement("img"),y=x.getAttribute,z=x.setAttribute,A=x.removeAttribute,B=b.documentElement,C={},D={xQuant:1,lazyFactor:.4,maxX:2},E="data-risrc",F=E+"set",G="webkitBackfaceVisibility"in B.style,H=navigator.userAgent,I=/AppleWebKit/i.test(H),J=/rident/.test(H)||/ecko/.test(H)&&H.match(/rv\:(\d+)/)&&RegExp.$1>35,K=0,L="currentSrc",M=/\s+\+?\d+(e\d+)?w/,N=/(\([^)]+\))?\s*(.+)/,O=/^([\+eE\d\.]+)(w|x)$/,P=/\s*\d+h\s*/,Q=a.respimgCFG,R=("https:"==location.protocol,"position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)"),S="font-size:100%!important;",T=!0,U={},V={},W=a.devicePixelRatio,X={px:1,"in":96},Y=b.createElement("a"),Z=!1,$=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},_=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d||!1):a.detachEvent&&a.detachEvent("on"+b,c)},ab=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},bb=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=ab(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")});return function(b,d){var e;if(!(b in U))if(U[b]=!1,d&&(e=b.match(a)))U[b]=e[1]*X[e[2]];else try{U[b]=new Function("e",c(b))(X)}catch(f){}return U[b]}}(),cb=function(a,b){return a.w?(a.cWidth=v.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.x,a},db=function(a){var c,d,e,f=a||{};if(f.elements&&1==f.elements.nodeType&&("IMG"==f.elements.nodeName.toUpperCase()?f.elements=[f.elements]:(f.context=f.elements,f.elements=null)),c=f.elements||v.qsa(f.context||b,f.reevaluate||f.reparse?v.sel:v.selShort),e=c.length){for(v.setupRun(f),Z=!0,d=0;e>d;d++)K++,6>K&&!c[d].complete&&K++,v.fillImg(c[d],f);v.teardownRun(f),K++}},eb=function(){var a=function(){_(this,"load",a),_(this,"error",a),v.fillImgs({elements:[this]})};return function(b){_(b,"load",a),_(b,"error",a),$(b,"error",a),$(b,"load",a)}}(),fb=ab(function(a){var b=[1,"x"],c=d(a||"");return c&&(c=c.replace(P,""),b=c.match(O)?[1*RegExp.$1,RegExp.$2]:!1),b});L in x||(L="src"),C["image/jpeg"]=!0,C["image/gif"]=!0,C["image/png"]=!0,C["image/svg+xml"]=b.implementation.hasFeature("http://wwwindow.w3.org/TR/SVG11/feature#Image","1.1"),v.ns=("ri"+(new Date).getTime()).substr(0,9),v.supSrcset="srcset"in x,v.supSizes="sizes"in x,v.selShort="picture>img,img[srcset]",v.sel=v.selShort,v.cfg=D,v.supSrcset&&(v.sel+=",img["+F+"]"),v.DPR=W||1,v.u=X,v.types=C,t=v.supSrcset&&!v.supSizes,v.setSize=w,v.makeUrl=ab(function(a){return Y.href=a,Y.href}),v.qsa=function(a,b){return a.querySelectorAll(b)},v.matchesMedia=function(){return v.matchesMedia=a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?function(a){return!a||matchMedia(a).matches}:v.mMQ,v.matchesMedia.apply(this,arguments)},v.mMQ=function(a){return a?bb(a):!0},v.calcLength=function(a){var b=bb(a,!0)||!1;return 0>b&&(b=!1),b},v.supportsType=function(a){return a?C[a]:!0},v.parseSize=ab(function(a){var b=(a||"").match(N);return{media:b&&b[1],length:b&&b[2]}}),v.parseSet=function(a){if(!a.cands){var b,c,d,e,f,g,h=a.srcset;for(a.cands=[];h;)h=h.replace(/^\s+/g,""),b=h.search(/\s/g),d=null,-1!=b?(c=h.slice(0,b),e=c.charAt(c.length-1),","!=e&&c||(c=c.replace(/,+$/,""),d=""),h=h.slice(b+1),null==d&&(f=h.indexOf(","),-1!=f?(d=h.slice(0,f),h=h.slice(f+1)):(d=h,h=""))):(c=h,h=""),c&&(d=fb(d))&&(g={url:c.replace(/^,+/,""),set:a},g[d[1]]=d[0],"x"==d[1]&&1==d[0]&&(a.has1x=!0),a.cands.push(g))}return a.cands},v.getEmValue=function(){var a;if(!s&&(a=b.body)){var c=b.createElement("div"),d=B.style.cssText,e=a.style.cssText;c.style.cssText=R,B.style.cssText=S,a.style.cssText=S,a.appendChild(c),s=c.offsetWidth,a.removeChild(c),s=parseFloat(s,10),B.style.cssText=d,a.style.cssText=e}return s||16},v.calcListLength=function(a){if(!(a in V)||D.uT){var b,c,e,f,g,h,i=d(a).split(/\s*,\s*/),j=!1;for(g=0,h=i.length;h>g&&(b=i[g],c=v.parseSize(b),e=c.length,f=c.media,!e||!v.matchesMedia(f)||(j=v.calcLength(e))===!1);g++);V[a]=j?j:X.width}return V[a]},v.setRes=function(a){var b;if(a){b=v.parseSet(a);for(var c=0,d=b.length;d>c;c++)cb(b[c],a.sizes)}return b},v.setRes.res=cb,v.applySetCandidate=function(a,b){if(a.length){var c,d,e,h,k,l,o,s,t,u,w,x,z,A=b[v.ns],B=!0,C=p,D=r;if(s=A.curSrc||b[L],t=A.curCan||j(b,s,a[0].set),d=v.DPR,z=t&&t.res,!o&&s&&(x=J&&!b.complete&&t&&z>d,x||t&&!(q>z)||(t&&d>z&&z>m&&(n>z&&(C*=.87,D+=.04*d),t.res+=C*Math.pow(z-D,2)),u=!A.pic||t&&t.set==a[0].set,t&&u&&t.res>=d?o=t:I||b.complete||!y.call(b,"src")||b.lazyload||J&&!(5>K)||!u&&g(b)||(o=t,w=s,B="L",eb(b)))),!o)for(z&&(t.res=t.res-(t.res-z)/2),a.sort(i),l=a.length,o=a[l-1],e=0;l>e;e++)if(c=a[e],c.res>=d){h=e-1,o=a[h]&&(k=c.res-d)&&(x||s!=v.makeUrl(c.url))&&f(a[h].res,k,d)?a[h]:c;break}return z&&(t.res=z),o&&(w=v.makeUrl(o.url),A.curSrc=w,A.curCan=o,w!=s&&v.setSrc(b,o),v.setSize(b)),B}},v.setSrc=function(a,b){var c;a.src=b.url,G&&(c=a.style.zoom,a.style.zoom="0.999",a.style.zoom=c)},v.getSet=function(a){var b,c,d,e=!1,f=a[v.ns].sets;for(b=0;b<f.length&&!e;b++)if(c=f[b],c.srcset&&v.matchesMedia(c.media)&&(d=v.supportsType(c.type))){"pending"==d&&(c=d),e=c;break}return e},v.parseSets=function(a,b){var d,e,f,g,h="PICTURE"==b.nodeName.toUpperCase(),i=a[v.ns];i.src===c&&(i.src=y.call(a,"src"),i.src?z.call(a,E,i.src):A.call(a,E)),i.srcset===c&&(d=y.call(a,"srcset"),i.srcset=d,g=!0),i.sets=[],h&&(i.pic=!0,l(b,i.sets)),i.srcset?(e={srcset:i.srcset,sizes:y.call(a,"sizes")},i.sets.push(e),f=(t||i.src)&&M.test(i.srcset||""),f||!i.src||k(i.src,e)||e.has1x||(e.srcset+=", "+i.src,e.cands.push({url:i.src,x:1,set:e}))):i.src&&i.sets.push({srcset:i.src,sizes:null}),i.curCan=null,i.supported=!(h||e&&!v.supSrcset||f),g&&v.supSrcset&&!i.supported&&(d?(z.call(a,F,d),a.srcset=""):A.call(a,F)),i.supported&&!i.srcset&&(!i.src&&a.src||a.src!=v.makeUrl(i.src))&&(null==i.src?a.removeAttribute("src"):a.src=i.src),i.parsed=!0},v.fillImg=function(a,b){var c,d,e=b.reparse||b.reevaluate;if(a[v.ns]||(a[v.ns]={}),d=a[v.ns],"L"==d.evaled&&a.complete&&(d.evaled=!1),e||!d.evaled){if(!d.parsed||b.reparse){if(c=a.parentNode,!c)return;v.parseSets(a,c,b)}d.supported?d.evaled=!0:h(a)}},v.setupRun=function(a){(!Z||a.reevaluate||T)&&(e(),a.elements||a.context||clearTimeout(u))},a.HTMLPictureElement?(db=w,v.fillImg=w):!function(){var c,d=a.attachEvent?/d$|^c/:/d$|^c|^i/,e=function(){var a=b.readyState||"";h=setTimeout(e,"loading"==a?200:999),b.body&&(c=c||d.test(a),v.fillImgs(),c&&(K+=6,clearTimeout(h)))},f=function(){v.fillImgs({reevaluate:!0})},g=function(){clearTimeout(u),T=!0,u=setTimeout(f,99)},h=setTimeout(e,b.body?9:99);$(a,"resize",g),$(b,"readystatechange",e)}(),v.respimage=db,v.fillImgs=db,v.teardownRun=w,db._=v,a.respimage=db,a.respimgCFG={ri:v,push:function(a){var b=a.shift();"function"==typeof v[b]?v[b].apply(v,a):(D[b]=a[0],Z&&v.fillImgs({reevaluate:!0}))}};for(;Q&&Q.length;)a.respimgCFG.push(Q.shift())}(window,document),function(a){"use strict";var b,c=0,d=function(){window.respimage&&a(window.respimage),(window.respimage||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a){"use strict";var b=a._,c=0,d=function(a,c){var d;for(d=0;d<a.length;d++)b.types[a[d]]=c};return window.HTMLPictureElement&&!b.cfg.uT?void(a.testTypeSupport=function(){}):(b.types["image/bmp"]=!0,b.types["image/x-bmp"]=!0,a.testTypeSupport=function(b,e,f,g){"string"==typeof b&&(b=b.split(/\s*\,*\s+/g));var h,i="pending",j=document.createElement("img"),k=function(){c--,d(b,i),1>c&&a({reevaluate:!0})};return g&&(h=document.createElement("canvas"),!h.getContext)?void d(b,!1):(j.onload=function(){var a;i=!0,f&&(i=j.width==f),g&&(a=h.getContext("2d"),a.drawImage(j,0,0),i=0===a.getImageData(0,0,1,1).data[3]),k()},j.onerror=function(){i=!1,k()},c++,d(b,"pending"),void(j.src=e))},a.testTypeSupport("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",1),a.testTypeSupport("image/jp2 image/jpx image/jpm","data:image/jp2;base64,/0//UQAyAAAAAAABAAAAAgAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAEBwEBBwEBBwEBBwEB/1IADAAAAAEAAAQEAAH/XAAEQED/ZAAlAAFDcmVhdGVkIGJ5IE9wZW5KUEVHIHZlcnNpb24gMi4wLjD/kAAKAAAAAABYAAH/UwAJAQAABAQAAf9dAAUBQED/UwAJAgAABAQAAf9dAAUCQED/UwAJAwAABAQAAf9dAAUDQED/k8+kEAGvz6QQAa/PpBABr994EAk//9k=",1),a.testTypeSupport("image/vnd.ms-photo","data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA==",1),void a.testTypeSupport("video/png video/apng video/x-mng video/x-png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==",!1,!0))}),function(a){"use strict";var b,c=0,d=function(){window.respimage&&a(window.respimage),(window.respimage||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a,b){"use strict";var c=a._,d={},e=c.cfg,f="currentSrc",g=function(a,b,c){var d=c.curCan;a&&b.setAttribute("width",parseInt(a/d.res,10))},h=function(a,b,c){var e,h,i;d[a]?g(d[a],b,c):(i=function(){c.pendingURLSize=null,e.onload=null,e.onerror=null,b=null,e=null},c.pendingURLSize=a,h=c.curCan,h.w&&g(h.w,b,c),e=document.createElement("img"),e.onload=function(){d[a]=e.naturalWidth||e.width,a==b[f]&&g(d[a],b,c),i()},e.onerror=i,e.src=a,e&&e.complete&&e.onload())},i=function(){var a,b,d=function(){var d,e,f,g=document.getElementsByTagName("img"),h={elements:[]};for(c.setupRun(h),a=!1,clearTimeout(b),d=0,e=g.length;e>d;d++)f=g[d][c.ns],f&&f.curCan&&(c.setRes.res(f.curCan,f.curCan.set.sizes),c.setSize(g[d]));c.teardownRun(h)};return function(){!a&&e.addSize&&(a=!0,clearTimeout(b),b=setTimeout(d))}}();f in document.createElement("img")||(f="src"),c.setSize=function(a){var d,g=a[c.ns],i=g.curCan;g.dims===b&&(g.dims=a.getAttribute("height")&&a.getAttribute("width")),e.addSize&&i&&!g.dims&&(d=c.makeUrl(i.url),d==a[f]&&d!==g.pendingURLSize&&h(d,a,g))},window.addEventListener&&addEventListener("resize",i,!1),e.addSize="addSize"in e?!!e.addSize:!0,i()}),function(){webshim.isReady("picture",!0);var a="picture, img[srcset]";webshim.addReady(function(b){b.querySelector(a)&&window.respimage()})}(); +/*! Respimg - Responsive Images that work today. + * Author: Alexander Farkas, 2014 + * Author: Scott Jehl, Filament Group, 2012 ( new proposal implemented by Shawn Jansepar ) + * License: MIT + * Spec: http://picture.responsiveimages.org/ + */ +!function(a,b,c){"use strict";function d(a){return a.trim?a.trim():a.replace(/^\s+|\s+$/g,"")}function e(){var b;T=!1,W=a.devicePixelRatio,U={},V={},b=(W||1)*E.xQuant,E.uT||(E.maxX=Math.max(1.3,E.maxX),b=Math.min(b,E.maxX),w.DPR=b),X.width=Math.max(a.innerWidth||0,C.clientWidth),X.height=Math.max(a.innerHeight||0,C.clientHeight),X.vw=X.width/100,X.vh=X.height/100,X.em=w.getEmValue(),X.rem=X.em,o=E.lazyFactor/2,o=o*b+o,q=.4+.1*b,l=.5+.2*b,m=.5+.25*b,p=b+1.3,(n=X.width>X.height)||(o*=.9),J&&(o*=.9),v=[X.width,X.height,b].join("-")}function f(a,b,c){var d=b*Math.pow(a-.4,1.9);return n||(d/=1.3),a+=d,a>c}function g(a){var b,c=w.getSet(a),d=!1;"pending"!=c&&(d=v,c&&(b=w.setRes(c),d=w.applySetCandidate(b,a))),a[w.ns].evaled=d}function h(a,b){return a.res-b.res}function i(a,b,c){var d;return!c&&b&&(c=a[w.ns].sets,c=c&&c[c.length-1]),d=j(b,c),d&&(b=w.makeUrl(b),a[w.ns].curSrc=b,a[w.ns].curCan=d,d.res||cb(d,d.set.sizes)),d}function j(a,b){var c,d,e;if(a&&b)for(e=w.parseSet(b),a=w.makeUrl(a),c=0;c<e.length;c++)if(a==w.makeUrl(e[c].url)){d=e[c];break}return d}function k(a,c){var d,e,f,g,h=a.getElementsByTagName("source");for(d=0,e=h.length;e>d;d++)f=h[d],f[w.ns]=!0,g=f.getAttribute("srcset"),RIDEBUG&&9!=b.documentMode&&f.parentNode!=a&&r("all source elements have to be a child of the picture element. For IE9 support wrap them in an audio/video element, BUT with conditional comments"),g&&c.push({srcset:g,media:f.getAttribute("media"),type:f.getAttribute("type"),sizes:f.getAttribute("sizes")}),RIDEBUG&&f.getAttribute("src")&&r("`src` on `source` invalid, use `srcset`.");if(RIDEBUG){var i=w.qsa(a,"source, img");"SOURCE"==i[i.length-1].nodeName.toUpperCase()&&r("all sources inside picture have to precede the img element")}}"undefined"==typeof RIDEBUG&&(a.RIDEBUG=!0);var l,m,n,o,p,q,r,s,t,u,v,w={},x=function(){},y=b.createElement("img"),z=y.getAttribute,A=y.setAttribute,B=y.removeAttribute,C=b.documentElement,D={},E={xQuant:1,lazyFactor:.4,maxX:2},F="data-risrc",G=F+"set",H="webkitBackfaceVisibility"in C.style,I=navigator.userAgent,J=/rident/.test(I)||/ecko/.test(I)&&I.match(/rv\:(\d+)/)&&RegExp.$1>35,K="currentSrc",L=/\s+\+?\d+(e\d+)?w/,M=/((?:\([^)]+\)(?:\s*and\s*|\s*or\s*|\s*not\s*)?)+)?\s*(.+)/,N=/^([\+eE\d\.]+)(w|x)$/,O=/\s*\d+h\s*/,P=a.respimgCFG,Q="https:"==location.protocol,R="position:absolute;left:0;visibility:hidden;display:block;padding:0;border:none;font-size:1em;width:1em;overflow:hidden;clip:rect(0px, 0px, 0px, 0px)",S="font-size:100%!important;",T=!0,U={},V={},W=a.devicePixelRatio,X={px:1,"in":96},Y=b.createElement("a"),Z=!1,$=function(a,b,c,d){a.addEventListener?a.addEventListener(b,c,d||!1):a.attachEvent&&a.attachEvent("on"+b,c)},_=function(a,b,c,d){a.removeEventListener?a.removeEventListener(b,c,d||!1):a.detachEvent&&a.detachEvent("on"+b,c)},ab=function(a){var b={};return function(c){return c in b||(b[c]=a(c)),b[c]}},bb=function(){var a=/^([\d\.]+)(em|vw|px)$/,b=function(){for(var a=arguments,b=0,c=a[0];++b in a;)c=c.replace(a[b],a[++b]);return c},c=ab(function(a){return"return "+b((a||"").toLowerCase(),/\band\b/g,"&&",/,/g,"||",/min-([a-z-\s]+):/g,"e.$1>=",/max-([a-z-\s]+):/g,"e.$1<=",/calc([^)]+)/g,"($1)",/(\d+[\.]*[\d]*)([a-z]+)/g,"($1 * e.$2)",/^(?!(e.[a-z]|[0-9\.&=|><\+\-\*\(\)\/])).*/gi,"")});return function(b,d){var e;if(!(b in U))if(U[b]=!1,d&&(e=b.match(a)))U[b]=e[1]*X[e[2]];else try{U[b]=new Function("e",c(b))(X)}catch(f){}return U[b]}}(),cb=function(a,b){return a.w?(a.cWidth=w.calcListLength(b||"100vw"),a.res=a.w/a.cWidth):a.res=a.x,a},db=function(c){var d,e,f,g=c||{};if(g.elements&&1==g.elements.nodeType&&("IMG"==g.elements.nodeName.toUpperCase()?g.elements=[g.elements]:(g.context=g.elements,g.elements=null)),g.reparse&&(g.reevaluate=!0,a.console&&console.warn&&console.warn("reparse was renamed to reevaluate!")),d=g.elements||w.qsa(g.context||b,g.reevaluate||g.reselect?w.sel:w.selShort),f=d.length){for(w.setupRun(g),Z=!0,e=0;f>e;e++)w.fillImg(d[e],g);w.teardownRun(g)}},eb=ab(function(a){var b=[1,"x"],c=d(a||"");return c&&(c=c.replace(O,""),c.match(N)?(b=[1*RegExp.$1,RegExp.$2],RIDEBUG&&(b[0]<0||isNaN(b[0])||"w"==b[1]&&/\./.test(""+b[0]))&&r("bad descriptor: "+a)):(b=!1,RIDEBUG&&r("unknown descriptor: "+a))),b});RIDEBUG&&(r=a.console&&console.warn?function(a){console.warn(a)}:x),K in y||(K="src"),D["image/jpeg"]=!0,D["image/gif"]=!0,D["image/png"]=!0,D["image/svg+xml"]=b.implementation.hasFeature("http://wwwindow.w3.org/TR/SVG11/feature#Image","1.1"),w.ns=("ri"+(new Date).getTime()).substr(0,9),w.supSrcset="srcset"in y,w.supSizes="sizes"in y,w.selShort="picture>img,img[srcset]",w.sel=w.selShort,w.cfg=E,w.supSrcset&&(w.sel+=",img["+G+"]"),w.DPR=W||1,w.u=X,w.types=D,t=w.supSrcset&&!w.supSizes,w.setSize=x,w.makeUrl=ab(function(a){return Y.href=a,Y.href}),w.qsa=function(a,b){return a.querySelectorAll(b)},w.matchesMedia=function(){return w.matchesMedia=a.matchMedia&&(matchMedia("(min-width: 0.1em)")||{}).matches?function(a){return!a||matchMedia(a).matches}:w.mMQ,w.matchesMedia.apply(this,arguments)},w.mMQ=function(a){return a?bb(a):!0},w.calcLength=function(a){var b=bb(a,!0)||!1;return 0>b&&(b=!1),RIDEBUG&&(b===!1||0>b)&&r("invalid source size: "+a),b},w.supportsType=function(a){return a?D[a]:!0},w.parseSize=ab(function(a){var b=(a||"").match(M);return{media:b&&b[1],length:b&&b[2]}}),w.parseSet=function(a){if(!a.cands){var b,c,d,e,f,g,h,i=a.srcset;for(a.cands=[];i;)i=i.replace(/^\s+/g,""),b=i.search(/\s/g),d=null,-1!=b?(c=i.slice(0,b),e=c.charAt(c.length-1),","!=e&&c||(c=c.replace(/,+$/,""),d=""),i=i.slice(b+1),null==d&&(f=i.indexOf(","),-1!=f?(d=i.slice(0,f),i=i.slice(f+1)):(d=i,i=""))):(c=i,i=""),c&&(d=eb(d))&&(RIDEBUG&&(h||(h=a.sizes?"w":d[1]),h!=d[1]&&r("mixing x with a w descriptor/sizes attribute in one srcset doesn't make sense in most cases and is invalid.")),g={url:c.replace(/^,+/,""),set:a},g[d[1]]=d[0],"x"==d[1]&&1==d[0]&&(a.has1x=!0),a.cands.push(g))}return a.cands},w.getEmValue=function(){var a;if(!s&&(a=b.body)){var c=b.createElement("div"),d=C.style.cssText,e=a.style.cssText;c.style.cssText=R,C.style.cssText=S,a.style.cssText=S,a.appendChild(c),s=c.offsetWidth,a.removeChild(c),s=parseFloat(s,10),C.style.cssText=d,a.style.cssText=e}return s||16},w.calcListLength=function(a){if(!(a in V)||E.uT){var b,c,e,f,g,h,i=d(a).split(/\s*,\s*/),j=!1;for(g=0,h=i.length;h>g&&(b=i[g],c=w.parseSize(b),e=c.length,f=c.media,!e||!w.matchesMedia(f)||(j=w.calcLength(e))===!1);g++);V[a]=j?j:X.width}return V[a]},w.setRes=function(a){var b;if(a){b=w.parseSet(a);for(var c=0,d=b.length;d>c;c++)cb(b[c],a.sizes)}return b},w.setRes.res=cb,w.applySetCandidate=function(a,b){if(a.length){var c,d,e,g,j,k,n,s,t,u,x,y,z,A=b[w.ns],B=v,C=o,D=q;if(s=A.curSrc||b[K],t=A.curCan||i(b,s,a[0].set),d=w.DPR,z=t&&t.res,!n&&s&&(y=J&&!b.complete&&t&&z-.2>d,y||t&&!(p>z)||(t&&d>z&&z>l&&(m>z&&(C*=.8,D+=.04*d),t.res+=C*Math.pow(z-D,2)),u=!A.pic||t&&t.set==a[0].set,t&&u&&t.res>=d&&(n=t))),!n)for(z&&(t.res=t.res-(t.res-z)/2),a.sort(h),k=a.length,n=a[k-1],e=0;k>e;e++)if(c=a[e],c.res>=d){g=e-1,n=a[g]&&(j=c.res-d)&&(y||s!=w.makeUrl(c.url))&&f(a[g].res,j,d)?a[g]:c;break}return z&&(t.res=z),n&&(x=w.makeUrl(n.url),A.curSrc=x,A.curCan=n,x!=s&&(w.setSrc(b,n),RIDEBUG&&(fb(b,n),Q&&!n.url.indexOf("http:")&&r("insecure: "+x))),w.setSize(b)),B}},w.setSrc=function(a,b){var c;a.src=b.url,H&&(c=a.style.zoom,a.style.zoom="0.999",a.style.zoom=c)},w.getSet=function(a){var b,c,d,e=!1,f=a[w.ns].sets;for(b=0;b<f.length&&!e;b++)if(c=f[b],c.srcset&&w.matchesMedia(c.media)&&(d=w.supportsType(c.type))){"pending"==d&&(c=d),e=c;break}return e},w.parseSets=function(a,b,d){var e,f,g,h,i="PICTURE"==b.nodeName.toUpperCase(),l=a[w.ns];(l.src===c||d.src)&&(l.src=z.call(a,"src"),l.src?A.call(a,F,l.src):B.call(a,F)),(l.srcset===c||!w.supSrcset||a.srcset||d.srcset)&&(e=z.call(a,"srcset"),l.srcset=e,h=!0),l.sets=[],i&&(l.pic=!0,k(b,l.sets)),l.srcset?(f={srcset:l.srcset,sizes:z.call(a,"sizes")},l.sets.push(f),g=(t||l.src)&&L.test(l.srcset||""),g||!l.src||j(l.src,f)||f.has1x||(f.srcset+=", "+l.src,f.cands.push({url:l.src,x:1,set:f})),RIDEBUG&&!i&&g&&l.src&&-1==f.srcset.indexOf(a[w.ns].src)&&r("The fallback candidate (`src`) isn't described inside the srcset attribute. Normally you want to describe all available candidates.")):l.src&&l.sets.push({srcset:l.src,sizes:null}),l.curCan=null,l.curSrc=c,l.supported=!(i||f&&!w.supSrcset||g),h&&w.supSrcset&&!l.supported&&(e?(A.call(a,G,e),a.srcset=""):B.call(a,G)),l.supported&&!l.srcset&&(!l.src&&a.src||a.src!=w.makeUrl(l.src))&&(null==l.src?a.removeAttribute("src"):a.src=l.src),RIDEBUG&&gb(l.sets,"source"),l.parsed=!0},w.fillImg=function(a,b){var c,d,e=b.reselect||b.reevaluate;if(a[w.ns]||(a[w.ns]={}),d=a[w.ns],e||d.evaled!=v){if(!d.parsed||b.reevaluate){if(c=a.parentNode,!c)return;w.parseSets(a,c,b)}d.supported?d.evaled=v:g(a)}},w.setupRun=function(b){(!Z||T||W!=a.devicePixelRatio)&&(e(),b.elements||b.context||clearTimeout(u))},a.HTMLPictureElement?(db=x,w.fillImg=x):(b.createElement("picture"),function(){var c,d=a.attachEvent?/d$|^c/:/d$|^c|^i/,e=function(){var a=b.readyState||"";h=setTimeout(e,"loading"==a?200:999),b.body&&(c=c||d.test(a),w.fillImgs(),c&&clearTimeout(h))},f=function(){w.fillImgs()},g=function(){clearTimeout(u),T=!0,u=setTimeout(f,99)},h=setTimeout(e,b.body?0:20);$(a,"resize",g),$(b,"readystatechange",e)}()),w.respimage=db,w.fillImgs=db,w.teardownRun=x,db._=w,a.respimage=db,a.respimgCFG={ri:w,push:function(a){var b=a.shift();"function"==typeof w[b]?w[b].apply(w,a):(E[b]=a[0],Z&&w.fillImgs({reselect:!0}))}};for(;P&&P.length;)a.respimgCFG.push(P.shift());if(RIDEBUG){r("Responsive image debugger active. Do not use in production, because it slows things down! extremly"),(!b.querySelector||(b.documentMode||9)<8)&&r("querySelector is needed. IE8 needs to be in strict, standard or edge mode: http://bit.ly/1yGgYU0 or try the ri.oldie.js plugin."),"<PICTURE>"==(b.getElementsByTagName("picture")[0]||{}).outerHTML&&r("IE8 needs to picture shived. Either include respimage.js in <head> or use html5shiv."),"BackCompat"==b.compatMode&&r("Browser is in quirksmode. Please make sure to be in strict mode.");var fb=function(a,b){var c=function(){var d,e,f=a.offsetWidth,g=a.naturalWidth,h=b.cWidth,i=w.DPR*E.xQuant,j=.84,k=i>1?.5:.75;!h&&g&&b.x&&(h=g/i),f&&h&&(f>h?(d=h/f,e=k):(d=f/h,e=j),Math.abs(f-h)>50&&(b.w&&.86>d?r("Check your sizes attribute: "+b.set.sizes+" was calculated to: "+h+"px. But your image is shown with a size of "+f+"px. img: "+b.url):b.x&&e>d)),_(a,"load",c)};$(a,"load",c)},gb=function(){var a={minw:/^\s*\(\s*min\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)\s*$/,maxw:/^\s*\(\s*max\-width\s*:\s*(\s*[0-9\.]+)(px|em)\s*\)\s*$/},b=function(a,b,c,d){var e,f;for(e=0;c>e&&e<b.length;e++)f=b[e],(a._min&&f._min&&a._min>=f._min||a._max&&f._max&&a._max<=f._max)&&r("source"==d?"Order of your source elements matters. Defining "+a.media+" after "+f.media+" doesn't make sense.":"Order inside your sizes attribute does matter. Defining "+a.media+" after "+f.media+" doesn't make sense.")},c=function(c,d){var e,f,g,h;for(h=c[c.length-1],h&&(h.media||h.type)&&r("source"==d?"The last src/srcset shouldn't have any type or media conditions. Use img[src] or img[srcset].":"Last sizes attribute shouldn't have any condition otherwise 100vw is used."),e=0,f=c.length;f>e;e++)g=c[e],g.media&&!g.type?(g._min=g.media.match(a.minw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),g._max=g.media.match(a.maxw)&&parseFloat(RegExp.$1)+(RegExp.$2||""),g._min&&(g._min=parseFloat(g._min,10)*(g._min.indexOf("em")>0?w.getEmValue():1)),g._max&&(g._max=parseFloat(g._max,10)*(g._max.indexOf("em")>0?w.getEmValue():1)),(g._min||g._max)&&b(g,c,e,d)):g.type||e==f-1||r("source"==d?"A source element without [media] and [type] doesn't make any sense. Last srcset can be used at the img element. Order is important!":"The order of your sizes attribute does matter! The sizes length without a media condition has to be defined as last entry.")};return function(a){var b,e,f,g,h;for(c(a,"source"),b=0,e=a.length;e>b;b++)if(f=d(a[b].sizes||"")){for(h=[],f=f.split(/\s*,\s*/),g=0;g<f.length;g++)f[g]&&h.push(w.parseSize(f[g]));h.length&&c(h,"sizes")}}}()}}(window,document),function(a){"use strict";var b,c=0,d=function(){window.respimage&&a(window.respimage),(window.respimage||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a,b){"use strict";var c=window.document,d=a._,e={},f=d.cfg,g=function(a,b,c){var d=c.curCan;a&&b.setAttribute("width",parseInt(a/d.res,10))},h=function(a,b,d){var f,h,i;a in e?g(e[a],b,d):(i=function(){d.pendingURLSize=null,f.onload=null,f.onerror=null,b=null,f=null},d.pendingURLSize=a,h=d.curCan,h.w&&g(h.w,b,d),f=c.createElement("img"),f.onload=function(){if(e[a]=f.naturalWidth||f.width,!e[a])try{c.body.appendChild(f),e[a]=f.offsetWidth||f.naturalWidth||f.width,c.body.removeChild(f)}catch(h){}a==b.src&&g(e[a],b,d),i()},f.onerror=i,f.src=a,f&&f.complete&&f.onload())},i=function(){var a,b,e=function(){var e,f,g,h=c.getElementsByTagName("img"),i={elements:[]};for(d.setupRun(i),a=!1,clearTimeout(b),e=0,f=h.length;f>e;e++)g=h[e][d.ns],g&&g.curCan&&(d.setRes.res(g.curCan,g.curCan.set.sizes),d.setSize(h[e]));d.teardownRun(i)};return function(){!a&&f.addSize&&(a=!0,clearTimeout(b),b=setTimeout(e))}}();d.setSize=function(a){var c,e=a[d.ns],g=e.curCan;e.dims===b&&(e.dims=a.getAttribute("height")&&a.getAttribute("width")),f.addSize&&g&&!e.dims&&(c=d.makeUrl(g.url),c==a.src&&c!==e.pendingURLSize&&h(c,a,e))},window.addEventListener&&!window.HTMLPictureElement&&addEventListener("resize",i,!1),f.addSize="addSize"in f?!!f.addSize:!0,i()}),function(a){"use strict";var b,c=0,d=function(){window.respimage&&a(window.respimage),(window.respimage||c>9999)&&clearInterval(b),c++};b=setInterval(d,8),d()}(function(a){"use strict";var b=a._,c=0,d=function(a,c){var d;for(d=0;d<a.length;d++)b.types[a[d]]=c};return window.HTMLPictureElement&&!b.cfg.uT?void(a.testTypeSupport=function(){}):(b.types["image/bmp"]=!0,b.types["image/x-bmp"]=!0,a.testTypeSupport=function(b,e,f,g){"string"==typeof b&&(b=b.split(/\s*\,*\s+/g));var h,i="pending",j=document.createElement("img"),k=function(){c--,d(b,i),1>c&&a({reevaluate:!0})};return g&&(h=document.createElement("canvas"),!h.getContext)?void d(b,!1):(j.onload=function(){var a;i=!0,f&&(i=j.width==f),g&&(a=h.getContext("2d"),a.drawImage(j,0,0),i=0===a.getImageData(0,0,1,1).data[3]),k()},j.onerror=function(){i=!1,k()},c++,d(b,"pending"),void(j.src=e))},a.testTypeSupport("image/webp","data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==",1),a.testTypeSupport("image/jp2 image/jpx image/jpm","data:image/jp2;base64,/0//UQAyAAAAAAABAAAAAgAAAAAAAAAAAAAABAAAAAQAAAAAAAAAAAAEBwEBBwEBBwEBBwEB/1IADAAAAAEAAAQEAAH/XAAEQED/ZAAlAAFDcmVhdGVkIGJ5IE9wZW5KUEVHIHZlcnNpb24gMi4wLjD/kAAKAAAAAABYAAH/UwAJAQAABAQAAf9dAAUBQED/UwAJAgAABAQAAf9dAAUCQED/UwAJAwAABAQAAf9dAAUDQED/k8+kEAGvz6QQAa/PpBABr994EAk//9k=",1),a.testTypeSupport("image/vnd.ms-photo","data:image/vnd.ms-photo;base64,SUm8AQgAAAAFAAG8AQAQAAAASgAAAIC8BAABAAAAAQAAAIG8BAABAAAAAQAAAMC8BAABAAAAWgAAAMG8BAABAAAAHwAAAAAAAAAkw91vA07+S7GFPXd2jckNV01QSE9UTwAZAYBxAAAAABP/gAAEb/8AAQAAAQAAAA==",1),void a.testTypeSupport("video/vnd.mozilla.apng video/x-apng video/png video/apng video/x-mng video/x-png","data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAACGFjVEwAAAABAAAAAcMq2TYAAAANSURBVAiZY2BgYPgPAAEEAQB9ssjfAAAAGmZjVEwAAAAAAAAAAQAAAAEAAAAAAAAAAAD6A+gBAbNU+2sAAAARZmRBVAAAAAEImWNgYGBgAAAABQAB6MzFdgAAAABJRU5ErkJggg==",!1,!0))}),function(){webshim.isReady("picture",!0);var a="picture, img[srcset]";webshim.addReady(function(b){b.querySelector(a)&&window.respimage()})}(); \ No newline at end of file