Last active
April 24, 2018 10:41
-
-
Save dieulot/9760786 to your computer and use it in GitHub Desktop.
Apple’s parallax scripts on CarPlay’s page
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AC = window.AC || {}; | |
AC.namespace = function (a) { | |
var c; | |
if (!(a && a.match && a.match(/\S/))) { | |
throw "Attempt to create AC.namespace with no name." | |
} | |
var d = a.split(/\./); | |
var b = window; | |
for (c = 0; c < d.length; c++) { | |
b[d[c]] = b[d[c]] || {}; | |
b = b[d[c]] | |
} | |
}; | |
if (!Function.prototype.bind) { | |
Function.prototype.bind = function (g) { | |
if (typeof this !== "function") { | |
throw new TypeError("Function.prototype.bind - what is trying to be bound is not callable") | |
} | |
var h = Array.prototype.slice.call(arguments, 1); | |
var i = this; | |
var f = function () {}; | |
var j = function () { | |
return i.apply((this instanceof f && g) ? this : g, h.concat(Array.prototype.slice.call(arguments))) | |
}; | |
f.prototype = this.prototype; | |
j.prototype = new f(); | |
return j | |
} | |
} | |
if (!Array.isArray) { | |
Array.isArray = function isArray(b) { | |
return (b && typeof b === "object" && "splice" in b && "join" in b) | |
} | |
} | |
if (!Array.prototype.every) { | |
Array.prototype.every = function every(h, i) { | |
var j = Object(this); | |
var g = j.length >>> 0; | |
var f; | |
if (typeof h !== "function") { | |
throw new TypeError(h + " is not a function") | |
} | |
for (f = 0; f < g; f += 1) { | |
if (f in j && !h.call(i, j[f], f, j)) { | |
return false | |
} | |
} | |
return true | |
} | |
} | |
if (!Array.prototype.filter) { | |
Array.prototype.filter = function filter(i, j) { | |
var k = Object(this); | |
var h = k.length >>> 0; | |
var l; | |
var g = []; | |
if (typeof i !== "function") { | |
throw new TypeError(i + " is not a function") | |
} | |
for (l = 0; l < h; l += 1) { | |
if (l in k && i.call(j, k[l], l, k)) { | |
g.push(k[l]) | |
} | |
} | |
return g | |
} | |
} | |
if (!Array.prototype.forEach) { | |
Array.prototype.forEach = function forEach(h, i) { | |
var j = Object(this); | |
var g; | |
var f; | |
if (typeof h !== "function") { | |
throw new TypeError("No function object passed to forEach.") | |
} | |
for (g = 0; g < this.length; g += 1) { | |
f = j[g]; | |
h.call(i, f, g, j) | |
} | |
} | |
} | |
if (!Array.prototype.indexOf) { | |
Array.prototype.indexOf = function indexOf(e, h) { | |
var g = h || 0; | |
var f = 0; | |
if (g < 0) { | |
g = this.length + h - 1; | |
if (g < 0) { | |
throw "Wrapped past beginning of array while looking up a negative start index." | |
} | |
} | |
for (f = 0; f < this.length; f++) { | |
if (this[f] === e) { | |
return f | |
} | |
} | |
return (-1) | |
} | |
} | |
if (!Array.prototype.lastIndexOf) { | |
Array.prototype.lastIndexOf = function lastIndexOf(h, i) { | |
var f = Object(this); | |
var g = f.length >>> 0; | |
var j; | |
i = parseInt(i, 10); | |
if (g <= 0) { | |
return -1 | |
} | |
j = (typeof i === "number") ? Math.min(g - 1, i) : g - 1; | |
j = j >= 0 ? j : g - Math.abs(j); | |
for (; j >= 0; j -= 1) { | |
if (j in f && h === f[j]) { | |
return j | |
} | |
} | |
return -1 | |
} | |
} | |
if (!Array.prototype.map) { | |
Array.prototype.map = function map(i, j) { | |
var l = Object(this); | |
var g = l.length >>> 0; | |
var k; | |
var h = new Array(g); | |
if (typeof i !== "function") { | |
throw new TypeError(i + " is not a function") | |
} | |
for (k = 0; k < g; k += 1) { | |
if (k in l) { | |
h[k] = i.call(j, l[k], k, l) | |
} | |
} | |
return h | |
} | |
} | |
if (!Array.prototype.reduce) { | |
Array.prototype.reduce = function reduce(i, l) { | |
var k = Object(this); | |
var g = k.length >>> 0; | |
var j = 0; | |
var h; | |
if (typeof i !== "function") { | |
throw new TypeError(i + " is not a function") | |
} | |
if (typeof l === "undefined") { | |
if (!g) { | |
throw new TypeError("Reduce of empty array with no initial value") | |
} | |
h = k[0]; | |
j = 1 | |
} else { | |
h = l | |
} | |
while (j < g) { | |
if (j in k) { | |
h = i.call(undefined, h, k[j], j, k); | |
j += 1 | |
} | |
} | |
return h | |
} | |
} | |
if (!Array.prototype.reduceRight) { | |
Array.prototype.reduceRight = function reduceRight(i, l) { | |
var k = Object(this); | |
var g = k.length >>> 0; | |
var j = g - 1; | |
var h; | |
if (typeof i !== "function") { | |
throw new TypeError(i + " is not a function") | |
} | |
if (l === undefined) { | |
if (!g) { | |
throw new TypeError("Reduce of empty array with no initial value") | |
} | |
h = k[g - 1]; | |
j = g - 2 | |
} else { | |
h = l | |
} | |
while (j >= 0) { | |
if (j in k) { | |
h = i.call(undefined, h, k[j], j, k); | |
j -= 1 | |
} | |
} | |
return h | |
} | |
} | |
if (!Array.prototype.some) { | |
Array.prototype.some = function some(h, i) { | |
var f = Object(this); | |
var g = f.length >>> 0; | |
var j; | |
if (typeof h !== "function") { | |
throw new TypeError(h + " is not a function") | |
} | |
for (j = 0; j < g; j += 1) { | |
if (j in f && h.call(i, f[j], j, f) === true) { | |
return true | |
} | |
} | |
return false | |
} | |
} | |
if (!Date.now) { | |
Date.now = function now() { | |
return new Date().getTime() | |
} | |
} | |
if (!Date.prototype.toISOString) { | |
Date.prototype.toISOString = function toISOString() { | |
if (!isFinite(this)) { | |
throw new RangeError("Date.prototype.toISOString called on non-finite value.") | |
} | |
var d = { | |
year: this.getUTCFullYear(), | |
month: this.getUTCMonth() + 1, | |
day: this.getUTCDate(), | |
hours: this.getUTCHours(), | |
minutes: this.getUTCMinutes(), | |
seconds: this.getUTCSeconds(), | |
mseconds: (this.getUTCMilliseconds() / 1000).toFixed(3).substr(2, 3) | |
}; | |
var f; | |
var e; | |
for (f in d) { | |
if (d.hasOwnProperty(f) && f !== "year" && f !== "mseconds") { | |
d[f] = String(d[f]).length === 1 ? "0" + String(d[f]) : String(d[f]) | |
} | |
} | |
if (d.year < 0 || d.year > 9999) { | |
e = d.year < 0 ? "-" : "+"; | |
d.year = e + String(Math.abs(d.year / 1000000)).substr(2, 6) | |
} | |
return d.year + "-" + d.month + "-" + d.day + "T" + d.hours + ":" + d.minutes + ":" + d.seconds + "." + d.mseconds + "Z" | |
} | |
} | |
if (!Date.prototype.toJSON) { | |
Date.prototype.toJSON = function (i) { | |
var h = Object(this); | |
var g; | |
var j = function (c) { | |
var a = typeof c; | |
var b = [null, "undefined", "boolean", "string", "number"].some(function (d) { | |
return d === a | |
}); | |
if (b) { | |
return true | |
} | |
return false | |
}; | |
var f = function (b) { | |
var a; | |
if (j(b)) { | |
return b | |
} | |
a = (typeof b.valueOf === "function") ? b.valueOf() : (typeof b.toString === "function") ? b.toString() : null; | |
if (a && j(a)) { | |
return a | |
} | |
throw new TypeError(b + " cannot be converted to a primitive") | |
}; | |
g = f(h); | |
if (typeof g === "number" && !isFinite(g)) { | |
return null | |
} | |
if (typeof h.toISOString !== "function") { | |
throw new TypeError("toISOString is not callable") | |
} | |
return h.toISOString.call(h) | |
} | |
} | |
if (!String.prototype.trim) { | |
String.prototype.trim = function trim() { | |
return this.replace(/^\s+|\s+$/g, "") | |
} | |
} | |
if (!Object.keys) { | |
Object.keys = function keys(d) { | |
var e = []; | |
var f; | |
if ((!d) || (typeof d.hasOwnProperty !== "function")) { | |
throw "Object.keys called on non-object." | |
} | |
for (f in d) { | |
if (d.hasOwnProperty(f)) { | |
e.push(f) | |
} | |
} | |
return e | |
} | |
}(function (k, j) { | |
function l(a) { | |
return a.map(function (b) { | |
return g(b) | |
}) | |
} | |
var h, g, i; | |
g = function (b, a) { | |
var c; | |
return "string" == typeof b ? c = h[b] : "function" == typeof a && Array.isArray(b) ? a.apply(j, l(b)) : void 0 | |
}, g.version = "1.0.3", g.config = function () {}, i = function (c, a, b) { | |
h[c] || (b || (b = a), h[c] = "function" == typeof b && Array.isArray(a) ? b.apply(b, l(a)) : "function" == typeof b ? b() : b) | |
}, i.amd = {}, g._init = function () { | |
h = {}, i("require", [], function () { | |
return g | |
}) | |
}, g.getRegisteredModules = function () { | |
return Object.getOwnPropertyNames(h).sort() | |
}, g._init(), k.require = k.require || g, k.define = k.define || i | |
})(this.AC || this, this); | |
(function () { | |
var b = ["abbr", "article", "aside", "command", "details", "figcaption", "figure", "footer", "header", "hgroup", "mark", "meter", "nav", "output", "progress", "section", "summary", "time"]; | |
b.forEach(function (a) { | |
document.createElement(a) | |
}) | |
})(); | |
/*! | |
* Sizzle CSS Selector Engine | |
* Copyright 2012, The Dojo Foundation | |
* Released under the MIT, BSD, and GPL Licenses. | |
* More information: http://sizzlejs.com/ | |
*/ | |
/*! | |
* contentloaded.js | |
* | |
* Author: Diego Perini (diego.perini at gmail.com) | |
* Summary: cross-browser wrapper for DOMContentLoaded | |
* Updated: 20101020 | |
* License: MIT | |
* Version: 1.2 | |
* | |
* URL: | |
* http://javascript.nwbox.com/ContentLoaded/ | |
* http://javascript.nwbox.com/ContentLoaded/MIT-LICENSE | |
* | |
*/ | |
AC.define("base/Regexp", [], function () { | |
var b = {}; | |
return b.RegExp = {}, b.RegExp.isRegExp = function (a) { | |
return "RegExp" === a.constructor.name | |
}, b.RegExp | |
}), AC.define("base/Environment_Browser", ["require", "base/Regexp"], function (d) { | |
var c = {}; | |
return c.RegExp = d("base/Regexp"), c.Environment = {}, c.Environment.Browser = {}, | |
function (k) { | |
var b, a, l, m, n, j; | |
return b = [{ | |
string: window.navigator.userAgent, | |
subString: "Chrome", | |
identity: "Chrome" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "OmniWeb", | |
versionSearch: "OmniWeb/", | |
identity: "OmniWeb" | |
}, { | |
string: window.navigator.userAgent, | |
subString: /mobile\/[^\s]*\ssafari\//i, | |
identity: "Safari Mobile", | |
versionSearch: "Version" | |
}, { | |
string: window.navigator.vendor, | |
subString: "Apple", | |
identity: "Safari", | |
versionSearch: "Version" | |
}, { | |
prop: window.opera, | |
identity: "Opera", | |
versionSearch: "Version" | |
}, { | |
string: window.navigator.vendor, | |
subString: "iCab", | |
identity: "iCab" | |
}, { | |
string: window.navigator.vendor, | |
subString: "KDE", | |
identity: "Konqueror" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "Firefox", | |
identity: "Firefox" | |
}, { | |
string: window.navigator.vendor, | |
subString: "Camino", | |
identity: "Camino" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "Netscape", | |
identity: "Netscape" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "MSIE", | |
identity: "IE", | |
versionSearch: "MSIE" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "Gecko", | |
identity: "Mozilla", | |
versionSearch: "rv" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "Mozilla", | |
identity: "Netscape", | |
versionSearch: "Mozilla" | |
}], a = [{ | |
string: window.navigator.platform, | |
subString: "Win", | |
identity: "Windows", | |
versionSearch: "Windows NT" | |
}, { | |
string: window.navigator.platform, | |
subString: "Mac", | |
identity: "OS X" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "iPhone", | |
identity: "iOS", | |
versionSearch: "iPhone OS" | |
}, { | |
string: window.navigator.userAgent, | |
subString: "iPad", | |
identity: "iOS", | |
versionSearch: "CPU OS" | |
}, { | |
string: window.navigator.userAgent, | |
subString: /android/i, | |
identity: "Android" | |
}, { | |
string: window.navigator.platform, | |
subString: "Linux", | |
identity: "Linux" | |
}], l = function (e) { | |
var g, f, h; | |
for (h = 0; h < e.length; h += 1) { | |
if (g = e[h].string, f = e[h].prop, j = e[h].versionSearch || e[h].identity, g) { | |
if (c.RegExp.isRegExp(e[h].subString) && g.match(e[h].subString)) { | |
return e[h].identity | |
} | |
if (-1 !== g.indexOf(e[h].subString)) { | |
return e[h].identity | |
} | |
} else { | |
if (f) { | |
return e[h].identity | |
} | |
} | |
} | |
}, m = function (e) { | |
var f = e.indexOf(j); | |
if (-1 !== f) { | |
return parseFloat(e.substring(f + j.length + 1)) | |
} | |
}, n = function (f) { | |
var e = new RegExp(j + " ([\\d_\\.]+)", "i"), | |
g = f.match(e); | |
return null !== g ? g[1].replace(/_/g, ".") : void 0 | |
}, k.name = l(b) || void 0, k.version = m(window.navigator.userAgent) || m(window.navigator.appVersion) || void 0, k.os = l(a) || void 0, k.osVersion = n(window.navigator.userAgent) || n(window.navigator.appVersion) || void 0, k.lowerCaseUserAgent = navigator.userAgent.toLowerCase(), k | |
}(c.Environment.Browser), c.Environment.Browser.isWebKit = function () { | |
return !!this.lowerCaseUserAgent.match(/applewebkit/) | |
}, c.Environment.Browser | |
}), AC.define("base/Environment_Feature", [], function () { | |
var b = {}; | |
return b.Environment = {}, b.Environment.Feature = {}, | |
function () { | |
var g = null, | |
f = null, | |
a = null, | |
h = null; | |
b.Environment.Feature.isCSSAvailable = function (c) { | |
return b.log("AC.Environment.Feature.isCSSAvailable is deprecated. Please use AC.Environment.Feature.cssPropertyAvailable instead."), this.cssPropertyAvailable(c) | |
}, b.Environment.Feature.cssPropertyAvailable = function (c) { | |
switch (null === g && (g = document.createElement("browserdetect").style), null === f && (f = ["-webkit-", "-moz-", "-o-", "-ms-", "-khtml-", ""]), null === a && (a = ["Webkit", "Moz", "O", "ms", "Khtml", ""]), null === h && (h = {}), c = c.replace(/([A-Z]+)([A-Z][a-z])/g, "$1\\-$2").replace(/([a-z\d])([A-Z])/g, "$1\\-$2").replace(/^(\-*webkit|\-*moz|\-*o|\-*ms|\-*khtml)\-/, "").toLowerCase()) { | |
case "gradient": | |
if (void 0 !== h.gradient) { | |
return h.gradient | |
} | |
c = "background-image:"; | |
var e = "gradient(linear,left top,right bottom,from(#9f9),to(white));", | |
i = "linear-gradient(left top,#9f9, white);"; | |
return g.cssText = (c + f.join(e + c) + f.join(i + c)).slice(0, -c.length), h.gradient = -1 !== g.backgroundImage.indexOf("gradient"), h.gradient; | |
case "inset-box-shadow": | |
if (void 0 !== h["inset-box-shadow"]) { | |
return h["inset-box-shadow"] | |
} | |
c = "box-shadow:"; | |
var d = "#fff 0 1px 1px inset;"; | |
return g.cssText = f.join(c + d), h["inset-box-shadow"] = -1 !== g.cssText.indexOf("inset"), h["inset-box-shadow"]; | |
default: | |
var q, r, s, j = c.split("-"), | |
t = j.length; | |
if (j.length > 0) { | |
for (c = j[0], r = 1; t > r; r += 1) { | |
c += j[r].substr(0, 1).toUpperCase() + j[r].substr(1) | |
} | |
} | |
if (q = c.substr(0, 1).toUpperCase() + c.substr(1), void 0 !== h[c]) { | |
return h[c] | |
} | |
for (s = a.length - 1; s >= 0; s -= 1) { | |
if (void 0 !== g[a[s] + c] || void 0 !== g[a[s] + q]) { | |
return h[c] = !0, !0 | |
} | |
} | |
return !1 | |
} | |
} | |
}(), b.Environment.Feature.supportsThreeD = function () { | |
return b.log("AC.Environment.Feature.supportsThreeD is deprecated. Please use AC.Environment.Feature.threeDTransformsAvailable instead."), this.threeDTransformsAvailable() | |
}, b.Environment.Feature.threeDTransformsAvailable = function () { | |
if ("undefined" != typeof this._threeDTransformsAvailable) { | |
return this._threeDTransformsAvailable | |
} | |
var e; | |
try { | |
if (this._threeDTransformsAvailable = !1, window.hasOwnProperty("styleMedia") ? this._threeDTransformsAvailable = window.styleMedia.matchMedium("(-webkit-transform-3d)") : window.hasOwnProperty("media") && (this._threeDTransformsAvailable = window.media.matchMedium("(-webkit-transform-3d)")), !this._threeDTransformsAvailable) { | |
if (!document.getElementById("supportsThreeDStyle")) { | |
var a = document.createElement("style"); | |
a.id = "supportsThreeDStyle", a.textContent = "@media (transform-3d),(-o-transform-3d),(-moz-transform-3d),(-ms-transform-3d),(-webkit-transform-3d) { #supportsThreeD { height:3px } }", document.querySelector("head").appendChild(a) | |
}(e = document.querySelector("#supportsThreeD")) || (e = document.createElement("div"), e.id = "supportsThreeD", document.body.appendChild(e)), this._threeDTransformsAvailable = 3 === e.offsetHeight | |
} | |
return this._threeDTransformsAvailable | |
} catch (f) { | |
return !1 | |
} | |
}, b.Environment.Feature.supportsCanvas = function () { | |
return b.log("AC.Environment.Feature.supportsCanvas is deprecated. Please use AC.Environment.Feature.canvasAvailable instead."), this.canvasAvailable() | |
}, b.Environment.Feature.canvasAvailable = function () { | |
if ("undefined" != typeof this._canvasAvailable) { | |
return this._canvasAvailable | |
} | |
var a = document.createElement("canvas"); | |
return this._canvasAvailable = !("function" != typeof a.getContext || !a.getContext("2d")), this._canvasAvailable | |
}, b.Environment.Feature.localStorageAvailable = function () { | |
if ("undefined" != typeof this._localStorageAvailable) { | |
return this._localStorageAvailable | |
} | |
try { | |
"undefined" != typeof window.localStorage && "function" == typeof window.localStorage.setItem ? (window.localStorage.setItem("ac_environment_feature", "test"), this._localStorageAvailable = !0, window.localStorage.removeItem("ac_environment_feature", "test")) : this._localStorageAvailable = !1 | |
} catch (a) { | |
this._localStorageAvailable = !1 | |
} | |
return this._localStorageAvailable | |
}, b.Environment.Feature.sessionStorageAvailable = function () { | |
if ("undefined" != typeof this._sessionStorageAvailable) { | |
return this._sessionStorageAvailable | |
} | |
try { | |
"undefined" != typeof window.sessionStorage && "function" == typeof window.sessionStorage.setItem ? (window.sessionStorage.setItem("ac_browser_detect", "test"), this._sessionStorageAvailable = !0, window.sessionStorage.removeItem("ac_browser_detect", "test")) : this._sessionStorageAvailable = !1 | |
} catch (a) { | |
this._sessionStorageAvailable = !1 | |
} | |
return this._sessionStorageAvailable | |
}, b.Environment.Feature.cookiesAvailable = function () { | |
return "undefined" != typeof this._cookiesAvailable ? this._cookiesAvailable : (this._cookiesAvailable = document.hasOwnProperty("cookie") && navigator.cookieEnabled ? !0 : !1, this._cookiesAvailable) | |
}, b.Environment.Feature.__normalizedScreenWidth = function () { | |
return "undefined" == typeof window.orientation ? window.screen.width : window.screen.width < window.screen.height ? window.screen.width : window.screen.height | |
}, b.Environment.Feature.touchAvailable = function () { | |
return "undefined" != typeof window.ontouchstart | |
}, b.Environment.Feature.isDesktop = function () { | |
return this.touchAvailable() || window.orientation ? !1 : !0 | |
}, b.Environment.Feature.isHandheld = function () { | |
return !this.isDesktop() && !this.isTablet() | |
}, b.Environment.Feature.isTablet = function () { | |
return !this.isDesktop() && this.__normalizedScreenWidth() > 480 | |
}, b.Environment.Feature.isRetina = function () { | |
var d, a = ["min-device-pixel-ratio:1.5", "-webkit-min-device-pixel-ratio:1.5", "min-resolution:1.5dppx", "min-resolution:144dpi", "min--moz-device-pixel-ratio:1.5"]; | |
if (void 0 !== window.devicePixelRatio) { | |
if (window.devicePixelRatio >= 1.5) { | |
return !0 | |
} | |
} else { | |
for (d = 0; d < a.length; d += 1) { | |
if (window.matchMedia("(" + a[d] + ")").matches === !0) { | |
return !0 | |
} | |
} | |
} | |
return !1 | |
}, b.Environment.Feature | |
}), AC.define("base/shims/ie/Environment", [], function () { | |
return function (d) { | |
d.Browser.IE = {}; | |
var c = function () { | |
var i, b, h = document.compatible, | |
a = h ? void 0 : 7, | |
j = []; | |
if (h && (i = h.length, 0 === i && (a = parseInt(document.documentMode, 10)), i > 0)) { | |
for (b = 0; i > b; b += 1) { | |
j.push(parseInt(h[b].version.match(/\d{1,2}/), 10)) | |
} | |
j = j.sort(function (e, f) { | |
return e - f | |
}), a = j.pop() | |
} | |
return a | |
}; | |
d.Browser.IE.documentMode = c() | |
} | |
}), AC.define("base/Environment", ["require", "base/Environment_Browser", "base/Environment_Feature", "base/shims/ie/Environment"], function (d) { | |
var c = { | |
Browser: d("base/Environment_Browser"), | |
Feature: d("base/Environment_Feature") | |
}; | |
return "IE" === c.Browser.name && d("base/shims/ie/Environment")(c), c | |
}), AC.define("base/shims/ie/Array", ["require", "base/Environment"], function (d) { | |
var c = {}; | |
return c.Environment = d("base/Environment"), | |
function (a) { | |
c.Environment.Browser.IE && c.Environment.Browser.IE.documentMode <= 8 && (a.toArray = function (i) { | |
var h, b = [], | |
j = i.length; | |
if (j > 0) { | |
for (h = 0; j > h; h += 1) { | |
b.push(i[h]) | |
} | |
} | |
return b | |
}) | |
} | |
}), AC.define("base/Array", ["require", "base/Environment", "base/shims/ie/Array"], function (d) { | |
var c = {}; | |
return c.Array = {}, c.Environment = d("base/Environment"), c.Array.toArray = function (a) { | |
return Array.prototype.slice.call(a) | |
}, c.Array.flatten = function (a) { | |
var f = [], | |
b = function (e) { | |
Array.isArray(e) ? e.forEach(b) : f.push(e) | |
}; | |
return a.forEach(b), f | |
}, c.Array.without = function (j, a) { | |
var h, i = j.indexOf(a), | |
b = j.length; | |
return i >= 0 ? (i === b - 1 ? h = j.slice(0, b - 1) : 0 === i ? h = j.slice(1) : (h = j.slice(0, i), h = h.concat(j.slice(i + 1))), h) : j | |
}, "IE" === c.Environment.Browser.name && d("base/shims/ie/Array")(c.Array), c.Array | |
}), | |
function (a1, bb) { | |
function a2(d, g, a, c) { | |
for (var b = 0, f = g.length; f > b; b++) { | |
e(d, g[b], a, c) | |
} | |
} | |
function at(g, c, h, f, d, i) { | |
var b, a = aw.setFilters[c.toLowerCase()]; | |
return a || e.error(c), (g || !(b = d)) && a2(g || "*", f, b = [], d), b.length > 0 ? a(b, h, i) : [] | |
} | |
function a0(a, s, c, p, l) { | |
for (var i, r, k, h, d, j, b, m, q = 0, o = l.length, n = ay.POS, g = new RegExp("^" + n.source + "(?!" + aI + ")", "i"), f = function () { | |
for (var u = 1, t = arguments.length - 2; t > u; u++) { | |
arguments[u] === bb && (i[u] = bb) | |
} | |
}; o > q; q++) { | |
for (n.exec(""), a = l[q], h = [], k = 0, d = p; i = n.exec(a);) { | |
m = n.lastIndex = i.index + i[0].length, m > k && (b = a.slice(k, i.index), k = m, j = [s], ax.test(b) && (d && (j = d), d = p), (r = aL.test(b)) && (b = b.slice(0, -5).replace(ax, "$&*")), i.length > 1 && i[0].replace(g, f), d = at(b, i[1], i[2], j, d, r)) | |
} | |
d ? (h = h.concat(d), (b = a.slice(k)) && ")" !== b ? a2(b, h, c, p) : aW.apply(c, h)) : e(a, s, c, p) | |
} | |
return 1 === o ? c : e.uniqueSort(c) | |
} | |
function bp(c, i, o) { | |
for (var l, n, k, f = [], b = 0, a = au.exec(c), j = !a.pop() && !a.pop(), h = j && c.match(aR) || [""], m = aw.preFilter, g = aw.filter, d = !o && i !== bl; null != (n = h[b]) && j; b++) { | |
for (f.push(l = []), d && (n = " " + n); n;) { | |
j = !1, (a = ax.exec(n)) && (n = n.slice(a[0].length), j = l.push({ | |
part: a.pop().replace(aS, " "), | |
captures: a | |
})); | |
for (k in g) { | |
!(a = ay[k].exec(n)) || m[k] && !(a = m[k](a, i, o)) || (n = n.slice(a.shift().length), j = l.push({ | |
part: k, | |
captures: a | |
})) | |
} | |
if (!j) { | |
break | |
} | |
} | |
} | |
return j || e.error(c), f | |
} | |
function aK(a, b, c) { | |
var f = b.dir, | |
d = bd++; | |
return a || (a = function (g) { | |
return g === c | |
}), b.first ? function (g, h) { | |
for (; g = g[f];) { | |
if (1 === g.nodeType) { | |
return a(g, h) && g | |
} | |
} | |
} : function (i, j) { | |
for (var k, h = d + "." + a4, g = h + "." + aU; i = i[f];) { | |
if (1 === i.nodeType) { | |
if ((k = i[aN]) === g) { | |
return !1 | |
} | |
if ("string" == typeof k && 0 === k.indexOf(h)) { | |
if (i.sizset) { | |
return i | |
} | |
} else { | |
if (i[aN] = g, a(i, j)) { | |
return i.sizset = !0, i | |
} | |
i.sizset = !1 | |
} | |
} | |
} | |
} | |
} | |
function aO(b, a) { | |
return b ? function (c, d) { | |
var f = a(c, d); | |
return f && b(f === !0 ? c : f, d) | |
} : a | |
} | |
function aG(g, b, f) { | |
for (var c, a, d = 0; c = g[d]; d++) { | |
aw.relative[c.part] ? a = aK(a, aw.relative[c.part], b) : (c.captures.push(b, f), a = aO(a, aw.filter[c.part].apply(null, c.captures))) | |
} | |
return a | |
} | |
function bm(a) { | |
return function (c, d) { | |
for (var b, f = 0; b = a[f]; f++) { | |
if (b(c, d)) { | |
return !0 | |
} | |
} | |
return !1 | |
} | |
} | |
var aU, a4, bc, bq, bj, bl = a1.document, | |
bi = bl.documentElement, | |
aM = "undefined", | |
bh = !1, | |
bk = !0, | |
bd = 0, | |
a8 = [].slice, | |
aW = [].push, | |
aN = ("sizcache" + Math.random()).replace(".", ""), | |
aI = "[\\x20\\t\\r\\n\\f]", | |
a9 = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])", | |
ba = "(?:[\\w#_-]|[^\\x00-\\xa0]|\\\\.)", | |
aE = "([*^$|!~]?=)", | |
ap = "\\[" + aI + "*(" + a9 + "+)" + aI + "*(?:" + aE + aI + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + ba + "+)|)|)" + aI + "*\\]", | |
aB = ":(" + a9 + "+)(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|(.*))\\)|)", | |
aC = ":(nth|eq|gt|lt|first|last|even|odd)(?:\\((\\d*)\\)|)(?=[^-]|$)", | |
be = aI + "*([\\x20\\t\\r\\n\\f>+~])" + aI + "*", | |
bf = "(?=[^\\x20\\t\\r\\n\\f])(?:\\\\.|" + ap + "|" + aB.replace(2, 7) + "|[^\\\\(),])+", | |
aS = new RegExp("^" + aI + "+|((?:^|[^\\\\])(?:\\\\.)*)" + aI + "+$", "g"), | |
ax = new RegExp("^" + be), | |
aR = new RegExp(bf + "?(?=" + aI + "*,|$)", "g"), | |
au = new RegExp("^(?:(?!,)(?:(?:^|,)" + aI + "*" + bf + ")*?|" + aI + "*(.*?))(\\)|$)"), | |
aH = new RegExp(bf.slice(19, -6) + "\\x20\\t\\r\\n\\f>+~])+|" + be, "g"), | |
aq = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/, | |
a3 = /[\x20\t\r\n\f]*[+~]/, | |
aL = /:not\($/, | |
aZ = /h\d/i, | |
ar = /input|select|textarea|button/i, | |
aT = /\\(?!\\)/g, | |
ay = { | |
ID: new RegExp("^#(" + a9 + "+)"), | |
CLASS: new RegExp("^\\.(" + a9 + "+)"), | |
NAME: new RegExp("^\\[name=['\"]?(" + a9 + "+)['\"]?\\]"), | |
TAG: new RegExp("^(" + a9.replace("[-", "[-\\*") + "+)"), | |
ATTR: new RegExp("^" + ap), | |
PSEUDO: new RegExp("^" + aB), | |
CHILD: new RegExp("^:(only|nth|last|first)-child(?:\\(" + aI + "*(even|odd|(([+-]|)(\\d*)n|)" + aI + "*(?:([+-]|)" + aI + "*(\\d+)|))" + aI + "*\\)|)", "i"), | |
POS: new RegExp(aC, "ig"), | |
needsContext: new RegExp("^" + aI + "*[>+~]|" + aC, "i") | |
}, aY = {}, aX = [], | |
a6 = {}, aQ = [], | |
aJ = function (a) { | |
return a.sizzleFilter = !0, a | |
}, bo = function (a) { | |
return function (b) { | |
return "input" === b.nodeName.toLowerCase() && b.type === a | |
} | |
}, aV = function (a) { | |
return function (b) { | |
var c = b.nodeName.toLowerCase(); | |
return ("input" === c || "button" === c) && b.type === a | |
} | |
}, av = function (d) { | |
var c = !1, | |
a = bl.createElement("div"); | |
try { | |
c = d(a) | |
} catch (b) {} | |
return a = null, c | |
}, a5 = av(function (a) { | |
a.innerHTML = "<select></select>"; | |
var b = typeof a.lastChild.getAttribute("multiple"); | |
return "boolean" !== b && "string" !== b | |
}), | |
br = av(function (a) { | |
a.id = aN + 0, a.innerHTML = "<a name='" + aN + "'></a><div name='" + aN + "'></div>", bi.insertBefore(a, bi.firstChild); | |
var b = bl.getElementsByName && bl.getElementsByName(aN).length === 2 + bl.getElementsByName(aN + 0).length; | |
return bj = !bl.getElementById(aN), bi.removeChild(a), b | |
}), | |
bn = av(function (a) { | |
return a.appendChild(bl.createComment("")), 0 === a.getElementsByTagName("*").length | |
}), | |
az = av(function (a) { | |
return a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute !== aM && "#" === a.firstChild.getAttribute("href") | |
}), | |
aA = av(function (a) { | |
return a.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", a.getElementsByClassName && 0 !== a.getElementsByClassName("e").length ? (a.lastChild.className = "e", 1 !== a.getElementsByClassName("e").length) : !1 | |
}), | |
e = function (g, j, d, a) { | |
d = d || [], j = j || bl; | |
var c, i, b, h, f = j.nodeType; | |
if (1 !== f && 9 !== f) { | |
return [] | |
} | |
if (!g || "string" != typeof g) { | |
return d | |
} | |
if (b = a7(j), !b && !a && (c = aq.exec(g))) { | |
if (h = c[1]) { | |
if (9 === f) { | |
if (i = j.getElementById(h), !i || !i.parentNode) { | |
return d | |
} | |
if (i.id === h) { | |
return d.push(i), d | |
} | |
} else { | |
if (j.ownerDocument && (i = j.ownerDocument.getElementById(h)) && aD(j, i) && i.id === h) { | |
return d.push(i), d | |
} | |
} | |
} else { | |
if (c[2]) { | |
return aW.apply(d, a8.call(j.getElementsByTagName(g), 0)), d | |
} | |
if ((h = c[3]) && aA && j.getElementsByClassName) { | |
return aW.apply(d, a8.call(j.getElementsByClassName(h), 0)), d | |
} | |
} | |
} | |
return aP(g, j, d, a, b) | |
}, aw = e.selectors = { | |
cacheLength: 50, | |
match: ay, | |
order: ["ID", "TAG"], | |
attrHandle: {}, | |
createPseudo: aJ, | |
find: { | |
ID: bj ? function (a, b, c) { | |
if (typeof b.getElementById !== aM && !c) { | |
var d = b.getElementById(a); | |
return d && d.parentNode ? [d] : [] | |
} | |
} : function (a, b, c) { | |
if (typeof b.getElementById !== aM && !c) { | |
var d = b.getElementById(a); | |
return d ? d.id === a || typeof d.getAttributeNode !== aM && d.getAttributeNode("id").value === a ? [d] : bb : [] | |
} | |
}, | |
TAG: bn ? function (b, a) { | |
return typeof a.getElementsByTagName !== aM ? a.getElementsByTagName(b) : void 0 | |
} : function (f, a) { | |
var b = a.getElementsByTagName(f); | |
if ("*" === f) { | |
for (var g, c = [], d = 0; g = b[d]; d++) { | |
1 === g.nodeType && c.push(g) | |
} | |
return c | |
} | |
return b | |
} | |
}, | |
relative: { | |
">": { | |
dir: "parentNode", | |
first: !0 | |
}, | |
" ": { | |
dir: "parentNode" | |
}, | |
"+": { | |
dir: "previousSibling", | |
first: !0 | |
}, | |
"~": { | |
dir: "previousSibling" | |
} | |
}, | |
preFilter: { | |
ATTR: function (a) { | |
return a[1] = a[1].replace(aT, ""), a[3] = (a[4] || a[5] || "").replace(aT, ""), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4) | |
}, | |
CHILD: function (a) { | |
return a[1] = a[1].toLowerCase(), "nth" === a[1] ? (a[2] || e.error(a[0]), a[3] = +(a[3] ? a[4] + (a[5] || 1) : 2 * ("even" === a[2] || "odd" === a[2])), a[4] = +(a[6] + a[7] || "odd" === a[2])) : a[2] && e.error(a[0]), a | |
}, | |
PSEUDO: function (c) { | |
var b, a = c[4]; | |
return ay.CHILD.test(c[0]) ? null : (a && (b = au.exec(a)) && b.pop() && (c[0] = c[0].slice(0, b[0].length - a.length - 1), a = b[0].slice(0, -1)), c.splice(2, 3, a || c[3]), c) | |
} | |
}, | |
filter: { | |
ID: bj ? function (a) { | |
return a = a.replace(aT, ""), | |
function (b) { | |
return b.getAttribute("id") === a | |
} | |
} : function (a) { | |
return a = a.replace(aT, ""), | |
function (b) { | |
var c = typeof b.getAttributeNode !== aM && b.getAttributeNode("id"); | |
return c && c.value === a | |
} | |
}, | |
TAG: function (a) { | |
return "*" === a ? function () { | |
return !0 | |
} : (a = a.replace(aT, "").toLowerCase(), function (b) { | |
return b.nodeName && b.nodeName.toLowerCase() === a | |
}) | |
}, | |
CLASS: function (b) { | |
var a = aY[b]; | |
return a || (a = aY[b] = new RegExp("(^|" + aI + ")" + b + "(" + aI + "|$)"), aX.push(b), aX.length > aw.cacheLength && delete aY[aX.shift()]), | |
function (c) { | |
return a.test(c.className || typeof c.getAttribute !== aM && c.getAttribute("class") || "") | |
} | |
}, | |
ATTR: function (a, b, c) { | |
return b ? function (d) { | |
var f = e.attr(d, a), | |
g = f + ""; | |
if (null == f) { | |
return "!=" === b | |
} | |
switch (b) { | |
case "=": | |
return g === c; | |
case "!=": | |
return g !== c; | |
case "^=": | |
return c && 0 === g.indexOf(c); | |
case "*=": | |
return c && g.indexOf(c) > -1; | |
case "$=": | |
return c && g.substr(g.length - c.length) === c; | |
case "~=": | |
return (" " + g + " ").indexOf(c) > -1; | |
case "|=": | |
return g === c || g.substr(0, c.length + 1) === c + "-" | |
} | |
} : function (d) { | |
return null != e.attr(d, a) | |
} | |
}, | |
CHILD: function (d, b, a, c) { | |
if ("nth" === d) { | |
var f = bd++; | |
return function (h) { | |
var k, g, i = 0, | |
j = h; | |
if (1 === a && 0 === c) { | |
return !0 | |
} | |
if (k = h.parentNode, k && (k[aN] !== f || !h.sizset)) { | |
for (j = k.firstChild; j && (1 !== j.nodeType || (j.sizset = ++i, j !== h)); j = j.nextSibling) {} | |
k[aN] = f | |
} | |
return g = h.sizset - c, 0 === a ? 0 === g : g % a === 0 && g / a >= 0 | |
} | |
} | |
return function (g) { | |
var h = g; | |
switch (d) { | |
case "only": | |
case "first": | |
for (; h = h.previousSibling;) { | |
if (1 === h.nodeType) { | |
return !1 | |
} | |
} | |
if ("first" === d) { | |
return !0 | |
} | |
h = g; | |
case "last": | |
for (; h = h.nextSibling;) { | |
if (1 === h.nodeType) { | |
return !1 | |
} | |
} | |
return !0 | |
} | |
} | |
}, | |
PSEUDO: function (a, b, d, f) { | |
var c = aw.pseudos[a] || aw.pseudos[a.toLowerCase()]; | |
return c || e.error("unsupported pseudo: " + a), c.sizzleFilter ? c(b, d, f) : c | |
} | |
}, | |
pseudos: { | |
not: aJ(function (d, b, c) { | |
var a = bg(d.replace(aS, "$1"), b, c); | |
return function (f) { | |
return !a(f) | |
} | |
}), | |
enabled: function (a) { | |
return a.disabled === !1 | |
}, | |
disabled: function (a) { | |
return a.disabled === !0 | |
}, | |
checked: function (b) { | |
var a = b.nodeName.toLowerCase(); | |
return "input" === a && !! b.checked || "option" === a && !! b.selected | |
}, | |
selected: function (a) { | |
return a.parentNode && a.parentNode.selectedIndex, a.selected === !0 | |
}, | |
parent: function (a) { | |
return !!a.firstChild | |
}, | |
empty: function (a) { | |
return !a.firstChild | |
}, | |
contains: aJ(function (a) { | |
return function (b) { | |
return (b.textContent || b.innerText || bs(b)).indexOf(a) > -1 | |
} | |
}), | |
has: aJ(function (a) { | |
return function (b) { | |
return e(a, b).length > 0 | |
} | |
}), | |
header: function (a) { | |
return aZ.test(a.nodeName) | |
}, | |
text: function (a) { | |
var b, c; | |
return "input" === a.nodeName.toLowerCase() && "text" === (b = a.type) && (null == (c = a.getAttribute("type")) || c.toLowerCase() === b) | |
}, | |
radio: bo("radio"), | |
checkbox: bo("checkbox"), | |
file: bo("file"), | |
password: bo("password"), | |
image: bo("image"), | |
submit: aV("submit"), | |
reset: aV("reset"), | |
button: function (a) { | |
var b = a.nodeName.toLowerCase(); | |
return "input" === b && "button" === a.type || "button" === b | |
}, | |
input: function (a) { | |
return ar.test(a.nodeName) | |
}, | |
focus: function (b) { | |
var a = b.ownerDocument; | |
return !(b !== a.activeElement || a.hasFocus && !a.hasFocus() || !b.type && !b.href) | |
}, | |
active: function (a) { | |
return a === a.ownerDocument.activeElement | |
} | |
}, | |
setFilters: { | |
first: function (a, b, c) { | |
return c ? a.slice(1) : [a[0]] | |
}, | |
last: function (a, b, c) { | |
var d = a.pop(); | |
return c ? a : [d] | |
}, | |
even: function (g, a, b) { | |
for (var c = [], d = b ? 1 : 0, f = g.length; f > d; d += 2) { | |
c.push(g[d]) | |
} | |
return c | |
}, | |
odd: function (g, a, b) { | |
for (var c = [], d = b ? 0 : 1, f = g.length; f > d; d += 2) { | |
c.push(g[d]) | |
} | |
return c | |
}, | |
lt: function (a, b, c) { | |
return c ? a.slice(+b) : a.slice(0, +b) | |
}, | |
gt: function (a, b, c) { | |
return c ? a.slice(0, +b + 1) : a.slice(+b + 1) | |
}, | |
eq: function (a, b, c) { | |
var d = a.splice(+b, 1); | |
return c ? a : d | |
} | |
} | |
}; | |
aw.setFilters.nth = aw.setFilters.eq, aw.filters = aw.pseudos, az || (aw.attrHandle = { | |
href: function (a) { | |
return a.getAttribute("href", 2) | |
}, | |
type: function (a) { | |
return a.getAttribute("type") | |
} | |
}), br && (aw.order.push("NAME"), aw.find.NAME = function (b, a) { | |
return typeof a.getElementsByName !== aM ? a.getElementsByName(b) : void 0 | |
}), aA && (aw.order.splice(1, 0, "CLASS"), aw.find.CLASS = function (a, b, c) { | |
return typeof b.getElementsByClassName === aM || c ? void 0 : b.getElementsByClassName(a) | |
}); | |
try { | |
a8.call(bi.childNodes, 0)[0].nodeType | |
} catch (aF) { | |
a8 = function (b) { | |
for (var a, c = []; a = this[b]; b++) { | |
c.push(a) | |
} | |
return c | |
} | |
} | |
var a7 = e.isXML = function (b) { | |
var a = b && (b.ownerDocument || b).documentElement; | |
return a ? "HTML" !== a.nodeName : !1 | |
}, aD = e.contains = bi.compareDocumentPosition ? function (a, b) { | |
return !!(16 & a.compareDocumentPosition(b)) | |
} : bi.contains ? function (c, d) { | |
var a = 9 === c.nodeType ? c.documentElement : c, | |
b = d.parentNode; | |
return c === b || !! (b && 1 === b.nodeType && a.contains && a.contains(b)) | |
} : function (a, b) { | |
for (; b = b.parentNode;) { | |
if (b === a) { | |
return !0 | |
} | |
} | |
return !1 | |
}, bs = e.getText = function (a) { | |
var b, d = "", | |
c = 0, | |
f = a.nodeType; | |
if (f) { | |
if (1 === f || 9 === f || 11 === f) { | |
if ("string" == typeof a.textContent) { | |
return a.textContent | |
} | |
for (a = a.firstChild; a; a = a.nextSibling) { | |
d += bs(a) | |
} | |
} else { | |
if (3 === f || 4 === f) { | |
return a.nodeValue | |
} | |
} | |
} else { | |
for (; b = a[c]; c++) { | |
d += bs(b) | |
} | |
} | |
return d | |
}; | |
e.attr = function (a, b) { | |
var d, c = a7(a); | |
return c || (b = b.toLowerCase()), aw.attrHandle[b] ? aw.attrHandle[b](a) : a5 || c ? a.getAttribute(b) : (d = a.getAttributeNode(b), d ? "boolean" == typeof a[b] ? a[b] ? b : null : d.specified ? d.value : null : null) | |
}, e.error = function (a) { | |
throw new Error("Syntax error, unrecognized expression: " + a) | |
}, [0, 0].sort(function () { | |
return bk = 0 | |
}), bi.compareDocumentPosition ? bc = function (a, b) { | |
return a === b ? (bh = !0, 0) : (a.compareDocumentPosition && b.compareDocumentPosition ? 4 & a.compareDocumentPosition(b) : a.compareDocumentPosition) ? -1 : 1 | |
} : (bc = function (k, a) { | |
if (k === a) { | |
return bh = !0, 0 | |
} | |
if (k.sourceIndex && a.sourceIndex) { | |
return k.sourceIndex - a.sourceIndex | |
} | |
var c, h, g = [], | |
i = [], | |
d = k.parentNode, | |
b = a.parentNode, | |
j = d; | |
if (d === b) { | |
return bq(k, a) | |
} | |
if (!d) { | |
return -1 | |
} | |
if (!b) { | |
return 1 | |
} | |
for (; j;) { | |
g.unshift(j), j = j.parentNode | |
} | |
for (j = b; j;) { | |
i.unshift(j), j = j.parentNode | |
} | |
c = g.length, h = i.length; | |
for (var f = 0; c > f && h > f; f++) { | |
if (g[f] !== i[f]) { | |
return bq(g[f], i[f]) | |
} | |
} | |
return f === c ? bq(k, i[f], -1) : bq(g[f], a, 1) | |
}, bq = function (c, d, b) { | |
if (c === d) { | |
return b | |
} | |
for (var a = c.nextSibling; a;) { | |
if (a === d) { | |
return -1 | |
} | |
a = a.nextSibling | |
} | |
return 1 | |
}), e.uniqueSort = function (b) { | |
var a, c = 1; | |
if (bc && (bh = bk, b.sort(bc), bh)) { | |
for (; a = b[c]; c++) { | |
a === b[c - 1] && b.splice(c--, 1) | |
} | |
} | |
return b | |
}; | |
var bg = e.compile = function (f, b, d) { | |
var g, h, c, a = a6[f]; | |
if (a && a.context === b) { | |
return a.dirruns++, a | |
} | |
for (h = bp(f, b, d), c = 0; g = h[c]; c++) { | |
h[c] = aG(g, b, d) | |
} | |
return a = a6[f] = bm(h), a.context = b, a.runs = a.dirruns = 0, aQ.push(f), aQ.length > aw.cacheLength && delete a6[aQ.shift()], a | |
}; | |
e.matches = function (a, b) { | |
return e(a, null, null, b) | |
}, e.matchesSelector = function (b, a) { | |
return e(a, null, null, [b]).length > 0 | |
}; | |
var aP = function (g, n, c, q, r) { | |
g = g.replace(aS, "$1"); | |
var p, o, b, m, l, j, i, h, d, a = g.match(aR), | |
k = g.match(aH), | |
f = n.nodeType; | |
if (ay.POS.test(g)) { | |
return a0(g, n, c, q, a) | |
} | |
if (q) { | |
p = a8.call(q, 0) | |
} else { | |
if (a && 1 === a.length) { | |
if (k.length > 1 && 9 === f && !r && (a = ay.ID.exec(k[0]))) { | |
if (n = aw.find.ID(a[1], n, r)[0], !n) { | |
return c | |
} | |
g = g.slice(k.shift().length) | |
} | |
for (h = (a = a3.exec(k[0])) && !a.index && n.parentNode || n, d = k.pop(), j = d.split(":not")[0], b = 0, m = aw.order.length; m > b; b++) { | |
if (i = aw.order[b], a = ay[i].exec(j)) { | |
if (p = aw.find[i]((a[1] || "").replace(aT, ""), h, r), null == p) { | |
continue | |
} | |
j === d && (g = g.slice(0, g.length - d.length) + j.replace(ay[i], ""), g || aW.apply(c, a8.call(p, 0))); | |
break | |
} | |
} | |
} | |
} if (g) { | |
for (o = bg(g, n, r), a4 = o.dirruns, null == p && (p = aw.find.TAG("*", a3.test(g) && n.parentNode || n)), b = 0; l = p[b]; b++) { | |
aU = o.runs++, o(l, n) && c.push(l) | |
} | |
} | |
return c | |
}; | |
bl.querySelectorAll && ! function () { | |
var h, g = aP, | |
a = /'|\\/g, | |
c = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g, | |
d = [], | |
f = [":active"], | |
b = bi.matchesSelector || bi.mozMatchesSelector || bi.webkitMatchesSelector || bi.oMatchesSelector || bi.msMatchesSelector; | |
av(function (i) { | |
i.innerHTML = "<select><option selected></option></select>", i.querySelectorAll("[selected]").length || d.push("\\[" + aI + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), i.querySelectorAll(":checked").length || d.push(":checked") | |
}), av(function (i) { | |
i.innerHTML = "<p test=''></p>", i.querySelectorAll("[test^='']").length && d.push("[*^$]=" + aI + "*(?:\"\"|'')"), i.innerHTML = "<input type='hidden'>", i.querySelectorAll(":enabled").length || d.push(":enabled", ":disabled") | |
}), d = d.length && new RegExp(d.join("|")), aP = function (n, i, m, k, l) { | |
if (!(k || l || d && d.test(n))) { | |
if (9 === i.nodeType) { | |
try { | |
return aW.apply(m, a8.call(i.querySelectorAll(n), 0)), m | |
} catch (o) {} | |
} else { | |
if (1 === i.nodeType && "object" !== i.nodeName.toLowerCase()) { | |
var p = i.getAttribute("id"), | |
j = p || aN, | |
q = a3.test(n) && i.parentNode || i; | |
p ? j = j.replace(a, "\\$&") : i.setAttribute("id", j); | |
try { | |
return aW.apply(m, a8.call(q.querySelectorAll(n.replace(aR, "[id='" + j + "'] $&")), 0)), m | |
} catch (o) {} finally { | |
p || i.removeAttribute("id") | |
} | |
} | |
} | |
} | |
return g(n, i, m, k, l) | |
}, b && (av(function (i) { | |
h = b.call(i, "div"); | |
try { | |
b.call(i, "[test!='']:sizzle"), f.push(aw.match.PSEUDO) | |
} catch (j) {} | |
}), f = new RegExp(f.join("|")), e.matchesSelector = function (k, i) { | |
if (i = i.replace(c, "='$1']"), !(a7(k) || f.test(i) || d && d.test(i))) { | |
try { | |
var l = b.call(k, i); | |
if (l || h || k.document && 11 !== k.document.nodeType) { | |
return l | |
} | |
} catch (j) {} | |
} | |
return e(i, null, null, [k]).length > 0 | |
}) | |
}(), "function" == typeof AC.define && AC.define.amd ? AC.define("base/vendor/Sizzle", [], function () { | |
return e | |
}) : a1.Sizzle = e | |
}(window), AC.define("base/String", [], function () { | |
var b = {}; | |
return b.String = {}, b.String.isString = function (a) { | |
return "string" == typeof a | |
}, b.String.toCamelCase = function (a) { | |
if (!b.String.isString(a)) { | |
throw "Argument must be of type String." | |
} | |
return a.replace(/-+(.)?/g, function (f, e) { | |
return e ? e.toUpperCase() : "" | |
}) | |
}, b.String.queryStringToObject = function (e) { | |
var f = {}, a = new RegExp("([^?=&]+)(=([^&]*))?", "g"); | |
if (!b.String.isString(e)) { | |
throw "QueryStringToObject error: argument must be a string" | |
} | |
return e.replace(a, function (j, i, c, d) { | |
f[i] = d | |
}), f | |
}, b.String | |
}), AC.define("base/Viewport", [], function () { | |
var b = {}; | |
return b.Viewport = {}, b.Viewport.scrollOffsets = function () { | |
return { | |
x: window.pageXOffset || document.documentElement.scrollLeft || document.body.scrollLeft, | |
y: window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop | |
} | |
}, b.Viewport.dimensions = function () { | |
return { | |
height: window.innerHeight || document.documentElement.clientHeight, | |
width: window.innerWidth || document.documentElement.clientWidth | |
} | |
}, b.Viewport | |
}), AC.define("base/Log", ["require", "base/Environment"], function (d) { | |
var c = {}; | |
return c.Environment = d("base/Environment"), c.log = function () { | |
var b = "f7c9180f-5c45-47b4-8de4-428015f096c0", | |
a = c.Environment.Feature.localStorageAvailable() && !! window.localStorage.getItem(b); | |
return function (f) { | |
window.console && "function" == typeof console.log && a && console.log(f) | |
} | |
}(), c.log | |
}), AC.define("base/onDOMReady", [], function () { | |
var b = function (t) { | |
var u = !1, | |
q = !0, | |
o = window.document, | |
p = o.documentElement, | |
a = o.addEventListener ? "addEventListener" : "attachEvent", | |
f = o.addEventListener ? "removeEventListener" : "detachEvent", | |
v = o.addEventListener ? "" : "on", | |
e = function (c) { | |
("readystatechange" != c.type || "complete" == o.readyState) && (("load" == c.type ? window : o)[f](v + c.type, e, !1), !u && (u = !0) && t.call(window, c.type || c)) | |
}, r = function () { | |
try { | |
p.doScroll("left") | |
} catch (c) { | |
return setTimeout(r, 50), void 0 | |
} | |
e("poll") | |
}; | |
if ("complete" == o.readyState) { | |
t.call(window, "lazy") | |
} else { | |
if (o.createEventObject && p.doScroll) { | |
try { | |
q = !window.frameElement | |
} catch (s) {} | |
q && r() | |
} | |
o[a](v + "DOMContentLoaded", e, !1), o[a](v + "readystatechange", e, !1), window[a](v + "load", e, !1) | |
} | |
}; | |
return b | |
}), AC.define("base/shims/ie/Element", ["require", "base/vendor/Sizzle", "base/Environment", "base/Array", "base/onDOMReady"], function (e) { | |
var f = {}, d = e("base/vendor/Sizzle"); | |
return f.Environment = e("base/Environment"), f.Array = e("base/Array"), AC_onDOMReady = e("base/onDOMReady"), | |
function (a) { | |
f.Environment.Browser.IE && f.Environment.Browser.IE.documentMode < 8 && (a.selectAll = function (j, i) { | |
if ("undefined" == typeof i) { | |
i = document | |
} else { | |
if (!a.isElement(i) && 9 !== i.nodeType && 11 !== i.nodeType) { | |
throw "AC_Element.selectAll: Invalid context nodeType" | |
} | |
} | |
var c, b = []; | |
if ("string" == typeof j) { | |
return 11 === i.nodeType ? (f.Array.toArray(i.childNodes).forEach(function (g) { | |
a.matchesSelector(g, j) && b.push(g), (c = d(j, g).length > 0) && b.concat(c) | |
}), b) : d(j, i) | |
} | |
throw "AC_Element.selectAll: Selector must be a string" | |
}), f.Environment.Browser.IE && f.Environment.Browser.IE.documentMode < 8 && (a.select = function (j, c) { | |
if ("undefined" == typeof c) { | |
c = document | |
} else { | |
if (!a.isElement(c) && 9 !== c.nodeType && 11 !== c.nodeType) { | |
throw "AC_Element.select: Invalid context nodeType" | |
} | |
} | |
var b, i = []; | |
if ("string" == typeof j) { | |
return 11 === c.nodeType ? (f.Array.toArray(c.childNodes).some(function (g) { | |
return a.matchesSelector(g, j) ? (i = g, !0) : (b = d(j, g).length > 0) ? (i = b[0], !0) : void 0 | |
}), i) : d(j, c)[0] | |
} | |
throw "AC_Element.select: Selector must be a string" | |
}), f.Environment.Browser.IE && f.Environment.Browser.IE.documentMode < 9 && "function" != typeof window.getComputedStyle && (a.getStyle = function (j, c) { | |
j = a.getElementById(j); | |
var k, l, b; | |
return j.currentStyle ? (c = "float" === c ? "styleFloat" : c, k = j.currentStyle, "opacity" === c ? (l = j.filters["DXImageTransform.Microsoft.Alpha"] || j.filters.Alpha, l ? parseFloat(l.Opacity / 100) : 1) : (b = k[c] || null, "auto" === b ? null : b)) : void 0 | |
}), f.Environment.Browser.IE && f.Environment.Browser.IE.documentMode <= 8 && (a.setStyle.__superSetStyle = a.setStyle.__setStyle, a.setStyle.__setStyle = function (c, b, i, j) { | |
"opacity" === b ? a.setStyle.__setOpacity(c, j) : a.setStyle.__superSetStyle(c, b, i, j) | |
}, a.setStyle.__setOpacity = function (c, b) { | |
b = b > 1 ? 1 : 100 * (0.00001 > b ? 0 : b); | |
var h = c.filters["DXImageTransform.Microsoft.Alpha"] || c.filters.Alpha; | |
h ? h.Opacity = b : c.style.filter += " progid:DXImageTransform.Microsoft.Alpha(Opacity=" + b + ")" | |
}), f.Environment.Browser.IE && f.Environment.Browser.IE.documentMode < 9 && (a.ancestorHasLayout = function (c, b) { | |
for (var j = !1, i = c.parentNode; i !== b;) { | |
if (i) { | |
if (i.currentStyle.hasLayout) { | |
j = !0; | |
break | |
} | |
i = i.parentNode | |
} | |
} | |
return j | |
}), f.Environment.Browser.IE && f.Environment.Browser.IE.documentMode < 8 && (a.__nonClickableImageBooster = function () { | |
var b, l, m, n, k, c = []; | |
a.selectAll("a > * img").forEach(function (g) { | |
b = g.parentNode, l = a.ancestor(g, "a"), a.ancestorHasLayout(g, l) && g.height > 0 && g.width > 0 && (a.select("ieclickbooster", l) || (m = document.createElement("ieclickbooster"), n = a.getStyle(l, "position"), "static" === n && a.setStyle(l, { | |
position: "relative" | |
}), a.selectAll("> *", l).forEach(function (i) { | |
var h = parseInt(i.currentStyle.zIndex, 10); | |
h > 0 && c.push(h) | |
}), c.sort(function (h, i) { | |
return i - h | |
}), k = c[0] ? c[0].toString() : "1", a.insert(m, l), a.setStyle(m, { | |
display: "block", | |
position: "absolute", | |
top: "0", | |
bottom: "0", | |
left: "0", | |
right: "0", | |
background: "url(/global/elements/blank.gif)", | |
cursor: "pointer", | |
zIndex: k | |
}))) | |
}) | |
}, AC_onDOMReady(function () { | |
a.__nonClickableImageBooster() | |
})) | |
} | |
}), AC.define("base/Element", ["require", "base/vendor/Sizzle", "base/Array", "base/String", "base/Viewport", "base/Log", "base/Environment", "base/shims/ie/Element"], function (g) { | |
var i = {}, j = g("base/vendor/Sizzle"); | |
i.Array = g("base/Array"), i.String = g("base/String"), i.Viewport = g("base/Viewport"), i.log = g("base/Log"), i.Element = {}, i.Environment = g("base/Environment"), i.Element.addEventListener = function (a, c, b, d) { | |
return a.addEventListener ? a.addEventListener(c, b, d) : a.attachEvent ? a.attachEvent("on" + c, b) : a["on" + c] = b, a | |
}, i.Element.removeEventListener = function (a, c, b, d) { | |
return a.removeEventListener ? a.removeEventListener(c, b, d) : a.detachEvent("on" + c, b), a | |
}, i.Element.getElementById = function (a) { | |
return i.String.isString(a) && (a = document.getElementById(a)), i.Element.isElement(a) ? a : null | |
}, i.Element.selectAll = function (b, a) { | |
if ("undefined" == typeof a) { | |
a = document | |
} else { | |
if (!i.Element.isElement(a) && 9 !== a.nodeType && 11 !== a.nodeType) { | |
throw "AC.Element.selectAll: Invalid context nodeType" | |
} | |
} if ("string" == typeof b) { | |
return i.Array.toArray(a.querySelectorAll(b)) | |
} | |
throw "AC.Element.selectAll: Selector must be a string" | |
}, i.Element.select = function (b, a) { | |
if ("undefined" == typeof a) { | |
a = document | |
} else { | |
if (!i.Element.isElement(a) && 9 !== a.nodeType && 11 !== a.nodeType) { | |
throw "AC.Element.select: Invalid context nodeType" | |
} | |
} if ("string" == typeof b) { | |
return a.querySelector(b) | |
} | |
throw "AC.Element.select: Selector must be a string" | |
}, i.Element.matchesSelector = function (a, b) { | |
return j.matchesSelector(a, b) | |
}, i.Element.matches = function (a, b) { | |
return i.log("AC.Element.matches is deprecated. Use AC.Element.filterBySelector instead."), i.Element.filterBySelector(b, a) | |
}, i.Element.filterBySelector = function (a, b) { | |
return j.matches(b, a) | |
}, i.Element.setOpacity = function (b, a) { | |
return i.log("AC.Element.setOpacity is deprecated. Use AC.Element.setStyle instead."), i.Element.setStyle(b, { | |
opacity: a | |
}) | |
}, i.Element.setStyle = function (d, c) { | |
if ("string" != typeof c && "object" != typeof c || Array.isArray(c)) { | |
throw new TypeError("styles argument must be either an object or a string") | |
} | |
d = i.Element.getElementById(d); | |
var e, b, a; | |
e = i.Element.setStyle.__explodeStyleStringToObject(c); | |
for (a in e) { | |
e.hasOwnProperty(a) && (b = a.replace(/-(\w)/g, i.Element.setStyle.__camelCaseReplace), i.Element.setStyle.__setStyle(d, b, e, e[a])) | |
} | |
return d | |
}, i.Element.setStyle.__explodeStyleStringToObject = function (b) { | |
var a, c, f, d, e = "object" == typeof b ? b : {}; | |
if ("string" == typeof b) { | |
for (a = b.split(";"), f = a.length, d = 0; f > d; d += 1) { | |
c = a[d].indexOf(":"), c > 0 && (e[a[d].substr(0, c).trim()] = a[d].substr(c + 1).trim()) | |
} | |
} | |
return e | |
}, i.Element.setStyle.__setStyle = function (b, a, c, d) { | |
"undefined" != typeof b.style[a] && (b.style[a] = d) | |
}, i.Element.setStyle.__camelCaseReplace = function (c, b, a, d) { | |
return 0 === a && "moz" !== d.substr(1, 3) ? b : b.toUpperCase() | |
}, i.Element.getStyle = function (c, b) { | |
var d, a; | |
return b = b.replace(/-(\w)/g, i.Element.setStyle.__camelCaseReplace), c = i.Element.getElementById(c), b = "float" === b ? "cssFloat" : b, d = window.getComputedStyle(c, null), a = d ? d[b] : null, "opacity" === b ? a ? parseFloat(a) : 1 : "auto" === a ? null : a | |
}, i.Element.cumulativeOffset = function (c) { | |
var b = i.Element.getBoundingBox(c), | |
d = i.Viewport.scrollOffsets(), | |
a = [b.top + d.y, b.left + d.x]; | |
return a.top = a[0], a.left = a[1], a | |
}, i.Element.getBoundingBox = function (c) { | |
c = i.Element.getElementById(c); | |
var a = c.getBoundingClientRect(), | |
d = a.width || a.right - a.left, | |
b = a.height || a.bottom - a.top; | |
return { | |
top: a.top, | |
right: a.right, | |
bottom: a.bottom, | |
left: a.left, | |
width: d, | |
height: b | |
} | |
}, i.Element.getInnerDimensions = function (d) { | |
var b, e, a = i.Element.getBoundingBox(d), | |
f = a.width, | |
c = a.height; | |
return ["padding", "border"].forEach(function (m) { | |
["Top", "Right", "Bottom", "Left"].forEach(function (o) { | |
b = "border" === m ? m + o + "Width" : m + o, e = parseFloat(i.Element.getStyle(d, b)), e = isNaN(e) ? 0 : e, ("Right" === o || "Left" === o) && (f -= e), ("Top" === o || "Bottom" === o) && (c -= e) | |
}) | |
}), { | |
width: f, | |
height: c | |
} | |
}, i.Element.getOuterDimensions = function (d) { | |
var b, a = i.Element.getBoundingBox(d), | |
e = a.width, | |
c = a.height; | |
return ["margin"].forEach(function (f) { | |
["Top", "Right", "Bottom", "Left"].forEach(function (n) { | |
b = parseFloat(i.Element.getStyle(d, f + n)), b = isNaN(b) ? 0 : b, ("Right" === n || "Left" === n) && (e += b), ("Top" === n || "Bottom" === n) && (c += b) | |
}) | |
}), { | |
width: e, | |
height: c | |
} | |
}, i.Element.hasClassName = function (a, b) { | |
var c = i.Element.getElementById(a); | |
return c && "" !== c.className ? new RegExp("(\\s|^)" + b + "(\\s|$)").test(c.className) : !1 | |
}, i.Element.addClassName = function (a, b) { | |
var c = i.Element.getElementById(a); | |
c.classList ? c.classList.add(b) : i.Element.hasClassName(c, b) || (c.className += " " + b) | |
}, i.Element.removeClassName = function (b, c) { | |
var d = i.Element.getElementById(b); | |
if (i.Element.hasClassName(d, c)) { | |
var a = new RegExp("(\\s|^)" + c + "(\\s|$)"); | |
d.className = d.className.replace(a, "$1").trim() | |
} | |
}, i.Element.toggleClassName = function (a, b) { | |
var c = i.Element.getElementById(a); | |
c.classList ? c.classList.toggle(b) : i.Element.hasClassName(c, b) ? i.Element.removeClassName(c, b) : i.Element.addClassName(c, b) | |
}, i.Element.isElement = function (a) { | |
return !(!a || 1 !== a.nodeType) | |
}, i.Element.addVendorEventListener = function (c, b, a, d) { | |
return i.log("AC.Element.addVendorEventListener is deprecated. Please use AC.Element.addVendorPrefixEventListener."), this.addVendorPrefixEventListener(c, b, a, d) | |
}, i.Element.addVendorPrefixEventListener = function (c, b, a, d) { | |
return b = b.match(/^webkit/i) ? b.replace(/^webkit/i, "") : b.match(/^moz/i) ? b.replace(/^moz/i, "") : b.match(/^ms/i) ? b.replace(/^ms/i, "") : b.match(/^o/i) ? b.replace(/^o/i, "") : b.charAt(0).toUpperCase() + b.slice(1), /WebKit/i.test(window.navigator.userAgent) ? i.Element.addEventListener(c, "webkit" + b, a, d) : /Opera/i.test(window.navigator.userAgent) ? i.Element.addEventListener(c, "O" + b, a, d) : /Gecko/i.test(window.navigator.userAgent) ? i.Element.addEventListener(c, b.toLowerCase(), a, d) : (b = b.charAt(0).toLowerCase() + b.slice(1), i.Element.addEventListener(c, b, a, d)) | |
}, i.Element.removeVendorEventListener = function (c, b, a, d) { | |
return i.log("AC.Element.removeVendorEventListener is deprecated. Please use AC.Element.removeVendorPrefixEventListener."), this.removeVendorPrefixEventListener(c, b, a, d) | |
}, i.Element.removeVendorPrefixEventListener = function (c, b, a, d) { | |
return b = b.match(/^webkit/i) ? b.replace(/^webkit/i, "") : b.match(/^moz/i) ? b.replace(/^moz/i, "") : b.match(/^ms/i) ? b.replace(/^ms/i, "") : b.match(/^o/i) ? b.replace(/^o/i, "") : b.charAt(0).toUpperCase() + b.slice(1), i.Element.removeEventListener(c, "webkit" + b, a, d), i.Element.removeEventListener(c, "O" + b, a, d), i.Element.removeEventListener(c, b.toLowerCase(), a, d), b = b.charAt(0).toLowerCase() + b.slice(1), i.Element.removeEventListener(c, b, a, d) | |
}, i.Element.setVendorPrefixStyle = function (f, c, d) { | |
if ("string" != typeof c) { | |
throw new TypeError("AC.Element.setVendorPrefixStyle: property must be a string") | |
} | |
if ("string" != typeof d && "number" != typeof d) { | |
throw new TypeError("AC.Element.setVendorPrefixStyle: value must be a string or a number") | |
} | |
d += "", f = i.Element.getElementById(f); | |
var a, b, e = ["", "webkit", "Moz", "ms", "O"]; | |
c = c.replace(/-(webkit|moz|ms|o)-/i, ""), c = c.replace(/^(webkit|Moz|ms|O)/, ""), c = c.charAt(0).toLowerCase() + c.slice(1), c = c.replace(/-(\w)/, function (o, p) { | |
return p.toUpperCase() | |
}), d = d.replace(/-(webkit|moz|ms|o)-/, "-vendor-"), e.forEach(function (n) { | |
a = "" === n ? c : n + c.charAt(0).toUpperCase() + c.slice(1), b = "" === n ? d.replace("-vendor-", "") : d.replace("-vendor-", "-" + n.charAt(0).toLowerCase() + n.slice(1) + "-"), a in f.style && i.Element.setStyle(f, a + ":" + b) | |
}) | |
}, i.Element.getVendorPrefixStyle = function (d, a) { | |
if ("string" != typeof a) { | |
throw new TypeError("AC.Element.getVendorPrefixStyle: property must be a string") | |
} | |
d = i.Element.getElementById(d); | |
var c, b = ["", "webkit", "Moz", "ms", "O"]; | |
return a = a.replace(/-(webkit|moz|ms|o)-/i, ""), a = a.replace(/^(webkit|Moz|ms|O)/, "").charAt(0).toLowerCase() + a.slice(1), a = a.replace(/-(\w)/, function (f, e) { | |
return e.toUpperCase() | |
}), b.some(function (f) { | |
var e = "" === f ? a : f + a.charAt(0).toUpperCase() + a.slice(1); | |
return e in d.style ? (c = i.Element.getStyle(d, e), !0) : void 0 | |
}), c | |
}, i.Element.insert = function (b, a, c) { | |
if (!b || 1 !== b.nodeType && 3 !== b.nodeType && 11 !== b.nodeType) { | |
throw "AC.Element.insert: element must be a valid node of type element, text, or document fragment" | |
} | |
if (!a || 1 !== a.nodeType && 11 !== a.nodeType) { | |
throw "AC.Element.insert: target must be a valid node of type element or document fragment" | |
} | |
switch (c) { | |
case "before": | |
if (11 === a.nodeType) { | |
throw "AC.Element.insert: target cannot be nodeType of documentFragment when using placement ‘before’" | |
} | |
a.parentNode.insertBefore(b, a); | |
break; | |
case "after": | |
if (11 === a.nodeType) { | |
throw "AC.Element.insert: target cannot be nodeType of documentFragment when using placement ‘after’" | |
} | |
a.parentNode.insertBefore(b, a.nextSibling); | |
break; | |
case "first": | |
a.insertBefore(b, a.firstChild); | |
break; | |
default: | |
a.appendChild(b) | |
} | |
}, i.Element.insertAt = function (b, a, e) { | |
var c, f, d; | |
if (b = i.Element.getElementById(b), a = i.Element.getElementById(a), !i.Element.isElement(b) || !i.Element.isElement(a)) { | |
throw "AC.Element.insertAt: element must be a valid DOM element" | |
} | |
if (c = i.Element.children(a), 0 > e && c.length && (e += c.length), a.contains(b) && e > c.indexOf(b) && e++, c && e <= c.length - 1) { | |
for (d = 0, f = c.length; f > d; d++) { | |
if (d === e) { | |
a.insertBefore(b, c[d]); | |
break | |
} | |
} | |
} else { | |
a.appendChild(b) | |
} | |
}, i.Element.children = function (b) { | |
var a = []; | |
if (b = i.Element.getElementById(b), !i.Element.isElement(b)) { | |
throw "AC.Element.children: element must be a valid DOM element" | |
} | |
return b.children && (a = [].filter.call(b.children, function (c) { | |
return 1 === c.nodeType | |
})), a.length ? a : null | |
}, i.Element.remove = function (c, a) { | |
if (!i.Element.isElement(c)) { | |
throw "AC.Element.remove: element must be a valid DOM element" | |
} | |
if (a === !0) { | |
var b = c.parentNode.removeChild(c); | |
return b | |
} | |
c.parentNode.removeChild(c) | |
}, i.Element.viewportOffset = function (b) { | |
var a = i.Element.getBoundingBox(b); | |
return { | |
x: a.left, | |
y: a.top | |
} | |
}, i.Element.pixelsInViewport = function (c) { | |
var b; | |
if (!i.Element.isElement(c)) { | |
throw "AC.Element.pixelsInViewport : element must be a valid DOM element" | |
} | |
var a = i.Viewport.dimensions(), | |
d = i.Element.getBoundingBox(c), | |
e = d.top; | |
return e >= 0 ? (b = a.height - e, b > d.height && (b = d.height)) : b = d.height + e, 0 > b && (b = 0), b > a.height && (b = a.height), b | |
}, i.Element.percentInViewport = function (c) { | |
var b = c.getBoundingClientRect().height, | |
a = i.Element.pixelsInViewport(c); | |
return a / b | |
}, i.Element.isInViewport = function (b, a) { | |
("number" != typeof a || a > 1 || 0 > a) && (a = 0); | |
var c = i.Element.percentInViewport(b); | |
return c > a || 1 === c | |
}; | |
var k = function (b, a) { | |
b = i.Element.getElementById(b); | |
var c = b.parentNode; | |
if (i.Element.isElement(c)) { | |
for (; c && ("function" != typeof a || a(c) !== !1);) { | |
c = c !== document.body ? c.parentNode : null | |
} | |
} | |
}; | |
i.Element.ancestors = function (c, b) { | |
var a = []; | |
return k(c, function (d) { | |
i.Element.isElement(d) && (void 0 === b || void 0 !== b && i.Element.matchesSelector(d, b)) && a.push(d) | |
}), a | |
}, i.Element.ancestor = function (b, a) { | |
b = i.Element.getElementById(b); | |
var c = null; | |
return null !== b && void 0 === a ? b.parentNode : (k(b, function (d) { | |
return i.Element.matchesSelector(d, a) ? (c = d, !1) : void 0 | |
}), c) | |
}; | |
var l, h; | |
return l = function (a, b) { | |
return l.prototype.initialize.apply(this, [a, b]), this | |
}, h = { | |
initialize: function (a, b) { | |
this.element = a, this.options = b || {} | |
}, | |
__findMatchingTarget: function (a) { | |
var b = null; | |
return b = i.Element.matchesSelector(a, this.options.selector) ? a : i.Element.ancestor(a, this.options.selector) | |
}, | |
__generateDelegateMethod: function () { | |
var b = this, | |
a = b.options.handler; | |
return function (f) { | |
var e, c = f.target || f.srcElement, | |
d = b.__findMatchingTarget(c); | |
null !== d && (e = new l.Event(f), e.setTarget(d), a(e)) | |
} | |
}, | |
attachEventListener: function () { | |
return this.__delegateMethod = this.__generateDelegateMethod(), i.Element.addEventListener(this.element, this.options.eventType, this.__delegateMethod), this.__delegateMethod | |
}, | |
unbind: function () { | |
i.Element.removeEventListener(this.element, this.options.eventType, this.__delegateMethod), this.__delegateMethod = void 0 | |
} | |
}, l.prototype = h, l.instances = [], l.filterInstances = function (b) { | |
var a = []; | |
return l.instances.forEach(function (c) { | |
b(c) === !0 && a.push(c) | |
}), a | |
}, l.Event = function () { | |
return l.Event.prototype.initialize.apply(this, arguments), this | |
}, l.Event.prototype = { | |
initialize: function (a) { | |
this.originalEvent = a | |
}, | |
setTarget: function (a) { | |
this.target = a, this.currentTarget = a | |
} | |
}, i.Element.addEventDelegate = function (b, c, d, a) { | |
var e = new i.Element.__EventDelegate(b, { | |
eventType: c, | |
selector: d, | |
handler: a | |
}); | |
return l.instances.push(e), e.attachEventListener() | |
}, i.Element.removeEventDelegate = function (b, c, d, a) { | |
var e = i.Element.__EventDelegate.filterInstances(function (n) { | |
var f = n.options; | |
return n.element === b && f.selector === d && f.eventType === c && f.handler === a | |
}); | |
e.forEach(function (f) { | |
f.unbind() | |
}) | |
}, i.Element.__EventDelegate = l, | |
function (a) { | |
var b = { | |
__objectifiedFunctions: {}, | |
__paramMaps: { | |
translate: "p1, p2, 0", | |
translateX: "p1, 0, 0", | |
translateY: "0, p1, 0", | |
scale: "p1, p2, 1", | |
scaleX: "p1, 1, 1", | |
scaleY: "1, p1, 1", | |
rotate: "0, 0, 1, p1", | |
matrix: "p1, p2, 0, 0, p3, p4, 0, 0, 0, 0, 1, 0, p5, p6, 0, 1" | |
}, | |
convert2dFunctions: function (e) { | |
var f; | |
this.__init(e); | |
for (var d in this.__objectifiedFunctions) { | |
if (this.__objectifiedFunctions.hasOwnProperty(d)) { | |
if (f = this.__objectifiedFunctions[d].replace(" ", "").split(","), d in this.__paramMaps) { | |
for (var c in this.__paramMaps) { | |
d === c && this.valuesToSet.push(this.__stripFunctionAxis(d) + "3d(" + this.__map2DTransformParams(f, this.__paramMaps[d]) + ")") | |
} | |
} else { | |
this.valuesToSet.push(d + "(" + this.__objectifiedFunctions[d] + ")") | |
} | |
} | |
} | |
return this.valuesToSet.join(" ") | |
}, | |
__init: function (c) { | |
this.valuesToSet = [], this.__objectifiedFunctions = "object" == typeof c ? c : {}, "string" == typeof c && (this.__objectifiedFunctions = this.__objectifyFunctionString(c)) | |
}, | |
__map2DTransformParams: function (d, c) { | |
return d.forEach(function (e, f) { | |
c = c.replace("p" + (f + 1), e) | |
}), c | |
}, | |
__splitFunctionStringToArray: function (c) { | |
return c.match(/[\w]+\(.+?\)/g) | |
}, | |
__splitFunctionNameAndParams: function (c) { | |
return c.match(/(.*)\((.*)\)/) | |
}, | |
__stripFunctionAxis: function (c) { | |
return c.match(/([a-z]+)(|X|Y)$/)[1] | |
}, | |
__objectifyFunctionString: function (e) { | |
var c, d = this; | |
return this.__splitFunctionStringToArray(e).forEach(function (f) { | |
c = d.__splitFunctionNameAndParams(f), d.__objectifiedFunctions[c[1]] = c[2] | |
}), this.__objectifiedFunctions | |
} | |
}; | |
a.Element.__vendorTransformHelper = b | |
}(i), i.Element.setVendorPrefixTransform = function (b, a) { | |
if ("string" != typeof a && "object" != typeof a || Array.isArray(a) || null === a) { | |
throw new TypeError("AC.Element.setVendorPrefixTransform: transformFunctions argument must be either an object or a string") | |
} | |
i.Element.setVendorPrefixStyle(b, "transform", i.Element.__vendorTransformHelper.convert2dFunctions(a)) | |
}, "IE" === i.Environment.Browser.name && g("base/shims/ie/Element")(i.Element), i.Element | |
}), AC.define("base/Event", [], function () { | |
var b = {}; | |
return b.Event = {}, b.Event.stop = function (a) { | |
a || (a = window.event), a.stopPropagation ? a.stopPropagation() : a.cancelBubble = !0, a.preventDefault && a.preventDefault(), a.stopped = !0, a.returnValue = !1 | |
}, b.Event.target = function (a) { | |
return "undefined" != typeof a.target ? a.target : a.srcElement | |
}, b.Event.Keys = { | |
UP: 38, | |
DOWN: 40, | |
LEFT: 37, | |
RIGHT: 39, | |
ESC: 27, | |
SPACE: 32, | |
BACKSPACE: 8, | |
DELETE: 46, | |
END: 35, | |
HOME: 36, | |
PAGEDOWN: 34, | |
PAGEUP: 33, | |
RETURN: 13, | |
TAB: 9 | |
}, b.Event | |
}), AC.define("base/Function", ["require", "base/Array"], function (d) { | |
var c = {}; | |
return c.Array = d("base/Array"), c.Function = {}, c.Function.emptyFunction = function () {}, c.Function.bindAsEventListener = function (f, a) { | |
var b = c.Array.toArray(arguments).slice(2); | |
return function (e) { | |
return f.apply(a, [e || window.event].concat(b)) | |
} | |
}, c.Function.getParamNames = function (a) { | |
var b = a.toString(); | |
return b.slice(b.indexOf("(") + 1, b.indexOf(")")).match(/([^\s,]+)/g) || [] | |
}, c.Function.iterateFramesOverAnimationDuration = function (a, b, k) { | |
var n, m, l, j = 0; | |
b = 1000 * b, m = function (e) { | |
l = l || e, j = Math.min(Math.max(0, (e - l) / b), 1), a(j), 1 > j ? n = window.requestAnimationFrame(m) : (window.cancelAnimationFrame(n), "function" == typeof k && k()) | |
}, window.requestAnimationFrame(m) | |
}, c.Function | |
}), AC.define("base/Synthesize", [], function () { | |
var b = {}; | |
return b.Synthesize = {}, b.Synthesize.synthesize = function (d) { | |
"object" != typeof d && (d = this); | |
var a; | |
for (a in d) { | |
d.hasOwnProperty(a) && "_" === a.charAt(0) && "_" !== a.charAt(1) && "function" != typeof d[a] && (this.__synthesizeGetter(a, d), this.__synthesizeSetter(a, d)) | |
} | |
}, b.Synthesize.__synthesizeGetter = function (a, f) { | |
var e = a.slice(1, a.length); | |
"undefined" == typeof f[e] && (f[e] = function () { | |
return f[a] | |
}) | |
}, b.Synthesize.__synthesizeSetter = function (a, f) { | |
var e = a.slice(1, a.length); | |
e = "set" + e.slice(0, 1).toUpperCase() + e.slice(1, e.length), "undefined" == typeof f[e] && (f[e] = function (c) { | |
f[a] = c | |
}) | |
}, b.Synthesize | |
}), AC.define("base/Object", ["require", "base/Synthesize"], function (d) { | |
var c = {}; | |
return c.Object = {}, c.Synthesize = d("base/Synthesize"), c.Object.extend = Object.extend ? Object.extend : function () { | |
var a, b; | |
return a = arguments.length < 2 ? [{}, | |
arguments[0] | |
] : [].slice.call(arguments), b = a.shift(), a.forEach(function (g) { | |
for (var h in g) { | |
g.hasOwnProperty(h) && (b[h] = g[h]) | |
} | |
}), b | |
}, c.Object.clone = Object.clone ? Object.clone : function (a) { | |
return c.Object.extend({}, a) | |
}, c.Object.getPrototypeOf = Object.getPrototypeOf ? Object.getPrototypeOf : "object" == typeof this.__proto__ ? function (a) { | |
return a.__proto__ | |
} : function (a) { | |
var b, f = a.constructor; | |
if (Object.prototype.hasOwnProperty.call(a, "constructor")) { | |
if (b = f, !delete a.constructor) { | |
return null | |
} | |
f = a.constructor, a.constructor = b | |
} | |
return f ? f.prototype : null | |
}, c.Object.toQueryParameters = function (b) { | |
var a, f = []; | |
if ("object" != typeof b) { | |
throw "toQueryParameters error: argument is not an object" | |
} | |
for (a in b) { | |
b.hasOwnProperty(a) && f.push(a + "=" + b[a]) | |
} | |
return f.join("&") | |
}, c.Object.isEmpty = function (b) { | |
var a; | |
if ("object" != typeof b) { | |
throw "AC.Object.isEmpty : Invalid parameter - expected object" | |
} | |
for (a in b) { | |
return !1 | |
} | |
return !0 | |
}, c.Object.synthesize = function (a) { | |
if ("object" == typeof a) { | |
return c.Object.extend(a, c.Object.clone(c.Synthesize)), a.synthesize(), a | |
} | |
throw "Argument supplied was not a valid object." | |
}, c.Object | |
}), AC.define("base/NotificationCenter", [], function () { | |
var b = {}; | |
return b.NotificationCenter = function () { | |
var a = {}; | |
return { | |
publish: function (g, i, j) { | |
i = i || {}; | |
var h = function () { | |
!a[g] || a[g].length < 1 || a[g].forEach(function (c) { | |
"undefined" != typeof c && (c.target && i.target ? c.target === i.target && c.callback(i.data) : c.callback(i.data)) | |
}) | |
}; | |
j === !0 ? window.setTimeout(h, 10) : h() | |
}, | |
subscribe: function (h, f, g) { | |
a[h] || (a[h] = []), a[h].push({ | |
callback: f, | |
target: g | |
}) | |
}, | |
unsubscribe: function (i, g, h) { | |
var j = a[i].slice(0); | |
a[i].forEach(function (c, d) { | |
"undefined" != typeof c && (h ? g === c.callback && c.target === h && j.splice(d, 1) : g === c.callback && j.splice(d, 1)) | |
}), a[i] = j | |
}, | |
hasSubscribers: function (f, e) { | |
return !a[f] || a[f].length < 1 ? !1 : e ? (a[f].forEach(function (c) { | |
return c.target && e && c.target === e ? !0 : void 0 | |
}), !1) : !0 | |
} | |
} | |
}(), b.NotificationCenter | |
}), AC.define("base/Class", ["require", "base/Object", "base/Array", "base/Function", "base/onDOMReady"], function (d) { | |
var c = {}; | |
return c.Object = d("base/Object"), c.Array = d("base/Array"), c.Function = d("base/Function"), c.onDOMReady = d("base/onDOMReady"), c.Class = function () { | |
var h, j = c.Array.toArray(arguments), | |
a = "function" == typeof j[0] ? j.shift() : null, | |
b = j.shift() || {}, i = function () { | |
var f, e; | |
f = "function" == typeof this.initialize && i.__shouldInitialize !== !1 ? this.initialize.apply(this, arguments) : !1, f === c.Class.Invalidate && (e = function () { | |
try { | |
this && this._parentClass && this._parentClass._sharedInstance === this && (this._parentClass._sharedInstance = null) | |
} catch (g) { | |
throw g | |
} | |
}, window.setTimeout(e.bind(this), 200)) | |
}; | |
return i.__superclass = a, a ? (h = a.__superclass ? c.Class(a.__superclass, a.prototype) : c.Class(a.prototype), h.__shouldInitialize = !1, i.prototype = new h(), c.Object.extend(i.prototype, b), c.Class.__wrapSuperMethods(i)) : i.prototype = b, i.sharedInstance = function () { | |
return i._sharedInstance || (i._sharedInstance = new i(), i._sharedInstance._parentClass = i), i._sharedInstance | |
}, c.Object.synthesize(i.prototype), i.autocreate = b.__instantiateOnDOMReady || !1, delete b.__instantiateOnDOMReady, i.autocreate && c.onDOMReady(function () { | |
i.autocreate && i.sharedInstance() | |
}), i | |
}, c.Class.__wrapSuperMethods = function (i) { | |
var b, j = i.prototype, | |
k = i.__superclass.prototype; | |
for (b in j) { | |
if (j.hasOwnProperty(b) && "function" == typeof j[b]) { | |
var l = j[b], | |
a = c.Function.getParamNames(l); | |
"$super" === a[0] && (j[b] = function (f, g) { | |
var e = k[f]; | |
return function () { | |
var h = c.Array.toArray(arguments); | |
return g.apply(this, [e.bind(this)].concat(h)) | |
} | |
}(b, l)) | |
} | |
} | |
return this | |
}, c.Class.Invalidate = function () { | |
return !1 | |
}, c.Class | |
}), AC.define("base/History", ["require", "base/NotificationCenter", "base/Class", "base/Object"], function (d) { | |
var c = {}; | |
return c.History = {}, c.NotificationCenter = d("base/NotificationCenter"), c.Class = d("base/Class"), c.Object = d("base/Object"), c.History.HashChange = c.Class({ | |
initialize: function (a) { | |
this._boundEventHandler = null, this._notificationString = a || "ac-history-hashchange", this.synthesize() | |
}, | |
__eventHandler: function (b) { | |
var a = new c.History.HashChange.Event(b); | |
c.NotificationCenter.publish(this.notificationString(), { | |
data: a | |
}, !1) | |
}, | |
__bindWindowEvent: function () { | |
this.setBoundEventHandler(this.__eventHandler.bind(this)), window.addEventListener("hashchange", this.boundEventHandler()) | |
}, | |
__unbindWindowEvent: function () { | |
window.removeEventListener("hashchange", this.boundEventHandler()), this.setBoundEventHandler(null) | |
}, | |
subscribe: function (a) { | |
null === this.boundEventHandler() && this.__bindWindowEvent(), c.NotificationCenter.subscribe(this.notificationString(), a) | |
}, | |
unsubscribe: function (a) { | |
c.NotificationCenter.unsubscribe(this.notificationString(), a), c.NotificationCenter.hasSubscribers(this.notificationString()) || this.__unbindWindowEvent() | |
} | |
}), c.History.HashChange.Event = c.Class({ | |
initialize: function (a) { | |
this.event = a, c.Object.extend(this, a), this.hasOwnProperty("oldURL") && this.oldURL.match("#") && (this.oldHash = this.oldURL.split("#")[1]), this.hasOwnProperty("newURL") && this.newURL.match("#") && (this.newHash = this.newURL.split("#")[1]) | |
} | |
}), c.History | |
}), AC.define("base/Ajax", ["require", "base/Class", "base/Object", "base/Function"], function (d) { | |
var c = {}; | |
return c.Ajax = {}, c.Class = d("base/Class"), c.Object = d("base/Object"), c.Function = d("base/Function"), c.Ajax.getTransport = function () { | |
var b = !1; | |
try { | |
b = new XMLHttpRequest() | |
} catch (a) { | |
try { | |
b = new ActiveXObject("Msxml2.XMLHTTP") | |
} catch (a) { | |
try { | |
b = new ActiveXObject("Microsoft.XMLHTTP") | |
} catch (a) { | |
b = !1 | |
} | |
} | |
} | |
return b | |
}, c.Ajax.AjaxTracker = c.Class(), c.Ajax.AjaxTracker.prototype = { | |
_responders: [], | |
initialize: function () {}, | |
addResponder: function (a) { | |
this._responders.push(a) | |
}, | |
removeResponder: function (f) { | |
var a = 0, | |
b = this._responders.length; | |
for (a = 0; b > a; a += 1) { | |
if (this._responders[a] === f) { | |
return f = null, this._responders.splice(a, 1), !0 | |
} | |
} | |
return !1 | |
} | |
}, c.Ajax.AjaxRequest = c.Class(), c.Ajax.AjaxRequest.prototype = { | |
__defaultOptions: { | |
method: "get" | |
}, | |
initialize: function (a, b) { | |
this._transport = c.Ajax.getTransport(), this._mimeTypeOverride = null, this._options = null, c.Object.synthesize(this), this.setOptions(c.Object.extend(c.Object.clone(this.__defaultOptions), b || {})), c.Ajax.AjaxTracker.sharedInstance().addResponder(this), this.transport().onreadystatechange = this._handleTransportStateChange.bind(this), this.transport().open(this.options().method, a, !0), this.transport().setRequestHeader("Content-Type", this.options().contentType), this.transport().send(null) | |
}, | |
_handleTransportStateChange: function () { | |
if (4 === this.transport().readyState) { | |
new c.Ajax.AjaxResponse(this) | |
} | |
}, | |
overrideMimeType: function (a) { | |
this._mimeTypeOverride = a, this.transport().overrideMimeType && this.transport().overrideMimeType(a) | |
} | |
}, c.Ajax.AjaxResponse = c.Class(), c.Ajax.AjaxResponse.prototype = { | |
_request: null, | |
_transport: null, | |
initialize: function (b) { | |
var f = !1, | |
a = b.transport(); | |
this._transport = a, this._request = b, 4 === a.readyState && (a.status >= 200 && a.status < 300 && (b.options().onSuccess ? b.options().onSuccess(this) : c.Function.emptyFunction(), f = !0), a.status >= 400 && a.status < 500 && (b.options().onFailure ? b.options().onFailure(this) : c.Function.emptyFunction(), f = !0), a.status >= 300 && a.status < 400 && (f = !0), (a.status >= 500 && a.status < 600 || 0 === a.status) && (b.options().onError ? b.options().onError(this) : c.Function.emptyFunction(), f = !0)), f === !0 && (b.options().onComplete ? b.options().onComplete(this) : c.Function.emptyFunction(), c.Ajax.AjaxTracker.sharedInstance().removeResponder(b)) | |
}, | |
responseText: function () { | |
return this._transport.responseText | |
}, | |
responseXML: function () { | |
return this._transport.responseXML | |
}, | |
responseJSON: function () { | |
return JSON.parse ? JSON.parse(this._transport.responseText) : new Function("return " + this._transport.responseText)() | |
} | |
}, c.Ajax.checkURL = function (f, a) { | |
var b = c.Ajax.getTransport(); | |
b.onreadystatechange = function () { | |
4 === this.readyState && "function" == typeof a && a(200 === this.status) | |
}, b.open("HEAD", f, !0), b.send(null) | |
}, c.Ajax.AjaxRequest.prototype._overrideMimeType = null, c.Ajax.AjaxRequest.prototype.overrideMimeType = function (a) { | |
this._overrideMimeType = a, this.transport.overrideMimeType && this.transport.overrideMimeType(a) | |
}, c.Ajax | |
}), AC.define("base/DeferredQueue", ["require", "base/Class", "base/Object"], function (d) { | |
var c = {}; | |
return c.Class = d("base/Class"), c.Object = d("base/Object"), c.DeferredQueue = c.Class({ | |
__defaultOptions: { | |
autoplay: !1, | |
asynchronous: !1 | |
}, | |
initialize: function (a) { | |
"object" != typeof a && (a = {}), this._options = c.Object.extend(c.Object.clone(this.__defaultOptions), a), this._isPlaying = !1, this._isRunningAction = !1, this._queue = [], this.didFinish = this.__didFinish.bind(this), this.synthesize() | |
}, | |
add: function (b, g) { | |
var a, h = {}; | |
g > 0 && (h.delay = g), a = new c.DeferredQueue.Action(b, h), this.queue().push(a), this.isPlaying() || this.options().autoplay !== !0 || this.start() | |
}, | |
remove: function (a) { | |
this.setQueue(c.Array.without(this.queue(), a)) | |
}, | |
start: function () { | |
return this.isPlaying() ? !1 : (this.setIsPlaying(!0), this.__runNextAction(), void 0) | |
}, | |
stop: function () { | |
return this.isPlaying() ? (this.setIsPlaying(!1), void 0) : !1 | |
}, | |
clear: function () { | |
this.setQueue([]), this.stop() | |
}, | |
__didFinish: function () { | |
this.setIsRunningAction(!1), this.__runNextAction() | |
}, | |
__runNextAction: function () { | |
if (!this.isPlaying()) { | |
return !1 | |
} | |
if (this.queue().length && !this.isRunningAction()) { | |
var a = this.queue().shift(); | |
if (a.run(), this.options().asynchronous === !0) { | |
return this.setIsRunningAction(!0), void 0 | |
} | |
this.__runNextAction() | |
} | |
} | |
}), c.DeferredQueue.Action = c.Class({ | |
__defaultOptions: { | |
delay: 0 | |
}, | |
initialize: function (a, b) { | |
if ("function" != typeof a) { | |
throw "Deferred Queue func must be a function." | |
} | |
"object" != typeof b && (b = {}), this._options = c.Object.extend(c.Object.clone(this.__defaultOptions), b), this.__func = a, this.synthesize() | |
}, | |
run: function () { | |
var a = this.__func; | |
"number" == typeof this.options().delay && this.options().delay > 0 ? window.setTimeout(function () { | |
a() | |
}, 1000 * this.options().delay) : a() | |
} | |
}), c.DeferredQueue | |
}), AC.define("base/onWindowLoad", ["require", "base/Object", "base/Element", "base/DeferredQueue", "base/Function"], function (d) { | |
var c = {}; | |
return c.Object = d("base/Object"), c.Element = d("base/Element"), c.DeferredQueue = d("base/DeferredQueue"), c.Function = d("base/Function"), c.Object.extend(c, { | |
onWindowLoad: function () { | |
var a = { | |
_queue: null, | |
queue: function () { | |
return this._queue || (this._queue = new c.DeferredQueue()), this._queue | |
}, | |
hasLoaded: function () { | |
return "complete" === window.document.readyState | |
}, | |
__setupListener: function () { | |
this.__boundOnLoad || (this.__boundOnLoad = c.Function.bindAsEventListener(this.__onLoad, this), c.Element.addEventListener(window, "load", this.__boundOnLoad)) | |
}, | |
__onLoad: function () { | |
this.queue().start(), c.Element.removeEventListener(window, "load", this.__boundOnLoad), this.__boundOnLoad = null | |
}, | |
onWindowLoad: function (b) { | |
this.hasLoaded() ? b() : (this.__setupListener(), this.queue().add(b)) | |
} | |
}; | |
return a.onWindowLoad.bind(a) | |
}() | |
}), c.onWindowLoad | |
}), AC.define("base/queryParameters", ["require", "base/String"], function (d) { | |
var c = {}; | |
return c.String = d("base/String"), c.queryParameters = function () { | |
var b = {}, a = window.location.toString().split("?")[1]; | |
return c.String.isString(a) && (b = c.String.queryStringToObject(a)), b | |
}, c.queryParameters | |
}), AC.define("base/adler32", [], function () { | |
var b = function (k) { | |
var h, i, a = 65521, | |
j = 1, | |
l = 0; | |
for (i = 0; i < k.length; i += 1) { | |
h = k.charCodeAt(i), j = (j + h) % a, l = (l + j) % a | |
} | |
return l << 16 | j | |
}; | |
return b | |
}), AC.define("base/Registry", ["require", "base/Class", "base/Object", "base/Element"], function (d) { | |
var c = {}; | |
return c.Registry = {}, c.Class = d("base/Class"), c.Object = d("base/Object"), c.Element = d("base/Element"), c.Registry = c.Class(), c.Registry.prototype = { | |
__defaultOptions: { | |
contextInherits: [], | |
matchCatchAll: !1 | |
}, | |
initialize: function (a, b) { | |
if ("string" != typeof a) { | |
throw "Prefix not defined for Component Registry" | |
} | |
"object" != typeof b && (b = {}), this._options = c.Object.extend(c.Object.clone(this.__defaultOptions), b), this._prefix = a, this._reservedNames = [], this.__model = [], this.__lookup = {}, c.Object.synthesize(this) | |
}, | |
addComponent: function (m, k, b, a, l) { | |
var n, j = null; | |
if (!this.__isReserved(m) && "string" == typeof m) { | |
if ("string" == typeof a && (j = this.lookup(a)), j || "_base" === m || (j = this.lookup("_base") || this.addComponent("_base")), this.lookup(m)) { | |
throw "Cannot overwrite existing Component: " + m | |
} | |
return "object" != typeof l && (l = {}), "undefined" == typeof l.inherits && Array.isArray(this._options.contextInherits) && (l.inherits = this._options.contextInherits), n = this.__lookup[m] = new c.Registry.Component(m, k, b, j, l), this.__addToModel(n), n | |
} | |
return null | |
}, | |
match: function (a) { | |
var b; | |
if (b = this.__matchName(a)) { | |
return b | |
} | |
if (b = this.__matchQualifier(a)) { | |
return b | |
} | |
if (this.options().matchCatchAll === !0) { | |
if ("undefined" != typeof this.__model[1]) { | |
if ("undefined" != typeof this.__model[0]) { | |
return this.__model[1][0] | |
} | |
throw "Catchall Type not defined" | |
} | |
throw "No non-_base types defined at index 1." | |
} | |
return null | |
}, | |
__matchName: function (b) { | |
var f, a; | |
if (!c.Element.isElement(b)) { | |
return null | |
} | |
for (f = this.__model.length - 1; f >= 0; f--) { | |
if (Array.isArray(this.__model[f])) { | |
for (a = this.__model[f].length - 1; a >= 0; a--) { | |
if (c.Element.hasClassName(b, this._prefix + this.__model[f][a].name())) { | |
return this.__model[f][a] | |
} | |
} | |
} | |
} | |
return null | |
}, | |
__matchQualifier: function (b) { | |
var f, a; | |
if (!c.Element.isElement(b)) { | |
return null | |
} | |
for (f = this.__model.length - 1; f >= 0; f--) { | |
if (Array.isArray(this.__model[f])) { | |
for (a = this.__model[f].length - 1; a >= 0; a--) { | |
if ("function" == typeof this.__model[f][a].qualifier && this.__model[f][a].qualifier.apply(this.__model[f][a], [b, this._prefix]) === !0) { | |
return this.__model[f][a] | |
} | |
} | |
} | |
} | |
return null | |
}, | |
__addToModel: function (a) { | |
c.Registry.Component.isComponent(a) && ("undefined" == typeof this.__model[a.level()] && (this.__model[a.level()] = []), this.__model[a.level()].push(a)) | |
}, | |
lookup: function (a) { | |
return "string" == typeof a && "undefined" != typeof this.__lookup[a] ? this.__lookup[a] : null | |
}, | |
hasComponent: function (b) { | |
var a; | |
return "object" == typeof b && "function" == typeof b.name && (a = this.lookup(b.name())) ? a === b : !1 | |
}, | |
reserveName: function (a) { | |
if ("string" != typeof a) { | |
throw "Cannot reserve name: Name must be a string" | |
} | |
if (!this.lookup(a)) { | |
throw "Cannot reserve name: Component with name already exists." | |
} | |
this._reservedNames.push(a) | |
}, | |
__isReserved: function (a) { | |
if ("string" == typeof a) { | |
return -1 !== this._reservedNames.indexOf(a) | |
} | |
throw "Cannot check if this name is reserved because it is not a String." | |
} | |
}, c.Registry | |
}), AC.define("base/RegistryComponent", ["require", "base/Class", "base/Function", "base/Object", "base/Registry"], function (d) { | |
var c = {}; | |
return c.Class = d("base/Class"), c.Function = d("base/Function"), c.Object = d("base/Object"), c.Registry = d("base/Registry"), c.Registry.Component = c.Class(), c.Registry.Component.prototype = { | |
initialize: function (j, h, a, b, i) { | |
if ("string" != typeof j) { | |
throw "Cannot create Component without a name" | |
} | |
this._name = j, this._properties = h || {}, this.qualifier = "function" == typeof a ? a : c.Function.emptyFunction, this._parent = b, this._context = i || {}, c.Object.synthesize(this) | |
}, | |
properties: function () { | |
var a = "undefined" == typeof this._parent || null === this._parent ? {} : this._parent.properties(); | |
return c.Object.extend(a, this._properties) | |
}, | |
context: function (a) { | |
return this._context[a] ? this._context[a] : Array.isArray(this._context.inherits) && -1 !== this._context.inherits.indexOf[a] ? this.parent() ? this.parent().context(a) : null : null | |
}, | |
level: function () { | |
return "undefined" != typeof this._level ? this._level : "_base" === this._name ? 0 : "undefined" == typeof this._parent || "_base" === this._parent.name() ? 1 : this._parent.level() + 1 | |
} | |
}, c.Registry.Component.isComponent = function (a) { | |
return a instanceof c.Registry.Component | |
}, c.Registry.Component | |
}), AC.define("legacy", ["require", "base/Array", "base/Element", "base/Event", "base/Function", "base/Object", "base/Regexp", "base/String", "base/Environment", "base/Viewport", "base/History", "base/NotificationCenter", "base/Ajax", "base/Log", "base/onWindowLoad", "base/queryParameters", "base/adler32", "base/onDOMReady", "base/Class", "base/Registry", "base/RegistryComponent"], function (d) { | |
var c = window.AC || {}; | |
c.Array = d("base/Array"), c.Element = d("base/Element"), c.Event = d("base/Event"), c.Function = d("base/Function"), c.Object = d("base/Object"), c.Regexp = d("base/Regexp"), c.String = d("base/String"), c.Environment = d("base/Environment"), c.Viewport = d("base/Viewport"), c.History = d("base/History"), c.NotificationCenter = d("base/NotificationCenter"), c.Ajax = d("base/Ajax"), c.log = d("base/Log"), c.onWindowLoad = d("base/onWindowLoad"), c.queryParameters = c.queryParameters = d("base/queryParameters"), c.adler32 = d("base/adler32"), c.onDOMReady = d("base/onDOMReady"), c.Class = d("base/Class"), c.Registry = d("base/Registry"), c.Registry.Component = d("base/RegistryComponent") | |
}); | |
AC.define("defer/core/Deferred", ["require"], function (n) { | |
function h() {} | |
return h.prototype = { | |
resolve: function l() { | |
return this._defer.resolve.apply(this._defer, Array.prototype.slice.call(arguments)), this.promise() | |
}, | |
reject: function m() { | |
return this._defer.reject.apply(this._defer, Array.prototype.slice.call(arguments)), this.promise() | |
}, | |
progress: function i() { | |
return this._defer.progress.apply(this._defer, Array.prototype.slice.call(arguments)), this.promise() | |
}, | |
then: function j() { | |
return this._defer.then.apply(this._defer, Array.prototype.slice.call(arguments)), this.promise() | |
}, | |
promise: function k() { | |
return this._defer.promise.apply(this._defer, Array.prototype.slice.call(arguments)) | |
} | |
}, h | |
}), AC.define("defer/lib/Deferred", [], function () { | |
var m, k, j, n, h, l; | |
m = { | |
0: "pending", | |
1: "resolved", | |
2: "rejected" | |
}, k = function (b, g) { | |
var c, f, a, d, e; | |
if (this._status !== 0) { | |
return console && console.warn && console.warn("Trying to fulfill more than once."), !1 | |
} | |
this.data = g, f = this.pending, a = f.length; | |
for (c = 0; c < a; c++) { | |
d = f[c], d[b] && (e = d[b](g)), typeof e == "object" && e.hasOwnProperty("then") && e.hasOwnProperty("status") ? e.then(function (o) { | |
d.deferred.resolve(o) | |
}, function (o) { | |
d.deferred.reject(o) | |
}, function (o) { | |
d.deferred.progress(o) | |
}) : d.deferred[b](e || undefined) | |
} | |
return b !== "progress" && (f = []), !0 | |
}, l = function (a, b) { | |
this.then = a, this.status = b | |
}, n = function (a) { | |
return typeof a != "function" ? function () {} : a | |
}, j = function (a, b, c) { | |
this.resolve = n(a), this.reject = n(b), this.progress = n(c), this.deferred = new h | |
}, h = function () { | |
this.pending = [], this._status = 0, this._promise = new l(this.then.bind(this), this.status.bind(this)) | |
}, h.prototype = { | |
status: function () { | |
return m[this._status] | |
}, | |
promise: function () { | |
return this._promise | |
}, | |
progress: function (a) { | |
return k.call(this, "progress", a), this._promise | |
}, | |
resolve: function (a) { | |
return k.call(this, "resolve", a), this._status === 0 && (this._status = 1), this._promise | |
}, | |
reject: function (a) { | |
return k.call(this, "reject", a), this._status === 0 && (this._status = 2), this._promise | |
}, | |
then: function (a, c, d) { | |
var e, b; | |
return b = new j(a, c, d), this._status === 0 ? this.pending.push(b) : this._status === 1 && typeof a == "function" ? (e = a(this.data), typeof e == "object" && e.hasOwnProperty("then") && e.hasOwnProperty("status") ? e.then(function (f) { | |
b.deferred.resolve(f) | |
}, function (f) { | |
b.deferred.reject(f) | |
}, function (f) { | |
b.deferred.progress(f) | |
}) : b.deferred.resolve(e)) : this._status === 2 && typeof c == "function" && (e = c(this.data), b.deferred.reject(e)), b.deferred.promise() | |
} | |
}; | |
var i = function () { | |
var c, d, a, b, e; | |
return c = [].slice.call(arguments), d = new h, a = 0, b = function (g) { | |
a--; | |
var f = c.indexOf(this); | |
c[f] = g, a === 0 && d.resolve(c) | |
}, e = function (f) { | |
d.reject(f) | |
}, c.forEach(function (f) { | |
f.then && (a++, f.then(b.bind(f), e)) | |
}), d.promise() | |
}; | |
return h.when = i, h | |
}), AC.define("defer/Deferred", ["require", "defer/core/Deferred", "defer/lib/Deferred"], function (g) { | |
function h() { | |
this._defer = new k | |
} | |
var j = new(g("defer/core/Deferred")), | |
k = g("defer/lib/Deferred"); | |
return h.prototype = j, h.join = function i() { | |
return k.when.apply(null, [].slice.call(arguments)) | |
}, h.all = function l(a) { | |
return k.when.apply(null, a) | |
}, h | |
}); | |
AC.define("ajax/Ajax", ["require", "defer/Deferred"], function (f) { | |
function i() { | |
var b = !1; | |
try { | |
b = new XMLHttpRequest() | |
} catch (a) { | |
try { | |
b = new ActiveXObject("Msxml2.XMLHTTP") | |
} catch (a) { | |
try { | |
b = new ActiveXObject("Microsoft.XMLHTTP") | |
} catch (a) { | |
b = !1 | |
} | |
} | |
} | |
return b | |
} | |
function h(a) { | |
a && (this.timeout = a) | |
} | |
var j, g = f("defer/Deferred"); | |
return j = h.prototype, j.timeout = 5000, j.xhrMethod = function (a, o, e, b) { | |
var c, n = i(), | |
p = new g(); | |
b = b || {}, n.open(a, o, !1), Object.keys(b).forEach(function (k) { | |
n.setRequestHeader(k, b[k]) | |
}), c = setTimeout(function () { | |
n.abort(), p.reject() | |
}, this.timeout), n.onreadystatechange = function () { | |
4 === n.readyState && (clearTimeout(c), n.status >= 200 && n.status < 300 ? p.resolve(n) : p.reject(n)) | |
}; | |
try { | |
n.send(e) | |
} catch (d) { | |
clearTimeout(c), n.abort() | |
} | |
return p.promise() | |
}, j.post = function (c, b, a) { | |
return this.xhrMethod("POST", c, b, a) | |
}, j.get = function (c, b, a) { | |
return this.xhrMethod("GET", c, b, a) | |
}, h | |
}); | |
AC.define("animationTimeout/AnimationTimeout", ["require", "defer/Deferred"], function (e) { | |
function h(b, a, c) { | |
this.duration = b, a && (this._intervalFunction = a), c && (this._cancelFunction = c), this._update = this._update.bind(this) | |
} | |
var g, f = e("defer/Deferred"); | |
return g = h.prototype, g._intervalFunction = window.requestAnimationFrame.bind(window), g._cancelFunction = window.cancelAnimationFrame.bind(window), g._update = function (a) { | |
this._startTime = this._startTime || a, this._progress = (a - this._startTime) / this.duration, this._progress < 1 ? (this._defer.progress(this._progress), this._requestID = this._intervalFunction(this._update)) : (this._progress = 1, this._defer.progress(1), this._defer.resolve(1)) | |
}, g.start = function () { | |
return this._defer = new f(), this._startTime = 0, this._requestID = this._intervalFunction(this._update), this._defer.promise() | |
}, g.cancel = function () { | |
this._cancelFunction(this._requestID), this._defer.reject() | |
}, h | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
AC.define("threeDTransformsAvailable", ["require"], function (c) { | |
var d = AC.Environment; | |
return function () { | |
var a = document.createElement("style"); | |
a.id = "supportsThreeDStyle"; | |
return d.Feature.threeDTransformsAvailable() || void 0 !== a.style.MozTransform | |
} | |
}); | |
(function () { | |
var C = { | |
_showOnScrolls: [], | |
__onScroll: function v(a) { | |
this._showOnScrolls.forEach(function (b) { | |
b.__onScroll(a) | |
}) | |
}, | |
add: function A(a, b) { | |
this._showOnScrolls.push(a); | |
if (!this.__boundOnScroll) { | |
this.__boundOnScroll = this.__onScroll.bind(this); | |
AC.Element.addEventListener(b, "scroll", this.__boundOnScroll) | |
} | |
} | |
}; | |
AC.ShowOnScroll = AC.Class(); | |
AC.ShowOnScroll.prototype = { | |
__defaultOptions: { | |
threshold: 0.5, | |
timeInView: 1, | |
scrollEndDelay: 0.4 | |
}, | |
initialize: function E(a, b) { | |
if ("object" !== typeof b) { | |
b = {} | |
} | |
this._options = AC.Object.extend(AC.Object.clone(this.__defaultOptions), b); | |
if ("iOS" === AC.Environment.Browser.os) { | |
this._options.scrollEndDelay = 0 | |
} | |
this._element = AC.Element.getElementById(a); | |
this._delegate = {}; | |
this._scrollTarget = b.scrollTarget || window; | |
if (!this._element) { | |
throw "AC.ShowOnScroll: Invalid target element - expected Element or (string) element ID" | |
} | |
if (false !== b.shouldObserve) { | |
this.startObserving() | |
} | |
AC.Object.synthesize(this) | |
}, | |
startObserving: function s() { | |
if ("undefined" === typeof this.__boundOnScroll) { | |
this.__boundOnScroll = AC.Function.bindAsEventListener(this.__onScroll, this) | |
} | |
if ("undefined" === typeof this.__boundRefreshMetrics) { | |
this.__boundRefreshMetrics = AC.Function.bindAsEventListener(this.refreshMetrics, this) | |
} | |
if ("undefined" === typeof this.__boundWindowLoad) { | |
this.__boundWindowLoad = AC.Function.bindAsEventListener(this.__onWindowLoad, this) | |
} | |
if (true !== this._isObserving) { | |
C.add(this, this._scrollTarget); | |
AC.Element.addEventListener(window, "load", this.__boundWindowLoad); | |
AC.Element.addEventListener(window, "resize", this.__boundRefreshMetrics); | |
AC.Element.addEventListener(window, "orientationchange", this.__boundRefreshMetrics); | |
this._isObserving = true | |
} | |
}, | |
stopObserving: function z() { | |
if (true === this._isObserving) { | |
AC.Element.removeEventListener(this._scrollTarget, "scroll", this.__boundOnScroll); | |
AC.Element.removeEventListener(window, "resize", this.__boundRefreshMetrics); | |
AC.Element.removeEventListener(window, "orientationchange", this.__boundRefreshMetrics); | |
this._isObserving = false | |
} | |
}, | |
setDelegate: function t(a) { | |
if ("object" === typeof a) { | |
this._delegate = a | |
} | |
}, | |
refreshMetrics: function x() { | |
delete this._viewportMetrics; | |
delete this._elementMetrics; | |
this._viewportMetrics = this.viewportMetrics(); | |
this._elementMetrics = this.elementMetrics() | |
}, | |
isInView: function u(a) { | |
if ("undefined" === typeof a) { | |
a = this.pixelsInView() | |
} | |
return a > 0 | |
}, | |
isEnoughInView: function D(a) { | |
if ("undefined" === typeof a) { | |
a = this.percentInView() | |
} | |
return 0 === a ? false : a >= this._options.threshold | |
}, | |
viewportMetrics: function q() { | |
if ("undefined" === typeof this._viewportMetrics) { | |
this._viewportMetrics = {}; | |
this._viewportMetrics.height = window.innerHeight || document.documentElement.clientHeight; | |
AC.Object.synthesize(this) | |
} | |
return this._viewportMetrics | |
}, | |
elementMetrics: function w() { | |
if ("undefined" === typeof this._elementMetrics) { | |
this._elementMetrics = {}; | |
this._elementMetrics.height = this._element.offsetHeight; | |
this._elementMetrics.offsetY = AC.Element.cumulativeOffset(this._element).top; | |
AC.Object.synthesize(this) | |
} | |
return this._elementMetrics | |
}, | |
pixelsInView: function y() { | |
var b; | |
var a = this.viewportMetrics(); | |
var c = this.elementMetrics(); | |
var d = this.elementViewportOffsetY(); | |
if (d >= 0) { | |
b = a.height - d; | |
if (b > c.height) { | |
b = c.height | |
} | |
} else { | |
b = c.height + d | |
} if (b < 0) { | |
b = 0 | |
} | |
return this._pixelsInView = b | |
}, | |
percentInView: function F(b) { | |
var a = this.viewportMetrics(); | |
var c = this.elementMetrics(); | |
if ("number" !== typeof b) { | |
b = this.pixelsInView() | |
} | |
this._percentInView = 0 === b ? 0 : b / c.height; | |
return this._percentInView | |
}, | |
percentTravelled: function r(c) { | |
var b = this.viewportMetrics(); | |
var d = this.elementMetrics(); | |
var e = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; | |
var a = b.height + d.height; | |
this._percentTravelled = 1 - (d.height + d.offsetY - e) / a; | |
return this._percentTravelled | |
}, | |
elementViewportOffsetY: function B() { | |
var a = this.elementMetrics(); | |
var b = window.pageYOffset || document.documentElement.scrollTop || document.body.scrollTop; | |
return a.offsetY - b | |
} | |
} | |
})(); | |
AC.Object.extend(AC.ShowOnScroll.prototype, { | |
__onScroll: function ac___onScroll() { | |
var i = this._percentInView; | |
var j = "undefined" === typeof i; | |
var h = this.pixelsInView(); | |
var f = this.percentInView(h); | |
var g = this.percentTravelled(h); | |
if (this.isInView(h) && (0 === i || j)) { | |
if ("function" === typeof this._delegate.scrolledIntoView) { | |
this._delegate.scrolledIntoView(this._element) | |
} | |
} | |
if (0 === f && i > 0 && !j) { | |
if ("function" === typeof this._delegate.scrolledOutOfView) { | |
this._delegate.scrolledOutOfView(this._element) | |
} | |
} | |
if (1 === f && (i < 1 || j)) { | |
if ("function" === typeof this._delegate.scrolledIntoViewCompletely) { | |
this._delegate.scrolledIntoViewCompletely(this._element, h) | |
} | |
} | |
if (f < 1 && 1 === i && !j) { | |
if ("function" === typeof this._delegate.scrolledOutOfViewCompletely) { | |
this._delegate.scrolledOutOfViewCompletely(this._element, h, g) | |
} | |
} | |
if (this.__hasChangedInViewPastThresholdStatus(i, f)) { | |
if (this.isEnoughInView(f)) { | |
this.__scrolledIntoViewPastThreshold() | |
} else { | |
if (!j) { | |
this.__scrolledOutOfViewPastThreshold() | |
} | |
} | |
} | |
if (this.isInView(h)) { | |
if ("function" === typeof this._delegate.scrolledWhileInView) { | |
this._delegate.scrolledWhileInView(this._element, h, g) | |
} | |
} | |
if (!j) { | |
this.__resetOnScrollEndTimer() | |
} | |
}, | |
__onWindowLoad: function ac___onWindowLoad() { | |
var b = this; | |
window.setTimeout(function () { | |
b.__onScroll.call(b) | |
}, 500) | |
}, | |
__onScrollEnd: function ac___onScrollEnd() { | |
delete this.__onScrollEndTimer; | |
this.refreshMetrics(); | |
if ("function" === typeof this._delegate.scrollEnd) { | |
this._delegate.scrollEnd(this._element, this._pixelsInView, this._percentTravelled) | |
} | |
}, | |
__scrolledIntoViewPastThreshold: function ac___scrolledIntoViewPastThreshold() { | |
this.__startTimeInViewTimer(); | |
if ("function" === typeof this._delegate.scrolledIntoViewPastThreshold) { | |
this._delegate.scrolledIntoViewPastThreshold(this._element, this._pixelsInView, this._percentTravelled, this._options.threshold) | |
} | |
}, | |
__scrolledOutOfViewPastThreshold: function ac___scrolledOutOfViewPastThreshold() { | |
this.__cancelTimeInViewTimer(); | |
if ("function" === typeof this._delegate.scrolledOutOfViewPastThreshold) { | |
this._delegate.scrolledOutOfViewPastThreshold(this._element, this._pixelsInView, this._percentTravelled, this._options.threshold) | |
} | |
}, | |
__visitorEngaged: function ac___visitorEngaged() { | |
if ("function" === typeof this._delegate.visitorEngaged) { | |
this._delegate.visitorEngaged(this._element, this._pixelsInView, this._percentTravelled, this._options.threshold) | |
} | |
delete this.__timeInViewTimerId | |
}, | |
__hasChangedInViewPastThresholdStatus: function ac___hasChangedInViewPastThresholdStatus(c, d) { | |
if (this.isEnoughInView(d) && !this.isEnoughInView(c) || !this.isEnoughInView(d) && this.isEnoughInView(c) || "undefined" === typeof c) { | |
return true | |
} else { | |
return false | |
} | |
}, | |
__cancelTimeInViewTimer: function ac___cancelTimeInViewTimer() { | |
if ("undefined" !== typeof this.__timeInViewTimerId) { | |
window.clearTimeout(this.__timeInViewTimerId); | |
delete this.__timeInViewTimerId | |
} | |
}, | |
__startTimeInViewTimer: function ac___startTimeInViewTimer() { | |
this.__visitorEngaged() | |
}, | |
__resetOnScrollEndTimer: function ac___resetOnScrollEndTimer() { | |
this.__onScrollEnd() | |
} | |
}); | |
AC.ShowOnScroll.version = "2.1"; | |
AC.define("AC/ShowOnScroll", function () {}); | |
AC.define("overview/analytics/SectionEngagement", ["require", "AC/ShowOnScroll", "base/Object", "base/Element"], function (g) { | |
g("AC/ShowOnScroll"); | |
var i = AC.ShowOnScroll; | |
var j = AC.Tracking; | |
var h = g("base/Object"); | |
var k = g("base/Element"); | |
function l(a, b) { | |
this._element = a; | |
this._options = b || {} | |
} | |
l.prototype = { | |
__defaultOptions: { | |
onlyTrackOnce: true, | |
id: "", | |
minimumDuration: 1, | |
debug: false, | |
decimals: 1, | |
pixelOffset: 50 | |
}, | |
determineThreshold: function () { | |
var a; | |
var b = this._element.offsetHeight; | |
if (this.isAppSection()) { | |
b += this.getDashboardHeight() | |
} | |
return this._options.pixelOffset / b | |
}, | |
getDashboardHeight: function () { | |
return 892 | |
}, | |
isAppSection: function () { | |
return k.hasClassName(this._element, "app") | |
}, | |
scrolledWhileInView: function () { | |
if (document.viewport.getHeight() + window.scrollY >= Element.getHeight(document.body)) { | |
this.scrolledOutOfViewPastThreshold() | |
} | |
}, | |
scrolledIntoViewPastThreshold: function () { | |
this.__startTime = new Date().getTime() | |
}, | |
scrolledOutOfViewPastThreshold: function () { | |
var b = Math.pow(10, this._options.decimals); | |
var c = { | |
prop34: j.pageName() + " - " + this._options.id + " - section engaged", | |
prop35: Math.round((new Date().getTime() - this.__startTime) / (1000 / b)) / b | |
}; | |
if (c.prop35 >= this._options.minimumDuration) { | |
if (true === this._options.onlyTrackOnce && true === this.__hasTracked) { | |
return | |
} | |
j.trackClick(c, this, "o", c.prop34); | |
this.__hasTracked = true; | |
if (this._options.debug) { | |
try { | |
console.log(c.prop34 + ": " + c.prop35 + "s") | |
} catch (a) {} | |
} | |
} | |
}, | |
activate: function () { | |
var c; | |
var b; | |
if ("object" !== typeof this.__defaultOptions) { | |
this.__defaultOptions = {} | |
} | |
this._options = h.extend(h.clone(this.__defaultOptions), this._options); | |
if (true === this._options.debug) { | |
this._element.setStyle("outline:5px rgba(255,255,0,.5) dotted") | |
} | |
var a = this._showOnScroll = new i(this._element, { | |
threshold: this.determineThreshold() | |
}); | |
this._showOnScroll.setDelegate(this); | |
if (this.isAppSection()) { | |
b = this._element.offsetHeight; | |
c = this._showOnScroll.elementMetrics; | |
this._showOnScroll.elementMetrics = function () { | |
var d = c.apply(a, arguments); | |
if (d.height === b) { | |
d.height += this.getDashboardHeight() | |
} | |
return d | |
}.bind(this) | |
} | |
} | |
}; | |
return l | |
}); | |
AC.define("overview/parallax/ParallaxElement", ["require", "base/Element"], function (e) { | |
var f = e("base/Element"); | |
var d = function (a) { | |
a = a || {}; | |
this.options = a; | |
var c = f.getElementById(a.containerId); | |
this._element = f.select(a.element || ".parallax", c); | |
this._topPercent = void 0 === a.isTopPercent ? true : a.isTopPercent; | |
this._topPos = this._topPercent ? 0.01 * a.top : a.top; | |
this._cBounds = f.getBoundingBox(c); | |
var b = f.getBoundingBox(this._element); | |
this._diffHeight = this._cBounds.height - b.height; | |
this._triggerStart = 0; | |
this._triggerEnd = 0; | |
this._scale = 1 + a.z * -1 / 10; | |
this._distToMove = this._diffHeight / this._scale | |
}; | |
d.prototype = { | |
update: function (a) { | |
var b = a >= this._triggerStart ? Math.min(1, 1 - (this._triggerEnd - a) / this._diffHeight) : 0; | |
var c = "translate3d(0," + this._distToMove * b + "px,0)"; | |
f.setVendorPrefixStyle(this._element, "transform", c); | |
if ("function" === typeof this.options.onComplete && 1 === b) { | |
this.options.onComplete.call() | |
} | |
}, | |
resize: function (b) { | |
var a = this._topPercent ? b * this._topPos : this._topPos; | |
this._triggerStart = this._cBounds.top - a; | |
this._triggerEnd = this._triggerStart + this._diffHeight | |
} | |
}; | |
return d | |
}); | |
AC.define("overview/parallax/RafManager", ["require", "base/Element"], function (e) { | |
var d = e("base/Element"); | |
var f = function (c, b, a) { | |
var h = null; | |
d.addEventListener(c, b, function () { | |
if (null !== h) { | |
window.cancelAnimationFrame(h) | |
} | |
h = window.requestAnimationFrame(function () { | |
a.call(); | |
h = null | |
}) | |
}, true) | |
}; | |
return { | |
addEventListener: f | |
} | |
}); | |
AC.define("overview/parallax/ParallaxManager", ["require", "base/Element", "overview/parallax/ParallaxElement", "overview/parallax/RafManager"], function (g) { | |
var j = g("base/Element"); | |
var h = g("overview/parallax/ParallaxElement"); | |
var i = g("overview/parallax/RafManager"); | |
var f = function (e) { | |
var l = window.innerHeight; | |
var b = window.pageYOffset; | |
var c = []; | |
c.push(new h({ | |
containerId: "device-container", | |
element: ".device", | |
top: 50, | |
z: -20, | |
onComplete: function () { | |
c.shift(); | |
j.addClassName(j.getElementById("device-container"), "hide-springboard") | |
} | |
})); | |
c.push(new h({ | |
containerId: "maps-landscape", | |
element: ".landscape", | |
top: 158, | |
z: -100 | |
})); | |
c.push(new h({ | |
containerId: "phone-landscape", | |
element: ".landscape", | |
top: 158, | |
z: -100 | |
})); | |
c.push(new h({ | |
containerId: "music-landscape", | |
element: ".landscape", | |
top: 158, | |
z: -100 | |
})); | |
c.push(new h({ | |
containerId: "messages-landscape", | |
element: ".landscape", | |
top: 158, | |
z: -100 | |
})); | |
function d() { | |
b = window.pageYOffset; | |
var k = c.length; | |
while (k--) { | |
c[k].update(b) | |
} | |
} | |
function a() { | |
l = window.innerHeight; | |
var k = c.length; | |
while (k--) { | |
c[k].resize(l); | |
c[k].update(b) | |
} | |
} | |
i.addEventListener(window, "scroll", d); | |
i.addEventListener(window, "resize", a); | |
a() | |
}; | |
return f | |
}); | |
AC.define("overview/bootstrap", ["require", "base/Element", "base/Environment", "threeDTransformsAvailable", "overview/analytics/SectionEngagement", "overview/parallax/ParallaxManager"], function (h) { | |
var l = h("base/Element"); | |
var i = h("base/Environment"); | |
var k = h("threeDTransformsAvailable")(); | |
var m = h("overview/analytics/SectionEngagement"); | |
if (i.Feature.isDesktop() && k) { | |
l.addClassName(l.getElementById("main"), "can-parallax"); | |
var n = h("overview/parallax/ParallaxManager"); | |
var j = new n() | |
} | |
l.selectAll("#hero, #main > section").forEach(function (b) { | |
var a = new m(b, { | |
id: b.id | |
}); | |
a.activate() | |
}) | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment