Skip to content

Instantly share code, notes, and snippets.

@cwbeck
Last active December 8, 2015 10:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cwbeck/a4539b862c2fafa8e114 to your computer and use it in GitHub Desktop.
Save cwbeck/a4539b862c2fafa8e114 to your computer and use it in GitHub Desktop.
Liverail Ad Manager - Unmin.
/*
LiveRail.AdManager
release 2.2.8
build 201511261816
*/
! function(a, b) {
a.getVPAIDAd = b()
}(this, function() {
var requirejs, require, define;
! function(a) {
function b(a, b) {
return r.call(a, b)
}
function c(a, b) {
var c, d, e, f, g, h, i, j, k, l, m, n = b && b.split("/"),
o = p.map,
q = o && o["*"] || {};
if (a && "." === a.charAt(0))
if (b) {
for (n = n.slice(0, n.length - 1), a = a.split("/"), g = a.length - 1, p.nodeIdCompat && t.test(a[g]) && (a[g] = a[g].replace(t, "")), a = n.concat(a), k = 0; k < a.length; k += 1)
if (m = a[k], "." === m) a.splice(k, 1), k -= 1;
else if (".." === m) {
if (1 === k && (".." === a[2] || ".." === a[0])) break;
k > 0 && (a.splice(k - 1, 2), k -= 2)
}
a = a.join("/")
} else 0 === a.indexOf("./") && (a = a.substring(2));
if ((n || q) && o) {
for (c = a.split("/"), k = c.length; k > 0; k -= 1) {
if (d = c.slice(0, k).join("/"), n)
for (l = n.length; l > 0; l -= 1)
if (e = o[n.slice(0, l).join("/")], e && (e = e[d])) {
f = e, h = k;
break
}
if (f) break;
!i && q && q[d] && (i = q[d], j = k)
}!f && i && (f = i, h = j), f && (c.splice(0, h, f), a = c.join("/"))
}
return a
}
function d(b, c) {
return function() {
return k.apply(a, s.call(arguments, 0).concat([b, c]))
}
}
function e(a) {
return function(b) {
return c(b, a)
}
}
function f(a) {
return function(b) {
n[a] = b
}
}
function g(c) {
if (b(o, c)) {
var d = o[c];
delete o[c], q[c] = !0, j.apply(a, d)
}
if (!b(n, c) && !b(q, c)) throw new Error("No " + c);
return n[c]
}
function h(a) {
var b, c = a ? a.indexOf("!") : -1;
return c > -1 && (b = a.substring(0, c), a = a.substring(c + 1, a.length)), [b, a]
}
function i(a) {
return function() {
return p && p.config && p.config[a] || {}
}
}
var j, k, l, m, n = {},
o = {},
p = {},
q = {},
r = Object.prototype.hasOwnProperty,
s = [].slice,
t = /\.js$/;
l = function(a, b) {
var d, f = h(a),
i = f[0];
return a = f[1], i && (i = c(i, b), d = g(i)), i ? a = d && d.normalize ? d.normalize(a, e(b)) : c(a, b) : (a = c(a, b), f = h(a), i = f[0], a = f[1], i && (d = g(i))), {
f: i ? i + "!" + a : a,
n: a,
pr: i,
p: d
}
}, m = {
require: function(a) {
return d(a)
},
exports: function(a) {
var b = n[a];
return "undefined" != typeof b ? b : n[a] = {}
},
module: function(a) {
return {
id: a,
uri: "",
exports: n[a],
config: i(a)
}
}
}, j = function(c, e, h, i) {
var j, k, p, r, s, t, u = [],
v = typeof h;
if (i = i || c, "undefined" === v || "function" === v) {
for (e = !e.length && h.length ? ["require", "exports", "module"] : e, s = 0; s < e.length; s += 1)
if (r = l(e[s], i), k = r.f, "require" === k) u[s] = m.require(c);
else if ("exports" === k) u[s] = m.exports(c), t = !0;
else if ("module" === k) j = u[s] = m.module(c);
else if (b(n, k) || b(o, k) || b(q, k)) u[s] = g(k);
else {
if (!r.p) throw new Error(c + " missing " + k);
r.p.load(r.n, d(i, !0), f(k), {}), u[s] = n[k]
}
p = h ? h.apply(n[c], u) : void 0, c && (j && j.exports !== a && j.exports !== n[c] ? n[c] = j.exports : p === a && t || (n[c] = p))
} else c && (n[c] = h)
}, requirejs = require = k = function(b, c, d, e, f) {
if ("string" == typeof b) return m[b] ? m[b](c) : g(l(b, c).f);
if (!b.splice) {
if (p = b, p.deps && k(p.deps, p.callback), !c) return;
c.splice ? (b = c, c = d, d = null) : b = a
}
return c = c || function() {}, "function" == typeof d && (d = e, e = f), e ? j(a, b, c, d) : setTimeout(function() {
j(a, b, c, d)
}, 4), k
}, k.config = function(a) {
return k(a)
}, requirejs._defined = n, define = function(a, c, d) {
c.splice || (d = c, c = []), b(n, a) || b(o, a) || (o[a] = [a, c, d])
}, define.amd = {
jQuery: !0
}
}(), define("../../lib/almond", function() {}), define("Handshake", ["require", "exports"], function() {
var a;
return function(a) {
function b() {
var a, b, d, e = this;
if ("function" == typeof window.postMessage) {
for (("https:" === window.location.protocol || "http:" !== window.location.protocol && window.parent && "https:" === window.parent.location.protocol) && (b = !0), a = (b ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/js/handshake.html", h = "", d = 0; 50 > d; d += 1) h += Math.random().toString(36).substr(2, 5);
i = document.createElement("iframe"), i.style.display = "none", i.src = a, document.body.appendChild(i), i.onload = function() {
i.contentWindow && i.contentWindow.postMessage ? i.contentWindow.postMessage(h, a) : i && i.parentNode === document.body && document.body.removeChild(i)
}, window.addEventListener ? window.addEventListener("message", function(a) {
var b = a.origin,
d = a.data;
c.apply(e, [b, d])
}, !1) : window.attachEvent && window.attachEvent("onmessage", function(a) {
a || (a = window.event);
var b = a.origin,
d = a.data;
c.apply(e, [b, d])
})
}
}
function c(a, b) {
var c, e, f;
if (a.match(/^https?:\/\/cdn-static(-secure)?\.liverail\.com/) && b && "string" == typeof b && "lrHandshakeResponse=" === b.substr(0, 20)) {
for (c = b.substr(20), e = "", f = 0; f < c.length; f += 1) e += String.fromCharCode(c.charCodeAt(f) - h.charCodeAt(f));
i && i.parentNode === document.body && (document.body.removeChild(i), delete i), d(e.split("&"))
}
}
function d(b) {
var c, d;
for (a.handshakeResponse = {
debug: 0,
debugIdFilter: "",
inspector: !1
}, c = 0; c < b.length; c += 1) switch (d = b[c].split("="), d[0]) {
case "debug":
a.handshakeResponse.debug = parseInt(d[1], 10);
break;
case "debugIdFilter":
a.handshakeResponse.debugIdFilter = decodeURIComponent(d[1]);
break;
case "inspector":
a.handshakeResponse.inspector = "true" === d[1]
}
k = !0, e()
}
function e() {
var a;
for (a = 0; a < l.length; a += 1) l[a]();
l = []
}
function f(a) {
return "undefined" == typeof a && (a = window), a.location.href && "about:blank" !== a.location.href ? a : a.parent
}
function g(a) {
if ("undefined" == typeof a && (a = null), "function" == typeof a && l.push(a), k) e();
else if (!j) {
j = !0;
var c = f().location.href;
c.match(/^https?:\/\/[A-Za-z0-9.\-_]+\.liverail\.com/) ? d(document.cookie.split("; ")) : b()
}
}
a.handshakeResponse = {};
var h, i, j, k, l = [];
a.check = g
}(a || (a = {})), a
}), ! function() {
var a = function() {
var b = /d{1,4}|m{1,4}|yy(?:yy)?|([HhMsTt])\1?|[LloSZWN]|"[^"]*"|'[^']*'/g,
c = /\b(?:[PMCEA][SDP]T|(?:Pacific|Mountain|Central|Eastern|Atlantic) (?:Standard|Daylight|Prevailing) Time|(?:GMT|UTC)(?:[-+]\d{4})?)\b/g,
d = /[^-+\dA-Z]/g,
e = function(a, b) {
for (a = String(a), b = b || 2; a.length < b;) a = "0" + a;
return a
},
f = function(a) {
var b = new Date(a.getFullYear(), a.getMonth(), a.getDate());
b.setDate(b.getDate() - (b.getDay() + 6) % 7 + 3);
var c = new Date(b.getFullYear(), 0, 4);
c.setDate(c.getDate() - (c.getDay() + 6) % 7 + 3);
var d = b.getTimezoneOffset() - c.getTimezoneOffset();
b.setHours(b.getHours() - d);
var e = (b - c) / 6048e5;
return 1 + Math.floor(e)
},
g = function(a) {
var b = a.getDay();
return 0 === b && (b = 7), b
};
return function(h, i, j, k) {
var l = a;
if (1 != arguments.length || "[object String]" != Object.prototype.toString.call(h) || /\d/.test(h) || (i = h, h = void 0), h = h || new Date, h instanceof Date || (h = new Date(h)), isNaN(h)) throw TypeError("Invalid date");
i = String(l.masks[i] || i || l.masks["default"]);
var m = i.slice(0, 4);
("UTC:" == m || "GMT:" == m) && (i = i.slice(4), j = !0, "GMT:" == m && (k = !0));
var n = j ? "getUTC" : "get",
o = h[n + "Date"](),
p = h[n + "Day"](),
q = h[n + "Month"](),
r = h[n + "FullYear"](),
s = h[n + "Hours"](),
t = h[n + "Minutes"](),
u = h[n + "Seconds"](),
v = h[n + "Milliseconds"](),
w = j ? 0 : h.getTimezoneOffset(),
x = f(h),
y = g(h),
z = {
d: o,
dd: e(o),
ddd: l.i18n.dayNames[p],
dddd: l.i18n.dayNames[p + 7],
m: q + 1,
mm: e(q + 1),
mmm: l.i18n.monthNames[q],
mmmm: l.i18n.monthNames[q + 12],
yy: String(r).slice(2),
yyyy: r,
h: s % 12 || 12,
hh: e(s % 12 || 12),
H: s,
HH: e(s),
M: t,
MM: e(t),
s: u,
ss: e(u),
l: e(v, 3),
L: e(Math.round(v / 10)),
t: 12 > s ? "a" : "p",
tt: 12 > s ? "am" : "pm",
T: 12 > s ? "A" : "P",
TT: 12 > s ? "AM" : "PM",
Z: k ? "GMT" : j ? "UTC" : (String(h).match(c) || [""]).pop().replace(d, ""),
o: (w > 0 ? "-" : "+") + e(100 * Math.floor(Math.abs(w) / 60) + Math.abs(w) % 60, 4),
S: ["th", "st", "nd", "rd"][o % 10 > 3 ? 0 : (o % 100 - o % 10 != 10) * o % 10],
W: x,
N: y
};
return i.replace(b, function(a) {
return a in z ? z[a] : a.slice(1, a.length - 1)
})
}
}();
a.masks = {
"default": "ddd mmm dd yyyy HH:MM:ss",
shortDate: "m/d/yy",
mediumDate: "mmm d, yyyy",
longDate: "mmmm d, yyyy",
fullDate: "dddd, mmmm d, yyyy",
shortTime: "h:MM TT",
mediumTime: "h:MM:ss TT",
longTime: "h:MM:ss TT Z",
isoDate: "yyyy-mm-dd",
isoTime: "HH:MM:ss",
isoDateTime: "yyyy-mm-dd'T'HH:MM:ss",
isoUtcDateTime: "UTC:yyyy-mm-dd'T'HH:MM:ss'Z'",
expiresHeaderFormat: "ddd, dd mmm yyyy HH:MM:ss Z"
}, a.i18n = {
dayNames: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
monthNames: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", "January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"]
}, "undefined" != typeof exports ? module.exports = a : "undefined" != typeof define && define("DateFormat", [], function() {
return a
})
}(), define("MessageData", ["require", "exports"], function() {
var a = function() {
function a(a, b, c, d) {
this.timestamp = new Date, this.priority = a, this.method = b, this.contextName = c, this.args = d
}
return a
}();
return a
}), define("Logger", ["require", "exports", "Handshake", "DateFormat", "MessageData"], function(a, b, c, d, e) {
var f = function() {
function a(a) {
this.contextName = "", this.contextName = a || ""
}
return a.getDebugLevel = function() {
return null !== a.currentDebugLevelOverride ? a.currentDebugLevelOverride : c.handshakeResponse.debug
}, a.setDebugLevelOverride = function(b) {
a.currentDebugLevelOverride = Math.max(0, Math.min(3, b))
}, a.clearDebugLevelOverride = function() {
a.currentDebugLevelOverride = null
}, a.getDebugIdFilter = function() {
return c.handshakeResponse.debugIdFilter
}, a.dormant = function() {
return "object" != typeof console ? !0 : Function && Function.prototype && Function.prototype.bind ? !1 : !0
}, a.handleMessage = function(b) {
return a.dormant() || 0 === a.getDebugLevel() ? void 0 : void 0 === a.getDebugLevel() ? (a.messageQueue.push(b), void(a.handshakeInitiated || (a.handshakeInitiated = !0, c.check(a.flushMessageQueue)))) : void a.outputMessage(b)
}, a.flushMessageQueue = function() {
for (a.getDebugLevel() > 0 && a.getDebugIdFilter() && console.warn('Debug ID Filter set to "' + a.getDebugIdFilter() + '"'); a.messageQueue.length > 0;) a.outputMessage(a.messageQueue.shift())
}, a.outputMessage = function(b) {
if (!(b.priority > a.getDebugLevel()) && b.contextName.match(new RegExp(a.getDebugIdFilter()))) {
var c = "LIVERAIL [" + d(b.timestamp, "HH:MM:ss.l") + "]";
b.contextName && (c += "[" + b.contextName + "]");
var e = [c].concat(b.args);
Function.prototype.bind.call(b.method, console).apply(this, e)
}
}, a.prototype.log = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.log, this.contextName, b))
}, a.prototype.info = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.info, this.contextName, b))
}, a.prototype.warn = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.warn, this.contextName, b))
}, a.prototype.error = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(1, console.error, this.contextName, b))
}, a.prototype.debug = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(2, console.log, this.contextName, b))
}, a.prototype.verbose = function() {
for (var b = [], c = 0; c < arguments.length - 0; c++) b[c] = arguments[c + 0];
a.dormant() || a.handleMessage(new e(3, console.log, this.contextName, b))
}, a.currentDebugLevelOverride = null, a.messageQueue = [], a
}();
return f
}), define("Utils", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.returnString = function(a, b) {
var c = b || "",
d = "" + a;
return "undefined" !== d && "null" !== d && "NaN" !== d && (c = d), c
}, a.returnFloat = function(a, b) {
var c = void 0 !== b ? b : NaN,
d = parseFloat(a);
return isNaN(d) || (c = d), c
}, a.returnInt = function(a, b) {
var c = void 0 !== b ? b : NaN,
d = parseInt(a, 10);
return isNaN(d) || (c = d), c
}, a.returnUnsignedInt = function(a, b) {
return Math.max(this.returnInt(a, b), 0)
}, a.returnBoolean = function(a, b) {
var c = b || !1;
return "boolean" == typeof a && (c = a), null === a && (c = !1), void 0 !== a && "string" != typeof a && (a = a.toString().toLowerCase()), ("true" === a || "1" === a || "yes" === a) && (c = !0), ("false" === a || "0" === a || "no" === a) && (c = !1), c
}, a.serialize = function(a) {
var b, c, d = [];
for (b in a)
if (a.hasOwnProperty(b))
if (Array.isArray(a[b]))
for (c = 0; c < a[b].length; c += 1) d.push(encodeURIComponent(b) + "[]=" + encodeURIComponent(a[b][c]));
else d.push(encodeURIComponent(b) + "=" + encodeURIComponent(a[b]));
return d.join("&")
}, a.retrieveCallingURL = function(a) {
for (var b = "", c = document.getElementsByTagName("script"), d = 0; d < c.length; d += 1)
if (-1 !== c[d].src.indexOf(a)) {
b = c[d].src;
break
}
return b
}, a.parseQueryString = function(a) {
var b, c, d = {},
e = a;
e.indexOf("?") > 0 && (e = e.slice(e.indexOf("?") + 1)), b = e.split("&");
for (var f = 0; f < b.length; f += 1)
if (b[f].length > 0 && (c = b[f].split("="), c[0] !== a && c[0].length > 0))
if (1 === c.length) d[c[0]] = null;
else if (2 === c.length) d[c[0]] = decodeURIComponent(c[1]);
else {
d[c[0]] = "";
for (var g = 1; g < c.length; g += 1) d[c[0]] += decodeURIComponent(c[g]), g < c.length - 1 && (d[c[0]] += "=")
}
return d
}, a.detectFlash = function() {
var a, b, c = !1;
try {
if (window.navigator && window.navigator.plugins && window.navigator.plugins.length > 0) window.navigator.mimeTypes && (a = window.navigator.mimeTypes["application/x-shockwave-flash"], a && a.enabledPlugin && a.enabledPlugin.description && (c = !0));
else if (void 0 !== ActiveXObject) {
try {
b = new ActiveXObject("ShockwaveFlash.ShockwaveFlash")
} catch (d) {
b = {
activeXError: !0
}
}
b.activeXError || (c = !0)
}
} catch (e) {}
return c
}, a.detectHTML5 = function() {
return !!document.createElement("video").canPlayType
}, a.stringifyParameterObject = function(a) {
var b, c = 0,
d = "";
for (b in a) a.hasOwnProperty(b) && (c > 0 && (d += "&"), d += encodeURIComponent(b) + "=" + encodeURIComponent(a[b]), c += 1);
return d
}, a.base64encode = function(a) {
if (btoa) return btoa(a);
var b, c, d, e, f, g, h;
for (b = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", e = a.length, d = 0, c = ""; e > d;) {
if (f = 255 & a.charCodeAt(d++), d === e) {
c += b.charAt(f >> 2), c += b.charAt((3 & f) << 4), c += "==";
break
}
if (g = a.charCodeAt(d++), d === e) {
c += b.charAt(f >> 2), c += b.charAt((3 & f) << 4 | (240 & g) >> 4), c += b.charAt((15 & g) << 2), c += "=";
break
}
h = a.charCodeAt(d++), c += b.charAt(f >> 2), c += b.charAt((3 & f) << 4 | (240 & g) >> 4), c += b.charAt((15 & g) << 2 | (192 & h) >> 6), c += b.charAt(63 & h)
}
return c
}, a.detectDevice = function(a) {
var b = 0;
try {
var c = navigator.userAgent.toLowerCase();
switch (a) {
case "android":
c.indexOf("android") > -1 && (b = parseFloat(c.match(/android ([\.0-9]+)/)[1]));
break;
case "msie":
c.indexOf("msie") > -1 && (b = parseFloat(c.match(/msie ([\.0-9]+)/)[1]));
break;
case "ios":
c.match(/(iphone|ipod|ipad)/) && (b = parseFloat(c.match(/os ([0-9]+(_[0-9]+)?)/)[1].replace("_", ".")));
break;
case "phone":
c.match(/(iphone|ipod)/) && (b = parseFloat(c.match(/os ([0-9]+(_[0-9]+)?)/)[1].replace("_", ".")))
}
} catch (d) {}
return b
}, a.isFunction = function(a) {
return !!(a && a.constructor && a.call && a.apply)
}, a.genUniqueId = function() {
var a, b, c = window.performance,
d = ["now", "webkitNow", "msNow", "mozNow"];
if (c)
for (var e = 0; e < d.length; e += 1)
if (c[d[e]]) {
b = d[e];
break
}
return b && (a = function() {
return c[b]()
}), (a = a || Date.now || function() {
return (new Date).getTime()
})()
}, a.checkWindowSanity = function() {
return window && window.parent && !!Object
}, a.addElement = function(a) {
var b, c, d, e, f;
if (c = a.target, e = a.before, void 0 === c && (c = document.body), "string" == typeof c && (c = document.getElementById(a.target)), "string" == typeof e && (e = document.getElementById(a.before)), "object" == typeof c) {
if (d = "div", "string" == typeof a.type && (d = a.type), b = document.createElement(d), "string" == typeof a.html && (b.innerHTML = a.html), "object" == typeof a.attributes)
for (f in a.attributes) a.attributes.hasOwnProperty(f) && b.setAttribute(f, a.attributes[f]);
if ("object" == typeof a.events)
for (f in a.events) a.events.hasOwnProperty(f) && b.addEventListener(f, a.events[f]);
if ("function" == typeof a.onload && (b.onload = a.onload), "string" == typeof a.className && (b.className = a.className), "object" == typeof a.styles)
for (f in a.styles) a.styles.hasOwnProperty(f) && b.style.setProperty && b.style.setProperty(f, a.styles[f], "important");
return "object" == typeof e ? c.insertBefore(b, e) : c.appendChild(b), b
}
return null
}, a.videoElementIsFullscreen = function(a) {
var b = a;
if (b.fullscreenEnabled || b.fullScreen || b.webkitIsFullScreen || b.mozFullScreen || b.msFullscreenEnabled) {
var c = b.fullscreenElement || b.webkitFullscreenElement || b.mozFullScreenElement || b.msFullscreenElement;
if (c && "video" === c.tagName.toLowerCase()) return !0
}
return !1
}, a.addDocumentFullscreenEventListener = function(a, b, c) {
"undefined" == typeof c && (c = !1), a.addEventListener("fullscreenchange", b, c), a.addEventListener("webkitfullscreenchange", b, c), a.addEventListener("mozfullscreenchange", b, c), a.addEventListener("MSFullscreenChange", b, c)
}, a.removeDocumentFullscreenEventListener = function(a, b, c) {
"undefined" == typeof c && (c = !1), a.removeEventListener("fullscreenchange", b, c), a.removeEventListener("webkitfullscreenchange", b, c), a.removeEventListener("mozfullscreenchange", b, c), a.removeEventListener("MSFullscreenChange", b, c)
}, a
}();
return c
}), define("InstanceData", ["require", "exports", "Utils"], function(a, b, c) {
var d = function() {
function a() {
this.defaultAdLinear = !0, this.disableIframes = !1, this.debugLevel = null, this.processInstanceData()
}
return a.prototype.getCallingURL = function() {
return this.callingURL
}, a.prototype.getQueryStringParameters = function() {
return this.queryStringParameters
}, a.prototype.getDefaultAdLinear = function() {
return this.defaultAdLinear
}, a.prototype.getDisableIframes = function() {
return this.disableIframes
}, a.prototype.getDebugLevel = function() {
return this.debugLevel
}, a.prototype.processInstanceData = function() {
this.callingURL = c.retrieveCallingURL("LiveRail.AdManager"), this.queryStringParameters = c.parseQueryString(this.callingURL);
for (var a in this.queryStringParameters)
if (this.queryStringParameters.hasOwnProperty(a)) {
var b = this.queryStringParameters[a];
switch (a.toUpperCase()) {
case "DISABLEIFRAMES":
this.disableIframes = c.returnBoolean(b, this.disableIframes);
break;
case "LR_DEBUG":
var d = c.returnUnsignedInt(b);
isNaN(d) || (this.debugLevel = d);
break;
case "ADLINEAR":
this.defaultAdLinear = c.returnBoolean(b, this.defaultAdLinear)
}
}
}, a
}();
return d
}), define("EventSubscription", ["require", "exports"], function() {
var a = function() {
function a(a, b) {
this.fn = a, this.listenerScope = b
}
return a
}();
return a
}), define("EventManager", ["require", "exports", "EventSubscription"], function(a, b, c) {
var d = function() {
function a(a) {
var b = this;
this.eventHandlerStore = {}, this.handlerDictionary = {}, this.eventDictionary = {}, this.onEventListenerObjectPropertyChange = function(a) {
b.validateEvent(a.propertyName) && b.handlerDictionary.hasOwnProperty(a.propertyName) && b.handlerDictionary[a.propertyName].apply(b.listenerScope, b.args)
}, this.validEvents = a, this.eventListenerObject = document.createElement("div"), this.eventListenerObject.addEventListener || (this.eventListenerObject.style.display = "none", this.eventListenerObject.attachEvent("onpropertychange", this.onEventListenerObjectPropertyChange), document.body.appendChild(this.eventListenerObject))
}
return a.prototype.subscribe = function(b, d, e) {
!this.validateEvent(d) || "function" != typeof b || "object" != typeof e && void 0 !== e || (this.eventDictionary.hasOwnProperty(d) || (this.eventDictionary[d] = this.createCustomEvent(d)), this.eventHandlerStore.hasOwnProperty(d) || (this.eventHandlerStore[d] = []), -1 === a.findSubscriptionIndex(b, this.eventHandlerStore[d]) && this.eventHandlerStore[d].push(new c(b, e)))
}, a.prototype.unsubscribe = function(b, c) {
if (this.validateEvent(c) && this.eventHandlerStore.hasOwnProperty(c)) {
var d = a.findSubscriptionIndex(b, this.eventHandlerStore[c]);
d >= 0 && this.eventHandlerStore[c].splice(d, 1)
}
}, a.prototype.dispatch = function(a, b) {
if ("undefined" == typeof b && (b = []), this.validateEvent(a) && this.eventHandlerStore.hasOwnProperty(a))
for (var c = 0; c < this.eventHandlerStore[a].length; c++) this.eventHandlerStore[a][c], this.dispatchSubscription(a, this.eventHandlerStore[a][c], b)
}, a.prototype.createCustomEvent = function(a) {
var b = this;
if (this.eventListenerObject.addEventListener) {
this.eventListenerObject.addEventListener(a, function() {
b.handlerDictionary[a].apply(b.listenerScope, b.args)
}, !1);
var c = document.createEvent("UIEvents");
c.initEvent(a, !1, !1)
} else this.eventListenerObject.attachEvent && (this.eventListenerObject[a] = 0);
return c
}, a.prototype.validateEvent = function(a) {
return "string" == typeof a && (!this.validEvents || this.validEvents.hasOwnProperty(a))
}, a.findSubscriptionIndex = function(a, b) {
for (var c = -1, d = 0; d < b.length; d += 1)
if (b[d].fn === a) {
c = d;
break
}
return c
}, a.prototype.dispatchSubscription = function(a, b, c) {
this.handlerDictionary[a] = b.fn, this.listenerScope = b.listenerScope || {}, this.args = c, this.eventListenerObject.addEventListener ? this.eventListenerObject.dispatchEvent(this.eventDictionary[a]) : this.eventListenerObject.attachEvent && (this.eventListenerObject[a] += 1)
}, a
}();
return d
}), define("VPAIDEvents", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.AdLoaded = "AdLoaded", a.AdStarted = "AdStarted", a.AdStopped = "AdStopped", a.AdSkipped = "AdSkipped", a.AdSkippableStateChange = "AdSkippableStateChange", a.AdSizeChange = "AdSizeChange", a.AdLinearChange = "AdLinearChange", a.AdDurationChange = "AdDurationChange", a.AdExpandedChange = "AdExpandedChange", a.AdVolumeChange = "AdVolumeChange", a.AdImpression = "AdImpression", a.AdVideoStart = "AdVideoStart", a.AdVideoFirstQuartile = "AdVideoFirstQuartile", a.AdVideoMidpoint = "AdVideoMidpoint", a.AdVideoThirdQuartile = "AdVideoThirdQuartile", a.AdVideoComplete = "AdVideoComplete", a.AdClickThru = "AdClickThru", a.AdInteraction = "AdInteraction", a.AdUserAcceptInvitation = "AdUserAcceptInvitation", a.AdUserMinimize = "AdUserMinimize", a.AdUserClose = "AdUserClose", a.AdPaused = "AdPaused", a.AdPlaying = "AdPlaying", a.AdLog = "AdLog", a.AdError = "AdError", a
}();
return c
}), define("Adapter", ["require", "exports", "EventManager", "Logger", "VPAIDEvents"], function(a, b, c, d, e) {
var f = function() {
function a(a, b) {
this.adapterConfiguration = null, this.eventManager = new c(e), this.adLinear = !0, this.logger = new d(a), this.destroy(), b && b(this)
}
return a.prototype.getAdLinear = function() {
return this.adLinear
}, a.prototype.getAdWidth = function() {
return this.adWidth
}, a.prototype.getAdHeight = function() {
return this.adHeight
}, a.prototype.getAdExpanded = function() {
return this.adExpanded
}, a.prototype.getAdSkippableState = function() {
return !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return -2
}, a.prototype.getAdRemainingTime = function() {
return -2
}, a.prototype.getAdDuration = function() {
return this.adDuration
}, a.prototype.getAdVolume = function() {
return this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.adVolume = a, this.onAdVolumeChange()
}, a.prototype.getAdCompanions = function() {
return this.adCompanions
}, a.prototype.getAdIcons = function() {
return this.adIcons
}, a.prototype.isPaused = function() {
return !1
}, a.prototype.getAdapterConfiguration = function() {
return this.adapterConfiguration
}, a.prototype.handshakeVersion = function(a) {
return a
}, a.prototype.initAd = function(a, b, c, d, e, f) {
this.adapterConfiguration = f.adapterConfiguration
}, a.prototype.resizeAd = function(a, b, c) {}, a.prototype.startAd = function() {}, a.prototype.stopAd = function() {}, a.prototype.pauseAd = function() {}, a.prototype.resumeAd = function() {}, a.prototype.expandAd = function() {}, a.prototype.collapseAd = function() {}, a.prototype.skipAd = function() {}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.onAdLoaded = function() {
this.onEvent(e.AdLoaded)
}, a.prototype.onAdStarted = function() {
this.onEvent(e.AdStarted)
}, a.prototype.onAdStopped = function() {
this.destroy(), this.onEvent(e.AdStopped)
}, a.prototype.onAdSkipped = function() {
this.onEvent(e.AdSkipped)
}, a.prototype.onAdSkippableStateChange = function() {
this.onEvent(e.AdSkippableStateChange)
}, a.prototype.onAdSizeChange = function() {
this.onEvent(e.AdSizeChange)
}, a.prototype.onAdLinearChange = function() {
this.onEvent(e.AdLinearChange)
}, a.prototype.onAdDurationChange = function() {
this.onEvent(e.AdDurationChange)
}, a.prototype.onAdExpandedChange = function() {
this.onEvent(e.AdExpandedChange)
}, a.prototype.onAdVolumeChange = function() {
this.onEvent(e.AdVolumeChange)
}, a.prototype.onAdImpression = function() {
this.onEvent(e.AdImpression)
}, a.prototype.onAdVideoStart = function() {
this.onEvent(e.AdVideoStart)
}, a.prototype.onAdVideoFirstQuartile = function() {
this.onEvent(e.AdVideoFirstQuartile)
}, a.prototype.onAdVideoMidpoint = function() {
this.onEvent(e.AdVideoMidpoint)
}, a.prototype.onAdVideoThirdQuartile = function() {
this.onEvent(e.AdVideoThirdQuartile)
}, a.prototype.onAdVideoComplete = function() {
this.onEvent(e.AdVideoComplete)
}, a.prototype.onAdClickThru = function(a, b, c) {
this.onEvent(e.AdClickThru, [a, b, c])
}, a.prototype.onAdInteraction = function() {
this.onEvent(e.AdInteraction)
}, a.prototype.onAdUserAcceptInvitation = function() {
this.onEvent(e.AdUserAcceptInvitation)
}, a.prototype.onAdUserMinimize = function() {
this.onEvent(e.AdUserMinimize)
}, a.prototype.onAdUserClose = function() {
this.onEvent(e.AdUserClose)
}, a.prototype.onAdPaused = function() {
this.onEvent(e.AdPaused)
}, a.prototype.onAdPlaying = function() {
this.onEvent(e.AdPlaying)
}, a.prototype.onAdLog = function(a) {
this.onEvent(e.AdLog, [a])
}, a.prototype.onAdError = function(a, b) {
"undefined" == typeof b && (b = {}), this.destroy(), this.onEvent(e.AdError, [a, b])
}, a.prototype.onEvent = function(a, b) {
"undefined" == typeof b && (b = []), this.eventManager.dispatch(a, b)
}, a.prototype.destroy = function() {
this.adWidth = 0, this.adHeight = 0, this.adExpanded = !1, this.adDuration = -2, this.adVolume = 1, this.adCompanions = "", this.adIcons = !1
}, a.prototype.supports = function(a) {
return !1
}, a
}();
return f
}), define("Tracker", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b) {
this.urls = [], this.type = a;
var c = parseFloat(b);
isNaN(c) || (this.value = c)
}
return a.formTrackerKey = function(a, b) {
return a + ("number" == typeof b ? b.toString() : "")
}, a.prototype.getType = function() {
return this.type
}, a.prototype.getValue = function() {
return this.value
}, a.prototype.addUrl = function(a) {
a && this.urls.push(a)
}, a.prototype.getUrls = function() {
return this.urls
}, a
}();
return c
}), define("AdCandidate", ["require", "exports", "Tracker"], function(a, b, c) {
var d = function() {
function a() {
this.clickThruUrl = "", this.impressionRegistered = !1, this.linearCreative = null, this.nonLinearCreative = null, this.thirdPartyData = {}, this.trackers = {}, this.companionAds = [], this.adExtensions = [], this.loadTime = 0, this.startTime = 0, this.stopTime = 0, this.maxCreativeDuration = 0
}
return a.prototype.hasValidClickthruUrl = function() {
return this.clickThruUrl.trim().length > 0
}, a.prototype.getLinearCreative = function() {
return this.linearCreative
}, a.prototype.setLinearCreative = function(a) {
this.linearCreative = a
}, a.prototype.getNonLinearCreative = function() {
return this.nonLinearCreative
}, a.prototype.setNonLinearCreative = function(a) {
this.nonLinearCreative = a
}, a.prototype.getThirdPartyData = function(a) {
return this.thirdPartyData[a]
}, a.prototype.setThirdPartyData = function(a, b) {
this.thirdPartyData[a] = b
}, a.prototype.addTracker = function(a) {
if (null !== a) {
var b = c.formTrackerKey(a.getType(), a.getValue());
this.trackers[b] || (this.trackers[b] = []), this.trackers[b].push(a)
}
}, a.prototype.getTrackers = function(a, b) {
var d = c.formTrackerKey(a, b);
return this.trackers[d] || []
}, a.prototype.addCompanionAd = function(a) {
this.companionAds.push(a)
}, a.prototype.getCompanionAds = function() {
return this.companionAds
}, a.prototype.addAdExtension = function(a) {
this.adExtensions.push(a)
}, a.prototype.getAdExtensions = function() {
return this.adExtensions
}, a.prototype.registerLoad = function() {
0 === this.loadTime && (this.loadTime = Date.now())
}, a.prototype.getLoadClock = function() {
return this.loadTime > 0 ? Date.now() - this.loadTime : 0
}, a.prototype.registerImpression = function() {
0 === this.startTime && (this.startTime = Date.now()), this.impressionRegistered = !0
}, a.prototype.hadImpression = function() {
return this.impressionRegistered
}, a.prototype.registerComplete = function() {
this.hadImpression() && 0 === this.stopTime && (this.stopTime = Date.now())
}, a.prototype.updateCreativeDuration = function(a) {
a > this.maxCreativeDuration && (this.maxCreativeDuration = a)
}, a.prototype.getDuration = function() {
var a = 0;
return this.hadImpression() && (a = this.maxCreativeDuration ? this.maxCreativeDuration : this.linearCreative ? this.linearCreative.getDuration() : this.getElapsedRealtime()), Math.max(0, a)
}, a.prototype.getElapsedRealtime = function() {
return Math.max(0, this.stopTime - this.startTime)
}, a.TYPE_LINEAR = "in", a.TYPE_OVERLAY = "ov", a
}();
return d
}), define("RendererEvents", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.Loaded = "Loaded", a.Impression = "Impression", a.Error = "Error", a
}();
return c
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LinearRendererEvents", ["require", "exports", "RendererEvents"], function(a, b, c) {
var d = function(a) {
function b() {
a.apply(this, arguments)
}
return __extends(b, a), b.Progress = "Progress", b.Ended = "Ended", b.Paused = "Paused", b.Resumed = "Resumed", b.VolumeChange = "VolumeChange", b
}(c);
return d
}), define("LogEvent", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b, c) {
"undefined" == typeof c && (c = {}), this.id = a, this.message = b, this.detail = c || {}
}
return a.eventWithType = function(b, c, d) {
return "undefined" == typeof c && (c = {}), "undefined" == typeof d && (d = null), new a(b.id, d || b.message, c)
}, a.prototype.description = function() {
var a = this,
b = "";
return Object.keys(this.detail).forEach(function(c) {
b += 0 === b.length ? " " : " ,", b += c + "=" + a.detail[c]
}), "(" + this.id + ") " + this.message + b
}, a
}();
return c
}), define("LogEventType", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.CreativeGeneralError = {
id: 400,
message: "General creative error"
}, a.CreativeFileNotFound = {
id: 401,
message: "Creative file not found"
}, a.CreativeFileTimeout = {
id: 402,
message: "Creative timed out"
}, a.CreativeFileUnsupported = {
id: 405,
message: "Problem displaying creative file"
}, a.CreativeComponentError = {
id: 901,
message: "Ad component emitted error event"
}, a.NoFill = {
id: 1001,
message: "No fill"
}, a.InvalidPlacement = {
id: 1003,
message: "Ad was loaded with no valid placement defined"
}, a.NoAvailableEnvironment = {
id: 1020,
message: "No available environment"
}, a.StartAdBeforeInitAd = {
id: 1021,
message: "initAd must be called before startAd"
}, a.InvalidSlotElement = {
id: 1022,
message: "environmentVars.slot is not a valid DOM element"
}, a.InvalidVideoElement = {
id: 1023,
message: "No valid video element"
}, a.UnsupportedDevice = {
id: 1024,
message: "Unsupported device"
}, a.UndefinedEnvironmentVars = {
id: 1025,
message: "environmentVars is not defined"
}, a.AdSourcesRequestFailed = {
id: 1101,
message: "LiveRail request for ad-sources failed"
}, a.AdSourcesRequestTimeout = {
id: 1102,
message: "LiveRail request for ad-sources timed out"
}, a.AdsRequestFailed = {
id: 1111,
message: "LiveRail request for ads failed"
}, a.AdsRequestTimeout = {
id: 1112,
message: "LiveRail request for ads timed out"
}, a.XMLParseFailure = {
id: 1201,
message: "Failed to parse LiveRail XML response"
}, a.XMLUnknownResponse = {
id: 1202,
message: "Unknown LiveRail XML response type"
}, a.XMLErrorMessage = {
id: 1203,
message: "LiveRail XML Error message"
}, a.XMLDuplicateSources = {
id: 1204,
message: "Second LiveRail XML contains sources"
}, a.NoAdSources = {
id: 1301,
message: "LiveRail returned no ad sources"
}, a.NoAdSlots = {
id: 1302,
message: "No ad-slots available"
}, a.AdapterMising = {
id: 2901,
message: "Adapter class not found"
}, a.AdCandidateStarted = {
id: 9001,
message: "Ad candidate started"
}, a.AdImpression = {
id: 9002,
message: "Creative AdImpression"
}, a.AdClickThrough = {
id: 9003,
message: "Creative AdClickThrough"
}, a.AdLoaded = {
id: 9004,
message: "Creative AdLoaded"
}, a.AdClickThroughFailed = {
id: 9910,
message: "Creative AdClickThrough failed"
}, a.MRCViewable = {
id: 9933,
message: "Ad placement met MRC viewable requirements"
}, a.FBViewable = {
id: 9934,
message: "Ad placement met FB viewable requirements"
}, a.ViewThrough = {
id: 9935,
message: "Ad placement met view through requirements"
}, a
}();
return c
}), define("Renderer", ["require", "exports", "EventManager", "RendererEvents"], function(a, b, c, d) {
var e = function() {
function a(a) {
this._adAsset = null, this._bgColor = a.getAdParameters().bgcolor, this._eventManager = new c, this._slot = a.slot, this._slotWindow = a.slotWindow
}
return a.prototype.destroy = function() {}, a.prototype.load = function(a) {
this._adAsset = a
}, a.prototype.start = function() {}, a.prototype.stop = function() {}, a.prototype.getAsset = function() {
return this._adAsset
}, a.prototype.getWidth = function() {
return 0
}, a.prototype.getHeight = function() {
return 0
}, a.prototype.impressionOccured = function() {
return !1
}, a.prototype.subscribe = function(a, b, c) {
this._eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this._eventManager.unsubscribe(a, b)
}, a.prototype.dispatchRendererLoaded = function() {
this._eventManager.dispatch(d.Loaded)
}, a.prototype.dispatchRendererImpression = function() {
this._eventManager.dispatch(d.Impression)
}, a.prototype.dispatchRendererError = function(a) {
this._eventManager.dispatch(d.Error, [a])
}, a
}();
return e
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LinearRenderer", ["require", "exports", "LinearRendererEvents", "Renderer"], function(a, b, c, d) {
var e = function(a) {
function b(b) {
a.call(this, b), this._videoSlot = b.videoSlot
}
return __extends(b, a), b.prototype.pause = function() {}, b.prototype.resume = function() {}, b.prototype.getCurrentTime = function() {
return -2
}, b.prototype.getDuration = function() {
return -2
}, b.prototype.getVolume = function() {
return -2
}, b.prototype.setVolume = function(a) {}, b.prototype.isPaused = function() {
return !1
}, b.prototype.isSeeking = function() {
return !1
}, b.prototype.dispatchRendererProgress = function() {
this._eventManager.dispatch(c.Progress)
}, b.prototype.dispatchRendererPaused = function() {
this._eventManager.dispatch(c.Paused)
}, b.prototype.dispatchRendererResumed = function() {
this._eventManager.dispatch(c.Resumed)
}, b.prototype.dispatchRendererEnded = function() {
this._eventManager.dispatch(c.Ended)
}, b.prototype.dispatchVolumeChange = function() {
this._eventManager.dispatch(c.VolumeChange)
}, b
}(d);
return e
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LRLinearFlashRenderer", ["require", "exports", "LinearRenderer", "LogEvent", "Logger"], function(a, b, c, d, e) {
var f = function(a) {
function b() {
a.apply(this, arguments);
var b = this;
this.logger = new e("LRLinearFlashRenderer"), this._impressionOccurred = !1, this._paused = !1, this._progressMonitorInterval = null, this._volume = 1, this.onProgress = function() {
b.dispatchRendererProgress()
}
}
return __extends(b, a), b.prototype.destroy = function() {
this.stopProgressMonitor(), this.unloadFlashVPAID()
}, b.prototype.load = function(b) {
a.prototype.load.call(this, b), this.logger.log("load(", b, ")"), this.loadFlashPlayer()
}, b.prototype.start = function() {
this.logger.log("start()"), this._flashPlayer && (this._flashPlayer.setVolume(this._volume), this._flashPlayer.start())
}, b.prototype.stop = function() {
this.logger.log("stop()"), this._flashPlayer && this._flashPlayer.stop()
}, b.prototype.pause = function() {
this.logger.log("pause()"), this._flashPlayer && this._flashPlayer.pause()
}, b.prototype.resume = function() {
this.logger.log("resume()"), this._flashPlayer && this._flashPlayer.resume()
}, b.prototype.getWidth = function() {
return this._flashPlayer ? this._flashPlayer.offsetWidth : 0
}, b.prototype.getHeight = function() {
return this._flashPlayer ? this._flashPlayer.offsetHeight : 0
}, b.prototype.getCurrentTime = function() {
return this._flashPlayer ? this._flashPlayer.getCurrentTime() : -2
}, b.prototype.getDuration = function() {
return this._flashPlayer ? this._flashPlayer.getDuration() : -2
}, b.prototype.getVolume = function() {
return this._volume
}, b.prototype.setVolume = function(a) {
this._volume = a, this._flashPlayer && this._flashPlayer.setVolume(this._volume), this.dispatchVolumeChange()
}, b.prototype.isPaused = function() {
return this._paused
}, b.prototype.isSeeking = function() {
return !1
}, b.prototype.impressionOccured = function() {
return this._impressionOccurred
}, b.prototype.dispatchRendererEnded = function() {
a.prototype.dispatchRendererEnded.call(this)
}, b.prototype.dispatchRendererError = function(b) {
a.prototype.dispatchRendererError.call(this, b)
}, b.prototype.unloadFlashVPAID = function() {
this._slot && this._flashContainer && (this._slot.removeChild(this._flashContainer), this.logger.log("Unloaded Flash player"), void 0 !== this._targetSlotOriginalStylePosition && (this.logger.log("Resetting slot element position to " + this._targetSlotOriginalStylePosition), this._slot.style.setProperty("position", this._targetSlotOriginalStylePosition, this._targetSlotOriginalPriorityPosition)), this._flashPlayer = null, this._flashContainer = null)
}, b.prototype.loadFlashPlayer = function() {
var a, c, e, f, g = this,
h = "",
i = {
onReady: function() {
return g.logger.log("Flash player dispatched Ready event"), g.logger.log("Calling load on Flash player with url:", g._adAsset.getUrl()), g._flashPlayer.load(g._adAsset.getUrl()), !0
},
onLoaded: function() {
return g.logger.log("Flash player dispatched Loaded event"), g.dispatchRendererLoaded(), !0
},
onImpression: function() {
return g.logger.log("Flash player dispatched Impression event"), g._impressionOccurred = !0, g.startProgressMonitor(), g.dispatchRendererImpression(), !0
},
onEnded: function() {
return g.logger.log("Flash player dispatched Ended event"), g.destroy(), g.dispatchRendererEnded(), !0
},
onError: function(a, b) {
return g.logger.error("Flash player dispatched Error event, id=" + a, "message=" + b), g.destroy(), g.dispatchRendererError(new d(a, b)), !0
},
onPaused: function() {
return g.logger.log("Flash player dispatched Paused event"), g._paused === !1 && (g._paused = !0, g.dispatchRendererPaused()), !0
},
onResumed: function() {
return g.logger.log("Flash player dispatched Resumed event"), g._paused === !0 && (g._paused = !1, g.dispatchRendererResumed()), !0
}
};
this._slotWindow.LiveRail || (this._slotWindow.LiveRail = {}), this._slotWindow.LiveRail.FlashPlayerListeners || (this._slotWindow.LiveRail.FlashPlayerListeners = {}), b.instanceCount += 1, c = "LiveRail.FlashPlayerListeners.FlashBridge_" + b.instanceCount, e = ("https:" === this._slotWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/swf/v4/flv-renderer.swf", a = "jscontext=" + c, h += '<object style="display: block; width: 100%; height: 100%;"', navigator.userAgent.match(/MSIE/i) ? (h += ' id="' + c + '"', h += ' name="' + c + '"', h += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">', h += '<param name="movie" value="' + e + '" />') : (h += ' data="' + e + '"', h += ' type="application/x-shockwave-flash">'), h += '<param name="quality" value="high" />', h += '<param name="allowfullscreen" value="true" />', h += '<param name="allowscriptaccess" value="always" />', h += '<param name="flashvars" value="' + a + '" />', h += '<param name="bgcolor" value="#000000" />', h += '<param name="wmode" value="opaque" />', h += "</object>", this._slotWindow.LiveRail.FlashPlayerListeners["FlashBridge_" + b.instanceCount] = i, this._flashContainer = this._slotWindow.document.createElement("div"), this._flashContainer.style.setProperty("position", "absolute", "important"), this._flashContainer.style.setProperty("position", "absolute", "important"), this._flashContainer.style.setProperty("top", "0px", "important"), this._flashContainer.style.setProperty("left", "0px", "important"), this._flashContainer.style.setProperty("width", "100%", "important"), this._flashContainer.style.setProperty("height", "100%", "important"), this._slotWindow.getComputedStyle ? f = this._slotWindow.getComputedStyle(this._slot, null).getPropertyValue("position") : this._slot.currentStyle && (f = this._slot.currentStyle.position), this._targetSlotOriginalStylePosition = void 0, this._targetSlotOriginalPriorityPosition = void 0, "static" === f && (this._targetSlotOriginalStylePosition = this._slot.style.getPropertyValue("position"), this._targetSlotOriginalPriorityPosition = this._slot.style.getPropertyPriority("position"), this._slot.style.setProperty("position", "relative", "important")), this._slot.appendChild(this._flashContainer), this._flashContainer.innerHTML = h, this._flashPlayer = this._flashContainer.childNodes[0], this.logger.verbose("Loaded JS-Flash event interface:", i)
}, b.prototype.startProgressMonitor = function() {
this._progressMonitorInterval || (this.logger.debug("Starting progress monitor at currentTime=" + this._flashPlayer.getCurrentTime()), this._progressMonitorInterval = setInterval(this.onProgress, b.ONPROGRESS_INTERVAL), this.onProgress())
}, b.prototype.stopProgressMonitor = function() {
if (this._progressMonitorInterval) {
this.logger.debug("Stopping progress monitor at currentTime=" + this._flashPlayer.getCurrentTime());
try {
clearInterval(this._progressMonitorInterval), this._progressMonitorInterval = null
} catch (a) {}
}
}, b.ONPROGRESS_INTERVAL = 500, b.FLASH_BRIDGE_URL = "http://static.liverail.com/swf/v4/flv-renderer.swf", b.instanceCount = 0, b
}(c);
return f
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LRLinearHtmlRenderer", ["require", "exports", "LinearRenderer", "LogEvent", "LogEventType", "Logger", "Utils"], function(a, b, c, d, e, f, g) {
var h = function(a) {
function b() {
a.apply(this, arguments);
var b = this;
this.logger = new f("LRLinearHtmlRenderer"), this._impressionOccurred = !1, this._iosVersion = g.detectDevice("ios"), this._lastProgressTime = 0, this._lastRealTime = 0, this._volume = 1, this.onProgress = function() {
return b._videoSlot.src !== b._adAsset.getUrl() ? void b.dispatchRendererError(d.eventWithType(e.CreativeGeneralError, {
message: "Video element src changed unexpectedly"
})) : (b._videoSlot.controls = !1, b._videoSlotWasSeeked(b._videoSlot.currentTime) ? void b.resetToLastProgressTime() : (b._lastProgressTime < b._videoSlot.currentTime && (b._lastProgressTime = b._videoSlot.currentTime), b._lastRealTime = Date.now(), !b._impressionOccurred && b._videoSlot.currentTime > 0 && (b._impressionOccurred = !0, b._videoSlot.addEventListener("ended", b.onVideoSlotEnded, !1), b.dispatchRendererImpression()), void b.dispatchRendererProgress()))
}, this.onVideoSlotPause = function() {
!b._videoSlotPaused && b._impressionOccurred && b._videoSlot.currentTime < b._videoSlot.duration && (b._videoSlotPaused = !0, b.dispatchRendererPaused())
}, this.onVideoSlotPlay = function() {
b._videoSlotPaused && b._impressionOccurred && b._videoSlot.currentTime < b._videoSlot.duration && (b._videoSlotPaused = !1, b.dispatchRendererResumed())
}, this.onVideoSlotCanplay = function(a) {
if (b._videoSlot.removeEventListener("canplay", b.onVideoSlotCanplay, !1), b._videoSlot.currentTime >= 1) {
b.logger.log("Target element currentTime is " + b._videoSlot.currentTime + ", seeking to 0");
var c = function() {
b._videoSlot.removeEventListener("seeked", c, !1), b.dispatchRendererLoaded()
};
b._videoSlot.addEventListener("seeked", c, !1), b._videoSlot.currentTime = 0
} else b.dispatchRendererLoaded()
}, this.onVideoSlotLoadstart = function(a) {
b._videoSlot.removeEventListener("loadstart", b.onVideoSlotLoadstart, !1), b.dispatchRendererLoaded()
}, this.onVideoSlotEnded = function() {
if (g.checkWindowSanity()) {
b.logger.log("Video slot ended");
for (var a = 0, c = 0; c < b._videoSlot.seekable.length; c += 1) b._videoSlot.seekable.end(c) > a && (a = b._videoSlot.seekable.end(c));
if (b._videoSlotWasSeeked(a)) return b.resetToLastProgressTime(), void b._videoSlot.play();
b.dispatchRendererEnded()
}
}, this.onVideoSlotError = function() {
if (g.checkWindowSanity()) {
var a = e.CreativeGeneralError,
c = b._videoSlot.error;
if (b.logger.error("Ad video playback error:", c), c) switch (c.code) {
case c.MEDIA_ERR_NETWORK:
a = e.CreativeFileNotFound;
break;
case c.MEDIA_ERR_DECODE:
a = e.CreativeFileUnsupported;
break;
case c.MEDIA_ERR_SRC_NOT_SUPPORTED:
a = e.CreativeFileUnsupported
}
b.dispatchRendererError(d.eventWithType(a, {
url: b._adAsset.getUrl()
}))
}
}, this.onVideoSlotVolumeChange = function() {
b.dispatchVolumeChange()
}
}
return __extends(b, a), b.prototype.destroy = function() {
this.stopProgressMonitor(), this.unregister_videoSlot(), this._videoSlot && this._videoSlot.pause()
}, b.prototype.load = function(b) {
a.prototype.load.call(this, b), this.logger.log("load(", b, ")"), this._videoSlot.pause(), this._videoSlot.volume = this._volume, this.register_videoSlot(), this._videoSlot.src = this._adAsset.getUrl(), this._videoSlot.load()
}, b.prototype.start = function() {
this.logger.log("start()"), this.startProgressMonitor(), this.startAdVideoPlayback()
}, b.prototype.stop = function() {
this.logger.log("stop()"), this.dispatchRendererEnded()
}, b.prototype.pause = function() {
this.logger.log("pause()"), this._videoSlot && !this._videoSlot.paused && this._videoSlot.pause()
}, b.prototype.resume = function() {
this.logger.log("resume()"), this._videoSlot && this._videoSlot.paused && this._videoSlot.play()
}, b.prototype.getWidth = function() {
return this._videoSlot ? this._videoSlot.offsetWidth : 0
}, b.prototype.getHeight = function() {
return this._videoSlot ? this._videoSlot.offsetHeight : 0
}, b.prototype.getCurrentTime = function() {
return this._videoSlot && !isNaN(this._videoSlot.currentTime) ? this._videoSlot.currentTime : -2
}, b.prototype.getDuration = function() {
return this._videoSlot ? this._videoSlot.duration : -2
}, b.prototype.getVolume = function() {
return this._videoSlot ? this._videoSlot.volume : this._volume
}, b.prototype.setVolume = function(a) {
this._volume = a, this._videoSlot && (this._videoSlot.volume = this._volume)
}, b.prototype.isPaused = function() {
return this._videoSlot ? this._videoSlot.paused : !1
}, b.prototype.isSeeking = function() {
return this._videoSlot ? this._videoSlot.seeking : !1
}, b.prototype.impressionOccured = function() {
return this._impressionOccurred
}, b.prototype.dispatchRendererEnded = function() {
this.destroy(), a.prototype.dispatchRendererEnded.call(this)
}, b.prototype.dispatchRendererError = function(b) {
this.destroy(), a.prototype.dispatchRendererError.call(this, b)
}, b.prototype.register_videoSlot = function() {
this.logger.debug("Registering listeners on video slot element"), this._videoSlot.addEventListener("pause", this.onVideoSlotPause, !0), this._videoSlot.addEventListener("play", this.onVideoSlotPlay, !0), this._videoSlot.addEventListener("error", this.onVideoSlotError, !0), this._videoSlot.addEventListener("volumechange", this.onVideoSlotVolumeChange, !0), this._iosVersion ? (this.logger.debug("iOS version " + this._iosVersion + " detected, using canplay event to begin playback"), this._videoSlot.addEventListener("canplay", this.onVideoSlotCanplay, !1)) : this._videoSlot.addEventListener("loadstart", this.onVideoSlotLoadstart, !1)
}, b.prototype.unregister_videoSlot = function() {
this.logger.debug("Unregistering listeners on video slot element"), this._videoSlot.removeEventListener("pause", this.onVideoSlotPause, !0), this._videoSlot.removeEventListener("play", this.onVideoSlotPlay, !0), this._videoSlot.removeEventListener("error", this.onVideoSlotError, !0), this._videoSlot.removeEventListener("ended", this.onVideoSlotEnded, !1), this._videoSlot.removeEventListener("canplay", this.onVideoSlotCanplay, !1), this._videoSlot.removeEventListener("loadstart", this.onVideoSlotLoadstart, !1), this._videoSlot.removeEventListener("volumechange", this.onVideoSlotVolumeChange, !0)
}, b.prototype.startAdVideoPlayback = function() {
this._bgColor && this._videoSlot.style.setProperty("background-color", "#000", "important"), this.logger.debug("Calling _videoSlot.play()"), this._videoSlot.play()
}, b.prototype.startProgressMonitor = function() {
this._progressMonitorInterval || (this.logger.debug("Starting progress monitor at currentTime=" + this._videoSlot.currentTime), this._progressMonitorInterval = setInterval(this.onProgress, b.ONPROGRESS_INTERVAL))
}, b.prototype.stopProgressMonitor = function() {
if (this._progressMonitorInterval) {
this.logger.debug("Stopping progress monitor at currentTime=" + this._videoSlot.currentTime);
try {
clearInterval(this._progressMonitorInterval), this._progressMonitorInterval = null
} catch (a) {}
}
}, b.prototype._videoSlotWasSeeked = function(a) {
var b = a - this._lastProgressTime,
c = (Date.now() - this._lastRealTime) / 1e3,
d = 1;
return b > c + d ? (this.logger.warn("Video slot was seeked, progress=" + b + "s realtime=" + c + "s margin=" + d + "s"), !0) : !1
}, b.prototype.resetToLastProgressTime = function() {
var a = Math.max(0, this._lastProgressTime - .2);
this.logger.warn("Setting currentTime to:", a), this._videoSlot.currentTime = a
}, b.ONPROGRESS_INTERVAL = 250, b
}(c);
return h
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LRAdapter", ["require", "exports", "Adapter", "AdCandidate", "LinearRendererEvents", "LogEvent", "LogEventType", "LRLinearFlashRenderer", "LRLinearHtmlRenderer", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f, g, h, i, j, k) {
var l = function(a) {
function b(b) {
var c = this;
a.call(this, "LRAdapter"), this.renderer = null, this.onStreamTimeout = function() {
c.logger.error("Ad video stream timed out after " + c.adapterConfiguration.adCreativeTimeout + " seconds"), c.onAdError(f.eventWithType(g.CreativeFileTimeout, {
url: c.renderer.getAsset().getUrl(),
kbps: c.renderer.getAsset().getKbps(),
type: c.renderer.getAsset().getMimeType(),
flash: c.renderer.getAsset().requiresFlash(),
timeout: c.adapterConfiguration.adCreativeTimeout
}))
}, this.onAdapterEnded = function() {
j.checkWindowSanity() && (c.logger.log("Renderer ended"), 3 === c.quartile && c.onAdVideoComplete(), c.onAdStopped())
}, this.onProgress = function() {
var a;
if (!window) return a = "Ad unit has been removed", c.logger.error(a), void c.onAdError(f.eventWithType(g.CreativeGeneralError, {
message: a
}));
if (window.parent && Object) {
var b = c.renderer.getCurrentTime(),
d = c.renderer.getDuration();
if (c.adDuration === d || isNaN(d) || (c.adDuration = d, c.onAdDurationChange()), c.renderer.impressionOccured()) {
if (!c.rendererStarted) {
if (!(c.renderer.getDuration() > 0)) return void c.logger.debug("Renderer has not yet started (currentTime=" + c.renderer.getCurrentTime() + " duration=" + c.renderer.getDuration() + ")");
c.clearStreamTimeout(), c.logger.debug("Renderer has started"), c.rendererStarted = !0, c.onAdVideoStart()
}
if (!c.dispatchedAdSkippableStateChange && c.getAdSkippableState() && (c.dispatchedAdSkippableStateChange = !0, c.eventManager.dispatch(k.AdSkippableStateChange)), c.renderer.impressionOccured() && !c.renderer.isSeeking() && !c.renderer.isPaused()) {
var e = d / 4;
0 === c.quartile && b >= e && (c.quartile += 1, c.onAdVideoFirstQuartile()), 1 === c.quartile && b >= 2 * e && (c.quartile += 1, c.onAdVideoMidpoint()), 2 === c.quartile && b >= 3 * e && (c.quartile += 1, c.onAdVideoThirdQuartile())
}
}
}
}, this.handleVideoElementFullscreen = function() {
j.videoElementIsFullscreen(c.slotWindow.document) && c.onAdError(f.eventWithType(g.CreativeGeneralError, {}, "Video element went fullscreen during Flash operation"))
}, this.destroy(), b(this)
}
return __extends(b, a), b.prototype.destroy = function() {
this.clearStreamTimeout(), this.slotWindow && j.removeDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1), this.unregisterRenderer(), this.adCandidate = null, this.rendererStarted = !1, this.quartile = 0, this.dispatchedAdSkippableStateChange = !1, this.lastProgressTime = 0, this.lastRealTime = 0, a.prototype.destroy.call(this)
}, b.prototype.supports = function(a) {
return !0
}, b.prototype.getAdWidth = function() {
return this.renderer ? this.renderer.getWidth() : this.adWidth
}, b.prototype.getAdHeight = function() {
return this.renderer ? this.renderer.getHeight() : this.adHeight
}, b.prototype.getAdVolume = function() {
return this.renderer && (this.adVolume = this.renderer.getVolume()), a.prototype.getAdVolume.call(this)
}, b.prototype.setAdVolume = function(b) {
this.renderer ? this.renderer.setVolume(b) : a.prototype.setAdVolume.call(this, b)
}, b.prototype.getAdSkippableState = function() {
return 0 === this.getAdSkippableRemainingTime() ? !0 : !1
}, b.prototype.getAdSkippableRemainingTime = function() {
if (null !== this.linearCreative.getSkipOffset() && this.linearCreative.getSkipOffset() > -1) {
var a;
return a = this.linearCreative.getSkipIsPercent() ? this.renderer.getDuration() * this.linearCreative.getSkipOffset() / 100 - this.renderer.getCurrentTime() : this.linearCreative.getSkipOffset() - this.renderer.getCurrentTime(), Math.max(0, a)
}
return -2
}, b.prototype.getAdRemainingTime = function() {
return this.renderer.getDuration() > 0 ? this.renderer.getCurrentTime() > 0 ? this.renderer.getDuration() - this.renderer.getCurrentTime() : this.renderer.getDuration() : -2
}, b.prototype.isPaused = function() {
return this.renderer ? this.renderer.isPaused() : !1
}, b.prototype.initAd = function(b, c, e, j, k, l) {
a.prototype.initAd.call(this, b, c, e, j, k, l), this.logger.debug("initAd(", b, ",", c, ",", e, ",", j, ",", k, ",", l, ")");
var m = null,
n = null;
this.adCandidate = l.adCandidate;
var o = l.environmentData;
return this.slotWindow = o.slotWindow, this.adLinear = this.adCandidate.type === d.TYPE_LINEAR, this.adLinear ? (this.linearCreative = this.adCandidate.getLinearCreative(), m = this.linearCreative.getAdAsset(j, this.adapterConfiguration.mimeTypePriorityList), n = m.requiresFlash() ? new h(o) : new i(o), this.registerRenderer(n), this.renderer.load(m), void 0) : void this.onAdError(f.eventWithType(g.CreativeFileUnsupported, {
type: this.adCandidate.type
}))
}, b.prototype.startAd = function() {
if (this.logger.debug("startAd()"), this.renderer instanceof h) {
if (this.handleVideoElementFullscreen()) return;
j.addDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1)
}
this.setStreamTimeout(), this.renderer.start(), this.onAdStarted()
}, b.prototype.stopAd = function() {
this.renderer ? this.renderer.stop() : this.onAdStopped()
}, b.prototype.pauseAd = function() {
this.renderer.impressionOccured() && this.renderer.isPaused() === !1 && this.renderer.pause()
}, b.prototype.resumeAd = function() {
this.renderer.impressionOccured() && this.renderer.isPaused() === !0 && this.renderer.resume()
}, b.prototype.skipAd = function() {
this.getAdSkippableState() === !0 ? (this.logger.log("skipAd received -- initiating ad skip"), this.onAdSkipped(), this.onAdStopped()) : this.logger.warn("skipAd received -- ad not skippable at this time")
}, b.prototype.expandAd = function() {
this.logger.log("expandAd is not supported for this creative")
}, b.prototype.collapseAd = function() {
this.logger.log("collapseAd is not supported for this creative")
}, b.prototype.onAdImpression = function() {
a.prototype.onAdImpression.call(this)
}, b.prototype.setStreamTimeout = function() {
this.logger.log("Stream timeout set to " + this.adapterConfiguration.adCreativeTimeout + " seconds"), this.streamTimeout && this.clearStreamTimeout(), this.streamTimeout = setTimeout(this.onStreamTimeout, Math.round(1e3 * this.adapterConfiguration.adCreativeTimeout))
}, b.prototype.clearStreamTimeout = function() {
this.streamTimeout && (clearTimeout(this.streamTimeout), this.streamTimeout = null)
}, b.prototype.registerRenderer = function(a) {
this.renderer = a, this.renderer && (this.renderer.setVolume(this.adVolume), this.renderer.subscribe(this.onLinearRendererLoaded, e.Loaded, this), this.renderer.subscribe(this.onLinearRendererImpression, e.Impression, this), this.renderer.subscribe(this.onLinearRendererProgress, e.Progress, this), this.renderer.subscribe(this.onLinearRendererEnded, e.Ended, this), this.renderer.subscribe(this.onLinearRendererError, e.Error, this), this.renderer.subscribe(this.onLinearRendererPaused, e.Paused, this), this.renderer.subscribe(this.onLinearRendererResumed, e.Resumed, this), this.renderer.subscribe(this.onLinearRendererVolumeChange, e.VolumeChange, this))
}, b.prototype.unregisterRenderer = function() {
this.renderer && (this.renderer.unsubscribe(this.onLinearRendererLoaded, e.Loaded), this.renderer.unsubscribe(this.onLinearRendererImpression, e.Impression), this.renderer.unsubscribe(this.onLinearRendererProgress, e.Progress), this.renderer.unsubscribe(this.onLinearRendererEnded, e.Ended), this.renderer.unsubscribe(this.onLinearRendererError, e.Error), this.renderer.unsubscribe(this.onLinearRendererPaused, e.Paused), this.renderer.unsubscribe(this.onLinearRendererResumed, e.Resumed), this.renderer.unsubscribe(this.onLinearRendererVolumeChange, e.VolumeChange), this.renderer.destroy(), this.renderer = null)
}, b.prototype.onLinearRendererLoaded = function() {
this.onAdLoaded()
}, b.prototype.onLinearRendererImpression = function() {
this.onAdImpression()
}, b.prototype.onLinearRendererProgress = function() {
this.onProgress()
}, b.prototype.onLinearRendererEnded = function() {
this.onAdapterEnded()
}, b.prototype.onLinearRendererError = function(a) {
this.onAdError(a)
}, b.prototype.onLinearRendererPaused = function() {
j.checkWindowSanity() && a.prototype.onAdPaused.call(this)
}, b.prototype.onLinearRendererResumed = function() {
j.checkWindowSanity() && a.prototype.onAdPlaying.call(this)
}, b.prototype.onLinearRendererVolumeChange = function() {
a.prototype.setAdVolume.call(this, this.renderer.getVolume())
}, b
}(c);
return l
}), define("MimeType", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.Flash = "application/x-shockwave-flash", a.FLV = "video/x-flv", a.JavaScript = "application/javascript", a.JavaScriptAlt = "application/x-javascript", a.HLS = "application/x-mpegURL", a.HLSAlt = "application/vnd.apple.mpegURL", a.Mobile3GP = "video/3gpp", a.MP4 = "video/mp4", a.OGG = "video/ogg", a.WebM = "video/webm", a
}();
return c
}), define("FlashVPAIDBridge", ["require", "exports", "EventManager", "Logger", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f) {
var g = function() {
function a(a, b, e) {
var g = this;
this.logger = new d("FlashVPAIDBridge"), this.eventManager = new c(f), this.adVolume = -1, this.flashBuild = "201406161543", this.creativeUrl = a, this.slot = b.slot, this.slotWindow = b.slotWindow, this.bgcolor = b.getAdParameters().bgcolor, this.destroy(), this.loadFlashVPAID(function(a) {
g.flashVPAID = a, g.logger.log("Loaded Flash VPAID:", g.flashVPAID), e(g)
})
}
return a.prototype.getAdLinear = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdLinear() : !1
}, a.prototype.getAdWidth = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdWidth() : 0
}, a.prototype.getAdHeight = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdHeight() : 0
}, a.prototype.getAdExpanded = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdExpanded() : !1
}, a.prototype.getAdSkippableState = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdSkippableState() : !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdSkippableRemainingTime() : -2
}, a.prototype.getAdRemainingTime = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdRemainingTime() : -2
}, a.prototype.getAdDuration = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdDuration() : -2
}, a.prototype.getAdVolume = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdVolume() : this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.adVolume = a, this.bridgeInterfaceExists() && this.flashVPAID.setAdVolume(a)
}, a.prototype.getAdCompanions = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdCompanions() : ""
}, a.prototype.getAdIcons = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdIcons() : !1
}, a.prototype.handshakeVersion = function(a) {
return a
}, a.prototype.initAd = function(a, b, c, d, f, g) {
if (this.logger.log("initAd() width:", a, " height:", b, " viewMode:", c, "desiredBitrate:", d, "creativeData:", f, "environmentVars:", g), this.bridgeInterfaceExists()) {
this.adVolume > -1 && (this.logger.debug("Setting Flash VPAID adVolume property to " + this.adVolume), this.flashVPAID.setAdVolume(this.adVolume));
var h = f.AdParameters || "";
this.flashVPAID.initAd(-1, -1, c, d, h, e.stringifyParameterObject(g))
}
}, a.prototype.resizeAd = function(a, b, c) {
return this.bridgeInterfaceExists() ? this.flashVPAID.resizeAd(a, b, c) : void 0
}, a.prototype.startAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.startAd() : void 0
}, a.prototype.stopAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.stopAd() : void 0
}, a.prototype.pauseAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.pauseAd() : void 0
}, a.prototype.resumeAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.resumeAd() : void 0
}, a.prototype.expandAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.expandAd() : void 0
}, a.prototype.collapseAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.collapseAd() : void 0
}, a.prototype.skipAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.skipAd() : void 0
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.destroy = function() {
this.unloadFlashVPAID(), this.flashContainer = null, this.flashVPAID = null
}, a.prototype.loadFlashVPAID = function(b) {
function c() {
window.setTimeout(function() {
"function" == typeof f.getVPAID && null !== f.getVPAID() ? b(f) : c()
}, 100)
}
var d, e, f, g, h, i = this,
j = "",
k = {
onVPAIDEvent: function(a) {
return i.onVPAIDEvent(a)
}
};
this.slotWindow.LiveRail || (this.slotWindow.LiveRail = {}), this.slotWindow.LiveRail.VPAIDListeners || (this.slotWindow.LiveRail.VPAIDListeners = {}), a.instanceCount += 1, e = "LiveRail.VPAIDListeners.FlashVPAIDBridge_" + a.instanceCount, g = ("https:" === this.slotWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/swf/ui/vpaid-player.swf", g += "?build=" + this.flashBuild, d = "jscontext=" + e, d += "&vpaidURL=" + encodeURIComponent(this.creativeUrl), d += "&allowDomains=*", d += "&currentSecurityDomain=false", j += '<object style="display: block; width: 100%; height: 100%;"', navigator.userAgent.match(/MSIE/i) ? (j += ' id="' + e + '"', j += ' name="' + e + '"', j += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">', j += '<param name="movie" value="' + g + '" />') : (j += ' data="' + g + '"', j += ' type="application/x-shockwave-flash">'), j += '<param name="quality" value="high" />', j += '<param name="allowfullscreen" value="true" />', j += '<param name="allowscriptaccess" value="always" />', j += '<param name="flashvars" value="' + d + '" />', this.bgcolor ? (j += '<param name="wmode" value="opaque" />', j += '<param name="bgcolor" value="#' + this.bgcolor + '" />') : j += '<param name="wmode" value="transparent" />', j += "</object>", this.slotWindow.LiveRail.VPAIDListeners["FlashVPAIDBridge_" + a.instanceCount] = k, this.flashContainer = this.slotWindow.document.createElement("div"), this.flashContainer.style.position = "absolute", this.flashContainer.style.top = "0px", this.flashContainer.style.left = "0px", this.flashContainer.style.width = "100%", this.flashContainer.style.height = "100%", this.slotWindow.getComputedStyle ? h = this.slotWindow.getComputedStyle(this.slot, null).getPropertyValue("position") : this.slot.currentStyle && (h = this.slot.currentStyle.position), this.targetSlotOriginalPosition = void 0, "static" === h && (this.targetSlotOriginalPosition = this.slot.style.position, this.slot.style.position = "relative"), this.slot.appendChild(this.flashContainer), this.flashContainer.innerHTML = j, f = this.flashContainer.childNodes[0], c(), this.logger.verbose("Loaded JS-Flash event interface:", k)
}, a.prototype.unloadFlashVPAID = function() {
this.slot && this.flashContainer && (this.slot.removeChild(this.flashContainer), this.logger.log("Unloaded Flash VPAID"), this.targetSlotOriginalPosition && (this.logger.log("Resetting slot element position to " + this.targetSlotOriginalPosition), this.slot.style.position = this.targetSlotOriginalPosition))
}, a.prototype.onVPAIDEvent = function(a) {
var b = this;
f.hasOwnProperty(a.type) && window.setTimeout(function() {
switch (b.logger.verbose("Received " + a.type + " event from Flash bridge:", a, ")"), a.type) {
case "AdClickThru":
b.eventManager.dispatch(f.AdClickThru, [a.data.url, a.data.id, a.data.playerHandles]);
break;
case "AdInteraction":
b.eventManager.dispatch(f.AdInteraction, [a.data.id]);
break;
case "AdLog":
b.eventManager.dispatch(f.AdLog, [a.data.message]);
break;
case "AdStopped":
b.destroy(), b.eventManager.dispatch(f.AdStopped);
break;
case "AdError":
b.destroy(), b.eventManager.dispatch(f.AdError, [a.data]);
break;
default:
b.eventManager.dispatch(a.type)
}
}, 0)
}, a.prototype.bridgeInterfaceExists = function() {
return this.flashVPAID && e.isFunction(this.flashVPAID.handshakeVersion)
}, a.instanceCount = 0, a
}();
return g
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("VPAIDFlashWrapper", ["require", "exports", "Adapter", "AdCandidate", "FlashVPAIDBridge", "LogEvent", "LogEventType", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f, g, h, i) {
var j = function(a) {
function b() {
var b = this;
a.call(this, "VPAIDFlashWrapper"), this.handleVideoElementFullscreen = function() {
return h.videoElementIsFullscreen(b.slotWindow.document) ? (b.onLinearVPAIDError(f.eventWithType(g.CreativeGeneralError, {}, "Video element went fullscreen during Flash operation")), !0) : !1
}, this.onVPAIDInitTimeout = function() {
b.initTimeout = null, b.logger.error("VPAID initAd timed out after " + b.adapterConfiguration.timeoutVPAIDInit + " seconds"), b.onLinearVPAIDError(f.eventWithType(g.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "init",
timeout: b.adapterConfiguration.timeoutVPAIDInit
}))
}, this.clearVPAIDInitTimeout = function() {
b.initTimeout && (clearTimeout(b.initTimeout), b.initTimeout = null)
}, this.onVPAIDStartTimeout = function() {
b.startTimeout = null, b.logger.error("VPAID startAd timed out after " + b.adapterConfiguration.timeoutVPAIDStart + " seconds"), b.onLinearVPAIDError(f.eventWithType(g.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "start",
timeout: b.adapterConfiguration.timeoutVPAIDStart
}))
}, this.clearVPAIDStartTimeout = function() {
b.startTimeout && (clearTimeout(b.startTimeout), b.startTimeout = null)
}, this.destroy()
}
return __extends(b, a), b.prototype.initAd = function(b, c, f, g, h, i) {
var j = this;
a.prototype.initAd.call(this, b, c, f, g, h, i), this.logger.debug("initAd(", b, ",", c, ",", f, ",", g, ",", h, ",", i, ")"), this.active = !0, this.slot = i.slot, this.adCandidate = i.adCandidate;
var k = i.environmentData;
this.slotWindow = k.slotWindow, this.adLinear = this.adCandidate.type === d.TYPE_LINEAR, new e(this.adCandidate.getThirdPartyData("url"), k, function(a) {
j.flashBridge = a;
var d = j.adCandidate.getThirdPartyData("creativeData") || "";
j.registerBridge(j.flashBridge), j.startVPAIDInitTimeout(), j.flashBridge.initAd(b, c, f, g, {
AdParameters: d
}, {})
})
}, b.prototype.resizeAd = function(a, b, c) {
this.flashBridge.resizeAd(a, b, c)
}, b.prototype.startAd = function() {
this.handleVideoElementFullscreen() || (h.addDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1), this.startVPAIDStartTimeout(), this.flashBridge.setAdVolume(this.adVolume), this.flashBridge.startAd())
}, b.prototype.stopAd = function() {
this.flashBridge.stopAd()
}, b.prototype.pauseAd = function() {
this.flashBridge.pauseAd()
}, b.prototype.resumeAd = function() {
this.flashBridge.resumeAd()
}, b.prototype.expandAd = function() {
this.flashBridge.expandAd()
}, b.prototype.collapseAd = function() {
this.flashBridge.collapseAd()
}, b.prototype.skipAd = function() {
this.flashBridge.skipAd()
}, b.prototype.getAdLinear = function() {
return this.flashBridge.getAdLinear()
}, b.prototype.getAdWidth = function() {
return this.flashBridge.getAdWidth()
}, b.prototype.getAdHeight = function() {
return this.flashBridge.getAdHeight()
}, b.prototype.getAdExpanded = function() {
return this.flashBridge.getAdExpanded()
}, b.prototype.getAdSkippableState = function() {
return this.flashBridge.getAdSkippableState()
}, b.prototype.getAdRemainingTime = function() {
return this.flashBridge.getAdRemainingTime()
}, b.prototype.getAdDuration = function() {
return this.flashBridge.getAdDuration()
}, b.prototype.getAdVolume = function() {
return this.flashBridge ? this.flashBridge.getAdVolume() : this.adVolume
}, b.prototype.setAdVolume = function(a) {
this.adVolume = a, this.flashBridge ? this.flashBridge.setAdVolume(this.adVolume) : this.onAdVolumeChange()
}, b.prototype.registerBridge = function(a) {
a && (this.logger.log("Registering event subscriptions on bridge instance:", a), a.subscribe(this.onAdLoaded, i.AdLoaded, this), a.subscribe(this.onAdStarted, i.AdStarted, this), a.subscribe(this.onAdStopped, i.AdStopped, this), a.subscribe(this.onAdSkipped, i.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, i.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, i.AdSizeChange, this), a.subscribe(this.onAdLinearChange, i.AdLinearChange, this), a.subscribe(this.onAdDurationChange, i.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, i.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, i.AdVolumeChange, this), a.subscribe(this.onAdImpression, i.AdImpression, this), a.subscribe(this.onAdVideoStart, i.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, i.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, i.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, i.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, i.AdVideoComplete, this), a.subscribe(this.onAdClickThru, i.AdClickThru, this), a.subscribe(this.onAdInteraction, i.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, i.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, i.AdUserMinimize, this), a.subscribe(this.onAdUserClose, i.AdUserClose, this), a.subscribe(this.onAdPaused, i.AdPaused, this), a.subscribe(this.onAdPlaying, i.AdPlaying, this), a.subscribe(this.onAdLog, i.AdLog, this), a.subscribe(this.onVPAIDAdError, i.AdError, this))
}, b.prototype.unregisterBridge = function(a) {
a && (this.logger.log("Unregistering event subscriptions on adapter instance:", a), a.unsubscribe(this.onAdLoaded, i.AdLoaded), a.unsubscribe(this.onAdStarted, i.AdStarted), a.unsubscribe(this.onAdStopped, i.AdStopped), a.unsubscribe(this.onAdSkipped, i.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, i.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, i.AdSizeChange), a.unsubscribe(this.onAdLinearChange, i.AdLinearChange), a.unsubscribe(this.onAdDurationChange, i.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, i.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, i.AdVolumeChange), a.unsubscribe(this.onAdImpression, i.AdImpression), a.unsubscribe(this.onAdVideoStart, i.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, i.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, i.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, i.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, i.AdVideoComplete), a.unsubscribe(this.onAdClickThru, i.AdClickThru), a.unsubscribe(this.onAdInteraction, i.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, i.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, i.AdUserMinimize), a.unsubscribe(this.onAdUserClose, i.AdUserClose), a.unsubscribe(this.onAdPaused, i.AdPaused), a.unsubscribe(this.onAdPlaying, i.AdPlaying), a.unsubscribe(this.onAdLog, i.AdLog), a.unsubscribe(this.onVPAIDAdError, i.AdError))
}, b.prototype.onAdLoaded = function() {
this.clearVPAIDInitTimeout(), this.eventManager.dispatch(i.AdLoaded)
}, b.prototype.onAdStarted = function() {
this.clearVPAIDStartTimeout(), this.eventManager.dispatch(i.AdStarted)
}, b.prototype.onAdStopped = function() {
this.destroy(), this.eventManager.dispatch(i.AdStopped)
}, b.prototype.onAdSkipped = function() {
this.eventManager.dispatch(i.AdSkipped)
}, b.prototype.onAdSkippableStateChange = function() {
this.eventManager.dispatch(i.AdSkippableStateChange)
}, b.prototype.onAdSizeChange = function() {
this.eventManager.dispatch(i.AdSizeChange)
}, b.prototype.onAdLinearChange = function() {
this.eventManager.dispatch(i.AdLinearChange)
}, b.prototype.onAdDurationChange = function() {
this.eventManager.dispatch(i.AdDurationChange)
}, b.prototype.onAdExpandedChange = function() {
this.eventManager.dispatch(i.AdExpandedChange)
}, b.prototype.onAdVolumeChange = function() {
this.eventManager.dispatch(i.AdVolumeChange)
}, b.prototype.onAdImpression = function() {
this.flashBridge.getAdVolume() !== this.adVolume && this.flashBridge.setAdVolume(this.adVolume), this.eventManager.dispatch(i.AdImpression)
}, b.prototype.onAdVideoStart = function() {
this.eventManager.dispatch(i.AdVideoStart)
}, b.prototype.onAdVideoFirstQuartile = function() {
this.eventManager.dispatch(i.AdVideoFirstQuartile)
}, b.prototype.onAdVideoMidpoint = function() {
this.eventManager.dispatch(i.AdVideoMidpoint)
}, b.prototype.onAdVideoThirdQuartile = function() {
this.eventManager.dispatch(i.AdVideoThirdQuartile)
}, b.prototype.onAdVideoComplete = function() {
this.eventManager.dispatch(i.AdVideoComplete)
}, b.prototype.onAdClickThru = function(a, b, c) {
this.eventManager.dispatch(i.AdClickThru, [a, b, c])
}, b.prototype.onAdInteraction = function() {
this.eventManager.dispatch(i.AdInteraction)
}, b.prototype.onAdUserAcceptInvitation = function() {
this.eventManager.dispatch(i.AdUserAcceptInvitation)
}, b.prototype.onAdUserMinimize = function() {
this.eventManager.dispatch(i.AdUserMinimize)
}, b.prototype.onAdUserClose = function() {
this.eventManager.dispatch(i.AdUserClose)
}, b.prototype.onAdPaused = function() {
this.eventManager.dispatch(i.AdPaused)
}, b.prototype.onAdPlaying = function() {
this.eventManager.dispatch(i.AdPlaying)
}, b.prototype.onAdLog = function(a) {
this.eventManager.dispatch(i.AdLog, [a])
}, b.prototype.onVPAIDAdError = function(a) {
this.logger.error("VPAID creative dispatched AdError with message:", a), this.onLinearVPAIDError(f.eventWithType(g.CreativeComponentError, {
url: this.adCandidate.getThirdPartyData("url"),
message: a
}))
}, b.prototype.destroy = function() {
this.flashBridge && (h.removeDocumentFullscreenEventListener(this.slotWindow.document, this.handleVideoElementFullscreen, !1), this.flashBridge.stopAd(), this.unregisterBridge(this.flashBridge), this.flashBridge = null), a.prototype.destroy.call(this)
}, b.prototype.startVPAIDInitTimeout = function() {
this.logger.log("VPAID initAd timeout set to " + this.adapterConfiguration.timeoutVPAIDInit + " seconds"), this.initTimeout = setTimeout(this.onVPAIDInitTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDInit)
}, b.prototype.startVPAIDStartTimeout = function() {
this.logger.log("VPAID start timeout set to " + this.adapterConfiguration.timeoutVPAIDStart + " seconds"), this.startTimeout = setTimeout(this.onVPAIDStartTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDStart)
}, b.prototype.onLinearVPAIDError = function(a) {
this.destroy(), this.eventManager.dispatch(i.AdError, [a])
}, b
}(c);
return j
}), define("VPAIDMethods", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.getAdLinear = "getAdLinear", a.getAdWidth = "getAdWidth", a.getAdHeight = "getAdHeight", a.getAdExpanded = "getAdExpanded", a.getAdSkippableState = "getAdSkippableState", a.getAdSkippableRemainingTime = "getAdSkippableRemainingTime", a.getAdRemainingTime = "getAdRemainingTime", a.getAdDuration = "getAdDuration", a.getAdVolume = "getAdVolume", a.setAdVolume = "setAdVolume", a.getAdCompanions = "getAdCompanions", a.getAdIcons = "getAdIcons", a.handshakeVersion = "handshakeVersion", a.initAd = "initAd", a.resizeAd = "resizeAd", a.startAd = "startAd", a.stopAd = "stopAd", a.pauseAd = "pauseAd", a.resumeAd = "resumeAd", a.expandAd = "expandAd", a.collapseAd = "collapseAd", a.skipAd = "skipAd", a.subscribe = "subscribe", a.unsubscribe = "unsubscribe", a
}();
return c
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("VPAIDHtmlWrapper", ["require", "exports", "Adapter", "AdCandidate", "LogEvent", "LogEventType", "Utils", "VPAIDEvents", "VPAIDMethods"], function(a, b, c, d, e, f, g, h, i) {
var j = function(a) {
function b() {
var b = this;
a.call(this, "VPAIDHtmlWrapper"), this.onVPAIDLoadTimeout = function() {
b.loadTimeout = null, b.onLinearVPAIDError(e.eventWithType(f.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "load",
timeout: b.adapterConfiguration.timeoutVPAIDLoad
}))
}, this.clearVPAIDLoadTimeout = function() {
b.loadTimeout && (clearTimeout(b.loadTimeout), b.loadTimeout = null)
}, this.onVPAIDInitTimeout = function() {
b.initTimeout = null, b.onLinearVPAIDError(e.eventWithType(f.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "init",
timeout: b.adapterConfiguration.timeoutVPAIDInit
}))
}, this.clearVPAIDInitTimeout = function() {
b.initTimeout && (clearTimeout(b.initTimeout), b.initTimeout = null)
}, this.onVPAIDStartTimeout = function() {
b.startTimeout = null, b.onLinearVPAIDError(e.eventWithType(f.CreativeFileTimeout, {
url: b.adCandidate.getThirdPartyData("url"),
type: b.adCandidate.getThirdPartyData("type"),
method: "start",
timeout: b.adapterConfiguration.timeoutVPAIDStart
}))
}, this.clearVPAIDStartTimeout = function() {
b.startTimeout && (clearTimeout(b.startTimeout), b.startTimeout = null)
}, this.onCreativeAdLoaded = function() {
b.clearVPAIDInitTimeout(), a.prototype.onAdLoaded.call(b)
}, this.onCreativeAdStarted = function() {
a.prototype.onAdStarted.call(b)
}, this.onCreativeAdImpression = function() {
b.clearVPAIDStartTimeout(), b.VPAIDInstance.getAdVolume() !== b.adVolume && b.setAdVolume(b.adVolume), a.prototype.onAdImpression.call(b)
}, this.onCreativeAdStopped = function() {
b.active && (b.logEvent(h.AdStopped), setTimeout(function() {
b.destroyThirdPartyVPAID(), b.destroy(), b.eventManager.dispatch(h.AdStopped)
}, 0))
}, this.onCreativeAdSkipped = function() {
a.prototype.onAdSkipped.call(b)
}, this.onCreativeAdSkippableStateChange = function() {
a.prototype.onAdSkippableStateChange.call(b)
}, this.onCreativeAdSizeChange = function() {
a.prototype.onAdSizeChange.call(b)
}, this.onCreativeAdLinearChange = function() {
a.prototype.onAdLinearChange.call(b)
}, this.onCreativeAdDurationChange = function() {
a.prototype.onAdDurationChange.call(b)
}, this.onCreativeAdExpandedChange = function() {
a.prototype.onAdExpandedChange.call(b)
}, this.onCreativeAdVolumeChange = function() {
a.prototype.onAdVolumeChange.call(b)
}, this.onCreativeAdVideoStart = function() {
a.prototype.onAdVideoStart.call(b)
}, this.onCreativeAdVideoFirstQuartile = function() {
a.prototype.onAdVideoFirstQuartile.call(b)
}, this.onCreativeAdVideoMidpoint = function() {
a.prototype.onAdVideoMidpoint.call(b)
}, this.onCreativeAdVideoThirdQuartile = function() {
a.prototype.onAdVideoThirdQuartile.call(b)
}, this.onCreativeAdVideoComplete = function() {
a.prototype.onAdVideoComplete.call(b)
}, this.onCreativeAdClickThru = function(c, d, e) {
a.prototype.onAdClickThru.call(b, g.returnString(c, "").trim(), g.returnString(d, ""), g.returnBoolean(e))
}, this.onCreativeAdInteraction = function() {
a.prototype.onAdInteraction.call(b)
}, this.onCreativeAdUserAcceptInvitation = function() {
a.prototype.onAdUserAcceptInvitation.call(b)
}, this.onCreativeAdUserMinimize = function() {
a.prototype.onAdUserMinimize.call(b)
}, this.onCreativeAdUserClose = function() {
a.prototype.onAdUserClose.call(b)
}, this.onCreativeAdPaused = function() {
a.prototype.onAdPaused.call(b)
}, this.onCreativeAdPlaying = function() {
a.prototype.onAdPlaying.call(b)
}, this.onCreativeAdLog = function(a) {
b.logEvent(h.AdLog, [a])
}, this.onCreativeAdError = function(a) {
b.logger.error("VPAID creative dispatched AdError with message:", a), b.onLinearVPAIDError(e.eventWithType(f.CreativeComponentError, {
url: b.adCandidate.getThirdPartyData("url"),
message: a
}))
}, this.validateVPAIDCreative = function(a) {
var c = !0;
return "object" == typeof a ? [i.handshakeVersion, i.initAd, i.startAd, i.stopAd, i.subscribe, i.unsubscribe, i.getAdLinear, i.getAdVolume, i.setAdVolume].every(function(d) {
var e = a[d];
return "function" != typeof e ? (b.logger.error("VPAID creative is missing required " + d + " method"), c = !1, !1) : !0
}) : c = !1, c
}, this.destroy()
}
return __extends(b, a), b.prototype.initAd = function(b, c, e, f, g, h) {
var j = this;
a.prototype.initAd.call(this, b, c, e, f, g, h), this.logger.debug("initAd(", b, ",", c, ",", e, ",", f, ",", g, ",", h, ")"), this.active = !0, this.slot = h.slot, this.videoSlot = h.videoSlot, this.adCandidate = h.adCandidate, this.adLinear = this.adCandidate.type === d.TYPE_LINEAR, this.instantiateThirdPartyVPAID(this.adCandidate.getThirdPartyData("url"), function(a) {
j.VPAIDInstance = a, j.registerVPAIDSubscriptions(j.VPAIDInstance);
var d = {},
g = j.adCandidate.getThirdPartyData("creativeData");
g && (d.AdParameters = g);
var k = {
slot: j.slot,
videoSlot: j.videoSlot,
videoSlotCanAutoPlay: h.videoSlotCanAutoPlay
};
j.logger.log("Calling initAd() on VPAID creative, timeout=" + j.adapterConfiguration.timeoutVPAIDInit, "width=" + b, "height=" + c, "viewMode=" + e, "desiredBitrate=" + f, "creativeData=", d, "environmentVars=", k), j.initTimeout = setTimeout(j.onVPAIDInitTimeout, 1e3 * j.adapterConfiguration.timeoutVPAIDInit), j.callVPAIDInstanceMethodOrDie(i.initAd, [b, c, e, f, d, k])
}, function(a) {
j.onLinearVPAIDError(a)
})
}, b.prototype.resizeAd = function(a, b, c) {
this.callVPAIDInstanceMethod(i.resizeAd, [a, b, c])
}, b.prototype.startAd = function() {
this.logger.log("Calling startAd() on VPAID creative, timeout=" + this.adapterConfiguration.timeoutVPAIDStart), this.startTimeout = setTimeout(this.onVPAIDStartTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDStart), this.setAdVolume(this.adVolume), this.callVPAIDInstanceMethodOrDie(i.startAd)
}, b.prototype.stopAd = function() {
this.logger.log("Calling stopAd() on VPAID creative"), this.callVPAIDInstanceMethodOrDie(i.stopAd)
}, b.prototype.pauseAd = function() {
this.logger.log("Calling pauseAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.pauseAd)
}, b.prototype.resumeAd = function() {
this.logger.log("Calling resumeAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.resumeAd)
}, b.prototype.expandAd = function() {
this.logger.log("Calling expandAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.expandAd)
}, b.prototype.collapseAd = function() {
this.logger.log("Calling collapseAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.collapseAd)
}, b.prototype.skipAd = function() {
this.logger.log("Calling skipAd() on VPAID creative"), this.callVPAIDInstanceMethod(i.skipAd)
}, b.prototype.getAdLinear = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdLinear) || a.prototype.getAdLinear.call(this) : a.prototype.getAdLinear.call(this)
}, b.prototype.getAdWidth = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdWidth) || a.prototype.getAdWidth.call(this) : a.prototype.getAdWidth.call(this)
}, b.prototype.getAdHeight = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdHeight) || a.prototype.getAdHeight.call(this) : a.prototype.getAdHeight.call(this)
}, b.prototype.getAdExpanded = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdExpanded) || a.prototype.getAdExpanded.call(this) : a.prototype.getAdExpanded.call(this)
}, b.prototype.getAdSkippableState = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdSkippableState) || a.prototype.getAdSkippableState.call(this) : a.prototype.getAdSkippableState.call(this)
}, b.prototype.getAdRemainingTime = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdRemainingTime) || a.prototype.getAdRemainingTime.call(this) : a.prototype.getAdRemainingTime.call(this)
}, b.prototype.getAdDuration = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdDuration) || a.prototype.getAdDuration.call(this) : a.prototype.getAdDuration.call(this)
}, b.prototype.getAdVolume = function() {
return this.VPAIDInstance ? this.callVPAIDInstanceMethod(i.getAdVolume) || a.prototype.getAdVolume.call(this) : a.prototype.getAdVolume.call(this)
}, b.prototype.setAdVolume = function(b) {
var c = this;
this.VPAIDInstance ? (this.callVPAIDInstanceMethod(i.setAdVolume, [b], function() {
a.prototype.setAdVolume.call(c, b)
}), 0 === b ? 0 === this.videoSlot.volume || this.videoSlot.muted || (this.logger.log("Failed to set volume to 0, setting video slot to muted=true"), this.videoSlot.muted = !0) : this.videoSlot.volume !== b && (this.logger.log("Failed to set volume to " + b + " setting video slot volume directly"), this.videoSlot.volume = b)) : a.prototype.setAdVolume.call(this, b)
}, b.prototype.onEvent = function(b, c) {
"undefined" == typeof c && (c = []), this.logEvent(b, c), a.prototype.onEvent.call(this, b, c)
}, b.prototype.logEvent = function(a, b) {
"undefined" == typeof b && (b = []), this.logger.log("Received " + a + " event with arguments:", b)
}, b.prototype.instantiateThirdPartyVPAID = function(a, b, c) {
var d = this;
this.logger.log("Loading VPAID creative, timeout=" + this.adapterConfiguration.timeoutVPAIDLoad + " url=" + a), this.loadTimeout = setTimeout(this.onVPAIDLoadTimeout, 1e3 * this.adapterConfiguration.timeoutVPAIDLoad), this.VPAIDLoader = document.createElement("iframe"), this.VPAIDLoader.style.setProperty("display", "none", "important"), document.body.appendChild(this.VPAIDLoader), this.VPAIDLoader.contentWindow.document.open(), this.VPAIDLoader.contentWindow.document.close();
var g = this.VPAIDLoader.contentWindow.document.createElement("script");
g.onload = function() {
var g = d.VPAIDLoader.contentWindow;
if ("function" != typeof g.getVPAIDAd) return void c(e.eventWithType(f.CreativeGeneralError, {
url: a,
message: "Creative does not provide getVPAIDAd constructor"
}));
var h = g.getVPAIDAd();
return d.validateVPAIDCreative(h) ? (h.handshakeVersion("2.0"), d.clearVPAIDLoadTimeout(), void(d.active && b(h))) : void c(e.eventWithType(f.CreativeGeneralError, {
url: a,
message: "Creative does not implement VPAID methods"
}))
}, g.onerror = function(b) {
this.clearVPAIDLoadTimeout(), this.active && c(e.eventWithType(f.CreativeGeneralError, {
message: "VPAID creative load failed with error: " + b.message,
url: a
}))
}, g.src = a, this.VPAIDLoader.contentWindow.document.body.appendChild(g)
}, b.prototype.onLinearVPAIDError = function(a) {
var b = this;
a.id !== f.CreativeComponentError.id && this.VPAIDInstance && this.active === !0 && (this.active = !1, this.stopAd()), setTimeout(function() {
b.destroyThirdPartyVPAID(), b.destroy(), b.eventManager.dispatch(h.AdError, [a])
}, 0)
}, b.prototype.destroyThirdPartyVPAID = function() {
this.clearVPAIDInitTimeout(), this.clearVPAIDLoadTimeout(), this.clearVPAIDStartTimeout(), this.unregisterVPAIDSubscriptions(this.VPAIDInstance), this.VPAIDInstance = null, document.body.removeChild(this.VPAIDLoader), this.VPAIDLoader = null, this.logger.log("Unloaded VPAID creative")
}, b.prototype.registerVPAIDSubscriptions = function(a) {
"object" == typeof a && "function" == typeof a.subscribe && (this.logger.log("Registering event subscriptions on VPAID instance:", a), a.subscribe(this.onCreativeAdLoaded, h.AdLoaded, this), a.subscribe(this.onCreativeAdStarted, h.AdStarted, this), a.subscribe(this.onCreativeAdStopped, h.AdStopped, this), a.subscribe(this.onCreativeAdSkipped, h.AdSkipped, this), a.subscribe(this.onCreativeAdSkippableStateChange, h.AdSkippableStateChange, this), a.subscribe(this.onCreativeAdSizeChange, h.AdSizeChange, this), a.subscribe(this.onCreativeAdLinearChange, h.AdLinearChange, this), a.subscribe(this.onCreativeAdDurationChange, h.AdDurationChange, this), a.subscribe(this.onCreativeAdExpandedChange, h.AdExpandedChange, this), a.subscribe(this.onCreativeAdVolumeChange, h.AdVolumeChange, this), a.subscribe(this.onCreativeAdImpression, h.AdImpression, this), a.subscribe(this.onCreativeAdVideoStart, h.AdVideoStart, this), a.subscribe(this.onCreativeAdVideoFirstQuartile, h.AdVideoFirstQuartile, this), a.subscribe(this.onCreativeAdVideoMidpoint, h.AdVideoMidpoint, this), a.subscribe(this.onCreativeAdVideoThirdQuartile, h.AdVideoThirdQuartile, this), a.subscribe(this.onCreativeAdVideoComplete, h.AdVideoComplete, this), a.subscribe(this.onCreativeAdClickThru, h.AdClickThru, this), a.subscribe(this.onCreativeAdInteraction, h.AdInteraction, this), a.subscribe(this.onCreativeAdUserAcceptInvitation, h.AdUserAcceptInvitation, this), a.subscribe(this.onCreativeAdUserMinimize, h.AdUserMinimize, this), a.subscribe(this.onCreativeAdUserClose, h.AdUserClose, this), a.subscribe(this.onCreativeAdPaused, h.AdPaused, this), a.subscribe(this.onCreativeAdPlaying, h.AdPlaying, this), a.subscribe(this.onCreativeAdLog, h.AdLog, this), a.subscribe(this.onCreativeAdError, h.AdError, this))
}, b.prototype.unregisterVPAIDSubscriptions = function(a) {
"object" == typeof a && "function" == typeof a.unsubscribe && (this.logger.log("Unregistering event subscriptions on VPAID instance:", a), a.unsubscribe(this.onCreativeAdLoaded, h.AdLoaded), a.unsubscribe(this.onCreativeAdStarted, h.AdStarted), a.unsubscribe(this.onCreativeAdStopped, h.AdStopped), a.unsubscribe(this.onCreativeAdSkipped, h.AdSkipped), a.unsubscribe(this.onCreativeAdSkippableStateChange, h.AdSkippableStateChange), a.unsubscribe(this.onCreativeAdSizeChange, h.AdSizeChange), a.unsubscribe(this.onCreativeAdLinearChange, h.AdLinearChange), a.unsubscribe(this.onCreativeAdDurationChange, h.AdDurationChange), a.unsubscribe(this.onCreativeAdExpandedChange, h.AdExpandedChange), a.unsubscribe(this.onCreativeAdVolumeChange, h.AdVolumeChange), a.unsubscribe(this.onCreativeAdImpression, h.AdImpression), a.unsubscribe(this.onCreativeAdVideoStart, h.AdVideoStart), a.unsubscribe(this.onCreativeAdVideoFirstQuartile, h.AdVideoFirstQuartile), a.unsubscribe(this.onCreativeAdVideoMidpoint, h.AdVideoMidpoint), a.unsubscribe(this.onCreativeAdVideoThirdQuartile, h.AdVideoThirdQuartile), a.unsubscribe(this.onCreativeAdVideoComplete, h.AdVideoComplete), a.unsubscribe(this.onCreativeAdClickThru, h.AdClickThru), a.unsubscribe(this.onCreativeAdInteraction, h.AdInteraction), a.unsubscribe(this.onCreativeAdUserAcceptInvitation, h.AdUserAcceptInvitation), a.unsubscribe(this.onCreativeAdUserMinimize, h.AdUserMinimize), a.unsubscribe(this.onCreativeAdUserClose, h.AdUserClose), a.unsubscribe(this.onCreativeAdPaused, h.AdPaused), a.unsubscribe(this.onCreativeAdPlaying, h.AdPlaying), a.unsubscribe(this.onCreativeAdLog, h.AdLog), a.unsubscribe(this.onCreativeAdError, h.AdError))
}, b.prototype.callVPAIDInstanceMethod = function(a, b, c) {
"undefined" == typeof b && (b = []), "undefined" == typeof c && (c = null);
try {
var d = this.VPAIDInstance;
return d[a].apply(d, b)
} catch (e) {
this.logger.error("VPAID instance uncaught error, method=" + a + " args=", b, "message=" + e.message, "error=", e), null !== c && c(e)
}
}, b.prototype.callVPAIDInstanceMethodOrDie = function(a, b) {
var c = this;
"undefined" == typeof b && (b = []), this.callVPAIDInstanceMethod(a, b, function(b) {
c.onLinearVPAIDError(e.eventWithType(f.CreativeGeneralError, {
url: c.adCandidate.getThirdPartyData("url"),
message: "Exception thrown calling " + a + " method: " + b.message
}))
})
}, b.prototype.destroy = function() {
this.active = !1, this.VPAIDInstance && (this.stopAd(), this.destroyThirdPartyVPAID()), this.videoSlot = null, this.slot = null, this.adapterConfiguration = null, this.adCandidate = null, a.prototype.destroy.call(this)
}, b
}(c);
return j
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("VPAIDAdapter", ["require", "exports", "Adapter", "MimeType", "VPAIDEvents", "VPAIDFlashWrapper", "VPAIDHtmlWrapper"], function(a, b, c, d, e, f, g) {
var h = function(a) {
function b(b) {
a.call(this, "VPAIDAdapter"), this.destroy(), b && b(this)
}
return __extends(b, a), b.prototype.supports = function(a) {
return !1
}, b.prototype.initAd = function(b, c, e, h, i, j) {
a.prototype.initAd.call(this, b, c, e, h, i, j), this.logger.debug("initAd(", b, ",", c, ",", e, ",", h, ",", i, ",", j, ")"), this.active = !0;
var k = j.adCandidate;
k.getThirdPartyData("type") === d.JavaScript ? this.wrapper = new g : this.wrapper = new f, this.registerVPAIDWrapper(this.wrapper), this.wrapper.initAd(b, c, e, h, i, j)
}, b.prototype.resizeAd = function(a, b, c) {
this.wrapper.resizeAd(a, b, c)
}, b.prototype.startAd = function() {
this.wrapper.startAd()
}, b.prototype.stopAd = function() {
this.wrapper.stopAd()
}, b.prototype.pauseAd = function() {
this.wrapper.pauseAd()
}, b.prototype.resumeAd = function() {
this.wrapper.resumeAd()
}, b.prototype.expandAd = function() {
this.wrapper.expandAd()
}, b.prototype.collapseAd = function() {
this.wrapper.collapseAd()
}, b.prototype.skipAd = function() {
this.wrapper.skipAd()
}, b.prototype.getAdLinear = function() {
return this.wrapper ? this.wrapper.getAdLinear() : a.prototype.getAdLinear.call(this)
}, b.prototype.getAdWidth = function() {
return this.active && this.wrapper ? this.wrapper.getAdWidth() : a.prototype.getAdWidth.call(this)
}, b.prototype.getAdHeight = function() {
return this.active && this.wrapper ? this.wrapper.getAdHeight() : a.prototype.getAdHeight.call(this)
}, b.prototype.getAdExpanded = function() {
return this.active && this.wrapper ? this.wrapper.getAdExpanded() : a.prototype.getAdExpanded.call(this)
}, b.prototype.getAdSkippableState = function() {
return this.active && this.wrapper ? this.wrapper.getAdSkippableState() : a.prototype.getAdSkippableState.call(this)
}, b.prototype.getAdRemainingTime = function() {
return this.active && this.wrapper ? this.wrapper.getAdRemainingTime() : a.prototype.getAdRemainingTime.call(this)
}, b.prototype.getAdDuration = function() {
return this.active && this.wrapper ? this.wrapper.getAdDuration() : a.prototype.getAdDuration.call(this)
}, b.prototype.getAdVolume = function() {
return this.active && this.wrapper ? this.wrapper.getAdVolume() : a.prototype.getAdVolume.call(this)
}, b.prototype.setAdVolume = function(b) {
this.active && this.wrapper && this.wrapper.setAdVolume(b), a.prototype.setAdVolume.call(this, b)
}, b.prototype.onAdStarted = function() {
this.adLinear = this.wrapper.getAdLinear(), a.prototype.onAdStarted.call(this)
}, b.prototype.onAdLinearChange = function() {
this.adLinear = this.wrapper.getAdLinear(), a.prototype.onAdLinearChange.call(this)
}, b.prototype.isPaused = function() {
return this._paused
}, b.prototype.onAdPaused = function() {
this._paused = !0, a.prototype.onAdPaused.call(this)
}, b.prototype.onAdPlaying = function() {
this._paused = !1, a.prototype.onAdPlaying.call(this)
}, b.prototype.unregisterVPAIDWrapperInstance = function() {
this.logger.log("Unregistering VPAID wrapper"), this.unregisterVPAIDWrapper(this.wrapper), this.wrapper.destroy()
}, b.prototype.registerVPAIDWrapper = function(a) {
"object" == typeof a && "function" == typeof a.subscribe && (this.wrapper.setAdVolume(this.adVolume), this.logger.log("Registering event subscriptions on wrapper instance:", a), a.subscribe(this.onAdLoaded, e.AdLoaded, this), a.subscribe(this.onAdStarted, e.AdStarted, this), a.subscribe(this.onAdStopped, e.AdStopped, this), a.subscribe(this.onAdSkipped, e.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, e.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, e.AdSizeChange, this), a.subscribe(this.onAdLinearChange, e.AdLinearChange, this), a.subscribe(this.onAdDurationChange, e.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, e.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, e.AdVolumeChange, this), a.subscribe(this.onAdImpression, e.AdImpression, this), a.subscribe(this.onAdVideoStart, e.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, e.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, e.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, e.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, e.AdVideoComplete, this), a.subscribe(this.onAdClickThru, e.AdClickThru, this), a.subscribe(this.onAdInteraction, e.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, e.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, e.AdUserMinimize, this), a.subscribe(this.onAdUserClose, e.AdUserClose, this), a.subscribe(this.onAdPaused, e.AdPaused, this), a.subscribe(this.onAdPlaying, e.AdPlaying, this), a.subscribe(this.onAdLog, e.AdLog, this), a.subscribe(this.onAdError, e.AdError, this))
}, b.prototype.unregisterVPAIDWrapper = function(a) {
"object" == typeof a && "function" == typeof a.unsubscribe && (this.logger.log("Unregistering event subscriptions on wrapper instance:", a), a.unsubscribe(this.onAdLoaded, e.AdLoaded), a.unsubscribe(this.onAdStarted, e.AdStarted), a.unsubscribe(this.onAdStopped, e.AdStopped), a.unsubscribe(this.onAdSkipped, e.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, e.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, e.AdSizeChange), a.unsubscribe(this.onAdLinearChange, e.AdLinearChange), a.unsubscribe(this.onAdDurationChange, e.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, e.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, e.AdVolumeChange), a.unsubscribe(this.onAdImpression, e.AdImpression), a.unsubscribe(this.onAdVideoStart, e.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, e.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, e.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, e.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, e.AdVideoComplete), a.unsubscribe(this.onAdClickThru, e.AdClickThru), a.unsubscribe(this.onAdInteraction, e.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, e.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, e.AdUserMinimize), a.unsubscribe(this.onAdUserClose, e.AdUserClose), a.unsubscribe(this.onAdPaused, e.AdPaused), a.unsubscribe(this.onAdPlaying, e.AdPlaying), a.unsubscribe(this.onAdLog, e.AdLog), a.unsubscribe(this.onAdError, e.AdError))
}, b.prototype.destroy = function() {
this.active = !1, this.wrapper && (this.unregisterVPAIDWrapperInstance(), this.wrapper = null), a.prototype.destroy.call(this)
}, b
}(c);
return h
}), define("AdapterFactory", ["require", "exports", "LRAdapter", "VPAIDAdapter"], function(a, b, c, d) {
var e = function() {
function a() {
this.adapterInstanceDictionary = {}
}
return a.setInstanceData = function(a) {
this.instanceData = a
}, a.getAvailableAdapters = function() {
var a = ["LR"];
return this.instanceData && this.instanceData.getDisableIframes() !== !0 && a.push("VPAID"), a
}, a.prototype.getAdapterInstance = function(b, e) {
var f = this,
g = function(a) {
f.adapterInstanceDictionary[b] || (f.adapterInstanceDictionary[b] = a), e(f.adapterInstanceDictionary[b] || null)
};
if (-1 === a.getAvailableAdapters().indexOf(b) || this.adapterInstanceDictionary.hasOwnProperty(b)) g(this.adapterInstanceDictionary[b]);
else switch (b) {
case "LR":
new c(g);
break;
case "VPAID":
new d(g)
}
}, a
}();
return e
}), define("AdapterConfiguration", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b) {
var c = a.getAdParameters();
this.adRequestTimeout = c.adRequestTimeout, this.adCreativeTimeout = c.adCreativeTimeout, this.timeoutVPAIDLoad = c.timeoutVPAIDLoad, this.timeoutVPAIDInit = c.timeoutVPAIDInit, this.timeoutVPAIDStart = c.timeoutVPAIDStart, this.desiredBitrate = c.desiredBitrate, this.linearSkin = c.linearSkin, this.indexMessage = c.indexMessage || b.indexMessage, this.countdownMessage = c.countdownMessage || b.countdownMessage, this.clickthroughMessage = c.clickthroughMessage || b.clickthroughMessage, this.skipCountdownMessage = c.skipCountdownMessage || b.skipCountdownMessage, this.skipMessage = c.skipMessage || b.skipMessage, this.showCountdown = c.showCountdown, this.clickElement = c.clickElement, this.playerHandlesClick = c.playerHandlesClick, this.pauseOnClick = c.pauseOnClick, this.placementType = b.placementType, this.allowExpand = b.allowExpand, this.allowSMS = b.allowSMS, this.allowTelephone = b.allowTelephone, this.allowWebcal = b.allowWebcal, this.allowResize = b.allowResize, this.allowPhoto = b.allowPhoto, this.allowCalendar = b.allowCalendar, this.mimeTypePriorityList = a.mimeTypePriorityList
}
return a.prototype.propertyOrDefault = function(a, b) {
return null !== a ? a : b
}, a
}();
return c
}), define("AdExtensionManager", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.prototype.init = function(a) {
this.adResponse = a
}, a.prototype.register = function(a, b) {
this.adapter = a, this.adCandidate = b
}, a.prototype.unregister = function() {}, a.prototype.onFullscreenEnter = function() {}, a.prototype.onFullscreenExit = function() {},
a
}();
return c
}), define("AdSourceRequestStatus", ["require", "exports"], function(a, b) {
var c;
return function(a) {
a[a.success = 0] = "success", a[a.empty = 1] = "empty", a[a.creativeError = 200] = "creativeError", a[a.ioError = 300] = "ioError", a[a.timeout = 301] = "timeout", a[a.wrapperLimit = 302] = "wrapperLimit"
}(c || (c = {})), c
}), define("AdSourceRequest", ["require", "exports", "AdSourceRequestStatus"], function(a, b, c) {
var d = function() {
function a(a, b) {
this.status = 0, this.totalDuration = 0, this.responses = [], this.id = a, this.adSource = b;
var c = b.getErc();
null !== c && (this.status = c)
}
return a.prototype.getId = function() {
return this.id
}, a.prototype.getAdSource = function() {
return this.adSource
}, a.prototype.getStatus = function() {
return this.status
}, a.prototype.setStatus = function(a) {
this.status = a
}, a.prototype.getTotalDuration = function() {
return this.totalDuration
}, a.prototype.increaseTotalDuration = function(a) {
this.totalDuration += a
}, a.prototype.addResponse = function(a) {
this.responses.push(a)
}, a.prototype.getResponses = function() {
return this.responses
}, a
}();
return d
}), define("HTTPRequest", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.aborted = !1
}
return a.prototype.setXMLHttpRequest = function(a) {
this.requestObject = a
}, a.prototype.getReadyState = function() {
return this.requestObject.readyState
}, a.prototype.abort = function() {
this.aborted = !0, this.requestObject.abort()
}, a.prototype.isAborted = function() {
return this.aborted
}, a
}();
return c
}), ! function() {
"use strict";
var a = {};
a.request = function(a) {
var b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u;
if ("object" != typeof a || !a.url) return null;
d = "corserror", e = "error", f = "parsererror", g = "timeout", i = {
latency: null,
duration: null
}, q = a.url, o = "GET", "POST" === a.type && (o = "POST"), j = function(b) {
"function" == typeof a.onloadstart && a.onloadstart(b)
}, k = function(b) {
"function" == typeof a.onprogress && a.onprogress(b)
}, l = function(d) {
if (void 0 === c.responseText || null === c.responseText) return m(e), c;
if (r = d.responseText, "json" === a.dataType) try {
r = JSON.parse(d.responseText)
} catch (g) {
return void m(f, g)
}
if ("xml" === a.dataType) try {
if (r = d.responseXML || null, (!r || !d.responseXML.documentElement) && "string" == typeof d.responseText && d.responseText.length > 0) {
if (!window.DOMParser) throw null;
try {
r = (new window.DOMParser).parseFromString(d.responseText, "text/xml")
} catch (h) {
throw null
}
}
if (r && "parsererror" === r.documentElement.tagName) throw null;
if (r && r.getElementsByTagName("parsererror").length > 0) throw null
} catch (j) {
return void m(f)
}
b && (b = !1, "function" == typeof a.success && a.success(r, "success", c, i))
}, m = function(d, f) {
var g = e,
h = e;
s && (clearTimeout(s), s = void 0), b && (b = !1, "function" == typeof a.error && ("string" == typeof d && (g = d), "object" == typeof f && (h = f.message), a.error(c, g, h, i)))
}, b = !0;
try {
h = document.createElement("a"), h.href = q, n = h.hostname
} catch (v) {}
if (!window.XMLHttpRequest || "" !== n && window.location.hostname !== n && void 0 === (new window.XMLHttpRequest).withCredentials) {
if (!window.XDomainRequest) return window.setTimeout(function() {
m(d)
}, 0), null;
c = new window.XDomainRequest;
try {
c.open(o, q)
} catch (w) {
return window.setTimeout(function() {
m(e, w)
}, 0), c
}
c.onload = function() {
i.duration = Date.now() - p, l(c)
}, c.onprogress = function() {
i.latency = Date.now() - p
}, c.onerror = function(a) {
i.duration = Date.now() - p, m(e, a)
}, c.ontimeout = function(a) {
m(g, a)
}, "number" == typeof a.timeout && (c.timeout = a.timeout)
} else {
c = new window.XMLHttpRequest, c.overrideMimeType && ("json" === a.dataType && c.overrideMimeType("application/json"), "xml" === a.dataType && c.overrideMimeType("text/xml"));
try {
c.open(o, q, !0)
} catch (w) {
return window.setTimeout(function() {
m(e, w)
}, 0), c
}
if (c.withCredentials = !0, "POST" === o && c.setRequestHeader("Content-type", "application/x-www-form-urlencoded"), c.onreadystatechange = function() {
return b && (2 === c.readyState && (i.latency = Date.now() - p), 4 === c.readyState) ? (i.duration = Date.now() - p, 200 !== c.status ? void m(e) : void l(c)) : void 0
}, c.onloadstart = j, "object" == typeof a.xhrFields)
for (u in a.xhrFields) a.xhrFields.hasOwnProperty(u) && (c[u] = a.xhrFields[u]);
"number" == typeof a.timeout && (t = a.timeout)
}
try {
c.onprogress = k, "number" == typeof t && (s = setTimeout(function() {
m(g)
}, t)), p = Date.now(), c.send(a.data)
} catch (x) {
window.setTimeout(function() {
m(e, x)
}, 0)
}
return c
}, "object" == typeof exports ? module.exports = a : "function" == typeof define && define("Ajax", [], function() {
return a
})
}(), ! function() {
function a() {
function a() {
! function(a) {
function b() {
function a(a) {
var b, c, e, f, g, h, j = d.dyn_tree,
k = d.stat_desc.static_tree,
l = d.stat_desc.extra_bits,
m = d.stat_desc.extra_base,
n = d.stat_desc.max_length,
p = 0;
for (f = 0; i >= f; f++) a.bl_count[f] = 0;
for (j[2 * a.heap[a.heap_max] + 1] = 0, b = a.heap_max + 1; o > b; b++) c = a.heap[b], f = j[2 * j[2 * c + 1] + 1] + 1, f > n && (f = n, p++), j[2 * c + 1] = f, c > d.max_code || (a.bl_count[f]++, g = 0, c >= m && (g = l[c - m]), h = j[2 * c], a.opt_len += h * (f + g), k && (a.static_len += h * (k[2 * c + 1] + g)));
if (0 !== p) {
do {
for (f = n - 1; 0 === a.bl_count[f];) f--;
a.bl_count[f]--, a.bl_count[f + 1] += 2, a.bl_count[n]--, p -= 2
} while (p > 0);
for (f = n; 0 !== f; f--)
for (c = a.bl_count[f]; 0 !== c;) e = a.heap[--b], e > d.max_code || (j[2 * e + 1] != f && (a.opt_len += (f - j[2 * e + 1]) * j[2 * e], j[2 * e + 1] = f), c--)
}
}
function b(a, b) {
var c = 0;
do c |= 1 & a, a >>>= 1, c <<= 1; while (--b > 0);
return c >>> 1
}
function c(a, c, d) {
var e, f, g, h = [],
j = 0;
for (e = 1; i >= e; e++) h[e] = j = j + d[e - 1] << 1;
for (f = 0; c >= f; f++) g = a[2 * f + 1], 0 !== g && (a[2 * f] = b(h[g]++, g))
}
var d = this;
d.build_tree = function(b) {
var e, f, g, h = d.dyn_tree,
i = d.stat_desc.static_tree,
j = d.stat_desc.elems,
k = -1;
for (b.heap_len = 0, b.heap_max = o, e = 0; j > e; e++) 0 !== h[2 * e] ? (b.heap[++b.heap_len] = k = e, b.depth[e] = 0) : h[2 * e + 1] = 0;
for (; b.heap_len < 2;) g = b.heap[++b.heap_len] = 2 > k ? ++k : 0, h[2 * g] = 1, b.depth[g] = 0, b.opt_len--, i && (b.static_len -= i[2 * g + 1]);
for (d.max_code = k, e = Math.floor(b.heap_len / 2); e >= 1; e--) b.pqdownheap(h, e);
g = j;
do e = b.heap[1], b.heap[1] = b.heap[b.heap_len--], b.pqdownheap(h, 1), f = b.heap[1], b.heap[--b.heap_max] = e, b.heap[--b.heap_max] = f, h[2 * g] = h[2 * e] + h[2 * f], b.depth[g] = Math.max(b.depth[e], b.depth[f]) + 1, h[2 * e + 1] = h[2 * f + 1] = g, b.heap[1] = g++, b.pqdownheap(h, 1); while (b.heap_len >= 2);
b.heap[--b.heap_max] = b.heap[1], a(b), c(h, d.max_code, b.bl_count)
}
}
function c(a, b, c, d, e) {
var f = this;
f.static_tree = a, f.extra_bits = b, f.extra_base = c, f.elems = d, f.max_length = e
}
function d(a, b, c, d, e) {
var f = this;
f.good_length = a, f.max_lazy = b, f.nice_length = c, f.max_chain = d, f.func = e
}
function e(a, b, c, d) {
var e = a[2 * b],
f = a[2 * c];
return f > e || e == f && d[b] <= d[c]
}
function f() {
function a() {
var a;
for (Ea = 2 * Aa, Ga[Ia - 1] = 0, a = 0; Ia - 1 > a; a++) Ga[a] = 0;
Va = P[Wa].max_lazy, Ya = P[Wa].good_length, Za = P[Wa].nice_length, Ua = P[Wa].max_chain, Qa = 0, Ma = 0, Sa = 0, Na = Ta = ba - 1, Pa = 0, Ha = 0
}
function d() {
var a;
for (a = 0; n > a; a++) $a[2 * a] = 0;
for (a = 0; j > a; a++) _a[2 * a] = 0;
for (a = 0; k > a; a++) ab[2 * a] = 0;
$a[2 * p] = 1, bb.opt_len = bb.static_len = 0, hb = jb = 0
}
function f() {
cb.dyn_tree = $a, cb.stat_desc = c.static_l_desc, db.dyn_tree = _a, db.stat_desc = c.static_d_desc, eb.dyn_tree = ab, eb.stat_desc = c.static_bl_desc, lb = 0, mb = 0, kb = 8, d()
}
function g(a, b) {
var c, d, e = -1,
f = a[1],
g = 0,
h = 7,
i = 4;
for (0 === f && (h = 138, i = 3), a[2 * (b + 1) + 1] = 65535, c = 0; b >= c; c++) d = f, f = a[2 * (c + 1) + 1], ++g < h && d == f || (i > g ? ab[2 * d] += g : 0 !== d ? (d != e && ab[2 * d]++, ab[2 * r]++) : 10 >= g ? ab[2 * s]++ : ab[2 * t]++, g = 0, e = d, 0 === f ? (h = 138, i = 3) : d == f ? (h = 6, i = 3) : (h = 7, i = 4))
}
function h() {
var a;
for (g($a, cb.max_code), g(_a, db.max_code), eb.build_tree(bb), a = k - 1; a >= 3 && 0 === ab[2 * b.bl_order[a] + 1]; a--);
return bb.opt_len += 3 * (a + 1) + 5 + 5 + 4, a
}
function i(a) {
bb.pending_buf[bb.pending++] = a
}
function l(a) {
i(255 & a), i(a >>> 8 & 255)
}
function o(a) {
i(a >> 8 & 255), i(255 & a & 255)
}
function q(a, b) {
var c, d = b;
mb > u - d ? (c = a, lb |= c << mb & 65535, l(lb), lb = c >>> u - mb, mb += d - u) : (lb |= a << mb & 65535, mb += d)
}
function J(a, b) {
var c = 2 * a;
q(65535 & b[c], 65535 & b[c + 1])
}
function ea(a, b) {
var c, d, e = -1,
f = a[1],
g = 0,
h = 7,
i = 4;
for (0 === f && (h = 138, i = 3), c = 0; b >= c; c++)
if (d = f, f = a[2 * (c + 1) + 1], !(++g < h && d == f)) {
if (i > g) {
do J(d, ab); while (0 !== --g)
} else 0 !== d ? (d != e && (J(d, ab), g--), J(r, ab), q(g - 3, 2)) : 10 >= g ? (J(s, ab), q(g - 3, 3)) : (J(t, ab), q(g - 11, 7));
g = 0, e = d, 0 === f ? (h = 138, i = 3) : d == f ? (h = 6, i = 3) : (h = 7, i = 4)
}
}
function fa(a, c, d) {
var e;
for (q(a - 257, 5), q(c - 1, 5), q(d - 4, 4), e = 0; d > e; e++) q(ab[2 * b.bl_order[e] + 1], 3);
ea($a, a - 1), ea(_a, c - 1)
}
function ga() {
16 == mb ? (l(lb), lb = 0, mb = 0) : mb >= 8 && (i(255 & lb), lb >>>= 8, mb -= 8)
}
function ha() {
q(_ << 1, 3), J(p, c.static_ltree), ga(), 9 > 1 + kb + 10 - mb && (q(_ << 1, 3), J(p, c.static_ltree), ga()), kb = 7
}
function ia(a, c) {
var d, e, f;
if (bb.pending_buf[ib + 2 * hb] = a >>> 8 & 255, bb.pending_buf[ib + 2 * hb + 1] = 255 & a, bb.pending_buf[fb + hb] = 255 & c, hb++, 0 === a ? $a[2 * c]++ : (jb++, a--, $a[2 * (b._length_code[c] + m + 1)]++, _a[2 * b.d_code(a)]++), 0 === (8191 & hb) && Wa > 2) {
for (d = 8 * hb, e = Qa - Ma, f = 0; j > f; f++) d += _a[2 * f] * (5 + b.extra_dbits[f]);
if (d >>>= 3, jb < Math.floor(hb / 2) && d < Math.floor(e / 2)) return !0
}
return hb == gb - 1
}
function ja(a, c) {
var d, e, f, g, h = 0;
if (0 !== hb)
do d = bb.pending_buf[ib + 2 * h] << 8 & 65280 | 255 & bb.pending_buf[ib + 2 * h + 1], e = 255 & bb.pending_buf[fb + h], h++, 0 === d ? J(e, a) : (f = b._length_code[e], J(f + m + 1, a), g = b.extra_lbits[f], 0 !== g && (e -= b.base_length[f], q(e, g)), d--, f = b.d_code(d), J(f, c), g = b.extra_dbits[f], 0 !== g && (d -= b.base_dist[f], q(d, g))); while (hb > h);
J(p, a), kb = a[2 * p + 1]
}
function ka() {
mb > 8 ? l(lb) : mb > 0 && i(255 & lb), lb = 0, mb = 0
}
function la(a, b, c) {
ka(), kb = 8, c && (l(b), l(~b)), bb.pending_buf.set(Da.subarray(a, a + b), bb.pending), bb.pending += b
}
function ma(a, b, c) {
q(($ << 1) + (c ? 1 : 0), 3), la(a, b, !0)
}
function na(a, b, e) {
var f, g, i = 0;
Wa > 0 ? (cb.build_tree(bb), db.build_tree(bb), i = h(), f = bb.opt_len + 3 + 7 >>> 3, g = bb.static_len + 3 + 7 >>> 3, f >= g && (f = g)) : f = g = b + 5, f >= b + 4 && -1 != a ? ma(a, b, e) : g == f ? (q((_ << 1) + (e ? 1 : 0), 3), ja(c.static_ltree, c.static_dtree)) : (q((aa << 1) + (e ? 1 : 0), 3), fa(cb.max_code + 1, db.max_code + 1, i + 1), ja($a, _a)), d(), e && ka()
}
function oa(a) {
na(Ma >= 0 ? Ma : -1, Qa - Ma, a), Ma = Qa, va.flush_pending()
}
function pa() {
var a, b, c, d;
do {
if (d = Ea - Sa - Qa, 0 === d && 0 === Qa && 0 === Sa) d = Aa;
else if (-1 == d) d--;
else if (Qa >= Aa + Aa - da) {
Da.set(Da.subarray(Aa, Aa + Aa), 0), Ra -= Aa, Qa -= Aa, Ma -= Aa, a = Ia, c = a;
do b = 65535 & Ga[--c], Ga[c] = b >= Aa ? b - Aa : 0; while (0 !== --a);
a = Aa, c = a;
do b = 65535 & Fa[--c], Fa[c] = b >= Aa ? b - Aa : 0; while (0 !== --a);
d += Aa
}
if (0 === va.avail_in) return;
a = va.read_buf(Da, Qa + Sa, d), Sa += a, Sa >= ba && (Ha = 255 & Da[Qa], Ha = (Ha << La ^ 255 & Da[Qa + 1]) & Ka)
} while (da > Sa && 0 !== va.avail_in)
}
function qa(a) {
var b, c = 65535;
for (c > xa - 5 && (c = xa - 5);;) {
if (1 >= Sa) {
if (pa(), 0 === Sa && a == z) return R;
if (0 === Sa) break
}
if (Qa += Sa, Sa = 0, b = Ma + c, (0 === Qa || Qa >= b) && (Sa = Qa - b, Qa = b, oa(!1), 0 === va.avail_out)) return R;
if (Qa - Ma >= Aa - da && (oa(!1), 0 === va.avail_out)) return R
}
return oa(a == C), 0 === va.avail_out ? a == C ? T : R : a == C ? U : S
}
function ra(a) {
var b, c, d = Ua,
e = Qa,
f = Ta,
g = Qa > Aa - da ? Qa - (Aa - da) : 0,
h = Za,
i = Ca,
j = Qa + ca,
k = Da[e + f - 1],
l = Da[e + f];
Ta >= Ya && (d >>= 2), h > Sa && (h = Sa);
do
if (b = a, Da[b + f] == l && Da[b + f - 1] == k && Da[b] == Da[e] && Da[++b] == Da[e + 1]) {
e += 2, b++;
do; while (Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && Da[++e] == Da[++b] && j > e);
if (c = ca - (j - e), e = j - ca, c > f) {
if (Ra = a, f = c, c >= h) break;
k = Da[e + f - 1], l = Da[e + f]
}
}
while ((a = 65535 & Fa[a & i]) > g && 0 !== --d);
return Sa >= f ? f : Sa
}
function sa(a) {
for (var b, c = 0;;) {
if (da > Sa) {
if (pa(), da > Sa && a == z) return R;
if (0 === Sa) break
}
if (Sa >= ba && (Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, c = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa), 0 !== c && Aa - da >= (Qa - c & 65535) && Xa != x && (Na = ra(c)), Na >= ba)
if (b = ia(Qa - Ra, Na - ba), Sa -= Na, Va >= Na && Sa >= ba) {
Na--;
do Qa++, Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, c = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa; while (0 !== --Na);
Qa++
} else Qa += Na, Na = 0, Ha = 255 & Da[Qa], Ha = (Ha << La ^ 255 & Da[Qa + 1]) & Ka;
else b = ia(0, 255 & Da[Qa]), Sa--, Qa++;
if (b && (oa(!1), 0 === va.avail_out)) return R
}
return oa(a == C), 0 === va.avail_out ? a == C ? T : R : a == C ? U : S
}
function ta(a) {
for (var b, c, d = 0;;) {
if (da > Sa) {
if (pa(), da > Sa && a == z) return R;
if (0 === Sa) break
}
if (Sa >= ba && (Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, d = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa), Ta = Na, Oa = Ra, Na = ba - 1, 0 !== d && Va > Ta && Aa - da >= (Qa - d & 65535) && (Xa != x && (Na = ra(d)), 5 >= Na && (Xa == w || Na == ba && Qa - Ra > 4096) && (Na = ba - 1)), Ta >= ba && Ta >= Na) {
c = Qa + Sa - ba, b = ia(Qa - 1 - Oa, Ta - ba), Sa -= Ta - 1, Ta -= 2;
do ++Qa <= c && (Ha = (Ha << La ^ 255 & Da[Qa + (ba - 1)]) & Ka, d = 65535 & Ga[Ha], Fa[Qa & Ca] = Ga[Ha], Ga[Ha] = Qa); while (0 !== --Ta);
if (Pa = 0, Na = ba - 1, Qa++, b && (oa(!1), 0 === va.avail_out)) return R
} else if (0 !== Pa) {
if (b = ia(0, 255 & Da[Qa - 1]), b && oa(!1), Qa++, Sa--, 0 === va.avail_out) return R
} else Pa = 1, Qa++, Sa--
}
return 0 !== Pa && (b = ia(0, 255 & Da[Qa - 1]), Pa = 0), oa(a == C), 0 === va.avail_out ? a == C ? T : R : a == C ? U : S
}
function ua(b) {
return b.total_in = b.total_out = 0, b.msg = null, bb.pending = 0, bb.pending_out = 0, wa = W, za = z, f(), a(), D
}
var va, wa, xa, ya, za, Aa, Ba, Ca, Da, Ea, Fa, Ga, Ha, Ia, Ja, Ka, La, Ma, Na, Oa, Pa, Qa, Ra, Sa, Ta, Ua, Va, Wa, Xa, Ya, Za, $a, _a, ab, bb = this,
cb = new b,
db = new b,
eb = new b;
bb.depth = [];
var fb, gb, hb, ib, jb, kb, lb, mb;
bb.bl_count = [], bb.heap = [], $a = [], _a = [], ab = [], bb.pqdownheap = function(a, b) {
for (var c = bb.heap, d = c[b], f = b << 1; f <= bb.heap_len && (f < bb.heap_len && e(a, c[f + 1], c[f], bb.depth) && f++, !e(a, d, c[f], bb.depth));) c[b] = c[f], b = f, f <<= 1;
c[b] = d
}, bb.deflateInit = function(a, b, c, d, e, f) {
return d || (d = Z), e || (e = L), f || (f = y), a.msg = null, b == v && (b = 6), 1 > e || e > K || d != Z || 9 > c || c > 15 || 0 > b || b > 9 || 0 > f || f > x ? G : (a.dstate = bb, Ba = c, Aa = 1 << Ba, Ca = Aa - 1, Ja = e + 7, Ia = 1 << Ja, Ka = Ia - 1, La = Math.floor((Ja + ba - 1) / ba), Da = new Uint8Array(2 * Aa), Fa = [], Ga = [], gb = 1 << e + 6, bb.pending_buf = new Uint8Array(4 * gb), xa = 4 * gb, ib = Math.floor(gb / 2), fb = 3 * gb, Wa = b, Xa = f, ya = 255 & d, ua(a))
}, bb.deflateEnd = function() {
return wa != W && wa != X && wa != Y ? G : (bb.pending_buf = null, Ga = null, Fa = null, Da = null, bb.dstate = null, wa == X ? H : D)
}, bb.deflateParams = function(a, b, c) {
var d = D;
return b == v && (b = 6), 0 > b || b > 9 || 0 > c || c > x ? G : (P[Wa].func != P[b].func && 0 !== a.total_in && (d = a.deflate(A)), Wa != b && (Wa = b, Va = P[Wa].max_lazy, Ya = P[Wa].good_length, Za = P[Wa].nice_length, Ua = P[Wa].max_chain), Xa = c, d)
}, bb.deflateSetDictionary = function(a, b, c) {
var d, e = c,
f = 0;
if (!b || wa != W) return G;
if (ba > e) return D;
for (e > Aa - da && (e = Aa - da, f = c - e), Da.set(b.subarray(f, f + e), 0), Qa = e, Ma = e, Ha = 255 & Da[0], Ha = (Ha << La ^ 255 & Da[1]) & Ka, d = 0; e - ba >= d; d++) Ha = (Ha << La ^ 255 & Da[d + (ba - 1)]) & Ka, Fa[d & Ca] = Ga[Ha], Ga[Ha] = d;
return D
}, bb.deflate = function(a, b) {
var c, d, e, f, g;
if (b > C || 0 > b) return G;
if (!a.next_out || !a.next_in && 0 !== a.avail_in || wa == Y && b != C) return a.msg = Q[F - G], G;
if (0 === a.avail_out) return a.msg = Q[F - I], I;
if (va = a, f = za, za = b, wa == W && (d = Z + (Ba - 8 << 4) << 8, e = (Wa - 1 & 255) >> 1, e > 3 && (e = 3), d |= e << 6, 0 !== Qa && (d |= V), d += 31 - d % 31, wa = X, o(d)), 0 !== bb.pending) {
if (va.flush_pending(), 0 === va.avail_out) return za = -1, D
} else if (0 === va.avail_in && f >= b && b != C) return va.msg = Q[F - I], I;
if (wa == Y && 0 !== va.avail_in) return a.msg = Q[F - I], I;
if (0 !== va.avail_in || 0 !== Sa || b != z && wa != Y) {
switch (g = -1, P[Wa].func) {
case M:
g = qa(b);
break;
case N:
g = sa(b);
break;
case O:
g = ta(b)
}
if ((g == T || g == U) && (wa = Y), g == R || g == T) return 0 === va.avail_out && (za = -1), D;
if (g == S) {
if (b == A) ha();
else if (ma(0, 0, !1), b == B)
for (c = 0; Ia > c; c++) Ga[c] = 0;
if (va.flush_pending(), 0 === va.avail_out) return za = -1, D
}
}
return b != C ? D : E
}
}
function g() {
var a = this;
a.next_in_index = 0, a.next_out_index = 0, a.avail_in = 0, a.total_in = 0, a.avail_out = 0, a.total_out = 0
}
function h(a) {
var b = this,
c = new g,
d = 512,
e = z,
f = new Uint8Array(d);
"undefined" == typeof a && (a = v), c.deflateInit(a), c.next_out = f, b.append = function(a, b) {
var g, h, i = [],
j = 0,
k = 0,
l = 0;
if (a.length) {
c.next_in_index = 0, c.next_in = a, c.avail_in = a.length;
do {
if (c.next_out_index = 0, c.avail_out = d, g = c.deflate(e), g != D) throw "deflating: " + c.msg;
c.next_out_index && i.push(c.next_out_index == d ? new Uint8Array(f) : new Uint8Array(f.subarray(0, c.next_out_index))), l += c.next_out_index, b && c.next_in_index > 0 && c.next_in_index != j && (b(c.next_in_index), j = c.next_in_index)
} while (c.avail_in > 0 || 0 === c.avail_out);
return h = new Uint8Array(l), i.forEach(function(a) {
h.set(a, k), k += a.length
}), h
}
}, b.flush = function() {
var a, b, e = [],
g = 0,
h = 0;
do {
if (c.next_out_index = 0, c.avail_out = d, a = c.deflate(C), a != E && a != D) throw "deflating: " + c.msg;
d - c.avail_out > 0 && e.push(new Uint8Array(f.subarray(0, c.next_out_index))), h += c.next_out_index
} while (c.avail_in > 0 || 0 === c.avail_out);
return c.deflateEnd(), b = new Uint8Array(h), e.forEach(function(a) {
b.set(a, g), g += a.length
}), b
}
}
var i = 15,
j = 30,
k = 19,
l = 29,
m = 256,
n = m + 1 + l,
o = 2 * n + 1,
p = 256,
q = 7,
r = 16,
s = 17,
t = 18,
u = 16,
v = -1,
w = 1,
x = 2,
y = 0,
z = 0,
A = 1,
B = 3,
C = 4,
D = 0,
E = 1,
F = 2,
G = -2,
H = -3,
I = -5,
J = [0, 1, 2, 3, 4, 4, 5, 5, 6, 6, 6, 6, 7, 7, 7, 7, 8, 8, 8, 8, 8, 8, 8, 8, 9, 9, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 11, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 12, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 13, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 14, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 15, 0, 0, 16, 17, 18, 18, 19, 19, 20, 20, 20, 20, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 28, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29, 29];
b._length_code = [0, 1, 2, 3, 4, 5, 6, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15, 15, 15, 15, 16, 16, 16, 16, 16, 16, 16, 16, 17, 17, 17, 17, 17, 17, 17, 17, 18, 18, 18, 18, 18, 18, 18, 18, 19, 19, 19, 19, 19, 19, 19, 19, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 21, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 22, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 23, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 24, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 25, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 26, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 27, 28], b.base_length = [0, 1, 2, 3, 4, 5, 6, 7, 8, 10, 12, 14, 16, 20, 24, 28, 32, 40, 48, 56, 64, 80, 96, 112, 128, 160, 192, 224, 0], b.base_dist = [0, 1, 2, 3, 4, 6, 8, 12, 16, 24, 32, 48, 64, 96, 128, 192, 256, 384, 512, 768, 1024, 1536, 2048, 3072, 4096, 6144, 8192, 12288, 16384, 24576], b.d_code = function(a) {
return 256 > a ? J[a] : J[256 + (a >>> 7)]
}, b.extra_lbits = [0, 0, 0, 0, 0, 0, 0, 0, 1, 1, 1, 1, 2, 2, 2, 2, 3, 3, 3, 3, 4, 4, 4, 4, 5, 5, 5, 5, 0], b.extra_dbits = [0, 0, 0, 0, 1, 1, 2, 2, 3, 3, 4, 4, 5, 5, 6, 6, 7, 7, 8, 8, 9, 9, 10, 10, 11, 11, 12, 12, 13, 13], b.extra_blbits = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 3, 7], b.bl_order = [16, 17, 18, 0, 8, 7, 9, 6, 10, 5, 11, 4, 12, 3, 13, 2, 14, 1, 15], c.static_ltree = [12, 8, 140, 8, 76, 8, 204, 8, 44, 8, 172, 8, 108, 8, 236, 8, 28, 8, 156, 8, 92, 8, 220, 8, 60, 8, 188, 8, 124, 8, 252, 8, 2, 8, 130, 8, 66, 8, 194, 8, 34, 8, 162, 8, 98, 8, 226, 8, 18, 8, 146, 8, 82, 8, 210, 8, 50, 8, 178, 8, 114, 8, 242, 8, 10, 8, 138, 8, 74, 8, 202, 8, 42, 8, 170, 8, 106, 8, 234, 8, 26, 8, 154, 8, 90, 8, 218, 8, 58, 8, 186, 8, 122, 8, 250, 8, 6, 8, 134, 8, 70, 8, 198, 8, 38, 8, 166, 8, 102, 8, 230, 8, 22, 8, 150, 8, 86, 8, 214, 8, 54, 8, 182, 8, 118, 8, 246, 8, 14, 8, 142, 8, 78, 8, 206, 8, 46, 8, 174, 8, 110, 8, 238, 8, 30, 8, 158, 8, 94, 8, 222, 8, 62, 8, 190, 8, 126, 8, 254, 8, 1, 8, 129, 8, 65, 8, 193, 8, 33, 8, 161, 8, 97, 8, 225, 8, 17, 8, 145, 8, 81, 8, 209, 8, 49, 8, 177, 8, 113, 8, 241, 8, 9, 8, 137, 8, 73, 8, 201, 8, 41, 8, 169, 8, 105, 8, 233, 8, 25, 8, 153, 8, 89, 8, 217, 8, 57, 8, 185, 8, 121, 8, 249, 8, 5, 8, 133, 8, 69, 8, 197, 8, 37, 8, 165, 8, 101, 8, 229, 8, 21, 8, 149, 8, 85, 8, 213, 8, 53, 8, 181, 8, 117, 8, 245, 8, 13, 8, 141, 8, 77, 8, 205, 8, 45, 8, 173, 8, 109, 8, 237, 8, 29, 8, 157, 8, 93, 8, 221, 8, 61, 8, 189, 8, 125, 8, 253, 8, 19, 9, 275, 9, 147, 9, 403, 9, 83, 9, 339, 9, 211, 9, 467, 9, 51, 9, 307, 9, 179, 9, 435, 9, 115, 9, 371, 9, 243, 9, 499, 9, 11, 9, 267, 9, 139, 9, 395, 9, 75, 9, 331, 9, 203, 9, 459, 9, 43, 9, 299, 9, 171, 9, 427, 9, 107, 9, 363, 9, 235, 9, 491, 9, 27, 9, 283, 9, 155, 9, 411, 9, 91, 9, 347, 9, 219, 9, 475, 9, 59, 9, 315, 9, 187, 9, 443, 9, 123, 9, 379, 9, 251, 9, 507, 9, 7, 9, 263, 9, 135, 9, 391, 9, 71, 9, 327, 9, 199, 9, 455, 9, 39, 9, 295, 9, 167, 9, 423, 9, 103, 9, 359, 9, 231, 9, 487, 9, 23, 9, 279, 9, 151, 9, 407, 9, 87, 9, 343, 9, 215, 9, 471, 9, 55, 9, 311, 9, 183, 9, 439, 9, 119, 9, 375, 9, 247, 9, 503, 9, 15, 9, 271, 9, 143, 9, 399, 9, 79, 9, 335, 9, 207, 9, 463, 9, 47, 9, 303, 9, 175, 9, 431, 9, 111, 9, 367, 9, 239, 9, 495, 9, 31, 9, 287, 9, 159, 9, 415, 9, 95, 9, 351, 9, 223, 9, 479, 9, 63, 9, 319, 9, 191, 9, 447, 9, 127, 9, 383, 9, 255, 9, 511, 9, 0, 7, 64, 7, 32, 7, 96, 7, 16, 7, 80, 7, 48, 7, 112, 7, 8, 7, 72, 7, 40, 7, 104, 7, 24, 7, 88, 7, 56, 7, 120, 7, 4, 7, 68, 7, 36, 7, 100, 7, 20, 7, 84, 7, 52, 7, 116, 7, 3, 8, 131, 8, 67, 8, 195, 8, 35, 8, 163, 8, 99, 8, 227, 8], c.static_dtree = [0, 5, 16, 5, 8, 5, 24, 5, 4, 5, 20, 5, 12, 5, 28, 5, 2, 5, 18, 5, 10, 5, 26, 5, 6, 5, 22, 5, 14, 5, 30, 5, 1, 5, 17, 5, 9, 5, 25, 5, 5, 5, 21, 5, 13, 5, 29, 5, 3, 5, 19, 5, 11, 5, 27, 5, 7, 5, 23, 5], c.static_l_desc = new c(c.static_ltree, b.extra_lbits, m + 1, n, i), c.static_d_desc = new c(c.static_dtree, b.extra_dbits, 0, j, i), c.static_bl_desc = new c(null, b.extra_blbits, 0, k, q);
var K = 9,
L = 8,
M = 0,
N = 1,
O = 2,
P = [new d(0, 0, 0, 0, M), new d(4, 4, 8, 4, N), new d(4, 5, 16, 8, N), new d(4, 6, 32, 32, N), new d(4, 4, 16, 16, O), new d(8, 16, 32, 32, O), new d(8, 16, 128, 128, O), new d(8, 32, 128, 256, O), new d(32, 128, 258, 1024, O), new d(32, 258, 258, 4096, O)],
Q = ["need dictionary", "stream end", "", "", "stream error", "data error", "", "buffer error", "", ""],
R = 0,
S = 1,
T = 2,
U = 3,
V = 32,
W = 42,
X = 113,
Y = 666,
Z = 8,
$ = 0,
_ = 1,
aa = 2,
ba = 3,
ca = 258,
da = ca + ba + 1;
g.prototype = {
deflateInit: function(a, b) {
var c = this;
return c.dstate = new f, b || (b = i), c.dstate.deflateInit(c, a, b)
},
deflate: function(a) {
var b = this;
return b.dstate ? b.dstate.deflate(b, a) : G
},
deflateEnd: function() {
var a = this;
if (!a.dstate) return G;
var b = a.dstate.deflateEnd();
return a.dstate = null, b
},
deflateParams: function(a, b) {
var c = this;
return c.dstate ? c.dstate.deflateParams(c, a, b) : G
},
deflateSetDictionary: function(a, b) {
var c = this;
return c.dstate ? c.dstate.deflateSetDictionary(c, a, b) : G
},
read_buf: function(a, b, c) {
var d = this,
e = d.avail_in;
return e > c && (e = c), 0 === e ? 0 : (d.avail_in -= e, a.set(d.next_in.subarray(d.next_in_index, d.next_in_index + e), b), d.next_in_index += e, d.total_in += e, e)
},
flush_pending: function() {
var a = this,
b = a.dstate.pending;
b > a.avail_out && (b = a.avail_out), 0 !== b && (a.next_out.set(a.dstate.pending_buf.subarray(a.dstate.pending_out, a.dstate.pending_out + b), a.next_out_index), a.next_out_index += b, a.dstate.pending_out += b, a.total_out += b, a.avail_out -= b, a.dstate.pending -= b, 0 === a.dstate.pending && (a.dstate.pending_out = 0))
}
};
var ea;
a.zip ? a.zip.Deflater = h : (ea = new h, a.addEventListener("message", function(b) {
var c = b.data;
c.init && (ea = new h(c.level), a.postMessage({
oninit: !0
})), c.append && a.postMessage({
onappend: !0,
data: ea.append(c.data, function(b) {
a.postMessage({
progress: !0,
current: b
})
})
}), c.flush && a.postMessage({
onflush: !0,
data: ea.flush()
})
}, !1))
}(this)
}! function(b) {
function c() {
var a = -1,
b = this;
b.append = function(c) {
var d, e = b.table;
for (d = 0; d < c.length; d++) a = a >>> 8 ^ e[255 & (a ^ c[d])]
}, b.get = function() {
return ~a
}
}
function d(a, b, c) {
return a.slice ? a.slice(b, b + c) : a.webkitSlice ? a.webkitSlice(b, b + c) : a.mozSlice ? a.mozSlice(b, b + c) : a.msSlice ? a.msSlice(b, b + c) : void 0
}
function e() {}
function f(a) {
function b(b, c) {
var f = new Blob([a], {
type: s
});
d = new g(f), d.init(function() {
e.size = d.size, b()
}, c)
}
function c(a, b, c, e) {
d.readUint8Array(a, b, c, e)
}
var d, e = this;
e.size = 0, e.init = b, e.readUint8Array = c
}
function g(a) {
function b(b) {
this.size = a.size, b()
}
function c(b, c, e, f) {
var g = new FileReader;
g.onload = function(a) {
e(new Uint8Array(a.target.result))
}, g.onerror = f, g.readAsArrayBuffer(d(a, b, c))
}
var e = this;
e.size = 0, e.init = b, e.readUint8Array = c
}
function h() {}
function i(a) {
function b(b) {
e = new Blob([], {
type: a
}), b()
}
function c(b, c) {
e = new Blob([e, o ? b : b.buffer], {
type: a
}), c()
}
function d(a) {
a(e)
}
var e, f = this;
f.init = b, f.writeUint8Array = c, f.getData = d
}
function j(a, b, c, d, e, f, g, h, i, j, k) {
function l() {
a.removeEventListener(t, m, !1), i(p)
}
function m(a) {
var b = a.data,
d = b.data;
b.onappend && (p += d.length, c.writeUint8Array(d, function() {
f(!1, d), n()
}, k)), b.onflush && (d ? (p += d.length, c.writeUint8Array(d, function() {
f(!1, d), l()
}, k)) : l()), b.progress && g && g(o + b.current, e)
}
function n() {
o = s * r, e > o ? b.readUint8Array(d + o, Math.min(r, e - o), function(b) {
q || (q = !0, h && h()), a.postMessage({
append: !0,
data: b
}), s++, f(!0, b)
}, j) : a.postMessage({
flush: !0
})
}
var o, p, q, s = 0;
p = 0, a.addEventListener(t, m, !1), n()
}
function k(a, b, c, d, e, f, g, h, i, j, k) {
function l() {
var s;
m = n * r, e > m ? b.readUint8Array(d + m, Math.min(r, e - m), function(b) {
q || (q = !0, h && h()), s = a.append(b, function() {}), p !== !1 && (g && g(d + m + r, e), o += s.length, f(!0, b), c.writeUint8Array(s, function() {
f(!1, s), n++, setTimeout(l, 1)
}, k))
}, j) : (s = a.flush(), s ? (o += s.length, c.writeUint8Array(s, function() {
f(!1, s), i(o)
}, k)) : i(o))
}
var m, n = 0,
o = 0,
p = !0,
q = !1;
return l(), {
terminate: function() {
p = !1
}
}
}
function l(d, e, f, g, h, i, l, m) {
function n(a, b) {
a && s.append(b)
}
function o(a) {
g(a, s.get()), URL.revokeObjectURL(r)
}
function p() {
q.removeEventListener(t, p, !1), j(q, d, e, 0, d.size, n, h, i, o, l, m)
}
var q, r, s = new c;
return b.Deflater.useWebWorkers ? (r = URL.createObjectURL(new Blob(["(", a.toString(), ")()"], {
type: "application/javascript"
})), q = new Worker(r), q.addEventListener(t, p, !1), q.postMessage({
init: !0,
level: f
})) : q = k(new b.zip.Deflater, d, e, 0, d.size, n, h, i, o, l, m), q
}
function m(a, b, d, e, f, g, h, i, j, k) {
function l() {
var c = m * r;
e > c ? a.readUint8Array(d + c, Math.min(r, e - c), function(a) {
o || (o = !0, i && i()), f && n.append(a), h && h(c, e, a), b.writeUint8Array(a, function() {
m++, l()
}, k)
}, j) : g(e, n.get())
}
var m = 0,
n = new c,
o = !1;
l()
}
function n(a, b) {
function c(a, b) {
f && f.terminate(), f = null, a && a(b)
}
function d() {
c(b, p)
}
function e() {
c(b, q)
}
var f;
return {
deflate: function(b, g, h, i, j) {
function k() {
c(function() {
a.getData(g)
})
}
function n() {
j = j || {}, b ? 0 === j.level ? m(b, a, 0, b.size, !0, k, h, i, e, d) : f = l(b, a, j.level, k, h, i, e, d) : k()
}
b ? b.init(n, e) : n()
},
cancel: c
}
}
var o, p = "Error while writing file data.",
q = "Error while reading file data.",
r = 16384,
s = "text/plain",
t = "message";
try {
o = 0 === new Blob([new DataView(new ArrayBuffer(0))]).size
} catch (u) {}
c.prototype.table = function() {
var a, b, c, d = [];
for (a = 0; 256 > a; a++) {
for (c = a, b = 0; 8 > b; b++) 1 & c ? c = c >>> 1 ^ 3988292384 : c >>>= 1;
d[a] = c
}
return d
}(), f.prototype = new e, f.prototype.constructor = f, g.prototype = new e, g.prototype.constructor = g, h.prototype.getData = function(a) {
a(this.data)
}, i.prototype = new h, i.prototype.constructor = i, b.zip = {}, b.Deflater = function() {}, b.Deflater.prototype = {
deflateText: function(a, b, c, d, e, g) {
var h = new i("application/octet-stream"),
j = this;
h.init(function() {
j.deflateWriter = n(h, c, !1);
var i = new f(a);
j.deflateWriter.deflate(i, b, d, e, g)
})
},
cancel: function() {
this.deflateWriter && (this.deflateWriter.cancel(), delete this.deflateWriter)
}
};
var v = !1;
try {
new Worker(URL.createObjectURL(new Blob(["//test"], {
type: "application/javascript"
}))), v = !0
} catch (w) {}
b.Deflater.useWebWorkers = v
}(this);
var b = !1;
try {
new Worker(URL.createObjectURL(new Blob(["//test"], {
type: "application/javascript"
}))), b = !0
} catch (c) {}
b || a.call(this)
}
var b = new a;
"undefined" != typeof exports ? module.exports = b.Deflater : "undefined" != typeof define && define("Deflater", [], function() {
return b.Deflater
})
}(), define("HTTP", ["require", "exports", "HTTPRequest", "Ajax", "Logger", "Deflater"], function(a, b, c, d, e, f) {
var g = function() {
function a() {}
return a.compressData = function(a, b) {
var c, d, e = this,
g = new f,
h = 0,
i = 0,
j = 200,
k = function() {
var d = i * h / 1024,
f = Math.round(d / (Date.now() - c) * 1e4) / 10;
e.logger.debug("Compression performance after " + j + "ms: " + d + "KB compressed (" + f + "KB/sec)"), 0 === d && (g.cancel(), e.logger.debug("Cancelling POST compression due to low performance"), b(a, !1))
},
l = function() {
d = setTimeout(k, j), c = Date.now()
},
m = function(a, b) {
0 === h && (h = a), i += 1
},
n = function(f) {
var g = Date.now() - c;
d && (clearTimeout(d), d = null), e.logger.debug("Compressed request data in " + g + "ms, " + Math.round(f.size / 10.24) / 100 + "KB / " + Math.round(a.length / 10.24) / 100 + "KB (" + Math.round(f.size / a.length * 100) + "% of original):"), b(f, !0)
},
o = function(c) {
d && (clearTimeout(d), d = null), b(a, !1)
},
p = {};
try {
g.deflateText(a, n, o, m, l, p)
} catch (q) {
o()
}
}, a.request = function(a) {
var b = this,
e = new c,
f = {
url: a.url,
type: a.type,
data: a.data,
timeout: "number" == typeof a.timeout ? 1e3 * a.timeout : void 0,
xhrFields: a.xhrFields,
onloadstart: a.onloadstart,
onprogress: a.onprogress,
dataType: a.dataType,
success: function(c, d, e, f) {
var g = (f.latency / 1e3).toFixed(1),
h = (f.duration / 1e3).toFixed(1);
b.logger.log("HTTP complete, status=" + e.status + ", latency=" + g + "s, duration=" + h + "s, url=" + a.url), a.success && a.success(c, d, e, f)
},
error: function(c, d, f, g) {
var h = "unknown";
c.readyState >= 4 && (h = c.status.toString()), e.isAborted() || b.logger.error("HTTP error, status=" + h + ", type=" + d + ", message=" + f + ", url=" + a.url), a.error && a.error(c, d, f, g)
}
};
return this.logger.log("HTTP load, timeout=" + a.timeout + " url=" + a.url), e.setXMLHttpRequest(d.request(f)), e
}, a.logger = new e("HTTP"), a
}();
return g
}), define("HTTPRequestQueue", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.requestQueue = []
}
return a.prototype.addRequest = function(a) {
var b = this.requestQueue.length;
return this.requestQueue.push(a), b
}, a.prototype.removeRequest = function(b) {
var c = this.requestQueue[b];
a.abortRequest(c), this.requestQueue.slice(b, 1)
}, a.prototype.removeAllRequests = function() {
this.requestQueue.forEach(function(b) {
a.abortRequest(b)
}), this.requestQueue = []
}, a.abortRequest = function(a) {
a && (a.getReadyState() > 1 || a.getReadyState() < 4) && a.abort()
}, a
}();
return c
}), define("LiveRailResponse", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.content = a.TYPE_UNKNOWN
}
return a.TYPE_UNKNOWN = null, a.TYPE_SOURCES = "sources", a.TYPE_ADS = "ads", a.TYPE_ERROR = "error", a
}();
return c
}), define("AdAsset", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b, c, d, e) {
this.mimeType = d, this.kbps = e, this.width = a, this.height = b, this.url = c
}
return a.prototype.getMimeType = function() {
return this.mimeType
}, a.prototype.getKbps = function() {
return this.kbps
}, a.prototype.getWidth = function() {
return this.width
}, a.prototype.getHeight = function() {
return this.height
}, a.prototype.getUrl = function() {
return this.url
}, a.prototype.toString = function() {
return "kbps=" + this.kbps + " width=" + this.width + " height=" + this.height + " mime=" + this.mimeType + " url=" + this.url
}, a.prototype.requiresFlash = function() {
return "video/x-flv" === this.mimeType || "application/x-shockwave-flash" === this.mimeType
}, a
}();
return c
}), define("AdExtension", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b) {
this.id = a, this.url = b
}
return a.prototype.getId = function() {
return this.id
}, a.prototype.getUrl = function() {
return this.url
}, a
}();
return c
}), define("AdSlot", ["require", "exports", "Tracker", "AdCandidate"], function(a, b, c, d) {
var e = function() {
function a(a, b) {
this.trackers = {}, this.adCandidates = [], this.adCandidateIndex = -1, this.impressionOccurred = !1, this.type = a, this.rule = b
}
return a.prototype.addTracker = function(a) {
if (null !== a) {
var b = c.formTrackerKey(a.getType(), a.getValue());
this.trackers[b] || (this.trackers[b] = []), this.trackers[b].push(a)
}
}, a.prototype.addAdCandidate = function(a) {
null !== a && this.adCandidates.push(a)
}, a.prototype.getTrackers = function(a, b) {
var d = c.formTrackerKey(a, b);
return this.trackers[d] || null
}, a.prototype.getUniqueAdapterIds = function() {
var a = [],
b = {};
return this.adCandidates.forEach(function(c) {
b[c.adapter] || (a.push(c.adapter), b[c.adapter] = !0)
}), a
}, a.prototype.getNextAdCandidate = function() {
var a = null;
return this.adCandidateIndex + 1 < this.adCandidates.length && (this.adCandidateIndex += 1, a = this.adCandidates[this.adCandidateIndex]), a
}, a.prototype.getAdCandidateCount = function() {
return this.adCandidates.length
}, a.prototype.registerImpression = function() {
var a = this.adCandidates[this.adCandidateIndex];
(a.type === d.TYPE_LINEAR || a.type === d.TYPE_OVERLAY) && (this.adCandidates[this.adCandidateIndex].registerImpression(), this.impressionOccurred = !0)
}, a.prototype.hadImpression = function() {
return this.impressionOccurred
}, a.TYPE_LINEAR = "in", a.TYPE_OVERLAY = "ov", a
}();
return e
}), define("AdSource", ["require", "exports"], function(a, b) {
var c = function() {
function a(a) {
this.url = null, this.erc = null, this.attributes = {}, this.priorities = [], this.url = a
}
return a.prototype.hasValidUrl = function() {
return null !== this.url && this.url.trim().length > 0
}, a.prototype.getUrl = function() {
return this.url
}, a.prototype.getErc = function() {
return this.erc
}, a.prototype.setErc = function(a) {
var b = parseInt(a, 10);
isNaN(b) || (this.erc = b)
}, a.prototype.getAttributes = function() {
return this.attributes
}, a.prototype.getAttribute = function(a) {
return void 0 !== this.attributes[a] ? this.attributes[a] : null
}, a.prototype.setAttribute = function(a, b) {
this.attributes[a] = b
}, a.prototype.getPriorities = function() {
return this.priorities
}, a.prototype.addPriority = function(a) {
this.priorities.push(a)
}, a.prototype.setPriorityDepth = function(a) {
this.priorityDepth = a
}, a
}();
return c
}), define("CompanionAd", ["require", "exports", "Tracker"], function(a, b, c) {
var d = function() {
function a(a, b, c, d) {
this.trackers = {}, this.type = a, this.size = b, this.content = c, this.clickUrl = d
}
return a.prototype.getType = function() {
return this.type
}, a.prototype.getSize = function() {
return this.size
}, a.prototype.getWidth = function() {
var a = null;
if (this.size) {
var b = parseInt(this.size.split("x")[0], 10);
isNaN(b) || (a = b)
}
return a
}, a.prototype.getHeight = function() {
var a = null;
if (this.size) {
var b = parseInt(this.size.split("x")[1], 10);
isNaN(b) || (a = b)
}
return a
}, a.prototype.getContent = function() {
return this.content
}, a.prototype.getClickUrl = function() {
return this.clickUrl
}, a.prototype.addTracker = function(a) {
if (null !== a) {
var b = c.formTrackerKey(a.getType(), a.getValue());
this.trackers[b] || (this.trackers[b] = []), this.trackers[b].push(a)
}
}, a.prototype.getTrackers = function(a, b) {
var d = c.formTrackerKey(a, b);
return this.trackers[d] || null
}, a
}();
return d
}),
function() {
"use strict";
var a = {};
a.parse = function(a, b) {
function c(a) {
return /^\s*$/.test(a) ? null : a
}
function d(a, b) {
var e, f, g, h, i, j = null,
k = 0,
l = "",
m = !1;
if (a.attributes && a.attributes.length > 0)
for (j = {}, k = 0; k < a.attributes.length; k += 1) e = a.attributes.item(k), j["@" + e.name] = c(e.value.trim());
if (a.childNodes && a.childNodes.length > 0)
for (i = 0; i < a.childNodes.length; i += 1) f = a.childNodes.item(i), 4 === f.nodeType ? (0 === l.length && (m = !0, l = " "), l += f.nodeValue, m && l.length > 1 && (m = !1, l = l.substring(1))) : 3 === f.nodeType ? l += f.nodeValue.trim() : 1 !== f.nodeType || f.prefix || (0 === k && (j = {}), g = f.nodeName.toLowerCase(), h = d(f, b), j.hasOwnProperty(g) ? (j[g].constructor !== Array && (j[g] = [j[g]]), j[g].push(h)) : (b[f.nodeName.toLowerCase()] ? j[g] = [h] : j[g] = h, k += 1));
return l && (k > 0 ? j.cdata = c(l) : j = c(l)), k > 0 && "function" == typeof Object.freeze && Object.freeze(j), j
}
return "object" != typeof b && (b = {}), "object" == typeof a ? d(a, b) : null
}, "object" == typeof exports ? module.exports = a : "function" == typeof define && define("JXONParser", [], function() {
return a
})
}(), define("LinearCreative", ["require", "exports", "Logger"], function(a, b, c) {
var d = function() {
function a(a, b, d, e) {
this.logger = new c("LinearCreative"), this.skipOffset = null, this.skipIsPercent = !1, this.assets = [], this.type = a, this.duration = b, this.skipOffset = d, this.skipIsPercent = e
}
return a.prototype.getType = function() {
return this.type
}, a.prototype.getDuration = function() {
return this.duration
}, a.prototype.getSkipOffset = function() {
return this.skipOffset
}, a.prototype.getSkipIsPercent = function() {
return this.skipIsPercent
}, a.prototype.addAdAsset = function(a) {
null !== a && this.assets.push(a)
}, a.prototype.getAdAsset = function(a, b) {
var c = this,
d = null,
e = {},
f = {};
return this.assets.forEach(function(b, d) {
c.logger.debug("Considering linear asset at index " + d + " (" + b.toString() + ")");
var g = e[b.getMimeType()],
h = f[b.getMimeType()];
(!h || h.getKbps() > b.getKbps()) && (f[b.getMimeType()] = b), b.getKbps() <= a && (!g || b.getKbps() > g.getKbps()) && (e[b.getMimeType()] = b)
}), b.every(function(a) {
return d = e[a] || f[a], d ? !1 : !0
}), this.logger.debug("Selected linear asset: " + d.toString()), d
}, a
}();
return d
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LiveRailResponseSources", ["require", "exports", "LiveRailResponse"], function(a, b, c) {
var d = function(a) {
function b() {
a.call(this), this.data = null, this.content = c.TYPE_SOURCES
}
return __extends(b, a), b.prototype.getData = function() {
return this.data
}, b.prototype.setData = function(a) {
"string" == typeof a && a.trim().length > 0 && (this.data = a)
}, b.prototype.addAdSource = function(a) {
this.adSources || (this.adSources = []), this.adSources.push(a)
}, b.prototype.getAdSources = function() {
return this.adSources
}, b
}(c);
return d
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LiveRailResponseSlots", ["require", "exports", "LiveRailResponse"], function(a, b, c) {
var d = function(a) {
function b() {
a.call(this), this.setupGeo = "", this.trid = "", this.placementDefinition = null, this.adSlots = [], this.adSlotIndex = -1, this.content = c.TYPE_ADS
}
return __extends(b, a), b.prototype.getSetupGeo = function() {
return this.setupGeo
}, b.prototype.setSetupGeo = function(a) {
this.setupGeo = a
}, b.prototype.getTrid = function() {
return this.trid
}, b.prototype.setTrid = function(a) {
this.trid = a
}, b.prototype.getPlacementDefinition = function() {
return this.placementDefinition
}, b.prototype.setPlacementDefinition = function(a) {
this.placementDefinition = a
}, b.prototype.addAdSlot = function(a) {
this.adSlots.push(a)
}, b.prototype.getAdSlots = function() {
return this.adSlots
}, b.prototype.getNextAdSlot = function() {
var a = null;
return this.adSlotIndex + 1 < this.adSlots.length && (this.adSlotIndex += 1, a = this.adSlots[this.adSlotIndex]), a
}, b.prototype.getUniqueAdapterIds = function() {
var a = [],
b = {};
return this.adSlots.forEach(function(c) {
c.getUniqueAdapterIds().forEach(function(c) {
b[c] || (a.push(c), b[c] = !0)
})
}), a
}, b.prototype.getAdCandidateCount = function() {
var a = 0;
return this.adSlots.forEach(function(b) {
a += b.getAdCandidateCount()
}), a
}, b
}(c);
return d
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
define("LiveRailResponseError", ["require", "exports", "LiveRailResponse"], function(a, b, c) {
var d = function(a) {
function b(b) {
a.call(this), this.content = c.TYPE_ERROR, this.errorMsg = b
}
return __extends(b, a), b
}(c);
return d
}), define("NonLinearCreative", ["require", "exports"], function(a, b) {
var c = function() {
function a(a) {
this.type = a
}
return a.prototype.getAdAsset = function() {
return this.asset
}, a.prototype.setAdAsset = function(a) {
this.asset = a
}, a
}();
return c
}), define("PlacementDefinition", ["require", "exports", "Utils"], function(a, b, c) {
var d = function() {
function a(b) {
if (this.placementType = 0, this.minViewabilityPercentage = a.DEFAULT_MIN_VIEWABILITY_PERCENTAGE, this.minViewabilityDuration = 0, this.refreshInterval = a.DEFAULT_REFRESH_INTERVAL_SECONDS, this.refreshThreshold = a.DEFAULT_REFRESH_THRESHOLD_SECONDS, this.maxDuration = 0, this.maxPodSlots = 1, this.maxPodDuration = 0, this.allowExpand = !0, this.allowSMS = !0, this.allowTelephone = !0, this.allowWebcal = !0, this.allowResize = !0, this.allowPhoto = !0, this.allowCalendar = !0, this.indexMessage = null, this.countdownMessage = "Advertisement ({COUNTDOWNTIME})", this.clickthroughMessage = "Learn More »", this.skipCountdownMessage = "Skip ad in {COUNTDOWN}", this.skipMessage = "Skip ad »", this.hasServerData = !1, b) {
this.hasServerData = !0;
var d = c.returnString(b["@type"]);
d === a.PLACEMENT_NAME_INSTREAM ? this.placementType = 1 : d === a.PLACEMENT_NAME_OVERLAY && (this.placementType = 2), this.minViewabilityPercentage = c.returnUnsignedInt(b["@min_viewability_percentage"], this.minViewabilityPercentage), this.minViewabilityDuration = c.returnFloat(b["@min_viewability_duration"], this.minViewabilityDuration), this.refreshInterval = c.returnInt(b["@refresh"], this.refreshInterval), this.refreshThreshold = c.returnInt(b["@refresh_threshold"], this.refreshThreshold), this.maxDuration = c.returnFloat(b["@max_duration"], this.maxDuration), this.maxPodSlots = c.returnUnsignedInt(b["@max_pod_slots"], this.maxPodSlots), this.maxPodDuration = c.returnFloat(b["@max_pod_duration"], this.maxPodDuration), this.allowExpand = c.returnBoolean(b["@allow_expand"], this.allowExpand), this.allowSMS = c.returnBoolean(b["@allow_sms"], this.allowSMS), this.allowTelephone = c.returnBoolean(b["@allow_tel"], this.allowTelephone), this.allowWebcal = c.returnBoolean(b["@allow_webcal"], this.allowWebcal), this.allowResize = c.returnBoolean(b["@allow_resize"], this.allowResize), this.allowPhoto = c.returnBoolean(b["@allow_photo"], this.allowPhoto), this.allowCalendar = c.returnBoolean(b["@allow_calendar"], this.allowCalendar), this.indexMessage = c.returnString(b["@index_message"], this.indexMessage), this.countdownMessage = c.returnString(b["@countdown_message"], this.countdownMessage), this.clickthroughMessage = c.returnString(b["@click_through_message"], this.clickthroughMessage), this.skipCountdownMessage = c.returnString(b["@skip_countdown_message"], this.skipCountdownMessage), this.skipMessage = c.returnString(b["@skip_message"], this.skipMessage)
}
}
return a.placementNameForType = function(b) {
switch (b) {
case 1:
return a.PLACEMENT_NAME_INSTREAM;
case 2:
return a.PLACEMENT_NAME_OVERLAY;
default:
return null
}
}, a.prototype.isFromServer = function() {
return this.hasServerData
}, a.PLACEMENT_NAME_INSTREAM = "video-in", a.PLACEMENT_NAME_OVERLAY = "video-ov", a.PLACEMENT_NAME_BANNER = "banner", a.PLACEMENT_NAME_INTERSTITIAL = "interstitial", a.PLACEMENT_NAME_NATIVE = "native", a.DEFAULT_REFRESH_INTERVAL_SECONDS = -1, a.DEFAULT_REFRESH_THRESHOLD_SECONDS = -1, a.DEFAULT_MIN_VIEWABILITY_PERCENTAGE = 1, a
}();
return d
}), define("LiveRailSchemaParser", ["require", "exports", "AdAsset", "AdCandidate", "AdExtension", "AdSlot", "AdSource", "CompanionAd", "JXONParser", "LinearCreative", "LiveRailResponse", "LiveRailResponseSources", "LiveRailResponseSlots", "LiveRailResponseError", "Logger", "NonLinearCreative", "PlacementDefinition", "Tracker", "Utils"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s) {
var t = function() {
function a() {
this.logger = new o("LiveRailSchemaParser")
}
return a.prototype.parseResponse = function(a) {
var b = null;
try {
var c = i.parse(a, {
source: !0,
adslot: !0,
ad: !0,
tracker: !0,
url: !0,
companion: !0,
param: !0
});
if (!c) throw "JXONParser failure";
this.logger.debug("Parsed LiveRail XML:", c);
var d = c.liverail;
switch (d["@content"]) {
case k.TYPE_SOURCES:
b = new l, this.parseDataNode(d, b), this.parseAdSources(d, b);
break;
case k.TYPE_ADS:
b = new m, this.parseAds(d, b);
break;
case k.TYPE_ERROR:
b = new n(d.message);
break;
default:
b = new k
}
} catch (e) {
return this.logger.error("Error parsing LiveRail response:", e), null
}
return b
}, a.prototype.parseDataNode = function(a, b) {
try {
b.setData(a.data)
} catch (c) {
this.logger.error("Error parsing data node:", c.message)
}
}, a.prototype.parseAdSources = function(a, b) {
var c = this;
try {
a.sources.source.forEach(function(a) {
var d = c.parseAdSource(a);
null !== d && b.addAdSource(d)
})
} catch (d) {
this.logger.error("Error parsing ad sources:", d.message)
}
}, a.prototype.parseAdSource = function(a) {
var b, c, d = null;
try {
d = new g(a.url[0]);
for (var e in a)
if (a.hasOwnProperty(e) && "@" === e.substr(0, 1))
if (b = e.substr(1), c = a[e], "erc" === b) d.setErc(c);
else {
if (d.setAttribute(b, c), "asp" === b && "string" == typeof c) {
var f = c.split(":");
f.forEach(function(a) {
d.addPriority(parseInt(a, 10))
})
}
"dpt" === b && d.setPriorityDepth(parseInt(c, 10) - 1)
}
} catch (h) {
this.logger.error("Error parsing ad source:", h.message)
}
return d
}, a.prototype.parseAds = function(a, b) {
var c = this;
try {
if (b.setSetupGeo(a.setup.data.geo), b.setTrid(a.setup.data.trid), a.setup.placement) {
var d = new q(a.setup.placement.definition);
b.setPlacementDefinition(d)
}
a.ads && Array.isArray(a.ads.adslot) && a.ads.adslot.forEach(function(a) {
var d = c.parseAdSlot(a);
null !== d && b.addAdSlot(d)
})
} catch (e) {
this.logger.error("Error parsing ads:", e.message)
}
}, a.prototype.parseAdSlot = function(a) {
var b = this,
c = null;
try {
var d = new f(a["@type"], a["@rule"]);
a.ad && a.ad.forEach(function(a) {
var c = b.parseAdCandidate(a);
null !== c && d.addAdCandidate(c)
}), a.trackers && a.trackers.tracker && a.trackers.tracker.forEach(function(a) {
var c = b.parseTracker(a);
null !== c && d.addTracker(c)
}), null !== d && (c = d)
} catch (e) {
this.logger.error("Error parsing ad slot node:", e.message)
}
return c
}, a.prototype.parseAdCandidate = function(a) {
var b = this,
c = null;
try {
if (a) {
c = new d, c.adapter = a["@adapter"], c.type = a["@type"], c.networkID = a["@nid"], c.connectionID = a["@coid"], c.scenarios = a["@ss"], c.values = a["@nr"], c.orderID = a["@oid"], c.orderLineID = a["@olid"], c.creativeID = a["@cid"] || "", c.uniqueCreativeID = a["@ucid"] || "", a.thirdparty && a.thirdparty.param.forEach(function(a) {
c.setThirdPartyData(a["@name"], a.cdata)
}), c.textTitle = a.text_title || "", c.textDescription = a.text_description || "", c.textUrl = a.text_url || "", c.clickThruUrl = s.returnString(a.clickthru, "").trim();
var e = this.parseLinearCreative(a.linear);
null !== e && c.setLinearCreative(e);
var f = this.parseNonLinearCreative(a.nonlinear);
null !== f && c.setNonLinearCreative(f), a.trackers && a.trackers.tracker && a.trackers.tracker.forEach(function(a) {
var d = b.parseTracker(a);
null !== d && c.addTracker(d)
}), a.companions && a.companions.companion && a.companions.companion.forEach(function(a) {
var d = b.parseCompanion(a);
null !== d && c.addCompanionAd(d)
})
}
} catch (g) {
this.logger.error("Error parsing ad candidate:", g.message)
}
return c
}, a.prototype.parseLinearCreative = function(a) {
var b = null;
if (a) try {
b = new j(a["@type"], s.returnFloat(a["@duration"], null), s.returnFloat(a["@skipoffset"], -1), a["@skipoffset"].indexOf("%") > -1), Array.isArray(a.url) && a.url.forEach(function(a) {
var d = new c(s.returnUnsignedInt(a["@width"], null), s.returnUnsignedInt(a["@height"], null), a.cdata, a["@mimetype"], s.returnUnsignedInt(a["@kbps"], null));
b.addAdAsset(d)
})
} catch (d) {
this.logger.error("Error parsing linear ad:", d.message)
}
return b
}, a.prototype.parseNonLinearCreative = function(a) {
var b = null;
if (a) try {
b = new p(a["@type"]);
var d = a.creative,
e = new c(d["@width"], d["@height"], d.url);
b.setAdAsset(e)
} catch (f) {
this.logger.error("Error parsing non linear ad:", f.message)
}
return b
}, a.prototype.parseCompanion = function(a) {
var b = this,
c = null;
if (a) try {
c = new h(a["@type"], a["@size"], a.content, a.clickthru), a.trackers && a.trackers.tracker && a.trackers.tracker.forEach(function(a) {
var d = b.parseTracker(a);
null !== d && c.addTracker(d)
})
} catch (d) {
this.logger.error("Error parsing companion ad:", d.message)
}
return c
}, a.prototype.parseTracker = function(a) {
var b = null;
try {
b = new r(a["@type"], a["@value"]), a.url && a.url.forEach(function(a) {
b.addUrl(a)
})
} catch (c) {
this.logger.error("Error parsing tracker:", c.message)
}
return b
}, a.prototype.parseAdExtension = function(a) {
var b = null;
if (a) try {
b = new e(a["@id"], a.url[0])
} catch (c) {
this.logger.error("Error parsing ad extension:", c.message)
}
return b
}, a
}();
return t
}), define("VASTResponseType", ["require", "exports"], function(a, b) {
var c;
return function(a) {
a[a.unknown = 0] = "unknown", a[a.nodata = 1] = "nodata", a[a.empty = 2] = "empty", a[a.inline = 3] = "inline", a[a.wrapper = 4] = "wrapper", a[a.error = 5] = "error"
}(c || (c = {})), c
}), define("VASTResponse", ["require", "exports", "VASTResponseType"], function(a, b, c) {
var d = function() {
function a(a, b) {
if (this.type = 0, this.body = "", this.wrapperUrl = null, this.mediaFileNodeList = null, this.body = b.responseText, null === a || "function" != typeof a.getElementsByTagName) 0 === this.body.trim().length && (this.type = 1);
else {
var c = a.querySelector("VAST") || a.querySelector("VideoAdServingTemplate");
if (c) {
var d = c.querySelector("Ad");
if (!d) return void(c.hasAttribute("error") ? this.type = 5 : this.type = 2);
if (d) {
var e = d.querySelector("Wrapper");
if (e) {
this.type = 4;
var f = e.getElementsByTagName("VASTAdTagURI")[0] || e.getElementsByTagName("VASTAdTagURL")[0];
return void(f && (this.wrapperUrl = f.textContent))
}
}
this.type = 3, this.mediaFileNodeList = d.getElementsByTagName("MediaFile")
}
}
}
return a.prototype.getType = function() {
return this.type
}, a.prototype.getBody = function() {
return this.body
}, a.prototype.getWrapperUrl = function() {
return this.wrapperUrl
}, a.prototype.hasValidWrapperUrl = function() {
return null !== this.wrapperUrl && this.wrapperUrl.trim().length > 0
}, a.prototype.hasValidMediaFileInList = function(a) {
var b = !1;
if (this.mediaFileNodeList.length > 0)
for (var c, d, e = 0; e < this.mediaFileNodeList.length; e += 1)
if (d = this.mediaFileNodeList[e].attributes, d && d.type && "string" == typeof d.type.value) {
c = d.type.value.toLowerCase();
for (var f = 0; f < a.length; f += 1)
if (a[f].toLowerCase() === c) {
b = !0;
break
}
}
return b
}, a
}();
return d
}), define("AdProvider", ["require", "exports", "AdSourceRequest", "AdSourceRequestStatus", "EventManager", "HTTP", "HTTPRequestQueue", "LiveRailResponse", "LiveRailSchemaParser", "LogEvent", "LogEventType", "Logger", "Utils", "VASTResponse", "VASTResponseType"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o) {
var p = function() {
function a() {
this.active = !1, this.requestQueue = new g, this.logger = new l("AdProvider"), this.eventManager = new e, this.liverailSchemaParser = new i, this.adSourceDataNode = null
}
return a.prototype.getAd = function(b) {
var c = this;
this.logger.debug("getAd(", b, ")"), this.active = !0, this.environmentData = b, a.getAdServerEndpoint(b, function(a) {
c.endpointUrl = a, c.logger.debug("Using ad server endpoint:", c.endpointUrl), c.makeFirstAdRequest(b.getAdRequestParameters())
})
}, a.prototype.cancel = function() {
this.destroy()
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.destroy = function() {
this.active = !1, this.endpointUrl = null, this.requestQueue.removeAllRequests()
}, a.prototype.onComplete = function() {
this.eventManager.dispatch("complete")
}, a.getAdServerEndpoint = function(a, b) {
var c = "https:" === a.slotWindow.location.protocol ? "https:" : "http:",
d = c + "//ad4.liverail.com/";
a.urlPrefix && (d = c + "//ad4." + a.urlPrefix + ".liverail.com/"), b(d)
}, a.prototype.makeFirstAdRequest = function(a) {
var b = this;
this.logger.log("Making first request to " + this.endpointUrl + " with parameters:", a);
var c = [];
for (var d in a) a.hasOwnProperty(d) && c.push(d);
c.sort(), this.logger.log("Ad request parameters:");
for (var e = 0; e < c.length; e += 1) this.logger.log(" " + c[e] + " = " + a[c[e]]);
var g = m.serialize(a);
this.requestQueue.addRequest(f.request({
url: this.endpointUrl,
type: "POST",
data: g,
dataType: "xml",
timeout: this.environmentData.getAdParameters().adDeliveryTimeout,
success: function(a) {
b.active && b.handleFirstAdResponse(a, null)
},
error: function(a, c, d) {
if (b.active) {
var e = j.eventWithType(k.AdSourcesRequestFailed, {
status: a.status,
textStatus: c
});
"timeout" === c && (e = j.eventWithType(k.AdSourcesRequestTimeout)), b.handleFirstAdResponse(null, e)
}
}
}))
}, a.prototype.handleFirstAdResponse = function(b, c) {
null !== c ? (this.destroy(), this.eventManager.dispatch(a.AdProviderError, [c])) : this.parseLiveRailResponse(b, !0)
}, a.prototype.parseLiveRailResponse = function(b, c) {
this.logger.debug("Parsing LiveRail XML:", b);
var d = this.liverailSchemaParser.parseResponse(b);
if (d) {
this.logger.debug("Parsed LiveRail " + d.content + " response:", d);
var e = null;
switch (d.content) {
case h.TYPE_UNKNOWN:
e = [j.eventWithType(k.XMLUnknownResponse)];
break;
case h.TYPE_ERROR:
var f = d;
e = [j.eventWithType(k.XMLErrorMessage, {
message: f.errorMsg
})];
break;
case h.TYPE_SOURCES:
var g = d;
if (c) {
if (!(g.getAdSources().length <= 0)) return this.adSourceDataNode = g.getData(), void this.queryAdSources(g.getAdSources());
e = [j.eventWithType(k.NoAdSources)]
} else e = [j.eventWithType(k.XMLDuplicateSources)];
break;
case h.TYPE_ADS:
var i = d;
if (!(i.getAdSlots().length <= 0)) return void this.eventManager.dispatch(a.AdProviderSuccess, [d]);
e = [j.eventWithType(k.NoAdSlots)]
}
null !== e && this.eventManager.dispatch(a.AdProviderError, e)
} else this.eventManager.dispatch(a.AdProviderError, [j.eventWithType(k.XMLParseFailure)])
}, a.prototype.queryAdSources = function(a) {
var b = this;
this.logger.log("Processing " + a.length + " ad sources"), this.adSourceRequests = [], this.adSourceQueryCount = 0, this.registeredAdSourceCount = 0, a.forEach(function(a, d) {
b.adSourceRequests[d] = new c(d, a), null !== a.getUrl() && 0 === a.getErc() && (b.adSourceQueryCount += 1, b.queryAdSourceURL(b.adSourceRequests[d]))
})
}, a.prototype.queryAdSourceURL = function(b, c, d) {
var e = this;
"undefined" == typeof c && (c = null), "undefined" == typeof d && (d = !0);
var g = b.getId(),
h = b.getResponses().length,
i = null === c ? b.getAdSource().getUrl() : c;
this.logger.log("Querying ad source: id=" + g + " wrapper=" + h + " url=" + i);
this.requestQueue.addRequest(f.request({
url: i,
type: "GET",
dataType: "xml",
timeout: this.environmentData.getAdParameters().adRequestTimeout,
xhrFields: {
withCredentials: d
},
success: function(a, c, d, f) {
if (e.active) {
e.logger.verbose("Retrieved VAST response for request id " + g + ":", a);
var i = new n(a, d);
switch (e.logger.verbose("Parsed VAST response for request id " + g + ":", i), f.duration && b.increaseTotalDuration(f.duration), i.getType()) {
case 0:
e.logger.warn("Ad request id " + g + " completed with unknown status"), b.setStatus(0), b.addResponse(i.getBody());
break;
case 1:
e.logger.debug("Ad source for request id " + g + " responded with no data"), b.setStatus(1);
break;
case 2:
e.logger.debug("Ad source for request id " + g + " responded with empty VAST"), b.setStatus(1);
break;
case 4:
if (i.hasValidWrapperUrl()) {
if (h < e.environmentData.getAdParameters().wrapperLimit) return e.logger.debug("Ad source for request id " + g + " responded with wrapper url=" + i.getWrapperUrl()), b.addResponse(i.getBody()), void e.queryAdSourceURL(b, i.getWrapperUrl());
e.logger.debug("Ad request id " + g + " has exceed the wrapper limit of " + e.environmentData.getAdParameters().wrapperLimit), b.setStatus(302)
} else e.logger.error("Ad source for request id " + g + " responded with invalid wrapper"), b.setStatus(0), b.addResponse(i.getBody());
break;
case 3:
i.hasValidMediaFileInList(e.environmentData.mimeTypePriorityList) ? (e.logger.log("Ad request id " + g + " completed successfully"), b.setStatus(0), b.addResponse(i.getBody())) : (e.logger.warn("Ad source response for request id " + g + " contains no usable MediaFile nodes"), b.setStatus(200));
break;
case 5:
e.logger.log("Ad request id " + g + " completed with C2S proxy error"), b.setStatus(0), b.addResponse(i.getBody())
}
e.registerAdSourceRequest()
}
},
error: function(f, h, j, k) {
if (e.active) {
if (k.duration && b.increaseTotalDuration(k.duration), d && "error" === h && 0 === f.status) return e.logger.error("Possible CORS error, retrying ad call using withCredentials:false"), void e.queryAdSourceURL(b, c, !1);
"timeout" !== h && 204 === f.status ? (e.logger.debug("Ad source for request id " + g + " responded with 204 No Content"), b.setStatus(1)) : (e.logger.error("Error loading ad source:" + h + ", id=" + g + ", ajaxObject=", f, ", url=" + i), "parsererror" === h ? (b.addResponse(f.responseText), b.setStatus(0)) : "timeout" === h ? b.setStatus(301) : b.setStatus(300)), (301 === b.getStatus() || 300 === b.getStatus()) && e.eventManager.dispatch(a.AdSourceRequestError, [b]), e.registerAdSourceRequest()
}
}
}))
}, a.prototype.registerAdSourceRequest = function() {
this.active && (this.registeredAdSourceCount += 1, this.registeredAdSourceCount === this.adSourceQueryCount && this.prepareSecondAdRequest())
}, a.prototype.prepareSecondAdRequest = function() {
var a = this,
b = {};
this.environmentData.iterateAdRequestParameters(function(c, d) {
b[d] = a.environmentData.getAdRequestParameters()[d]
}), null !== this.adSourceDataNode && (b.data = this.adSourceDataNode), b.LR_POSTXML = "true", this.adSourceRequests.forEach(function(a) {
var c = a.getAdSource().getAttributes(),
d = a.getId();
for (var e in c) c.hasOwnProperty(e) && (b[e + d] = c[e] || "");
if (b["erc" + d] = a.getStatus(), a.getTotalDuration() > 0 && (b["rtt" + d] = a.getTotalDuration()), a.getAdSource().hasValidUrl() && 0 === a.getStatus()) {
var f = a.getResponses();
f.length > 1 && (b["subresponse" + d] = []), f.forEach(function(a, c) {
0 === c ? b["response" + d] = a : b["subresponse" + d].push(a)
})
}
}), this.makeSecondAdRequest(b)
}, a.prototype.makeSecondAdRequest = function(a) {
var b = this;
this.logger.log("Making second request to " + this.endpointUrl + " with parameters:", a);
var c = this.endpointUrl,
d = m.serialize(a);
f.compressData(d, function(a, e) {
var g, h = l.getDebugLevel();
e && 3 > h ? (c += "?compressed", g = a) : (b.logger.verbose("Debug level " + h + ", passing uncompressed request data"), g = d), b.requestQueue.addRequest(f.request({
url: c,
type: "POST",
data: g,
dataType: "xml",
timeout: b.environmentData.getAdParameters().adDeliveryTimeout,
success: function(a) {
b.active && b.handleSecondAdResponse(a, null)
},
error: function(a, c, d) {
if (b.active) {
var e = j.eventWithType(k.AdsRequestFailed);
"timeout" === c && (e = j.eventWithType(k.AdsRequestTimeout)), b.handleSecondAdResponse(null, e)
}
}
}))
})
}, a.prototype.handleSecondAdResponse = function(b, c) {
null !== c ? (this.destroy(), this.eventManager.dispatch(a.AdProviderError, [c])) : this.parseLiveRailResponse(b, !1)
}, a.AdProviderSuccess = "AdProviderSuccess", a.AdProviderError = "AdProviderError", a.AdSourceRequestError = "AdSourceRequestError", a
}();
return p
}),
function() {
"use strict";
var a = {
getBrowserFeatures: function() {
var a = {
mode: "fast"
};
return JSON.stringify(a)
}
};
"undefined" != typeof exports ? module.exports = a : "undefined" != typeof define && define("BrowserFeatures", [], function() {
return a
})
}(), define("InterfaceAsset", ["require", "exports"], function(a, b) {
var c = function() {
function a(a) {
this.base64String = a.base64String
}
return a.getBase64ImgSrc = function(a) {
return "data:image/png;base64," + a.base64String
}, a.LARGE_PLAY_BUTTON = {
base64String: "iVBORw0KGgoAAAANSUhEUgAAAFAAAABQCAYAAACOEfKtAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAABFZJREFUeNrs3dtLI1ccB/BcNJe1yU7cohN121wUjCL1FitUUUnBQl5WWHxSqP+AD4Kvviq+CL4JFYuXFx+0IIIvwS1aSBHUQrVBnGTKrsaUrk4mpslE1+zvBLObtkubpmDmJL8vDDPJHDLhw5n5nRn0RKn4e3QMw9TD2gILc/8ek7FdLBHul/Q2LwiCD9bxzEYlmS8ArjeZTHYajcbH3d3dzWaz2aLRaHRkn8FgYEtLS3XFIHdzcxOPRCIXZDuRSMSDwSC/s7NzCDZhpVLpBcgX6bbKDLxnAPe52+3utdvtnfAB0vHx8etAIBBJtzk9Pb0uBsDa2tqP0ttWq9XQ0NDwBDqQluM47+bm5gtRFH8ExO/eAQLcVwDYMzIy8rVWq/14e3v71d7e3msF5l2cTueTvr6+GkmSfl9YWPgWAL8HyC01wDHQLZ8PDw8/B+WalZWVE5/PJyLZn3N+fh7jeV5saWl5arPZKg4ODsI6ne5QDde43ra2ti9gx5eLi4u+s7OzGHJ9OHBZuyWIUB8c19fXPFiFVdD7LE1NTc1wrRMQ799DjIgVMSN2BJCFs5g9OTkRkCe7ECtiRuxU6SEKVJgI0mQXYkXMyLYq/ebl5WUCabJLppUKOf5fEBABERABERCDgAiIgAiIQUAEREAExCBg0QBOT0/XmEwmNQLmmMHBwcqtrS3HwMDAYwTMMZWVldqZmZna5eVlu81m0yBgjunq6mI2NjYco6OjFQiYY8rKykrGxsaeejweR2trqx4Bc4zdbn+0trbWQEORkfUwhoYiI/txoNyLDDUDabkWGaruRORYZKi8lZNTkaH6XlgORYb6hwn5LjIF8zQmX0WmoB5n5aPIFOTzQJZlNdAjDQ9xrJJCw9vd3RUmJiZe+v3+BAL+h4RCIWlqaurl+vp6+CGPWxCAq6urocnJyeDV1dWbhz421YAcx/0xPj7O7+/v5+2/C6gEjEajt3Nzc8HZ2dnf8v1dqAN86CJRMID5KhIFAZjPIkE1oByKBJWAcioS1AHKrUhQAyjXIkEFoJyLhKwBaSgSsgZ0uVy/0H4fjn8fiIAIiIAIiEFABERABMQgIAIiIAJiEBABaQMks9ZmTryK+ecQK2KWBhTIlL9ms/kR0mQXYnU/TbKQAgyFQnxdXR2DNNmFWBGzFODd3Z3P6/UeVlVVGfA0zu70JVbEjNipIGTm3vDFxYXP7XZb9Hq9Gpk+HGJDjIhVagZfsFPHIWS6d47j4k6ns7mxsbHC7/eLsVjsDZK9T3l5uWZoaKhOq9VKS0tLy+DzQzgc/jnV2yRJegUr69HR0Wl7e7ujo6PjU5PJVBqNRm/I3MnFDFddXa3v6elh+/v7P4GXV/Pz898A3K+iKJKp4G+VGW11RqPxGXTLepfL9ZnVaq1nWbYe+55CQU7ZQCDg83g8P5Hr3j1eahij/GtjhmEs0KiTTDINiw75FIpkMhmHhYfORX7Jgc/c91aAAQBVWxmAi5XwnAAAAABJRU5ErkJggg=="
}, a.SMALL_PLAY_BUTTON = {
base64String: "iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAActJREFUeNpiZAACAQEBAyAFwiCgwEA5eAClL3z48OECC9ACByDHITg42F5cXFyBlZWVg5eXV4Jc0z9//vzi9+/fP16+fPlg7dq1CkDzBVj+//9vERUV5S4mJmZ47Nix5+/fv//49OnTF9+/f/9LqgWcnJzM0tLSnIKCguyOjo42kZGRHMuWLfvBwsjIyKGsrGyxYsWKm3fu3PlCSRiBHAY14wvQsT8jIiIsgObvZOLj42MHKaDUAnQAMw9kPtOnT59+/vr16w8DjQDIfCYQg42NjYWBhoCJgQ6AaEu6urpkgKmGmaaWhIWFie/YsUMTmDR5aBpcwMzKPn/+fPXp06fLk+IrsuLE09NT5MiRIzqBgYH8NI14bm5ulv7+fhVQXNE0da1ateple3v7c0LqyMofwMLvZ0VFxYP9+/cTVUqQbMmcOXOetbS0PCdFD9GW3L1791tpaemDc+fOfSfVYURb4uzsfH14FCtDwxJQnayrq8tPTYNB5gFryg8wSz48evTogpOTkyyofqaGBSBzgEWPwoMHDy6AzGcEtVaAVaS7t7e3A6iup5ZPgEn+xNatWw8Aa8adjNB62IOJicmC2nHx79+/E0BLdgAEGACb67HFg0eK6wAAAABJRU5ErkJggg=="
}, a.SMALL_PAUSE_BUTTON = {
base64String: "iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAV1JREFUeNpiZAACAQEBAyAFwiCgwEA5eAClL3z48OECC9ACByDHITg42F5cXFyBlZWVg5eXV4Jc0z9//vzi9+/fP16+fPlg7dq1CkDzBVj+//9vERUV5S4mJmZ47Nix5+/fv//49OnTF9+/f/9LqgWcnJzM0tLSnIKCguyOjo42kZGRHMuWLfvBwsjIyKGsrGyxYsWKm3fu3PlCSRiBHAY14wvQsT8jIiIsgObvZOLj42MHKaDUAnQAMw9kPtOnT59+/vr16w8DjQDIfCYQg42NjYWBhoCJgQ6AKEsePHhgDMKExAa/T0YtGbVk8FpCVHGioKBwlhix0TihniWgOllXV5efmgaDzAPWlB9glnx49OjRBScnJ1lQ/UwNC0DmeHp6KgBL6Qsg8xlBrRVgFenu7e3tAKrrqeWTu3fvnti6desBYM24kxFaD3swMTFZUDsu/v37dwJoyQ6AAAMA3I+OLwkeBn4AAAAASUVORK5CYII="
}, a.SMALL_MUTE_BUTTON = {
base64String: "iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAjhJREFUeNpiZAACAQEBAyAFwiCgwEA5eAClL3z48OECC9ACByDHITg42F5cXFyBlZWVg5eXV4Jc0z9//vzi9+/fP16+fPlg7dq1CkDzBVj+//9vERUV5S4mJmZ47Nix5+/fv//49OnTF9+/f/9LqgWcnJzM0tLSnIKCguyOjo42kZGRHMuWLfvBwsjIyKGsrGyxYsWKm3fu3PlCSRiBHAY14wvQsT8jIiIsgObvZOLj42MHKaDUAnQAMw9kPtOnT59+/vr16w8DjQDIfCYQg42NjYWBhoCJgQ6AJEsSEhKEQbSSkhIbiJ4+fbq8kZERJ9UsAVnQ0NAAzqgZGRliIIu6u7ufL168WA2YZJkptgTZAhA4fvz459LSUsl79+79Aqai721tbTL49OON8AcPHhhjE1+/fv3HlpYWkKUPT58+/RmY6cRAbKpHPDc3Nws2NlUt+fr1KzxvAcupn2RbkpiYeBOE7969+w1ZHFgu8Rw6dOgDiG1qasp77ty5z2THyf79+8FFw4ULF24tWLBAWV9fnxfE9/T0FAClLFAKU1FR4QQmjLsUBxewsPvr7+9/a/v27W9A/BkzZrwCpSxQCqupqXkAkifbJ+ggMzMTnIJAFiDzh16xMvgtAdXJurq6/NQ0GGQesKb8ALPkw6NHjy44OTnJgupnalgAMgeYzBWAxdIFkPmMoNYKsIp09/b2dgDV9dTyCTADn9i6desBYM24kxFaD3swMTFZUDsu/v37dwJoyQ6AAAMA3dXxPPfPejcAAAAASUVORK5CYII="
}, a.SMALL_UNMUTE_BUTTON = {
base64String: "iVBORw0KGgoAAAANSUhEUgAAABkAAAAZCAYAAADE6YVjAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAZpJREFUeNpiZAACAQEBAyAFwiCgwEA5eAClL3z48OECC9ACByDHITg42F5cXFyBlZWVg5eXV4Jc0z9//vzi9+/fP16+fPlg7dq1CkDzBRj5+fkroqKi/MXExAyPHTv2/P379z+fPn36HQj+kmoBJycns7S0NKegoCC7o6OjzOPHj88sW7ZsIwsjIyOHsrKyxYoVK27euXPnCyVhBHIY1IwvIMdGRERYAM3fycLHx8cOUkCpBegAZh7IfKZPnz79/PXr1x8GGgGQ+UwgBhsbGwsDDQETAx0ASZZYWVkJ09QSkAX+/v4KNLOEEgtAAG+Ed3Z2Gg/PiKdJcC1YsOAmiPby8pIFlm1cNLHk+vXr4KLh4cOHt5KSkpRlZWV5aRZc3759+ztlypRbV65ceUPzOFm8ePHDkZ266GcJqE7W1dXlp6bBIPOANeUHmCUfHj16dMHJyUkWVD9TwwKQOZ6engoPHjy4ADKfEdRaAVaR7t7e3g6gup5aPrl79+6JrVu3HgDWjDsZofWwBxMTkwW14+Lfv38ngJbsAAgwAALln4vEJfLOAAAAAElFTkSuQmCC"
}, a
}();
return c
}), define("ClickToPlayInterface", ["require", "exports", "EventManager", "InterfaceAsset", "Utils"], function(a, b, c, d, e) {
var f = function() {
function a(b) {
var d = this;
this.eventManager = new c, this.onclick = function(b) {
b.preventDefault(), b.stopPropagation(), b.which > 1 || (d.environmentData.videoSlot.play(), d.environmentData.videoSlot.pause(), d.eventManager.dispatch(a.EVENT_CLICK))
}, this.environmentData = b
}
return a.prototype.register = function() {
this.frame = e.addElement({
target: this.environmentData.slot,
styles: {
width: "100%",
height: "100%",
position: "absolute",
cursor: "pointer",
top: "0px",
left: "0px",
"background-color": "#000"
},
events: {
contextmenu: function(a) {
a.preventDefault()
},
click: this.onclick
}
}), this.button = e.addElement({
target: this.frame,
type: "img",
styles: {
position: "absolute",
display: "block",
border: "0px none",
cursor: "pointer",
top: "50%",
left: "50%",
width: "80px",
height: "80px",
margin: "-40px 0px 0px -40px"
},
attributes: {
src: d.getBase64ImgSrc(new d(d.LARGE_PLAY_BUTTON))
},
events: {
contextmenu: function(a) {
a.preventDefault()
},
click: this.onclick
}
}), this.videoSlotOriginalStylePosition = this.environmentData.videoSlot.style.getPropertyValue("position"), this.videoSlotOriginalPriorityPosition = this.environmentData.videoSlot.style.getPropertyPriority("position"), this.videoSlotOriginalStyleLeft = this.environmentData.videoSlot.style.getPropertyValue("left"), this.videoSlotOriginalPriorityLeft = this.environmentData.videoSlot.style.getPropertyPriority("left"), this.videoSlotOriginalStyleRight = this.environmentData.videoSlot.style.getPropertyValue("right"), this.videoSlotOriginalPriorityRight = this.environmentData.videoSlot.style.getPropertyPriority("right"), this.environmentData.videoSlot.style.setProperty("position", "relative", "important"), this.environmentData.videoSlot.style.setProperty("left", "-100000px", "important"), this.environmentData.videoSlot.style.removeProperty("right")
}, a.prototype.unregister = function() {
this.environmentData.videoSlot.style.setProperty("position", this.videoSlotOriginalStylePosition, this.videoSlotOriginalPriorityPosition), this.environmentData.videoSlot.style.setProperty("left", this.videoSlotOriginalStyleLeft, this.videoSlotOriginalPriorityLeft), this.environmentData.videoSlot.style.setProperty("right", this.videoSlotOriginalStyleRight, this.videoSlotOriginalPriorityRight), this.environmentData.slot && this.frame && this.environmentData.slot.removeChild(this.frame), this.frame = null, this.button = null
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.EVENT_CLICK = "click", a
}();
return f
}), define("CompanionPlacement", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b, c, d, e) {
"undefined" == typeof d && (d = null), "undefined" == typeof e && (e = null), this.width = a, this.height = b, this.companionId = c, null !== d && (this.defaultId = d), null !== e && (this.purge = e)
}
return a.prototype.getWidth = function() {
return this.width
}, a.prototype.getHeight = function() {
return this.height
}, a.prototype.getCompanionId = function() {
return this.companionId
}, a.prototype.getDefaultId = function() {
return this.defaultId
}, a.prototype.getPurge = function() {
return this.purge
}, a
}();
return c
}), define("CompanionManager", ["require", "exports", "Logger", "CompanionPlacement", "Utils"], function(require, exports, Logger, CompanionPlacement, Utils) {
var CompanionManager = function() {
function CompanionManager() {
this.logger = new Logger("CompanionManager")
}
return CompanionManager.prototype.showCompanions = function(companionAds, companionPlacements, targetWindow) {
var _this = this;
return this.logger.log("showCompanions(", companionAds, ",", companionPlacements, ")"), "object" == typeof targetWindow && "object" == typeof targetWindow.document && targetWindow.document.getElementById ? void companionAds.forEach(function(companionAd) {
function onWrapperLoad() {
wrapper.contentWindow && wrapper.contentWindow.postMessage && ("http://cdn-static.liverail.com" === content.substr(0, 30) ? wrapper.contentWindow.postMessage(uniqueId, "http://cdn-static.liverail.com") : "https://cdn-static-secure.liverail.com" === content.substr(0, 38) && wrapper.contentWindow.postMessage(uniqueId, "https://cdn-static-secure.liverail.com"));
}
function handleMessage(a) {
var b = window;
a || (a = b.event), a.data === uniqueId && "function" == typeof lrCompanionClickThru && lrCompanionClickThru(companionFingerprint)
}
var content = companionAd.getContent(),
size = companionAd.getSize(),
width = companionAd.getWidth(),
height = companionAd.getHeight(),
companionPlacement = CompanionManager.resolveCompanionPlacement(companionAd, companionPlacements),
companionElement = CompanionManager.locateElement(companionPlacement.getCompanionId(), targetWindow),
defaultElement = CompanionManager.locateElement(companionPlacement.getDefaultId(), targetWindow);
if (!companionElement) return void _this.logger.log("Unable to find " + size + " placement, dropping companion ad");
var companionHTML = "";
companionAd.getTrackers("impression").forEach(function(a) {
a.getUrls().forEach(function(a) {
companionHTML += '<img src="' + a + '" width="1" height="1" style="display: none; visibility: hidden;" />'
})
});
var clickUrl = companionAd.getClickUrl();
clickUrl && null !== clickUrl.match(/^http(s)?:\/\/t4\.liverail\.com/) && (clickUrl = clickUrl.replace(/&redirect=(%20|%0A|%0D|%09|%0C|%0B|%00)+/, "&redirect="));
var lrCompanionClickThru = "function" == typeof targetWindow.lrCompanionClickThru ? targetWindow.lrCompanionClickThru : null,
wrapper = null,
lrCompanionDisplayCallback = targetWindow.lrCompanionDisplayCallback || {};
switch (typeof lrCompanionDisplayCallback[size]) {
case "function":
lrCompanionDisplayCallback[size]();
break;
case "string":
eval(lrCompanionDisplayCallback[size])
}
switch (companionAd.getType()) {
case "iframe":
lrCompanionClickThru ? wrapper = CompanionManager.createWrapperFrame(width, height, content, targetWindow) : companionHTML += '<iframe src="' + content + '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="width: ' + width + "px; height: " + height + 'px; border: 0px; margin: 0px;"></iframe>';
break;
case "image":
if ("string" == typeof clickUrl && null !== clickUrl.match(/^http(s)?:\/\/t4.liverail.com/)) {
var clickthruRedirect = clickUrl.split(/&redirect=/)[1];
("string" != typeof clickthruRedirect || clickthruRedirect.length <= 0) && (clickUrl = null)
}
companionHTML += (clickUrl ? '<a href="' + clickUrl + '" target="_blank">' : "") + '<img src="' + content + '" border="0" style="width: ' + width + "px; height: " + height + 'px; border: 0px; margin: 0px;" />' + (clickUrl ? "</a>" : "");
break;
case "flash":
var delimiter = -1 === content.indexOf("?") ? "?" : "&",
clickTag = clickUrl && content.match(/cdn(-secure)?\.liverail\.com/) ? delimiter + "clickTAG=" + encodeURIComponent(clickUrl) : delimiter;
companionHTML += '<object width="' + width + '" height="' + height + '"><param name="movie" value="' + content + clickTag + '"><param name="wmode" value="opaque"><param name="allowScriptAccess" value="always"><embed src="' + content + clickTag + '" type="application/x-shockwave-flash" allowScriptAccess="always" wmode="opaque" width="' + width + '" height="' + height + '"></embed></object>';
break;
case "js":
lrCompanionClickThru ? wrapper = CompanionManager.createWrapperFrame(width, height, ("https:" === targetWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/js/companion_iframe.html?type=js&content=" + encodeURIComponent(content), targetWindow) : companionHTML += '<iframe src="' + ("https:" === window.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/js/companion_iframe.html?type=js&content=" + encodeURIComponent(content) + '" frameborder="0" marginwidth="0" marginheight="0" scrolling="no" style="width: ' + width + "px; height: " + height + 'px; border: 0px; margin: 0px;"></iframe>';
break;
default:
companionHTML += content
}
if (_this.logger.log("Showing " + size + " " + companionAd.getType() + " companion ad"), lrCompanionClickThru) {
var companionFingerprint = {
type: companionAd.getType(),
width: width,
height: height,
companionElement: companionElement
};
if (wrapper) {
var uniqueId = Utils.genUniqueId().toString();
wrapper.onload = function() {
onWrapperLoad()
}, "function" != typeof wrapper.onload && (wrapper.onreadystatechange = function() {
("loaded" === this.readyState || "complete" === this.readyState) && onWrapperLoad()
}), targetWindow.addEventListener("message", handleMessage, !1), companionElement.innerHTML = "", companionElement.appendChild(wrapper)
} else {
var divWrapper = targetWindow.document.createElement("div");
divWrapper.onmouseup = function(a) {
a || (a = targetWindow.event), 3 !== a.which && 2 !== a.button && "function" == typeof lrCompanionClickThru && lrCompanionClickThru(companionFingerprint)
}, divWrapper.innerHTML = companionHTML, companionElement.innerHTML = "", companionElement.appendChild(divWrapper)
}
} else companionElement.innerHTML = companionHTML;
defaultElement && (defaultElement.style.display = "none"), companionElement.style.display = "block"
}) : void this.logger.error("Invalid target window, dropping companion ads")
}, CompanionManager.prototype.hideCompanions = function(companionAds, companionPlacements, targetWindow) {
var _this = this;
this.logger.log("hideCompanions(", companionAds, ",", companionPlacements), companionAds.forEach(function(companionAd) {
var size = companionAd.getSize(),
companionPlacement = CompanionManager.resolveCompanionPlacement(companionAd, companionPlacements),
companionElement = CompanionManager.locateElement(companionPlacement.getCompanionId(), targetWindow),
defaultElement = CompanionManager.locateElement(companionPlacement.getDefaultId(), targetWindow);
if (companionElement && companionPlacement.getPurge()) {
_this.logger.log("Hiding " + size + " " + companionAd.getType() + " companion ad");
var lrCompanionPurgeDelay = targetWindow.lrCompanionPurgeDelay || {},
lrCompanionPurgeCallback = targetWindow.lrCompanionPurgeCallback || {};
switch (typeof lrCompanionPurgeCallback[size]) {
case "function":
lrCompanionPurgeCallback[size]();
break;
case "string":
eval(lrCompanionPurgeCallback[size])
}
lrCompanionPurgeDelay[size] > 0 ? setTimeout(function() {
CompanionManager.hideCompanionElement(companionElement, defaultElement)
}, lrCompanionPurgeDelay[size]) : CompanionManager.hideCompanionElement(companionElement, defaultElement)
}
})
}, CompanionManager.resolveCompanionPlacement = function(a, b) {
return b[a.getSize()] || new CompanionPlacement(a.getWidth(), a.getHeight(), "lr_comp_" + a.getSize(), "lr_comp_default_" + a.getSize(), !1)
}, CompanionManager.locateElement = function(a, b) {
try {
var c = b.document.getElementById(a);
if (null !== c) return c;
if (b !== window.top && b.parent && b.parent !== b) return this.locateElement(a, b.parent)
} catch (d) {}
return null
}, CompanionManager.createWrapperFrame = function(a, b, c, d) {
var e = d.document.createElement("iframe");
return e.src = c, e.style.border = "0px", e.style.margin = "0px", e.style.width = a + "px", e.style.height = b + "px", e.style.overflow = "hidden", e.scrolling = "no", e.frameBorder = "0", e.marginWidth = "0", e.marginHeight = "0", e
}, CompanionManager.hideCompanionElement = function(a, b) {
a.style.display = "none", b && (b.style.display = "block")
}, CompanionManager
}();
return CompanionManager
}), define("InventoryPodSlot", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this._adResponse = null, this._hadImpression = !1, this._retryCount = 0
}
return a.prototype.setAdResponse = function(a) {
this._adResponse = a
}, a.prototype.getAdResponse = function() {
return this._adResponse
}, a.prototype.getRetryCount = function() {
return this._retryCount
}, a.prototype.registerRetry = function() {
this._retryCount += 1
}, a.prototype.registerAdSlotCompletion = function(a) {
a.hadImpression() && (this._hadImpression = !0)
}, a.prototype.hadImpression = function() {
return this._hadImpression
}, a
}();
return c
}), define("InventoryPod", ["require", "exports", "InventoryPodSlot", "PlacementDefinition"], function(a, b, c, d) {
var e = function() {
function a(a) {
this.adParameters = null, this.placementDefinition = new d, this.podSlotQueue = [], this.failedSlots = 0, this.playedDuration = 0, this.startTime = 0, this.adParameters = a
}
return a.prototype.getMaxDuration = function() {
return this.placementDefinition.isFromServer() ? this.placementDefinition.maxDuration : this.adParameters ? this.adParameters.maxDuration : 0
}, a.prototype.getMaxPodSlots = function() {
return this.placementDefinition.isFromServer() ? this.placementDefinition.maxPodSlots : this.adParameters ? this.adParameters.maxPodSlots : 0
}, a.prototype.getMaxPodDuration = function() {
return this.placementDefinition.isFromServer() ? this.placementDefinition.maxPodDuration : this.adParameters ? this.adParameters.maxPodDuration : 0
}, a.prototype.getNewInventoryPodSlot = function() {
var a = null;
return this.hasCompleted() || (a = new c, this.podSlotQueue.push(a)), a
}, a.prototype.setStartTime = function() {
0 === this.startTime && (this.startTime = Date.now())
}, a.prototype.getElapsedRealtime = function() {
return (Date.now() - this.startTime) / 1e3
}, a.prototype.increasePlayedDuration = function(a) {
this.playedDuration += Math.max(0, a)
}, a.prototype.getPlayedDuration = function() {
return this.playedDuration
}, a.prototype.getRemainingDuration = function() {
if (this.isDurationBased()) {
var a = Math.max(0, this.getMaxPodDuration() - this.getPlayedDuration());
return this.getMaxDuration() > 0 ? Math.round(Math.min(this.getMaxDuration(), a)) : a
}
return null
}, a.prototype.getPodSlotIndex = function() {
return this.podSlotQueue.length - 1
}, a.prototype.getCurrentPodPosition = function() {
return Math.max(this.podSlotQueue.length - this.failedSlots, 1)
}, a.prototype.getTotalSlots = function() {
return Math.max(this.getMaxPodSlots() - this.failedSlots, 0)
}, a.prototype.hasCompleted = function() {
return this.isDurationBased() && this.getRemainingDuration() < 3 ? !0 : this.isSlotBased() && this.podSlotQueue.length >= this.getMaxPodSlots() && this.podSlotQueue.length > 0 ? !0 : this.podSlotQueue.length >= 10 ? !0 : this.getPlayedDuration() >= 600
}, a.prototype.isDurationBased = function() {
return this.getMaxPodDuration() > 0
}, a.prototype.isSlotBased = function() {
return this.getMaxPodSlots() > 0 || !this.isDurationBased()
}, a.prototype.setPlacementDefinition = function(a) {
null !== a && (this.placementDefinition = a)
}, a.prototype.getPlacementDefinition = function() {
return this.placementDefinition
}, a.prototype.registerInventoryPodSlotCompletion = function(a) {
a.hadImpression() || (this.failedSlots += 1)
}, a.TYPE_INSTREAM = "in", a.TYPE_OVERLAY = "ov", a
}();
return e
}), define("InventoryPodHistory", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.failedConnectionIds = [], this.servedCreativeIds = [], this.failedCreativeIds = []
}
return a.prototype.registerAdSourceFailure = function(a) {
var b = a.getAttribute("cid");
b && this.failedConnectionIds.push(a.getAttribute("cid"))
}, a.prototype.getFailedConnectionIds = function() {
return this.failedConnectionIds
}, a.prototype.registerAdCandidateCompletion = function(a) {
var b = a.uniqueCreativeID || a.creativeID;
a.hadImpression() ? b && this.servedCreativeIds.push(b) : b && "0" !== b ? this.failedCreativeIds.push(b) : a.connectionID && this.failedConnectionIds.push(a.connectionID)
}, a.prototype.getServedCreativeIds = function() {
return this.servedCreativeIds
}, a.prototype.getFailedCreativeIds = function() {
return this.failedCreativeIds
}, a
}();
return c
}), define("Integration", ["require", "exports"], function(a, b) {
var c;
return function(a) {
a[a.unknown = 0] = "unknown", a[a.interstitial = 1] = "interstitial", a[a.JWPlayer = 2] = "JWPlayer", a[a.BrightCove = 3] = "BrightCove", a[a.VideoJS = 4] = "VideoJS", a[a.PDK = 5] = "PDK"
}(c || (c = {})), c
}), define("LinearSkin", ["require", "exports", "EventManager", "Logger", "VPAIDEvents"], function(a, b, c, d, e) {
var f = function() {
function a(a, b, f) {
this.eventManager = new c(e), this.adapter = null, this.adCandidate = null, this.environmentData = b, this.inventoryPod = f, this.logger = new d(a)
}
return a.prototype.register = function(a, b) {
this.logger.debug("Registering adapter:", a, "adCandidate:", b), this.adapter = a, this.adCandidate = b, this.registerAdapterSubscriptions(this.adapter)
}, a.prototype.unregister = function() {
null !== this.adapter && (this.logger.debug("Unregistering adapter:", this.adapter, "adCandidate:", this.adCandidate), this.unregisterAdapterSubscriptions(this.adapter), this.adapter = null, this.adCandidate = null)
}, a.prototype.registerAdapterSubscriptions = function(a) {
this.logger.log("Registering event subscriptions on adapter:", a), a.subscribe(this.onAdStopped, e.AdStopped, this), a.subscribe(this.onAdSkipped, e.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, e.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, e.AdSizeChange, this), a.subscribe(this.onAdLinearChange, e.AdLinearChange, this), a.subscribe(this.onAdDurationChange, e.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, e.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, e.AdVolumeChange, this), a.subscribe(this.onAdImpression, e.AdImpression, this), a.subscribe(this.onAdVideoStart, e.AdVideoStart, this), a.subscribe(this.onAdVideoComplete, e.AdVideoComplete, this), a.subscribe(this.onAdClickThru, e.AdClickThru, this), a.subscribe(this.onAdInteraction, e.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, e.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, e.AdUserMinimize, this), a.subscribe(this.onAdUserClose, e.AdUserClose, this), a.subscribe(this.onAdPaused, e.AdPaused, this), a.subscribe(this.onAdPlaying, e.AdPlaying, this), a.subscribe(this.onAdError, e.AdError, this)
}, a.prototype.unregisterAdapterSubscriptions = function(a) {
this.logger.log("Unregistering event subscriptions on adapter:", a), a.unsubscribe(this.onAdStopped, e.AdStopped), a.unsubscribe(this.onAdSkipped, e.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, e.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, e.AdSizeChange), a.unsubscribe(this.onAdLinearChange, e.AdLinearChange), a.unsubscribe(this.onAdDurationChange, e.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, e.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, e.AdVolumeChange), a.unsubscribe(this.onAdImpression, e.AdImpression), a.unsubscribe(this.onAdVideoStart, e.AdVideoStart), a.unsubscribe(this.onAdVideoComplete, e.AdVideoComplete), a.unsubscribe(this.onAdClickThru, e.AdClickThru), a.unsubscribe(this.onAdInteraction, e.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, e.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, e.AdUserMinimize), a.unsubscribe(this.onAdUserClose, e.AdUserClose), a.unsubscribe(this.onAdPaused, e.AdPaused), a.unsubscribe(this.onAdPlaying, e.AdPlaying), a.unsubscribe(this.onAdError, e.AdError)
}, a.prototype.onAdLoaded = function() {}, a.prototype.onAdStarted = function() {}, a.prototype.onAdStopped = function() {}, a.prototype.onAdSkipped = function() {}, a.prototype.onAdSkippableStateChange = function() {}, a.prototype.onAdSizeChange = function() {}, a.prototype.onAdLinearChange = function() {}, a.prototype.onAdDurationChange = function() {}, a.prototype.onAdExpandedChange = function() {}, a.prototype.onAdVolumeChange = function() {}, a.prototype.onAdImpression = function() {}, a.prototype.onAdVideoStart = function() {}, a.prototype.onAdVideoFirstQuartile = function() {}, a.prototype.onAdVideoMidpoint = function() {}, a.prototype.onAdVideoThirdQuartile = function() {}, a.prototype.onAdVideoComplete = function() {}, a.prototype.onAdClickThru = function(a, b, c) {}, a.prototype.onAdInteraction = function() {}, a.prototype.onAdUserAcceptInvitation = function() {}, a.prototype.onAdUserMinimize = function() {}, a.prototype.onAdUserClose = function() {}, a.prototype.onAdPaused = function() {}, a.prototype.onAdPlaying = function() {}, a.prototype.onAdError = function() {}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a
}();
return f
});
var __extends = this.__extends || function(a, b) {
function c() {
this.constructor = a
}
for (var d in b) b.hasOwnProperty(d) && (a[d] = b[d]);
c.prototype = b.prototype, a.prototype = new c
};
return define("DefaultLinearSkin", ["require", "exports", "Integration", "InterfaceAsset", "LinearSkin", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f, g) {
var h = function(a) {
function b(b, c) {
var d = this;
a.call(this, "DefaultLinearSkin", b, c), this._countdownInterval = null, this._countdownMessage = "", this._largePlayButton = null, this._layoutAdded = !1, this._skipElement = null, this._smallMuteButton = null, this._smallPlayButton = null, this.onClickElementClick = function(a) {
if (d.adapter && f.checkWindowSanity()) {
if (a.which > 1) return;
d.logger.log("Click element was clicked"), a.stopPropagation(), a.preventDefault(), d.adapter.supports(1) && (d.adapter.isPaused() ? d.adapter.resumeAd() : d.adCandidate.hasValidClickthruUrl() && (!d.adapter.getAdapterConfiguration().playerHandlesClick && d.adapter.getAdapterConfiguration().pauseOnClick && (d.logger.log("Pause-on-click is enabled, calling pauseAd()"), d.adapter.pauseAd()), d.eventManager.dispatch(g.AdClickThru, [d.adCandidate.clickThruUrl, "", !0])))
}
}, this.onPlayButtonClick = function(a) {
d.adapter.isPaused() ? d.adapter.resumeAd() : d.adapter.pauseAd()
}, this.onSkipElementClick = function(a) {
0 === d.adapter.getAdSkippableRemainingTime() && d.adapter.getAdSkippableState() === !0 ? (d.logger.log("Skip button pressed"), d.adapter.skipAd()) : d.logger.warn("Skip button pressed -- ad not skippable at this time")
}, this.onSmallMuteElementClick = function(a) {
d.adapter.adVolume > 0 ? d.adapter.setAdVolume(0) : d.adapter.setAdVolume(1)
}, this.onSmallPlayElementClick = function(a) {
d.adapter.isPaused() ? d.adapter.resumeAd() : d.adapter.pauseAd()
}, this.onCountdownInterval = function() {
if (d._countdownFrame && d.adapter.getAdRemainingTime() >= 0) {
var a = d.adapter.getAdDuration() - d.adapter.getAdRemainingTime(),
b = Math.ceil(Math.round(d.adapter.getAdDuration()) - a),
c = Math.floor(b / 60),
e = Math.floor(b % 60),
f = c + ":" + (10 > e ? "0" : "") + e,
g = d._countdownMessage.replace(/\{COUNTDOWN\}/g, b.toString()).replace(/\{COUNTDOWNTIME\}/g, f);
d._countdownHTML !== g && (d._countdownHTML = g, d._countdownFrame.innerHTML = d._countdownHTML)
}
if (d._skipElement)
if (d.adapter.getAdSkippableRemainingTime() >= 0 || d.adapter.getAdSkippableState() === !0) {
var h, i;
d.adapter.getAdSkippableRemainingTime() > 0 ? (h = d.adapter.getAdapterConfiguration().skipCountdownMessage.replace("{COUNTDOWN}", Math.ceil(d.adapter.getAdSkippableRemainingTime()).toString()), i = "default") : (h = d.adapter.getAdapterConfiguration().skipMessage, i = "pointer"), d._skipHTML !== h && (d._skipHTML = h, d._skipElement.innerHTML = d._skipHTML, d._skipElement.style.setProperty("cursor", i, "important"), d._skipElement.style.setProperty("display", "block", "important"))
} else d._skipElement.style.setProperty("display", "none", "important")
}
}
return __extends(b, a), b.prototype.register = function(b, c) {
a.prototype.register.call(this, b, c)
}, b.prototype.unregister = function() {
this.adapter && (this.removeSkinLayout(), a.prototype.unregister.call(this))
}, b.prototype.addSkinLayout = function() {
this._layoutAdded || (this._layoutAdded = !0, !this._clickElement && this.adapter.supports(1) && (this._clickElement = f.addElement({
target: this.environmentData.slot,
styles: {
position: "absolute",
top: "0px",
left: "0px",
width: "100%",
height: "100%",
cursor: "default"
},
events: {
click: this.onClickElementClick,
contextmenu: function(a) {
a.preventDefault()
}
}
}), this.adCandidate.hasValidClickthruUrl() && this._clickElement.style.setProperty("cursor", "pointer", "important")), 1 !== this.adapter.getAdapterConfiguration().linearSkin && 2 !== this.adapter.getAdapterConfiguration().linearSkin || f.detectDevice("phone") || (this.isLegacyInterstitial() || (this._countdownMessage = this.parseCountdownMessage(), this.adapter.supports(2) && (this._largePlayButton = f.addElement({
target: this.environmentData.slot,
type: "img",
styles: {
position: "absolute",
opacity: "0.7",
display: "none",
border: "0px none",
cursor: "pointer",
top: "50%",
left: "50%",
width: "80px",
height: "80px",
margin: "-40px 0px 0px -40px",
transition: "opacity 250ms ease-out",
"-webkit-transition": "opacity 250ms ease-out",
"-moz-transition": "opacity 250ms ease-out",
"user-select": "none",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"-khtml-user-select": "none",
"-o-user-select": "none"
},
attributes: {
src: d.getBase64ImgSrc(new d(d.LARGE_PLAY_BUTTON))
},
events: {
contextmenu: function(a) {
a.preventDefault()
},
click: this.onPlayButtonClick,
mouseover: function(a) {
var b = a.srcElement;
b.style.setProperty("opacity", "1.0", "important")
},
mouseout: function(a) {
var b = a.srcElement;
b.style.setProperty("opacity", "0.7", "important")
}
}
}))), this.adapter.supports(3) && (this._skipElement = f.addElement({
target: this.environmentData.slot,
styles: {
position: "absolute",
display: "none",
right: "0px",
bottom: "16%",
padding: "6px 12px 6px 12px",
"font-family": "Helvetica, Arial, sans",
"font-size": "14px",
"text-align": "left",
background: "rgba(0,0,0,0.5)",
color: "rgb(204,204,204)",
border: "1px solid rgb(76,76,76)",
"border-right-width": "0px",
"user-select": "none",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"-khtml-user-select": "none",
"-o-user-select": "none"
},
events: {
contextmenu: function(a) {
a.preventDefault()
},
click: this.onSkipElementClick
}
})), this.isLegacyInterstitial() || (this.adapter.getAdapterConfiguration().showCountdown && this.adapter.supports(0) && (this._countdownFrame = f.addElement({
target: this.environmentData.slot,
styles: {
position: "absolute",
top: "0px",
left: "0px",
width: "100%",
height: "18px",
"line-height": "18px",
"text-indent": "5px",
"text-align": "left",
background: "rgba(0,0,0,0.5)",
color: "rgb(204,204,204)",
"font-family": "Helvetica, Arial, sans",
"font-size": "11px",
cursor: "default",
"user-select": "none",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"-khtml-user-select": "none",
"-o-user-select": "none"
},
events: {
contextmenu: function(a) {
a.preventDefault()
}
}
})), 2 === this.adapter.getAdapterConfiguration().linearSkin && this.adapter.supports(2) && (this._smallMuteButton = f.addElement({
type: "img",
target: this.environmentData.slot,
styles: {
position: "absolute",
opacity: "0.7",
display: "block",
border: "0px none",
cursor: "pointer",
bottom: "5px",
left: "35px",
width: "25px",
height: "25px",
transition: "opacity 250ms ease-out",
"-webkit-transition": "opacity 250ms ease-out",
"-moz-transition": "opacity 250ms ease-out",
"user-select": "none",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"-khtml-user-select": "none",
"-o-user-select": "none"
},
events: {
contextmenu: function(a) {
a.preventDefault()
},
click: this.onSmallMuteElementClick,
mouseover: function(a) {
var b = a.srcElement;
b.style.setProperty("opacity", "1.0", "important")
},
mouseout: function(a) {
var b = a.srcElement;
b.style.setProperty("opacity", "0.7", "important")
}
}
}), this.renderSmallMuteAsset(), this._smallPlayButton = f.addElement({
type: "img",
target: this.environmentData.slot,
styles: {
position: "absolute",
opacity: "0.7",
display: "block",
border: "0px none",
cursor: "pointer",
bottom: "5px",
left: "5px",
width: "25px",
height: "25px",
transition: "opacity 250ms ease-out",
"-webkit-transition": "opacity 250ms ease-out",
"-moz-transition": "opacity 250ms ease-out",
"user-select": "none",
"-webkit-user-select": "none",
"-moz-user-select": "none",
"-khtml-user-select": "none",
"-o-user-select": "none"
},
events: {
contextmenu: function(a) {
a.preventDefault()
},
click: this.onSmallPlayElementClick,
mouseover: function(a) {
var b = a.srcElement;
b.style.setProperty("opacity", "1.0", "important")
},
mouseout: function(a) {
var b = a.srcElement;
b.style.setProperty("opacity", "0.7", "important")
}
}
}), this.renderSmallPlayAsset())))), this.registerCountdownInterval()
}, b.prototype.renderSmallMuteAsset = function() {
this.adapter.adVolume > 0 ? this._smallMuteButton.src = d.getBase64ImgSrc(new d(d.SMALL_MUTE_BUTTON)) : this._smallMuteButton.src = d.getBase64ImgSrc(new d(d.SMALL_UNMUTE_BUTTON))
}, b.prototype.renderSmallPlayAsset = function() {
this.adapter.isPaused() ? this._smallPlayButton.src = d.getBase64ImgSrc(new d(d.SMALL_PLAY_BUTTON)) : this._smallPlayButton.src = d.getBase64ImgSrc(new d(d.SMALL_PAUSE_BUTTON))
}, b.prototype.removeSkinLayout = function() {
this._layoutAdded && (this.unregisterCountdownInterval(), this._layoutAdded = !1, this._clickElement && (this.environmentData.slot.removeChild(this._clickElement), this._clickElement = null), this._skipElement && (this.environmentData.slot.removeChild(this._skipElement), this._skipElement = null), this._largePlayButton && (this.environmentData.slot.removeChild(this._largePlayButton), this._largePlayButton = null), this._countdownFrame && (this.environmentData.slot.removeChild(this._countdownFrame), this._countdownFrame = null), this._smallMuteButton && (this.environmentData.slot.removeChild(this._smallMuteButton), this._smallMuteButton = null), this._smallPlayButton && (this.environmentData.slot.removeChild(this._smallPlayButton), this._smallPlayButton = null))
}, b.prototype.onAdImpression = function() {
this.addSkinLayout()
}, b.prototype.onAdStopped = function() {
this.removeSkinLayout()
}, b.prototype.onAdError = function() {
this.removeSkinLayout()
}, b.prototype.onAdPaused = function() {
this._largePlayButton && this._largePlayButton.style.setProperty("display", "block", "important"), this._smallPlayButton && this.renderSmallPlayAsset()
}, b.prototype.onAdPlaying = function() {
this._largePlayButton && this._largePlayButton.style.setProperty("display", "none", "important"), this._smallPlayButton && this.renderSmallPlayAsset()
}, b.prototype.onAdVolumeChange = function() {
this._smallMuteButton && this.renderSmallMuteAsset()
}, b.prototype.registerCountdownInterval = function() {
null !== this._countdownInterval && this.unregisterCountdownInterval(), this._countdownInterval = setInterval(this.onCountdownInterval, 500), this.onCountdownInterval()
}, b.prototype.unregisterCountdownInterval = function() {
clearInterval(this._countdownInterval), this._countdownInterval = null
}, b.prototype.parseCountdownMessage = function() {
var a = "";
if (this.adapter.getAdapterConfiguration().indexMessage && this.inventoryPod.getTotalSlots() > 1) {
var b = this.adapter.getAdapterConfiguration().indexMessage;
b = b.replace(/\{ADINDEX\}/g, this.inventoryPod.getCurrentPodPosition().toString()), b = b.replace(/\{ADSTOTAL\}/g, this.inventoryPod.getTotalSlots().toString()), a = b
}
return this.adapter.getAdapterConfiguration().countdownMessage && (a.length > 0 && (a += " "), a += this.adapter.getAdapterConfiguration().countdownMessage), a
}, b.prototype.isLegacyInterstitial = function() {
return 1 === this.environmentData.integration && null === this.environmentData.integrationVersion
}, b
}(e);
return h
}), define("LinearSkinFactory", ["require", "exports", "DefaultLinearSkin"], function(a, b, c) {
var d = function() {
function a() {}
return a.getLinearSkinInstance = function(a, b) {
var d;
switch (a.getAdParameters().linearSkin) {
default: d = new c(a, b)
}
return d
}, a
}();
return d
}),
function() {
"use strict";
var a = {
isCssAllSupported: function() {
return "all" in document.documentElement.style
},
isCssFeatureQueriesSupported: function() {
var a = "CSS" in window && "supports" in window.CSS;
return a || "supportsCSS" in window
},
isDragAndDropSupported: function() {
var a = document.createElement("div");
return "draggable" in a || "ondragstart" in a && "ondrop" in a
},
isOggSupported: function() {
var a = document.createElement("video"),
b = !1;
try {
if (b = !!a.canPlayType) {
var c = a.canPlayType('video/ogg; codecs="theora"').replace(/^no$/, "");
b = "" != c
}
} catch (d) {}
return b
},
isCssVariablesSupported: function() {
return window.CSS && window.CSS.supports && window.CSS.supports("--fake-var", 0)
},
isScopedCssSupported: function() {
var a = document.createElement("style");
return a.setAttribute("scoped", "true"), a.scoped === !0
},
isCssPositionStickySupported: function() {
var a = "position:",
b = "sticky",
c = ["-webkit-", "-moz-", "-o-", "-ms-"],
d = document.createElement("a"),
e = d.style;
return e.cssText = a + c.join(b + ";" + a).slice(0, -a.length), -1 !== e.position.indexOf(b)
},
getTimeZoneOffset: function() {
var a = new Date;
return a.getTimezoneOffset()
},
isDialogSupported: function() {
var a = document.createElement("dialog");
return !!a.show
},
isVideoSupported: function() {
var a = document.createElement("video");
return !!a.canPlayType
},
isAudioSupported: function() {
var a = document.createElement("audio");
return !!a.canPlayType
},
getAncestorOrigin: function() {
var a = "";
if (window.location && location.ancestorOrigins && location.ancestorOrigins.length > 0) {
a = location.ancestorOrigins.item(0);
for (var b = 1; b < location.ancestorOrigins.length; ++b) a = a + "," + location.ancestorOrigins.item(b)
}
return a
},
isGetRandomValuesSupported: function() {
return !!window.crypto && !!window.crypto.getRandomValues || !!window.msCrypto && !!window.msCrypto.getRandomValues
},
getBrowserFeatures: function() {
var a = {
ua: navigator.userAgent,
version: navigator.appVersion,
platform: navigator.platform,
isIframe: parent !== window,
ref: document.referrer,
url: document.URL,
width: screen.width,
height: screen.height,
awidth: screen.availWidth,
aheight: screen.availHeight,
left: window.screenLeft ? window.screenLeft : window.screenX,
top: window.screenTop ? window.screenTop : window.screenY,
cssall: this.isCssAllSupported(),
cfq: this.isCssFeatureQueriesSupported(),
plugins: navigator.plugins.length,
websql: !!window.openDatabase,
pmode: !!window.callPhantom || !!window._phantom,
dnd: this.isDragAndDropSupported(),
ogg: this.isOggSupported(),
cssvar: this.isCssVariablesSupported(),
scope: this.isScopedCssSupported(),
ce: "registerElement" in document,
sticky: this.isCssPositionStickySupported(),
imp: "import" in document.createElement("link"),
chrome: !!window.chrome,
ie: !!window.ActiveXObject,
tz: this.getTimeZoneOffset(),
chromewebstore: !!window.chrome && !!window.chrome.webstore,
dialog: this.isDialogSupported(),
video: this.isVideoSupported(),
audio: this.isAudioSupported(),
ancestor: this.getAncestorOrigin(),
random: this.isGetRandomValuesSupported()
};
return JSON.stringify(a)
}
};
"undefined" != typeof exports ? module.exports = a : "undefined" != typeof define && define("PluginBrowserFeatures", [], function() {
return a
})
}(), define("PigeonEvent", ["require", "exports"], function(a, b) {
var c = function() {
function a(a) {
this.time = Date.now() / 1e3, this.extra = {}, this.name = a
}
return a.prototype.addExtraDictionary = function(a) {
var b = this;
a && Object.keys(a).forEach(function(c) {
b.extra[c] = "" + a[c]
})
}, a.prototype.addExtraParam = function(a, b) {
a && (this.extra[a] = "" + b)
}, a.prototype.toDictionary = function() {
return {
name: this.name,
time: this.time,
extra: this.extra
}
}, a
}();
return c
}), define("PigeonLogger", ["require", "exports", "HTTP", "Logger", "Utils"], function(a, b, c, d, e) {
var f = function() {
function a() {}
return a.logEvent = function(b) {
a.lastEventTime = Date.now(), a.eventQueue.push(b), null === a.delayTimer && (a.delayTimer = setTimeout(a.delayTimerHandler, 200))
}, a.dispatchEventQueue = function() {
if (a.eventQueue.length > 0) {
a.logger.verbose("Logging " + a.eventQueue.length + " events");
var b = Date.now() / 1e3,
d = [];
a.eventQueue.forEach(function(a) {
d.push(a.toDictionary())
});
var f = {
seq: a.sequenceId++,
time: b,
app_id: 541974109282702,
app_ver: "2.2.8",
log_type: "client_event",
session_id: a.getSessionID(),
data: d
};
c.request({
url: "https://graph.facebook.com/logging_client_events",
type: "POST",
timeout: null,
data: e.serialize({
access_token: "541974109282702|7d5d3313170a82367ae5fbb6f8d9aa6e",
message: JSON.stringify(f)
}),
xhrFields: {
withCredentials: !1
},
error: function(b, c, d) {
a.logger.error("Failed to communicate with logging endpoint, error=" + d)
}
}), a.eventQueue = []
}
}, a.delayTimerHandler = function() {
a.delayTimer = null, a.dispatchEventQueue()
}, a.getSessionID = function() {
var b = Date.now();
return (!a.sessionId || b - a.SESSION_TIMEOUT > a.lastEventTime) && (a.sessionId = b.toString(16) + "-" + (~~(16777215 * Math.random())).toString(16)), a.sessionId
}, a.delayTimer = null, a.eventQueue = [], a.logger = new d("PigeonLogger"), a.sequenceId = 0, a.sessionId = null, a.sessionIDInitialized = !1, a.SESSION_TIMEOUT = 18e4, a
}();
return f
}), ! function() {
function a(a, b) {
"use strict";
var c, d, e, f, g, h, i;
g = {
bottom: null,
error: null,
focus: null,
height: null,
iframe: null,
left: null,
pageUrl: "",
right: null,
top: null,
topUrl: "",
visibleWidth: null,
visibleHeight: null,
viewable: 0,
viewablePercent: 0,
viewportWidth: null,
viewportHeight: null,
width: null
};
try {
void 0 === b && (b = a.ownerDocument.defaultView || a.ownerDocument.parentWindow);
try {
"function" == typeof b.getComputedStyle && void 0 !== a.clientWidth && (c = b.getComputedStyle(a), i = a.clientWidth - parseFloat(c.paddingLeft) - parseFloat(c.paddingRight), d = a.clientHeight - parseFloat(c.paddingTop) - parseFloat(c.paddingBottom), "number" != typeof i || isNaN(i) || "number" != typeof d || isNaN(d) || (g.width = i, g.height = d))
} catch (j) {}
e = b.top, g.topUrl = e && b !== e && b.document.referrer ? b.document.referrer : b.document.location.href, void 0 !== b.document.hidden ? g.focus = !b.document.hidden : void 0 !== b.document.webkitHidden && (g.focus = !b.document.webkitHidden);
try {
g.pageUrl = e.location.href
} catch (j) {}
g.pageUrl ? b.top === b.self ? g.iframe = 0 : g.iframe = 1 : (g.iframe = 2, b.parent === b.top ? g.pageUrl = g.topUrl : g.pageUrl = ""), 2 !== g.iframe && (h = b.document.documentElement.hasOwnProperty ? b.document.documentElement.hasOwnProperty("ontouchstart") : !1, h ? (g.viewportWidth = e.innerWidth, g.viewportHeight = e.innerHeight) : (g.viewportWidth = e.document.documentElement.clientWidth || e.innerWidth || e.document.body.clientWidth, g.viewportHeight = e.document.documentElement.clientHeight || e.innerHeight || e.document.body.clientHeight), "function" == typeof e.document.hasFocus && (g.focus = e.document.hasFocus()), g.top = 0, g.left = 0, f = function(a, b) {
var c = b.getBoundingClientRect();
g.top += c.top, g.left += c.left, null === g.right ? g.right = c.right : g.right += c.left, null === g.bottom ? g.bottom = c.bottom : g.bottom += c.top, a.self !== e && f(a.parent, a.frameElement);
}, f(b, a), g.width = g.right - g.left, g.height = g.bottom - g.top, g.visibleWidth = g.right - g.left, g.visibleHeight = g.bottom - g.top, g.left < 0 && (g.visibleWidth += g.left), g.top < 0 && (g.visibleHeight += g.top), g.right > g.viewportWidth && (g.visibleWidth -= g.right - g.viewportWidth), g.bottom > g.viewportHeight && (g.visibleHeight -= g.bottom - g.viewportHeight), g.visibleWidth = Math.max(0, g.visibleWidth), g.visibleHeight = Math.max(0, g.visibleHeight), g.viewablePercent = Math.round(g.visibleWidth * g.visibleHeight / (g.width * g.height) * 100) || 0)
} catch (k) {
"object" == typeof k ? g.error = k.message : g.error = "unknown"
}
return null !== g.error || g.focus !== !1 && 2 === g.iframe || (g.focus !== !1 && g.viewablePercent >= 50 ? g.viewable = 1 : g.viewable = 2), g
}
function b(a) {
"use strict";
var b, c, d = "",
e = "",
f = "",
g = a || window,
h = 0,
i = 0,
j = 0,
k = "",
l = "";
try {
for (; null !== g && 100 > j;) {
j += 1, b = "", c = "";
try {
b = g.document.referrer, c = g.location.href || g.document.location.href, d = b, e = c, i = j
} catch (m) {
h += 1
}
k += (k ? "|*" : "") + c, a.top ? g === a.top ? (c && (f = c), g = null) : (g.parent === a.top && a.top && b && (f = b), g = g.parent) : g = null
}
} catch (n) {
l = n.message || "unknown error"
}
return {
errorMsg: l,
window_top: a.top ? "[Window]" : "null",
crossDomainCount: h,
level: i,
domains: k,
location: e,
referrer: d,
topUrl: f || d || e,
pageUrl: f
}
}
var c = {
measureViewability: a,
measureWindow: b
};
"undefined" != typeof exports ? module.exports = c : "undefined" != typeof define && define("Viewability", [], function() {
return c
})
}(), define("TrackingManager", ["require", "exports", "Logger", "PigeonEvent", "PigeonLogger", "Viewability"], function(a, b, c, d, e, f) {
var g = function() {
function a() {}
return a.dispatchTrackers = function(a, b) {
var c = this;
"undefined" == typeof a && (a = []), a.forEach(function(a) {
a.getUrls().forEach(function(d) {
if (b)
for (var e in b)
if (b.hasOwnProperty(e)) {
var f = b[e];
if (void 0 !== f && f !== e)
for (; - 1 !== d.indexOf(e);) d = d.replace(e, f)
}
c.logger.log("Tracker load, type=" + a.getType() + (a.getValue() ? ", value=" + a.getValue() : "") + ", url=" + d), c.dispatchTrackingPixel(d)
})
})
}, a.registerLogEvent = function(b, c, g, h) {
var i = new d(a.LIVERAIL_EVENT);
i.addExtraDictionary(c.getAdRequestParameters()), i.addExtraParam(a.ERROR_CODE, b.id), i.addExtraParam(a.ERROR_MSG, b.message), i.addExtraParam(a.ERROR_DETAIL, JSON.stringify(b.detail)), g && (i.addExtraParam(a.AD_LOAD_CLOCK, g.getLoadClock()), i.addExtraParam(a.AD_ADAPTER, g.adapter), i.addExtraParam(a.AD_HAD_IMPRESSION, g.hadImpression()), i.addExtraParam(a.AD_TYPE, g.type), i.addExtraParam(a.AD_NID, g.networkID), i.addExtraParam(a.AD_COID, g.connectionID), i.addExtraParam(a.AD_SS, g.scenarios), i.addExtraParam(a.AD_NR, g.values), i.addExtraParam(a.AD_OID, g.orderID), i.addExtraParam(a.AD_OLID, g.orderLineID), i.addExtraParam(a.AD_CID, g.creativeID), i.addExtraParam(a.AD_UCID, g.uniqueCreativeID), i.addExtraParam(a.AD_VOLUME, 100 * h), i.addExtraParam(a.WINDOW_MEASUREMENT, JSON.stringify(f.measureWindow(c.slotWindow))), i.addExtraParam(a.VIEWABILITY_MEASUREMENT, JSON.stringify(f.measureViewability(c.videoSlot))), i.addExtraParam(a.NAVIGATOR, JSON.stringify(c.collectNavigatorProperties()))), e.logEvent(i)
}, a.dispatchTrackingPixel = function(a) {
var b = document.createElement("img");
b.src = a, b.style.setProperty("display", "none", "important"), b.style.setProperty("width", "1px", "important"), document.body.appendChild(b)
}, a.LIVERAIL_EVENT = "liverail_sdk_internal", a.ERROR_CODE = "error_code", a.ERROR_MSG = "error_msg", a.ERROR_DETAIL = "error_detail", a.AD_ADAPTER = "ad_adapter", a.AD_LOAD_CLOCK = "ad_load_clock", a.AD_HAD_IMPRESSION = "ad_had_impression", a.AD_TYPE = "ad_type", a.AD_NID = "ad_nid", a.AD_COID = "ad_coid", a.AD_SS = "ad_ss", a.AD_NR = "ad_nr", a.AD_OID = "ad_oid", a.AD_OLID = "ad_olid", a.AD_CID = "ad_cid", a.AD_UCID = "ad_ucid", a.AD_VOLUME = "ad_volume", a.WINDOW_MEASUREMENT = "window_measurement", a.VIEWABILITY_MEASUREMENT = "viewability_measurement", a.NAVIGATOR = "navigator", a.logger = new c("TrackingManager"), a
}();
return g
}), define("ViewabilityTest", ["require", "exports"], function(a, b) {
var c = function() {
function a(a) {
this._complete = !1, this._minViewableArea = null, this._passed = !1, this._testDuration = 0, this._viewableDuration = 0, this._rule = a
}
return a.prototype.getResults = function() {
return {
complete: this._complete,
minViewableArea: this._minViewableArea,
passed: this._passed,
testDuration: this._testDuration,
viewableDuration: this._viewableDuration
}
}, a.prototype.getRule = function() {
return this._rule
}, a.prototype.isComplete = function() {
return this._complete
}, a.prototype.registerMeasurement = function(a, b) {
return this.isComplete() ? void 0 : (this._testDuration += a, b >= this._rule.area ? (this._viewableDuration += a, (null === this._minViewableArea || this._minViewableArea > b) && (this._minViewableArea = b)) : (this._viewableDuration = 0, this._minViewableArea = null), this._rule.startTime >= 0 && this._testDuration > this._rule.startTime && 0 === this._viewableDuration ? void(this._complete = !0) : void(this._viewableDuration >= this._rule.duration && (this._passed = !0, this._complete = !0)))
}, a
}();
return c
}), define("ViewabilityManager", ["require", "exports", "Viewability", "ViewabilityTest"], function(a, b, c, d) {
var e = function() {
function a(a, b, e, f) {
var g = this;
this._active = !0, this._tests = [], this._viewableInterval = null, this.onProgress = function() {
if (g.isActive())
for (var a, b = c.measureViewability(g._targetElement, g._targetWindow), d = 0; d < g._tests.length; d++) a = g._tests[d], a.isComplete() || (a.registerMeasurement(g._frequency, g.calculateViewablePercent(b)), a.isComplete() && a.getRule().onComplete && a.getRule().onComplete(a.getResults()))
}, this._frequency = e, this._targetElement = a, this._targetWindow = b;
for (var h = 0; h < f.length; h++) this._tests.push(new d(f[h]));
this.registerMonitor()
}
return a.prototype.destroy = function() {
this.unregisterMonitor(), this._active = !1, this.dispatchIncompleteResults()
}, a.prototype.pause = function() {
this.isActive() && this.unregisterMonitor()
}, a.prototype.resume = function() {
this.isActive() && this.registerMonitor()
}, a.prototype.calculateViewablePercent = function(a) {
return null === a.error && 2 !== a.iframe && a.focus === !0 ? a.viewablePercent : 0
}, a.prototype.dispatchIncompleteResults = function() {
for (var a, b = 0; b < this._tests.length; b++) a = this._tests[b], a.isComplete() || a.getRule().onComplete(a.getResults())
}, a.prototype.isActive = function() {
return this._active
}, a.prototype.registerMonitor = function() {
null === this._viewableInterval && (this._viewableInterval = setInterval(this.onProgress, this._frequency))
}, a.prototype.unregisterMonitor = function() {
null !== this._viewableInterval && (clearInterval(this._viewableInterval), this._viewableInterval = null)
}, a
}();
return e
}), define("ViewabilityRule", ["require", "exports"], function(a, b) {
var c = function() {
function a(a, b, c, d) {
this.onComplete = null, this.area = a, this.duration = c, this.startTime = b, "function" == typeof d && (this.onComplete = d)
}
return a
}();
return c
}), define("VPAIDViewMode", ["require", "exports"], function(a, b) {
var c = function() {
function a() {}
return a.normal = "normal", a.thumbnail = "thumbnail", a.fullscreen = "fullscreen", a
}();
return c
}), define("AdManager", ["require", "exports", "AdapterConfiguration", "AdapterFactory", "AdExtensionManager", "AdProvider", "BrowserFeatures", "ClickToPlayInterface", "CompanionManager", "EventManager", "InventoryPod", "InventoryPodHistory", "Logger", "LogEvent", "LogEventType", "LinearSkinFactory", "PluginBrowserFeatures", "TrackingManager", "Utils", "ViewabilityManager", "ViewabilityRule", "VPAIDEvents", "VPAIDViewMode"], function(a, b, c, d, e, f, g, h, i, j, k, l, m, n, o, p, q, r, s, t, u, v, w) {
var x = function() {
function a(a) {
var b = this;
this.logger = new m("AdManager"), this.eventManager = new j(v), this.companionManager = new i, this.adProvider = new f, this.adExtensionManager = new e, this.adapterFactory = new d, this.adVolume = 1, this.adVolumeSet = !0, this.onVideoSlotContextMenu = function(a) {
s.checkWindowSanity() && a.preventDefault()
}, this.onVideoSlotVolumeChange = function() {
s.checkWindowSanity() && b.updateAdVolume(b.environmentData.videoSlot.muted ? 0 : b.environmentData.videoSlot.volume)
}, this.updateViewMode = function() {
if (s.checkWindowSanity()) {
var a = w.normal,
c = b.environmentData.slotWindow.document,
d = b.videoSlot;
(c.fullscreenEnabled || c.fullScreen || c.webkitIsFullScreen || c.mozFullScreen || c.msFullscreenEnabled || d && d.webkitDisplayingFullscreen) && (a = w.fullscreen), b.viewMode !== a && (b.adCandidate && b.state > 4 && b.state < 10 && (a === w.fullscreen ? r.dispatchTrackers(b.adCandidate.getTrackers("fullscreen")) : r.dispatchTrackers(b.adCandidate.getTrackers("leaveFullscreen"))), b.viewMode = a)
}
}, this.onAdSourceRequestError = function(a) {
var c = a.getAdSource();
b.inventoryPodHistory.registerAdSourceFailure(c)
}, this.onAdProviderSuccess = function(a) {
0 === b.inventoryPod.getPodSlotIndex() && null !== a.getPlacementDefinition() && b.inventoryPod.setPlacementDefinition(a.getPlacementDefinition()), b.inventoryPodSlot.setAdResponse(a), b.environmentData.setSessionId(a.getTrid()), b.initializeInventoryPodSlot()
}, this.onAdProviderError = function(a) {
b.registerLogEvent(a), b.onInventoryPodComplete(a)
}, this.adLinear = a.getDefaultAdLinear(), this.adProvider.subscribe(this.onAdProviderSuccess, f.AdProviderSuccess), this.adProvider.subscribe(this.onAdProviderError, f.AdProviderError), this.adProvider.subscribe(this.onAdSourceRequestError, f.AdSourceRequestError)
}
return a.prototype.getAdLinear = function() {
return this.adLinear
}, a.prototype.getAdWidth = function() {
return this.adapter ? this.adapter.getAdWidth() : 0
}, a.prototype.getAdHeight = function() {
return this.adapter ? this.adapter.getAdHeight() : 0
}, a.prototype.getAdExpanded = function() {
return this.adapter ? this.adapter.getAdExpanded() : !1
}, a.prototype.getAdSkippableState = function() {
return this.adapter ? this.adapter.getAdSkippableState() : !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return this.adapter ? this.adapter.getAdSkippableRemainingTime() : -2
}, a.prototype.getAdRemainingTime = function() {
return this.adapter ? Math.ceil(this.adapter.getAdRemainingTime()) : -2
}, a.prototype.getAdDuration = function() {
return this.adapter ? Math.ceil(this.adapter.getAdDuration()) : -2
}, a.prototype.getAdVolume = function() {
return this.adapter && this.adapter.getAdVolume() >= 0 ? this.adapter.getAdVolume() : this.adVolume
}, a.prototype.setAdVolume = function(a) {
var b = s.returnFloat(a);
isNaN(b) || (this.adVolumeSet = !0, this.updateAdVolume(b))
}, a.prototype.getAdCompanions = function() {
return this.adapter ? this.adapter.getAdCompanions() : ""
}, a.prototype.getAdIcons = function() {
return this.adapter ? this.adapter.getAdIcons() : !1
}, a.prototype.handshakeVersion = function(a) {
return "2.0"
}, a.prototype.initAd = function(a, b, c, d, e, f) {
this.destroy(), this.state = 1, this.registerEnvironmentData(f.environmentData), this.logger.log("Initializing with environmentData:", this.environmentData), this.inventoryPod = new k(this.environmentData.getAdParameters()), this.inventoryPodHistory = new l, this.instantiateInventoryPodSlot()
}, a.prototype.resizeAd = function(a, b, c) {
return this.adapter ? this.adapter.resizeAd(a, b, c) : void 0
}, a.prototype.startAd = function() {
3 === this.state && this.startNextInventoryPodSlot()
}, a.prototype.stopAd = function() {
if (this.state > 0) {
var a = this.state;
if (this.state = 2, a >= 4 && this.adapter) return this.adCandidate && r.dispatchTrackers(this.adCandidate.getTrackers("close")), void this.adapter.stopAd();
this.onInventoryPodComplete()
} else this.destroy(), this.eventManager.dispatch(v.AdStopped)
}, a.prototype.pauseAd = function() {
return this.adapter ? this.adapter.pauseAd() : void 0
}, a.prototype.resumeAd = function() {
return this.adapter ? this.adapter.resumeAd() : void 0
}, a.prototype.expandAd = function() {
return this.adapter ? this.adapter.expandAd() : void 0
}, a.prototype.collapseAd = function() {
return this.adapter ? this.adapter.collapseAd() : void 0
}, a.prototype.skipAd = function() {
return this.adapter ? this.adapter.skipAd() : void 0
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.onAdLoaded = function() {
this.registerLogEvent(n.eventWithType(o.AdLoaded)), this.registerLinearSkin(), this.registerDocument(), this.adapter.startAd()
}, a.prototype.onAdStarted = function() {
this.onAdLinearChange()
}, a.prototype.onAdStopped = function() {
this.state > 3 && (this.state = 10), this.adCandidate.registerComplete(), this.onAdapterComplete()
}, a.prototype.onAdSkipped = function() {
r.dispatchTrackers(this.adCandidate.getTrackers("skip")), this.eventManager.dispatch(v.AdSkipped)
}, a.prototype.onAdSkippableStateChange = function() {
this.eventManager.dispatch(v.AdSkippableStateChange)
}, a.prototype.onAdSizeChange = function() {
this.updateViewMode(), this.eventManager.dispatch(v.AdSizeChange)
}, a.prototype.onAdLinearChange = function() {
var a = this.adapter.getAdLinear();
this.adLinear !== a && (this.adLinear = a, this.eventManager.dispatch(v.AdLinearChange))
}, a.prototype.onAdDurationChange = function() {
this.adCandidate.updateCreativeDuration(this.adapter.getAdDuration()), this.eventManager.dispatch(v.AdDurationChange)
}, a.prototype.onAdExpandedChange = function() {
this.eventManager.dispatch(v.AdExpandedChange)
}, a.prototype.onAdVolumeChange = function() {
this.adVolume > 0 && 0 === this.adapter.getAdVolume() ? r.dispatchTrackers(this.adCandidate.getTrackers("mute")) : 0 === this.adVolume && this.adapter.getAdVolume() > 0 && r.dispatchTrackers(this.adCandidate.getTrackers("unmute")), this.adVolume = this.adapter.getAdVolume(), this.eventManager.dispatch(v.AdVolumeChange)
}, a.prototype.onAdImpression = function() {
this.state >= 3 && this.state < 6 && (this.state = 6, this.impressionCount += 1, r.dispatchTrackers(this.adCandidate.getTrackers("impression")), this.registerLogEvent(n.eventWithType(o.AdImpression)), (0 === this.adVolume || this.environmentData.videoSlot && this.environmentData.videoSlot.muted) && r.dispatchTrackers(this.adCandidate.getTrackers("mute")), this.updateViewMode(), this.adSlot.registerImpression(), this.registerViewabilityManager(), this.eventManager.dispatch(v.AdImpression), this.companionManager.showCompanions(this.adCandidate.getCompanionAds(), this.environmentData.companionPlacements, this.environmentData.slotWindow))
}, a.prototype.onAdVideoStart = function() {
this.state < 5 && (this.state = 5), this.eventManager.dispatch(v.AdVideoStart)
}, a.prototype.onAdVideoFirstQuartile = function() {
6 === this.state && (this.state = 7, r.dispatchTrackers(this.adCandidate.getTrackers("view", 25))), this.eventManager.dispatch(v.AdVideoFirstQuartile)
}, a.prototype.onAdVideoMidpoint = function() {
7 === this.state && (this.state = 8, r.dispatchTrackers(this.adCandidate.getTrackers("view", 50))), this.eventManager.dispatch(v.AdVideoMidpoint)
}, a.prototype.onAdVideoThirdQuartile = function() {
8 === this.state && (this.state = 9, r.dispatchTrackers(this.adCandidate.getTrackers("view", 75))), this.eventManager.dispatch(v.AdVideoThirdQuartile)
}, a.prototype.onAdVideoComplete = function() {
9 === this.state && (this.state = 10, this.adCandidate.registerComplete(), r.dispatchTrackers(this.adCandidate.getTrackers("view", 100))), this.eventManager.dispatch(v.AdVideoComplete)
}, a.prototype.onAdClickThru = function(a, b, c) {
if (this.state < 6 || this.state >= 10) return void this.logger.debug("Video click occurred -- ad is not currently playing, ignoring");
if (this.logger.log("AdClickThru occurred, clickUrl=" + a, "clickId=" + b, "adManagerHandles=" + c), c && 0 === a.length) return void this.logger.log("Missing click URL, ignoring AdClickThru");
var d = "",
e = "",
f = !1;
if (c === !1) this.logger.log("Creative handles click, ignoring clickUrl");
else if (this.environmentData.getAdParameters().playerHandlesClick === !0) this.logger.log("Player handles click"), d = a, e = b, f = !0;
else if (this.logger.log("AdManager handles click, url=" + a), !this.environmentData.slotWindow.open(a, this.environmentData.getAdParameters().clickthruTarget)) return void this.registerLogEvent(n.eventWithType(o.AdClickThroughFailed, {
url: a
}));
r.dispatchTrackers(this.adCandidate.getTrackers("clickthru")), this.registerLogEvent(n.eventWithType(o.AdClickThrough, {
url: a,
playerHandles: f
})), this.eventManager.dispatch(v.AdClickThru, [d, e, f])
}, a.prototype.onAdInteraction = function() {
this.eventManager.dispatch(v.AdInteraction)
}, a.prototype.onAdUserAcceptInvitation = function() {
this.eventManager.dispatch(v.AdUserAcceptInvitation)
}, a.prototype.onAdUserMinimize = function() {
this.eventManager.dispatch(v.AdUserMinimize)
}, a.prototype.onAdUserClose = function() {
r.dispatchTrackers(this.adCandidate.getTrackers("close")), this.eventManager.dispatch(v.AdUserClose)
}, a.prototype.onAdPaused = function() {
this.state >= 6 && this.state < 10 && (r.dispatchTrackers(this.adCandidate.getTrackers("pause")), this.eventManager.dispatch(v.AdPaused))
}, a.prototype.onAdPlaying = function() {
this.state >= 6 && this.state < 10 && (r.dispatchTrackers(this.adCandidate.getTrackers("resume")), this.eventManager.dispatch(v.AdPlaying))
}, a.prototype.onAdLog = function(a) {
this.eventManager.dispatch(v.AdLog, [a])
}, a.prototype.onAdError = function(a) {
this.logger.error("Received AdError from adapter, error=", a), this.state = 10, this.adCandidate.registerComplete(), r.dispatchTrackers(this.adCandidate.getTrackers("error"), {
"[ERRORCODE]": a.id
}), this.registerLogEvent(a), this.onAdapterComplete()
}, a.prototype.destroy = function() {
if (this.logger.debug("destroy()"), this.state = 0, this.adProvider.cancel(), this.unregisterViewabilityManager(), this.unregisterDocument(), this.adapter) {
var a = this.adapter;
this.unregisterAdapter(), a.destroy()
}
this.unregisterLinearSkin(), this.unregisterEnvironmentData(), this.unregisterVideoSlot(), this.unregisterClickToPlayInterface(), this.impressionCount = 0, this.inventoryPodHistory = null, this.inventoryPod = null, this.inventoryPodSlot = null, this.adSlot = null, this.adCandidate = null, this.linearSkin = null, this.videoElementControls = void 0, this.viewMode = w.normal
}, a.prototype.registerClickToPlayInterface = function() {
this.logger.log("Registering click-to-play interface"), this.clickToPlayInterface = new h(this.environmentData), this.clickToPlayInterface.subscribe(this.onClickToPlay, h.EVENT_CLICK, this), this.clickToPlayInterface.register()
}, a.prototype.unregisterClickToPlayInterface = function() {
this.clickToPlayInterface && (this.logger.log("Unregistering click-to-play interface"), this.clickToPlayInterface.unsubscribe(this.onClickToPlay, h.EVENT_CLICK), this.clickToPlayInterface.unregister(), this.clickToPlayInterface = null)
}, a.prototype.onClickToPlay = function() {
this.logger.log("User initiated click-to-play"), this.unregisterClickToPlayInterface(), this.runAdCandidate()
}, a.prototype.registerLogEvent = function(a) {
r.registerLogEvent(a, this.environmentData, this.adCandidate, this.getAdVolume())
}, a.prototype.registerEnvironmentData = function(a) {
this.unregisterEnvironmentData(), this.environmentData = a
}, a.prototype.unregisterEnvironmentData = function() {
this.environmentData && (this.environmentData = null)
}, a.prototype.registerVideoSlot = function(a) {
a && (this.videoSlot = a, this.videoSlot.pause(), this.videoSlot.controls !== !1 && (this.logger.verbose("Preserving controls from videoSlot:", this.videoSlot.controls), this.videoElementControls = this.videoSlot.controls), this.logger.verbose("Setting videoSlot controls to false"), this.videoSlot.controls = !1, this.videoSlot.addEventListener("volumechange", this.onVideoSlotVolumeChange, !1), this.videoSlot.addEventListener("contextmenu", this.onVideoSlotContextMenu, !0))
}, a.prototype.unregisterVideoSlot = function() {
this.videoSlot && (void 0 !== this.videoElementControls && (this.logger.verbose("Restoring controls on videoSlot to:", this.videoElementControls), this.videoSlot.controls = this.videoElementControls), this.videoSlot.removeEventListener("volumechange", this.onVideoSlotVolumeChange, !1), this.videoSlot.removeEventListener("contextmenu", this.onVideoSlotContextMenu, !0), this.videoSlot = null)
}, a.prototype.updateAdVolume = function(a) {
this.adVolume !== a && (this.adapter ? this.adapter.setAdVolume(a) : (this.adVolume = a, this.eventManager.dispatch(v.AdVolumeChange)))
}, a.prototype.instantiateInventoryPodSlot = function() {
var a = this.inventoryPodSlot;
return this.inventoryPodSlot = this.inventoryPod.getNewInventoryPodSlot(), null !== this.inventoryPodSlot && (null === this.adSlot || this.inventoryPod.isSlotBased() || this.inventoryPod.isDurationBased() && a && a.getAdResponse() && a.getAdResponse().getAdCandidateCount() > 0) ? (this.logger.debug("Instantiated new inventory pod slot:", this.inventoryPodSlot), void this.startInventoryPodSlot()) : void this.onInventoryPodComplete()
}, a.prototype.startInventoryPodSlot = function() {
this.logger.log("Inventory pod slot " + this.inventoryPod.getPodSlotIndex() + ", retries: " + this.inventoryPodSlot.getRetryCount() + " -------------------------------------------------------"), this.environmentData.setSlotIndex(this.inventoryPod.getPodSlotIndex()), this.environmentData.setRetryIndex(this.inventoryPodSlot.getRetryCount()), this.environmentData.setPodPosition(this.inventoryPod.getCurrentPodPosition()), this.environmentData.setRemainingDuration(this.inventoryPod.getRemainingDuration()), this.environmentData.setFailedConnectionIds(this.inventoryPodHistory.getFailedConnectionIds()), this.environmentData.setServedCreativeIds(this.inventoryPodHistory.getServedCreativeIds()), this.environmentData.setFailedCreativeIds(this.inventoryPodHistory.getFailedCreativeIds()), this.adProvider.getAd(this.environmentData)
}, a.prototype.onInventoryPodComplete = function(a) {
var b = this,
c = this.impressionCount > 0,
d = this.state;
this.videoSlot && this.videoSlot.pause(), this.destroy(), setTimeout(function() {
c || 2 === d ? b.eventManager.dispatch(v.AdStopped) : b.eventManager.dispatch(v.AdError, [a || n.eventWithType(o.NoFill)])
}, 0)
}, a.prototype.initializeInventoryPodSlot = function() {
var a = this;
this.preInstantiateAdapters(this.inventoryPodSlot.getAdResponse().getUniqueAdapterIds(), function() {
a.onInventoryPodSlotLoaded()
})
}, a.prototype.preInstantiateAdapters = function(a, b) {
var c = this;
if (a.length > 0) {
this.logger.debug("Inventory pod slot requires adapters: " + a.join(","));
var d = 0,
e = function(e, f) {
null === f ? c.logger.error("Failed to instantiate " + e + "Adapter") : c.logger.debug(e + "Adapter instance ready"), d += 1, d === a.length && b()
};
a.forEach(function(a) {
c.adapterFactory.getAdapterInstance(a, function(b) {
e(a, b)
})
})
} else b()
}, a.prototype.onInventoryPodSlotLoaded = function() {
return this.adSlot = this.inventoryPodSlot.getAdResponse().getNextAdSlot(), this.adSlot && r.dispatchTrackers(this.adSlot.getTrackers("adslot")), this.adSlot && 0 !== this.adSlot.getAdCandidateCount() ? void(this.state < 3 ? (this.state = 3, this.eventManager.dispatch(v.AdLoaded)) : this.startNextInventoryPodSlot()) : void this.onInventoryPodSlotComplete()
}, a.prototype.startNextInventoryPodSlot = function() {
this.startNextAdSlot()
}, a.prototype.onInventoryPodSlotComplete = function() {
this.inventoryPod.registerInventoryPodSlotCompletion(this.inventoryPodSlot), 2 === this.state ? this.onInventoryPodComplete() : this.instantiateInventoryPodSlot()
}, a.prototype.startNextAdSlot = function() {
null === this.adSlot ? this.onInventoryPodSlotComplete() : this.startNextAdCandidate()
}, a.prototype.onAdSlotComplete = function() {
var a = this.adSlot;
this.adSlot = null, this.inventoryPodSlot.registerAdSlotCompletion(a), a.hadImpression() || 2 === this.state ? this.onInventoryPodSlotComplete() : !a.hadImpression() && this.inventoryPodSlot.getRetryCount() < this.environmentData.getAdParameters().maximumRetry ? (this.logger.log("Inventory pod slot failed, retrying"), this.inventoryPodSlot.registerRetry(), this.environmentData.setRetryIndex(this.inventoryPodSlot.getRetryCount()), this.startInventoryPodSlot()) : this.startNextAdSlot()
}, a.prototype.startNextAdCandidate = function() {
if (this.adCandidate = this.adSlot.getNextAdCandidate(), null !== this.adCandidate) {
if (this.videoSlot || this.registerVideoSlot(this.environmentData.videoSlot), 3 === this.state && !this.environmentData.videoSlotCanAutoPlay) return void this.registerClickToPlayInterface();
this.runAdCandidate()
} else this.onAdSlotComplete()
}, a.prototype.onAdCandidateComplete = function() {
this.companionManager.hideCompanions(this.adCandidate.getCompanionAds(), this.environmentData.companionPlacements, this.environmentData.slotWindow), this.adCandidate.hadImpression() && this.inventoryPod.increasePlayedDuration(this.adCandidate.getDuration()), this.logger.log("Ad pod playedDuration=" + this.inventoryPod.getPlayedDuration() + "s elapsedRealtime=" + this.inventoryPod.getElapsedRealtime() + "s"), this.inventoryPodHistory.registerAdCandidateCompletion(this.adCandidate), 2 === this.state ? this.onAdSlotComplete() : this.startNextAdCandidate()
}, a.prototype.beginInventoryPod = function() {
this.linearSkin = p.getLinearSkinInstance(this.environmentData, this.inventoryPod), this.adVolumeSet || (this.adVolume = this.environmentData.videoSlot.volume), this.inventoryPod.setStartTime()
}, a.prototype.onAdapterInstantiated = function() {
3 === this.state && (this.state = 4, this.eventManager.dispatch(v.AdStarted))
}, a.prototype.runAdCandidate = function() {
var a = this;
3 === this.state && this.beginInventoryPod(), this.logger.log("Running ad candidate:", this.adCandidate), this.adapterFactory.getAdapterInstance(this.adCandidate.adapter, function(b) {
if (null !== b) {
a.onAdapterInstantiated(), a.adapter = b, a.logger.log("Registering " + a.adCandidate.adapter + "Adapter instance:", a.adapter), a.registerAdapter(), a.adCandidate.registerLoad();
var d = "";
try {
d = g.getBrowserFeatures()
} catch (e) {
d = JSON.stringify({
error: e.message
})
}
var f = "";
try {
f = q.getBrowserFeatures()
} catch (e) {
f = JSON.stringify({
error: e.message
})
}
a.registerLogEvent(n.eventWithType(o.AdCandidateStarted, {
browserFeatures: d,
pluginBrowserFeatures: f
})), a.adapter.initAd(a.environmentData.initWidth, a.environmentData.initHeight, a.environmentData.getAdParameters().viewMode, a.environmentData.getAdParameters().desiredBitrate, null, {
slot: a.environmentData.slot,
videoSlot: a.environmentData.videoSlot,
videoSlotCanAutoPlay: !0,
environmentData: a.environmentData,
adCandidate: a.adCandidate,
adapterConfiguration: new c(a.environmentData, a.inventoryPod.getPlacementDefinition())
})
} else a.logger.error(a.adCandidate.adapter + "Adapter not available"), a.registerLogEvent(n.eventWithType(o.AdapterMising, {
adapterID: a.adCandidate.adapter
})), a.onAdapterComplete()
})
}, a.prototype.onAdapterComplete = function() {
this.state > 4 && (this.state = 4), this.unregisterViewabilityManager(), this.unregisterAdapter(), this.unregisterLinearSkin(), this.unregisterDocument(), this.onAdCandidateComplete()
}, a.prototype.registerAdapter = function() {
this.logger.log("Setting " + this.adCandidate.adapter + "Adapter volume to " + this.adVolume), this.adapter.setAdVolume(this.adVolume), this.registerAdapterSubscriptions(this.adapter)
}, a.prototype.unregisterAdapter = function() {
this.adapter && (this.unregisterAdapterSubscriptions(this.adapter), this.adapter = null)
}, a.prototype.registerAdapterSubscriptions = function(a) {
this.logger.log("Registering event subscriptions on adapter instance:", a), a.subscribe(this.onAdLoaded, v.AdLoaded, this), a.subscribe(this.onAdStarted, v.AdStarted, this), a.subscribe(this.onAdStopped, v.AdStopped, this), a.subscribe(this.onAdSkipped, v.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, v.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, v.AdSizeChange, this), a.subscribe(this.onAdLinearChange, v.AdLinearChange, this), a.subscribe(this.onAdDurationChange, v.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, v.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, v.AdVolumeChange, this), a.subscribe(this.onAdImpression, v.AdImpression, this), a.subscribe(this.onAdVideoStart, v.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, v.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, v.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, v.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, v.AdVideoComplete, this), a.subscribe(this.onAdClickThru, v.AdClickThru, this), a.subscribe(this.onAdInteraction, v.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, v.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, v.AdUserMinimize, this), a.subscribe(this.onAdUserClose, v.AdUserClose, this), a.subscribe(this.onAdPaused, v.AdPaused, this), a.subscribe(this.onAdPlaying, v.AdPlaying, this), a.subscribe(this.onAdLog, v.AdLog, this), a.subscribe(this.onAdError, v.AdError, this)
}, a.prototype.unregisterAdapterSubscriptions = function(a) {
this.logger.log("Unregistering event subscriptions on adapter instance:", a), a.unsubscribe(this.onAdLoaded, v.AdLoaded), a.unsubscribe(this.onAdStarted, v.AdStarted), a.unsubscribe(this.onAdStopped, v.AdStopped), a.unsubscribe(this.onAdSkipped, v.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, v.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, v.AdSizeChange), a.unsubscribe(this.onAdLinearChange, v.AdLinearChange), a.unsubscribe(this.onAdDurationChange, v.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, v.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, v.AdVolumeChange), a.unsubscribe(this.onAdImpression, v.AdImpression), a.unsubscribe(this.onAdVideoStart, v.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, v.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, v.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, v.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, v.AdVideoComplete), a.unsubscribe(this.onAdClickThru, v.AdClickThru), a.unsubscribe(this.onAdInteraction, v.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, v.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, v.AdUserMinimize), a.unsubscribe(this.onAdUserClose, v.AdUserClose), a.unsubscribe(this.onAdPaused, v.AdPaused), a.unsubscribe(this.onAdPlaying, v.AdPlaying), a.unsubscribe(this.onAdLog, v.AdLog), a.unsubscribe(this.onAdError, v.AdError)
}, a.prototype.registerLinearSkin = function() {
this.linearSkin.subscribe(this.onAdClickThru, v.AdClickThru, this), this.linearSkin.register(this.adapter, this.adCandidate)
}, a.prototype.unregisterLinearSkin = function() {
this.linearSkin && (this.linearSkin.unsubscribe(this.onAdClickThru, v.AdClickThru), this.linearSkin.unregister())
}, a.prototype.registerDocument = function() {
s.addDocumentFullscreenEventListener(this.environmentData.slotWindow.document, this.updateViewMode, !1), this.videoSlot && (this.videoSlot.addEventListener("webkitbeginfullscreen", this.updateViewMode, !1), this.videoSlot.addEventListener("webkitendfullscreen", this.updateViewMode, !1))
}, a.prototype.unregisterDocument = function() {
this.environmentData && this.environmentData.slotWindow && s.removeDocumentFullscreenEventListener(this.environmentData.slotWindow.document, this.updateViewMode, !1), this.videoSlot && (this.videoSlot.removeEventListener("webkitbeginfullscreen", this.updateViewMode, !1), this.videoSlot.removeEventListener("webkitendfullscreen", this.updateViewMode, !1))
}, a.prototype.registerViewabilityManager = function() {
var a = this;
if (null === this.viewabilityManager) {
var b = new u(50, -1, 2e3, function(b) {
a.logger.log("MRC viewability results:", b), b.passed && (r.dispatchTrackers(a.adCandidate.getTrackers("viewable_mrc")), a.registerLogEvent(n.eventWithType(o.MRCViewable, {
minViewableArea: b.minViewableArea
})))
}),
c = new u(1, 0, 3e3, function(b) {
a.logger.log("FB viewability results:", b), b.passed && (r.dispatchTrackers(a.adCandidate.getTrackers("viewable_fb")), a.registerLogEvent(n.eventWithType(o.FBViewable, {
minViewableArea: b.minViewableArea
})))
}),
d = new u(1, 0, 1e4, function(b) {
a.logger.log("View through results:", b), b.passed && (r.dispatchTrackers(a.adCandidate.getTrackers("viewthrough")), a.registerLogEvent(n.eventWithType(o.ViewThrough, {
minViewableArea: b.minViewableArea
})))
});
this.viewabilityManager = new t(this.environmentData.slot, this.environmentData.slotWindow, 250, [b, c, d])
}
}, a.prototype.unregisterViewabilityManager = function() {
this.viewabilityManager && this.viewabilityManager.destroy(), this.viewabilityManager = null
}, a
}();
return x
}), define("FlashVPAIDBridge", ["require", "exports", "EventManager", "Logger", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f) {
var g = function() {
function a(a, b, e) {
var g = this;
this.logger = new d("FlashVPAIDBridge"), this.eventManager = new c(f), this.adVolume = -1, this.flashBuild = "201406161543", this.creativeUrl = a, this.slot = b.slot, this.slotWindow = b.slotWindow, this.bgcolor = b.getAdParameters().bgcolor, this.destroy(), this.loadFlashVPAID(function(a) {
g.flashVPAID = a, g.logger.log("Loaded Flash VPAID:", g.flashVPAID), e(g)
})
}
return a.prototype.getAdLinear = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdLinear() : !1
}, a.prototype.getAdWidth = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdWidth() : 0
}, a.prototype.getAdHeight = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdHeight() : 0
}, a.prototype.getAdExpanded = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdExpanded() : !1
}, a.prototype.getAdSkippableState = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdSkippableState() : !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdSkippableRemainingTime() : -2;
}, a.prototype.getAdRemainingTime = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdRemainingTime() : -2
}, a.prototype.getAdDuration = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdDuration() : -2
}, a.prototype.getAdVolume = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdVolume() : this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.adVolume = a, this.bridgeInterfaceExists() && this.flashVPAID.setAdVolume(a)
}, a.prototype.getAdCompanions = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdCompanions() : ""
}, a.prototype.getAdIcons = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.getAdIcons() : !1
}, a.prototype.handshakeVersion = function(a) {
return a
}, a.prototype.initAd = function(a, b, c, d, f, g) {
if (this.logger.log("initAd() width:", a, " height:", b, " viewMode:", c, "desiredBitrate:", d, "creativeData:", f, "environmentVars:", g), this.bridgeInterfaceExists()) {
this.adVolume > -1 && (this.logger.debug("Setting Flash VPAID adVolume property to " + this.adVolume), this.flashVPAID.setAdVolume(this.adVolume));
var h = f.AdParameters || "";
this.flashVPAID.initAd(-1, -1, c, d, h, e.stringifyParameterObject(g))
}
}, a.prototype.resizeAd = function(a, b, c) {
return this.bridgeInterfaceExists() ? this.flashVPAID.resizeAd(a, b, c) : void 0
}, a.prototype.startAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.startAd() : void 0
}, a.prototype.stopAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.stopAd() : void 0
}, a.prototype.pauseAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.pauseAd() : void 0
}, a.prototype.resumeAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.resumeAd() : void 0
}, a.prototype.expandAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.expandAd() : void 0
}, a.prototype.collapseAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.collapseAd() : void 0
}, a.prototype.skipAd = function() {
return this.bridgeInterfaceExists() ? this.flashVPAID.skipAd() : void 0
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.destroy = function() {
this.unloadFlashVPAID(), this.flashContainer = null, this.flashVPAID = null
}, a.prototype.loadFlashVPAID = function(b) {
function c() {
window.setTimeout(function() {
"function" == typeof f.getVPAID && null !== f.getVPAID() ? b(f) : c()
}, 100)
}
var d, e, f, g, h, i = this,
j = "",
k = {
onVPAIDEvent: function(a) {
return i.onVPAIDEvent(a)
}
};
this.slotWindow.LiveRail || (this.slotWindow.LiveRail = {}), this.slotWindow.LiveRail.VPAIDListeners || (this.slotWindow.LiveRail.VPAIDListeners = {}), a.instanceCount += 1, e = "LiveRail.VPAIDListeners.FlashVPAIDBridge_" + a.instanceCount, g = ("https:" === this.slotWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/swf/ui/vpaid-player.swf", g += "?build=" + this.flashBuild, d = "jscontext=" + e, d += "&vpaidURL=" + encodeURIComponent(this.creativeUrl), d += "&allowDomains=*", d += "&currentSecurityDomain=false", j += '<object style="display: block; width: 100%; height: 100%;"', navigator.userAgent.match(/MSIE/i) ? (j += ' id="' + e + '"', j += ' name="' + e + '"', j += ' classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000">', j += '<param name="movie" value="' + g + '" />') : (j += ' data="' + g + '"', j += ' type="application/x-shockwave-flash">'), j += '<param name="quality" value="high" />', j += '<param name="allowfullscreen" value="true" />', j += '<param name="allowscriptaccess" value="always" />', j += '<param name="flashvars" value="' + d + '" />', this.bgcolor ? (j += '<param name="wmode" value="opaque" />', j += '<param name="bgcolor" value="#' + this.bgcolor + '" />') : j += '<param name="wmode" value="transparent" />', j += "</object>", this.slotWindow.LiveRail.VPAIDListeners["FlashVPAIDBridge_" + a.instanceCount] = k, this.flashContainer = this.slotWindow.document.createElement("div"), this.flashContainer.style.position = "absolute", this.flashContainer.style.top = "0px", this.flashContainer.style.left = "0px", this.flashContainer.style.width = "100%", this.flashContainer.style.height = "100%", this.slotWindow.getComputedStyle ? h = this.slotWindow.getComputedStyle(this.slot, null).getPropertyValue("position") : this.slot.currentStyle && (h = this.slot.currentStyle.position), this.targetSlotOriginalPosition = void 0, "static" === h && (this.targetSlotOriginalPosition = this.slot.style.position, this.slot.style.position = "relative"), this.slot.appendChild(this.flashContainer), this.flashContainer.innerHTML = j, f = this.flashContainer.childNodes[0], c(), this.logger.verbose("Loaded JS-Flash event interface:", k)
}, a.prototype.unloadFlashVPAID = function() {
this.slot && this.flashContainer && (this.slot.removeChild(this.flashContainer), this.logger.log("Unloaded Flash VPAID"), this.targetSlotOriginalPosition && (this.logger.log("Resetting slot element position to " + this.targetSlotOriginalPosition), this.slot.style.position = this.targetSlotOriginalPosition))
}, a.prototype.onVPAIDEvent = function(a) {
var b = this;
f.hasOwnProperty(a.type) && window.setTimeout(function() {
switch (b.logger.verbose("Received " + a.type + " event from Flash bridge:", a, ")"), a.type) {
case "AdClickThru":
b.eventManager.dispatch(f.AdClickThru, [a.data.url, a.data.id, a.data.playerHandles]);
break;
case "AdInteraction":
b.eventManager.dispatch(f.AdInteraction, [a.data.id]);
break;
case "AdLog":
b.eventManager.dispatch(f.AdLog, [a.data.message]);
break;
case "AdStopped":
b.destroy(), b.eventManager.dispatch(f.AdStopped);
break;
case "AdError":
b.destroy(), b.eventManager.dispatch(f.AdError, [a.data]);
break;
default:
b.eventManager.dispatch(a.type)
}
}, 0)
}, a.prototype.bridgeInterfaceExists = function() {
return this.flashVPAID && e.isFunction(this.flashVPAID.handshakeVersion)
}, a.instanceCount = 0, a
}();
return g
}), define("FlashAdManagerController", ["require", "exports", "EventManager", "FlashVPAIDBridge", "Logger", "VPAIDEvents"], function(a, b, c, d, e, f) {
var g = function() {
function a(a) {
this.logger = new e("FlashAdManagerBridge"), this.eventManager = new c(f), this.adVolume = -1, this.instanceData = a, this.destroy()
}
return a.prototype.getAdLinear = function() {
return this.flashBridge ? this.flashBridge.getAdLinear() : !1
}, a.prototype.getAdWidth = function() {
return this.flashBridge ? this.flashBridge.getAdWidth() : 0
}, a.prototype.getAdHeight = function() {
return this.flashBridge ? this.flashBridge.getAdHeight() : 0
}, a.prototype.getAdExpanded = function() {
return this.flashBridge ? this.flashBridge.getAdExpanded() : !1
}, a.prototype.getAdSkippableState = function() {
return this.flashBridge ? this.flashBridge.getAdSkippableState() : !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return this.flashBridge ? this.flashBridge.getAdSkippableRemainingTime() : -2
}, a.prototype.getAdRemainingTime = function() {
return this.flashBridge ? this.flashBridge.getAdRemainingTime() : -2
}, a.prototype.getAdDuration = function() {
return this.flashBridge ? this.flashBridge.getAdDuration() : -2
}, a.prototype.getAdVolume = function() {
return this.flashBridge ? this.flashBridge.getAdVolume() : this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.adVolume = a, this.flashBridge && this.flashBridge.setAdVolume(a)
}, a.prototype.getAdCompanions = function() {
return this.flashBridge ? this.flashBridge.getAdCompanions() : ""
}, a.prototype.getAdIcons = function() {
return this.flashBridge ? this.flashBridge.getAdIcons() : !1
}, a.prototype.handshakeVersion = function(a) {
return a
}, a.prototype.initAd = function(a, b, c, e, f, g) {
var h = this;
this.logger.log("initAd(", a, ",", b, ",", c, ",", e, ",", f, ",", g), this.destroy();
var i = g.environmentData,
j = ("https:" === i.slotWindow.location.protocol ? "https://cdn-static-secure" : "http://cdn-static") + ".liverail.com/swf/v4/admanager.swf?adLinear=" + this.instanceData.getDefaultAdLinear();
new d(j, i, function(d) {
h.flashBridge = d, h.registerBridgeSubscriptions(h.flashBridge), h.flashBridge.initAd(a, b, c, e, {
AdParameters: ""
}, i.inputParameters)
})
}, a.prototype.resizeAd = function(a, b, c) {
return this.flashBridge ? this.flashBridge.resizeAd(a, b, c) : void 0
}, a.prototype.startAd = function() {
return this.flashBridge ? this.flashBridge.startAd() : void 0
}, a.prototype.stopAd = function() {
return this.flashBridge ? this.flashBridge.stopAd() : void 0
}, a.prototype.pauseAd = function() {
return this.flashBridge ? this.flashBridge.pauseAd() : void 0
}, a.prototype.resumeAd = function() {
return this.flashBridge ? this.flashBridge.resumeAd() : void 0
}, a.prototype.expandAd = function() {
return this.flashBridge ? this.flashBridge.expandAd() : void 0
}, a.prototype.collapseAd = function() {
return this.flashBridge ? this.flashBridge.collapseAd() : void 0
}, a.prototype.skipAd = function() {
return this.flashBridge ? this.flashBridge.skipAd() : void 0
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.destroy = function() {
this.flashBridge && (this.unregisterBridgeSubscriptions(this.flashBridge), this.flashBridge = null)
}, a.prototype.registerBridgeSubscriptions = function(a) {
this.logger.log("Registering event subscriptions on bridge instance:", a), a.subscribe(this.onAdLoaded, f.AdLoaded, this), a.subscribe(this.onAdStarted, f.AdStarted, this), a.subscribe(this.onAdStopped, f.AdStopped, this), a.subscribe(this.onAdSkipped, f.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, f.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, f.AdSizeChange, this), a.subscribe(this.onAdLinearChange, f.AdLinearChange, this), a.subscribe(this.onAdDurationChange, f.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, f.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, f.AdVolumeChange, this), a.subscribe(this.onAdImpression, f.AdImpression, this), a.subscribe(this.onAdVideoStart, f.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, f.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, f.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, f.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, f.AdVideoComplete, this), a.subscribe(this.onAdClickThru, f.AdClickThru, this), a.subscribe(this.onAdInteraction, f.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, f.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, f.AdUserMinimize, this), a.subscribe(this.onAdUserClose, f.AdUserClose, this), a.subscribe(this.onAdPaused, f.AdPaused, this), a.subscribe(this.onAdPlaying, f.AdPlaying, this), a.subscribe(this.onAdLog, f.AdLog, this), a.subscribe(this.onAdError, f.AdError, this)
}, a.prototype.unregisterBridgeSubscriptions = function(a) {
this.logger.log("Unregistering event subscriptions on adapter instance:", a), a.unsubscribe(this.onAdLoaded, f.AdLoaded), a.unsubscribe(this.onAdStarted, f.AdStarted), a.unsubscribe(this.onAdStopped, f.AdStopped), a.unsubscribe(this.onAdSkipped, f.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, f.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, f.AdSizeChange), a.unsubscribe(this.onAdLinearChange, f.AdLinearChange), a.unsubscribe(this.onAdDurationChange, f.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, f.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, f.AdVolumeChange), a.unsubscribe(this.onAdImpression, f.AdImpression), a.unsubscribe(this.onAdVideoStart, f.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, f.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, f.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, f.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, f.AdVideoComplete), a.unsubscribe(this.onAdClickThru, f.AdClickThru), a.unsubscribe(this.onAdInteraction, f.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, f.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, f.AdUserMinimize), a.unsubscribe(this.onAdUserClose, f.AdUserClose), a.unsubscribe(this.onAdPaused, f.AdPaused), a.unsubscribe(this.onAdPlaying, f.AdPlaying), a.unsubscribe(this.onAdLog, f.AdLog), a.unsubscribe(this.onAdError, f.AdError)
}, a.prototype.onAdLoaded = function() {
this.eventManager.dispatch(f.AdLoaded)
}, a.prototype.onAdStarted = function() {
this.eventManager.dispatch(f.AdStarted)
}, a.prototype.onAdStopped = function() {
this.destroy(), this.eventManager.dispatch(f.AdStopped)
}, a.prototype.onAdSkipped = function() {
this.eventManager.dispatch(f.AdSkipped)
}, a.prototype.onAdSkippableStateChange = function() {
this.eventManager.dispatch(f.AdSkippableStateChange)
}, a.prototype.onAdSizeChange = function() {
this.eventManager.dispatch(f.AdSizeChange)
}, a.prototype.onAdLinearChange = function() {
this.eventManager.dispatch(f.AdLinearChange)
}, a.prototype.onAdDurationChange = function() {
this.eventManager.dispatch(f.AdDurationChange)
}, a.prototype.onAdExpandedChange = function() {
this.eventManager.dispatch(f.AdExpandedChange)
}, a.prototype.onAdVolumeChange = function() {
this.eventManager.dispatch(f.AdVolumeChange)
}, a.prototype.onAdImpression = function() {
this.eventManager.dispatch(f.AdImpression)
}, a.prototype.onAdVideoStart = function() {
this.eventManager.dispatch(f.AdVideoStart)
}, a.prototype.onAdVideoFirstQuartile = function() {
this.eventManager.dispatch(f.AdVideoFirstQuartile)
}, a.prototype.onAdVideoMidpoint = function() {
this.eventManager.dispatch(f.AdVideoMidpoint)
}, a.prototype.onAdVideoThirdQuartile = function() {
this.eventManager.dispatch(f.AdVideoThirdQuartile)
}, a.prototype.onAdVideoComplete = function() {
this.eventManager.dispatch(f.AdVideoComplete)
}, a.prototype.onAdClickThru = function(a, b, c) {
this.eventManager.dispatch(f.AdClickThru, [a, b, c])
}, a.prototype.onAdInteraction = function() {
this.eventManager.dispatch(f.AdInteraction)
}, a.prototype.onAdUserAcceptInvitation = function() {
this.eventManager.dispatch(f.AdUserAcceptInvitation)
}, a.prototype.onAdUserMinimize = function() {
this.eventManager.dispatch(f.AdUserMinimize)
}, a.prototype.onAdUserClose = function() {
this.eventManager.dispatch(f.AdUserClose)
}, a.prototype.onAdPaused = function() {
this.eventManager.dispatch(f.AdPaused)
}, a.prototype.onAdPlaying = function() {
this.eventManager.dispatch(f.AdPlaying)
}, a.prototype.onAdLog = function(a) {
this.eventManager.dispatch(f.AdLog, [a])
}, a.prototype.onAdError = function(a, b) {
"undefined" == typeof b && (b = {}), this.destroy(), this.eventManager.dispatch(f.AdError, [a, b])
}, a
}();
return g
}), define("AdManagerFactory", ["require", "exports", "AdManager", "FlashAdManagerController"], function(a, b, c, d) {
var e = function() {
function a(a) {
this.adManagerDictionary = {}, this.instanceData = a
}
return a.prototype.adManagerForEnvironment = function(a) {
if (!this.adManagerDictionary[a]) switch (a) {
case 1:
this.adManagerDictionary[a] = new c(this.instanceData);
break;
case 2:
this.adManagerDictionary[a] = new d(this.instanceData);
break;
case 0:
this.adManagerDictionary[a] = null
}
return this.adManagerDictionary[a]
}, a
}();
return e
}), define("AdParameters", ["require", "exports"], function(a, b) {
var c = function() {
function a() {
this.maximumRetry = 1, this.maxPodSlots = 0, this.maxPodDuration = 0, this.maxDuration = 0, this.adDeliveryTimeout = 10, this.adRequestTimeout = 10, this.adCreativeTimeout = 15, this.timeoutVPAIDLoad = 10, this.timeoutVPAIDInit = 15, this.timeoutVPAIDStart = 10, this.viewMode = "normal", this.wrapperLimit = 3, this.desiredBitrate = 800, this.showCountdown = !1, this.clickthruTarget = "_blank", this.linearSkin = 1, this.countdownMessage = null, this.indexMessage = null, this.clickthroughMessage = null, this.clickElement = null, this.skipCountdownMessage = null, this.skipMessage = null, this.playerHandlesClick = !1, this.pauseOnClick = !0
}
return a
}();
return c
}), define("EnvironmentData", ["require", "exports", "AdapterFactory", "AdParameters", "CompanionPlacement", "Integration", "InventoryPod", "Logger", "MimeType", "Utils", "Viewability"], function(a, b, c, d, e, f, g, h, i, j, k) {
var l = function() {
function a(a, b) {
this.placementId = null, this.adUnitType = g.TYPE_INSTREAM, this.integration = 0, this.integrationVersion = null, this.urlPrefix = null, this.mimeTypePriorityList = [], this.inputParameters = {}, this.companionPlacements = {}, this.logger = new h("EnvironmentData"), this.adParameters = new d, this.adRequestParameters = {}, this.slotIndex = 0, this.retryIndex = 0, this.podPosition = null, this.remainingDuration = 1, this.sessionId = null, this.failedConnectionIds = "", this.servedCreativeIds = "", this.failedCreativeIds = "", this.processInitData(a, b)
}
return a.prototype.getAdParameters = function() {
return this.adParameters
}, a.prototype.getAdRequestParameters = function() {
return this.resolveCurrentAdParameters()
}, a.prototype.iterateAdRequestParameters = function(a) {
var b = this.resolveCurrentAdParameters();
for (var c in b)
if (b.hasOwnProperty(c) && a(b[c], c) === !1) break
}, a.prototype.setSlotIndex = function(a) {
this.slotIndex = a
}, a.prototype.setRetryIndex = function(a) {
this.retryIndex = a
}, a.prototype.setPodPosition = function(a) {
this.podPosition = a
}, a.prototype.setRemainingDuration = function(a) {
this.remainingDuration = a
}, a.prototype.setSessionId = function(a) {
this.sessionId = a
}, a.prototype.setFailedConnectionIds = function(a) {
this.failedConnectionIds = a.join() || ""
}, a.prototype.setServedCreativeIds = function(a) {
this.servedCreativeIds = a.join() || ""
}, a.prototype.setFailedCreativeIds = function(a) {
this.failedCreativeIds = a.join() || ""
}, a.prototype.collectNavigatorProperties = function() {
var a = {};
return ["appName", "appVersion", "cookieEnabled", "platform", "product", "vendor"].forEach(function(b) {
var c = window.navigator;
c && c.hasOwnProperty(b) ? a[b] = c[b] : a[b] = null
}), a
}, a.prototype.resolveCurrentAdParameters = function() {
var a = {};
for (var b in this.adRequestParameters) this.adRequestParameters.hasOwnProperty(b) && (a[b] = this.adRequestParameters[b]);
return delete a.LR_SESSION_ID, this.sessionId && (a.LR_SESSION_ID = this.sessionId), null !== this.remainingDuration && (a.LR_DURATION = Math.round(this.remainingDuration)), a.LR_SLOT_INDEX = this.slotIndex, a.LR_RETRY_INDEX = this.retryIndex, a.LR_POD_CURRENT = this.podPosition, a.blacklist_connection_id = this.failedConnectionIds, a.served_creative_id = this.servedCreativeIds, a.failed_creative_id = this.failedCreativeIds, a
}, a.prototype.processInitData = function(a, b) {
var d = this;
this.videoSlot = b.videoSlot, this.slot = b.slot || this.videoSlot.parentNode, this.videoSlotCanAutoPlay = b.videoSlotCanAutoPlay, "object" == typeof this.slot && "object" == typeof this.slot.ownerDocument ? this.slotWindow = this.slot.ownerDocument.defaultView || this.slot.ownerDocument.parentWindow : "object" == typeof this.videoSlot && "object" == typeof this.videoSlot.ownerDocument ? this.slotWindow = this.videoSlot.ownerDocument.defaultView || this.videoSlot.ownerDocument.parentWindow : b.window && (this.slotWindow = b.window), this.initWidth = b.width, this.initHeight = b.height, this.adParameters.desiredBitrate = j.returnInt(b.desiredBitrate, this.adParameters.desiredBitrate), h.getDebugLevel() > 0 && (this.adRequestParameters.LR_DEBUG = j.returnString(h.getDebugLevel())), this.processParameterSet(b.environmentVars), this.windowMeasurement = k.measureWindow(this.slotWindow), this.logger.debug("Retrieved window measurement:", this.windowMeasurement), this.viewabilityMeasurement = k.measureViewability(this.videoSlot), this.logger.debug("Retrieved viewability measurement:", this.viewabilityMeasurement), this.adRequestParameters.LR_VIEWABLE = j.returnString(this.viewabilityMeasurement.viewable), this.adRequestParameters.LR_WINDOW_DEPTH = j.returnString(this.windowMeasurement.crossDomainCount), this.adRequestParameters.LR_WINDOW_LOCATION = j.returnString(this.windowMeasurement.location), this.adRequestParameters.LR_WINDOW_REFERRER = j.returnString(this.windowMeasurement.referrer), this.adRequestParameters.LR_IFRAME = j.returnString(this.viewabilityMeasurement.iframe), this.adRequestParameters.LR_URL && "[LR_URL]" !== this.adRequestParameters.LR_URL.toUpperCase() || (this.adRequestParameters.LR_URL = this.windowMeasurement.topUrl), this.adRequestParameters.LR_PAGE_URL = this.windowMeasurement.pageUrl, delete this.adRequestParameters.LR_MUTED;
var e = null;
this.videoSlot && (e = this.videoSlot.muted || this.videoSlot.volume <= 0 ? 1 : 0), -1 !== b.adVolume && (e = b.adVolume <= 0 ? 1 : 0), null !== e && (this.adRequestParameters.LR_MUTED = j.returnString(e)), this.adRequestParameters.LR_WIDTH = j.returnString(this.viewabilityMeasurement.width), this.adRequestParameters.LR_HEIGHT = j.returnString(this.viewabilityMeasurement.height);
var f = 3;
this.viewabilityMeasurement.width <= 300 || this.viewabilityMeasurement.height < 250 ? (this.logger.log("Detected in-banner placement"), f = 2) : 1 === this.integration && (this.logger.log("Detected interstitial placement"), f = 1), this.adRequestParameters.LR_ADTYPE = j.returnString(f), this.adRequestParameters.LR_SCHEMA = "liverail", delete this.adRequestParameters.LR_FORMAT, 1 === b.environmentType && (this.logger.verbose("Determining format support:"), this.adRequestParameters.LR_FORMAT = "", a.getDisableIframes() !== !0 && (this.adRequestParameters.LR_FORMAT = i.JavaScript + ";" + i.JavaScriptAlt, this.mimeTypePriorityList.push(i.JavaScript), this.mimeTypePriorityList.push(i.JavaScriptAlt)), [i.HLS, i.HLSAlt, i.MP4, i.WebM, i.OGG, i.Mobile3GP].forEach(function(a) {
var b = d.videoSlot.canPlayType(a);
d.logger.verbose(" " + a + ":", b), "" !== b && "no" !== b.toLowerCase() && (d.adRequestParameters.LR_FORMAT.length > 0 && (d.adRequestParameters.LR_FORMAT += ";"), d.adRequestParameters.LR_FORMAT += a, d.mimeTypePriorityList.push(a))
}), j.detectFlash() && !j.videoElementIsFullscreen(this.slotWindow.document) && (this.adRequestParameters.LR_FORMAT += ";" + i.FLV + ";" + i.Flash, this.mimeTypePriorityList.push(i.FLV), this.mimeTypePriorityList.push(i.Flash))), this.adRequestParameters.LR_ADAPTERS = c.getAvailableAdapters().join(), this.adRequestParameters.LR_SDK = "js", this.adRequestParameters.LR_SDK_VERSION = "2.2.8";
var l = navigator.language || navigator.browserLanguage || "",
m = l.split("-");
if (this.adRequestParameters.LR_LOCALE = m[0] + (m[1] ? "_" + m[1].toUpperCase() : ""), "string" == typeof this.adRequestParameters.LR_ADMAP) {
this.adRequestParameters.LR_ADMAP = this.adRequestParameters.LR_ADMAP.split(";", 1)[0];
var n = this.adRequestParameters.LR_ADMAP.split(":");
void 0 === this.adRequestParameters.LR_ADUNIT && (this.adRequestParameters.LR_ADUNIT = n[0]), void 0 === this.adRequestParameters.LR_SCENARIO && (this.adRequestParameters.LR_SCENARIO = n[1]), void 0 === this.adRequestParameters.LR_VIDEO_POSITION && (this.adRequestParameters.LR_VIDEO_POSITION = n[2])
}
this.adRequestParameters.LR_ADUNIT = this.adRequestParameters.LR_ADUNIT || g.TYPE_INSTREAM, this.adRequestParameters.LR_SCENARIO = this.adRequestParameters.LR_SCENARIO || "", this.adRequestParameters.LR_VIDEO_POSITION = this.adRequestParameters.LR_VIDEO_POSITION || 0, this.adRequestParameters.LR_ADUNIT === g.TYPE_INSTREAM || this.adRequestParameters.LR_ADUNIT === g.TYPE_OVERLAY ? (this.adUnitType = this.adRequestParameters.LR_ADUNIT, this.logger.log("Set adUnitType to:", this.adUnitType)) : this.logger.error("Invalid adUnitType passed to LR_ADUNIT:", this.adRequestParameters.LR_ADUNIT), this.adRequestParameters.LR_ADMAP = this.adRequestParameters.LR_ADUNIT + ":" + this.adRequestParameters.LR_SCENARIO + ":" + this.adRequestParameters.LR_VIDEO_POSITION
}, a.prototype.processParameterSet = function(a) {
for (var b in a)
if (a.hasOwnProperty(b)) {
var c = a[b],
d = null;
switch ("LR_" === b.substr(0, 3).toUpperCase() && (d = j.returnString(c)), d && (this.inputParameters[b] = d), b.toUpperCase()) {
case "LR_ENVIRONMENT":
break;
case "LR_PUBLISHER_ID":
d && (d.match(/[^0-9]/) || (this.publisherId = j.returnUnsignedInt(c, this.publisherId)), this.adRequestParameters[b] = d);
break;
case "LR_PLACEMENT_ID":
d && (this.placementId = d, this.adRequestParameters[b] = d);
break;
case "LR_INTEGRATION":
switch (d) {
case "int":
this.integration = 1;
break;
case "jw":
this.integration = 2;
break;
case "bc":
this.integration = 3;
break;
case "vjs":
this.integration = 4;
break;
case "pdk":
this.integration = 5;
break;
default:
this.integration = 0
}
0 !== this.integration && this.logger.log("Set integration to " + this.integration + " (", d, ")"), this.ingestAdRequestParameter(b, d);
break;
case "LR_INTEGRATION_VERSION":
d && (this.integrationVersion = d, this.logger.log("Set integration version to " + this.integrationVersion), this.ingestAdRequestParameter(b, d));
break;
case "LR_ALLOW_RETRY":
this.adParameters.maximumRetry = Math.min(7, Math.max(0, j.returnInt(c, this.adParameters.maxDuration))), this.logger.log("Set maximumRetry to:", this.adParameters.maximumRetry);
break;
case "LR_DURATION":
this.adParameters.maxDuration = Math.max(0, j.returnFloat(c, this.adParameters.maxDuration)), this.ingestAdRequestParameter(b, d), this.logger.log("Set maxDuration to:", this.adParameters.maxDuration);
break;
case "LR_POD_SLOTS":
this.adParameters.maxPodSlots = j.returnUnsignedInt(c, this.adParameters.maxPodSlots), this.logger.log("Set maxPodSlots to:", this.adParameters.maxPodSlots);
break;
case "LR_POD_DURATION":
this.adParameters.maxPodDuration = Math.max(0, j.returnFloat(c, this.adParameters.maxPodDuration)), this.logger.log("Set maxPodDuration to:", this.adParameters.maxPodDuration);
break;
case "LR_WRAPPER_LIMIT":
this.adParameters.wrapperLimit = j.returnUnsignedInt(c, this.adParameters.wrapperLimit), this.logger.log("Set wrapper limit to:", this.adParameters.wrapperLimit);
break;
case "LR_CLICK_TARGET":
this.adParameters.clickthruTarget = j.returnString(c, this.adParameters.clickthruTarget), this.logger.log("Set clickthrough target to:", this.adParameters.clickthruTarget);
break;
case "LR_TIMEOUT_DELIVERY":
this.adParameters.adDeliveryTimeout = Math.max(0, j.returnFloat(c, this.adParameters.adDeliveryTimeout)), this.logger.log("Set delivery timeout to:", this.adParameters.adDeliveryTimeout);
break;
case "LR_TIMEOUT_ADSOURCE":
this.adParameters.adRequestTimeout = Math.max(0, j.returnFloat(c, this.adParameters.adRequestTimeout)), this.logger.log("Set ad source timeout to:", this.adParameters.adRequestTimeout);
break;
case "LR_TIMEOUT_STREAM":
this.adParameters.adCreativeTimeout = Math.max(0, j.returnFloat(c, this.adParameters.adCreativeTimeout)), this.logger.log("Set stream timeout to:", this.adParameters.adCreativeTimeout);
break;
case "LR_TIMEOUT_VPAID_LOAD":
this.adParameters.timeoutVPAIDLoad = Math.max(0, j.returnFloat(c, this.adParameters.timeoutVPAIDLoad)), this.logger.log("Set VPAID load timeout to:", this.adParameters.timeoutVPAIDLoad);
break;
case "LR_TIMEOUT_VPAID_INIT":
this.adParameters.timeoutVPAIDInit = Math.max(0, j.returnFloat(c, this.adParameters.timeoutVPAIDInit)), this.logger.log("Set VPAID init timeout to:", this.adParameters.timeoutVPAIDInit);
break;
case "LR_TIMEOUT_VPAID_START":
this.adParameters.timeoutVPAIDStart = Math.max(0, j.returnFloat(c, this.adParameters.timeoutVPAIDStart)), this.logger.log("Set VPAID start timeout to:", this.adParameters.timeoutVPAIDStart);
break;
case "LR_LAYOUT_SKIN_ID":
this.adParameters.linearSkin = j.returnUnsignedInt(c, this.adParameters.linearSkin), this.logger.log("Set layout skin id to:", this.adParameters.linearSkin);
break;
case "LR_LAYOUT_SHOW_COUNTDOWN":
this.adParameters.showCountdown = j.returnBoolean(c, this.adParameters.showCountdown), this.logger.log("Set showCountdown to:", this.adParameters.showCountdown);
break;
case "LR_LAYOUT_SKIN_MESSAGE":
this.adParameters.countdownMessage = j.returnString(c, this.adParameters.countdownMessage), this.adParameters.showCountdown = !0, this.logger.log("Set countdown message to:", this.adParameters.countdownMessage);
break;
case "LR_LAYOUT_CLICK_MESSAGE":
this.adParameters.clickthroughMessage = j.returnString(c, this.adParameters.clickthroughMessage), this.logger.log("Set clickthrough message to:", this.adParameters.clickthroughMessage);
break;
case "LR_LAYOUT_LINEAR_PAUSEONCLICKTHRU":
this.adParameters.pauseOnClick = j.returnBoolean(c, this.adParameters.pauseOnClick), this.logger.log("Set pause on clickthrough to:", this.adParameters.pauseOnClick);
break;
case "LR_SKIP_COUNTDOWN":
this.adParameters.skipCountdownMessage = j.returnString(c, this.adParameters.skipCountdownMessage), this.logger.log("Set skip countdown message to:", this.adParameters.skipCountdownMessage);
break;
case "LR_SKIP_MESSAGE":
this.adParameters.skipMessage = j.returnString(c, this.adParameters.skipMessage), this.logger.log("Set skip message to:", this.adParameters.skipMessage);
break;
case "LR_LAYOUT_SKIN_ADINDEX":
this.adParameters.indexMessage = j.returnString(c, this.adParameters.indexMessage), this.logger.log("Set index message to:", this.adParameters.indexMessage);
break;
case "LR_BITRATE":
this.adParameters.desiredBitrate = j.returnUnsignedInt(c, this.adParameters.desiredBitrate), this.logger.log("Set desired bitrate to:", this.adParameters.desiredBitrate);
break;
case "LR_PLAYER_HANDLES_CLICK":
this.adParameters.playerHandlesClick = j.returnBoolean(c, this.adParameters.playerHandlesClick), this.logger.log("Set playerHandlesClick to:", this.adParameters.playerHandlesClick);
break;
case "LR_DEBUG":
var e = j.returnUnsignedInt(c, null);
null !== e && (this.adRequestParameters[b] = d, h.setDebugLevelOverride(e));
break;
case "LR_COMPANIONS":
this.parseCompanionPlacements(d), this.ingestAdRequestParameter(b, d);
break;
case "BGCOLOR":
this.adParameters.bgcolor = j.returnString(c, this.adParameters.bgcolor), this.logger.log("Set bgcolor to:", this.adParameters.bgcolor);
break;
case "URLPREFIX":
var f = j.returnString(c, null);
f && !f.match(/[^A-Za-z0-9\.]/) && (this.urlPrefix = f, this.logger.log("Set urlPrefix to:", this.urlPrefix));
break;
default:
this.ingestAdRequestParameter(b, d)
}
}
}, a.prototype.ingestAdRequestParameter = function(a, b) {
null !== b && (this.adRequestParameters[a] = b)
}, a.prototype.parseCompanionPlacements = function(a) {
if ("string" == typeof a)
for (var b = a.split("|"), c = 0; c < b.length; c += 1) {
var d = b[c].split(":");
if (d.length >= 3) {
var f = j.returnUnsignedInt(d[0], null),
g = j.returnUnsignedInt(d[1], null),
h = j.returnString(d[2], null),
i = j.returnString(d[3], null),
k = j.returnBoolean(d[4], null),
l = f + "x" + g,
m = new e(f, g, h, i, k);
this.logger.log("Parsed " + l + " companion placement:", m), this.companionPlacements[l] = m
}
}
}, a
}();
return l
}), define("EnvironmentManager", ["require", "exports", "AdManagerFactory", "EnvironmentData", "EventManager", "LogEvent", "LogEventType", "Logger", "Utils", "VPAIDEvents"], function(a, b, c, d, e, f, g, h, i, j) {
var k = function() {
function a(a) {
this.logger = new h("EnvironmentManager"), this.eventManager = new e(j), this.adVolume = 1, this.adVolumeSet = !1, this.instanceData = a, this.adManagerFactory = new c(this.instanceData), this.adLinear = this.instanceData.getDefaultAdLinear(), this.destroy()
}
return a.prototype.getAdLinear = function() {
return this.adManager ? this.adManager.getAdLinear() : this.adLinear
}, a.prototype.getAdWidth = function() {
return this.adManager ? this.adManager.getAdWidth() : 0
}, a.prototype.getAdHeight = function() {
return this.adManager ? this.adManager.getAdHeight() : 0
}, a.prototype.getAdExpanded = function() {
return this.adManager ? this.adManager.getAdExpanded() : !1
}, a.prototype.getAdSkippableState = function() {
return this.adManager ? this.adManager.getAdSkippableState() : !1
}, a.prototype.getAdSkippableRemainingTime = function() {
return this.adManager ? this.adManager.getAdSkippableRemainingTime() : -2
}, a.prototype.getAdRemainingTime = function() {
return this.adManager ? this.adManager.getAdRemainingTime() : -2
}, a.prototype.getAdDuration = function() {
return this.adManager ? this.adManager.getAdDuration() : -2
}, a.prototype.getAdVolume = function() {
return this.adManager ? this.adManager.getAdVolume() : this.adVolume
}, a.prototype.setAdVolume = function(a) {
this.logger.log("--> setAdVolume(", a, ")"), a >= 0 && 1 >= a && (this.adVolume = a, this.adVolumeSet = !0, this.adManager ? this.adManager.setAdVolume(a) : this.onAdVolumeChange())
}, a.prototype.getAdCompanions = function() {
return this.adManager ? this.adManager.getAdCompanions() : ""
}, a.prototype.getAdIcons = function() {
return this.adManager ? this.adManager.getAdIcons() : !1
}, a.prototype.handshakeVersion = function(a) {
return this.logger.log("--> handshakeVersion(" + a + ")"), "2.0"
}, a.prototype.initAd = function(b, c, e, h, j, k) {
this.logger.log("--> initAd() width:", b, " height:", c, " viewMode:", e, "desiredBitrate:", h, "creativeData:", j, "environmentVars:", k), this.destroy(), this.state = 1;
var l = a.consolidateEnvironmentVars([this.instanceData.getQueryStringParameters(), j, k]),
m = this.chooseEnvironmentType(l.LR_ENVIRONMENT),
n = k.slot,
o = k.videoSlot,
p = i.returnBoolean(k.videoSlotCanAutoPlay, !0);
1 === m && void 0 === o && a.isValidElement(n) && (n.innerHTML = "", p = k.videoSlotCanAutoPlay || !1, o = document.createElement("video"), o.style.setProperty("display", "block", "important"), o.style.setProperty("width", b + "px", "important"), o.style.setProperty("height", c + "px", "important"), n.appendChild(o)), o && !this.adVolumeSet && (this.adVolume = o.volume);
var q = {
width: b,
height: c,
viewMode: e,
desiredBitrate: h,
environmentVars: l,
environmentType: m,
slot: n,
videoSlot: o,
videoSlotCanAutoPlay: p,
window: k.window,
adVolume: this.adVolume
};
switch (this.environmentData = new d(this.instanceData, q), m) {
case 0:
return void this.onAdError(f.eventWithType(g.NoAvailableEnvironment));
case 1:
if (!a.isValidPlayer(o)) return void this.onAdError(f.eventWithType(g.InvalidVideoElement));
break;
case 2:
if (!a.isValidElement(n)) return void this.onAdError(f.eventWithType(g.InvalidSlotElement))
}
this.environmentData.publisherId > 0 || null !== this.environmentData.placementId ? (this.adManager = this.adManagerFactory.adManagerForEnvironment(m),
this.adVolumeSet && (this.logger.debug("Setting AdManager volume to " + this.adVolume), this.adManager.setAdVolume(this.adVolume)), this.registerEventSubscriptions(this.adManager), this.adManager.initAd(b, c, e, h, {}, {
environmentData: this.environmentData
})) : this.onAdError(f.eventWithType(g.InvalidPlacement))
}, a.prototype.resizeAd = function(a, b, c) {
return this.adManager ? this.adManager.resizeAd(a, b, c) : void 0
}, a.prototype.startAd = function() {
return this.logger.log("--> startAd()"), 0 === this.state ? void this.onAdError(f.eventWithType(g.StartAdBeforeInitAd)) : 1 === this.state ? void(this.startAdCalled = !0) : 4 === this.state ? void this.logger.error("AdManager already started, ignoring startAd") : void(3 === this.state && this.startAdManager())
}, a.prototype.stopAd = function() {
return this.logger.log("--> stopAd()"), this.adManager ? this.adManager.stopAd() : void this.onAdStopped()
}, a.prototype.pauseAd = function() {
return this.logger.log("--> pauseAd()"), this.adManager ? this.adManager.pauseAd() : void 0
}, a.prototype.resumeAd = function() {
return this.logger.log("--> resumeAd()"), this.adManager ? this.adManager.resumeAd() : void 0
}, a.prototype.expandAd = function() {
return this.logger.log("--> expandAd()"), this.adManager ? this.adManager.expandAd() : void 0
}, a.prototype.collapseAd = function() {
return this.logger.log("--> collapseAd()"), this.adManager ? this.adManager.collapseAd() : void 0
}, a.prototype.skipAd = function() {
return this.logger.log("--> skipAd()"), this.adManager ? this.adManager.skipAd() : void 0
}, a.prototype.subscribe = function(a, b, c) {
this.eventManager.subscribe(a, b, c)
}, a.prototype.unsubscribe = function(a, b) {
this.eventManager.unsubscribe(a, b)
}, a.prototype.onAdLoaded = function() {
this.logger.log("<-- Dispatching AdLoaded event"), this.state = 3, this.eventManager.dispatch(j.AdLoaded), this.startAdCalled === !0 && 3 === this.state && (this.logger.log("startAd already called - calling lazy startAd"), this.startAdCalled = !1, this.startAdManager())
}, a.prototype.onAdStarted = function() {
this.logger.log("<-- Dispatching AdStarted event"), this.eventManager.dispatch(j.AdStarted)
}, a.prototype.onAdStopped = function() {
this.logger.log("<-- Dispatching AdStopped event"), this.eventManager.dispatch(j.AdStopped)
}, a.prototype.onAdSkipped = function() {
this.logger.log("<-- Dispatching AdSkipped event"), this.eventManager.dispatch(j.AdSkipped)
}, a.prototype.onAdSkippableStateChange = function() {
this.logger.log("<-- Dispatching AdSkippableStateChange event"), this.eventManager.dispatch(j.AdSkippableStateChange)
}, a.prototype.onAdSizeChange = function() {
this.logger.log("<-- Dispatching AdSizeChange event"), this.eventManager.dispatch(j.AdSizeChange)
}, a.prototype.onAdLinearChange = function() {
this.adLinear = this.adManager.getAdLinear(), this.logger.log("<-- Dispatching AdLinearChange event"), this.eventManager.dispatch(j.AdLinearChange)
}, a.prototype.onAdDurationChange = function() {
this.logger.log("<-- Dispatching AdDurationChange event"), this.eventManager.dispatch(j.AdDurationChange)
}, a.prototype.onAdExpandedChange = function() {
this.logger.log("<-- Dispatching AdExpandedChange event"), this.eventManager.dispatch(j.AdExpandedChange)
}, a.prototype.onAdVolumeChange = function() {
this.logger.log("<-- Dispatching AdVolumeChange event"), this.eventManager.dispatch(j.AdVolumeChange)
}, a.prototype.onAdImpression = function() {
this.logger.log("<-- Dispatching AdImpression event"), this.eventManager.dispatch(j.AdImpression)
}, a.prototype.onAdVideoStart = function() {
this.logger.log("<-- Dispatching AdVideoStart event"), this.eventManager.dispatch(j.AdVideoStart)
}, a.prototype.onAdVideoFirstQuartile = function() {
this.logger.log("<-- Dispatching AdVideoFirstQuartile event"), this.eventManager.dispatch(j.AdVideoFirstQuartile)
}, a.prototype.onAdVideoMidpoint = function() {
this.logger.log("<-- Dispatching AdVideoMidpoint event"), this.eventManager.dispatch(j.AdVideoMidpoint)
}, a.prototype.onAdVideoThirdQuartile = function() {
this.logger.log("<-- Dispatching AdVideoThirdQuartile event"), this.eventManager.dispatch(j.AdVideoThirdQuartile)
}, a.prototype.onAdVideoComplete = function() {
this.logger.log("<-- Dispatching AdVideoComplete event"), this.eventManager.dispatch(j.AdVideoComplete)
}, a.prototype.onAdClickThru = function(a, b, c) {
this.logger.log("<-- Dispatching AdClickThru event, url=" + a + " id=" + b + " playerHandles=" + c), this.eventManager.dispatch(j.AdClickThru, [a, b, c])
}, a.prototype.onAdInteraction = function() {
this.logger.log("<-- Dispatching AdInteraction event"), this.eventManager.dispatch(j.AdInteraction)
}, a.prototype.onAdUserAcceptInvitation = function() {
this.logger.log("<-- Dispatching AdUserAcceptInvitation event"), this.eventManager.dispatch(j.AdUserAcceptInvitation)
}, a.prototype.onAdUserMinimize = function() {
this.logger.log("<-- Dispatching AdUserMinimize event"), this.eventManager.dispatch(j.AdUserMinimize)
}, a.prototype.onAdUserClose = function() {
this.logger.log("<-- Dispatching AdUserClose event"), this.eventManager.dispatch(j.AdUserClose)
}, a.prototype.onAdPaused = function() {
this.logger.log("<-- Dispatching AdPaused event"), this.eventManager.dispatch(j.AdPaused)
}, a.prototype.onAdPlaying = function() {
this.logger.log("<-- Dispatching AdPlaying event"), this.eventManager.dispatch(j.AdPlaying)
}, a.prototype.onAdLog = function(a) {
this.logger.log("<-- Dispatching AdLog event, message=" + a), this.eventManager.dispatch(j.AdLog, [a])
}, a.prototype.onAdError = function(a) {
this.logger.log("<-- Dispatching AdError event, message=" + a.message + " id=" + a.id), this.destroy(), this.eventManager.dispatch(j.AdError, [a.message, a.id])
}, a.prototype.destroy = function() {
this.adManager && (this.unregisterEventSubscriptions(this.adManager), this.adManager = null), this.state = 0, this.environmentData = null, this.startAdCalled = !1
}, a.prototype.startAdManager = function() {
this.state = 4, this.adManager && this.adManager.startAd()
}, a.prototype.registerEventSubscriptions = function(a) {
this.logger.log("Registering event subscriptions"), a.subscribe(this.onAdLoaded, j.AdLoaded, this), a.subscribe(this.onAdStarted, j.AdStarted, this), a.subscribe(this.onAdStopped, j.AdStopped, this), a.subscribe(this.onAdSkipped, j.AdSkipped, this), a.subscribe(this.onAdSkippableStateChange, j.AdSkippableStateChange, this), a.subscribe(this.onAdSizeChange, j.AdSizeChange, this), a.subscribe(this.onAdLinearChange, j.AdLinearChange, this), a.subscribe(this.onAdDurationChange, j.AdDurationChange, this), a.subscribe(this.onAdExpandedChange, j.AdExpandedChange, this), a.subscribe(this.onAdVolumeChange, j.AdVolumeChange, this), a.subscribe(this.onAdImpression, j.AdImpression, this), a.subscribe(this.onAdVideoStart, j.AdVideoStart, this), a.subscribe(this.onAdVideoFirstQuartile, j.AdVideoFirstQuartile, this), a.subscribe(this.onAdVideoMidpoint, j.AdVideoMidpoint, this), a.subscribe(this.onAdVideoThirdQuartile, j.AdVideoThirdQuartile, this), a.subscribe(this.onAdVideoComplete, j.AdVideoComplete, this), a.subscribe(this.onAdClickThru, j.AdClickThru, this), a.subscribe(this.onAdInteraction, j.AdInteraction, this), a.subscribe(this.onAdUserAcceptInvitation, j.AdUserAcceptInvitation, this), a.subscribe(this.onAdUserMinimize, j.AdUserMinimize, this), a.subscribe(this.onAdUserClose, j.AdUserClose, this), a.subscribe(this.onAdPaused, j.AdPaused, this), a.subscribe(this.onAdPlaying, j.AdPlaying, this), a.subscribe(this.onAdLog, j.AdLog, this), a.subscribe(this.onAdError, j.AdError, this)
}, a.prototype.unregisterEventSubscriptions = function(a) {
this.logger.log("Unregistering event subscriptions"), a.unsubscribe(this.onAdLoaded, j.AdLoaded), a.unsubscribe(this.onAdStarted, j.AdStarted), a.unsubscribe(this.onAdStopped, j.AdStopped), a.unsubscribe(this.onAdSkipped, j.AdSkipped), a.unsubscribe(this.onAdSkippableStateChange, j.AdSkippableStateChange), a.unsubscribe(this.onAdSizeChange, j.AdSizeChange), a.unsubscribe(this.onAdLinearChange, j.AdLinearChange), a.unsubscribe(this.onAdDurationChange, j.AdDurationChange), a.unsubscribe(this.onAdExpandedChange, j.AdExpandedChange), a.unsubscribe(this.onAdVolumeChange, j.AdVolumeChange), a.unsubscribe(this.onAdImpression, j.AdImpression), a.unsubscribe(this.onAdVideoStart, j.AdVideoStart), a.unsubscribe(this.onAdVideoFirstQuartile, j.AdVideoFirstQuartile), a.unsubscribe(this.onAdVideoMidpoint, j.AdVideoMidpoint), a.unsubscribe(this.onAdVideoThirdQuartile, j.AdVideoThirdQuartile), a.unsubscribe(this.onAdVideoComplete, j.AdVideoComplete), a.unsubscribe(this.onAdClickThru, j.AdClickThru), a.unsubscribe(this.onAdInteraction, j.AdInteraction), a.unsubscribe(this.onAdUserAcceptInvitation, j.AdUserAcceptInvitation), a.unsubscribe(this.onAdUserMinimize, j.AdUserMinimize), a.unsubscribe(this.onAdUserClose, j.AdUserClose), a.unsubscribe(this.onAdPaused, j.AdPaused), a.unsubscribe(this.onAdPlaying, j.AdPlaying), a.unsubscribe(this.onAdLog, j.AdLog), a.unsubscribe(this.onAdError, j.AdError)
}, a.consolidateEnvironmentVars = function(a) {
for (var b = {}, c = 0; c < a.length; c += 1)
for (var d in a[c]) a[c].hasOwnProperty(d) && (b[d] = a[c][d]);
return b
}, a.prototype.chooseEnvironmentType = function(a) {
"undefined" == typeof a && (a = "html5");
for (var b = 0, c = a.split(","), d = 0; d < c.length; d += 1) {
switch (this.logger.log("Considering environment: " + c[d]), c[d]) {
case "flash":
i.detectFlash() && (b = 2);
break;
case "html5":
i.detectHTML5() && (b = 1)
}
if (0 !== b) {
this.logger.log("Selected environment: " + c[d]);
break
}
}
return 0 === b && this.logger.error("No available environment"), b
}, a.isValidElement = function(a) {
return "object" == typeof a && null !== a && !!a.tagName
}, a.isValidPlayer = function(a) {
return "object" == typeof a && null !== a && "function" == typeof a.canPlayType
}, a
}();
return k
}), define("getVPAIDAd", ["require", "exports", "Logger", "InstanceData", "AdapterFactory", "EnvironmentManager"], function(a, b, c, d, e, f) {
function g() {
var a = new d;
a.getDisableIframes() && c.setDebugLevelOverride(0), null !== a.getDebugLevel() && c.setDebugLevelOverride(a.getDebugLevel()), e.setInstanceData(a);
var b = new f(a),
g = {
getAdLinear: function() {
return b.getAdLinear()
},
getAdWidth: function() {
return b.getAdWidth()
},
getAdHeight: function() {
return b.getAdHeight()
},
getAdExpanded: function() {
return b.getAdExpanded()
},
getAdSkippableState: function() {
return b.getAdSkippableState()
},
getAdSkippableRemainingTime: function() {
return b.getAdSkippableRemainingTime()
},
getAdRemainingTime: function() {
return b.getAdRemainingTime()
},
getAdDuration: function() {
return b.getAdDuration()
},
getAdVolume: function() {
return b.getAdVolume()
},
setAdVolume: function(a) {
return b.setAdVolume(a)
},
getAdCompanions: function() {
return b.getAdCompanions()
},
getAdIcons: function() {
return b.getAdIcons()
},
handshakeVersion: function(a) {
return b.handshakeVersion(a)
},
initAd: function(a, c, d, e, f, g) {
return b.initAd(a, c, d, e, f, g)
},
resizeAd: function(a, c, d) {
return b.resizeAd(a, c, d)
},
startAd: function() {
return b.startAd()
},
stopAd: function() {
return b.stopAd()
},
pauseAd: function() {
return b.pauseAd()
},
resumeAd: function() {
return b.resumeAd()
},
expandAd: function() {
return b.expandAd()
},
collapseAd: function() {
return b.collapseAd()
},
skipAd: function() {
return b.skipAd()
},
subscribe: function(a, c, d) {
return b.subscribe(a, c, d)
},
unsubscribe: function(a, c) {
return b.unsubscribe(a, c)
}
},
h = new c;
return h.log("Loaded LiveRail.AdManager (release 2.2.8, build 201511261816):", g), h.log("Using calling URL:", a.getCallingURL()), h.log("Using instance data:", a), g
}
return g
}), require("getVPAIDAd")
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment