PageSourceSearch

https://www.thehewittfertilitycentre.org.uk/_frontend/js/shared/polyfills/picturefill.js

js thehewittfertilitycentre.org.uk collected 2026-10-04 13:26:59 UTC 14,578 bytes, 12 lines download raw bytes

vendor: 6,604 bytes, lines 1-12
1/*! picturefill - v3.0.2 - 2016-02-12
2 * https://scottjehl.github.io/picturefill/
3 * Copyright (c) 2016 https://github.com/scottjehl/picturefill/blob/master/Authors.txt; Licensed MIT
4 */ /*! Gecko-Picture - v1.0
5 * https://github.com/scottjehl/picturefill/tree/3.0/src/plugins/gecko-picture
6 * Firefox's early picture implementation (prior to FF41) is static and does
7 * not react to viewport changes. This tiny module fixes this.
8 */ !function (e) { var t, s, r, n, i, c, a, u = navigator.userAgent; e.HTMLPictureElement && /ecko/.test(u) && u.match(/rv\:(\d+)/) && RegExp.$1 < 45 && addEventListener("resize", (s = document.createElement("source"), r = function (e) { var t, r, n = e.parentNode; "PICTURE" === n.nodeName.toUpperCase() ? (t = s.cloneNode(), n.insertBefore(t, n.firstElementChild), setTimeout(function () { n.removeChild(t) })) : (!e._pfLastSize || e.offsetWidth > e._pfLastSize) && (e._pfLastSize = e.offsetWidth, r = e.sizes, e.sizes += ",100vw", setTimeout(function () { e.sizes = r })) }, n = function () { var e, t = document.querySelectorAll("picture > img, img[srcset][sizes]"); for (e = 0; e < t.length; e++)r(t[e]) }, i = function () { clearTimeout(t), t = setTimeout(n, 99) }, c = e.matchMedia && matchMedia("(orientation: landscape)"), a = function () { i(), c && c.addListener && c.addListener(i) }, s.srcset = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", /^[c|i]|d$/.test(document.readyState || "") ? a() : document.addEventListener("DOMContentLoaded", a), i)) }(window),/*! Picturefill - v3.0.2
9 * http://scottjehl.github.io/picturefill
10 * Copyright (c) 2015 https://github.com/scottjehl/picturefill/blob/master/Authors.txt;
11 *  License: MIT
12 */ function (e, t, s) { "use strict"; t.createElement("picture"); var r, n, i, c, a = {}, u = !1, l = function () { }, o = t.createElement("img"), f = o.getAttribute, p = o.setAttribute, A = o.removeAttribute, d = t.documentElement, h = {}, $ = { algorithm: "" }, m = "data-pfsrc", g = m + "set", _ = navigator.userAgent, v = /rident/.test(_) || /ecko/.test(_) && _.match(/rv\:(\d+)/) && RegExp.$1 > 35, w = "currentSrc", S = /\s+\+?\d+(e\d+)?w/, y = /(\([^)]+\))?\s*(.+)/, x = e.picturefillCFG, E = "font-size:100%!important;", z = !0, b = {}, C = {}, R = e.devicePixelRatio, L = { px: 1, in: 96 }, T = t.createElement("a"), P = !1, B = /^[ \t\n\r\u000c]+/, D = /^[, \t\n\r\u000c]+/, U = /^[^ \t\n\r\u000c]+/, k = /[,]+$/, I = /^\d+$/, M = /^-?(?:[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?$/, W = function (e, t, s, r) { e.addEventListener ? e.addEventListener(t, s, r || !1) : e.attachEvent && e.attachEvent("on" + t, s) }, Q = function (e) { var t = {}; return function (s) { return s in t || (t[s] = e(s)), t[s] } }; function G(e) { return " " === e || "	" === e || "\n" === e || "\f" === e || "\r" === e } var H, N, O, q = (H = /^([\d\.]+)(em|vw|px)$/, N = function () { for (var e = arguments, t = 0, s = e[0]; (++t in e);)s = s.replace(e[t], e[++t]); return s }, O = Q(function (e) { return "return " + N((e || "").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\.&=|><\+\-\*\(\)\/])).*/ig, "") + ";" }), function (e, t) { var s; if (!(e in b)) { if (b[e] = !1, t && (s = e.match(H))) b[e] = s[1] * L[s[2]]; else try { b[e] = Function("e", O(e))(L) } catch (r) { } } return b[e] }), j = function (e, t) { return e.w ? (e.cWidth = a.calcListLength(t || "100vw"), e.res = e.w / e.cWidth) : e.res = e.d, e }, F = function (e) { if (u) { var s, r, n, i = e || {}; if (i.elements && 1 === i.elements.nodeType && ("IMG" === i.elements.nodeName.toUpperCase() ? i.elements = [i.elements] : (i.context = i.elements, i.elements = null)), n = (s = i.elements || a.qsa(i.context || t, i.reevaluate || i.reselect ? a.sel : a.selShort)).length) { for (a.setupRun(i), P = !0, r = 0; r < n; r++)a.fillImg(s[r], i); a.teardownRun(i) } } }; function V(e, t, s, r) { var n, i, c, a; return "saveData" === $.algorithm ? e > 2.7 ? a = s + 1 : (c = (i = t - s) * (n = Math.pow(e - .6, 1.5)), r && (c += .1 * n), a = e + c) : a = s > 1 ? Math.sqrt(e * t) : e, a > s } function K(e, t) { return e.res - t.res } function J(e, t) { var s, r, n; if (e && t) { for (s = 0, n = a.parseSet(t), e = a.makeUrl(e); s < n.length; s++)if (e === a.makeUrl(n[s].url)) { r = n[s]; break } } return r } for (r = e.console && console.warn ? function (e) { console.warn(e) } : l, (w in o) || (w = "src"), h["image/jpeg"] = !0, h["image/gif"] = !0, h["image/png"] = !0, h["image/svg+xml"] = t.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#Image", "1.1"), a.ns = ("pf" + new Date().getTime()).substr(0, 9), a.supSrcset = ("srcset" in o), a.supSizes = ("sizes" in o), a.supPicture = !!e.HTMLPictureElement, a.supSrcset && a.supPicture && !a.supSizes && (X = t.createElement("img"), o.srcset = "data:,a", X.src = "data:,a", a.supSrcset = o.complete === X.complete, a.supPicture = a.supSrcset && a.supPicture), a.supSrcset && !a.supSizes ? (Y = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==", Z = t.createElement("img"), ee = function () { 2 === Z.width && (a.supSizes = !0), i = a.supSrcset && !a.supSizes, u = !0, setTimeout(F) }, Z.onload = ee, Z.onerror = ee, Z.setAttribute("sizes", "9px"), Z.srcset = Y + " 1w,data:image/gif;base64,R0lGODlhAgABAPAAAP///wAAACH5BAAAAAAALAAAAAACAAEAAAICBAoAOw== 9w", Z.src = Y) : u = !0, (a.selShort = "picture>img,img[srcset]", a.sel = a.selShort, a.cfg = $, a.DPR = R || 1, a.u = L, a.types = h, a.setSize = l, a.makeUrl = Q(function (e) { return T.href = e, T.href }), a.qsa = function (e, t) { return ("querySelector" in e) ? e.querySelectorAll(t) : [] }, a.matchesMedia = function () { return e.matchMedia && (matchMedia("(min-width: 0.1em)") || {}).matches ? a.matchesMedia = function (e) { return !e || matchMedia(e).matches } : a.matchesMedia = a.mMQ, a.matchesMedia.apply(this, arguments) }, a.mMQ = function (e) { return !e || q(e) }, a.calcLength = function (e) { var t = q(e, !0) || !1; return t < 0 && (t = !1), t }, a.supportsType = function (e) { return !e || h[e] }, a.parseSize = Q(function (e) { var t = (e || "").match(y); return { media: t && t[1], length: t && t[2] } }), a.parseSet = function (e) { return e.cands || (e.cands = function e(t, s) { function r(e) { var s, r = e.exec(t.substring(o)); if (r) return o += (s = r[0]).length, s } var n, i, c, a, u, l = t.length, o = 0, f = []; function p() { var e, t, r, c, a, u, l, o, p, A = !1, d = {}; for (c = 0; c < i.length;
12 c++)u = (a = i[c])[a.length - 1], o = parseInt(l = a.substring(0, a.length - 1), 10), p = parseFloat(l), I.test(l) && "w" === u ? ((e || t) && (A = !0), 0 === o ? A = !0 : e = o) : M.test(l) && "x" === u ? ((e || t || r) && (A = !0), p < 0 ? A = !0 : t = p) : I.test(l) && "h" === u ? ((r || t) && (A = !0), 0 === o ? A = !0 : r = o) : A = !0; A || (d.url = n, e && (d.w = e), t && (d.d = t), r && (d.h = r), r || t || e || (d.d = 1), 1 === d.d && (s.has1x = !0), d.set = s, f.push(d)) } function A() { for (r(B), c = "", a = "in descriptor"; ;) { if (u = t.charAt(o), "in descriptor" === a) { if (G(u)) c && (i.push(c), c = "", a = "after descriptor"); else if ("," === u) { o += 1, c && i.push(c), p(); return } else if ("(" === u) c += u, a = "in parens"; else if ("" === u) { c && i.push(c), p(); return } else c += u } else if ("in parens" === a) { if (")" === u) c += u, a = "in descriptor"; else if ("" === u) { i.push(c), p(); return } else c += u } else if ("after descriptor" === a) { if (G(u)); else if ("" === u) { p(); return } else a = "in descriptor", o -= 1 } o += 1 } } for (; ;) { if (r(D), o >= l) return f; n = r(U), i = [], "," === n.slice(-1) ? (n = n.replace(k, ""), p()) : A() } }(e.srcset, e)), e.cands }, a.getEmValue = function () { var e; if (!n && (e = t.body)) { var s = t.createElement("div"), r = d.style.cssText, i = e.style.cssText; s.style.cssText = "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)", d.style.cssText = E, e.style.cssText = E, e.appendChild(s), n = s.offsetWidth, e.removeChild(s), n = parseFloat(n, 10), d.style.cssText = r, e.style.cssText = i } return n || 16 }, a.calcListLength = function (e) { if (!(e in C) || $.uT) { var t = a.calcLength(function e(t) { var s, r, n, i, c, u, l = /^(?:[+-]?[0-9]+|[0-9]*\.[0-9]+)(?:[eE][+-]?[0-9]+)?(?:ch|cm|em|ex|in|mm|pc|pt|px|rem|vh|vmin|vmax|vw)$/i, o = /^calc\((?:[0-9a-z \.\+\-\*\/\(\)]+)\)$/i; function f(e) { return !!(l.test(e) && parseFloat(e) >= 0 || o.test(e)) || "0" === e || "-0" === e || "+0" === e } for (s = 0, n = (r = function e(t) { var s, r = "", n = [], i = [], c = 0, a = 0, u = !1; function l() { r && (n.push(r), r = "") } function o() { n[0] && (i.push(n), n = []) } for (; ;) { if ("" === (s = t.charAt(a))) return l(), o(), i; if (u) { if ("*" === s && "/" === t[a + 1]) { u = !1, a += 2, l(); continue } a += 1; continue } if (G(s)) { if (t.charAt(a - 1) && G(t.charAt(a - 1)) || !r) { a += 1; continue } if (0 === c) { l(), a += 1; continue } s = " " } else if ("(" === s) c += 1; else if (")" === s) c -= 1; else if ("," === s) { l(), o(), a += 1; continue } else if ("/" === s && "*" === t.charAt(a + 1)) { u = !0, a += 2; continue } r += s, a += 1 } }(t)).length; s < n; s++) { if (f(c = (i = r[s])[i.length - 1])) { if (u = c, i.pop(), 0 === i.length || (i = i.join(" "), a.matchesMedia(i))) return u } } return "100vw" }(e)); C[e] = t || L.width } return C[e] }, a.setRes = function (e) { var t; if (e) { t = a.parseSet(e); for (var s = 0, r = t.length; s < r; s++)j(t[s], e.sizes) } return t }, a.setRes.res = j, a.applySetCandidate = function (e, t) { if (e.length) { var s, r, n, i, c, u, l, o, f, p, A, d, h, $ = t[a.ns], m = a.DPR; if (u = $.curSrc || t[w], (l = $.curCan || (p = t, A = u, !(d = e[0].set) && A && (d = (d = p[a.ns].sets) && d[d.length - 1]), (h = J(A, d)) && (A = a.makeUrl(A), p[a.ns].curSrc = A, p[a.ns].curCan = h, h.res || j(h, h.set.sizes)), h)) && l.set === e[0].set && !(f = v && !t.complete && l.res - .1 > m) && (l.cached = !0, l.res >= m && (c = l)), !c) { for (e.sort(K), c = e[(i = e.length) - 1], r = 0; r < i; r++)if ((s = e[r]).res >= m) { c = e[n = r - 1] && (f || u !== a.makeUrl(s.url)) && V(e[n].res, s.res, m, e[n].cached) ? e[n] : s; break } } c && (o = a.makeUrl(c.url), $.curSrc = o, $.curCan = c, o !== u && a.setSrc(t, c), a.setSize(t)) } }, a.setSrc = function (e, t) { var s; e.src = t.url, "image/svg+xml" === t.set.type && (s = e.style.width, e.style.width = e.offsetWidth + 1 + "px", e.offsetWidth + 1 && (e.style.width = s)) }, a.getSet = function (e) { var t, s, r, n = !1, i = e[a.ns].sets; for (t = 0; t < i.length && !n; t++)if ((s = i[t]).srcset && a.matchesMedia(s.media) && (r = a.supportsType(s.type))) { "pending" === r && (s = r), n = s; break } return n }, a.parseSets = function (e, t, r) { var n, c, u, l, o = t && "PICTURE" === t.nodeName.toUpperCase(), d = e[a.ns]; (s === d.src || r.src) && (d.src = f.call(e, "src"), d.src ? p.call(e, m, d.src) : A.call(e, m)), (s === d.srcset || r.srcset || !a.supSrcset || e.srcset) && (n = f.call(e, "srcset"), d.srcset = n, l = !0), d.sets = [], o && (d.pic = !0, function e(t, s) { var r, n, i, c, u = t.getElementsByTagName("source"); for (r = 0, n = u.length; r < n; r++)(i = u[r])[a.ns] = !0, (c = i.getAttribute("srcset")) && s.push({ srcset: c, media: i.getAttribute("media"), type: i.getAttribute("type"), sizes: i.getAttribute("sizes") }) }(t, d.sets)), d.srcset ? (c = { srcset: d.srcset, sizes: f.call(e, "sizes") }, d.sets.push(c), (u = (i || d.src) && S.test(d.srcset || "")) || !d.src || J(d.src, c) || c.has1x || (c.srcset += ", " + d.src, c.cands.push({ url: d.src, d: 1, set: c }))) : d.src && d.sets.push({ srcset: d.src, sizes: null }), d.curCan = null, d.curSrc = s, d.supported = !(o || c && !a.supSrcset || u && !a.supSizes), l && a.supSrcset && !d.supported && (n ? (p.call(e, g, n), e.srcset = "") : A.call(e, g)), d.supported && !d.srcset && (!d.src && e.src || e.src !== a.makeUrl(d.src)) && (null === d.src ? e.removeAttribute("src") : e.src = d.src), d.parsed = !0 }, a.fillImg = function (e, t) { var s, r, n, i, u, l = t.reselect || t.reevaluate; e[a.ns] || (e[a.ns] = {}), u = e[a.ns], (l || u.evaled !== c) && (((!u.parsed || t.reevaluate) && a.parseSets(e, e.parentNode, t), u.supported) ? u.evaled = c : (s = e, n = a.getSet(s), i = !1, "pending" !== n && (i = c, n && (r = a.setRes(n), a.applySetCandidate(r, s))), s[a.ns].evaled = i)) }, a.setupRun = function () { (!P || z || R !== e.devicePixelRatio) && (z = !1, R = e.devicePixelRatio, b = {}, C = {}, a.DPR = R || 1, L.width = Math.max(e.innerWidth || 0, d.clientWidth), L.height = Math.max(e.innerHe
12ight || 0, d.clientHeight), L.vw = L.width / 100, L.vh = L.height / 100, c = [L.height, L.width, R].join("-"), L.em = a.getEmValue(), L.rem = L.em) }, a.supPicture) ? (F = l, a.fillImg = l) : (es = e.attachEvent ? /d$|^c/ : /d$|^c|^i/, er = function () { var e = t.readyState || ""; en = setTimeout(er, "loading" === e ? 200 : 999), t.body && (a.fillImgs(), (et = et || es.test(e)) && clearTimeout(en)) }, en = setTimeout(er, t.body ? 9 : 99), ei = d.clientHeight, ec = function () { z = Math.max(e.innerWidth || 0, d.clientWidth) !== L.width || d.clientHeight !== ei, ei = d.clientHeight, z && a.fillImgs() }, eu = 99, W(e, "resize", (ea = ec, ef = function () { var e = new Date - eo; e < eu ? el = setTimeout(ef, eu - e) : (el = null, ea()) }, function () { eo = new Date, el || (el = setTimeout(ef, eu)) })), W(t, "readystatechange", er)), a.picturefill = F, a.fillImgs = F, a.teardownRun = l, F._ = a, e.picturefillCFG = { pf: a, push: function (e) { var t = e.shift(); "function" == typeof a[t] ? a[t].apply(a, e) : ($[t] = e[0], P && a.fillImgs({ reselect: !0 })) } }; x && x.length;)e.picturefillCFG.push(x.shift()); if (e.picturefill = F, "object" == typeof module && "object" == typeof module.exports ? module.exports = F : "function" == typeof define && define.amd && define("picturefill", function () { return F }), !a.supPicture) { var X, Y, Z, ee, et, es, er, en, ei, ec, ea, eu, el, eo, ef, ep, eA = "image/webp"; h["image/webp"] = ((ep = new e.Image).onerror = function () { h[eA] = !1, F() }, ep.onload = function () { h[eA] = 1 === ep.width, F() }, ep.src = "data:image/webp;base64,UklGRkoAAABXRUJQVlA4WAoAAAAQAAAAAAAAAAAAQUxQSAwAAAABBxAR/Q9ERP8DAABWUDggGAAAADABAJ0BKgEAAQADADQlpAADcAD++/1QAA==", "pending") } }(window, document);

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.