/*! thPlayer - v1.0 - 2015-06-12 */ !function () { var a = function (a) { return a.charAt(0).toUpperCase() + a.slice(1) }, b = function (a) { a.$wrap.addClass(a.css.wrap), a.$container.addClass(a.css.container).off(".thScroll").on({ "touchstart.thScroll": function (b) { b.stopPropagation(), a.scrolling = !0, a.previous = b.originalEvent.touches[0][a.coordName] }, "touchend.thScroll": function () { a.scrolling = !1 }, "touchmove.thScroll": function (b) { var c = a.previous - b.originalEvent.touches[0][a.coordName] < 0 ? 1 : 2; !a.$wrap.hasClass(a.css.visible) || a.atSide && a.atSide === c || (b.preventDefault(), a.movePin(a.previous - b.originalEvent.touches[0][a.coordName]), a.previous = b.originalEvent.touches[0][a.coordName]) }, "mousewheel.thScroll DOMMouseScroll.thScroll": function (b) { var c = b.originalEvent.wheelDelta > 0 || b.originalEvent.detail < 0 ? 1 : 2; a.atSide && a.atSide === c || (b.preventDefault(), b.stopPropagation(), a.visible && a.movePin(b.originalEvent.wheelDelta > 0 || b.originalEvent.detail < 0 ? -a.moveStep : a.moveStep)) } }), a.$pin.addClass(a.css.pin).appendTo(a.$wrap).off(".thScroll").on({ "touchstart.thScroll": function (b) { b.preventDefault(), a.start = a.$pin.position()[a.moveSide] - b.originalEvent.touches[0][a.coordName] }, "touchmove.thScroll": function (b) { b.preventDefault(), a.$wrap.hasClass(a.css.visible) && a.movePin(!1, b.originalEvent.touches[0][a.coordName] + a.start) }, "mousedown.thScroll": function (b) { b.preventDefault(), a.visible && 1 === b.which && (a.start = a.$pin.position()[a.moveSide] - b[a.coordName], jQuery(window).on("mousemove.thScroll", function (b) { return a.$wrap.hasClass(a.css.visible) ? void a.movePin(!1, b[a.coordName] + a.start) : void jQuery(window).off(".thScroll") }), jQuery(window).on("mouseup.thScroll", function () { jQuery(window).off(".thScroll") })) } }), a.setDirection(this.direction) }, c = function (a, c, d) { this.id = H(), this.$wrap = a, this.$container = c, this.$pin = jQuery("
"), this.direction = d, this.css = { wrap: "th-scroll-wrap", container: "th-scroll-container", pin: "th-scroll-pin", visible: "th-scroll-visible", direction: "th-scroll-" }, b(this) }; c.prototype = { refresh: function () { b(this) }, movePin: function (b, c) { b = "number" == typeof c ? c : this.$pin.position()[this.moveSide] + b, b = b > this.max ? this.max : 0 > b ? 0 : b; var d = Math.round(b); return this.$pin.css(this.moveSide, d + "px"), this.atSide = 0 === d ? 1 : d >= this.max ? 2 : !1, b *= this.proportion, b = 0 > b ? this.size + b : b, this.$container["scroll" + a(this.moveSide)](b), this }, toElement: function (b, c) { if (b = this.$container.find(b), b.length) { var d = 0, e = b.offset()[this.moveSide] - this.$container.offset()[this.moveSide], f = b["outer" + a(this.property)](); switch (c) { case "middle": var g = f > this.size ? 0 : (f - this.size) / 2; d = e + g; break; case "bottom": d = e + f - this.size; break; case "top": default: d = e } this.movePin(d / this.proportion) } }, resize: function () { var b = this.$container[this.property](), c = this.$container.prop("scroll" + a(this.property)); if (this.size !== b || this.scrollSize !== c) { this.atSide = -1, this.size = b, this.scrollSize = c; var d = this.scrollSize - this.size; if (0 >= d) return this.$wrap.removeClass(this.css.visible), this.visible = !1, this; this.visible = !0, this.$wrap.addClass(this.css.visible); var e = d / this.scrollSize; return this.max = Math.round(e * this.size), this.proportion = d / this.max, this.moveStep = this.defaultStep / this.proportion, this.$pin[this.property](this.size - this.max + "px"), this.$pin.css(this.moveSide, Math.round(this.$container["scroll" + a(this.moveSide)]() / this.proportion) + "px"), this } }, setDirection: function (a) { return this.direction = a, "x" === a || "horizontal" === a ? (this.moveSide = "left", this.coordName = "pageX", this.property = "width", this.defaultStep = 32, this.$wrap.removeClass(this.css.direction + "y").addClass(this.css.direction + "x")) : (this.moveSide = "top", this.coordName = "pageY", this.property = "height", this.defaultStep = 55, this.$wrap.removeClass(this.css.direction + "x").addClass(this.css.direction + "y")), this.resize(), this }, remove: function () { return jQuery(window).off(".thScroll"), this.$wrap.removeClass(this.css.wrap + " " + this.css.visible + " " + this.css.direction + "y " + this.css.direction + "x"), this.$container.removeClass(this.css.container), this.$pin.remove(), this.$pin = null, null } }; var d = function (a) { return "#" === a.charAt(0) ? a.substring(1, 7) : a }, e = function (a) { return parseInt(d(a).substring(0, 2), 16) }, f = function (a) { return parseInt(d(a).substring(2, 4), 16) }, g = function (a) { return parseInt(d(a).substring(4, 6), 16) }, h = function (a, b, c) { b = t(b) ? b : "#000000", this.$container = a, this.$canvas = jQuery("").css({ width: "100%", height: "100%" }), this.$canvas[0].width = 100, this.$canvas[0].height = 100, this.size = 100, this.context = this.$canvas[0].getContext("2d"), this.startDate = new Date, this.number = u(c) ? c : 16, this.color = { red: e(b), green: f(b), blue: g(b) }, this.refresh() }; h.prototype = { draw: function () { if (this.isDisabled()) return this; var a = parseInt((new Date - this.startDate) / 1e3 * this.number) / this.number; this.context.save(), this.context.clearRect(0, 0, this.size, this.size), this.context.translate(this.size / 2, this.size / 2), this.context.rotate(2 * Math.PI * a); for (var b = 0; b < this.number; b++) this.context.beginPath(), this.context.rotate(2 * Math.PI / this.number), this.context.moveTo(this.size / 5, 0), this.context.lineTo(this.size / 2, 0), this.context.lineWidth = this.size / 30, this.context.strokeStyle = "rgba(" + this.color.red + "," + this.color.green + "," + this.color.blue + "," + b / this.number + ")", this.context.stroke(); return this.context.restore(), this }, isDisabled: function () { return this.$canvas.is(":hidden") ? !0 : !1 }, start: function (a) { this.interval && clearInterval(this.interval), a = u(a) ? a : 10; var b = this; return this.interval = setInterval(function () { b.draw() }, 1e3 / a), this }, stop: function () { return this.interval && clearInterval(this.interval), this.interval = !1, this }, remove: function () { return this.stop(), this.$canvas.remove(), null }, refresh: function (a) { return s(a) || (this.$container = a), this.$container && this.$container.length ? (this.$canvas.appendTo(this.$container), this.draw(), this) : (this.stop(), this) } }; var i = function (a, b) { return a = t(a) ? { src: a } : a, a instanceof jQuery && (a = Ga(a)), a.src ? (this.src = a.src, this.type = t(a.type) ? a.type : !1, this.kind = a.kind || b || "video", this.duration = !1, this.available = !1, this.needsCheck = !0, void (this.type && !aa[this.kind].prototype.canPlayType(this.type) && (this.needsCheck = !1))) : !1 }; i.prototype = { check: function (a) { var b = this, c = null; return b.deferred ? b.deferred : b.needsCheck ? (c = aa[this.kind].prototype.check(this, a), b.deferred = c, b.deferred.always(function () { b.deferred = null }), c) : (c = jQuery.Deferred(), b.available ? c.resolve(b) : c.reject(p.error), c) } }; var j = function (a, b) { var c = this; b = jQuery.extend(!0, _a, b || {}), c.items = {}, c.sorted = [], c.controls = {}, c.players = {}, c.current = {}, c.prop = {}, c.player = a, c.atStart = !!b.atStart, s(b.skip) || (c.skipTime = u(b.skip) ? b.skip : !!b.skip), s(b.every) || (c.every = u(b.every) ? b.every : !!b.every), hb(c, b.items), cb(c, c.player.$wrap), gb(c), c.sort(), c.defaultSorted = c.sorted }; j.prototype = { visible: !1, skipTime: !0, every: !1, atStart: !0, getOrder: "_loop", css: { visible: "th-advert-visible", skipable: "th-advert-skipable", hasLink: "th-clickable" }, canSkip: function () { if (!u(this.skipTime)) return !!this.skipTime; var a = ca(this, "time"); return a === !1 ? !1 : this.skipTime <= a }, hasItems: function () { var a = !1; return jQuery.each(this.items, function () { return a = !0, !1 }), a }, count: function () { var a = this; return null !== a.countItems ? a.countItems : (a.countItems = 0, jQuery.each(this.items, function () { ++a.countItems }), a.countItems) }, get: function (a, b) { return t(a) || (b = s(b) ? a.params : b, a = a.method), Z[a] ? Z[a](this, b) : this.items[a] ? this.items[a] : null }, add: function (a) { this.countItems = null, kb(this, a); var b = this.sorted; return this.sort(), this.defaultSorted = this.sorted, this.sorted = b, this }, sort: function (a, b) { return a = a && $[a] ? a : "default", $[a](this, b), this }, show: function (a) { return tb(this, s(a) ? this.getOrder : a), this }, hide: function (a) { return this.visible = !1, fa(this.player, this.css.visible + " " + this.css.skipable), pb(this), this.player.prop.tempDisabled = !1, a || (this.player.$events.trigger("thadverthide"), this.player.play()), this }, skip: function () { return this.canSkip() && this.hide(), this } }; var k = function (a) { var b = this; b.sources = {}, a = Ja(b, a), b.id = a.id || H(), b.name = a.name || a.src || a.id, b.preview = a.preview || null, b.shortDescription = a.shortDescription || null, b.description = a.description || null, b.originalControls = w(a.originalControls) ? a.originalControls : null, b.playerProp = a.playerProp ? a.playerProp : !1, b.noAdverts = w(a.noAdverts) ? a.noAdverts : !1, b.advertsProp = a.advertsProp ? a.advertsProp : !1, b.kind = a.kind || "video", a.sources && jQuery.each(a.sources, function (a, c) { b.addSource(c) }) }; k.prototype = { update: function (a) { var b = this; return a = Ja(b, a), t(a.name) && (b.name = a.name), t(a.preview) && (b.preview = a.preview), t(a.shortDescription) && (b.shortDescription = a.shortDescription), t(a.description) && (b.description = a.description), w(a.originalControls) && (b.originalControls = a.originalControls), s(a.playerProp) || (b.playerProp = a.playerProp), w(a.noAdverts) && (b.noAdverts = a.noAdverts), t(a.kind) && (b.kind = a.kind), s(a.advertsProp) || (b.advertsProp = a.advertsProp), a.sources && jQuery.each(a.sources, function (a, c) { b.addSource(c) }), b }, addSource: function (a) { return a instanceof i || (a = new i(a, this.kind)), a && a.kind === this.kind && (this.sources[a.src] = a), this }, getAvailable: function () { return Ka(this.sources) } }; for (var l = jQuery(document)[0], m = (jQuery([]), "file:" === window.location.protocol, navigator.userAgent.match(/(iPad|iPhone|iPod)/g) ? !0 : !1), n = !m, o = { available: !1, api: {} }, p = { pending: 0, loading: 1, success: 10, buffering: 11, aborted: 20, error: 30, notFound: 31, current: 50 }, q = function (a) { window.console && console.log(a) }, r = function (a) { return '[data-role~="' + a + '"]' }, s = function (a) { return "undefined" == typeof a ? !0 : !1 }, t = function (a) { return "string" == typeof a ? !0 : !1 }, u = function (a) { return "number" == typeof a ? !0 : !1 }, v = function (a) { return "function" == typeof a ? !0 : !1 }, w = function (a) { return a === !0 || a === !1 ? !0 : !1 }, x = function (a, b, c) { return a && a[b] ? a[b].apply(a, c) : !1 }, y = function (a, b) { return b ? (a = (a || jQuery([])).add(b), a.length ? a : !1) : a }, z = function (a, b) { return b ? (a = (a || jQuery([])).not(b), a.length ? a : !1) : a }, A = function (a, b, c, d) { a && (d && (b += "." + d, a.off(b)), a.on(b, c)) }, B = function (a, b, c) { var d = a.find(b); return c || d.length ? d : !1 }, C = function (a) { return '[data-action~="' + a + '"]' }, D = function (a) { if (t(a)) return '[data-group~="' + a + '"]'; var b = []; return jQuery.each(a, function (a, c) { b.push(D(c)) }), b.join(",") }, E = function (a, b, c, d, e) { b && a[c] && A(b, "click", function () { a[c].apply(a, e) }, d) }, F = function (a, b, c, d) { c && (b = "$" + b, a.controls[b] = y(a.controls[b], c), A(c, "thremove", function (d) { d.target === c[0] && (a.controls[b] = z(a.controls[b], c)) }, d)) }, G = function (a, b) { if (!u(a)) return b ? "0" : "0:00"; var c = parseInt(a, 10), d = Math.floor(c / 3600), e = Math.floor((c - 3600 * d) / 60), f = c - 3600 * d - 60 * e; return (!b || d) && d && 10 > e && (e = "0" + e), (!b || e || d) && 10 > f && (f = "0" + f), a = (d ? d + ":" : "") + (!b || d ? e + ":" : "") + f }, H = function () { function a() { return Math.floor(65536 * (1 + Math.random())).toString(16).substring(1) } return a() + a() + "-" + a() + "-" + a() + "-" + a() + "-" + a() + a() + a() }, I = function (a) { var b = new jQuery.Deferred, c = jQuery.ajax({ type: "HEAD", url: a, success: function () { b.resolve.apply(b, arguments) }, error: function () { b.reject.apply(b, arguments) } }); return b.always(function () { c.abort(), c = null }), b }, J = { singleIn: function (a, b, c) { return c ? (c && t(c) && (c = [c]), a[b] === !0 || a[b] && jQuery.inArray(a[b], c) > -1 ? !0 : !1) : !a[b] }, inArray: function (a, b, c) { return c ? a[b] === !0 || a[b] && jQuery.inArray(c, a[b]) > -1 ? !0 : !1 : !(a[b] && a[b] !== !0 && a[b].length) } }, K = [["requestFullscreen", "exitFullscreen", "fullscreenElement", "fullscreenEnabled", "fullscreenchange", "fullscreenerror"], ["webkitRequestFullscreen", "webkitExitFullscreen", "webkitFullscreenElement", "webkitFullscreenEnabled", "webkitfullscreenchange", "webkitfullscreenerror"], ["webkitRequestFullScreen", "webkitCancelFullScreen", "webkitCurrentFullScreenElement", "webkitCancelFullScreen", "webkitfullscreenchange", "webkitfullscreenerror"], ["mozRequestFullScreen", "mozCancelFullScreen", "mozFullScreenElement", "mozFullScreenEnabled", "mozfullscreenchange", "mozfullscreenerror"], ["msRequestFullscreen", "msExitFullscreen", "msFullscreenElement", "msFullscreenEnabled", "MSFullscreenChange", "MSFullscreenError"]], L = 0; L < K.length; L++) if (K[L][1] in l) { o.available = !0; for (var M = 0; M < K[L].length; M++) o.api[K[0][M]] = K[L][M]; break } var N = function (a) { return C("player-" + a) }, O = function (a, b, c) { F(a, b, c, "thControls") }, P = function (a, b, c, d) { E(a, b, c, "thControls", d) }, Q = function (a, b, c) { (c || a.controls.$duration) && (b = G(u(b) ? b : a.duration() || 0), (c || a.controls.$duration).html(b.replace(/(\d)/g, "$1"))) }, R = function (a, b, c) { (c || a.controls.$playedTime) && (b = G(u(b) ? b : a.time() || 0), (c || a.controls.$playedTime).html(b.replace(/(\d)/g, "$1"))) }, S = function (a) { a.sourcesCollection && (a.controls.$title && (a.controls.$title.text(a.sourcesCollection.name), a.controls.$title.attr("title", a.sourcesCollection.name)), a.sourcesCollection.description && a.controls.$description ? (a.controls.$description.html(a.sourcesCollection.description), ea(a, a.css.hasInfo)) : fa(a, a.css.hasInfo)) }, T = function (a, b) { a.$events.off(".thControls").on({ "thloadstart.thControls": function () { Q(a, 0), R(a, 0), S(a) }, "thdurationchange.thControls": function () { Q(a) } }), b.$panel && b.$panel.off(".thControls").on({ "mouseenter.thControls": function () { ea(a, a.css.mouseOverControl) }, "mouseleave.thControls": function () { fa(a, a.css.mouseOverControl) } }), P(a, b.$togglePlay, "togglePlay"), P(a, b.$stop, "stop"), P(a, b.$toggleLoop, "toggleLoop"), P(a, b.$fullscreen, "toggleFullscreen"), P(a, b.$toggleInfo, "toggleInfo") }, U = function (a, b) { var c = {}; return c.$panel = B(b, da("panel")), c.$togglePlay = B(b, N("togglePlay")), c.$stop = B(b, N("stop")), c.$playedTime = B(b, da("playedTime")), c.$duration = B(b, da("duration")), c.$toggleLoop = B(b, N("toggleLoop")), c.$toggleInfo = B(b, N("toggleInfo")), c.$fullscreen = B(b, N("toggleFullscreen")), c.$title = B(b, da("title")), c.$description = B(b, da("description")), c.$prefix = B(b, da("prefix")), O(a, "wrap", b), O(a, "playedTime", c.$playedTime), O(a, "duration", c.$duration), O(a, "title", c.$title), O(a, "description", c.$description), O(a, "prefix", c.$prefix), S(a), R(a, !1, c.$playedTime), Q(a, !1, c.$duration), T(a, c), c.scroll = Sa(a, c.$panel || a.$wrap), c.volume = $a(a, c.$panel || a.$wrap), c }, V = function (a) { a.$events.on({ thskinchange: function () { a.mouseMoveTimer && ea(a, a.css.mouseMove), a.loop(a.prop.loop), a.prop.paused ? (ea(a, a.css.pause), fa(a, a.css.playing)) : (ea(a, a.css.playing), fa(a, a.css.pause)), a.hasError() && ea(a, a.css.error) }, thvolumechange: function () { a.volume() }, thloadstart: function () { a.status = p.loading, a.prop.played = !1, la(a), ia(a), fa(a, a.css.error) }, thabort: function () { a.status = p.aborted, ja(a), fa(a, a.css.showPreview, a.css.playing, a.css.pause), ea(a, a.css.error) }, therror: function () { a.status = p.error, ja(a), fa(a, a.css.showPreview, a.css.playing, a.css.pause), ea(a, a.css.error) }, thloadedmetadata: function () { a.status = p.success, a.prop.paused && (ja(a), ea(a, a.css.pause)) }, thpause: function () { Math.round(a.time()) !== Math.round(a.duration()) && (a.prop.paused = !0, ja(a), fa(a, a.css.playing), ea(a, a.css.pause)) }, thplay: function () { a.prop.played = !0, a.prop.paused = !1, ja(a), fa(a, a.css.pause, a.css.showPreview), ea(a, a.css.playing) }, thtimeupdate: function () { R(a) }, thended: function () { a.keyBinding.moveTimer && clearInterval(a.keyBinding.moveTimer) }, thcanplay: function () { ja(a), a.prop.paused ? ea(a, a.css.pause) : ea(a, a.css.playing) }, thwaiting: function () { a.prop.paused || ia(a) } }) }, W = function (a) { var b = function () { a.mouseMoveTimer ? (clearTimeout(a.mouseMoveTimer), a.mouseMoveTimer = null) : ea(a, a.css.mouseMove), a.mouseMoveTimer = setTimeout(function () { fa(a, a.css.mouseMove), a.mouseMoveTimer = null }, a.hideTimeout) }; a.$fake.on({ click: function () { a.togglePlay() }, dblclick: function () { a.toggleFullscreen() } }), a.$wrap.prop("tabindex", 1).on({ mouseenter: function () { ea(a, a.css.mouseOver) }, mouseleave: function () { fa(a, a.css.mouseOver) }, "mousewheel DOMMouseScroll": function (b) { if (a.playlist) { var c = jQuery(b.target), d = thPlaylistControlsByRole("container"); if (c.is(d) || c.parents(d).length) return } b.preventDefault(), b.stopPropagation(), a.volumeChange(b.originalEvent.wheelDelta > 0 || b.originalEvent.detail < 0 ? a.keyBinding.volumeStep : -a.keyBinding.volumeStep) }, click: b, mousemove: b, touchmove: b, touchstart: b, keydown: function (b) { if (null === a.keyBinding.key) { var c = !0; switch (a.keyBinding.key = b.keyCode, a.keyBinding.key) { case 13: a.toggleFullscreen(); break; case 32: a.togglePlay(); break; case 37: a.keyBinding.func = function () { try { a.canSeek() && a.time(a.time() - a.keyBinding.timeStep) } catch (b) { } }; break; case 39: a.keyBinding.func = function () { try { a.canSeek() && a.time(a.time() + a.keyBinding.timeStep) } catch (b) { } }; break; case 38: a.keyBinding.func = function () { a.volumeChange(a.keyBinding.volumeStep) }; break; case 40: a.keyBinding.func = function () { a.volumeChange(-a.keyBinding.volumeStep) }; break; default: c = !1 } c && b.preventDefault(), a.keyBinding.func ? a.keyBinding.clickTimer = setTimeout(function () { a.keyBinding.clickTimer && (clearTimeout(a.keyBinding.clickTimer), a.keyBinding.clickTimer = null), a.keyBinding.moveTimer = setInterval(a.keyBinding.func, 20, 0, !1) }, 150, !1) : a.keyBinding.key = null } }, keyup: function (b) { null !== a.keyBinding.key && a.keyBinding.key === b.keyCode && (a.keyBinding.moveTimer && clearInterval(a.keyBinding.moveTimer), a.keyBinding.clickTimer && (clearTimeout(a.keyBinding.clickTimer), a.keyBinding.func()), a.keyBinding.key = a.keyBinding.func = a.keyBinding.clickTimer = a.keyBinding.moveTimer = null) } }) }, X = function (a) { a.$events.on({ thinit: function (b, c) { c.autoplay ? a.play() : a.load() }, thended: function () { na(a) } }) }, Y = function (a) { jQuery(l).on(o.api.fullscreenchange, function () { if (l[o.api.fullscreenElement] !== a.$wrap[0]) { if (l[o.api.fullscreenElement] && jQuery(l[o.api.fullscreenElement]).parents(a.$wrap).length) return; a.fullscreen(!1), fa(a, a.css.fullscreen), jQuery("html").removeClass(a.css.rootFullscreen), a.prop.fullscreen = !1, a.resize() } else ea(a, a.css.fullscreen), jQuery("html").addClass(a.css.rootFullscreen), a.prop.fullscreen = !0, a.resize() }).on(o.api.fullscreenerror, function () { l[o.api.fullscreenElement] === a.$wrap[0] && (fa(a, a.css.fullscreen), jQuery("html").removeClass(a.css.rootFullscreen), a.prop.fullscreen = !1, a.resize()) }), jQuery(window).on("resize", function () { a.resize() }), V(a) }, Z = { _playlist: function (a, b) { var c = null; return jQuery.each(a.items, function (a, d) { return J.inArray(d, "playlist", b) ? (c = d, !1) : void 0 }), c }, _loop: function (a) { if (!a.sorted.length) return null; for (var b = a.current.collection ? jQuery.inArray(a.current.collection.id, a.sorted) : -1; a.sorted.length > 0;) { if (b = b + 1 >= a.sorted.length ? 0 : b + 1, a.items[a.sorted[b]]) return a.items[a.sorted[b]]; a.sorted.splice(b, 1) } return null }, _first: function (a) { for (; a.sorted.length;) { if (a.items[a.sorted[0]]) return a.items[a.sorted[0]]; a.sorted.shift() } return null }, _last: function (a) { for (; a.sorted.length;) { if (a.items[a.sorted[a.sorted.length - 1]]) return a.items[a.sorted[a.sorted.length - 1]]; a.sorted.pop() } return null }, _next: function (a) { if (!a.sorted.length) return null; var b = a.current.collection ? jQuery.inArray(a.current.collection.id, a.sorted) : 0; if (-1 === b) return null; for (; a.sorted.length;) { if (b = b + 1 >= a.sorted.length ? b : b + 1, !a.sorted[b]) return null; if (a.items[a.sorted[b]]) return a.items[a.sorted[b]]; a.sorted.splice(b, 1) } return null }, _previous: function (a) { if (!a.sorted.length) return null; var b = a.current.collection ? jQuery.inArray(a.current.collection.id, a.sorted) : 0; if (-1 === b) return null; for (; a.sorted.length;) { if (b = -1 >= b - 1 ? b : b - 1, !a.sorted[b]) return null; if (a.items[a.sorted[b]]) return a.items[a.sorted[b]]; a.sorted.splice(b, 1) } return null } }, $ = { "default": function (a) { a.sorted = [], jQuery.each(a.items, function (b, c) { c.excluded || a.sorted.push(b) }) }, "in": function (a, b) { b = jQuery.isArray(b) ? b : [b], a.sorted = [], jQuery.each(b, function (b, c) { a.items[c] && a.sorted.push(c) }) } }, _ = {}, aa = {}, ba = { skin: "PanelIconsSilver", autoplay: !1, muted: !1, time: 0, volume: 1, logoSrc: !1, logoTitle: !1, logoLink: !1, showPreview: !1, playlist: !0, textTrackList: !0, adverts: !0, texts: { skipAdvert: "Skip advert" } }, ca = function (a, b) { return x(a.current.kind, b, Array.prototype.slice.call(arguments, 2)) }, da = function (a) { return r("player-" + a) }, ea = function (a) { a.controls.$wrap && a.controls.$wrap.addClass(Array.prototype.slice.call(arguments, 1).join(" ")) }, fa = function (a) { a.controls.$wrap && a.controls.$wrap.removeClass(Array.prototype.slice.call(arguments, 1).join(" ")) }, ga = function (a) { a.pause(), a.time(0) }, ha = function (a, b) { a.$events.trigger("thplaystart"), a.canPlay() && (a.prop.paused = !1, u(b) && a.time(b), setTimeout(function () { ca(a, "play") }, 100)) }, ia = function (a) { !a.prop.loading && n && (a.prop.loading = !0, a.loader && a.loader.start(), ea(a, a.css.loading)) }, ja = function (a) { n && (a.prop.loading = !1, fa(a, a.css.loading), a.loader && a.loader.stop()) }, ka = function (a) { a.prop.showPreview && a.sourcesCollection && (a.prop.played ? fa(a, a.css.showPreview) : ea(a, a.css.showPreview)) }, la = function (a) { if (a.$preview && a.sourcesCollection) { var b = a.$preview.is("img") ? a.$preview : a.$preview.find("img"), c = !0, d = a.sourcesCollection.preview; b.length ? d === b.first().attr("src") ? c = !1 : b = jQuery("").appendTo(a.$preview.empty()) : b = jQuery("").appendTo(a.$preview), c && b.attr({ src: d }).hide().off(".thPreview").on("load.thPreview", function () { jQuery(this).show() }), ka(a) } }, ma = function (a) { if (a.$logo && t(a.logo.src)) { var b = a.$logo.is("img") ? a.$logo : jQuery(""), c = t(a.logo.title) ? a.logo.title : ""; b.attr({ src: a.logo.src, title: c, alt: c }), t(a.logo.link) ? b.wrap("").parent().attr({ href: a.logo.link, target: "_blank" }).click(function (b) { b.stopPropagation(), a.pause() }).appendTo(a.$logo.empty()) : b.appendTo(a.$logo.empty()) } }, na = function (a) { ja(a), a.prop.paused = !0, ea(a, a.css.pause), fa(a, a.css.playing) }, oa = function (a) { ca(a, "clean"), ca(a, "detach"), ca(a, "off", ".thsetsource"), a.current.source = null, a.current.kind = null, a.$events.trigger("thclean") }, pa = function (a, b) { var c = da("wrap"); b.is("video") ? b.parents(c).length ? a.$wrap = b.parents(c).first() : (b.wrap(""), a.$wrap = b.parent()) : a.$wrap = b.is(c) ? b : jQuery("").appendTo(b), a.$events = jQuery("