/* * jQuery Easing v1.3 - http://gsgd.co.uk/sandbox/jquery/easing/ * * Uses the built in easing capabilities added In jQuery 1.1 * to offer multiple easing options * * TERMS OF USE - jQuery Easing * * Open source under the BSD License. * * Copyright © 2008 George McGinley Smith * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ // t: current time, b: begInnIng value, c: change In value, d: duration jQuery.easing['jswing'] = jQuery.easing['swing']; jQuery.extend(jQuery.easing, { def: 'easeOutQuad', swing: function(x, t, b, c, d) { //alert(jQuery.easing.default); return jQuery.easing[jQuery.easing.def](x, t, b, c, d); }, easeInQuad: function(x, t, b, c, d) { return c * (t /= d) * t + b; }, easeOutQuad: function(x, t, b, c, d) { return -c * (t /= d) * (t - 2) + b; }, easeInOutQuad: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t + b; return -c / 2 * ((--t) * (t - 2) - 1) + b; }, easeInCubic: function(x, t, b, c, d) { return c * (t /= d) * t * t + b; }, easeOutCubic: function(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t + 1) + b; }, easeInOutCubic: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t + b; return c / 2 * ((t -= 2) * t * t + 2) + b; }, easeInQuart: function(x, t, b, c, d) { return c * (t /= d) * t * t * t + b; }, easeOutQuart: function(x, t, b, c, d) { return -c * ((t = t / d - 1) * t * t * t - 1) + b; }, easeInOutQuart: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t + b; return -c / 2 * ((t -= 2) * t * t * t - 2) + b; }, easeInQuint: function(x, t, b, c, d) { return c * (t /= d) * t * t * t * t + b; }, easeOutQuint: function(x, t, b, c, d) { return c * ((t = t / d - 1) * t * t * t * t + 1) + b; }, easeInOutQuint: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return c / 2 * t * t * t * t * t + b; return c / 2 * ((t -= 2) * t * t * t * t + 2) + b; }, easeInSine: function(x, t, b, c, d) { return -c * Math.cos(t / d * (Math.PI / 2)) + c + b; }, easeOutSine: function(x, t, b, c, d) { return c * Math.sin(t / d * (Math.PI / 2)) + b; }, easeInOutSine: function(x, t, b, c, d) { return -c / 2 * (Math.cos(Math.PI * t / d) - 1) + b; }, easeInExpo: function(x, t, b, c, d) { return (t == 0) ? b : c * Math.pow(2, 10 * (t / d - 1)) + b; }, easeOutExpo: function(x, t, b, c, d) { return (t == d) ? b + c : c * (-Math.pow(2, -10 * t / d) + 1) + b; }, easeInOutExpo: function(x, t, b, c, d) { if (t == 0) return b; if (t == d) return b + c; if ((t /= d / 2) < 1) return c / 2 * Math.pow(2, 10 * (t - 1)) + b; return c / 2 * (-Math.pow(2, -10 * --t) + 2) + b; }, easeInCirc: function(x, t, b, c, d) { return -c * (Math.sqrt(1 - (t /= d) * t) - 1) + b; }, easeOutCirc: function(x, t, b, c, d) { return c * Math.sqrt(1 - (t = t / d - 1) * t) + b; }, easeInOutCirc: function(x, t, b, c, d) { if ((t /= d / 2) < 1) return -c / 2 * (Math.sqrt(1 - t * t) - 1) + b; return c / 2 * (Math.sqrt(1 - (t -= 2) * t) + 1) + b; }, easeInElastic: function(x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; }, easeOutElastic: function(x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d) == 1) return b + c; if (!p) p = d * .3; if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; }, easeInOutElastic: function(x, t, b, c, d) { var s = 1.70158; var p = 0; var a = c; if (t == 0) return b; if ((t /= d / 2) == 2) return b + c; if (!p) p = d * (.3 * 1.5); if (a < Math.abs(c)) { a = c; var s = p / 4; } else var s = p / (2 * Math.PI) * Math.asin(c / a); if (t < 1) return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; }, easeInBack: function(x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * (t /= d) * t * ((s + 1) * t - s) + b; }, easeOutBack: function(x, t, b, c, d, s) { if (s == undefined) s = 1.70158; return c * ((t = t / d - 1) * t * ((s + 1) * t + s) + 1) + b; }, easeInOutBack: function(x, t, b, c, d, s) { if (s == undefined) s = 1.70158; if ((t /= d / 2) < 1) return c / 2 * (t * t * (((s *= (1.525)) + 1) * t - s)) + b; return c / 2 * ((t -= 2) * t * (((s *= (1.525)) + 1) * t + s) + 2) + b; }, easeInBounce: function(x, t, b, c, d) { return c - jQuery.easing.easeOutBounce(x, d - t, 0, c, d) + b; }, easeOutBounce: function(x, t, b, c, d) { if ((t /= d) < (1 / 2.75)) { return c * (7.5625 * t * t) + b; } else if (t < (2 / 2.75)) { return c * (7.5625 * (t -= (1.5 / 2.75)) * t + .75) + b; } else if (t < (2.5 / 2.75)) { return c * (7.5625 * (t -= (2.25 / 2.75)) * t + .9375) + b; } else { return c * (7.5625 * (t -= (2.625 / 2.75)) * t + .984375) + b; } }, easeInOutBounce: function(x, t, b, c, d) { if (t < d / 2) return jQuery.easing.easeInBounce(x, t * 2, 0, c, d) * .5 + b; return jQuery.easing.easeOutBounce(x, t * 2 - d, 0, c, d) * .5 + c * .5 + b; } }); /* * * TERMS OF USE - EASING EQUATIONS * * Open source under the BSD License. * * Copyright © 2001 Robert Penner * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * Redistributions of source code must retain the above copyright notice, this list of * conditions and the following disclaimer. * Redistributions in binary form must reproduce the above copyright notice, this list * of conditions and the following disclaimer in the documentation and/or other materials * provided with the distribution. * * Neither the name of the author nor the names of contributors may be used to endorse * or promote products derived from this software without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED * OF THE POSSIBILITY OF SUCH DAMAGE. * */ /*! * FitVids 1.1 * * Copyright 2013, Chris Coyier - http://css-tricks.com + Dave Rupert - http://daverupert.com * Credit to Thierry Koblentz - http://www.alistapart.com/articles/creating-intrinsic-ratios-for-video/ * Released under the WTFPL license - http://sam.zoy.org/wtfpl/ * */ ! function(t) { "use strict"; t.fn.fitVids = function(e) { var i = { customSelector: null, ignore: null }; if (!document.getElementById("fit-vids-style")) { var r = document.head || document.getElementsByTagName("head")[0], a = ".fluid-width-video-wrapper{width:100%;position:relative;padding:0;}.fluid-width-video-wrapper iframe,.fluid-width-video-wrapper object,.fluid-width-video-wrapper embed {position:absolute;top:0;left:0;width:100%;height:100%;}", d = document.createElement("div"); d.innerHTML = '
x
", r.appendChild(d.childNodes[1]) } return e && t.extend(i, e), this.each(function() { var e = ['iframe[src*="player.vimeo.com"]', 'iframe[src*="youtube.com"]', 'iframe[src*="youtube-nocookie.com"]', 'iframe[src*="kickstarter.com"][src*="video.html"]', "object", "embed"]; i.customSelector && e.push(i.customSelector); var r = ".fitvidsignore"; i.ignore && (r = r + ", " + i.ignore); var a = t(this).find(e.join(",")); a = a.not("object object"), a = a.not(r), a.each(function(e) { var i = t(this); if (!(i.parents(r).length > 0 || "embed" === this.tagName.toLowerCase() && i.parent("object").length || i.parent(".fluid-width-video-wrapper").length)) { i.css("height") || i.css("width") || !isNaN(i.attr("height")) && !isNaN(i.attr("width")) || (i.attr("height", 9), i.attr("width", 16)); var a = "object" === this.tagName.toLowerCase() || i.attr("height") && !isNaN(parseInt(i.attr("height"), 10)) ? parseInt(i.attr("height"), 10) : i.height(), d = isNaN(parseInt(i.attr("width"), 10)) ? i.width() : parseInt(i.attr("width"), 10), o = a / d; if (!i.attr("id")) { var h = "fitvid" + e; i.attr("id", h) } i.wrap('').parent(".fluid-width-video-wrapper").css("padding-top", 100 * o + "%"), i.removeAttr("height").removeAttr("width") } }) }) } }(window.jQuery || window.Zepto); /* * jQuery Superfish Menu Plugin - v1.7.8 * Copyright (c) 2016 * * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html */ ; ! function(a, b) { "use strict"; var c = function() { var c = { bcClass: "sf-breadcrumb", menuClass: "sf-js-enabled", anchorClass: "sf-with-ul", menuArrowClass: "sf-arrows" }, d = function() { var b = /^(?![\w\W]*Windows Phone)[\w\W]*(iPhone|iPad|iPod)/i.test(navigator.userAgent); return b && a("html").css("cursor", "pointer").on("click", a.noop), b }(), e = function() { var a = document.documentElement.style; return "behavior" in a && "fill" in a && /iemobile/i.test(navigator.userAgent) }(), f = function() { return !!b.PointerEvent }(), g = function(a, b) { var d = c.menuClass; b.cssArrows && (d += " " + c.menuArrowClass), a.toggleClass(d) }, h = function(b, d) { return b.find("li." + d.pathClass).slice(0, d.pathLevels).addClass(d.hoverClass + " " + c.bcClass).filter(function() { return a(this).children(d.popUpSelector).hide().show().length }).removeClass(d.pathClass) }, i = function(a) { a.children("a").toggleClass(c.anchorClass) }, j = function(a) { var b = a.css("ms-touch-action"), c = a.css("touch-action"); c = c || b, c = "pan-y" === c ? "auto" : "pan-y", a.css({ "ms-touch-action": c, "touch-action": c }) }, k = function(a) { return a.closest("." + c.menuClass) }, l = function(a) { return k(a).data("sf-options") }, m = function() { var b = a(this), c = l(b); clearTimeout(c.sfTimer), b.siblings().superfish("hide").end().superfish("show") }, n = function(b) { b.retainPath = a.inArray(this[0], b.$path) > -1, this.superfish("hide"), this.parents("." + b.hoverClass).length || (b.onIdle.call(k(this)), b.$path.length && a.proxy(m, b.$path)()) }, o = function() { var b = a(this), c = l(b); d ? a.proxy(n, b, c)() : (clearTimeout(c.sfTimer), c.sfTimer = setTimeout(a.proxy(n, b, c), c.delay)) }, p = function(b) { var c = a(this), d = l(c), e = c.siblings(b.data.popUpSelector); return d.onHandleTouch.call(e) === !1 ? this : void(e.length > 0 && e.is(":hidden") && (c.one("click.superfish", !1), "MSPointerDown" === b.type || "pointerdown" === b.type ? c.trigger("focus") : a.proxy(m, c.parent("li"))())) }, q = function(b, c) { var g = "li:has(" + c.popUpSelector + ")"; a.fn.hoverIntent && !c.disableHI ? b.hoverIntent(m, o, g) : b.on("mouseenter.superfish", g, m).on("mouseleave.superfish", g, o); var h = "MSPointerDown.superfish"; f && (h = "pointerdown.superfish"), d || (h += " touchend.superfish"), e && (h += " mousedown.superfish"), b.on("focusin.superfish", "li", m).on("focusout.superfish", "li", o).on(h, "a", c, p) }; return { hide: function(b) { if (this.length) { var c = this, d = l(c); if (!d) return this; var e = d.retainPath === !0 ? d.$path : "", f = c.find("li." + d.hoverClass).add(this).not(e).removeClass(d.hoverClass).children(d.popUpSelector), g = d.speedOut; if (b && (f.show(), g = 0), d.retainPath = !1, d.onBeforeHide.call(f) === !1) return this; f.stop(!0, !0).animate(d.animationOut, g, function() { var b = a(this); d.onHide.call(b) }) } return this }, show: function() { var a = l(this); if (!a) return this; var b = this.addClass(a.hoverClass), c = b.children(a.popUpSelector); return a.onBeforeShow.call(c) === !1 ? this : (c.stop(!0, !0).animate(a.animation, a.speed, function() { a.onShow.call(c) }), this) }, destroy: function() { return this.each(function() { var b, d = a(this), e = d.data("sf-options"); return e ? (b = d.find(e.popUpSelector).parent("li"), clearTimeout(e.sfTimer), g(d, e), i(b), j(d), d.off(".superfish").off(".hoverIntent"), b.children(e.popUpSelector).attr("style", function(a, b) { return b.replace(/display[^;]+;?/g, "") }), e.$path.removeClass(e.hoverClass + " " + c.bcClass).addClass(e.pathClass), d.find("." + e.hoverClass).removeClass(e.hoverClass), e.onDestroy.call(d), void d.removeData("sf-options")) : !1 }) }, init: function(b) { return this.each(function() { var d = a(this); if (d.data("sf-options")) return !1; var e = a.extend({}, a.fn.superfish.defaults, b), f = d.find(e.popUpSelector).parent("li"); e.$path = h(d, e), d.data("sf-options", e), g(d, e), i(f), j(d), q(d, e), f.not("." + c.bcClass).superfish("hide", !0), e.onInit.call(this) }) } } }(); a.fn.superfish = function(b, d) { return c[b] ? c[b].apply(this, Array.prototype.slice.call(arguments, 1)) : "object" != typeof b && b ? a.error("Method " + b + " does not exist on jQuery.fn.superfish") : c.init.apply(this, arguments) }, a.fn.superfish.defaults = { popUpSelector: "ul,.sf-mega", hoverClass: "sfHover", pathClass: "overrideThisToUse", pathLevels: 1, delay: 800, animation: { opacity: "show" }, animationOut: { opacity: "hide" }, speed: "normal", speedOut: "fast", cssArrows: !0, disableHI: !1, onInit: a.noop, onBeforeShow: a.noop, onShow: a.noop, onBeforeHide: a.noop, onHide: a.noop, onIdle: a.noop, onDestroy: a.noop, onHandleTouch: a.noop } }(jQuery, window); (function($) { $.fn.hoverIntent = function(handlerIn, handlerOut, selector) { // default configuration values var cfg = { interval: 100, sensitivity: 7, timeout: 0 }; if (typeof handlerIn === "object") { cfg = $.extend(cfg, handlerIn); } else if ($.isFunction(handlerOut)) { cfg = $.extend(cfg, { over: handlerIn, out: handlerOut, selector: selector }); } else { cfg = $.extend(cfg, { over: handlerIn, out: handlerIn, selector: handlerOut }); } // instantiate variables // cX, cY = current X and Y position of mouse, updated by mousemove event // pX, pY = previous X and Y position of mouse, set by mouseover and polling interval var cX, cY, pX, pY; // A private function for getting mouse position var track = function(ev) { cX = ev.pageX; cY = ev.pageY; }; // A private function for comparing current and previous mouse position var compare = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); // compare mouse positions to see if they've crossed the threshold if ((Math.abs(pX - cX) + Math.abs(pY - cY)) < cfg.sensitivity) { $(ob).off("mousemove.hoverIntent", track); // set hoverIntent state to true (so mouseOut can be called) ob.hoverIntent_s = 1; return cfg.over.apply(ob, [ev]); } else { // set previous coordinates for next time pX = cX; pY = cY; // use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs) ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } }; // A private function for delaying the mouseOut function var delay = function(ev, ob) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); ob.hoverIntent_s = 0; return cfg.out.apply(ob, [ev]); }; // A private function for handling mouse 'hovering' var handleHover = function(e) { // copy objects to be passed into t (required for event object to be passed in IE) var ev = jQuery.extend({}, e); var ob = this; // cancel hoverIntent timer if it exists if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); } // if e.type == "mouseenter" if (e.type == "mouseenter") { // set "previous" X and Y position based on initial entry point pX = ev.pageX; pY = ev.pageY; // update "current" X and Y position based on mousemove $(ob).on("mousemove.hoverIntent", track); // start polling interval (self-calling timeout) to compare mouse coordinates over time if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout(function() { compare(ev, ob); }, cfg.interval); } // else e.type == "mouseleave" } else { // unbind expensive mousemove event $(ob).off("mousemove.hoverIntent", track); // if hoverIntent state is true, then call the mouseOut function after the specified delay if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout(function() { delay(ev, ob); }, cfg.timeout); } } }; // listen for mouseenter and mouseleave return this.on({ 'mouseenter.hoverIntent': handleHover, 'mouseleave.hoverIntent': handleHover }, cfg.selector); }; })(jQuery); /** * * Twitter Feed Fetcher * */ function sm_format_twitter(twitters) { var statusHTML = []; for (var i = 0; i < twitters.length; i++) { var username = twitters[i].user.screen_name; var name = twitters[i].user.name; var username_avatar = twitters[i].user.profile_image_url; var status = twitters[i].text.replace(/((https?|s?ftp|ssh)\:\/\/[^"\s\<\>]*[^.,;'">\:\s\<\>\)\]\!])/g, function(url) { return '' + url + ''; }).replace(/\B@([_a-z0-9]+)/ig, function(reply) { return reply.charAt(0) + '' + reply.substring(1) + ''; }); statusHTML.push('(.*?)<\/p>/g; var input = item.description; if (regex.test(input)) { item.description = input.match(regex)[2] if (item.description != undefined) item.description = item.description.replace('
', '').replace('
', ''); } } item['image_s'] = item.media.m.replace('_m', '_s'); item['image_t'] = item.media.m.replace('_m', '_t'); item['image_m'] = item.media.m.replace('_m', '_m'); item['image'] = item.media.m.replace('_m', ''); item['image_b'] = item.media.m.replace('_m', '_b'); delete item.media; if (settings.useTemplate) { var template = settings.itemTemplate; for (var key in item) { var rgx = new RegExp('{{' + key + '}}', 'g'); template = template.replace(rgx, item[key]); } $container.append(template) } settings.itemCallback.call(container, item); } }); if ($.isFunction(callback)) { callback.call(container, data); } }); }); } })(jQuery); /*! * Instafeed 1.4.1 */ (function() { var e; e = function() { function e(e, t) { var n, r; this.options = { target: "instafeed", get: "popular", resolution: "thumbnail", sortBy: "none", links: !0, mock: !1, useHttp: !1 }; if (typeof e == "object") for (n in e) r = e[n], this.options[n] = r; this.context = t != null ? t : this, this.unique = this._genKey() } return e.prototype.hasNext = function() { return typeof this.context.nextUrl == "string" && this.context.nextUrl.length > 0 }, e.prototype.next = function() { return this.hasNext() ? this.run(this.context.nextUrl) : !1 }, e.prototype.run = function(t) { var n, r, i; if (typeof this.options.clientId != "string" && typeof this.options.accessToken != "string") throw new Error("Missing clientId or accessToken."); if (typeof this.options.accessToken != "string" && typeof this.options.clientId != "string") throw new Error("Missing clientId or accessToken."); return this.options.before != null && typeof this.options.before == "function" && this.options.before.call(this), typeof document != "undefined" && document !== null && (i = document.createElement("script"), i.id = "instafeed-fetcher", i.src = t || this._buildUrl(), n = document.getElementsByTagName("head"), n[0].appendChild(i), r = "instafeedCache" + this.unique, window[r] = new e(this.options, this), window[r].unique = this.unique), !0 }, e.prototype.parse = function(e) { var t, n, r, i, s, o, u, a, f, l, c, h, p, d, v, m, g, y, b, w, E, S, x, T, N, C, k, L, A, O, M, _, D; if (typeof e != "object") { if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, "Invalid JSON data"), !1; throw new Error("Invalid JSON response") } if (e.meta.code !== 200) { if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, e.meta.error_message), !1; throw new Error("Error from Instagram: " + e.meta.error_message) } if (e.data.length === 0) { if (this.options.error != null && typeof this.options.error == "function") return this.options.error.call(this, "No images were returned from Instagram"), !1; throw new Error("No images were returned from Instagram") } this.options.success != null && typeof this.options.success == "function" && this.options.success.call(this, e), this.context.nextUrl = "", e.pagination != null && (this.context.nextUrl = e.pagination.next_url); if (this.options.sortBy !== "none") { this.options.sortBy === "random" ? M = ["", "random"] : M = this.options.sortBy.split("-"), O = M[0] === "least" ? !0 : !1; switch (M[1]) { case "random": e.data.sort(function() { return .5 - Math.random() }); break; case "recent": e.data = this._sortBy(e.data, "created_time", O); break; case "liked": e.data = this._sortBy(e.data, "likes.count", O); break; case "commented": e.data = this._sortBy(e.data, "comments.count", O); break; default: throw new Error("Invalid option for sortBy: '" + this.options.sortBy + "'.") } } if (typeof document != "undefined" && document !== null && this.options.mock === !1) { m = e.data, A = parseInt(this.options.limit, 10), this.options.limit != null && m.length > A && (m = m.slice(0, A)), u = document.createDocumentFragment(), this.options.filter != null && typeof this.options.filter == "function" && (m = this._filter(m, this.options.filter)); if (this.options.template != null && typeof this.options.template == "string") { f = "", d = "", w = "", D = document.createElement("div"); for (c = 0, N = m.length; c < N; c++) { h = m[c], p = h.images[this.options.resolution]; if (typeof p != "object") throw o = "No image found for resolution: " + this.options.resolution + ".", new Error(o); E = p.width, y = p.height, b = "square", E > y && (b = "landscape"), E < y && (b = "portrait"), v = p.url, l = window.location.protocol.indexOf("http") >= 0, l && !this.options.useHttp && (v = v.replace(/https?:\/\//, "//")), d = this._makeTemplate(this.options.template, { model: h, id: h.id, link: h.link, type: h.type, image: v, width: E, height: y, orientation: b, caption: this._getObjectProperty(h, "caption.text"), likes: h.likes.count, comments: h.comments.count, location: this._getObjectProperty(h, "location.name") }), f += d } D.innerHTML = f, i = [], r = 0, n = D.childNodes.length; while (r < n) i.push(D.childNodes[r]), r += 1; for (x = 0, C = i.length; x < C; x++) L = i[x], u.appendChild(L) } else for (T = 0, k = m.length; T < k; T++) { h = m[T], g = document.createElement("img"), p = h.images[this.options.resolution]; if (typeof p != "object") throw o = "No image found for resolution: " + this.options.resolution + ".", new Error(o); v = p.url, l = window.location.protocol.indexOf("http") >= 0, l && !this.options.useHttp && (v = v.replace(/https?:\/\//, "//")), g.src = v, this.options.links === !0 ? (t = document.createElement("a"), t.href = h.link, t.appendChild(g), u.appendChild(t)) : u.appendChild(g) } _ = this.options.target, typeof _ == "string" && (_ = document.getElementById(_)); if (_ == null) throw o = 'No element with id="' + this.options.target + '" on page.', new Error(o); _.appendChild(u), a = document.getElementsByTagName("head")[0], a.removeChild(document.getElementById("instafeed-fetcher")), S = "instafeedCache" + this.unique, window[S] = void 0; try { delete window[S] } catch (P) { s = P } } return this.options.after != null && typeof this.options.after == "function" && this.options.after.call(this), !0 }, e.prototype._buildUrl = function() { var e, t, n; e = "https://api.instagram.com/v1"; switch (this.options.get) { case "popular": t = "media/popular"; break; case "tagged": if (!this.options.tagName) throw new Error("No tag name specified. Use the 'tagName' option."); t = "tags/" + this.options.tagName + "/media/recent"; break; case "location": if (!this.options.locationId) throw new Error("No location specified. Use the 'locationId' option."); t = "locations/" + this.options.locationId + "/media/recent"; break; case "user": if (!this.options.userId) throw new Error("No user specified. Use the 'userId' option."); t = "users/" + this.options.userId + "/media/recent"; break; default: throw new Error("Invalid option for get: '" + this.options.get + "'.") } return n = e + "/" + t, this.options.accessToken != null ? n += "?access_token=" + this.options.accessToken : n += "?client_id=" + this.options.clientId, this.options.limit != null && (n += "&count=" + this.options.limit), n += "&callback=instafeedCache" + this.unique + ".parse", n }, e.prototype._genKey = function() { var e; return e = function() { return ((1 + Math.random()) * 65536 | 0).toString(16).substring(1) }, "" + e() + e() + e() + e() }, e.prototype._makeTemplate = function(e, t) { var n, r, i, s, o; r = /(?:\{{2})([\w\[\]\.]+)(?:\}{2})/, n = e; while (r.test(n)) s = n.match(r)[1], o = (i = this._getObjectProperty(t, s)) != null ? i : "", n = n.replace(r, function() { return "" + o }); return n }, e.prototype._getObjectProperty = function(e, t) { var n, r; t = t.replace(/\[(\w+)\]/g, ".$1"), r = t.split("."); while (r.length) { n = r.shift(); if (!(e != null && n in e)) return null; e = e[n] } return e }, e.prototype._sortBy = function(e, t, n) { var r; return r = function(e, r) { var i, s; return i = this._getObjectProperty(e, t), s = this._getObjectProperty(r, t), n ? i > s ? 1 : -1 : i < s ? 1 : -1 }, e.sort(r.bind(this)), e }, e.prototype._filter = function(e, t) { var n, r, i, s, o; n = [], r = function(e) { if (t(e)) return n.push(e) }; for (i = 0, o = e.length; i < o; i++) s = e[i], r(s); return n }, e }(), function(e, t) { return typeof define == "function" && define.amd ? define([], t) : typeof module == "object" && module.exports ? module.exports = t() : e.Instafeed = t() }(this, function() { return e }) }).call(this); /** * @preserve * Jribbble v2.0.4 | Thu Jun 4 01:49:29 2015 -0400 * Copyright (c) 2015, Tyler Gaw me@tylergaw.com * Released under the ISC-LICENSE */ ! function(e, t, r, s) { "use strict"; e.jribbble = {}; var n = null, o = "https://api.dribbble.com/v1", i = ["animated", "attachments", "debuts", "playoffs", "rebounds", "teams"], u = { token: "Jribbble: Missing Dribbble access token. Set one with $.jribbble.accessToken = YOUR_ACCESS_TOKEN. If you do not have an access token, you must register a new application at https://dribbble.com/account/applications/new", singular: function(e) { return e.substr(0, e.length - 1) }, idRequired: function(e) { return "Jribbble: You have to provide a " + this.singular(e) + ' ID. ex: $.jribbble.%@("1234").'.replace(/%@/g, e) }, subResource: function(e) { return "Jribbble: You have to provide a " + this.singular(e) + ' ID to get %@. ex: $.jribbble.%@("1234").%@()'.replace(/%@/g, e) }, shotId: function(e) { return "Jribbble: You have to provide a shot ID to get %@. ex: " + ' $.jribbble.shots("1234").%@()'.replace(/%@/g, e) }, commentLikes: 'Jribbble: You have to provide a comment ID to get likes. ex: $.jribbble.shots("1234").comments("456").likes()' }, c = function(e, t) { if (e && "object" != typeof e) return e; throw new Error(u.idRequired(t)) }, l = function(e) { var t = {}; return e.forEach(function(e) { t[e] = d.call(this, e) }.bind(this)), t }, h = function(t) { var r = e.param(t); return r ? "?" + r : "" }, a = function(e) { if (0 !== e.length) { var t = e[0], r = typeof t, s = {}; if ("number" === r || "string" === r) { var n = i.indexOf(t); n > -1 ? s.list = t : s.resource = t } else "object" === r && (s = t); return s } }, b = function() { var t = e.extend({}, e.Deferred()), r = function() { return this.methods = [], this.response = null, this.flushed = !1, this.add = function(e) { this.flushed ? e(this.scope) : this.methods.push(e) }, this.flush = function(e) { if (!this.flushed) { for (this.scope = e, this.flushed = !0; this.methods[0];) this.methods.shift()(e); return e } }, this }; return t.queue = new r, t.url = o, t.get = function() { return n ? (e.ajax({ type: "GET", url: this.url, beforeSend: function(e) { e.setRequestHeader("Authorization", "Bearer " + n) }, success: function(e) { this.resolve(e) }.bind(this), error: function(e) { this.reject(e) }.bind(this) }), this) : (console.error(u.token), !1) }, t }, f = function(t) { return function(r) { return e.extend(this, b()), this.queue.add(function(e) { e.url += "/" + t + "/" + r }), setTimeout(function() { this.queue.flush(this).get() }.bind(this)), this } }, d = function(e) { return function(t) { return this.queue.add(function(r) { r.url += "/" + e + "/" + h(t || {}) }), this } }; e.jribbble.shots = function(t, r) { var s = a([].slice.call(arguments)) || {}, n = r || {}, o = function(t) { return function(r, s) { var n = a([].slice.call(arguments)) || {}, o = s || {}; return this.queue.add(function(r) { if (!r.shotId) throw new Error(u.shotId(t)); r.url += "/" + t + "/", n.resource && (r.url += n.resource, delete n.resource), r.url += h(e.extend(n, o)) }), this } }, i = function() { return e.extend(this, b()), this.url += "/shots/", this.queue.add(function(t) { s.resource && (t.shotId = s.resource, t.url += s.resource, delete s.resource), t.url += h(e.extend(s, n)) }), setTimeout(function() { this.queue.flush(this).get() }.bind(this)), this }; return i.prototype.attachments = o("attachments"), i.prototype.buckets = o("buckets"), i.prototype.likes = o("likes"), i.prototype.projects = o("projects"), i.prototype.rebounds = o("rebounds"), i.prototype.comments = function(t, r) { var s = a([].slice.call(arguments)) || {}, n = r || {}; return this.queue.add(function(t) { if (!t.shotId) throw new Error(u.shotId("comments")); t.url += "/comments/", s.resource && (t.commentId = s.resource, t.url += s.resource + "/", delete s.resource), t.url += h(e.extend(s, n)) }), this.likes = function(e) { var t = e || {}; return this.queue.add(function(e) { if (!e.commentId) throw new Error(u.commentLikes); e.url += "likes/" + h(t) }), this }, this }, new i }, e.jribbble.teams = function(e) { var t = "teams", r = c(e, t), s = f.call(this, t); return s.prototype = l.call(this, ["members", "shots"]), new s(r) }, e.jribbble.users = function(e) { var t = "users", r = c(e, t), s = f.call(this, t); return s.prototype = l.call(this, ["buckets", "followers", "following", "likes", "projects", "shots", "teams"]), s.prototype.isFollowing = function(e) { return this.queue.add(function(t) { t.url += "/following/" + e }), this }, new s(r) }, e.jribbble.buckets = function(e) { var t = "buckets", r = c(e, t), s = f.call(this, t); return s.prototype = l.call(this, ["shots"]), new s(r) }, e.jribbble.projects = function(e) { var t = "projects", r = c(e, t), s = f.call(this, t); return s.prototype = l.call(this, ["shots"]), new s(r) }, e.jribbble.setToken = function(e) { return n = e, this } }(jQuery, window, document); /*jquery.mb.YTPlayer 05-02-2016 _ jquery.mb.components _ email: matteo@open-lab.com _ Copyright (c) 2001-2016. Matteo Bicocchi (Pupunzi); _ blog: http://pupunzi.open-lab.com _ Open Lab s.r.l., Florence - Italy */ function onYouTubeIframeAPIReady() { ytp.YTAPIReady || (ytp.YTAPIReady = !0, jQuery(document).trigger("YTAPIReady")) } function uncamel(a) { return a.replace(/([A-Z])/g, function(a) { return "-" + a.toLowerCase() }) } function setUnit(a, b) { return "string" != typeof a || a.match(/^[\-0-9\.]+jQuery/) ? "" + a + b : a } function setFilter(a, b, c) { var d = uncamel(b), e = jQuery.browser.mozilla ? "" : jQuery.CSS.sfx; a[e + "filter"] = a[e + "filter"] || "", c = setUnit(c > jQuery.CSS.filters[b].max ? jQuery.CSS.filters[b].max : c, jQuery.CSS.filters[b].unit), a[e + "filter"] += d + "(" + c + ") ", delete a[b] } var ytp = ytp || {}, getYTPVideoID = function(a) { var b, c; return a.indexOf("youtu.be") > 0 ? (b = a.substr(a.lastIndexOf("/") + 1, a.length), c = b.indexOf("?list=") > 0 ? b.substr(b.lastIndexOf("="), b.length) : null, b = c ? b.substr(0, b.lastIndexOf("?")) : b) : a.indexOf("http") > -1 ? (b = a.match(/[\\?&]v=([^]*)/)[1], c = a.indexOf("list=") > 0 ? a.match(/[\\?&]list=([^]*)/)[1] : null) : (b = a.length > 15 ? null : a, c = b ? null : a), { videoID: b, playlistID: c } }; ! function(jQuery, ytp) { jQuery.mbYTPlayer = { name: "jquery.mb.YTPlayer", version: "2.9.12", build: "5815", author: "Matteo Bicocchi", apiKey: "", defaults: { containment: "body", ratio: "auto", videoURL: null, playlistURL: null, startAt: 0, stopAt: 0, autoPlay: !0, vol: 50, addRaster: !1, opacity: 1, quality: "default", mute: !1, loop: !0, showControls: !0, showAnnotations: !1, showYTLogo: !0, stopMovieOnBlur: !0, realfullscreen: !0, gaTrack: !0, optimizeDisplay: !0, onReady: function(a) {} }, controls: { play: "P", pause: "p", mute: "M", unmute: "A", onlyYT: "O", showSite: "R", ytLogo: "Y" }, locationProtocol: "https:", buildPlayer: function(options) { return this.each(function() { var YTPlayer = this, $YTPlayer = jQuery(YTPlayer); YTPlayer.loop = 0, YTPlayer.opt = {}, YTPlayer.state = {}, YTPlayer.filtersEnabled = !0, YTPlayer.filters = { grayscale: { value: 0, unit: "%" }, hue_rotate: { value: 0, unit: "deg" }, invert: { value: 0, unit: "%" }, opacity: { value: 0, unit: "%" }, saturate: { value: 0, unit: "%" }, sepia: { value: 0, unit: "%" }, brightness: { value: 0, unit: "%" }, contrast: { value: 0, unit: "%" }, blur: { value: 0, unit: "px" } }, $YTPlayer.addClass("mb_YTPlayer"); var property = $YTPlayer.data("property") && "string" == typeof $YTPlayer.data("property") ? eval("(" + $YTPlayer.data("property") + ")") : $YTPlayer.data("property"); "undefined" != typeof property && "undefined" != typeof property.vol && (property.vol = 0 === property.vol ? property.vol = 1 : property.vol), jQuery.extend(YTPlayer.opt, jQuery.mbYTPlayer.defaults, options, property), YTPlayer.hasChanged || (YTPlayer.defaultOpt = {}, jQuery.extend(YTPlayer.defaultOpt, jQuery.mbYTPlayer.defaults, options)), "true" == YTPlayer.opt.loop && (YTPlayer.opt.loop = 9999), YTPlayer.isRetina = window.retina || window.devicePixelRatio > 1; var isIframe = function() { var a = !1; try { self.location.href != top.location.href && (a = !0) } catch (b) { a = !0 } return a }; YTPlayer.canGoFullScreen = !(jQuery.browser.msie || jQuery.browser.opera || isIframe()), YTPlayer.canGoFullScreen || (YTPlayer.opt.realfullscreen = !1), $YTPlayer.attr("id") || $YTPlayer.attr("id", "video_" + (new Date).getTime()); var playerID = "mbYTP_" + YTPlayer.id; YTPlayer.isAlone = !1, YTPlayer.hasFocus = !0; var videoID = this.opt.videoURL ? getYTPVideoID(this.opt.videoURL).videoID : $YTPlayer.attr("href") ? getYTPVideoID($YTPlayer.attr("href")).videoID : !1, playlistID = this.opt.videoURL ? getYTPVideoID(this.opt.videoURL).playlistID : $YTPlayer.attr("href") ? getYTPVideoID($YTPlayer.attr("href")).playlistID : !1; YTPlayer.videoID = videoID, YTPlayer.playlistID = playlistID, YTPlayer.opt.showAnnotations = YTPlayer.opt.showAnnotations ? "0" : "3"; var playerVars = { autoplay: 0, modestbranding: 1, controls: 0, showinfo: 0, rel: 0, enablejsapi: 1, version: 3, playerapiid: playerID, origin: "*", allowfullscreen: !0, wmode: "transparent", iv_load_policy: YTPlayer.opt.showAnnotations }; document.createElement("video").canPlayType && jQuery.extend(playerVars, { html5: 1 }), jQuery.browser.msie && jQuery.browser.version < 9 && (this.opt.opacity = 1); var playerBox = jQuery("").attr("id", playerID).addClass("playerBox"), overlay = jQuery("").css({ position: "absolute", top: 0, left: 0, width: "100%", height: "100%" }).addClass("YTPOverlay"); if (YTPlayer.isSelf = "self" == YTPlayer.opt.containment, YTPlayer.defaultOpt.containment = YTPlayer.opt.containment = jQuery("self" == YTPlayer.opt.containment ? this : YTPlayer.opt.containment), YTPlayer.isBackground = "body" == YTPlayer.opt.containment.get(0).tagName.toLowerCase(), !YTPlayer.isBackground || !ytp.backgroundIsInited) { var isPlayer = YTPlayer.opt.containment.is(jQuery(this)); if (YTPlayer.canPlayOnMobile = isPlayer && 0 === jQuery(this).children().length, isPlayer ? YTPlayer.isPlayer = !0 : $YTPlayer.hide(), jQuery.browser.mobile && !YTPlayer.canPlayOnMobile) return void $YTPlayer.remove(); var wrapper = jQuery("").addClass("mbYTP_wrapper").attr("id", "wrapper_" + playerID); if (wrapper.css({ position: "absolute", zIndex: 0, minWidth: "100%", minHeight: "100%", left: 0, top: 0, overflow: "hidden", opacity: 0 }), playerBox.css({ position: "absolute", zIndex: 0, width: "100%", height: "100%", top: 0, left: 0, overflow: "hidden" }), wrapper.append(playerBox), YTPlayer.opt.containment.children().not("script, style").each(function() { "static" == jQuery(this).css("position") && jQuery(this).css("position", "relative") }), YTPlayer.isBackground ? (jQuery("body").css({ boxSizing: "border-box" }), wrapper.css({ position: "fixed", top: 0, left: 0, zIndex: 0 }), $YTPlayer.hide()) : "static" == YTPlayer.opt.containment.css("position") && YTPlayer.opt.containment.css({ position: "relative" }), YTPlayer.opt.containment.prepend(wrapper), YTPlayer.wrapper = wrapper, playerBox.css({ opacity: 1 }), jQuery.browser.mobile || (playerBox.after(overlay), YTPlayer.overlay = overlay), YTPlayer.isBackground || overlay.on("mouseenter", function() { YTPlayer.controlBar && YTPlayer.controlBar.addClass("visible") }).on("mouseleave", function() { YTPlayer.controlBar && YTPlayer.controlBar.removeClass("visible") }), ytp.YTAPIReady) setTimeout(function() { jQuery(document).trigger("YTAPIReady") }, 100); else { jQuery("#YTAPI").remove(); var tag = jQuery("").attr({ src: jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/iframe_api?v=" + jQuery.mbYTPlayer.version, id: "YTAPI" }); jQuery("head").prepend(tag) } jQuery(document).on("YTAPIReady", function() { YTPlayer.isBackground && ytp.backgroundIsInited || YTPlayer.isInit || (YTPlayer.isBackground && (ytp.backgroundIsInited = !0), YTPlayer.opt.autoPlay = "undefined" == typeof YTPlayer.opt.autoPlay ? YTPlayer.isBackground ? !0 : !1 : YTPlayer.opt.autoPlay, YTPlayer.opt.vol = YTPlayer.opt.vol ? YTPlayer.opt.vol : 100, jQuery.mbYTPlayer.getDataFromAPI(YTPlayer), jQuery(YTPlayer).on("YTPChanged", function() { if (!YTPlayer.isInit) { if (YTPlayer.isInit = !0, jQuery.browser.mobile && YTPlayer.canPlayOnMobile) { if (YTPlayer.opt.containment.outerWidth() > jQuery(window).width()) { YTPlayer.opt.containment.css({ maxWidth: "100%" }); var h = .6 * YTPlayer.opt.containment.outerWidth(); YTPlayer.opt.containment.css({ maxHeight: h }) } return void new YT.Player(playerID, { videoId: YTPlayer.videoID.toString(), height: "100%", width: "100%", events: { onReady: function(a) { YTPlayer.player = a.target, playerBox.css({ opacity: 1 }), YTPlayer.wrapper.css({ opacity: 1 }) } } }) } new YT.Player(playerID, { videoId: YTPlayer.videoID.toString(), playerVars: playerVars, events: { onReady: function(a) { YTPlayer.player = a.target, YTPlayer.isReady || (YTPlayer.isReady = YTPlayer.isPlayer && !YTPlayer.opt.autoPlay ? !1 : !0, YTPlayer.playerEl = YTPlayer.player.getIframe(), jQuery(YTPlayer.playerEl).unselectable(), $YTPlayer.optimizeDisplay(), YTPlayer.videoID = videoID, jQuery(window).off("resize.YTP").on("resize.YTP", function() { $YTPlayer.optimizeDisplay() }), jQuery.mbYTPlayer.checkForState(YTPlayer)) }, onStateChange: function(event) { if ("function" == typeof event.target.getPlayerState) { var state = event.target.getPlayerState(); if (YTPlayer.state != state) { if (YTPlayer.preventTrigger) return void(YTPlayer.preventTrigger = !1); YTPlayer.state = state; var eventType; switch (state) { case -1: eventType = "YTPUnstarted"; break; case 0: eventType = "YTPEnd"; break; case 1: eventType = "YTPPlay", YTPlayer.controlBar && YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.pause), "undefined" != typeof _gaq && eval(YTPlayer.opt.gaTrack) && _gaq.push(["_trackEvent", "YTPlayer", "Play", YTPlayer.hasData ? YTPlayer.videoData.title : YTPlayer.videoID.toString()]), "undefined" != typeof ga && eval(YTPlayer.opt.gaTrack) && ga("send", "event", "YTPlayer", "play", YTPlayer.hasData ? YTPlayer.videoData.title : YTPlayer.videoID.toString()); break; case 2: eventType = "YTPPause", YTPlayer.controlBar && YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); break; case 3: YTPlayer.player.setPlaybackQuality(YTPlayer.opt.quality), eventType = "YTPBuffering", YTPlayer.controlBar && YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); break; case 5: eventType = "YTPCued" } var YTPEvent = jQuery.Event(eventType); YTPEvent.time = YTPlayer.player.time, YTPlayer.canTrigger && jQuery(YTPlayer).trigger(YTPEvent) } } }, onPlaybackQualityChange: function(a) { var b = a.target.getPlaybackQuality(), c = jQuery.Event("YTPQualityChange"); c.quality = b, jQuery(YTPlayer).trigger(c) }, onError: function(a) { 150 == a.data && (console.log("Embedding this video is restricted by Youtube."), YTPlayer.isPlayList && jQuery(YTPlayer).playNext()), 2 == a.data && YTPlayer.isPlayList && jQuery(YTPlayer).playNext(), "function" == typeof YTPlayer.opt.onError && YTPlayer.opt.onError($YTPlayer, a) } } }) } })) }) } }) }, getDataFromAPI: function(a) { if (a.videoData = jQuery.mbStorage.get("YTPlayer_data_" + a.videoID), jQuery(a).off("YTPData.YTPlayer").on("YTPData.YTPlayer", function() { if (a.hasData && a.isPlayer && !a.opt.autoPlay) { var b = a.videoData.thumb_max || a.videoData.thumb_high || a.videoData.thumb_medium; a.opt.containment.css({ background: "rgba(0,0,0,0.5) url(" + b + ") center center", backgroundSize: "cover" }), a.opt.backgroundUrl = b } }), a.videoData) setTimeout(function() { a.opt.ratio = "auto" == a.opt.ratio ? "16/9" : a.opt.ratio, a.dataReceived = !0, jQuery(a).trigger("YTPChanged"); var b = jQuery.Event("YTPData"); b.prop = {}; for (var c in a.videoData) b.prop[c] = a.videoData[c]; jQuery(a).trigger(b) }, 500), a.hasData = !0; else if (jQuery.mbYTPlayer.apiKey) jQuery.getJSON(jQuery.mbYTPlayer.locationProtocol + "//www.googleapis.com/youtube/v3/videos?id=" + a.videoID + "&key=" + jQuery.mbYTPlayer.apiKey + "&part=snippet", function(b) { function c(b) { a.videoData = {}, a.videoData.id = a.videoID, a.videoData.channelTitle = b.channelTitle, a.videoData.title = b.title, a.videoData.description = b.description.length < 400 ? b.description : b.description.substring(0, 400) + " ...", a.videoData.aspectratio = "auto" == a.opt.ratio ? "16/9" : a.opt.ratio, a.opt.ratio = a.videoData.aspectratio, a.videoData.thumb_max = b.thumbnails.maxres ? b.thumbnails.maxres.url : null, a.videoData.thumb_high = b.thumbnails.high ? b.thumbnails.high.url : null, a.videoData.thumb_medium = b.thumbnails.medium ? b.thumbnails.medium.url : null, jQuery.mbStorage.set("YTPlayer_data_" + a.videoID, a.videoData) } a.dataReceived = !0, jQuery(a).trigger("YTPChanged"), c(b.items[0].snippet), a.hasData = !0; var d = jQuery.Event("YTPData"); d.prop = {}; for (var e in a.videoData) d.prop[e] = a.videoData[e]; jQuery(a).trigger(d) }); else { if (setTimeout(function() { jQuery(a).trigger("YTPChanged") }, 50), a.isPlayer && !a.opt.autoPlay) { var b = jQuery.mbYTPlayer.locationProtocol + "//i.ytimg.com/vi/" + a.videoID + "/hqdefault.jpg"; a.opt.containment.css({ background: "rgba(0,0,0,0.5) url(" + b + ") center center", backgroundSize: "cover" }), a.opt.backgroundUrl = b } a.videoData = null, a.opt.ratio = "auto" == a.opt.ratio ? "16/9" : a.opt.ratio } a.isPlayer && !a.opt.autoPlay && (a.loading = jQuery("").addClass("loading").html("Loading").hide(), jQuery(a).append(a.loading), a.loading.fadeIn()) }, removeStoredData: function() { jQuery.mbStorage.remove() }, getVideoData: function() { var a = this.get(0); return a.videoData }, getVideoID: function() { var a = this.get(0); return a.videoID || !1 }, setVideoQuality: function(a) { var b = this.get(0); b.player.setPlaybackQuality(a) }, playlist: function(a, b, c) { var d = this, e = d.get(0); return e.isPlayList = !0, b && (a = jQuery.shuffle(a)), e.videoID || (e.videos = a, e.videoCounter = 0, e.videoLength = a.length, jQuery(e).data("property", a[0]), jQuery(e).mb_YTPlayer()), "function" == typeof c && jQuery(e).one("YTPChanged", function() { c(e) }), jQuery(e).on("YTPEnd", function() { jQuery(e).playNext() }), d }, playNext: function() { var a = this.get(0); return a.checkForStartAt && (clearTimeout(a.checkForStartAt), clearInterval(a.getState)), a.videoCounter++, a.videoCounter >= a.videoLength && (a.videoCounter = 0), jQuery(a).changeMovie(a.videos[a.videoCounter]), this }, playPrev: function() { var a = this.get(0); return a.checkForStartAt && (clearInterval(a.checkForStartAt), clearInterval(a.getState)), a.videoCounter--, a.videoCounter < 0 && (a.videoCounter = a.videoLength - 1), jQuery(a).changeMovie(a.videos[a.videoCounter]), this }, changeMovie: function(a) { var b = this.get(0); b.opt.startAt = 0, b.opt.stopAt = 0, b.opt.mute = !0, b.hasData = !1, b.hasChanged = !0, b.player.loopTime = void 0, a && jQuery.extend(b.opt, b.defaultOpt, a), b.videoID = getYTPVideoID(b.opt.videoURL).videoID, "true" == b.opt.loop && (b.opt.loop = 9999), jQuery(b.playerEl).CSSAnimate({ opacity: 0 }, 200, function() { var a = jQuery.Event("YTPChangeMovie"); return a.time = b.player.time, a.videoId = b.videoID, jQuery(b).trigger(a), jQuery(b).YTPGetPlayer().cueVideoByUrl(encodeURI(jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/v/" + b.videoID), 1, b.opt.quality), jQuery(b).optimizeDisplay(), jQuery.mbYTPlayer.checkForState(b), jQuery.mbYTPlayer.getDataFromAPI(b), this }) }, getPlayer: function() { return jQuery(this).get(0).player }, playerDestroy: function() { var a = this.get(0); ytp.YTAPIReady = !0, ytp.backgroundIsInited = !1, a.isInit = !1, a.videoID = null; var b = a.wrapper; return b.remove(), jQuery("#controlBar_" + a.id).remove(), clearInterval(a.checkForStartAt), clearInterval(a.getState), this }, fullscreen: function(real) { function hideMouse() { YTPlayer.overlay.css({ cursor: "none" }) } function RunPrefixMethod(a, b) { for (var c, d, e = ["webkit", "moz", "ms", "o", ""], f = 0; f < e.length && !a[c];) { if (c = b, "" == e[f] && (c = c.substr(0, 1).toLowerCase() + c.substr(1)), c = e[f] + c, d = typeof a[c], "undefined" != d) return e = [e[f]], "function" == d ? a[c]() : a[c]; f++ } } function launchFullscreen(a) { RunPrefixMethod(a, "RequestFullScreen") } function cancelFullscreen() { (RunPrefixMethod(document, "FullScreen") || RunPrefixMethod(document, "IsFullScreen")) && RunPrefixMethod(document, "CancelFullScreen") } var YTPlayer = this.get(0); "undefined" == typeof real && (real = YTPlayer.opt.realfullscreen), real = eval(real); var controls = jQuery("#controlBar_" + YTPlayer.id), fullScreenBtn = controls.find(".mb_OnlyYT"), videoWrapper = YTPlayer.isSelf ? YTPlayer.opt.containment : YTPlayer.wrapper; if (real) { var fullscreenchange = jQuery.browser.mozilla ? "mozfullscreenchange" : jQuery.browser.webkit ? "webkitfullscreenchange" : "fullscreenchange"; jQuery(document).off(fullscreenchange).on(fullscreenchange, function() { var a = RunPrefixMethod(document, "IsFullScreen") || RunPrefixMethod(document, "FullScreen"); a ? (jQuery(YTPlayer).YTPSetVideoQuality("default"), jQuery(YTPlayer).trigger("YTPFullScreenStart")) : (YTPlayer.isAlone = !1, fullScreenBtn.html(jQuery.mbYTPlayer.controls.onlyYT), jQuery(YTPlayer).YTPSetVideoQuality(YTPlayer.opt.quality), videoWrapper.removeClass("YTPFullscreen"), videoWrapper.CSSAnimate({ opacity: YTPlayer.opt.opacity }, 500), videoWrapper.css({ zIndex: 0 }), YTPlayer.isBackground ? jQuery("body").after(controls) : YTPlayer.wrapper.before(controls), jQuery(window).resize(), jQuery(YTPlayer).trigger("YTPFullScreenEnd")) }) } return YTPlayer.isAlone ? (jQuery(document).off("mousemove.YTPlayer"), YTPlayer.overlay.css({ cursor: "auto" }), real ? cancelFullscreen() : (videoWrapper.CSSAnimate({ opacity: YTPlayer.opt.opacity }, 500), videoWrapper.css({ zIndex: 0 })), fullScreenBtn.html(jQuery.mbYTPlayer.controls.onlyYT), YTPlayer.isAlone = !1) : (jQuery(document).on("mousemove.YTPlayer", function(a) { YTPlayer.overlay.css({ cursor: "auto" }), clearTimeout(YTPlayer.hideCursor), jQuery(a.target).parents().is(".mb_YTPBar") || (YTPlayer.hideCursor = setTimeout(hideMouse, 3e3)) }), hideMouse(), real ? (videoWrapper.css({ opacity: 0 }), videoWrapper.addClass("YTPFullscreen"), launchFullscreen(videoWrapper.get(0)), setTimeout(function() { videoWrapper.CSSAnimate({ opacity: 1 }, 1e3), YTPlayer.wrapper.append(controls), jQuery(YTPlayer).optimizeDisplay(), YTPlayer.player.seekTo(YTPlayer.player.getCurrentTime() + .1, !0) }, 500)) : videoWrapper.css({ zIndex: 1e4 }).CSSAnimate({ opacity: 1 }, 1e3), fullScreenBtn.html(jQuery.mbYTPlayer.controls.showSite), YTPlayer.isAlone = !0), this }, toggleLoops: function() { var a = this.get(0), b = a.opt; return 1 == b.loop ? b.loop = 0 : (b.startAt ? a.player.seekTo(b.startAt) : a.player.playVideo(), b.loop = 1), this }, play: function() { var a = this.get(0); if (a.isReady) return a.player.playVideo(), a.wrapper.CSSAnimate({ opacity: a.isAlone ? 1 : a.opt.opacity }, 2e3), jQuery(a.playerEl).CSSAnimate({ opacity: 1 }, 1e3), jQuery(a).css("background-image", "none"), this }, togglePlay: function(a) { var b = this.get(0); return 1 == b.state ? this.YTPPause() : this.YTPPlay(), "function" == typeof a && a(b.state), this }, stop: function() { var a = this.get(0), b = jQuery("#controlBar_" + a.id), c = b.find(".mb_YTPPlaypause"); return c.html(jQuery.mbYTPlayer.controls.play), a.player.stopVideo(), this }, pause: function() { var a = this.get(0); return a.player.pauseVideo(), this }, seekTo: function(a) { var b = this.get(0); return b.player.seekTo(a, !0), this }, setVolume: function(a) { var b = this.get(0); return a || b.opt.vol || 0 != b.player.getVolume() ? !a && b.player.getVolume() > 0 || a && b.opt.vol == a ? b.isMute ? jQuery(b).YTPUnmute() : jQuery(b).YTPMute() : (b.opt.vol = a, b.player.setVolume(b.opt.vol), b.volumeBar && b.volumeBar.length && b.volumeBar.updateSliderVal(a)) : jQuery(b).YTPUnmute(), this }, mute: function() { var a = this.get(0); if (!a.isMute) { a.player.mute(), a.isMute = !0, a.player.setVolume(0), a.volumeBar && a.volumeBar.length && a.volumeBar.width() > 10 && a.volumeBar.updateSliderVal(0); var b = jQuery("#controlBar_" + a.id), c = b.find(".mb_YTPMuteUnmute"); c.html(jQuery.mbYTPlayer.controls.unmute), jQuery(a).addClass("isMuted"), a.volumeBar && a.volumeBar.length && a.volumeBar.addClass("muted"); var d = jQuery.Event("YTPMuted"); return d.time = a.player.time, a.canTrigger && jQuery(a).trigger(d), this } }, unmute: function() { var a = this.get(0); if (a.isMute) { a.player.unMute(), a.isMute = !1, a.player.setVolume(a.opt.vol), a.volumeBar && a.volumeBar.length && a.volumeBar.updateSliderVal(a.opt.vol > 10 ? a.opt.vol : 10); var b = jQuery("#controlBar_" + a.id), c = b.find(".mb_YTPMuteUnmute"); c.html(jQuery.mbYTPlayer.controls.mute), jQuery(a).removeClass("isMuted"), a.volumeBar && a.volumeBar.length && a.volumeBar.removeClass("muted"); var d = jQuery.Event("YTPUnmuted"); return d.time = a.player.time, a.canTrigger && jQuery(a).trigger(d), this } }, applyFilter: function(a, b) { var c = this.get(0); return c.filters[a].value = b, c.filtersEnabled && this.YTPEnableFilters(), this }, applyFilters: function(a) { var b = this.get(0); return this.on("YTPReady", function() { for (var c in a) b.filters[c].value = a[c], jQuery(b).YTPApplyFilter(c, a[c]); jQuery(b).trigger("YTPFiltersApplied") }), this }, toggleFilter: function(a, b) { return this.each(function() { var c = this; c.filters[a].value ? c.filters[a].value = 0 : c.filters[a].value = b, c.filtersEnabled && jQuery(this).YTPEnableFilters() }) }, toggleFilters: function(a) { return this.each(function() { var b = this; b.filtersEnabled ? (jQuery(b).trigger("YTPDisableFilters"), jQuery(b).YTPDisableFilters()) : (jQuery(b).YTPEnableFilters(), jQuery(b).trigger("YTPEnableFilters")), "function" == typeof a && a(b.filtersEnabled) }) }, disableFilters: function() { return this.each(function() { var a = this, b = jQuery(a.playerEl); b.css("-webkit-filter", ""), b.css("filter", ""), a.filtersEnabled = !1 }) }, enableFilters: function() { return this.each(function() { var a = this, b = jQuery(a.playerEl), c = ""; for (var d in a.filters) a.filters[d].value && (c += d.replace("_", "-") + "(" + a.filters[d].value + a.filters[d].unit + ") "); b.css("-webkit-filter", c), b.css("filter", c), a.filtersEnabled = !0 }) }, removeFilter: function(a, b) { return this.each(function() { "function" == typeof a && (b = a, a = null); var c = this; if (a) jQuery(this).YTPApplyFilter(a, 0), "function" == typeof b && b(a); else for (var d in c.filters) jQuery(this).YTPApplyFilter(d, 0), "function" == typeof b && b(d) }) }, manageProgress: function() { var a = this.get(0), b = jQuery("#controlBar_" + a.id), c = b.find(".mb_YTPProgress"), d = b.find(".mb_YTPLoaded"), e = b.find(".mb_YTPseekbar"), f = c.outerWidth(), g = Math.floor(a.player.getCurrentTime()), h = Math.floor(a.player.getDuration()), i = g * f / h, j = 0, k = 100 * a.player.getVideoLoadedFraction(); return d.css({ left: j, width: k + "%" }), e.css({ left: 0, width: i }), { totalTime: h, currentTime: g } }, buildControls: function(YTPlayer) { var data = YTPlayer.opt; if (data.showYTLogo = data.showYTLogo || data.printUrl, !jQuery("#controlBar_" + YTPlayer.id).length) { YTPlayer.controlBar = jQuery("").attr("id", "controlBar_" + YTPlayer.id).addClass("mb_YTPBar").css({ whiteSpace: "noWrap", position: YTPlayer.isBackground ? "fixed" : "absolute", zIndex: YTPlayer.isBackground ? 1e4 : 1e3 }).hide(); var buttonBar = jQuery("").addClass("buttonBar"), playpause = jQuery("" + jQuery.mbYTPlayer.controls.play + "").addClass("mb_YTPPlaypause ytpicon").click(function() { 1 == YTPlayer.player.getPlayerState() ? jQuery(YTPlayer).YTPPause() : jQuery(YTPlayer).YTPPlay() }), MuteUnmute = jQuery("" + jQuery.mbYTPlayer.controls.mute + "").addClass("mb_YTPMuteUnmute ytpicon").click(function() { 0 == YTPlayer.player.getVolume() ? jQuery(YTPlayer).YTPUnmute() : jQuery(YTPlayer).YTPMute() }), volumeBar = jQuery("").addClass("mb_YTPVolumeBar").css({ display: "inline-block" }); YTPlayer.volumeBar = volumeBar; var idx = jQuery("").addClass("mb_YTPTime"), vURL = data.videoURL ? data.videoURL : ""; vURL.indexOf("http") < 0 && (vURL = jQuery.mbYTPlayer.locationProtocol + "//www.youtube.com/watch?v=" + data.videoURL); var movieUrl = jQuery("").html(jQuery.mbYTPlayer.controls.ytLogo).addClass("mb_YTPUrl ytpicon").attr("title", "view on YouTube").on("click", function() { window.open(vURL, "viewOnYT") }), onlyVideo = jQuery("").html(jQuery.mbYTPlayer.controls.onlyYT).addClass("mb_OnlyYT ytpicon").on("click", function() { jQuery(YTPlayer).YTPFullscreen(data.realfullscreen) }), progressBar = jQuery("").addClass("mb_YTPProgress").css("position", "absolute").click(function(a) { timeBar.css({ width: a.clientX - timeBar.offset().left }), YTPlayer.timeW = a.clientX - timeBar.offset().left, YTPlayer.controlBar.find(".mb_YTPLoaded").css({ width: 0 }); var b = Math.floor(YTPlayer.player.getDuration()); YTPlayer["goto"] = timeBar.outerWidth() * b / progressBar.outerWidth(), YTPlayer.player.seekTo(parseFloat(YTPlayer["goto"]), !0), YTPlayer.controlBar.find(".mb_YTPLoaded").css({ width: 0 }) }), loadedBar = jQuery("").addClass("mb_YTPLoaded").css("position", "absolute"), timeBar = jQuery("").addClass("mb_YTPseekbar").css("position", "absolute"); progressBar.append(loadedBar).append(timeBar), buttonBar.append(playpause).append(MuteUnmute).append(volumeBar).append(idx), data.showYTLogo && buttonBar.append(movieUrl), (YTPlayer.isBackground || eval(YTPlayer.opt.realfullscreen) && !YTPlayer.isBackground) && buttonBar.append(onlyVideo), YTPlayer.controlBar.append(buttonBar).append(progressBar), YTPlayer.isBackground ? jQuery("body").after(YTPlayer.controlBar) : (YTPlayer.controlBar.addClass("inlinePlayer"), YTPlayer.wrapper.before(YTPlayer.controlBar)), volumeBar.simpleSlider({ initialval: YTPlayer.opt.vol, scale: 100, orientation: "h", callback: function(a) { 0 == a.value ? jQuery(YTPlayer).YTPMute() : jQuery(YTPlayer).YTPUnmute(), YTPlayer.player.setVolume(a.value), YTPlayer.isMute || (YTPlayer.opt.vol = a.value) } }) } }, checkForState: function(YTPlayer) { var interval = YTPlayer.opt.showControls ? 100 : 400; return clearInterval(YTPlayer.getState), jQuery.contains(document, YTPlayer) ? (jQuery.mbYTPlayer.checkForStart(YTPlayer), void(YTPlayer.getState = setInterval(function() { var prog = jQuery(YTPlayer).YTPManageProgress(), $YTPlayer = jQuery(YTPlayer), data = YTPlayer.opt, startAt = YTPlayer.opt.startAt ? YTPlayer.opt.startAt : 1, stopAt = YTPlayer.opt.stopAt > YTPlayer.opt.startAt ? YTPlayer.opt.stopAt : 0; if (stopAt = stopAt < YTPlayer.player.getDuration() ? stopAt : 0, YTPlayer.player.time != prog.currentTime) { var YTPEvent = jQuery.Event("YTPTime"); YTPEvent.time = YTPlayer.player.time, jQuery(YTPlayer).trigger(YTPEvent) } if (YTPlayer.player.time = prog.currentTime, 0 == YTPlayer.player.getVolume() ? $YTPlayer.addClass("isMuted") : $YTPlayer.removeClass("isMuted"), YTPlayer.opt.showControls && (prog.totalTime ? YTPlayer.controlBar.find(".mb_YTPTime").html(jQuery.mbYTPlayer.formatTime(prog.currentTime) + " / " + jQuery.mbYTPlayer.formatTime(prog.totalTime)) : YTPlayer.controlBar.find(".mb_YTPTime").html("-- : -- / -- : --")), eval(YTPlayer.opt.stopMovieOnBlur) && (document.hasFocus() ? document.hasFocus() && !YTPlayer.hasFocus && -1 != YTPlayer.state && 0 != YTPlayer.state && (YTPlayer.hasFocus = !0, $YTPlayer.YTPPlay()) : 1 == YTPlayer.state && (YTPlayer.hasFocus = !1, $YTPlayer.YTPPause())), YTPlayer.controlBar && YTPlayer.controlBar.outerWidth() <= 400 && !YTPlayer.isCompact ? (YTPlayer.controlBar.addClass("compact"), YTPlayer.isCompact = !0, !YTPlayer.isMute && YTPlayer.volumeBar && YTPlayer.volumeBar.updateSliderVal(YTPlayer.opt.vol)) : YTPlayer.controlBar && YTPlayer.controlBar.outerWidth() > 400 && YTPlayer.isCompact && (YTPlayer.controlBar.removeClass("compact"), YTPlayer.isCompact = !1, !YTPlayer.isMute && YTPlayer.volumeBar && YTPlayer.volumeBar.updateSliderVal(YTPlayer.opt.vol)), 1 == YTPlayer.player.getPlayerState() && (parseFloat(YTPlayer.player.getDuration() - 1.5) < YTPlayer.player.getCurrentTime() || stopAt > 0 && parseFloat(YTPlayer.player.getCurrentTime()) > stopAt)) { if (YTPlayer.isEnded) return; if (YTPlayer.isEnded = !0, setTimeout(function() { YTPlayer.isEnded = !1 }, 1e3), YTPlayer.isPlayList) { if (!data.loop || data.loop > 0 && YTPlayer.player.loopTime === data.loop - 1) { YTPlayer.player.loopTime = void 0, clearInterval(YTPlayer.getState); var YTPEnd = jQuery.Event("YTPEnd"); return YTPEnd.time = YTPlayer.player.time, jQuery(YTPlayer).trigger(YTPEnd), void(YTPlayer.state = 0) } } else if (!data.loop || data.loop > 0 && YTPlayer.player.loopTime === data.loop - 1) return YTPlayer.player.loopTime = void 0, YTPlayer.preventTrigger = !0, jQuery(YTPlayer).YTPPause(), YTPlayer.state = 0, void YTPlayer.wrapper.CSSAnimate({ opacity: 0 }, 500, function() { YTPlayer.controlBar && YTPlayer.controlBar.find(".mb_YTPPlaypause").html(jQuery.mbYTPlayer.controls.play); var a = jQuery.Event("YTPEnd"); a.time = YTPlayer.player.time, jQuery(YTPlayer).trigger(a), YTPlayer.player.seekTo(startAt, !0), YTPlayer.isBackground || YTPlayer.opt.containment.css({ background: "rgba(0,0,0,0.5) url(" + YTPlayer.opt.backgroundUrl + ") center center", backgroundSize: "cover" }) }); YTPlayer.player.loopTime = YTPlayer.player.loopTime ? ++YTPlayer.player.loopTime : 1, startAt = startAt || 1, YTPlayer.preventTrigger = !0, jQuery(YTPlayer).YTPPause(), YTPlayer.player.seekTo(startAt, !0), $YTPlayer.YTPPlay() } }, interval))) : (jQuery(YTPlayer).YTPPlayerDestroy(), clearInterval(YTPlayer.getState), void clearInterval(YTPlayer.checkForStartAt)) }, checkForStart: function(a) { var b = jQuery(a); if (!jQuery.contains(document, a)) return void jQuery(a).YTPPlayerDestroy(); if (a.preventTrigger = !0, jQuery(a).YTPPause(), jQuery(a).muteYTPVolume(), jQuery("#controlBar_" + a.id).remove(), a.opt.showControls && jQuery.mbYTPlayer.buildControls(a), a.opt.addRaster) { var c = "dot" == a.opt.addRaster ? "raster-dot" : "raster"; a.overlay.addClass(a.isRetina ? c + " retina" : c) } else a.overlay.removeClass(function(a, b) { var c = b.split(" "), d = []; return jQuery.each(c, function(a, b) { /raster.*/.test(b) && d.push(b) }), d.push("retina"), d.join(" ") }); var d = a.opt.startAt ? a.opt.startAt : 1; a.player.playVideo(), a.player.seekTo(d, !0), a.checkForStartAt = setInterval(function() { jQuery(a).YTPMute(); var c = a.player.getVideoLoadedFraction() >= d / a.player.getDuration(); if (a.player.getDuration() > 0 && a.player.getCurrentTime() >= d && c) { clearInterval(a.checkForStartAt), a.isReady = !0, "function" == typeof a.opt.onReady && a.opt.onReady(a); var e = jQuery.Event("YTPReady"); if (e.time = a.player.time, jQuery(a).trigger(e), a.preventTrigger = !0, jQuery(a).YTPPause(), a.opt.mute || jQuery(a).YTPUnmute(), a.canTrigger = !0, a.opt.autoPlay) { b.YTPPlay(); var f = jQuery.Event("YTPStart"); f.time = a.player.time, jQuery(a).trigger(f), b.css("background-image", "none"), jQuery(a.playerEl).CSSAnimate({ opacity: 1 }, 1e3), a.wrapper.CSSAnimate({ opacity: a.isAlone ? 1 : a.opt.opacity }, 1e3) } else b.YTPPause(), a.isPlayer || (jQuery(a.playerEl).CSSAnimate({ opacity: 1 }, 500), a.wrapper.CSSAnimate({ opacity: a.isAlone ? 1 : a.opt.opacity }, 500)); a.isPlayer && !a.opt.autoPlay && (a.loading.html("Ready"), setTimeout(function() { a.loading.fadeOut() }, 100)), a.controlBar && a.controlBar.slideDown(1e3) } else jQuery.browser.safari }, 1) }, formatTime: function(a) { var b = Math.floor(a / 60), c = Math.floor(a - 60 * b); return (9 >= b ? "0" + b : b) + " : " + (9 >= c ? "0" + c : c) } }, jQuery.fn.toggleVolume = function() { var a = this.get(0); if (a) return a.player.isMuted() ? (jQuery(a).YTPUnmute(), !0) : (jQuery(a).YTPMute(), !1) }, jQuery.fn.optimizeDisplay = function() { var a = this.get(0), b = a.opt, c = jQuery(a.playerEl), d = {}, e = a.wrapper; d.width = e.outerWidth(), d.height = e.outerHeight(); var f = 24, g = 100, h = {}; b.optimizeDisplay ? (h.width = d.width + d.width * f / 100, h.height = "16/9" == b.ratio ? Math.ceil(9 * d.width / 16) : Math.ceil(3 * d.width / 4), h.marginTop = -((h.height - d.height) / 2), h.marginLeft = -(d.width * (f / 2) / 100), h.height < d.height && (h.height = d.height + d.height * f / 100, h.width = "16/9" == b.ratio ? Math.floor(16 * d.height / 9) : Math.floor(4 * d.height / 3), h.marginTop = -(d.height * (f / 2) / 100), h.marginLeft = -((h.width - d.width) / 2)), h.width += g, h.height += g, h.marginTop -= g / 2, h.marginLeft -= g / 2) : (h.width = "100%", h.height = "100%", h.marginTop = 0, h.marginLeft = 0), c.css({ width: h.width, height: h.height, marginTop: h.marginTop, marginLeft: h.marginLeft }) }, jQuery.shuffle = function(a) { for (var b = a.slice(), c = b.length, d = c; d--;) { var e = parseInt(Math.random() * c), f = b[d]; b[d] = b[e], b[e] = f } return b }, jQuery.fn.unselectable = function() { return this.each(function() { jQuery(this).css({ "-moz-user-select": "none", "-webkit-user-select": "none", "user-select": "none" }).attr("unselectable", "on") }) }, jQuery.fn.YTPlayer = jQuery.mbYTPlayer.buildPlayer, jQuery.fn.YTPGetPlayer = jQuery.mbYTPlayer.getPlayer, jQuery.fn.YTPGetVideoID = jQuery.mbYTPlayer.getVideoID, jQuery.fn.YTPChangeMovie = jQuery.mbYTPlayer.changeMovie, jQuery.fn.YTPPlayerDestroy = jQuery.mbYTPlayer.playerDestroy, jQuery.fn.YTPPlay = jQuery.mbYTPlayer.play, jQuery.fn.YTPTogglePlay = jQuery.mbYTPlayer.togglePlay, jQuery.fn.YTPStop = jQuery.mbYTPlayer.stop, jQuery.fn.YTPPause = jQuery.mbYTPlayer.pause, jQuery.fn.YTPSeekTo = jQuery.mbYTPlayer.seekTo, jQuery.fn.YTPlaylist = jQuery.mbYTPlayer.playlist, jQuery.fn.YTPPlayNext = jQuery.mbYTPlayer.playNext, jQuery.fn.YTPPlayPrev = jQuery.mbYTPlayer.playPrev, jQuery.fn.YTPMute = jQuery.mbYTPlayer.mute, jQuery.fn.YTPUnmute = jQuery.mbYTPlayer.unmute, jQuery.fn.YTPToggleVolume = jQuery.mbYTPlayer.toggleVolume, jQuery.fn.YTPSetVolume = jQuery.mbYTPlayer.setVolume, jQuery.fn.YTPGetVideoData = jQuery.mbYTPlayer.getVideoData, jQuery.fn.YTPFullscreen = jQuery.mbYTPlayer.fullscreen, jQuery.fn.YTPToggleLoops = jQuery.mbYTPlayer.toggleLoops, jQuery.fn.YTPSetVideoQuality = jQuery.mbYTPlayer.setVideoQuality, jQuery.fn.YTPManageProgress = jQuery.mbYTPlayer.manageProgress, jQuery.fn.YTPApplyFilter = jQuery.mbYTPlayer.applyFilter, jQuery.fn.YTPApplyFilters = jQuery.mbYTPlayer.applyFilters, jQuery.fn.YTPToggleFilter = jQuery.mbYTPlayer.toggleFilter, jQuery.fn.YTPToggleFilters = jQuery.mbYTPlayer.toggleFilters, jQuery.fn.YTPRemoveFilter = jQuery.mbYTPlayer.removeFilter, jQuery.fn.YTPDisableFilters = jQuery.mbYTPlayer.disableFilters, jQuery.fn.YTPEnableFilters = jQuery.mbYTPlayer.enableFilters, jQuery.fn.mb_YTPlayer = jQuery.mbYTPlayer.buildPlayer, jQuery.fn.playNext = jQuery.mbYTPlayer.playNext, jQuery.fn.playPrev = jQuery.mbYTPlayer.playPrev, jQuery.fn.changeMovie = jQuery.mbYTPlayer.changeMovie, jQuery.fn.getVideoID = jQuery.mbYTPlayer.getVideoID, jQuery.fn.getPlayer = jQuery.mbYTPlayer.getPlayer, jQuery.fn.playerDestroy = jQuery.mbYTPlayer.playerDestroy, jQuery.fn.fullscreen = jQuery.mbYTPlayer.fullscreen, jQuery.fn.buildYTPControls = jQuery.mbYTPlayer.buildControls, jQuery.fn.playYTP = jQuery.mbYTPlayer.play, jQuery.fn.toggleLoops = jQuery.mbYTPlayer.toggleLoops, jQuery.fn.stopYTP = jQuery.mbYTPlayer.stop, jQuery.fn.pauseYTP = jQuery.mbYTPlayer.pause, jQuery.fn.seekToYTP = jQuery.mbYTPlayer.seekTo, jQuery.fn.muteYTPVolume = jQuery.mbYTPlayer.mute, jQuery.fn.unmuteYTPVolume = jQuery.mbYTPlayer.unmute, jQuery.fn.setYTPVolume = jQuery.mbYTPlayer.setVolume, jQuery.fn.setVideoQuality = jQuery.mbYTPlayer.setVideoQuality, jQuery.fn.manageYTPProgress = jQuery.mbYTPlayer.manageProgress, jQuery.fn.YTPGetDataFromFeed = jQuery.mbYTPlayer.getVideoData }(jQuery, ytp), jQuery.support.CSStransition = function() { var a = document.body || document.documentElement, b = a.style; return void 0 !== b.transition || void 0 !== b.WebkitTransition || void 0 !== b.MozTransition || void 0 !== b.MsTransition || void 0 !== b.OTransition }(), jQuery.CSS = { name: "mb.CSSAnimate", author: "Matteo Bicocchi", version: "2.0.0", transitionEnd: "transitionEnd", sfx: "", filters: { blur: { min: 0, max: 100, unit: "px" }, brightness: { min: 0, max: 400, unit: "%" }, contrast: { min: 0, max: 400, unit: "%" }, grayscale: { min: 0, max: 100, unit: "%" }, hueRotate: { min: 0, max: 360, unit: "deg" }, invert: { min: 0, max: 100, unit: "%" }, saturate: { min: 0, max: 400, unit: "%" }, sepia: { min: 0, max: 100, unit: "%" } }, normalizeCss: function(a) { var b = jQuery.extend(!0, {}, a); jQuery.browser.webkit || jQuery.browser.opera ? jQuery.CSS.sfx = "-webkit-" : jQuery.browser.mozilla ? jQuery.CSS.sfx = "-moz-" : jQuery.browser.msie && (jQuery.CSS.sfx = "-ms-"); for (var c in b) { "transform" === c && (b[jQuery.CSS.sfx + "transform"] = b[c], delete b[c]), "transform-origin" === c && (b[jQuery.CSS.sfx + "transform-origin"] = a[c], delete b[c]), "filter" !== c || jQuery.browser.mozilla || (b[jQuery.CSS.sfx + "filter"] = a[c], delete b[c]), "blur" === c && setFilter(b, "blur", a[c]), "brightness" === c && setFilter(b, "brightness", a[c]), "contrast" === c && setFilter(b, "contrast", a[c]), "grayscale" === c && setFilter(b, "grayscale", a[c]), "hueRotate" === c && setFilter(b, "hueRotate", a[c]), "invert" === c && setFilter(b, "invert", a[c]), "saturate" === c && setFilter(b, "saturate", a[c]), "sepia" === c && setFilter(b, "sepia", a[c]); var d = ""; "x" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " translateX(" + setUnit(a[c], "px") + ")", delete b[c]), "y" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " translateY(" + setUnit(a[c], "px") + ")", delete b[c]), "z" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " translateZ(" + setUnit(a[c], "px") + ")", delete b[c]), "rotate" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " rotate(" + setUnit(a[c], "deg") + ")", delete b[c]), "rotateX" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " rotateX(" + setUnit(a[c], "deg") + ")", delete b[c]), "rotateY" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " rotateY(" + setUnit(a[c], "deg") + ")", delete b[c]), "rotateZ" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " rotateZ(" + setUnit(a[c], "deg") + ")", delete b[c]), "scale" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " scale(" + setUnit(a[c], "") + ")", delete b[c]), "scaleX" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " scaleX(" + setUnit(a[c], "") + ")", delete b[c]), "scaleY" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " scaleY(" + setUnit(a[c], "") + ")", delete b[c]), "scaleZ" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " scaleZ(" + setUnit(a[c], "") + ")", delete b[c]), "skew" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " skew(" + setUnit(a[c], "deg") + ")", delete b[c]), "skewX" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " skewX(" + setUnit(a[c], "deg") + ")", delete b[c]), "skewY" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " skewY(" + setUnit(a[c], "deg") + ")", delete b[c]), "perspective" === c && (d = jQuery.CSS.sfx + "transform", b[d] = b[d] || "", b[d] += " perspective(" + setUnit(a[c], "px") + ")", delete b[c]) } return b }, getProp: function(a) { var b = []; for (var c in a) b.indexOf(c) < 0 && b.push(uncamel(c)); return b.join(",") }, animate: function(a, b, c, d, e) { return this.each(function() { function f() { g.called = !0, g.CSSAIsRunning = !1, h.off(jQuery.CSS.transitionEnd + "." + g.id), clearTimeout(g.timeout), h.css(jQuery.CSS.sfx + "transition", ""), "function" == typeof e && e.apply(g), "function" == typeof g.CSSqueue && (g.CSSqueue(), g.CSSqueue = null) } var g = this, h = jQuery(this); g.id = g.id || "CSSA_" + (new Date).getTime(); var i = i || { type: "noEvent" }; if (g.CSSAIsRunning && g.eventType == i.type && !jQuery.browser.msie && jQuery.browser.version <= 9) return void(g.CSSqueue = function() { h.CSSAnimate(a, b, c, d, e) }); if (g.CSSqueue = null, g.eventType = i.type, 0 !== h.length && a) { if (a = jQuery.normalizeCss(a), g.CSSAIsRunning = !0, "function" == typeof b && (e = b, b = jQuery.fx.speeds._default), "function" == typeof c && (d = c, c = 0), "string" == typeof c && (e = c, c = 0), "function" == typeof d && (e = d, d = "cubic-bezier(0.65,0.03,0.36,0.72)"), "string" == typeof b) for (var j in jQuery.fx.speeds) { if (b == j) { b = jQuery.fx.speeds[j]; break } b = jQuery.fx.speeds._default } if (b || (b = jQuery.fx.speeds._default), "string" == typeof e && (d = e, e = null), !jQuery.support.CSStransition) { for (var k in a) { if ("transform" === k && delete a[k], "filter" === k && delete a[k], "transform-origin" === k && delete a[k], "auto" === a[k] && delete a[k], "x" === k) { var l = a[k], m = "left"; a[m] = l, delete a[k] } if ("y" === k) { var l = a[k], m = "top"; a[m] = l, delete a[k] }("-ms-transform" === k || "-ms-filter" === k) && delete a[k] } return void h.delay(c).animate(a, b, e) } var n = { "default": "ease", "in": "ease-in", out: "ease-out", "in-out": "ease-in-out", snap: "cubic-bezier(0,1,.5,1)", easeOutCubic: "cubic-bezier(.215,.61,.355,1)", easeInOutCubic: "cubic-bezier(.645,.045,.355,1)", easeInCirc: "cubic-bezier(.6,.04,.98,.335)", easeOutCirc: "cubic-bezier(.075,.82,.165,1)", easeInOutCirc: "cubic-bezier(.785,.135,.15,.86)", easeInExpo: "cubic-bezier(.95,.05,.795,.035)", easeOutExpo: "cubic-bezier(.19,1,.22,1)", easeInOutExpo: "cubic-bezier(1,0,0,1)", easeInQuad: "cubic-bezier(.55,.085,.68,.53)", easeOutQuad: "cubic-bezier(.25,.46,.45,.94)", easeInOutQuad: "cubic-bezier(.455,.03,.515,.955)", easeInQuart: "cubic-bezier(.895,.03,.685,.22)", easeOutQuart: "cubic-bezier(.165,.84,.44,1)", easeInOutQuart: "cubic-bezier(.77,0,.175,1)", easeInQuint: "cubic-bezier(.755,.05,.855,.06)", easeOutQuint: "cubic-bezier(.23,1,.32,1)", easeInOutQuint: "cubic-bezier(.86,0,.07,1)", easeInSine: "cubic-bezier(.47,0,.745,.715)", easeOutSine: "cubic-bezier(.39,.575,.565,1)", easeInOutSine: "cubic-bezier(.445,.05,.55,.95)", easeInBack: "cubic-bezier(.6,-.28,.735,.045)", easeOutBack: "cubic-bezier(.175, .885,.32,1.275)", easeInOutBack: "cubic-bezier(.68,-.55,.265,1.55)" }; n[d] && (d = n[d]), h.off(jQuery.CSS.transitionEnd + "." + g.id); var o = jQuery.CSS.getProp(a), p = {}; jQuery.extend(p, a), p[jQuery.CSS.sfx + "transition-property"] = o, p[jQuery.CSS.sfx + "transition-duration"] = b + "ms", p[jQuery.CSS.sfx + "transition-delay"] = c + "ms", p[jQuery.CSS.sfx + "transition-timing-function"] = d, setTimeout(function() { h.one(jQuery.CSS.transitionEnd + "." + g.id, f), h.css(p) }, 1), g.timeout = setTimeout(function() { return g.called || !e ? (g.called = !1, void(g.CSSAIsRunning = !1)) : (h.css(jQuery.CSS.sfx + "transition", ""), e.apply(g), g.CSSAIsRunning = !1, void("function" == typeof g.CSSqueue && (g.CSSqueue(), g.CSSqueue = null))) }, b + c + 10) } }) } }, jQuery.fn.CSSAnimate = jQuery.CSS.animate, jQuery.normalizeCss = jQuery.CSS.normalizeCss, jQuery.fn.css3 = function(a) { return this.each(function() { var b = jQuery(this), c = jQuery.normalizeCss(a); b.css(c) }) }; var nAgt = navigator.userAgent; if (!jQuery.browser) { jQuery.browser = {}, jQuery.browser.mozilla = !1, jQuery.browser.webkit = !1, jQuery.browser.opera = !1, jQuery.browser.safari = !1, jQuery.browser.chrome = !1, jQuery.browser.msie = !1, jQuery.browser.ua = nAgt, jQuery.browser.name = navigator.appName, jQuery.browser.fullVersion = "" + parseFloat(navigator.appVersion), jQuery.browser.majorVersion = parseInt(navigator.appVersion, 10); var nameOffset, verOffset, ix; if (-1 != (verOffset = nAgt.indexOf("Opera"))) jQuery.browser.opera = !0, jQuery.browser.name = "Opera", jQuery.browser.fullVersion = nAgt.substring(verOffset + 6), -1 != (verOffset = nAgt.indexOf("Version")) && (jQuery.browser.fullVersion = nAgt.substring(verOffset + 8)); else if (-1 != (verOffset = nAgt.indexOf("OPR"))) jQuery.browser.opera = !0, jQuery.browser.name = "Opera", jQuery.browser.fullVersion = nAgt.substring(verOffset + 4); else if (-1 != (verOffset = nAgt.indexOf("MSIE"))) jQuery.browser.msie = !0, jQuery.browser.name = "Microsoft Internet Explorer", jQuery.browser.fullVersion = nAgt.substring(verOffset + 5); else if (-1 != nAgt.indexOf("Trident")) { jQuery.browser.msie = !0, jQuery.browser.name = "Microsoft Internet Explorer"; var start = nAgt.indexOf("rv:") + 3, end = start + 4; jQuery.browser.fullVersion = nAgt.substring(start, end) } else -1 != (verOffset = nAgt.indexOf("Chrome")) ? (jQuery.browser.webkit = !0, jQuery.browser.chrome = !0, jQuery.browser.name = "Chrome", jQuery.browser.fullVersion = nAgt.substring(verOffset + 7)) : -1 != (verOffset = nAgt.indexOf("Safari")) ? (jQuery.browser.webkit = !0, jQuery.browser.safari = !0, jQuery.browser.name = "Safari", jQuery.browser.fullVersion = nAgt.substring(verOffset + 7), -1 != (verOffset = nAgt.indexOf("Version")) && (jQuery.browser.fullVersion = nAgt.substring(verOffset + 8))) : -1 != (verOffset = nAgt.indexOf("AppleWebkit")) ? (jQuery.browser.webkit = !0, jQuery.browser.name = "Safari", jQuery.browser.fullVersion = nAgt.substring(verOffset + 7), -1 != (verOffset = nAgt.indexOf("Version")) && (jQuery.browser.fullVersion = nAgt.substring(verOffset + 8))) : -1 != (verOffset = nAgt.indexOf("Firefox")) ? (jQuery.browser.mozilla = !0, jQuery.browser.name = "Firefox", jQuery.browser.fullVersion = nAgt.substring(verOffset + 8)) : (nameOffset = nAgt.lastIndexOf(" ") + 1) < (verOffset = nAgt.lastIndexOf("/")) && (jQuery.browser.name = nAgt.substring(nameOffset, verOffset), jQuery.browser.fullVersion = nAgt.substring(verOffset + 1), jQuery.browser.name.toLowerCase() == jQuery.browser.name.toUpperCase() && (jQuery.browser.name = navigator.appName)); - 1 != (ix = jQuery.browser.fullVersion.indexOf(";")) && (jQuery.browser.fullVersion = jQuery.browser.fullVersion.substring(0, ix)), -1 != (ix = jQuery.browser.fullVersion.indexOf(" ")) && (jQuery.browser.fullVersion = jQuery.browser.fullVersion.substring(0, ix)), jQuery.browser.majorVersion = parseInt("" + jQuery.browser.fullVersion, 10), isNaN(jQuery.browser.majorVersion) && (jQuery.browser.fullVersion = "" + parseFloat(navigator.appVersion), jQuery.browser.majorVersion = parseInt(navigator.appVersion, 10)), jQuery.browser.version = jQuery.browser.majorVersion } jQuery.browser.android = /Android/i.test(nAgt), jQuery.browser.blackberry = /BlackBerry|BB|PlayBook/i.test(nAgt), jQuery.browser.ios = /iPhone|iPad|iPod|webOS/i.test(nAgt), jQuery.browser.operaMobile = /Opera Mini/i.test(nAgt), jQuery.browser.windowsMobile = /IEMobile|Windows Phone/i.test(nAgt), jQuery.browser.kindle = /Kindle|Silk/i.test(nAgt), jQuery.browser.mobile = jQuery.browser.android || jQuery.browser.blackberry || jQuery.browser.ios || jQuery.browser.windowsMobile || jQuery.browser.operaMobile || jQuery.browser.kindle, jQuery.isMobile = jQuery.browser.mobile, jQuery.isTablet = jQuery.browser.mobile && jQuery(window).width() > 765, jQuery.isAndroidDefault = jQuery.browser.android && !/chrome/i.test(nAgt), ! function(a) { /iphone|ipod|ipad|android|ie|blackberry|fennec/.test(navigator.userAgent.toLowerCase()); var b = "ontouchstart" in window || window.navigator && window.navigator.msPointerEnabled && window.MSGesture || window.DocumentTouch && document instanceof DocumentTouch || !1; a.simpleSlider = { defaults: { initialval: 0, scale: 100, orientation: "h", readonly: !1, callback: !1 }, events: { start: b ? "touchstart" : "mousedown", end: b ? "touchend" : "mouseup", move: b ? "touchmove" : "mousemove" }, init: function(c) { return this.each(function() { var d = this, e = a(d); e.addClass("simpleSlider"), d.opt = {}, a.extend(d.opt, a.simpleSlider.defaults, c), a.extend(d.opt, e.data()); var f = "h" == d.opt.orientation ? "horizontal" : "vertical", g = a("").addClass("level").addClass(f); e.prepend(g), d.level = g, e.css({ cursor: "default" }), "auto" == d.opt.scale && (d.opt.scale = a(d).outerWidth()), e.updateSliderVal(), d.opt.readonly || (e.on(a.simpleSlider.events.start, function(a) { b && (a = a.changedTouches[0]), d.canSlide = !0, e.updateSliderVal(a), e.css({ cursor: "col-resize" }), a.preventDefault(), a.stopPropagation() }), a(document).on(a.simpleSlider.events.move, function(c) { b && (c = c.changedTouches[0]), d.canSlide && (a(document).css({ cursor: "default" }), e.updateSliderVal(c), c.preventDefault(), c.stopPropagation()) }).on(a.simpleSlider.events.end, function() { a(document).css({ cursor: "auto" }), d.canSlide = !1, e.css({ cursor: "auto" }) })) }) }, updateSliderVal: function(b) { function c(a, b) { return Math.floor(100 * a / b) } var d = this, e = d.get(0); e.opt.initialval = "number" == typeof e.opt.initialval ? e.opt.initialval : e.opt.initialval(e); var f = a(e).outerWidth(), g = a(e).outerHeight(); e.x = "object" == typeof b ? b.clientX + document.body.scrollLeft - d.offset().left : "number" == typeof b ? b * f / e.opt.scale : e.opt.initialval * f / e.opt.scale, e.y = "object" == typeof b ? b.clientY + document.body.scrollTop - d.offset().top : "number" == typeof b ? (e.opt.scale - e.opt.initialval - b) * g / e.opt.scale : e.opt.initialval * g / e.opt.scale, e.y = d.outerHeight() - e.y, e.scaleX = e.x * e.opt.scale / f, e.scaleY = e.y * e.opt.scale / g, e.outOfRangeX = e.scaleX > e.opt.scale ? e.scaleX - e.opt.scale : e.scaleX < 0 ? e.scaleX : 0, e.outOfRangeY = e.scaleY > e.opt.scale ? e.scaleY - e.opt.scale : e.scaleY < 0 ? e.scaleY : 0, e.outOfRange = "h" == e.opt.orientation ? e.outOfRangeX : e.outOfRangeY, e.value = "undefined" != typeof b ? "h" == e.opt.orientation ? e.x >= d.outerWidth() ? e.opt.scale : e.x <= 0 ? 0 : e.scaleX : e.y >= d.outerHeight() ? e.opt.scale : e.y <= 0 ? 0 : e.scaleY : "h" == e.opt.orientation ? e.scaleX : e.scaleY, "h" == e.opt.orientation ? e.level.width(c(e.x, f) + "%") : e.level.height(c(e.y, g)), "function" == typeof e.opt.callback && e.opt.callback(e) } }, a.fn.simpleSlider = a.simpleSlider.init, a.fn.updateSliderVal = a.simpleSlider.updateSliderVal }(jQuery), ! function(a) { a.mbCookie = { set: function(a, b, c, d) { b = JSON.stringify(b), c || (c = 7), d = d ? "; domain=" + d : ""; var e, f = new Date; f.setTime(f.getTime() + 864e5 * c), e = "; expires=" + f.toGMTString(), document.cookie = a + "=" + b + e + "; path=/" + d }, get: function(a) { for (var b = a + "=", c = document.cookie.split(";"), d = 0; d < c.length; d++) { for (var e = c[d]; " " == e.charAt(0);) e = e.substring(1, e.length); if (0 == e.indexOf(b)) return JSON.parse(e.substring(b.length, e.length)) } return null }, remove: function(b) { a.mbCookie.set(b, "", -1) } }, a.mbStorage = { set: function(a, b) { b = JSON.stringify(b), localStorage.setItem(a, b) }, get: function(a) { return localStorage[a] ? JSON.parse(localStorage[a]) : null }, remove: function(a) { a ? localStorage.removeItem(a) : localStorage.clear() } } }(jQuery); /*! * jQuery Cookie Plugin v1.4.1 * https://github.com/carhartl/jquery-cookie * * Copyright 2006, 2014 Klaus Hartl * Released under the MIT license */ ! function(e) { "function" == typeof define && define.amd ? define(["jquery"], e) : "object" == typeof exports ? module.exports = e(require("jquery")) : e(jQuery) }(function(e) { function n(e) { return u.raw ? e : encodeURIComponent(e) } function o(e) { return u.raw ? e : decodeURIComponent(e) } function i(e) { return n(u.json ? JSON.stringify(e) : String(e)) } function t(e) { 0 === e.indexOf('"') && (e = e.slice(1, -1).replace(/\\"/g, '"').replace(/\\\\/g, "\\")); try { return e = decodeURIComponent(e.replace(c, " ")), u.json ? JSON.parse(e) : e } catch (n) {} } function r(n, o) { var i = u.raw ? n : t(n); return e.isFunction(o) ? o(i) : i } var c = /\+/g, u = e.cookie = function(t, c, s) { if (arguments.length > 1 && !e.isFunction(c)) { if (s = e.extend({}, u.defaults, s), "number" == typeof s.expires) { var a = s.expires, d = s.expires = new Date; d.setMilliseconds(d.getMilliseconds() + 864e5 * a) } return document.cookie = [n(t), "=", i(c), s.expires ? "; expires=" + s.expires.toUTCString() : "", s.path ? "; path=" + s.path : "", s.domain ? "; domain=" + s.domain : "", s.secure ? "; secure" : ""].join("") } for (var f = t ? void 0 : {}, p = document.cookie ? document.cookie.split("; ") : [], l = 0, m = p.length; m > l; l++) { var x = p[l].split("="), g = o(x.shift()), j = x.join("="); if (t === g) { f = r(j, c); break } t || void 0 === (j = r(j)) || (f[g] = j) } return f }; u.defaults = {}, e.removeCookie = function(n, o) { return e.cookie(n, "", e.extend({}, o, { expires: -1 })), !e.cookie(n) } }); /**! * easy-pie-chart * Lightweight plugin to render simple, animated and retina optimized pie charts * * @license * @author Robert Fleischmann")[0], h = r.each; d.style.cssText = "background-color:rgba(1,1,1,.5)", p.rgba = d.style.backgroundColor.indexOf("rgba") > -1, h(c, function(r, n) { n.cache = "_" + r, n.props.alpha = { idx: 3, type: "percent", def: 1 } }), l.fn = r.extend(l.prototype, { parse: function(o, s, i, u) { if (o === n) return this._rgba = [null, null, null, null], this; (o.jquery || o.nodeType) && (o = r(o).css(s), s = n); var f = this, p = r.type(o), d = this._rgba = []; return s !== n && (o = [o, s, i, u], p = "array"), "string" === p ? this.parse(e(o) || a._default) : "array" === p ? (h(c.rgba.props, function(r, n) { d[n.idx] = t(o[n.idx], n) }), this) : "object" === p ? (o instanceof l ? h(c, function(r, n) { o[n.cache] && (f[n.cache] = o[n.cache].slice()) }) : h(c, function(n, e) { var a = e.cache; h(e.props, function(r, n) { if (!f[a] && e.to) { if ("alpha" === r || null == o[r]) return; f[a] = e.to(f._rgba) } f[a][n.idx] = t(o[r], n, !0) }), f[a] && r.inArray(null, f[a].slice(0, 3)) < 0 && (f[a][3] = 1, e.from && (f._rgba = e.from(f[a]))) }), this) : void 0 }, is: function(r) { var n = l(r), t = !0, e = this; return h(c, function(r, o) { var a, s = n[o.cache]; return s && (a = e[o.cache] || o.to && o.to(e._rgba) || [], h(o.props, function(r, n) { return null != s[n.idx] ? t = s[n.idx] === a[n.idx] : void 0 })), t }), t }, _space: function() { var r = [], n = this; return h(c, function(t, e) { n[e.cache] && r.push(t) }), r.pop() }, transition: function(r, n) { var e = l(r), o = e._space(), a = c[o], s = 0 === this.alpha() ? l("transparent") : this, i = s[a.cache] || a.to(s._rgba), u = i.slice(); return e = e[a.cache], h(a.props, function(r, o) { var a = o.idx, s = i[a], l = e[a], c = f[o.type] || {}; null !== l && (null === s ? u[a] = l : (c.mod && (l - s > c.mod / 2 ? s += c.mod : s - l > c.mod / 2 && (s -= c.mod)), u[a] = t((l - s) * n + s, o))) }), this[o](u) }, blend: function(n) { if (1 === this._rgba[3]) return this; var t = this._rgba.slice(), e = t.pop(), o = l(n)._rgba; return l(r.map(t, function(r, n) { return (1 - e) * o[n] + e * r })) }, toRgbaString: function() { var n = "rgba(", t = r.map(this._rgba, function(r, n) { return null == r ? n > 2 ? 1 : 0 : r }); return 1 === t[3] && (t.pop(), n = "rgb("), n + t.join() + ")" }, toHslaString: function() { var n = "hsla(", t = r.map(this.hsla(), function(r, n) { return null == r && (r = n > 2 ? 1 : 0), n && 3 > n && (r = Math.round(100 * r) + "%"), r }); return 1 === t[3] && (t.pop(), n = "hsl("), n + t.join() + ")" }, toHexString: function(n) { var t = this._rgba.slice(), e = t.pop(); return n && t.push(~~(255 * e)), "#" + r.map(t, function(r) { return r = (r || 0).toString(16), 1 === r.length ? "0" + r : r }).join("") }, toString: function() { return 0 === this._rgba[3] ? "transparent" : this.toRgbaString() } }), l.fn.parse.prototype = l.fn, c.hsla.to = function(r) { if (null == r[0] || null == r[1] || null == r[2]) return [null, null, null, r[3]]; var n, t, e = r[0] / 255, o = r[1] / 255, a = r[2] / 255, s = r[3], i = Math.max(e, o, a), u = Math.min(e, o, a), l = i - u, c = i + u, f = .5 * c; return n = u === i ? 0 : e === i ? 60 * (o - a) / l + 360 : o === i ? 60 * (a - e) / l + 120 : 60 * (e - o) / l + 240, t = 0 === l ? 0 : .5 >= f ? l / c : l / (2 - c), [Math.round(n) % 360, t, f, null == s ? 1 : s] }, c.hsla.from = function(r) { if (null == r[0] || null == r[1] || null == r[2]) return [null, null, null, r[3]]; var n = r[0] / 360, t = r[1], e = r[2], a = r[3], s = .5 >= e ? e * (1 + t) : e + t - e * t, i = 2 * e - s; return [Math.round(255 * o(i, s, n + 1 / 3)), Math.round(255 * o(i, s, n)), Math.round(255 * o(i, s, n - 1 / 3)), a] }, h(c, function(e, o) { var a = o.props, s = o.cache, u = o.to, c = o.from; l.fn[e] = function(e) { if (u && !this[s] && (this[s] = u(this._rgba)), e === n) return this[s].slice(); var o, i = r.type(e), f = "array" === i || "object" === i ? e : arguments, p = this[s].slice(); return h(a, function(r, n) { var e = f["object" === i ? r : n.idx]; null == e && (e = p[n.idx]), p[n.idx] = t(e, n) }), c ? (o = l(c(p)), o[s] = p, o) : l(p) }, h(a, function(n, t) { l.fn[n] || (l.fn[n] = function(o) { var a, s = r.type(o), u = "alpha" === n ? this._hsla ? "hsla" : "rgba" : e, l = this[u](), c = l[t.idx]; return "undefined" === s ? c : ("function" === s && (o = o.call(this, c), s = r.type(o)), null == o && t.empty ? this : ("string" === s && (a = i.exec(o), a && (o = c + parseFloat(a[2]) * ("+" === a[1] ? 1 : -1))), l[t.idx] = o, this[u](l))) }) }) }), l.hook = function(n) { var t = n.split(" "); h(t, function(n, t) { r.cssHooks[t] = { set: function(n, o) { var a, s, i = ""; if ("transparent" !== o && ("string" !== r.type(o) || (a = e(o)))) { if (o = l(a || o), !p.rgba && 1 !== o._rgba[3]) { for (s = "backgroundColor" === t ? n.parentNode : n; ("" === i || "transparent" === i) && s && s.style;) try { i = r.css(s, "backgroundColor"), s = s.parentNode } catch (u) {} o = o.blend(i && "transparent" !== i ? i : "_default") } o = o.toRgbaString() } try { n.style[t] = o } catch (u) {} } }, r.fx.step[t] = function(n) { n.colorInit || (n.start = l(n.elem, t), n.end = l(n.end), n.colorInit = !0), r.cssHooks[t].set(n.elem, n.start.transition(n.end, n.pos)) } }) }, l.hook(s), r.cssHooks.borderColor = { expand: function(r) { var n = {}; return h(["Top", "Right", "Bottom", "Left"], function(t, e) { n["border" + e + "Color"] = r }), n } }, a = r.Color.names = { aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [null, null, null, 0], _default: "#ffffff" } }(jQuery); // Toastr v2.1.0 ! function(e) { e(["jquery"], function(e) { return function() { function t(e, t, n) { return f({ type: O.error, iconClass: g().iconClasses.error, message: e, optionsOverride: n, title: t }) } function n(t, n) { return t || (t = g()), v = e("#" + t.containerId), v.length ? v : (n && (v = c(t)), v) } function i(e, t, n) { return f({ type: O.info, iconClass: g().iconClasses.info, message: e, optionsOverride: n, title: t }) } function o(e) { w = e } function s(e, t, n) { return f({ type: O.success, iconClass: g().iconClasses.success, message: e, optionsOverride: n, title: t }) } function a(e, t, n) { return f({ type: O.warning, iconClass: g().iconClasses.warning, message: e, optionsOverride: n, title: t }) } function r(e) { var t = g(); v || n(t), l(e, t) || u(t) } function d(t) { var i = g(); return v || n(i), t && 0 === e(":focus", t).length ? void h(t) : void(v.children().length && v.remove()) } function u(t) { for (var n = v.children(), i = n.length - 1; i >= 0; i--) l(e(n[i]), t) } function l(t, n) { return t && 0 === e(":focus", t).length ? (t[n.hideMethod]({ duration: n.hideDuration, easing: n.hideEasing, complete: function() { h(t) } }), !0) : !1 } function c(t) { return v = e("
").attr("id", t.containerId).addClass(t.positionClass).attr("aria-live", "polite").attr("role", "alert"), v.appendTo(e(t.target)), v } function p() { return { tapToDismiss: !0, toastClass: "toast", containerId: "toast-container", debug: !1, showMethod: "fadeIn", showDuration: 300, showEasing: "swing", onShown: void 0, hideMethod: "fadeOut", hideDuration: 1e3, hideEasing: "swing", onHidden: void 0, extendedTimeOut: 1e3, iconClasses: { error: "toast-error", info: "toast-info", success: "toast-success", warning: "toast-warning" }, iconClass: "toast-info", positionClass: "toast-top-right", timeOut: 5e3, titleClass: "toast-title", messageClass: "toast-message", target: "body", closeHtml: '', newestOnTop: !0, preventDuplicates: !1, progressBar: !1 } } function m(e) { w && w(e) } function f(t) { function i(t) { return !e(":focus", l).length || t ? (clearTimeout(O.intervalId), l[r.hideMethod]({ duration: r.hideDuration, easing: r.hideEasing, complete: function() { h(l), r.onHidden && "hidden" !== b.state && r.onHidden(), b.state = "hidden", b.endTime = new Date, m(b) } })) : void 0 } function o() { (r.timeOut > 0 || r.extendedTimeOut > 0) && (u = setTimeout(i, r.extendedTimeOut), O.maxHideTime = parseFloat(r.extendedTimeOut), O.hideEta = (new Date).getTime() + O.maxHideTime) } function s() { clearTimeout(u), O.hideEta = 0, l.stop(!0, !0)[r.showMethod]({ duration: r.showDuration, easing: r.showEasing }) } function a() { var e = (O.hideEta - (new Date).getTime()) / O.maxHideTime * 100; f.width(e + "%") } var r = g(), d = t.iconClass || r.iconClass; if ("undefined" != typeof t.optionsOverride && (r = e.extend(r, t.optionsOverride), d = t.optionsOverride.iconClass || d), r.preventDuplicates) { if (t.message === C) return; C = t.message } T++, v = n(r, !0); var u = null, l = e(""), c = e(""), p = e(""), f = e(""), w = e(r.closeHtml), O = { intervalId: null, hideEta: null, maxHideTime: null }, b = { toastId: T, state: "visible", startTime: new Date, options: r, map: t }; return t.iconClass && l.addClass(r.toastClass).addClass(d), t.title && (c.append(t.title).addClass(r.titleClass), l.append(c)), t.message && (p.append(t.message).addClass(r.messageClass), l.append(p)), r.closeButton && (w.addClass("toast-close-button").attr("role", "button"), l.prepend(w)), r.progressBar && (f.addClass("toast-progress"), l.prepend(f)), l.hide(), r.newestOnTop ? v.prepend(l) : v.append(l), l[r.showMethod]({ duration: r.showDuration, easing: r.showEasing, complete: r.onShown }), r.timeOut > 0 && (u = setTimeout(i, r.timeOut), O.maxHideTime = parseFloat(r.timeOut), O.hideEta = (new Date).getTime() + O.maxHideTime, r.progressBar && (O.intervalId = setInterval(a, 10))), l.hover(s, o), !r.onclick && r.tapToDismiss && l.click(i), r.closeButton && w && w.click(function(e) { e.stopPropagation ? e.stopPropagation() : void 0 !== e.cancelBubble && e.cancelBubble !== !0 && (e.cancelBubble = !0), i(!0) }), r.onclick && l.click(function() { r.onclick(), i() }), m(b), r.debug && console && console.log(b), l } function g() { return e.extend({}, p(), b.options) } function h(e) { v || (v = n()), e.is(":visible") || (e.remove(), e = null, 0 === v.children().length && (v.remove(), C = void 0)) } var v, w, C, T = 0, O = { error: "error", info: "info", success: "success", warning: "warning" }, b = { clear: r, remove: d, error: t, getContainer: n, info: i, options: {}, subscribe: o, success: s, version: "2.1.0", warning: a }; return b }() }) }("function" == typeof define && define.amd ? define : function(e, t) { "undefined" != typeof module && module.exports ? module.exports = t(require("jquery")) : window.toastr = t(window.jQuery) }); /*! * Chart.js * http://chartjs.org/ * Version: 1.0.2 * * Copyright 2015 Nick Downie * Released under the MIT license * https://github.com/nnnick/Chart.js/blob/master/LICENSE.md */ (function() { "use strict"; var t = this, i = t.Chart, e = function(t) { this.canvas = t.canvas, this.ctx = t; var i = function(t, i) { return t["offset" + i] ? t["offset" + i] : document.defaultView.getComputedStyle(t).getPropertyValue(i) }, e = this.width = i(t.canvas, "Width"), n = this.height = i(t.canvas, "Height"); t.canvas.width = e, t.canvas.height = n; var e = this.width = t.canvas.width, n = this.height = t.canvas.height; return this.aspectRatio = this.width / this.height, s.retinaScale(this), this }; e.defaults = { global: { animation: !0, animationSteps: 60, animationEasing: "easeOutQuart", showScale: !0, scaleOverride: !1, scaleSteps: null, scaleStepWidth: null, scaleStartValue: null, scaleLineColor: "rgba(0,0,0,.1)", scaleLineWidth: 1, scaleShowLabels: !0, scaleLabel: "<%=value%>", scaleIntegersOnly: !0, scaleBeginAtZero: !1, scaleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", scaleFontSize: 12, scaleFontStyle: "normal", scaleFontColor: "#666", responsive: !1, maintainAspectRatio: !0, showTooltips: !0, customTooltips: !1, tooltipEvents: ["mousemove", "touchstart", "touchmove", "mouseout"], tooltipFillColor: "rgba(0,0,0,0.8)", tooltipFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", tooltipFontSize: 14, tooltipFontStyle: "normal", tooltipFontColor: "#fff", tooltipTitleFontFamily: "'Helvetica Neue', 'Helvetica', 'Arial', sans-serif", tooltipTitleFontSize: 14, tooltipTitleFontStyle: "bold", tooltipTitleFontColor: "#fff", tooltipYPadding: 6, tooltipXPadding: 6, tooltipCaretSize: 8, tooltipCornerRadius: 6, tooltipXOffset: 10, tooltipTemplate: "<%if (label){%><%=label%>: <%}%><%= value %>", multiTooltipTemplate: "<%= value %>", multiTooltipKeyBackground: "#fff", onAnimationProgress: function() {}, onAnimationComplete: function() {} } }, e.types = {}; var s = e.helpers = {}, n = s.each = function(t, i, e) { var s = Array.prototype.slice.call(arguments, 3); if (t) if (t.length === +t.length) { var n; for (n = 0; n < t.length; n++) i.apply(e, [t[n], n].concat(s)) } else for (var o in t) i.apply(e, [t[o], o].concat(s)) }, o = s.clone = function(t) { var i = {}; return n(t, function(e, s) { t.hasOwnProperty(s) && (i[s] = e) }), i }, a = s.extend = function(t) { return n(Array.prototype.slice.call(arguments, 1), function(i) { n(i, function(e, s) { i.hasOwnProperty(s) && (t[s] = e) }) }), t }, h = s.merge = function() { var t = Array.prototype.slice.call(arguments, 0); return t.unshift({}), a.apply(null, t) }, l = s.indexOf = function(t, i) { if (Array.prototype.indexOf) return t.indexOf(i); for (var e = 0; e < t.length; e++) if (t[e] === i) return e; return -1 }, r = (s.where = function(t, i) { var e = []; return s.each(t, function(t) { i(t) && e.push(t) }), e }, s.findNextWhere = function(t, i, e) { e || (e = -1); for (var s = e + 1; s < t.length; s++) { var n = t[s]; if (i(n)) return n } }, s.findPreviousWhere = function(t, i, e) { e || (e = t.length); for (var s = e - 1; s >= 0; s--) { var n = t[s]; if (i(n)) return n } }, s.inherits = function(t) { var i = this, e = t && t.hasOwnProperty("constructor") ? t.constructor : function() { return i.apply(this, arguments) }, s = function() { this.constructor = e }; return s.prototype = i.prototype, e.prototype = new s, e.extend = r, t && a(e.prototype, t), e.__super__ = i.prototype, e }), c = s.noop = function() {}, u = s.uid = function() { var t = 0; return function() { return "chart-" + t++ } }(), d = s.warn = function(t) { window.console && "function" == typeof window.console.warn && console.warn(t) }, p = s.amd = "function" == typeof define && define.amd, f = s.isNumber = function(t) { return !isNaN(parseFloat(t)) && isFinite(t) }, g = s.max = function(t) { return Math.max.apply(Math, t) }, m = s.min = function(t) { return Math.min.apply(Math, t) }, v = (s.cap = function(t, i, e) { if (f(i)) { if (t > i) return i } else if (f(e) && e > t) return e; return t }, s.getDecimalPlaces = function(t) { return t % 1 !== 0 && f(t) ? t.toString().split(".")[1].length : 0 }), S = s.radians = function(t) { return t * (Math.PI / 180) }, x = (s.getAngleFromPoint = function(t, i) { var e = i.x - t.x, s = i.y - t.y, n = Math.sqrt(e * e + s * s), o = 2 * Math.PI + Math.atan2(s, e); return 0 > e && 0 > s && (o += 2 * Math.PI), { angle: o, distance: n } }, s.aliasPixel = function(t) { return t % 2 === 0 ? 0 : .5 }), y = (s.splineCurve = function(t, i, e, s) { var n = Math.sqrt(Math.pow(i.x - t.x, 2) + Math.pow(i.y - t.y, 2)), o = Math.sqrt(Math.pow(e.x - i.x, 2) + Math.pow(e.y - i.y, 2)), a = s * n / (n + o), h = s * o / (n + o); return { inner: { x: i.x - a * (e.x - t.x), y: i.y - a * (e.y - t.y) }, outer: { x: i.x + h * (e.x - t.x), y: i.y + h * (e.y - t.y) } } }, s.calculateOrderOfMagnitude = function(t) { return Math.floor(Math.log(t) / Math.LN10) }), C = (s.calculateScaleRange = function(t, i, e, s, n) { var o = 2, a = Math.floor(i / (1.5 * e)), h = o >= a, l = g(t), r = m(t); l === r && (l += .5, r >= .5 && !s ? r -= .5 : l += .5); for (var c = Math.abs(l - r), u = y(c), d = Math.ceil(l / (1 * Math.pow(10, u))) * Math.pow(10, u), p = s ? 0 : Math.floor(r / (1 * Math.pow(10, u))) * Math.pow(10, u), f = d - p, v = Math.pow(10, u), S = Math.round(f / v); (S > a || a > 2 * S) && !h;) if (S > a) v *= 2, S = Math.round(f / v), S % 1 !== 0 && (h = !0); else if (n && u >= 0) { if (v / 2 % 1 !== 0) break; v /= 2, S = Math.round(f / v) } else v /= 2, S = Math.round(f / v); return h && (S = o, v = f / S), { steps: S, stepValue: v, min: p, max: p + S * v } }, s.template = function(t, i) { function e(t, i) { var e = /\W/.test(t) ? new Function("obj", "var p=[],print=function(){p.push.apply(p,arguments);};with(obj){p.push('" + t.replace(/[\r\t\n]/g, " ").split("<%").join(" ").replace(/((^|%>)[^\t]*)'/g, "$1\r").replace(/\t=(.*?)%>/g, "',$1,'").split(" ").join("');").split("%>").join("p.push('").split("\r").join("\\'") + "');}return p.join('');") : s[t] = s[t]; return i ? e(i) : e } if (t instanceof Function) return t(i); var s = {}; return e(t, i) }), w = (s.generateLabels = function(t, i, e, s) { var o = new Array(i); return labelTemplateString && n(o, function(i, n) { o[n] = C(t, { value: e + s * (n + 1) }) }), o }, s.easingEffects = { linear: function(t) { return t }, easeInQuad: function(t) { return t * t }, easeOutQuad: function(t) { return -1 * t * (t - 2) }, easeInOutQuad: function(t) { return (t /= .5) < 1 ? .5 * t * t : -0.5 * (--t * (t - 2) - 1) }, easeInCubic: function(t) { return t * t * t }, easeOutCubic: function(t) { return 1 * ((t = t / 1 - 1) * t * t + 1) }, easeInOutCubic: function(t) { return (t /= .5) < 1 ? .5 * t * t * t : .5 * ((t -= 2) * t * t + 2) }, easeInQuart: function(t) { return t * t * t * t }, easeOutQuart: function(t) { return -1 * ((t = t / 1 - 1) * t * t * t - 1) }, easeInOutQuart: function(t) { return (t /= .5) < 1 ? .5 * t * t * t * t : -0.5 * ((t -= 2) * t * t * t - 2) }, easeInQuint: function(t) { return 1 * (t /= 1) * t * t * t * t }, easeOutQuint: function(t) { return 1 * ((t = t / 1 - 1) * t * t * t * t + 1) }, easeInOutQuint: function(t) { return (t /= .5) < 1 ? .5 * t * t * t * t * t : .5 * ((t -= 2) * t * t * t * t + 2) }, easeInSine: function(t) { return -1 * Math.cos(t / 1 * (Math.PI / 2)) + 1 }, easeOutSine: function(t) { return 1 * Math.sin(t / 1 * (Math.PI / 2)) }, easeInOutSine: function(t) { return -0.5 * (Math.cos(Math.PI * t / 1) - 1) }, easeInExpo: function(t) { return 0 === t ? 1 : 1 * Math.pow(2, 10 * (t / 1 - 1)) }, easeOutExpo: function(t) { return 1 === t ? 1 : 1 * (-Math.pow(2, -10 * t / 1) + 1) }, easeInOutExpo: function(t) { return 0 === t ? 0 : 1 === t ? 1 : (t /= .5) < 1 ? .5 * Math.pow(2, 10 * (t - 1)) : .5 * (-Math.pow(2, -10 * --t) + 2) }, easeInCirc: function(t) { return t >= 1 ? t : -1 * (Math.sqrt(1 - (t /= 1) * t) - 1) }, easeOutCirc: function(t) { return 1 * Math.sqrt(1 - (t = t / 1 - 1) * t) }, easeInOutCirc: function(t) { return (t /= .5) < 1 ? -0.5 * (Math.sqrt(1 - t * t) - 1) : .5 * (Math.sqrt(1 - (t -= 2) * t) + 1) }, easeInElastic: function(t) { var i = 1.70158, e = 0, s = 1; return 0 === t ? 0 : 1 == (t /= 1) ? 1 : (e || (e = .3), s < Math.abs(1) ? (s = 1, i = e / 4) : i = e / (2 * Math.PI) * Math.asin(1 / s), -(s * Math.pow(2, 10 * (t -= 1)) * Math.sin(2 * (1 * t - i) * Math.PI / e))) }, easeOutElastic: function(t) { var i = 1.70158, e = 0, s = 1; return 0 === t ? 0 : 1 == (t /= 1) ? 1 : (e || (e = .3), s < Math.abs(1) ? (s = 1, i = e / 4) : i = e / (2 * Math.PI) * Math.asin(1 / s), s * Math.pow(2, -10 * t) * Math.sin(2 * (1 * t - i) * Math.PI / e) + 1) }, easeInOutElastic: function(t) { var i = 1.70158, e = 0, s = 1; return 0 === t ? 0 : 2 == (t /= .5) ? 1 : (e || (e = .3 * 1.5), s < Math.abs(1) ? (s = 1, i = e / 4) : i = e / (2 * Math.PI) * Math.asin(1 / s), 1 > t ? -.5 * s * Math.pow(2, 10 * (t -= 1)) * Math.sin(2 * (1 * t - i) * Math.PI / e) : s * Math.pow(2, -10 * (t -= 1)) * Math.sin(2 * (1 * t - i) * Math.PI / e) * .5 + 1) }, easeInBack: function(t) { var i = 1.70158; return 1 * (t /= 1) * t * ((i + 1) * t - i) }, easeOutBack: function(t) { var i = 1.70158; return 1 * ((t = t / 1 - 1) * t * ((i + 1) * t + i) + 1) }, easeInOutBack: function(t) { var i = 1.70158; return (t /= .5) < 1 ? .5 * t * t * (((i *= 1.525) + 1) * t - i) : .5 * ((t -= 2) * t * (((i *= 1.525) + 1) * t + i) + 2) }, easeInBounce: function(t) { return 1 - w.easeOutBounce(1 - t) }, easeOutBounce: function(t) { return (t /= 1) < 1 / 2.75 ? 7.5625 * t * t : 2 / 2.75 > t ? 1 * (7.5625 * (t -= 1.5 / 2.75) * t + .75) : 2.5 / 2.75 > t ? 1 * (7.5625 * (t -= 2.25 / 2.75) * t + .9375) : 1 * (7.5625 * (t -= 2.625 / 2.75) * t + .984375) }, easeInOutBounce: function(t) { return .5 > t ? .5 * w.easeInBounce(2 * t) : .5 * w.easeOutBounce(2 * t - 1) + .5 } }), b = s.requestAnimFrame = function() { return window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function(t) { return window.setTimeout(t, 1e3 / 60) } }(), P = s.cancelAnimFrame = function() { return window.cancelAnimationFrame || window.webkitCancelAnimationFrame || window.mozCancelAnimationFrame || window.oCancelAnimationFrame || window.msCancelAnimationFrame || function(t) { return window.clearTimeout(t, 1e3 / 60) } }(), L = (s.animationLoop = function(t, i, e, s, n, o) { var a = 0, h = w[e] || w.linear, l = function() { a++; var e = a / i, r = h(e); t.call(o, r, e, a), s.call(o, r, e), i > a ? o.animationFrame = b(l) : n.apply(o) }; b(l) }, s.getRelativePosition = function(t) { var i, e, s = t.originalEvent || t, n = t.currentTarget || t.srcElement, o = n.getBoundingClientRect(); return s.touches ? (i = s.touches[0].clientX - o.left, e = s.touches[0].clientY - o.top) : (i = s.clientX - o.left, e = s.clientY - o.top), { x: i, y: e } }, s.addEvent = function(t, i, e) { t.addEventListener ? t.addEventListener(i, e) : t.attachEvent ? t.attachEvent("on" + i, e) : t["on" + i] = e }), k = s.removeEvent = function(t, i, e) { t.removeEventListener ? t.removeEventListener(i, e, !1) : t.detachEvent ? t.detachEvent("on" + i, e) : t["on" + i] = c }, F = (s.bindEvents = function(t, i, e) { t.events || (t.events = {}), n(i, function(i) { t.events[i] = function() { e.apply(t, arguments) }, L(t.chart.canvas, i, t.events[i]) }) }, s.unbindEvents = function(t, i) { n(i, function(i, e) { k(t.chart.canvas, e, i) }) }), R = s.getMaximumWidth = function(t) { var i = t.parentNode; return i.clientWidth }, T = s.getMaximumHeight = function(t) { var i = t.parentNode; return i.clientHeight }, A = (s.getMaximumSize = s.getMaximumWidth, s.retinaScale = function(t) { var i = t.ctx, e = t.canvas.width, s = t.canvas.height; window.devicePixelRatio && (i.canvas.style.width = e + "px", i.canvas.style.height = s + "px", i.canvas.height = s * window.devicePixelRatio, i.canvas.width = e * window.devicePixelRatio, i.scale(window.devicePixelRatio, window.devicePixelRatio)) }), M = s.clear = function(t) { t.ctx.clearRect(0, 0, t.width, t.height) }, W = s.fontString = function(t, i, e) { return i + " " + t + "px " + e }, z = s.longestText = function(t, i, e) { t.font = i; var s = 0; return n(e, function(i) { var e = t.measureText(i).width; s = e > s ? e : s }), s }, B = s.drawRoundedRectangle = function(t, i, e, s, n, o) { t.beginPath(), t.moveTo(i + o, e), t.lineTo(i + s - o, e), t.quadraticCurveTo(i + s, e, i + s, e + o), t.lineTo(i + s, e + n - o), t.quadraticCurveTo(i + s, e + n, i + s - o, e + n), t.lineTo(i + o, e + n), t.quadraticCurveTo(i, e + n, i, e + n - o), t.lineTo(i, e + o), t.quadraticCurveTo(i, e, i + o, e), t.closePath() }; e.instances = {}, e.Type = function(t, i, s) { this.options = i, this.chart = s, this.id = u(), e.instances[this.id] = this, i.responsive && this.resize(), this.initialize.call(this, t) }, a(e.Type.prototype, { initialize: function() { return this }, clear: function() { return M(this.chart), this }, stop: function() { return P(this.animationFrame), this }, resize: function(t) { this.stop(); var i = this.chart.canvas, e = R(this.chart.canvas), s = this.options.maintainAspectRatio ? e / this.chart.aspectRatio : T(this.chart.canvas); return i.width = this.chart.width = e, i.height = this.chart.height = s, A(this.chart), "function" == typeof t && t.apply(this, Array.prototype.slice.call(arguments, 1)), this }, reflow: c, render: function(t) { return t && this.reflow(), this.options.animation && !t ? s.animationLoop(this.draw, this.options.animationSteps, this.options.animationEasing, this.options.onAnimationProgress, this.options.onAnimationComplete, this) : (this.draw(), this.options.onAnimationComplete.call(this)), this }, generateLegend: function() { return C(this.options.legendTemplate, this) }, destroy: function() { this.clear(), F(this, this.events); var t = this.chart.canvas; t.width = this.chart.width, t.height = this.chart.height, t.style.removeProperty ? (t.style.removeProperty("width"), t.style.removeProperty("height")) : (t.style.removeAttribute("width"), t.style.removeAttribute("height")), delete e.instances[this.id] }, showTooltip: function(t, i) { "undefined" == typeof this.activeElements && (this.activeElements = []); var o = function(t) { var i = !1; return t.length !== this.activeElements.length ? i = !0 : (n(t, function(t, e) { t !== this.activeElements[e] && (i = !0) }, this), i) }.call(this, t); if (o || i) { if (this.activeElements = t, this.draw(), this.options.customTooltips && this.options.customTooltips(!1), t.length > 0) if (this.datasets && this.datasets.length > 1) { for (var a, h, r = this.datasets.length - 1; r >= 0 && (a = this.datasets[r].points || this.datasets[r].bars || this.datasets[r].segments, h = l(a, t[0]), -1 === h); r--); var c = [], u = [], d = function() { var t, i, e, n, o, a = [], l = [], r = []; return s.each(this.datasets, function(i) { t = i.points || i.bars || i.segments, t[h] && t[h].hasValue() && a.push(t[h]) }), s.each(a, function(t) { l.push(t.x), r.push(t.y), c.push(s.template(this.options.multiTooltipTemplate, t)), u.push({ fill: t._saved.fillColor || t.fillColor, stroke: t._saved.strokeColor || t.strokeColor }) }, this), o = m(r), e = g(r), n = m(l), i = g(l), { x: n > this.chart.width / 2 ? n : i, y: (o + e) / 2 } }.call(this, h); new e.MultiTooltip({ x: d.x, y: d.y, xPadding: this.options.tooltipXPadding, yPadding: this.options.tooltipYPadding, xOffset: this.options.tooltipXOffset, fillColor: this.options.tooltipFillColor, textColor: this.options.tooltipFontColor, fontFamily: this.options.tooltipFontFamily, fontStyle: this.options.tooltipFontStyle, fontSize: this.options.tooltipFontSize, titleTextColor: this.options.tooltipTitleFontColor, titleFontFamily: this.options.tooltipTitleFontFamily, titleFontStyle: this.options.tooltipTitleFontStyle, titleFontSize: this.options.tooltipTitleFontSize, cornerRadius: this.options.tooltipCornerRadius, labels: c, legendColors: u, legendColorBackground: this.options.multiTooltipKeyBackground, title: t[0].label, chart: this.chart, ctx: this.chart.ctx, custom: this.options.customTooltips }).draw() } else n(t, function(t) { var i = t.tooltipPosition(); new e.Tooltip({ x: Math.round(i.x), y: Math.round(i.y), xPadding: this.options.tooltipXPadding, yPadding: this.options.tooltipYPadding, fillColor: this.options.tooltipFillColor, textColor: this.options.tooltipFontColor, fontFamily: this.options.tooltipFontFamily, fontStyle: this.options.tooltipFontStyle, fontSize: this.options.tooltipFontSize, caretHeight: this.options.tooltipCaretSize, cornerRadius: this.options.tooltipCornerRadius, text: C(this.options.tooltipTemplate, t), chart: this.chart, custom: this.options.customTooltips }).draw() }, this); return this } }, toBase64Image: function() { return this.chart.canvas.toDataURL.apply(this.chart.canvas, arguments) } }), e.Type.extend = function(t) { var i = this, s = function() { return i.apply(this, arguments) }; if (s.prototype = o(i.prototype), a(s.prototype, t), s.extend = e.Type.extend, t.name || i.prototype.name) { var n = t.name || i.prototype.name, l = e.defaults[i.prototype.name] ? o(e.defaults[i.prototype.name]) : {}; e.defaults[n] = a(l, t.defaults), e.types[n] = s, e.prototype[n] = function(t, i) { var o = h(e.defaults.global, e.defaults[n], i || {}); return new s(t, o, this) } } else d("Name not provided for this chart, so it hasn't been registered"); return i }, e.Element = function(t) { a(this, t), this.initialize.apply(this, arguments), this.save() }, a(e.Element.prototype, { initialize: function() {}, restore: function(t) { return t ? n(t, function(t) { this[t] = this._saved[t] }, this) : a(this, this._saved), this }, save: function() { return this._saved = o(this), delete this._saved._saved, this }, update: function(t) { return n(t, function(t, i) { this._saved[i] = this[i], this[i] = t }, this), this }, transition: function(t, i) { return n(t, function(t, e) { this[e] = (t - this._saved[e]) * i + this._saved[e] }, this), this }, tooltipPosition: function() { return { x: this.x, y: this.y } }, hasValue: function() { return f(this.value) } }), e.Element.extend = r, e.Point = e.Element.extend({ display: !0, inRange: function(t, i) { var e = this.hitDetectionRadius + this.radius; return Math.pow(t - this.x, 2) + Math.pow(i - this.y, 2) < Math.pow(e, 2) }, draw: function() { if (this.display) { var t = this.ctx; t.beginPath(), t.arc(this.x, this.y, this.radius, 0, 2 * Math.PI), t.closePath(), t.strokeStyle = this.strokeColor, t.lineWidth = this.strokeWidth, t.fillStyle = this.fillColor, t.fill(), t.stroke() } } }), e.Arc = e.Element.extend({ inRange: function(t, i) { var e = s.getAngleFromPoint(this, { x: t, y: i }), n = e.angle >= this.startAngle && e.angle <= this.endAngle, o = e.distance >= this.innerRadius && e.distance <= this.outerRadius; return n && o }, tooltipPosition: function() { var t = this.startAngle + (this.endAngle - this.startAngle) / 2, i = (this.outerRadius - this.innerRadius) / 2 + this.innerRadius; return { x: this.x + Math.cos(t) * i, y: this.y + Math.sin(t) * i } }, draw: function(t) { var i = this.ctx; i.beginPath(), i.arc(this.x, this.y, this.outerRadius, this.startAngle, this.endAngle), i.arc(this.x, this.y, this.innerRadius, this.endAngle, this.startAngle, !0), i.closePath(), i.strokeStyle = this.strokeColor, i.lineWidth = this.strokeWidth, i.fillStyle = this.fillColor, i.fill(), i.lineJoin = "bevel", this.showStroke && i.stroke() } }), e.Rectangle = e.Element.extend({ draw: function() { var t = this.ctx, i = this.width / 2, e = this.x - i, s = this.x + i, n = this.base - (this.base - this.y), o = this.strokeWidth / 2; this.showStroke && (e += o, s -= o, n += o), t.beginPath(), t.fillStyle = this.fillColor, t.strokeStyle = this.strokeColor, t.lineWidth = this.strokeWidth, t.moveTo(e, this.base), t.lineTo(e, n), t.lineTo(s, n), t.lineTo(s, this.base), t.fill(), this.showStroke && t.stroke() }, height: function() { return this.base - this.y }, inRange: function(t, i) { return t >= this.x - this.width / 2 && t <= this.x + this.width / 2 && i >= this.y && i <= this.base } }), e.Tooltip = e.Element.extend({ draw: function() { var t = this.chart.ctx; t.font = W(this.fontSize, this.fontStyle, this.fontFamily), this.xAlign = "center", this.yAlign = "above"; var i = this.caretPadding = 2, e = t.measureText(this.text).width + 2 * this.xPadding, s = this.fontSize + 2 * this.yPadding, n = s + this.caretHeight + i; this.x + e / 2 > this.chart.width ? this.xAlign = "left" : this.x - e / 2 < 0 && (this.xAlign = "right"), this.y - n < 0 && (this.yAlign = "below"); var o = this.x - e / 2, a = this.y - n; if (t.fillStyle = this.fillColor, this.custom) this.custom(this); else { switch (this.yAlign) { case "above": t.beginPath(), t.moveTo(this.x, this.y - i), t.lineTo(this.x + this.caretHeight, this.y - (i + this.caretHeight)), t.lineTo(this.x - this.caretHeight, this.y - (i + this.caretHeight)), t.closePath(), t.fill(); break; case "below": a = this.y + i + this.caretHeight, t.beginPath(), t.moveTo(this.x, this.y + i), t.lineTo(this.x + this.caretHeight, this.y + i + this.caretHeight), t.lineTo(this.x - this.caretHeight, this.y + i + this.caretHeight), t.closePath(), t.fill() } switch (this.xAlign) { case "left": o = this.x - e + (this.cornerRadius + this.caretHeight); break; case "right": o = this.x - (this.cornerRadius + this.caretHeight) } B(t, o, a, e, s, this.cornerRadius), t.fill(), t.fillStyle = this.textColor, t.textAlign = "center", t.textBaseline = "middle", t.fillText(this.text, o + e / 2, a + s / 2) } } }), e.MultiTooltip = e.Element.extend({ initialize: function() { this.font = W(this.fontSize, this.fontStyle, this.fontFamily), this.titleFont = W(this.titleFontSize, this.titleFontStyle, this.titleFontFamily), this.height = this.labels.length * this.fontSize + (this.labels.length - 1) * (this.fontSize / 2) + 2 * this.yPadding + 1.5 * this.titleFontSize, this.ctx.font = this.titleFont; var t = this.ctx.measureText(this.title).width, i = z(this.ctx, this.font, this.labels) + this.fontSize + 3, e = g([i, t]); this.width = e + 2 * this.xPadding; var s = this.height / 2; this.y - s < 0 ? this.y = s : this.y + s > this.chart.height && (this.y = this.chart.height - s), this.x > this.chart.width / 2 ? this.x -= this.xOffset + this.width : this.x += this.xOffset }, getLineHeight: function(t) { var i = this.y - this.height / 2 + this.yPadding, e = t - 1; return 0 === t ? i + this.titleFontSize / 2 : i + (1.5 * this.fontSize * e + this.fontSize / 2) + 1.5 * this.titleFontSize }, draw: function() { if (this.custom) this.custom(this); else { B(this.ctx, this.x, this.y - this.height / 2, this.width, this.height, this.cornerRadius); var t = this.ctx; t.fillStyle = this.fillColor, t.fill(), t.closePath(), t.textAlign = "left", t.textBaseline = "middle", t.fillStyle = this.titleTextColor, t.font = this.titleFont, t.fillText(this.title, this.x + this.xPadding, this.getLineHeight(0)), t.font = this.font, s.each(this.labels, function(i, e) { t.fillStyle = this.textColor, t.fillText(i, this.x + this.xPadding + this.fontSize + 3, this.getLineHeight(e + 1)), t.fillStyle = this.legendColorBackground, t.fillRect(this.x + this.xPadding, this.getLineHeight(e + 1) - this.fontSize / 2, this.fontSize, this.fontSize), t.fillStyle = this.legendColors[e].fill, t.fillRect(this.x + this.xPadding, this.getLineHeight(e + 1) - this.fontSize / 2, this.fontSize, this.fontSize) }, this) } } }), e.Scale = e.Element.extend({ initialize: function() { this.fit() }, buildYLabels: function() { this.yLabels = []; for (var t = v(this.stepValue), i = 0; i <= this.steps; i++) this.yLabels.push(C(this.templateString, { value: (this.min + i * this.stepValue).toFixed(t) })); this.yLabelWidth = this.display && this.showLabels ? z(this.ctx, this.font, this.yLabels) : 0 }, addXLabel: function(t) { this.xLabels.push(t), this.valuesCount++, this.fit() }, removeXLabel: function() { this.xLabels.shift(), this.valuesCount--, this.fit() }, fit: function() { this.startPoint = this.display ? this.fontSize : 0, this.endPoint = this.display ? this.height - 1.5 * this.fontSize - 5 : this.height, this.startPoint += this.padding, this.endPoint -= this.padding; var t, i = this.endPoint - this.startPoint; for (this.calculateYRange(i), this.buildYLabels(), this.calculateXLabelRotation(); i > this.endPoint - this.startPoint;) i = this.endPoint - this.startPoint, t = this.yLabelWidth, this.calculateYRange(i), this.buildYLabels(), t < this.yLabelWidth && this.calculateXLabelRotation() }, calculateXLabelRotation: function() { this.ctx.font = this.font; var t, i, e = this.ctx.measureText(this.xLabels[0]).width, s = this.ctx.measureText(this.xLabels[this.xLabels.length - 1]).width; if (this.xScalePaddingRight = s / 2 + 3, this.xScalePaddingLeft = e / 2 > this.yLabelWidth + 10 ? e / 2 : this.yLabelWidth + 10, this.xLabelRotation = 0, this.display) { var n, o = z(this.ctx, this.font, this.xLabels); this.xLabelWidth = o; for (var a = Math.floor(this.calculateX(1) - this.calculateX(0)) - 6; this.xLabelWidth > a && 0 === this.xLabelRotation || this.xLabelWidth > a && this.xLabelRotation <= 90 && this.xLabelRotation > 0;) n = Math.cos(S(this.xLabelRotation)), t = n * e, i = n * s, t + this.fontSize / 2 > this.yLabelWidth + 8 && (this.xScalePaddingLeft = t + this.fontSize / 2), this.xScalePaddingRight = this.fontSize / 2, this.xLabelRotation++, this.xLabelWidth = n * o; this.xLabelRotation > 0 && (this.endPoint -= Math.sin(S(this.xLabelRotation)) * o + 3) } else this.xLabelWidth = 0, this.xScalePaddingRight = this.padding, this.xScalePaddingLeft = this.padding }, calculateYRange: c, drawingArea: function() { return this.startPoint - this.endPoint }, calculateY: function(t) { var i = this.drawingArea() / (this.min - this.max); return this.endPoint - i * (t - this.min) }, calculateX: function(t) { var i = (this.xLabelRotation > 0, this.width - (this.xScalePaddingLeft + this.xScalePaddingRight)), e = i / Math.max(this.valuesCount - (this.offsetGridLines ? 0 : 1), 1), s = e * t + this.xScalePaddingLeft; return this.offsetGridLines && (s += e / 2), Math.round(s) }, update: function(t) { s.extend(this, t), this.fit() }, draw: function() { var t = this.ctx, i = (this.endPoint - this.startPoint) / this.steps, e = Math.round(this.xScalePaddingLeft); this.display && (t.fillStyle = this.textColor, t.font = this.font, n(this.yLabels, function(n, o) { var a = this.endPoint - i * o, h = Math.round(a), l = this.showHorizontalLines; t.textAlign = "right", t.textBaseline = "middle", this.showLabels && t.fillText(n, e - 10, a), 0 !== o || l || (l = !0), l && t.beginPath(), o > 0 ? (t.lineWidth = this.gridLineWidth, t.strokeStyle = this.gridLineColor) : (t.lineWidth = this.lineWidth, t.strokeStyle = this.lineColor), h += s.aliasPixel(t.lineWidth), l && (t.moveTo(e, h), t.lineTo(this.width, h), t.stroke(), t.closePath()), t.lineWidth = this.lineWidth, t.strokeStyle = this.lineColor, t.beginPath(), t.moveTo(e - 5, h), t.lineTo(e, h), t.stroke(), t.closePath() }, this), n(this.xLabels, function(i, e) { var s = this.calculateX(e) + x(this.lineWidth), n = this.calculateX(e - (this.offsetGridLines ? .5 : 0)) + x(this.lineWidth), o = this.xLabelRotation > 0, a = this.showVerticalLines; 0 !== e || a || (a = !0), a && t.beginPath(), e > 0 ? (t.lineWidth = this.gridLineWidth, t.strokeStyle = this.gridLineColor) : (t.lineWidth = this.lineWidth, t.strokeStyle = this.lineColor), a && (t.moveTo(n, this.endPoint), t.lineTo(n, this.startPoint - 3), t.stroke(), t.closePath()), t.lineWidth = this.lineWidth, t.strokeStyle = this.lineColor, t.beginPath(), t.moveTo(n, this.endPoint), t.lineTo(n, this.endPoint + 5), t.stroke(), t.closePath(), t.save(), t.translate(s, o ? this.endPoint + 12 : this.endPoint + 8), t.rotate(-1 * S(this.xLabelRotation)), t.font = this.font, t.textAlign = o ? "right" : "center", t.textBaseline = o ? "middle" : "top", t.fillText(i, 0, 0), t.restore() }, this)) } }), e.RadialScale = e.Element.extend({ initialize: function() { this.size = m([this.height, this.width]), this.drawingArea = this.display ? this.size / 2 - (this.fontSize / 2 + this.backdropPaddingY) : this.size / 2 }, calculateCenterOffset: function(t) { var i = this.drawingArea / (this.max - this.min); return (t - this.min) * i }, update: function() { this.lineArc ? this.drawingArea = this.display ? this.size / 2 - (this.fontSize / 2 + this.backdropPaddingY) : this.size / 2 : this.setScaleSize(), this.buildYLabels() }, buildYLabels: function() { this.yLabels = []; for (var t = v(this.stepValue), i = 0; i <= this.steps; i++) this.yLabels.push(C(this.templateString, { value: (this.min + i * this.stepValue).toFixed(t) })) }, getCircumference: function() { return 2 * Math.PI / this.valuesCount }, setScaleSize: function() { var t, i, e, s, n, o, a, h, l, r, c, u, d = m([this.height / 2 - this.pointLabelFontSize - 5, this.width / 2]), p = this.width, g = 0; for (this.ctx.font = W(this.pointLabelFontSize, this.pointLabelFontStyle, this.pointLabelFontFamily), i = 0; i < this.valuesCount; i++) t = this.getPointPosition(i, d), e = this.ctx.measureText(C(this.templateString, { value: this.labels[i] })).width + 5, 0 === i || i === this.valuesCount / 2 ? (s = e / 2, t.x + s > p && (p = t.x + s, n = i), t.x - s < g && (g = t.x - s, a = i)) : i < this.valuesCount / 2 ? t.x + e > p && (p = t.x + e, n = i) : i > this.valuesCount / 2 && t.x - e < g && (g = t.x - e, a = i); l = g, r = Math.ceil(p - this.width), o = this.getIndexAngle(n), h = this.getIndexAngle(a), c = r / Math.sin(o + Math.PI / 2), u = l / Math.sin(h + Math.PI / 2), c = f(c) ? c : 0, u = f(u) ? u : 0, this.drawingArea = d - (u + c) / 2, this.setCenterPoint(u, c) }, setCenterPoint: function(t, i) { var e = this.width - i - this.drawingArea, s = t + this.drawingArea; this.xCenter = (s + e) / 2, this.yCenter = this.height / 2 }, getIndexAngle: function(t) { var i = 2 * Math.PI / this.valuesCount; return t * i - Math.PI / 2 }, getPointPosition: function(t, i) { var e = this.getIndexAngle(t); return { x: Math.cos(e) * i + this.xCenter, y: Math.sin(e) * i + this.yCenter } }, draw: function() { if (this.display) { var t = this.ctx; if (n(this.yLabels, function(i, e) { if (e > 0) { var s, n = e * (this.drawingArea / this.steps), o = this.yCenter - n; if (this.lineWidth > 0) if (t.strokeStyle = this.lineColor, t.lineWidth = this.lineWidth, this.lineArc) t.beginPath(), t.arc(this.xCenter, this.yCenter, n, 0, 2 * Math.PI), t.closePath(), t.stroke(); else { t.beginPath(); for (var a = 0; a < this.valuesCount; a++) s = this.getPointPosition(a, this.calculateCenterOffset(this.min + e * this.stepValue)), 0 === a ? t.moveTo(s.x, s.y) : t.lineTo(s.x, s.y); t.closePath(), t.stroke() } if (this.showLabels) { if (t.font = W(this.fontSize, this.fontStyle, this.fontFamily), this.showLabelBackdrop) { var h = t.measureText(i).width; t.fillStyle = this.backdropColor, t.fillRect(this.xCenter - h / 2 - this.backdropPaddingX, o - this.fontSize / 2 - this.backdropPaddingY, h + 2 * this.backdropPaddingX, this.fontSize + 2 * this.backdropPaddingY) } t.textAlign = "center", t.textBaseline = "middle", t.fillStyle = this.fontColor, t.fillText(i, this.xCenter, o) } } }, this), !this.lineArc) { t.lineWidth = this.angleLineWidth, t.strokeStyle = this.angleLineColor; for (var i = this.valuesCount - 1; i >= 0; i--) { if (this.angleLineWidth > 0) { var e = this.getPointPosition(i, this.calculateCenterOffset(this.max)); t.beginPath(), t.moveTo(this.xCenter, this.yCenter), t.lineTo(e.x, e.y), t.stroke(), t.closePath() } var s = this.getPointPosition(i, this.calculateCenterOffset(this.max) + 5); t.font = W(this.pointLabelFontSize, this.pointLabelFontStyle, this.pointLabelFontFamily), t.fillStyle = this.pointLabelFontColor; var o = this.labels.length, a = this.labels.length / 2, h = a / 2, l = h > i || i > o - h, r = i === h || i === o - h; t.textAlign = 0 === i ? "center" : i === a ? "center" : a > i ? "left" : "right", t.textBaseline = r ? "middle" : l ? "bottom" : "top", t.fillText(this.labels[i], s.x, s.y) } } } } }), s.addEvent(window, "resize", function() { var t; return function() { clearTimeout(t), t = setTimeout(function() { n(e.instances, function(t) { t.options.responsive && t.resize(t.render, !0) }) }, 50) } }()), p ? define(function() { return e }) : "object" == typeof module && module.exports && (module.exports = e), t.Chart = e, e.noConflict = function() { return t.Chart = i, e } }).call(this), function() { "use strict"; var t = this, i = t.Chart, e = i.helpers, s = { scaleBeginAtZero: !0, scaleShowGridLines: !0, scaleGridLineColor: "rgba(0,0,0,.05)", scaleGridLineWidth: 1, scaleShowHorizontalLines: !0, scaleShowVerticalLines: !0, barShowStroke: !0, barStrokeWidth: 2, barValueSpacing: 5, barDatasetSpacing: 1, legendTemplate: '")[0], f = e.each; p.style.cssText = "background-color:rgba(1,1,1,.5)", d.rgba = p.style.backgroundColor.indexOf("rgba") > -1, f(u, function(e, t) { t.cache = "_" + e, t.props.alpha = { idx: 3, type: "percent", def: 1 } }), l.fn = e.extend(l.prototype, { parse: function(n, o, r, h) { if (n === t) return this._rgba = [null, null, null, null], this; (n.jquery || n.nodeType) && (n = e(n).css(o), o = t); var c = this, d = e.type(n), p = this._rgba = []; return o !== t && (n = [n, o, r, h], d = "array"), "string" === d ? this.parse(s(n) || a._default) : "array" === d ? (f(u.rgba.props, function(e, t) { p[t.idx] = i(n[t.idx], t) }), this) : "object" === d ? (n instanceof l ? f(u, function(e, t) { n[t.cache] && (c[t.cache] = n[t.cache].slice()) }) : f(u, function(t, s) { var a = s.cache; f(s.props, function(e, t) { if (!c[a] && s.to) { if ("alpha" === e || null == n[e]) return; c[a] = s.to(c._rgba) } c[a][t.idx] = i(n[e], t, !0) }), c[a] && 0 > e.inArray(null, c[a].slice(0, 3)) && (c[a][3] = 1, s.from && (c._rgba = s.from(c[a]))) }), this) : t }, is: function(e) { var i = l(e), s = !0, n = this; return f(u, function(e, a) { var o, r = i[a.cache]; return r && (o = n[a.cache] || a.to && a.to(n._rgba) || [], f(a.props, function(e, i) { return null != r[i.idx] ? s = r[i.idx] === o[i.idx] : t })), s }), s }, _space: function() { var e = [], t = this; return f(u, function(i, s) { t[s.cache] && e.push(i) }), e.pop() }, transition: function(e, t) { var s = l(e), n = s._space(), a = u[n], o = 0 === this.alpha() ? l("transparent") : this, r = o[a.cache] || a.to(o._rgba), h = r.slice(); return s = s[a.cache], f(a.props, function(e, n) { var a = n.idx, o = r[a], l = s[a], u = c[n.type] || {}; null !== l && (null === o ? h[a] = l : (u.mod && (l - o > u.mod / 2 ? o += u.mod : o - l > u.mod / 2 && (o -= u.mod)), h[a] = i((l - o) * t + o, n))) }), this[n](h) }, blend: function(t) { if (1 === this._rgba[3]) return this; var i = this._rgba.slice(), s = i.pop(), n = l(t)._rgba; return l(e.map(i, function(e, t) { return (1 - s) * n[t] + s * e })) }, toRgbaString: function() { var t = "rgba(", i = e.map(this._rgba, function(e, t) { return null == e ? t > 2 ? 1 : 0 : e }); return 1 === i[3] && (i.pop(), t = "rgb("), t + i.join() + ")" }, toHslaString: function() { var t = "hsla(", i = e.map(this.hsla(), function(e, t) { return null == e && (e = t > 2 ? 1 : 0), t && 3 > t && (e = Math.round(100 * e) + "%"), e }); return 1 === i[3] && (i.pop(), t = "hsl("), t + i.join() + ")" }, toHexString: function(t) { var i = this._rgba.slice(), s = i.pop(); return t && i.push(~~(255 * s)), "#" + e.map(i, function(e) { return e = (e || 0).toString(16), 1 === e.length ? "0" + e : e }).join("") }, toString: function() { return 0 === this._rgba[3] ? "transparent" : this.toRgbaString() } }), l.fn.parse.prototype = l.fn, u.hsla.to = function(e) { if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]]; var t, i, s = e[0] / 255, n = e[1] / 255, a = e[2] / 255, o = e[3], r = Math.max(s, n, a), h = Math.min(s, n, a), l = r - h, u = r + h, c = .5 * u; return t = h === r ? 0 : s === r ? 60 * (n - a) / l + 360 : n === r ? 60 * (a - s) / l + 120 : 60 * (s - n) / l + 240, i = 0 === l ? 0 : .5 >= c ? l / u : l / (2 - u), [Math.round(t) % 360, i, c, null == o ? 1 : o] }, u.hsla.from = function(e) { if (null == e[0] || null == e[1] || null == e[2]) return [null, null, null, e[3]]; var t = e[0] / 360, i = e[1], s = e[2], a = e[3], o = .5 >= s ? s * (1 + i) : s + i - s * i, r = 2 * s - o; return [Math.round(255 * n(r, o, t + 1 / 3)), Math.round(255 * n(r, o, t)), Math.round(255 * n(r, o, t - 1 / 3)), a] }, f(u, function(s, n) { var a = n.props, o = n.cache, h = n.to, u = n.from; l.fn[s] = function(s) { if (h && !this[o] && (this[o] = h(this._rgba)), s === t) return this[o].slice(); var n, r = e.type(s), c = "array" === r || "object" === r ? s : arguments, d = this[o].slice(); return f(a, function(e, t) { var s = c["object" === r ? e : t.idx]; null == s && (s = d[t.idx]), d[t.idx] = i(s, t) }), u ? (n = l(u(d)), n[o] = d, n) : l(d) }, f(a, function(t, i) { l.fn[t] || (l.fn[t] = function(n) { var a, o = e.type(n), h = "alpha" === t ? this._hsla ? "hsla" : "rgba" : s, l = this[h](), u = l[i.idx]; return "undefined" === o ? u : ("function" === o && (n = n.call(this, u), o = e.type(n)), null == n && i.empty ? this : ("string" === o && (a = r.exec(n), a && (n = u + parseFloat(a[2]) * ("+" === a[1] ? 1 : -1))), l[i.idx] = n, this[h](l))) }) }) }), l.hook = function(t) { var i = t.split(" "); f(i, function(t, i) { e.cssHooks[i] = { set: function(t, n) { var a, o, r = ""; if ("transparent" !== n && ("string" !== e.type(n) || (a = s(n)))) { if (n = l(a || n), !d.rgba && 1 !== n._rgba[3]) { for (o = "backgroundColor" === i ? t.parentNode : t; ("" === r || "transparent" === r) && o && o.style;) try { r = e.css(o, "backgroundColor"), o = o.parentNode } catch (h) {} n = n.blend(r && "transparent" !== r ? r : "_default") } n = n.toRgbaString() } try { t.style[i] = n } catch (h) {} } }, e.fx.step[i] = function(t) { t.colorInit || (t.start = l(t.elem, i), t.end = l(t.end), t.colorInit = !0), e.cssHooks[i].set(t.elem, t.start.transition(t.end, t.pos)) } }) }, l.hook(o), e.cssHooks.borderColor = { expand: function(e) { var t = {}; return f(["Top", "Right", "Bottom", "Left"], function(i, s) { t["border" + s + "Color"] = e }), t } }, a = e.Color.names = { aqua: "#00ffff", black: "#000000", blue: "#0000ff", fuchsia: "#ff00ff", gray: "#808080", green: "#008000", lime: "#00ff00", maroon: "#800000", navy: "#000080", olive: "#808000", purple: "#800080", red: "#ff0000", silver: "#c0c0c0", teal: "#008080", white: "#ffffff", yellow: "#ffff00", transparent: [null, null, null, 0], _default: "#ffffff" } }(r), function() { function t(t) { var i, s, n = t.ownerDocument.defaultView ? t.ownerDocument.defaultView.getComputedStyle(t, null) : t.currentStyle, a = {}; if (n && n.length && n[0] && n[n[0]]) for (s = n.length; s--;) i = n[s], "string" == typeof n[i] && (a[e.camelCase(i)] = n[i]); else for (i in n) "string" == typeof n[i] && (a[i] = n[i]); return a } function i(t, i) { var s, a, o = {}; for (s in i) a = i[s], t[s] !== a && (n[s] || (e.fx.step[s] || !isNaN(parseFloat(a))) && (o[s] = a)); return o } var s = ["add", "remove", "toggle"], n = { border: 1, borderBottom: 1, borderColor: 1, borderLeft: 1, borderRight: 1, borderTop: 1, borderWidth: 1, margin: 1, padding: 1 }; e.each(["borderLeftStyle", "borderRightStyle", "borderBottomStyle", "borderTopStyle"], function(t, i) { e.fx.step[i] = function(e) { ("none" !== e.end && !e.setAttr || 1 === e.pos && !e.setAttr) && (r.style(e.elem, i, e.end), e.setAttr = !0) } }), e.fn.addBack || (e.fn.addBack = function(e) { return this.add(null == e ? this.prevObject : this.prevObject.filter(e)) }), e.effects.animateClass = function(n, a, o, r) { var h = e.speed(a, o, r); return this.queue(function() { var a, o = e(this), r = o.attr("class") || "", l = h.children ? o.find("*").addBack() : o; l = l.map(function() { var i = e(this); return { el: i, start: t(this) } }), a = function() { e.each(s, function(e, t) { n[t] && o[t + "Class"](n[t]) }) }, a(), l = l.map(function() { return this.end = t(this.el[0]), this.diff = i(this.start, this.end), this }), o.attr("class", r), l = l.map(function() { var t = this, i = e.Deferred(), s = e.extend({}, h, { queue: !1, complete: function() { i.resolve(t) } }); return this.el.animate(this.diff, s), i.promise() }), e.when.apply(e, l.get()).done(function() { a(), e.each(arguments, function() { var t = this.el; e.each(this.diff, function(e) { t.css(e, "") }) }), h.complete.call(o[0]) }) }) }, e.fn.extend({ addClass: function(t) { return function(i, s, n, a) { return s ? e.effects.animateClass.call(this, { add: i }, s, n, a) : t.apply(this, arguments) } }(e.fn.addClass), removeClass: function(t) { return function(i, s, n, a) { return arguments.length > 1 ? e.effects.animateClass.call(this, { remove: i }, s, n, a) : t.apply(this, arguments) } }(e.fn.removeClass), toggleClass: function(t) { return function(i, s, n, a, o) { return "boolean" == typeof s || void 0 === s ? n ? e.effects.animateClass.call(this, s ? { add: i } : { remove: i }, n, a, o) : t.apply(this, arguments) : e.effects.animateClass.call(this, { toggle: i }, s, n, a) } }(e.fn.toggleClass), switchClass: function(t, i, s, n, a) { return e.effects.animateClass.call(this, { add: i, remove: t }, s, n, a) } }) }(), function() { function t(t, i, s, n) { return e.isPlainObject(t) && (i = t, t = t.effect), t = { effect: t }, null == i && (i = {}), e.isFunction(i) && (n = i, s = null, i = {}), ("number" == typeof i || e.fx.speeds[i]) && (n = s, s = i, i = {}), e.isFunction(s) && (n = s, s = null), i && e.extend(t, i), s = s || i.duration, t.duration = e.fx.off ? 0 : "number" == typeof s ? s : s in e.fx.speeds ? e.fx.speeds[s] : e.fx.speeds._default, t.complete = n || i.complete, t } function i(t) { return !t || "number" == typeof t || e.fx.speeds[t] ? !0 : "string" != typeof t || e.effects.effect[t] ? e.isFunction(t) ? !0 : "object" != typeof t || t.effect ? !1 : !0 : !0 } e.extend(e.effects, { version: "1.11.4", save: function(e, t) { for (var i = 0; t.length > i; i++) null !== t[i] && e.data(o + t[i], e[0].style[t[i]]) }, restore: function(e, t) { var i, s; for (s = 0; t.length > s; s++) null !== t[s] && (i = e.data(o + t[s]), void 0 === i && (i = ""), e.css(t[s], i)) }, setMode: function(e, t) { return "toggle" === t && (t = e.is(":hidden") ? "show" : "hide"), t }, getBaseline: function(e, t) { var i, s; switch (e[0]) { case "top": i = 0; break; case "middle": i = .5; break; case "bottom": i = 1; break; default: i = e[0] / t.height } switch (e[1]) { case "left": s = 0; break; case "center": s = .5; break; case "right": s = 1; break; default: s = e[1] / t.width } return { x: s, y: i } }, createWrapper: function(t) { if (t.parent().is(".ui-effects-wrapper")) return t.parent(); var i = { width: t.outerWidth(!0), height: t.outerHeight(!0), "float": t.css("float") }, s = e("
").addClass("ui-effects-wrapper").css({ fontSize: "100%", background: "transparent", border: "none", margin: 0, padding: 0 }), n = { width: t.width(), height: t.height() }, a = document.activeElement; try { a.id } catch (o) { a = document.body } return t.wrap(s), (t[0] === a || e.contains(t[0], a)) && e(a).focus(), s = t.parent(), "static" === t.css("position") ? (s.css({ position: "relative" }), t.css({ position: "relative" })) : (e.extend(i, { position: t.css("position"), zIndex: t.css("z-index") }), e.each(["top", "left", "bottom", "right"], function(e, s) { i[s] = t.css(s), isNaN(parseInt(i[s], 10)) && (i[s] = "auto") }), t.css({ position: "relative", top: 0, left: 0, right: "auto", bottom: "auto" })), t.css(n), s.css(i).show() }, removeWrapper: function(t) { var i = document.activeElement; return t.parent().is(".ui-effects-wrapper") && (t.parent().replaceWith(t), (t[0] === i || e.contains(t[0], i)) && e(i).focus()), t }, setTransition: function(t, i, s, n) { return n = n || {}, e.each(i, function(e, i) { var a = t.cssUnit(i); a[0] > 0 && (n[i] = a[0] * s + a[1]) }), n } }), e.fn.extend({ effect: function() { function i(t) { function i() { e.isFunction(a) && a.call(n[0]), e.isFunction(t) && t() } var n = e(this), a = s.complete, r = s.mode; (n.is(":hidden") ? "hide" === r : "show" === r) ? (n[r](), i()) : o.call(n[0], s, i) } var s = t.apply(this, arguments), n = s.mode, a = s.queue, o = e.effects.effect[s.effect]; return e.fx.off || !o ? n ? this[n](s.duration, s.complete) : this.each(function() { s.complete && s.complete.call(this) }) : a === !1 ? this.each(i) : this.queue(a || "fx", i) }, show: function(e) { return function(s) { if (i(s)) return e.apply(this, arguments); var n = t.apply(this, arguments); return n.mode = "show", this.effect.call(this, n) } }(e.fn.show), hide: function(e) { return function(s) { if (i(s)) return e.apply(this, arguments); var n = t.apply(this, arguments); return n.mode = "hide", this.effect.call(this, n) } }(e.fn.hide), toggle: function(e) { return function(s) { if (i(s) || "boolean" == typeof s) return e.apply(this, arguments); var n = t.apply(this, arguments); return n.mode = "toggle", this.effect.call(this, n) } }(e.fn.toggle), cssUnit: function(t) { var i = this.css(t), s = []; return e.each(["em", "px", "%", "pt"], function(e, t) { i.indexOf(t) > 0 && (s = [parseFloat(i), t]) }), s } }) }(), function() { var t = {}; e.each(["Quad", "Cubic", "Quart", "Quint", "Expo"], function(e, i) { t[i] = function(t) { return Math.pow(t, e + 2) } }), e.extend(t, { Sine: function(e) { return 1 - Math.cos(e * Math.PI / 2) }, Circ: function(e) { return 1 - Math.sqrt(1 - e * e) }, Elastic: function(e) { return 0 === e || 1 === e ? e : -Math.pow(2, 8 * (e - 1)) * Math.sin((80 * (e - 1) - 7.5) * Math.PI / 15) }, Back: function(e) { return e * e * (3 * e - 2) }, Bounce: function(e) { for (var t, i = 4; ((t = Math.pow(2, --i)) - 1) / 11 > e;); return 1 / Math.pow(4, 3 - i) - 7.5625 * Math.pow((3 * t - 2) / 22 - e, 2) } }), e.each(t, function(t, i) { e.easing["easeIn" + t] = i, e.easing["easeOut" + t] = function(e) { return 1 - i(1 - e) }, e.easing["easeInOut" + t] = function(e) { return .5 > e ? i(2 * e) / 2 : 1 - i(-2 * e + 2) / 2 } }) }(), e.effects, e.effects.effect.fade = function(t, i) { var s = e(this), n = e.effects.setMode(s, t.mode || "toggle"); s.animate({ opacity: n }, { queue: !1, duration: t.duration, easing: t.easing, complete: i }) }, e.effects.effect.slide = function(t, i) { var s, n = e(this), a = ["position", "top", "bottom", "left", "right", "width", "height"], o = e.effects.setMode(n, t.mode || "show"), r = "show" === o, h = t.direction || "left", l = "up" === h || "down" === h ? "top" : "left", u = "up" === h || "left" === h, c = {}; e.effects.save(n, a), n.show(), s = t.distance || n["top" === l ? "outerHeight" : "outerWidth"](!0), e.effects.createWrapper(n).css({ overflow: "hidden" }), r && n.css(l, u ? isNaN(s) ? "-" + s : -s : s), c[l] = (r ? u ? "+=" : "-=" : u ? "-=" : "+=") + s, n.animate(c, { queue: !1, duration: t.duration, easing: t.easing, complete: function() { "hide" === o && n.hide(), e.effects.restore(n, a), e.effects.removeWrapper(n), i() } }) } }); /*! * Bootstrap v3.3.6 (http://getbootstrap.com) * Copyright 2011-2016 Twitter, Inc. * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) */ if ("undefined" == typeof jQuery) throw new Error("Bootstrap's JavaScript requires jQuery"); + function(t) { "use strict"; var e = t.fn.jquery.split(" ")[0].split("."); if (e[0] < 2 && e[1] < 9 || 1 == e[0] && 9 == e[1] && e[2] < 1 || e[0] > 2) throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3") }(jQuery), + function(t) { "use strict"; function e(e) { return this.each(function() { var i = t(this), n = i.data("bs.alert"); n || i.data("bs.alert", n = new o(this)), "string" == typeof e && n[e].call(i) }) } var i = '[data-dismiss="alert"]', o = function(e) { t(e).on("click", i, this.close) }; o.VERSION = "3.3.6", o.TRANSITION_DURATION = 150, o.prototype.close = function(e) { function i() { a.detach().trigger("closed.bs.alert").remove() } var n = t(this), s = n.attr("data-target"); s || (s = n.attr("href"), s = s && s.replace(/.*(?=#[^\s]*$)/, "")); var a = t(s); e && e.preventDefault(), a.length || (a = n.closest(".alert")), a.trigger(e = t.Event("close.bs.alert")), e.isDefaultPrevented() || (a.removeClass("in"), t.support.transition && a.hasClass("fade") ? a.one("bsTransitionEnd", i).emulateTransitionEnd(o.TRANSITION_DURATION) : i()) }; var n = t.fn.alert; t.fn.alert = e, t.fn.alert.Constructor = o, t.fn.alert.noConflict = function() { return t.fn.alert = n, this }, t(document).on("click.bs.alert.data-api", i, o.prototype.close) }(jQuery), + function(t) { "use strict"; function e(e) { return this.each(function() { var o = t(this), n = o.data("bs.button"), s = "object" == typeof e && e; n || o.data("bs.button", n = new i(this, s)), "toggle" == e ? n.toggle() : e && n.setState(e) }) } var i = function(e, o) { this.$element = t(e), this.options = t.extend({}, i.DEFAULTS, o), this.isLoading = !1 }; i.VERSION = "3.3.6", i.DEFAULTS = { loadingText: "loading..." }, i.prototype.setState = function(e) { var i = "disabled", o = this.$element, n = o.is("input") ? "val" : "html", s = o.data(); e += "Text", null == s.resetText && o.data("resetText", o[n]()), setTimeout(t.proxy(function() { o[n](null == s[e] ? this.options[e] : s[e]), "loadingText" == e ? (this.isLoading = !0, o.addClass(i).attr(i, i)) : this.isLoading && (this.isLoading = !1, o.removeClass(i).removeAttr(i)) }, this), 0) }, i.prototype.toggle = function() { var t = !0, e = this.$element.closest('[data-toggle="buttons"]'); if (e.length) { var i = this.$element.find("input"); "radio" == i.prop("type") ? (i.prop("checked") && (t = !1), e.find(".active").removeClass("active"), this.$element.addClass("active")) : "checkbox" == i.prop("type") && (i.prop("checked") !== this.$element.hasClass("active") && (t = !1), this.$element.toggleClass("active")), i.prop("checked", this.$element.hasClass("active")), t && i.trigger("change") } else this.$element.attr("aria-pressed", !this.$element.hasClass("active")), this.$element.toggleClass("active") }; var o = t.fn.button; t.fn.button = e, t.fn.button.Constructor = i, t.fn.button.noConflict = function() { return t.fn.button = o, this }, t(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function(i) { var o = t(i.target); o.hasClass("btn") || (o = o.closest(".btn")), e.call(o, "toggle"), t(i.target).is('input[type="radio"]') || t(i.target).is('input[type="checkbox"]') || i.preventDefault() }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function(e) { t(e.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(e.type)) }) }(jQuery), + function(t) { "use strict"; function e(e) { return this.each(function() { var o = t(this), n = o.data("bs.carousel"), s = t.extend({}, i.DEFAULTS, o.data(), "object" == typeof e && e), a = "string" == typeof e ? e : s.slide; n || o.data("bs.carousel", n = new i(this, s)), "number" == typeof e ? n.to(e) : a ? n[a]() : s.interval && n.pause().cycle() }) } var i = function(e, i) { this.$element = t(e), this.$indicators = this.$element.find(".carousel-indicators"), this.options = i, this.paused = null, this.sliding = null, this.interval = null, this.$active = null, this.$items = null, this.options.keyboard && this.$element.on("keydown.bs.carousel", t.proxy(this.keydown, this)), "hover" == this.options.pause && !("ontouchstart" in document.documentElement) && this.$element.on("mouseenter.bs.carousel", t.proxy(this.pause, this)).on("mouseleave.bs.carousel", t.proxy(this.cycle, this)) }; i.VERSION = "3.3.6", i.TRANSITION_DURATION = 600, i.DEFAULTS = { interval: 5e3, pause: "hover", wrap: !0, keyboard: !0 }, i.prototype.keydown = function(t) { if (!/input|textarea/i.test(t.target.tagName)) { switch (t.which) { case 37: this.prev(); break; case 39: this.next(); break; default: return } t.preventDefault() } }, i.prototype.cycle = function(e) { return e || (this.paused = !1), this.interval && clearInterval(this.interval), this.options.interval && !this.paused && (this.interval = setInterval(t.proxy(this.next, this), this.options.interval)), this }, i.prototype.getItemIndex = function(t) { return this.$items = t.parent().children(".item"), this.$items.index(t || this.$active) }, i.prototype.getItemForDirection = function(t, e) { var i = this.getItemIndex(e), o = "prev" == t && 0 === i || "next" == t && i == this.$items.length - 1; if (o && !this.options.wrap) return e; var n = "prev" == t ? -1 : 1, s = (i + n) % this.$items.length; return this.$items.eq(s) }, i.prototype.to = function(t) { var e = this, i = this.getItemIndex(this.$active = this.$element.find(".item.active")); return t > this.$items.length - 1 || 0 > t ? void 0 : this.sliding ? this.$element.one("slid.bs.carousel", function() { e.to(t) }) : i == t ? this.pause().cycle() : this.slide(t > i ? "next" : "prev", this.$items.eq(t)) }, i.prototype.pause = function(e) { return e || (this.paused = !0), this.$element.find(".next, .prev").length && t.support.transition && (this.$element.trigger(t.support.transition.end), this.cycle(!0)), this.interval = clearInterval(this.interval), this }, i.prototype.next = function() { return this.sliding ? void 0 : this.slide("next") }, i.prototype.prev = function() { return this.sliding ? void 0 : this.slide("prev") }, i.prototype.slide = function(e, o) { var n = this.$element.find(".item.active"), s = o || this.getItemForDirection(e, n), a = this.interval, r = "next" == e ? "left" : "right", l = this; if (s.hasClass("active")) return this.sliding = !1; var h = s[0], d = t.Event("slide.bs.carousel", { relatedTarget: h, direction: r }); if (this.$element.trigger(d), !d.isDefaultPrevented()) { if (this.sliding = !0, a && this.pause(), this.$indicators.length) { this.$indicators.find(".active").removeClass("active"); var p = t(this.$indicators.children()[this.getItemIndex(s)]); p && p.addClass("active") } var c = t.Event("slid.bs.carousel", { relatedTarget: h, direction: r }); return t.support.transition && this.$element.hasClass("slide") ? (s.addClass(e), s[0].offsetWidth, n.addClass(r), s.addClass(r), n.one("bsTransitionEnd", function() { s.removeClass([e, r].join(" ")).addClass("active"), n.removeClass(["active", r].join(" ")), l.sliding = !1, setTimeout(function() { l.$element.trigger(c) }, 0) }).emulateTransitionEnd(i.TRANSITION_DURATION)) : (n.removeClass("active"), s.addClass("active"), this.sliding = !1, this.$element.trigger(c)), a && this.cycle(), this } }; var o = t.fn.carousel; t.fn.carousel = e, t.fn.carousel.Constructor = i, t.fn.carousel.noConflict = function() { return t.fn.carousel = o, this }; var n = function(i) { var o, n = t(this), s = t(n.attr("data-target") || (o = n.attr("href")) && o.replace(/.*(?=#[^\s]+$)/, "")); if (s.hasClass("carousel")) { var a = t.extend({}, s.data(), n.data()), r = n.attr("data-slide-to"); r && (a.interval = !1), e.call(s, a), r && s.data("bs.carousel").to(r), i.preventDefault() } }; t(document).on("click.bs.carousel.data-api", "[data-slide]", n).on("click.bs.carousel.data-api", "[data-slide-to]", n), t(window).on("load", function() { t('[data-ride="carousel"]').each(function() { var i = t(this); e.call(i, i.data()) }) }) }(jQuery), + function(t) { "use strict"; function e(e) { var i = e.attr("data-target"); i || (i = e.attr("href"), i = i && /#[A-Za-z]/.test(i) && i.replace(/.*(?=#[^\s]*$)/, "")); var o = i && t(i); return o && o.length ? o : e.parent() } function i(i) { i && 3 === i.which || (t(n).remove(), t(s).each(function() { var o = t(this), n = e(o), s = { relatedTarget: this }; n.hasClass("open") && (i && "click" == i.type && /input|textarea/i.test(i.target.tagName) && t.contains(n[0], i.target) || (n.trigger(i = t.Event("hide.bs.dropdown", s)), i.isDefaultPrevented() || (o.attr("aria-expanded", "false"), n.removeClass("open").trigger(t.Event("hidden.bs.dropdown", s))))) })) } function o(e) { return this.each(function() { var i = t(this), o = i.data("bs.dropdown"); o || i.data("bs.dropdown", o = new a(this)), "string" == typeof e && o[e].call(i) }) } var n = ".dropdown-backdrop", s = '[data-toggle="dropdown"]', a = function(e) { t(e).on("click.bs.dropdown", this.toggle) }; a.VERSION = "3.3.6", a.prototype.toggle = function(o) { var n = t(this); if (!n.is(".disabled, :disabled")) { var s = e(n), a = s.hasClass("open"); if (i(), !a) { "ontouchstart" in document.documentElement && !s.closest(".navbar-nav").length && t(document.createElement("div")).addClass("dropdown-backdrop").insertAfter(t(this)).on("click", i); var r = { relatedTarget: this }; if (s.trigger(o = t.Event("show.bs.dropdown", r)), o.isDefaultPrevented()) return; n.trigger("focus").attr("aria-expanded", "true"), s.toggleClass("open").trigger(t.Event("shown.bs.dropdown", r)) } return !1 } }, a.prototype.keydown = function(i) { if (/(38|40|27|32)/.test(i.which) && !/input|textarea/i.test(i.target.tagName)) { var o = t(this); if (i.preventDefault(), i.stopPropagation(), !o.is(".disabled, :disabled")) { var n = e(o), a = n.hasClass("open"); if (!a && 27 != i.which || a && 27 == i.which) return 27 == i.which && n.find(s).trigger("focus"), o.trigger("click"); var r = " li:not(.disabled):visible a", l = n.find(".dropdown-menu" + r); if (l.length) { var h = l.index(i.target); 38 == i.which && h > 0 && h--, 40 == i.which && h < l.length - 1 && h++, ~h || (h = 0), l.eq(h).trigger("focus") } } } }; var r = t.fn.dropdown; t.fn.dropdown = o, t.fn.dropdown.Constructor = a, t.fn.dropdown.noConflict = function() { return t.fn.dropdown = r, this }, t(document).on("click.bs.dropdown.data-api", i).on("click.bs.dropdown.data-api", ".dropdown form", function(t) { t.stopPropagation() }).on("click.bs.dropdown.data-api", s, a.prototype.toggle).on("keydown.bs.dropdown.data-api", s, a.prototype.keydown).on("keydown.bs.dropdown.data-api", ".dropdown-menu", a.prototype.keydown) }(jQuery), + function(t) { "use strict"; function e(e, o) { return this.each(function() { var n = t(this), s = n.data("bs.modal"), a = t.extend({}, i.DEFAULTS, n.data(), "object" == typeof e && e); s || n.data("bs.modal", s = new i(this, a)), "string" == typeof e ? s[e](o) : a.show && s.show(o) }) } var i = function(e, i) { this.options = i, this.$body = t(document.body), this.$element = t(e), this.$dialog = this.$element.find(".modal-dialog"), this.$backdrop = null, this.isShown = null, this.originalBodyPad = null, this.scrollbarWidth = 0, this.ignoreBackdropClick = !1, this.options.remote && this.$element.find(".modal-content").load(this.options.remote, t.proxy(function() { this.$element.trigger("loaded.bs.modal") }, this)) }; i.VERSION = "3.3.6", i.TRANSITION_DURATION = 300, i.BACKDROP_TRANSITION_DURATION = 150, i.DEFAULTS = { backdrop: !0, keyboard: !0, show: !0 }, i.prototype.toggle = function(t) { return this.isShown ? this.hide() : this.show(t) }, i.prototype.show = function(e) { var o = this, n = t.Event("show.bs.modal", { relatedTarget: e }); this.$element.trigger(n), this.isShown || n.isDefaultPrevented() || (this.isShown = !0, this.checkScrollbar(), this.setScrollbar(), this.$body.addClass("modal-open"), this.escape(), this.resize(), this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', t.proxy(this.hide, this)), this.$dialog.on("mousedown.dismiss.bs.modal", function() { o.$element.one("mouseup.dismiss.bs.modal", function(e) { t(e.target).is(o.$element) && (o.ignoreBackdropClick = !0) }) }), this.backdrop(function() { var n = t.support.transition && o.$element.hasClass("fade"); o.$element.parent().length || o.$element.appendTo(o.$body), o.$element.show().scrollTop(0), o.adjustDialog(), n && o.$element[0].offsetWidth, o.$element.addClass("in"), o.enforceFocus(); var s = t.Event("shown.bs.modal", { relatedTarget: e }); n ? o.$dialog.one("bsTransitionEnd", function() { o.$element.trigger("focus").trigger(s) }).emulateTransitionEnd(i.TRANSITION_DURATION) : o.$element.trigger("focus").trigger(s) })) }, i.prototype.hide = function(e) { e && e.preventDefault(), e = t.Event("hide.bs.modal"), this.$element.trigger(e), this.isShown && !e.isDefaultPrevented() && (this.isShown = !1, this.escape(), this.resize(), t(document).off("focusin.bs.modal"), this.$element.removeClass("in").off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"), this.$dialog.off("mousedown.dismiss.bs.modal"), t.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", t.proxy(this.hideModal, this)).emulateTransitionEnd(i.TRANSITION_DURATION) : this.hideModal()) }, i.prototype.enforceFocus = function() { t(document).off("focusin.bs.modal").on("focusin.bs.modal", t.proxy(function(t) { this.$element[0] === t.target || this.$element.has(t.target).length || this.$element.trigger("focus") }, this)) }, i.prototype.escape = function() { this.isShown && this.options.keyboard ? this.$element.on("keydown.dismiss.bs.modal", t.proxy(function(t) { 27 == t.which && this.hide() }, this)) : this.isShown || this.$element.off("keydown.dismiss.bs.modal") }, i.prototype.resize = function() { this.isShown ? t(window).on("resize.bs.modal", t.proxy(this.handleUpdate, this)) : t(window).off("resize.bs.modal") }, i.prototype.hideModal = function() { var t = this; this.$element.hide(), this.backdrop(function() { t.$body.removeClass("modal-open"), t.resetAdjustments(), t.resetScrollbar(), t.$element.trigger("hidden.bs.modal") }) }, i.prototype.removeBackdrop = function() { this.$backdrop && this.$backdrop.remove(), this.$backdrop = null }, i.prototype.backdrop = function(e) { var o = this, n = this.$element.hasClass("fade") ? "fade" : ""; if (this.isShown && this.options.backdrop) { var s = t.support.transition && n; if (this.$backdrop = t(document.createElement("div")).addClass("modal-backdrop " + n).appendTo(this.$body), this.$element.on("click.dismiss.bs.modal", t.proxy(function(t) { return this.ignoreBackdropClick ? void(this.ignoreBackdropClick = !1) : void(t.target === t.currentTarget && ("static" == this.options.backdrop ? this.$element[0].focus() : this.hide())) }, this)), s && this.$backdrop[0].offsetWidth, this.$backdrop.addClass("in"), !e) return; s ? this.$backdrop.one("bsTransitionEnd", e).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION) : e() } else if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass("in"); var a = function() { o.removeBackdrop(), e && e() }; t.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", a).emulateTransitionEnd(i.BACKDROP_TRANSITION_DURATION) : a() } else e && e() }, i.prototype.handleUpdate = function() { this.adjustDialog() }, i.prototype.adjustDialog = function() { var t = this.$element[0].scrollHeight > document.documentElement.clientHeight; this.$element.css({ paddingLeft: !this.bodyIsOverflowing && t ? this.scrollbarWidth : "", paddingRight: this.bodyIsOverflowing && !t ? this.scrollbarWidth : "" }) }, i.prototype.resetAdjustments = function() { this.$element.css({ paddingLeft: "", paddingRight: "" }) }, i.prototype.checkScrollbar = function() { var t = window.innerWidth; if (!t) { var e = document.documentElement.getBoundingClientRect(); t = e.right - Math.abs(e.left) } this.bodyIsOverflowing = document.body.clientWidth < t, this.scrollbarWidth = this.measureScrollbar() }, i.prototype.setScrollbar = function() { var t = parseInt(this.$body.css("padding-right") || 0, 10); this.originalBodyPad = document.body.style.paddingRight || "", this.bodyIsOverflowing && this.$body.css("padding-right", t + this.scrollbarWidth) }, i.prototype.resetScrollbar = function() { this.$body.css("padding-right", this.originalBodyPad) }, i.prototype.measureScrollbar = function() { var t = document.createElement("div"); t.className = "modal-scrollbar-measure", this.$body.append(t); var e = t.offsetWidth - t.clientWidth; return this.$body[0].removeChild(t), e }; var o = t.fn.modal; t.fn.modal = e, t.fn.modal.Constructor = i, t.fn.modal.noConflict = function() { return t.fn.modal = o, this }, t(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function(i) { var o = t(this), n = o.attr("href"), s = t(o.attr("data-target") || n && n.replace(/.*(?=#[^\s]+$)/, "")), a = s.data("bs.modal") ? "toggle" : t.extend({ remote: !/#/.test(n) && n }, s.data(), o.data()); o.is("a") && i.preventDefault(), s.one("show.bs.modal", function(t) { t.isDefaultPrevented() || s.one("hidden.bs.modal", function() { o.is(":visible") && o.trigger("focus") }) }), e.call(s, a, this) }) }(jQuery), + function(t) { "use strict"; function e(e) { return this.each(function() { var o = t(this), n = o.data("bs.tooltip"), s = "object" == typeof e && e; (n || !/destroy|hide/.test(e)) && (n || o.data("bs.tooltip", n = new i(this, s)), "string" == typeof e && n[e]()) }) } var i = function(t, e) { this.type = null, this.options = null, this.enabled = null, this.timeout = null, this.hoverState = null, this.$element = null, this.inState = null, this.init("tooltip", t, e) }; i.VERSION = "3.3.6", i.TRANSITION_DURATION = 150, i.DEFAULTS = { animation: !0, placement: "top", selector: !1, template: '