/* Minification failed. Returning unminified contents.
(793,60-68): run-time error JS1137: 'function' is a new reserved word and should not be used as an identifier: function
(102,23-27): run-time error JS1137: 'null' is a new reserved word and should not be used as an identifier: null
(126,8-16): run-time error JS1137: 'function' is a new reserved word and should not be used as an identifier: function
(136,8-12): run-time error JS1137: 'null' is a new reserved word and should not be used as an identifier: null
 */
/*
 * Bootstrap v3.3.4 (http://getbootstrap.com)
 * Copyright 2011-2015 Twitter, Inc.
 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
 */
/*
 * Generated using the Bootstrap Customizer (http://getbootstrap.com/customize/?id=2339ab8ae767bc6cefc1)
 * Config saved to config.json and https://gist.github.com/2339ab8ae767bc6cefc1
 */
if (typeof jQuery === "undefined") { throw new Error("Bootstrap's JavaScript requires jQuery") } +function (a) { var b = a.fn.jquery.split(" ")[0].split("."); if ((b[0] < 2 && b[1] < 9) || (b[0] == 1 && b[1] == 9 && b[2] < 1)) { throw new Error("Bootstrap's JavaScript requires jQuery version 1.9.1 or higher") } }(jQuery); +function (a) { var c = '[data-dismiss="alert"]'; var b = function (f) { a(f).on("click", c, this.close) }; b.VERSION = "3.3.4"; b.TRANSITION_DURATION = 150; b.prototype.close = function (h) { var g = a(this); var j = g.attr("data-target"); if (!j) { j = g.attr("href"); j = j && j.replace(/.*(?=#[^\s]*$)/, "") } var f = a(j); if (h) { h.preventDefault() } if (!f.length) { f = g.closest(".alert") } f.trigger(h = a.Event("close.bs.alert")); if (h.isDefaultPrevented()) { return } f.removeClass("in"); function i() { f.detach().trigger("closed.bs.alert").remove() } a.support.transition && f.hasClass("fade") ? f.one("bsTransitionEnd", i).emulateTransitionEnd(b.TRANSITION_DURATION) : i() }; function e(f) { return this.each(function () { var g = a(this); var h = g.data("bs.alert"); if (!h) { g.data("bs.alert", (h = new b(this))) } if (typeof f == "string") { h[f].call(g) } }) } var d = a.fn.alert; a.fn.alert = e; a.fn.alert.Constructor = b; a.fn.alert.noConflict = function () { a.fn.alert = d; return this }; a(document).on("click.bs.alert.data-api", c, b.prototype.close) }(jQuery); +function (a) { var b = function (e, f) { this.$element = a(e); this.options = a.extend({}, b.DEFAULTS, f); this.isLoading = false }; b.VERSION = "3.3.4"; b.DEFAULTS = { loadingText: "loading..." }; b.prototype.setState = function (h) { var f = "disabled"; var e = this.$element; var i = e.is("input") ? "val" : "html"; var g = e.data(); h = h + "Text"; if (g.resetText == null) { e.data("resetText", e[i]()) } setTimeout(a.proxy(function () { e[i](g[h] == null ? this.options[h] : g[h]); if (h == "loadingText") { this.isLoading = true; e.addClass(f).attr(f, f) } else { if (this.isLoading) { this.isLoading = false; e.removeClass(f).removeAttr(f) } } }, this), 0) }; b.prototype.toggle = function () { var g = true; var f = this.$element.closest('[data-toggle="buttons"]'); if (f.length) { var e = this.$element.find("input"); if (e.prop("type") == "radio") { if (e.prop("checked") && this.$element.hasClass("active")) { g = false } else { f.find(".active").removeClass("active") } } if (g) { e.prop("checked", !this.$element.hasClass("active")).trigger("change") } } else { this.$element.attr("aria-pressed", !this.$element.hasClass("active")) } if (g) { this.$element.toggleClass("active") } }; function d(e) { return this.each(function () { var f = a(this); var g = f.data("bs.button"); var h = typeof e == "object" && e; if (!g) { f.data("bs.button", (g = new b(this, h))) } if (e == "toggle") { g.toggle() } else { if (e) { g.setState(e) } } }) } var c = a.fn.button; a.fn.button = d; a.fn.button.Constructor = b; a.fn.button.noConflict = function () { a.fn.button = c; return this }; a(document).on("click.bs.button.data-api", '[data-toggle^="button"]', function (g) { var f = a(g.target); if (!f.hasClass("btn")) { f = f.closest(".btn") } d.call(f, "toggle"); g.preventDefault() }).on("focus.bs.button.data-api blur.bs.button.data-api", '[data-toggle^="button"]', function (f) { a(f.target).closest(".btn").toggleClass("focus", /^focus(in)?$/.test(f.type)) }) }(jQuery); +function (a) { var b = function (f, g) { this.$element = a(f); this.$indicators = this.$element.find(".carousel-indicators"); this.options = g; this.paused = null; this.sliding = null; this.interval = null; this.$active = null; this.$items = null; this.options.keyboard && this.$element.on("keydown.bs.carousel", a.proxy(this.keydown, this)); this.options.pause == "hover" && !("ontouchstart" in document.documentElement) && this.$element.on("mouseenter.bs.carousel", a.proxy(this.pause, this)).on("mouseleave.bs.carousel", a.proxy(this.cycle, this)) }; b.VERSION = "3.3.4"; b.TRANSITION_DURATION = 600; b.DEFAULTS = { interval: 5000, pause: "hover", wrap: true, keyboard: true }; b.prototype.keydown = function (f) { if (/input|textarea/i.test(f.target.tagName)) { return } switch (f.which) { case 37: this.prev(); break; case 39: this.next(); break; default: return }f.preventDefault() }; b.prototype.cycle = function (f) { f || (this.paused = false); this.interval && clearInterval(this.interval); this.options.interval && !this.paused && (this.interval = setInterval(a.proxy(this.next, this), this.options.interval)); return this }; b.prototype.getItemIndex = function (f) { this.$items = f.parent().children(".item"); return this.$items.index(f || this.$active) }; b.prototype.getItemForDirection = function (i, f) { var g = this.getItemIndex(f); var k = (i == "prev" && g === 0) || (i == "next" && g == (this.$items.length - 1)); if (k && !this.options.wrap) { return f } var h = i == "prev" ? -1 : 1; var j = (g + h) % this.$items.length; return this.$items.eq(j) }; b.prototype.to = function (g) { var h = this; var f = this.getItemIndex(this.$active = this.$element.find(".item.active")); if (g > (this.$items.length - 1) || g < 0) { return } if (this.sliding) { return this.$element.one("slid.bs.carousel", function () { h.to(g) }) } if (f == g) { return this.pause().cycle() } return this.slide(g > f ? "next" : "prev", this.$items.eq(g)) }; b.prototype.pause = function (f) { f || (this.paused = true); if (this.$element.find(".next, .prev").length && a.support.transition) { this.$element.trigger(a.support.transition.end); this.cycle(true) } this.interval = clearInterval(this.interval); return this }; b.prototype.next = function () { if (this.sliding) { return } return this.slide("next") }; b.prototype.prev = function () { if (this.sliding) { return } return this.slide("prev") }; b.prototype.slide = function (p, k) { var f = this.$element.find(".item.active"); var g = k || this.getItemForDirection(p, f); var j = this.interval; var i = p == "next" ? "left" : "right"; var o = this; if (g.hasClass("active")) { return (this.sliding = false) } var l = g[0]; var m = a.Event("slide.bs.carousel", { relatedTarget: l, direction: i }); this.$element.trigger(m); if (m.isDefaultPrevented()) { return } this.sliding = true; j && this.pause(); if (this.$indicators.length) { this.$indicators.find(".active").removeClass("active"); var h = a(this.$indicators.children()[this.getItemIndex(g)]); h && h.addClass("active") } var n = a.Event("slid.bs.carousel", { relatedTarget: l, direction: i }); if (a.support.transition && this.$element.hasClass("slide")) { g.addClass(p); g[0].offsetWidth; f.addClass(i); g.addClass(i); f.one("bsTransitionEnd", function () { g.removeClass([p, i].join(" ")).addClass("active"); f.removeClass(["active", i].join(" ")); o.sliding = false; setTimeout(function () { o.$element.trigger(n) }, 0) }).emulateTransitionEnd(b.TRANSITION_DURATION) } else { f.removeClass("active"); g.addClass("active"); this.sliding = false; this.$element.trigger(n) } j && this.cycle(); return this }; function e(f) { return this.each(function () { var g = a(this); var i = g.data("bs.carousel"); var j = a.extend({}, b.DEFAULTS, g.data(), typeof f == "object" && f); var h = typeof f == "string" ? f : j.slide; if (!i) { g.data("bs.carousel", (i = new b(this, j))) } if (typeof f == "number") { i.to(f) } else { if (h) { i[h]() } else { if (j.interval) { i.pause().cycle() } } } }) } var d = a.fn.carousel; a.fn.carousel = e; a.fn.carousel.Constructor = b; a.fn.carousel.noConflict = function () { a.fn.carousel = d; return this }; var c = function (h) { var i; var g = a(this); var f = a(g.attr("data-target") || (i = g.attr("href")) && i.replace(/.*(?=#[^\s]+$)/, "")); if (!f.hasClass("carousel")) { return } var j = a.extend({}, f.data(), g.data()); var k = g.attr("data-slide-to"); if (k) { j.interval = false } e.call(f, j); if (k) { f.data("bs.carousel").to(k) } h.preventDefault() }; a(document).on("click.bs.carousel.data-api", "[data-slide]", c).on("click.bs.carousel.data-api", "[data-slide-to]", c); a(window).on("load", function () { a('[data-ride="carousel"]').each(function () { var f = a(this); e.call(f, f.data()) }) }) }(jQuery); +function (a) { var b = ".dropdown-backdrop"; var h = '[data-toggle="dropdown"]'; var d = function (i) { a(i).on("click.bs.dropdown", this.toggle) }; d.VERSION = "3.3.4"; d.prototype.toggle = function (k) { var j = a(this); if (j.is(".disabled, :disabled")) { return } var i = e(j); var l = i.hasClass("open"); c(); if (!l) { if ("ontouchstart" in document.documentElement && !i.closest(".navbar-nav").length) { a('<div class="dropdown-backdrop"/>').insertAfter(a(this)).on("click", c) } var m = { relatedTarget: this }; i.trigger(k = a.Event("show.bs.dropdown", m)); if (k.isDefaultPrevented()) { return } j.trigger("focus").attr("aria-expanded", "true"); i.toggleClass("open").trigger("shown.bs.dropdown", m) } return false }; d.prototype.keydown = function (m) { if (!/(38|40|27|32)/.test(m.which) || /input|textarea/i.test(m.target.tagName)) { return } var k = a(this); m.preventDefault(); m.stopPropagation(); if (k.is(".disabled, :disabled")) { return } var j = e(k); var o = j.hasClass("open"); if ((!o && m.which != 27) || (o && m.which == 27)) { if (m.which == 27) { j.find(h).trigger("focus") } return k.trigger("click") } var l = " li:not(.disabled):visible a"; var i = j.find('[role="menu"]' + l + ', [role="listbox"]' + l); if (!i.length) { return } var n = i.index(m.target); if (m.which == 38 && n > 0) { n-- } if (m.which == 40 && n < i.length - 1) { n++ } if (!~n) { n = 0 } i.eq(n).trigger("focus") }; function c(i) { if (i && i.which === 3) { return } a(b).remove(); a(h).each(function () { var k = a(this); var j = e(k); var l = { relatedTarget: this }; if (!j.hasClass("open")) { return } j.trigger(i = a.Event("hide.bs.dropdown", l)); if (i.isDefaultPrevented()) { return } k.attr("aria-expanded", "false"); j.removeClass("open").trigger("hidden.bs.dropdown", l) }) } function e(j) { var k = j.attr("data-target"); if (!k) { k = j.attr("href"); k = k && /#[A-Za-z]/.test(k) && k.replace(/.*(?=#[^\s]*$)/, "") } var i = k && a(k); return i && i.length ? i : j.parent() } function g(i) { return this.each(function () { var j = a(this); var k = j.data("bs.dropdown"); if (!k) { j.data("bs.dropdown", (k = new d(this))) } if (typeof i == "string") { k[i].call(j) } }) } var f = a.fn.dropdown; a.fn.dropdown = g; a.fn.dropdown.Constructor = d; a.fn.dropdown.noConflict = function () { a.fn.dropdown = f; return this }; a(document).on("click.bs.dropdown.data-api", c).on("click.bs.dropdown.data-api", ".dropdown form", function (i) { i.stopPropagation() }).on("click.bs.dropdown.data-api", h, d.prototype.toggle).on("keydown.bs.dropdown.data-api", h, d.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="menu"]', d.prototype.keydown).on("keydown.bs.dropdown.data-api", '[role="listbox"]', d.prototype.keydown) }(jQuery); +function (a) { var b = function (e, f) { this.options = f; this.$body = a(document.body); this.$element = a(e); this.$dialog = this.$element.find(".modal-dialog"); this.$backdrop = null; this.isShown = null; this.originalBodyPad = null; this.scrollbarWidth = 0; this.ignoreBackdropClick = false; if (this.options.remote) { this.$element.find(".modal-content").load(this.options.remote, a.proxy(function () { this.$element.trigger("loaded.bs.modal") }, this)) } }; b.VERSION = "3.3.4"; b.TRANSITION_DURATION = 300; b.BACKDROP_TRANSITION_DURATION = 150; b.DEFAULTS = { backdrop: true, keyboard: true, show: true }; b.prototype.toggle = function (e) { return this.isShown ? this.hide() : this.show(e) }; b.prototype.show = function (f) { var h = this; var g = a.Event("show.bs.modal", { relatedTarget: f }); this.$element.trigger(g); if (this.isShown || g.isDefaultPrevented()) { return } this.isShown = true; this.checkScrollbar(); this.setScrollbar(); this.$body.addClass("modal-open"); this.escape(); this.resize(); this.$element.on("click.dismiss.bs.modal", '[data-dismiss="modal"]', a.proxy(this.hide, this)); this.$dialog.on("mousedown.dismiss.bs.modal", function () { h.$element.one("mouseup.dismiss.bs.modal", function (i) { if (a(i.target).is(h.$element)) { h.ignoreBackdropClick = true } }) }); this.backdrop(function () { var j = a.support.transition && h.$element.hasClass("fade"); if (!h.$element.parent().length) { h.$element.appendTo(h.$body) } h.$element.show().scrollTop(0); h.adjustDialog(); if (j) { h.$element[0].offsetWidth } h.$element.addClass("in").attr("aria-hidden", false); h.enforceFocus(); var i = a.Event("shown.bs.modal", { relatedTarget: f }); j ? h.$dialog.one("bsTransitionEnd", function () { h.$element.trigger("focus").trigger(i) }).emulateTransitionEnd(b.TRANSITION_DURATION) : h.$element.trigger("focus").trigger(i) }) }; b.prototype.hide = function (f) { if (f) { f.preventDefault() } f = a.Event("hide.bs.modal"); this.$element.trigger(f); if (!this.isShown || f.isDefaultPrevented()) { return } this.isShown = false; this.escape(); this.resize(); a(document).off("focusin.bs.modal"); this.$element.removeClass("in").attr("aria-hidden", true).off("click.dismiss.bs.modal").off("mouseup.dismiss.bs.modal"); this.$dialog.off("mousedown.dismiss.bs.modal"); a.support.transition && this.$element.hasClass("fade") ? this.$element.one("bsTransitionEnd", a.proxy(this.hideModal, this)).emulateTransitionEnd(b.TRANSITION_DURATION) : this.hideModal() }; b.prototype.enforceFocus = function () { a(document).off("focusin.bs.modal").on("focusin.bs.modal", a.proxy(function (f) { if (this.$element[0] !== f.target && !this.$element.has(f.target).length) { this.$element.trigger("focus") } }, this)) }; b.prototype.escape = function () { if (this.isShown && this.options.keyboard) { this.$element.on("keydown.dismiss.bs.modal", a.proxy(function (f) { f.which == 27 && this.hide() }, this)) } else { if (!this.isShown) { this.$element.off("keydown.dismiss.bs.modal") } } }; b.prototype.resize = function () { if (this.isShown) { a(window).on("resize.bs.modal", a.proxy(this.handleUpdate, this)) } else { a(window).off("resize.bs.modal") } }; b.prototype.hideModal = function () { var e = this; this.$element.hide(); this.backdrop(function () { e.$body.removeClass("modal-open"); e.resetAdjustments(); e.resetScrollbar(); e.$element.trigger("hidden.bs.modal") }) }; b.prototype.removeBackdrop = function () { this.$backdrop && this.$backdrop.remove(); this.$backdrop = null }; b.prototype.backdrop = function (f) { var i = this; var e = this.$element.hasClass("fade") ? "fade" : ""; if (this.isShown && this.options.backdrop) { var h = a.support.transition && e; this.$backdrop = a('<div class="modal-backdrop ' + e + '" />').appendTo(this.$body); this.$element.on("click.dismiss.bs.modal", a.proxy(function (j) { if (this.ignoreBackdropClick) { this.ignoreBackdropClick = false; return } if (j.target !== j.currentTarget) { return } this.options.backdrop == "static" ? this.$element[0].focus() : this.hide() }, this)); if (h) { this.$backdrop[0].offsetWidth } this.$backdrop.addClass("in"); if (!f) { return } h ? this.$backdrop.one("bsTransitionEnd", f).emulateTransitionEnd(b.BACKDROP_TRANSITION_DURATION) : f() } else { if (!this.isShown && this.$backdrop) { this.$backdrop.removeClass("in"); var g = function () { i.removeBackdrop(); f && f() }; a.support.transition && this.$element.hasClass("fade") ? this.$backdrop.one("bsTransitionEnd", g).emulateTransitionEnd(b.BACKDROP_TRANSITION_DURATION) : g() } else { if (f) { f() } } } }; b.prototype.handleUpdate = function () { this.adjustDialog() }; b.prototype.adjustDialog = function () { var e = this.$element[0].scrollHeight > document.documentElement.clientHeight; this.$element.css({ paddingLeft: !this.bodyIsOverflowing && e ? this.scrollbarWidth : "", paddingRight: this.bodyIsOverflowing && !e ? this.scrollbarWidth : "" }) }; b.prototype.resetAdjustments = function () { this.$element.css({ paddingLeft: "", paddingRight: "" }) }; b.prototype.checkScrollbar = function () { var f = window.innerWidth; if (!f) { var e = document.documentElement.getBoundingClientRect(); f = e.right - Math.abs(e.left) } this.bodyIsOverflowing = document.body.clientWidth < f; this.scrollbarWidth = this.measureScrollbar() }; b.prototype.setScrollbar = function () { var e = parseInt((this.$body.css("padding-right") || 0), 10); this.originalBodyPad = document.body.style.paddingRight || ""; if (this.bodyIsOverflowing) { this.$body.css("padding-right", e + this.scrollbarWidth) } }; b.prototype.resetScrollbar = function () { this.$body.css("padding-right", this.originalBodyPad) }; b.prototype.measureScrollbar = function () { var f = document.createElement("div"); f.className = "modal-scrollbar-measure"; this.$body.append(f); var e = f.offsetWidth - f.clientWidth; this.$body[0].removeChild(f); return e }; function d(f, e) { return this.each(function () { var g = a(this); var h = g.data("bs.modal"); var i = a.extend({}, b.DEFAULTS, g.data(), typeof f == "object" && f); if (!h) { g.data("bs.modal", (h = new b(this, i))) } if (typeof f == "string") { h[f](e) } else { if (i.show) { h.show(e) } } }) } var c = a.fn.modal; a.fn.modal = d; a.fn.modal.Constructor = b; a.fn.modal.noConflict = function () { a.fn.modal = c; return this }; a(document).on("click.bs.modal.data-api", '[data-toggle="modal"]', function (h) { var g = a(this); var i = g.attr("href"); var f = a(g.attr("data-target") || (i && i.replace(/.*(?=#[^\s]+$)/, ""))); var j = f.data("bs.modal") ? "toggle" : a.extend({ remote: !/#/.test(i) && i }, f.data(), g.data()); if (g.is("a")) { h.preventDefault() } f.one("show.bs.modal", function (e) { if (e.isDefaultPrevented()) { return } f.one("hidden.bs.modal", function () { g.is(":visible") && g.trigger("focus") }) }); d.call(f, j, this) }) }(jQuery); +function (a) { var d = function (e, f) { this.type = null; this.options = null; this.enabled = null; this.timeout = null; this.hoverState = null; this.$element = null; this.init("tooltip", e, f) }; d.VERSION = "3.3.4"; d.TRANSITION_DURATION = 150; d.DEFAULTS = { animation: true, placement: "top", selector: false, template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', trigger: "hover focus", title: "", delay: 0, html: false, container: false, viewport: { selector: "body", padding: 0 } }; d.prototype.init = function (m, e, j) { this.enabled = true; this.type = m; this.$element = a(e); this.options = this.getOptions(j); this.$viewport = this.options.viewport && a(this.options.viewport.selector || this.options.viewport); if (this.$element[0] instanceof document.constructor && !this.options.selector) { throw new Error("`selector` option must be specified when initializing " + this.type + " on the window.document object!") } var l = this.options.trigger.split(" "); for (var h = l.length; h--;) { var k = l[h]; if (k == "click") { this.$element.on("click." + this.type, this.options.selector, a.proxy(this.toggle, this)) } else { if (k != "manual") { var f = k == "hover" ? "mouseenter" : "focusin"; var g = k == "hover" ? "mouseleave" : "focusout"; this.$element.on(f + "." + this.type, this.options.selector, a.proxy(this.enter, this)); this.$element.on(g + "." + this.type, this.options.selector, a.proxy(this.leave, this)) } } } this.options.selector ? (this._options = a.extend({}, this.options, { trigger: "manual", selector: "" })) : this.fixTitle() }; d.prototype.getDefaults = function () { return d.DEFAULTS }; d.prototype.getOptions = function (e) { e = a.extend({}, this.getDefaults(), this.$element.data(), e); if (e.delay && typeof e.delay == "number") { e.delay = { show: e.delay, hide: e.delay } } return e }; d.prototype.getDelegateOptions = function () { var f = {}; var e = this.getDefaults(); this._options && a.each(this._options, function (g, h) { if (e[g] != h) { f[g] = h } }); return f }; d.prototype.enter = function (e) { var f = e instanceof this.constructor ? e : a(e.currentTarget).data("bs." + this.type); if (f && f.$tip && f.$tip.is(":visible")) { f.hoverState = "in"; return } if (!f) { f = new this.constructor(e.currentTarget, this.getDelegateOptions()); a(e.currentTarget).data("bs." + this.type, f) } clearTimeout(f.timeout); f.hoverState = "in"; if (!f.options.delay || !f.options.delay.show) { return f.show() } f.timeout = setTimeout(function () { if (f.hoverState == "in") { f.show() } }, f.options.delay.show) }; d.prototype.leave = function (e) { var f = e instanceof this.constructor ? e : a(e.currentTarget).data("bs." + this.type); if (!f) { f = new this.constructor(e.currentTarget, this.getDelegateOptions()); a(e.currentTarget).data("bs." + this.type, f) } clearTimeout(f.timeout); f.hoverState = "out"; if (!f.options.delay || !f.options.delay.hide) { return f.hide() } f.timeout = setTimeout(function () { if (f.hoverState == "out") { f.hide() } }, f.options.delay.hide) }; d.prototype.show = function () { var o = a.Event("show.bs." + this.type); if (this.hasContent() && this.enabled) { this.$element.trigger(o); var p = a.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); if (o.isDefaultPrevented() || !p) { return } var t = this; var g = this.tip(); var u = this.getUID(this.type); this.setContent(); g.attr("id", u); this.$element.attr("aria-describedby", u); if (this.options.animation) { g.addClass("fade") } var r = typeof this.options.placement == "function" ? this.options.placement.call(this, g[0], this.$element[0]) : this.options.placement; var k = /\s?auto?\s?/i; var j = k.test(r); if (j) { r = r.replace(k, "") || "top" } g.detach().css({ top: 0, left: 0, display: "block" }).addClass(r).data("bs." + this.type, this); this.options.container ? g.appendTo(this.options.container) : g.insertAfter(this.$element); var s = this.getPosition(); var i = g[0].offsetWidth; var h = g[0].offsetHeight; if (j) { var q = r; var f = this.options.container ? a(this.options.container) : this.$element.parent(); var n = this.getPosition(f); r = r == "bottom" && s.bottom + h > n.bottom ? "top" : r == "top" && s.top - h < n.top ? "bottom" : r == "right" && s.right + i > n.width ? "left" : r == "left" && s.left - i < n.left ? "right" : r; g.removeClass(q).addClass(r) } var l = this.getCalculatedOffset(r, s, i, h); this.applyPlacement(l, r); var m = function () { var e = t.hoverState; t.$element.trigger("shown.bs." + t.type); t.hoverState = null; if (e == "out") { t.leave(t) } }; a.support.transition && this.$tip.hasClass("fade") ? g.one("bsTransitionEnd", m).emulateTransitionEnd(d.TRANSITION_DURATION) : m() } }; d.prototype.applyPlacement = function (o, p) { var e = this.tip(); var q = e[0].offsetWidth; var k = e[0].offsetHeight; var n = parseInt(e.css("margin-top"), 10); var m = parseInt(e.css("margin-left"), 10); if (isNaN(n)) { n = 0 } if (isNaN(m)) { m = 0 } o.top = o.top + n; o.left = o.left + m; a.offset.setOffset(e[0], a.extend({ using: function (r) { e.css({ top: Math.round(r.top), left: Math.round(r.left) }) } }, o), 0); e.addClass("in"); var g = e[0].offsetWidth; var f = e[0].offsetHeight; if (p == "top" && f != k) { o.top = o.top + k - f } var j = this.getViewportAdjustedDelta(p, o, g, f); if (j.left) { o.left += j.left } else { o.top += j.top } var l = /top|bottom/.test(p); var h = l ? j.left * 2 - q + g : j.top * 2 - k + f; var i = l ? "offsetWidth" : "offsetHeight"; e.offset(o); this.replaceArrow(h, e[0][i], l) }; d.prototype.replaceArrow = function (e, f, g) { this.arrow().css(g ? "left" : "top", 50 * (1 - e / f) + "%").css(g ? "top" : "left", "") }; d.prototype.setContent = function () { var e = this.tip(); var f = this.getTitle(); e.find(".tooltip-inner")[this.options.html ? "html" : "text"](f); e.removeClass("fade in top bottom left right") }; d.prototype.hide = function (g) { var j = this; var f = a(this.$tip); var i = a.Event("hide.bs." + this.type); function h() { if (j.hoverState != "in") { f.detach() } j.$element.removeAttr("aria-describedby").trigger("hidden.bs." + j.type); g && g() } this.$element.trigger(i); if (i.isDefaultPrevented()) { return } f.removeClass("in"); a.support.transition && f.hasClass("fade") ? f.one("bsTransitionEnd", h).emulateTransitionEnd(d.TRANSITION_DURATION) : h(); this.hoverState = null; return this }; d.prototype.fixTitle = function () { var e = this.$element; if (e.attr("title") || typeof (e.attr("data-original-title")) != "string") { e.attr("data-original-title", e.attr("title") || "").attr("title", "") } }; d.prototype.hasContent = function () { return this.getTitle() }; d.prototype.getPosition = function (e) { e = e || this.$element; var f = e[0]; var i = f.tagName == "BODY"; var h = f.getBoundingClientRect(); if (h.width == null) { h = a.extend({}, h, { width: h.right - h.left, height: h.bottom - h.top }) } var g = i ? { top: 0, left: 0 } : e.offset(); var k = { scroll: i ? document.documentElement.scrollTop || document.body.scrollTop : e.scrollTop() }; var j = i ? { width: a(window).width(), height: a(window).height() } : null; return a.extend({}, h, k, j, g) }; d.prototype.getCalculatedOffset = function (g, h, f, e) { return g == "bottom" ? { top: h.top + h.height, left: h.left + h.width / 2 - f / 2 } : g == "top" ? { top: h.top - e, left: h.left + h.width / 2 - f / 2 } : g == "left" ? { top: h.top + h.height / 2 - e / 2, left: h.left - f } : { top: h.top + h.height / 2 - e / 2, left: h.left + h.width } }; d.prototype.getViewportAdjustedDelta = function (j, k, f, e) { var h = { top: 0, left: 0 }; if (!this.$viewport) { return h } var o = this.options.viewport && this.options.viewport.padding || 0; var n = this.getPosition(this.$viewport); if (/right|left/.test(j)) { var m = k.top - o - n.scroll; var g = k.top + o - n.scroll + e; if (m < n.top) { h.top = n.top - m } else { if (g > n.top + n.height) { h.top = n.top + n.height - g } } } else { var i = k.left - o; var l = k.left + o + f; if (i < n.left) { h.left = n.left - i } else { if (l > n.width) { h.left = n.left + n.width - l } } } return h }; d.prototype.getTitle = function () { var g; var e = this.$element; var f = this.options; g = e.attr("data-original-title") || (typeof f.title == "function" ? f.title.call(e[0]) : f.title); return g }; d.prototype.getUID = function (e) { do { e += ~~(Math.random() * 1000000) } while (document.getElementById(e)); return e }; d.prototype.tip = function () { return (this.$tip = this.$tip || a(this.options.template)) }; d.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow")) }; d.prototype.enable = function () { this.enabled = true }; d.prototype.disable = function () { this.enabled = false }; d.prototype.toggleEnabled = function () { this.enabled = !this.enabled }; d.prototype.toggle = function (f) { var g = this; if (f) { g = a(f.currentTarget).data("bs." + this.type); if (!g) { g = new this.constructor(f.currentTarget, this.getDelegateOptions()); a(f.currentTarget).data("bs." + this.type, g) } } g.tip().hasClass("in") ? g.leave(g) : g.enter(g) }; d.prototype.destroy = function () { var e = this; clearTimeout(this.timeout); this.hide(function () { e.$element.off("." + e.type).removeData("bs." + e.type) }) }; function c(e) { return this.each(function () { var f = a(this); var g = f.data("bs.tooltip"); var h = typeof e == "object" && e; if (!g && /destroy|hide/.test(e)) { return } if (!g) { f.data("bs.tooltip", (g = new d(this, h))) } if (typeof e == "string") { g[e]() } }) } var b = a.fn.tooltip; a.fn.tooltip = c; a.fn.tooltip.Constructor = d; a.fn.tooltip.noConflict = function () { a.fn.tooltip = b; return this } }(jQuery); +function (a) { var d = function (e, f) { this.init("popover", e, f) }; if (!a.fn.tooltip) { throw new Error("Popover requires tooltip.js") } d.VERSION = "3.3.4"; d.DEFAULTS = a.extend({}, a.fn.tooltip.Constructor.DEFAULTS, { placement: "right", trigger: "click", content: "", template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' }); d.prototype = a.extend({}, a.fn.tooltip.Constructor.prototype); d.prototype.constructor = d; d.prototype.getDefaults = function () { return d.DEFAULTS }; d.prototype.setContent = function () { var e = this.tip(); var g = this.getTitle(); var f = this.getContent(); e.find(".popover-title")[this.options.html ? "html" : "text"](g); e.find(".popover-content").children().detach().end()[this.options.html ? (typeof f == "string" ? "html" : "append") : "text"](f); e.removeClass("fade top bottom left right in"); if (!e.find(".popover-title").html()) { e.find(".popover-title").hide() } }; d.prototype.hasContent = function () { return this.getTitle() || this.getContent() }; d.prototype.getContent = function () { var e = this.$element; var f = this.options; return e.attr("data-content") || (typeof f.content == "function" ? f.content.call(e[0]) : f.content) }; d.prototype.arrow = function () { return (this.$arrow = this.$arrow || this.tip().find(".arrow")) }; function c(e) { return this.each(function () { var f = a(this); var g = f.data("bs.popover"); var h = typeof e == "object" && e; if (!g && /destroy|hide/.test(e)) { return } if (!g) { f.data("bs.popover", (g = new d(this, h))) } if (typeof e == "string") { g[e]() } }) } var b = a.fn.popover; a.fn.popover = c; a.fn.popover.Constructor = d; a.fn.popover.noConflict = function () { a.fn.popover = b; return this } }(jQuery); +function (a) { var e = function (f) { this.element = a(f) }; e.VERSION = "3.3.4"; e.TRANSITION_DURATION = 150; e.prototype.show = function () { var h = this.element; var i = h.closest("ul:not(.dropdown-menu)"); var k = h.data("target"); if (!k) { k = h.attr("href"); k = k && k.replace(/.*(?=#[^\s]*$)/, "") } if (h.parent("li").hasClass("active")) { return } var f = i.find(".active:last a"); var j = a.Event("hide.bs.tab", { relatedTarget: h[0] }); var l = a.Event("show.bs.tab", { relatedTarget: f[0] }); f.trigger(j); h.trigger(l); if (l.isDefaultPrevented() || j.isDefaultPrevented()) { return } var g = a(k); this.activate(h.closest("li"), i); this.activate(g, g.parent(), function () { f.trigger({ type: "hidden.bs.tab", relatedTarget: h[0] }); h.trigger({ type: "shown.bs.tab", relatedTarget: f[0] }) }) }; e.prototype.activate = function (i, h, g) { var f = h.find("> .active"); var k = g && a.support.transition && ((f.length && f.hasClass("fade")) || !!h.find("> .fade").length); function j() { f.removeClass("active").find("> .dropdown-menu > .active").removeClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", false); i.addClass("active").find('[data-toggle="tab"]').attr("aria-expanded", true); if (k) { i[0].offsetWidth; i.addClass("in") } else { i.removeClass("fade") } if (i.parent(".dropdown-menu").length) { i.closest("li.dropdown").addClass("active").end().find('[data-toggle="tab"]').attr("aria-expanded", true) } g && g() } f.length && k ? f.one("bsTransitionEnd", j).emulateTransitionEnd(e.TRANSITION_DURATION) : j(); f.removeClass("in") }; function d(f) { return this.each(function () { var g = a(this); var h = g.data("bs.tab"); if (!h) { g.data("bs.tab", (h = new e(this))) } if (typeof f == "string") { h[f]() } }) } var c = a.fn.tab; a.fn.tab = d; a.fn.tab.Constructor = e; a.fn.tab.noConflict = function () { a.fn.tab = c; return this }; var b = function (f) { f.preventDefault(); d.call(a(this), "show") }; a(document).on("click.bs.tab.data-api", '[data-toggle="tab"]', b).on("click.bs.tab.data-api", '[data-toggle="pill"]', b) }(jQuery); +function (a) { var b = function (e, f) { this.options = a.extend({}, b.DEFAULTS, f); this.$target = a(this.options.target).on("scroll.bs.affix.data-api", a.proxy(this.checkPosition, this)).on("click.bs.affix.data-api", a.proxy(this.checkPositionWithEventLoop, this)); this.$element = a(e); this.affixed = null; this.unpin = null; this.pinnedOffset = null; this.checkPosition() }; b.VERSION = "3.3.4"; b.RESET = "affix affix-top affix-bottom"; b.DEFAULTS = { offset: 0, target: window }; b.prototype.getState = function (l, g, j, i) { var m = this.$target.scrollTop(); var k = this.$element.offset(); var n = this.$target.height(); if (j != null && this.affixed == "top") { return m < j ? "top" : false } if (this.affixed == "bottom") { if (j != null) { return (m + this.unpin <= k.top) ? false : "bottom" } return (m + n <= l - i) ? false : "bottom" } var h = this.affixed == null; var f = h ? m : k.top; var e = h ? n : g; if (j != null && m <= j) { return "top" } if (i != null && (f + e >= l - i)) { return "bottom" } return false }; b.prototype.getPinnedOffset = function () { if (this.pinnedOffset) { return this.pinnedOffset } this.$element.removeClass(b.RESET).addClass("affix"); var f = this.$target.scrollTop(); var e = this.$element.offset(); return (this.pinnedOffset = e.top - f) }; b.prototype.checkPositionWithEventLoop = function () { setTimeout(a.proxy(this.checkPosition, this), 1) }; b.prototype.checkPosition = function () { if (!this.$element.is(":visible")) { return } var i = this.$element.height(); var j = this.options.offset; var l = j.top; var k = j.bottom; var m = a(document.body).height(); if (typeof j != "object") { k = l = j } if (typeof l == "function") { l = j.top(this.$element) } if (typeof k == "function") { k = j.bottom(this.$element) } var f = this.getState(m, i, l, k); if (this.affixed != f) { if (this.unpin != null) { this.$element.css("top", "") } var g = "affix" + (f ? "-" + f : ""); var h = a.Event(g + ".bs.affix"); this.$element.trigger(h); if (h.isDefaultPrevented()) { return } this.affixed = f; this.unpin = f == "bottom" ? this.getPinnedOffset() : null; this.$element.removeClass(b.RESET).addClass(g).trigger(g.replace("affix", "affixed") + ".bs.affix") } if (f == "bottom") { this.$element.offset({ top: m - i - k }) } }; function d(e) { return this.each(function () { var f = a(this); var g = f.data("bs.affix"); var h = typeof e == "object" && e; if (!g) { f.data("bs.affix", (g = new b(this, h))) } if (typeof e == "string") { g[e]() } }) } var c = a.fn.affix; a.fn.affix = d; a.fn.affix.Constructor = b; a.fn.affix.noConflict = function () { a.fn.affix = c; return this }; a(window).on("load", function () { a('[data-spy="affix"]').each(function () { var e = a(this); var f = e.data(); f.offset = f.offset || {}; if (f.offsetBottom != null) { f.offset.bottom = f.offsetBottom } if (f.offsetTop != null) { f.offset.top = f.offsetTop } d.call(e, f) }) }) }(jQuery); +function (a) { var b = function (f, g) { this.$element = a(f); this.options = a.extend({}, b.DEFAULTS, g); this.$trigger = a('[data-toggle="collapse"][href="#' + f.id + '"],[data-toggle="collapse"][data-target="#' + f.id + '"]'); this.transitioning = null; if (this.options.parent) { this.$parent = this.getParent() } else { this.addAriaAndCollapsedClass(this.$element, this.$trigger) } if (this.options.toggle) { this.toggle() } }; b.VERSION = "3.3.4"; b.TRANSITION_DURATION = 350; b.DEFAULTS = { toggle: true }; b.prototype.dimension = function () { var f = this.$element.hasClass("width"); return f ? "width" : "height" }; b.prototype.show = function () { if (this.transitioning || this.$element.hasClass("in")) { return } var g; var f = this.$parent && this.$parent.children(".panel").children(".in, .collapsing"); if (f && f.length) { g = f.data("bs.collapse"); if (g && g.transitioning) { return } } var k = a.Event("show.bs.collapse"); this.$element.trigger(k); if (k.isDefaultPrevented()) { return } if (f && f.length) { e.call(f, "hide"); g || f.data("bs.collapse", null) } var i = this.dimension(); this.$element.removeClass("collapse").addClass("collapsing")[i](0).attr("aria-expanded", true); this.$trigger.removeClass("collapsed").attr("aria-expanded", true); this.transitioning = 1; var h = function () { this.$element.removeClass("collapsing").addClass("collapse in")[i](""); this.transitioning = 0; this.$element.trigger("shown.bs.collapse") }; if (!a.support.transition) { return h.call(this) } var j = a.camelCase(["scroll", i].join("-")); this.$element.one("bsTransitionEnd", a.proxy(h, this)).emulateTransitionEnd(b.TRANSITION_DURATION)[i](this.$element[0][j]) }; b.prototype.hide = function () { if (this.transitioning || !this.$element.hasClass("in")) { return } var h = a.Event("hide.bs.collapse"); this.$element.trigger(h); if (h.isDefaultPrevented()) { return } var g = this.dimension(); this.$element[g](this.$element[g]())[0].offsetHeight; this.$element.addClass("collapsing").removeClass("collapse in").attr("aria-expanded", false); this.$trigger.addClass("collapsed").attr("aria-expanded", false); this.transitioning = 1; var f = function () { this.transitioning = 0; this.$element.removeClass("collapsing").addClass("collapse").trigger("hidden.bs.collapse") }; if (!a.support.transition) { return f.call(this) } this.$element[g](0).one("bsTransitionEnd", a.proxy(f, this)).emulateTransitionEnd(b.TRANSITION_DURATION) }; b.prototype.toggle = function () { this[this.$element.hasClass("in") ? "hide" : "show"]() }; b.prototype.getParent = function () { return a(this.options.parent).find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]').each(a.proxy(function (h, g) { var f = a(g); this.addAriaAndCollapsedClass(c(f), f) }, this)).end() }; b.prototype.addAriaAndCollapsedClass = function (f, g) { var h = f.hasClass("in"); f.attr("aria-expanded", h); g.toggleClass("collapsed", !h).attr("aria-expanded", h) }; function c(f) { var g; var h = f.attr("data-target") || (g = f.attr("href")) && g.replace(/.*(?=#[^\s]+$)/, ""); return a(h) } function e(f) { return this.each(function () { var g = a(this); var h = g.data("bs.collapse"); var i = a.extend({}, b.DEFAULTS, g.data(), typeof f == "object" && f); if (!h && i.toggle && /show|hide/.test(f)) { i.toggle = false } if (!h) { g.data("bs.collapse", (h = new b(this, i))) } if (typeof f == "string") { h[f]() } }) } var d = a.fn.collapse; a.fn.collapse = e; a.fn.collapse.Constructor = b; a.fn.collapse.noConflict = function () { a.fn.collapse = d; return this }; a(document).on("click.bs.collapse.data-api", '[data-toggle="collapse"]', function (i) { var g = a(this); if (!g.attr("data-target")) { i.preventDefault() } var f = c(g); var h = f.data("bs.collapse"); var j = h ? "toggle" : g.data(); e.call(f, j) }) }(jQuery); +function (a) { function d(e, f) { this.$body = a(document.body); this.$scrollElement = a(e).is(document.body) ? a(window) : a(e); this.options = a.extend({}, d.DEFAULTS, f); this.selector = (this.options.target || "") + " .nav li > a"; this.offsets = []; this.targets = []; this.activeTarget = null; this.scrollHeight = 0; this.$scrollElement.on("scroll.bs.scrollspy", a.proxy(this.process, this)); this.refresh(); this.process() } d.VERSION = "3.3.4"; d.DEFAULTS = { offset: 10 }; d.prototype.getScrollHeight = function () { return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) }; d.prototype.refresh = function () { var g = this; var f = "offset"; var e = 0; this.offsets = []; this.targets = []; this.scrollHeight = this.getScrollHeight(); if (!a.isWindow(this.$scrollElement[0])) { f = "position"; e = this.$scrollElement.scrollTop() } this.$body.find(this.selector).map(function () { var h = a(this); var j = h.data("target") || h.attr("href"); var i = /^#./.test(j) && a(j); return (i && i.length && i.is(":visible") && [[i[f]().top + e, j]]) || null }).sort(function (h, i) { return h[0] - i[0] }).each(function () { g.offsets.push(this[0]); g.targets.push(this[1]) }) }; d.prototype.process = function () { var k = this.$scrollElement.scrollTop() + this.options.offset; var j = this.getScrollHeight(); var g = this.options.offset + j - this.$scrollElement.height(); var h = this.offsets; var l = this.targets; var e = this.activeTarget; var f; if (this.scrollHeight != j) { this.refresh() } if (k >= g) { return e != (f = l[l.length - 1]) && this.activate(f) } if (e && k < h[0]) { this.activeTarget = null; return this.clear() } for (f = h.length; f--;) { e != l[f] && k >= h[f] && (h[f + 1] === undefined || k < h[f + 1]) && this.activate(l[f]) } }; d.prototype.activate = function (g) { this.activeTarget = g; this.clear(); var f = this.selector + '[data-target="' + g + '"],' + this.selector + '[href="' + g + '"]'; var e = a(f).parents("li").addClass("active"); if (e.parent(".dropdown-menu").length) { e = e.closest("li.dropdown").addClass("active") } e.trigger("activate.bs.scrollspy") }; d.prototype.clear = function () { a(this.selector).parentsUntil(this.options.target, ".active").removeClass("active") }; function c(e) { return this.each(function () { var f = a(this); var g = f.data("bs.scrollspy"); var h = typeof e == "object" && e; if (!g) { f.data("bs.scrollspy", (g = new d(this, h))) } if (typeof e == "string") { g[e]() } }) } var b = a.fn.scrollspy; a.fn.scrollspy = c; a.fn.scrollspy.Constructor = d; a.fn.scrollspy.noConflict = function () { a.fn.scrollspy = b; return this }; a(window).on("load.bs.scrollspy.data-api", function () { a('[data-spy="scroll"]').each(function () { var e = a(this); c.call(e, e.data()) }) }) }(jQuery); +function (a) { function b() { var c = document.createElement("bootstrap"); var e = { WebkitTransition: "webkitTransitionEnd", MozTransition: "transitionend", OTransition: "oTransitionEnd otransitionend", transition: "transitionend" }; for (var d in e) { if (c.style[d] !== undefined) { return { end: e[d] } } } return false } a.fn.emulateTransitionEnd = function (f) { var e = false; var c = this; a(this).one("bsTransitionEnd", function () { e = true }); var d = function () { if (!e) { a(c).trigger(a.support.transition.end) } }; setTimeout(d, f); return this }; a(function () { a.support.transition = b(); if (!a.support.transition) { return } a.event.special.bsTransitionEnd = { bindType: a.support.transition.end, delegateType: a.support.transition.end, handle: function (c) { if (a(c.target).is(this)) { return c.handleObj.handler.apply(this, arguments) } } } }) }(jQuery);;// is.js 0.7.3
// Author: Aras Atasaygin

// AMD with global, Node, or global
; (function (root, factory) {
    if (typeof define === 'function' && define.amd) {
        // AMD. Register as an anonymous module.
        define(['is'], function (is) {
            // Also create a global in case some scripts
            // that are loaded still are looking for
            // a global even when an AMD loader is in use.
            return (root.is = factory(is));
        });
    } else if (typeof exports === 'object') {
        // Node. Does not work with strict CommonJS, but
        // only CommonJS-like enviroments that support module.exports,
        // like Node.
        module.exports = factory(require('is_js'));
    } else {
        // Browser globals (root is window)
        root.is = factory(root.is);
    }
}(this, function (is) {

    // Baseline
    /* -------------------------------------------------------------------------- */

    var root = this || global;
    var previousIs = root.is;

    // define 'is' object and current version
    is = {};
    is.VERSION = '0.7.3';

    // define interfaces
    is.not = {};
    is.all = {};
    is.any = {};

    // cache some methods to call later on
    var toString = Object.prototype.toString;
    var arraySlice = Array.prototype.slice;
    var hasOwnProperty = Object.prototype.hasOwnProperty;

    // helper function which reverses the sense of predicate result
    function not(func) {
        return function () {
            return !func.apply(null, arraySlice.call(arguments));
        };
    }

    // helper function which call predicate function per parameter and return true if all pass
    function all(func) {
        return function () {
            var parameters = arraySlice.call(arguments);
            var length = parameters.length;
            if (length === 1 && is.array(parameters[0])) {    // support array
                parameters = parameters[0];
                length = parameters.length;
            }
            for (var i = 0; i < length; i++) {
                if (!func.call(null, parameters[i])) {
                    return false;
                }
            }
            return true;
        };
    }

    // helper function which call predicate function per parameter and return true if any pass
    function any(func) {
        return function () {
            var parameters = arraySlice.call(arguments);
            var length = parameters.length;
            if (length === 1 && is.array(parameters[0])) {    // support array
                parameters = parameters[0];
                length = parameters.length;
            }
            for (var i = 0; i < length; i++) {
                if (func.call(null, parameters[i])) {
                    return true;
                }
            }
            return false;
        };
    }

    // Type checks
    /* -------------------------------------------------------------------------- */

    // is a given value Arguments?
    is.arguments = function (value) {    // fallback check is for IE
        return is.not.null(value) && (toString.call(value) === '[object Arguments]' || (typeof value === 'object' && 'callee' in value));
    };

    // is a given value Array?
    is.array = Array.isArray || function (value) {    // check native isArray first
        return toString.call(value) === '[object Array]';
    };

    // is a given value Boolean?
    is.boolean = function (value) {
        return value === true || value === false || toString.call(value) === '[object Boolean]';
    };

    // is a given value Date Object?
    is.date = function (value) {
        return toString.call(value) === '[object Date]';
    };

    // is a given value Error object?
    is.error = function (value) {
        return toString.call(value) === '[object Error]';
    };

    // is a given value function?
    is.function = function (value) {    // fallback check is for IE
        return toString.call(value) === '[object Function]' || typeof value === 'function';
    };

    // is a given value NaN?
    is.nan = function (value) {    // NaN is number :) Also it is the only value which does not equal itself
        return value !== value;
    };

    // is a given value null?
    is.null = function (value) {
        return value === null || toString.call(value) === '[object Null]';
    };

    // is a given value number?
    is.number = function (value) {
        return is.not.nan(value) && toString.call(value) === '[object Number]';
    };

    // is a given value object?
    is.object = function (value) {
        var type = typeof value;
        return type === 'function' || type === 'object' && !!value;
    };

    // is given value a pure JSON object?
    is.json = function (value) {
        return toString.call(value) === '[object Object]';
    };

    // is a given value RegExp?
    is.regexp = function (value) {
        return toString.call(value) === '[object RegExp]';
    };

    // are given values same type?
    // prevent NaN, Number same type check
    is.sameType = function (value1, value2) {
        if (is.nan(value1) || is.nan(value2)) {
            return is.nan(value1) === is.nan(value2);
        }
        return toString.call(value1) === toString.call(value2);
    };
    // sameType method does not support 'all' and 'any' interfaces
    is.sameType.api = ['not'];

    // is a given value String?
    is.string = function (value) {
        return toString.call(value) === '[object String]';
    };

    // is a given value Char?
    is.char = function (value) {
        return is.string(value) && value.length === 1;
    };

    // is a given value undefined?
    is.undefined = function (value) {
        return value === void 0;
    };

    // Presence checks
    /* -------------------------------------------------------------------------- */

    //is a given value empty? Objects, arrays, strings
    is.empty = function (value) {
        if (is.object(value)) {
            var num = Object.getOwnPropertyNames(value).length;
            if (num === 0 || (num === 1 && is.array(value)) || (num === 2 && is.arguments(value))) {
                return true;
            }
            return false;
        } else {
            return value === '';
        }
    };

    // is a given value existy?
    is.existy = function (value) {
        return value !== null && value !== undefined;
    };

    // is a given value truthy?
    is.truthy = function (value) {
        return is.existy(value) && value !== false && is.not.nan(value) && value !== "" && value !== 0;
    };

    // is a given value falsy?
    is.falsy = not(is.truthy);

    // is a given value space?
    // horizantal tab: 9, line feed: 10, vertical tab: 11, form feed: 12, carriage return: 13, space: 32
    is.space = function (value) {
        if (is.char(value)) {
            var characterCode = value.charCodeAt(0);
            return (characterCode > 8 && characterCode < 14) || characterCode === 32;
        } else {
            return false;
        }
    };

    // Arithmetic checks
    /* -------------------------------------------------------------------------- */

    // are given values equal? supports numbers, strings, regexps, booleans
    // TODO: Add object and array support
    is.equal = function (value1, value2) {
        // check 0 and -0 equity with Infinity and -Infinity
        if (is.all.number(value1, value2)) {
            return value1 === value2 && 1 / value1 === 1 / value2;
        }
        // check regexps as strings too
        if (is.all.string(value1, value2) || is.all.regexp(value1, value2)) {
            return '' + value1 === '' + value2;
        }
        if (is.all.boolean(value1, value2)) {
            return value1 === value2;
        }
        return false;
    };
    // equal method does not support 'all' and 'any' interfaces
    is.equal.api = ['not'];

    // is a given number even?
    is.even = function (numb) {
        return is.number(numb) && numb % 2 === 0;
    };

    // is a given number odd?
    is.odd = function (numb) {
        return is.number(numb) && numb % 2 !== 0;
    };

    // is a given number positive?
    is.positive = function (numb) {
        return is.number(numb) && numb > 0;
    };

    // is a given number negative?
    is.negative = function (numb) {
        return is.number(numb) && numb < 0;
    };

    // is a given number above minimum parameter?
    is.above = function (numb, min) {
        return is.all.number(numb, min) && numb > min;
    };
    // above method does not support 'all' and 'any' interfaces
    is.above.api = ['not'];

    // is a given number above maximum parameter?
    is.under = function (numb, max) {
        return is.all.number(numb, max) && numb < max;
    };
    // least method does not support 'all' and 'any' interfaces
    is.under.api = ['not'];

    // is a given number within minimum and maximum parameters?
    is.within = function (numb, min, max) {
        return is.all.number(numb, min, max) && numb > min && numb < max;
    };
    // within method does not support 'all' and 'any' interfaces
    is.within.api = ['not'];

    // is a given number decimal?
    is.decimal = function (numb) {
        return is.number(numb) && numb % 1 !== 0;
    };

    // is a given number integer?
    is.integer = function (numb) {
        return is.number(numb) && numb % 1 === 0;
    };

    // is a given number finite?
    is.finite = isFinite || function (numb) {
        return numb !== Infinity && numb !== -Infinity && is.not.nan(numb);
    };

    // is a given number infinite?
    is.infinite = not(is.finite);

    // Regexp checks
    /* -------------------------------------------------------------------------- */
    // Steven Levithan, Jan Goyvaerts: Regular Expressions Cookbook
    // Scott Gonzalez: Email address validation

    // eppPhone match extensible provisioning protocol format
    // nanpPhone match north american number plan format
    // dateString match m/d/yy and mm/dd/yyyy, allowing any combination of one or two digits for the day and month, and two or four digits for the year
    // time match hours, minutes, and seconds, 24-hour clock
    var regexps = {
        url: /^(https?:\/\/)?([\da-z\.-]+)\.([a-z\.]{2,6})([\/\w \.-]*)*\/?$/,
        email: /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i,
        creditCard: /^(?:(4[0-9]{12}(?:[0-9]{3})?)|(5[1-5][0-9]{14})|(6(?:011|5[0-9]{2})[0-9]{12})|(3[47][0-9]{13})|(3(?:0[0-5]|[68][0-9])[0-9]{11})|((?:2131|1800|35[0-9]{3})[0-9]{11}))$/,
        alphaNumeric: /^[A-Za-z0-9]+$/,
        timeString: /^(2[0-3]|[01]?[0-9]):([0-5]?[0-9]):([0-5]?[0-9])$/,
        dateString: /^(1[0-2]|0?[1-9])\/(3[01]|[12][0-9]|0?[1-9])\/(?:[0-9]{2})?[0-9]{2}$/,
        usZipCode: /^[0-9]{5}(?:-[0-9]{4})?$/,
        caPostalCode: /^(?!.*[DFIOQU])[A-VXY][0-9][A-Z]\s?[0-9][A-Z][0-9]$/,
        ukPostCode: /^[A-Z]{1,2}[0-9RCHNQ][0-9A-Z]?\s?[0-9][ABD-HJLNP-UW-Z]{2}$|^[A-Z]{2}-?[0-9]{4}$/,
        nanpPhone: /^\(?([0-9]{3})\)?[-. ]?([0-9]{3})[-. ]?([0-9]{4})$/,
        eppPhone: /^\+[0-9]{1,3}\.[0-9]{4,14}(?:x.+)?$/,
        socialSecurityNumber: /^(?!000|666)[0-8][0-9]{2}-(?!00)[0-9]{2}-(?!0000)[0-9]{4}$/,
        affirmative: /^(?:1|t(?:rue)?|y(?:es)?|ok(?:ay)?)$/,
        hexadecimal: /^[0-9a-fA-F]+$/,
        hexColor: /^#?([0-9a-fA-F]{3}|[0-9a-fA-F]{6})$/,
        ipv4: /^(?:(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])\.){3}(?:\d|[1-9]\d|1\d{2}|2[0-4]\d|25[0-5])$/,
        ipv6: /^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/,
        ip: /^(([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])\.){3}([0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$|^(([a-zA-Z]|[a-zA-Z][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z]|[A-Za-z][A-Za-z0-9\-]*[A-Za-z0-9])$|^\s*((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|(([0-9A-Fa-f]{1,4}:){6}(:[0-9A-Fa-f]{1,4}|((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){5}(((:[0-9A-Fa-f]{1,4}){1,2})|:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(([0-9A-Fa-f]{1,4}:){4}(((:[0-9A-Fa-f]{1,4}){1,3})|((:[0-9A-Fa-f]{1,4})?:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){3}(((:[0-9A-Fa-f]{1,4}){1,4})|((:[0-9A-Fa-f]{1,4}){0,2}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){2}(((:[0-9A-Fa-f]{1,4}){1,5})|((:[0-9A-Fa-f]{1,4}){0,3}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(([0-9A-Fa-f]{1,4}:){1}(((:[0-9A-Fa-f]{1,4}){1,6})|((:[0-9A-Fa-f]{1,4}){0,4}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(:(((:[0-9A-Fa-f]{1,4}){1,7})|((:[0-9A-Fa-f]{1,4}){0,5}:((25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(\.(25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(%.+)?\s*$/
    };

    // create regexp checks methods from 'regexp' object
    for (var regexp in regexps) {
        if (regexps.hasOwnProperty(regexp)) {
            regexpCheck(regexp, regexps);
        }
    }

    function regexpCheck(regexp, regexps) {
        is[regexp] = function (value) {
            return regexps[regexp].test(value);
        };
    }

    // String checks
    /* -------------------------------------------------------------------------- */

    // is a given string include parameter substring?
    is.include = function (str, substr) {
        return str.indexOf(substr) > -1;
    };
    // include method does not support 'all' and 'any' interfaces
    is.include.api = ['not'];

    // is a given string all uppercase?
    is.upperCase = function (str) {
        return is.string(str) && str === str.toUpperCase();
    };

    // is a given string all lowercase?
    is.lowerCase = function (str) {
        return is.string(str) && str === str.toLowerCase();
    };

    // is string start with a given startWith parameter?
    is.startWith = function (str, startWith) {
        return is.string(str) && str.indexOf(startWith) === 0;
    };
    // startWith method does not support 'all' and 'any' interfaces
    is.startWith.api = ['not'];

    // is string end with a given endWith parameter?
    is.endWith = function (str, endWith) {
        return is.string(str) && str.indexOf(endWith) > -1 && str.indexOf(endWith) === str.length - endWith.length;
    };
    // endWith method does not support 'all' and 'any' interfaces
    is.endWith.api = ['not'];

    // is a given string or sentence capitalized?
    is.capitalized = function (str) {
        if (is.not.string(str)) {
            return false;
        }
        var words = str.split(' ');
        var capitalized = [];
        for (var i = 0; i < words.length; i++) {
            capitalized.push(words[i][0] === words[i][0].toUpperCase());
        }
        return is.all.truthy.apply(null, capitalized);
    };

    // is a given string palindrome?
    is.palindrome = function (str) {
        return is.string(str) && str == str.split('').reverse().join('');
    };

    // Time checks
    /* -------------------------------------------------------------------------- */

    var days = ['sunday', 'monday', 'tuesday', 'wednesday', 'thursday', 'friday', 'saturday'];
    var months = ['january', 'february', 'march', 'april', 'may', 'june', 'july', 'august', 'september', 'october', 'november', 'december'];

    // is a given date indicate today?
    is.today = function (obj) {
        var now = new Date();
        var todayString = now.toDateString();
        return is.date(obj) && obj.toDateString() === todayString;
    };

    // is a given date indicate yesterday?
    is.yesterday = function (obj) {
        var now = new Date();
        var yesterdayString = new Date(now.setDate(now.getDate() - 1)).toDateString();
        return is.date(obj) && obj.toDateString() === yesterdayString;
    };

    // is a given date indicate tomorrow?
    is.tomorrow = function (obj) {
        var now = new Date();
        var tomorrowString = new Date(now.setDate(now.getDate() + 1)).toDateString();
        return is.date(obj) && obj.toDateString() === tomorrowString;
    };

    // is a given date past?
    is.past = function (obj) {
        var now = new Date();
        return is.date(obj) && obj.getTime() < now.getTime();
    };

    // is a given date future?
    is.future = not(is.past);

    // is a given dates day equal given dayString parameter?
    is.day = function (obj, dayString) {
        return is.date(obj) && dayString.toLowerCase() === days[obj.getDay()];
    };
    // day method does not support 'all' and 'any' interfaces
    is.day.api = ['not'];

    // is a given dates month equal given monthString parameter?
    is.month = function (obj, monthString) {
        return is.date(obj) && monthString.toLowerCase() === months[obj.getMonth()];
    };
    // month method does not support 'all' and 'any' interfaces
    is.month.api = ['not'];

    // is a given dates year equal given year parameter?
    is.year = function (obj, year) {
        return is.date(obj) && is.number(year) && year === obj.getFullYear();
    };
    // year method does not support 'all' and 'any' interfaces
    is.year.api = ['not'];

    // is the given year a leap year?
    is.leapYear = function (year) {
        return is.number(year) && ((year % 4 === 0 && year % 100 !== 0) || year % 400 === 0);
    };

    // is a given date weekend?
    // 6: Saturday, 0: Sunday
    is.weekend = function (obj) {
        return is.date(obj) && (obj.getDay() === 6 || obj.getDay() === 0);
    };

    // is a given date weekday?
    is.weekday = not(is.weekend);

    // is date within given range?
    is.inDateRange = function (obj, startObj, endObj) {
        if (is.not.date(obj) || is.not.date(startObj) || is.not.date(endObj)) {
            return false;
        }
        var givenDate = obj.getTime();
        var start = startObj.getTime();
        var end = endObj.getTime();
        return givenDate > start && givenDate < end;
    };
    // inDateRange method does not support 'all' and 'any' interfaces
    is.inDateRange.api = ['not'];

    // is a given date in last week range?
    is.inLastWeek = function (obj) {
        return is.inDateRange(obj, new Date(new Date().setDate(new Date().getDate() - 7)), new Date());
    };

    // is a given date in last month range?
    is.inLastMonth = function (obj) {
        return is.inDateRange(obj, new Date(new Date().setMonth(new Date().getMonth() - 1)), new Date());
    };

    // is a given date in last year range?
    is.inLastYear = function (obj) {
        return is.inDateRange(obj, new Date(new Date().setFullYear(new Date().getFullYear() - 1)), new Date());
    };

    // is a given date in next week range?
    is.inNextWeek = function (obj) {
        return is.inDateRange(obj, new Date(), new Date(new Date().setDate(new Date().getDate() + 7)));
    };

    // is a given date in next month range?
    is.inNextMonth = function (obj) {
        return is.inDateRange(obj, new Date(), new Date(new Date().setMonth(new Date().getMonth() + 1)));
    };

    // is a given date in next year range?
    is.inNextYear = function (obj) {
        return is.inDateRange(obj, new Date(), new Date(new Date().setFullYear(new Date().getFullYear() + 1)));
    };

    // is a given date in the parameter quarter?
    is.quarterOfYear = function (obj, quarterNumber) {
        return is.date(obj) && is.number(quarterNumber) && quarterNumber === Math.floor((obj.getMonth() + 3) / 3);
    };
    // quarterOfYear method does not support 'all' and 'any' interfaces
    is.quarterOfYear.api = ['not'];

    // is a given date in daylight saving time?
    is.dayLightSavingTime = function (obj) {
        var january = new Date(obj.getFullYear(), 0, 1);
        var july = new Date(obj.getFullYear(), 6, 1);
        var stdTimezoneOffset = Math.max(january.getTimezoneOffset(), july.getTimezoneOffset());
        return obj.getTimezoneOffset() < stdTimezoneOffset;
    };

    // Environment checks
    /* -------------------------------------------------------------------------- */

    // check if library is used as a Node.js module
    if (typeof window !== 'undefined') {

        // store navigator properties to use later
        var userAgent = 'navigator' in window && 'userAgent' in navigator && navigator.userAgent.toLowerCase() || '';
        var vendor = 'navigator' in window && 'vendor' in navigator && navigator.vendor.toLowerCase() || '';
        var appVersion = 'navigator' in window && 'appVersion' in navigator && navigator.appVersion.toLowerCase() || '';

        // is current browser chrome?
        is.chrome = function () {
            return /chrome|chromium/i.test(userAgent) && /google inc/.test(vendor);
        };
        // chrome method does not support 'all' and 'any' interfaces
        is.chrome.api = ['not'];

        // is current browser firefox?
        is.firefox = function () {
            return /firefox/i.test(userAgent);
        };
        // firefox method does not support 'all' and 'any' interfaces
        is.firefox.api = ['not'];

        // is current browser internet explorer?
        // parameter is optional
        is.ie = function (version) {
            if (!version) {
                return /msie/i.test(userAgent) || "ActiveXObject" in window;
            }
            if (version >= 11) {
                return "ActiveXObject" in window;
            }
            return new RegExp('msie ' + version).test(userAgent);
        };
        // ie method does not support 'all' and 'any' interfaces
        is.ie.api = ['not'];

        // is current browser opera?
        is.opera = function () {
            return /^Opera\//.test(userAgent) || // Opera 12 and older versions
                /\x20OPR\//.test(userAgent); // Opera 15+
        };
        // opera method does not support 'all' and 'any' interfaces
        is.opera.api = ['not'];

        // is current browser safari?
        is.safari = function () {
            return /safari/i.test(userAgent) && /apple computer/i.test(vendor);
        };
        // safari method does not support 'all' and 'any' interfaces
        is.safari.api = ['not'];

        // is current device ios?
        is.ios = function () {
            return is.iphone() || is.ipad() || is.ipod();
        };
        // ios method does not support 'all' and 'any' interfaces
        is.ios.api = ['not'];

        // is current device iphone?
        is.iphone = function () {
            return /iphone/i.test(userAgent);
        };
        // iphone method does not support 'all' and 'any' interfaces
        is.iphone.api = ['not'];

        // is current device ipad?
        is.ipad = function () {
            return /ipad/i.test(userAgent);
        };
        // ipad method does not support 'all' and 'any' interfaces
        is.ipad.api = ['not'];

        // is current device ipod?
        is.ipod = function () {
            return /ipod/i.test(userAgent);
        };
        // ipod method does not support 'all' and 'any' interfaces
        is.ipod.api = ['not'];

        // is current device android?
        is.android = function () {
            return /android/i.test(userAgent);
        };
        // android method does not support 'all' and 'any' interfaces
        is.android.api = ['not'];

        // is current device android phone?
        is.androidPhone = function () {
            return /android/i.test(userAgent) && /mobile/i.test(userAgent);
        };
        // androidPhone method does not support 'all' and 'any' interfaces
        is.androidPhone.api = ['not'];

        // is current device android tablet?
        is.androidTablet = function () {
            return /android/i.test(userAgent) && !/mobile/i.test(userAgent);
        };
        // androidTablet method does not support 'all' and 'any' interfaces
        is.androidTablet.api = ['not'];

        // is current device blackberry?
        is.blackberry = function () {
            return /blackberry/i.test(userAgent) || /BB10/i.test(userAgent);
        };
        // blackberry method does not support 'all' and 'any' interfaces
        is.blackberry.api = ['not'];

        // is current device desktop?
        is.desktop = function () {
            return is.not.mobile() && is.not.tablet();
        };
        // desktop method does not support 'all' and 'any' interfaces
        is.desktop.api = ['not'];

        // is current operating system linux?
        is.linux = function () {
            return /linux/i.test(appVersion);
        };
        // linux method does not support 'all' and 'any' interfaces
        is.linux.api = ['not'];

        // is current operating system mac?
        is.mac = function () {
            return /mac/i.test(appVersion);
        };
        // mac method does not support 'all' and 'any' interfaces
        is.mac.api = ['not'];

        // is current operating system windows?
        is.windows = function () {
            return /win/i.test(appVersion);
        };
        // windows method does not support 'all' and 'any' interfaces
        is.windows.api = ['not'];

        // is current device windows phone?
        is.windowsPhone = function () {
            return is.windows() && /phone/i.test(userAgent);
        };
        // windowsPhone method does not support 'all' and 'any' interfaces
        is.windowsPhone.api = ['not'];

        // is current device windows tablet?
        is.windowsTablet = function () {
            return is.windows() && is.not.windowsPhone() && /touch/i.test(userAgent);
        };
        // windowsTablet method does not support 'all' and 'any' interfaces
        is.windowsTablet.api = ['not'];

        // is current device mobile?
        is.mobile = function () {
            return is.iphone() || is.ipod() || is.androidPhone() || is.blackberry() || is.windowsPhone();
        };
        // mobile method does not support 'all' and 'any' interfaces
        is.mobile.api = ['not'];

        // is current device tablet?
        is.tablet = function () {
            return is.ipad() || is.androidTablet() || is.windowsTablet();
        };
        // tablet method does not support 'all' and 'any' interfaces
        is.tablet.api = ['not'];

        // is current state online?
        is.online = function () {
            return navigator.onLine;
        };
        // online method does not support 'all' and 'any' interfaces
        is.online.api = ['not'];

        // is current state offline?
        is.offline = not(is.online);
        // offline method does not support 'all' and 'any' interfaces
        is.offline.api = ['not'];

        // is current device supports touch?
        is.touchDevice = function () {
            return 'ontouchstart' in window || 'DocumentTouch' in window && document instanceof DocumentTouch;
        };
        // touchDevice method does not support 'all' and 'any' interfaces
        is.touchDevice.api = ['not'];
    }

    // Object checks
    /* -------------------------------------------------------------------------- */

    // has a given object got parameterized count property?
    is.propertyCount = function (obj, count) {
        if (!is.object(obj) || !is.number(count)) {
            return false;
        }
        if (Object.keys) {
            return Object.keys(obj).length === count;
        }
        var properties = [],
            property;
        for (property in obj) {
            if (hasOwnProperty.call(obj, property)) {
                properties.push(property);
            }
        }
        return properties.length === count;
    };
    // propertyCount method does not support 'all' and 'any' interfaces
    is.propertyCount.api = ['not'];

    // is given object has parameterized property?
    is.propertyDefined = function (obj, property) {
        return is.object(obj) && is.string(property) && property in obj;
    };
    // propertyDefined method does not support 'all' and 'any' interfaces
    is.propertyDefined.api = ['not'];

    // is a given object window?
    // setInterval method is only available for window object
    is.windowObject = function (obj) {
        return typeof obj === 'object' && 'setInterval' in obj;
    };

    // is a given object a DOM node?
    is.domNode = function (obj) {
        return is.object(obj) && obj.nodeType > 0;
    };

    // Array checks
    /* -------------------------------------------------------------------------- */

    // is a given item in an array?
    is.inArray = function (val, arr) {
        if (is.not.array(arr)) {
            return false;
        }
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] === val) return true;
        }
        return false;
    };
    // inArray method does not support 'all' and 'any' interfaces
    is.inArray.api = ['not'];

    // is a given array sorted?
    is.sorted = function (arr) {
        if (is.not.array(arr)) {
            return false;
        }
        for (var i = 0; i < arr.length; i++) {
            if (arr[i] > arr[i + 1]) return false;
        }
        return true;
    };

    // API
    // Set 'not', 'all' and 'any' interfaces to methods based on their api property
    /* -------------------------------------------------------------------------- */

    function setInterfaces() {
        var options = is;
        for (var option in options) {
            if (hasOwnProperty.call(options, option) && is.function(options[option])) {
                var interfaces = options[option].api || ['not', 'all', 'any'];
                for (var i = 0; i < interfaces.length; i++) {
                    if (interfaces[i] === 'not') {
                        is.not[option] = not(is[option]);
                    }
                    if (interfaces[i] === 'all') {
                        is.all[option] = all(is[option]);
                    }
                    if (interfaces[i] === 'any') {
                        is.any[option] = any(is[option]);
                    }
                }
            }
        }
    }
    setInterfaces();

    // Configuration methods
    // Intentionally added after setInterfaces function
    /* -------------------------------------------------------------------------- */

    // set optional regexps to methods if you think they suck
    is.setRegexp = function (regexp, regexpName) {
        for (var r in regexps) {
            if (hasOwnProperty.call(regexps, r) && (regexpName === r)) {
                regexps[r] = regexp;
            }
        }
    };

    // change namespace of library to prevent name collisions
    // var preferredName = is.setNamespace();
    // preferredName.odd(3);
    // => true
    is.setNamespace = function () {
        root.is = previousIs;
        return this;
    };

    return is;
}));;/*
 * Toastr
 * Copyright 2012-2015
 * Authors: John Papa, Hans Fjällemark, and Tim Ferrell.
 * All Rights Reserved.
 * Use, reproduction, distribution, and modification of this code is subject to the terms and
 * conditions of the MIT license, available at http://www.opensource.org/licenses/mit-license.php
 *
 * ARIA Support: Greta Krafsig
 *
 * Project: https://github.com/CodeSeven/toastr
 */
/* global define */
; (function (define) {
    define(['jquery'], function ($) {
        return (function () {
            var $container;
            var listener;
            var toastId = 0;
            var toastType = {
                error: 'error',
                info: 'info',
                success: 'success',
                warning: 'warning'
            };

            var toastr = {
                clear: clear,
                remove: remove,
                error: error,
                getContainer: getContainer,
                info: info,
                options: {},
                subscribe: subscribe,
                success: success,
                version: '2.1.1',
                warning: warning
            };

            var previousToast;

            return toastr;

            ////////////////

            function error(message, title, optionsOverride) {
                return notify({
                    type: toastType.error,
                    iconClass: getOptions().iconClasses.error,
                    message: message,
                    optionsOverride: optionsOverride,
                    title: title
                });
            }

            function getContainer(options, create) {
                if (!options) { options = getOptions(); }
                $container = $('#' + options.containerId);
                if ($container.length) {
                    return $container;
                }
                if (create) {
                    $container = createContainer(options);
                }
                return $container;
            }

            function info(message, title, optionsOverride) {
                return notify({
                    type: toastType.info,
                    iconClass: getOptions().iconClasses.info,
                    message: message,
                    optionsOverride: optionsOverride,
                    title: title
                });
            }

            function subscribe(callback) {
                listener = callback;
            }

            function success(message, title, optionsOverride) {
                return notify({
                    type: toastType.success,
                    iconClass: getOptions().iconClasses.success,
                    message: message,
                    optionsOverride: optionsOverride,
                    title: title
                });
            }

            function warning(message, title, optionsOverride) {
                return notify({
                    type: toastType.warning,
                    iconClass: getOptions().iconClasses.warning,
                    message: message,
                    optionsOverride: optionsOverride,
                    title: title
                });
            }

            function clear($toastElement, clearOptions) {
                var options = getOptions();
                if (!$container) { getContainer(options); }
                if (!clearToast($toastElement, options, clearOptions)) {
                    clearContainer(options);
                }
            }

            function remove($toastElement) {
                var options = getOptions();
                if (!$container) { getContainer(options); }
                if ($toastElement && $(':focus', $toastElement).length === 0) {
                    removeToast($toastElement);
                    return;
                }
                if ($container.children().length) {
                    $container.remove();
                }
            }

            // internal functions

            function clearContainer (options) {
                var toastsToClear = $container.children();
                for (var i = toastsToClear.length - 1; i >= 0; i--) {
                    clearToast($(toastsToClear[i]), options);
                }
            }

            function clearToast ($toastElement, options, clearOptions) {
                var force = clearOptions && clearOptions.force ? clearOptions.force : false;
                if ($toastElement && (force || $(':focus', $toastElement).length === 0)) {
                    $toastElement[options.hideMethod]({
                        duration: options.hideDuration,
                        easing: options.hideEasing,
                        complete: function () { removeToast($toastElement); }
                    });
                    return true;
                }
                return false;
            }

            function createContainer(options) {
                $container = $('<div/>')
                    .attr('id', options.containerId)
                    .addClass(options.positionClass)
                    .attr('aria-live', 'polite')
                    .attr('role', 'alert');

                $container.appendTo($(options.target));
                return $container;
            }

            function getDefaults() {
                return {
                    tapToDismiss: true,
                    toastClass: 'toast',
                    containerId: 'toast-container',
                    debug: false,

                    showMethod: 'fadeIn', //fadeIn, slideDown, and show are built into jQuery
                    showDuration: 300,
                    showEasing: 'swing', //swing and linear are built into jQuery
                    onShown: undefined,
                    hideMethod: 'fadeOut',
                    hideDuration: 1000,
                    hideEasing: 'swing',
                    onHidden: undefined,

                    extendedTimeOut: 1000,
                    iconClasses: {
                        error: 'toast-error',
                        info: 'toast-info',
                        success: 'toast-success',
                        warning: 'toast-warning'
                    },
                    iconClass: 'toast-info',
                    positionClass: 'toast-top-right',
                    timeOut: 5000, // Set timeOut and extendedTimeOut to 0 to make it sticky
                    titleClass: 'toast-title',
                    messageClass: 'toast-message',
                    target: 'body',
                    closeHtml: '<button type="button">&times;</button>',
                    newestOnTop: true,
                    preventDuplicates: false,
                    progressBar: false
                };
            }

            function publish(args) {
                if (!listener) { return; }
                listener(args);
            }

            function notify(map) {
                var options = getOptions();
                var iconClass = map.iconClass || options.iconClass;

                if (typeof (map.optionsOverride) !== 'undefined') {
                    options = $.extend(options, map.optionsOverride);
                    iconClass = map.optionsOverride.iconClass || iconClass;
                }

                if (shouldExit(options, map)) { return; }

                toastId++;

                $container = getContainer(options, true);

                var intervalId = null;
                var $toastElement = $('<div/>');
                var $titleElement = $('<div/>');
                var $messageElement = $('<div/>');
                var $progressElement = $('<div/>');
                var $closeElement = $(options.closeHtml);
                var progressBar = {
                    intervalId: null,
                    hideEta: null,
                    maxHideTime: null
                };
                var response = {
                    toastId: toastId,
                    state: 'visible',
                    startTime: new Date(),
                    options: options,
                    map: map,
                    closeClicked: false
                };

                personalizeToast();

                displayToast();

                handleEvents();

                publish(response);

                if (options.debug && console) {
                    console.log(response);
                }

                return $toastElement;

                function personalizeToast() {
                    setIcon();
                    setTitle();
                    setMessage();
                    setCloseButton();
                    setProgressBar();
                    setSequence();
                }

                function handleEvents() {
                    $toastElement.hover(stickAround, delayedHideToast);
                    if (!options.onclick && options.tapToDismiss) {
                        $toastElement.click(hideToast);
                    }

                    if (options.closeButton && $closeElement) {
                        $closeElement.click(function (event) {
                            if (event.stopPropagation) {
                                event.stopPropagation();
                                response.closeClicked = true;
                            } else if (event.cancelBubble !== undefined && event.cancelBubble !== true) {
                                event.cancelBubble = true;
                            }
                            hideToast(true);
                        });
                    }

                    if (options.onclick) {
                        $toastElement.click(function () {
                            options.onclick();
                            hideToast();
                        });
                    }
                }

                function displayToast() {
                    $toastElement.hide();

                    $toastElement[options.showMethod](
                        {duration: options.showDuration, easing: options.showEasing, complete: options.onShown}
                    );

                    if (options.timeOut > 0) {
                        intervalId = setTimeout(hideToast, options.timeOut);
                        progressBar.maxHideTime = parseFloat(options.timeOut);
                        progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
                        if (options.progressBar) {
                            progressBar.intervalId = setInterval(updateProgress, 10);
                        }
                    }
                }

                function setIcon() {
                    if (map.iconClass) {
                        $toastElement.addClass(options.toastClass).addClass(iconClass);
                    }
                }

                function setSequence() {
                    if (options.newestOnTop) {
                        $container.prepend($toastElement);
                    } else {
                        $container.append($toastElement);
                    }
                }

                function setTitle() {
                    if (map.title) {
                        $titleElement.append(map.title).addClass(options.titleClass);
                        $toastElement.append($titleElement);
                    }
                }

                function setMessage() {
                    if (map.message) {
                        $messageElement.append(map.message).addClass(options.messageClass);
                        $toastElement.append($messageElement);
                    }
                }

                function setCloseButton() {
                    if (options.closeButton) {
                        $closeElement.addClass('toast-close-button').attr('role', 'button');
                        $toastElement.prepend($closeElement);
                    }
                }

                function setProgressBar() {
                    if (options.progressBar) {
                        $progressElement.addClass('toast-progress');
                        $toastElement.prepend($progressElement);
                    }
                }

                function shouldExit(options, map) {
                    if (options.preventDuplicates) {
                        if (map.message === previousToast) {
                            return true;
                        } else {
                            previousToast = map.message;
                        }
                    }
                    return false;
                }

                function hideToast(override) {
                    if ($(':focus', $toastElement).length && !override) {
                        return;
                    }
                    clearTimeout(progressBar.intervalId);
                    return $toastElement[options.hideMethod]({
                        duration: options.hideDuration,
                        easing: options.hideEasing,
                        complete: function () {
                            removeToast($toastElement);
                            if (options.onHidden && response.state !== 'hidden') {
                                options.onHidden();
                            }
                            response.state = 'hidden';
                            response.endTime = new Date();
                            publish(response);
                        }
                    });
                }

                function delayedHideToast() {
                    if (options.timeOut > 0 || options.extendedTimeOut > 0) {
                        intervalId = setTimeout(hideToast, options.extendedTimeOut);
                        progressBar.maxHideTime = parseFloat(options.extendedTimeOut);
                        progressBar.hideEta = new Date().getTime() + progressBar.maxHideTime;
                    }
                }

                function stickAround() {
                    clearTimeout(intervalId);
                    progressBar.hideEta = 0;
                    $toastElement.stop(true, true)[options.showMethod](
                        {duration: options.showDuration, easing: options.showEasing}
                    );
                }

                function updateProgress() {
                    var percentage = ((progressBar.hideEta - (new Date().getTime())) / progressBar.maxHideTime) * 100;
                    $progressElement.width(percentage + '%');
                }
            }

            function getOptions() {
                return $.extend({}, getDefaults(), toastr.options);
            }

            function removeToast($toastElement) {
                if (!$container) { $container = getContainer(); }
                if ($toastElement.is(':visible')) {
                    return;
                }
                $toastElement.remove();
                $toastElement = null;
                if ($container.children().length === 0) {
                    $container.remove();
                    previousToast = undefined;
                }
            }

        })();
    });
}(typeof define === 'function' && define.amd ? define : function (deps, factory) {
    if (typeof module !== 'undefined' && module.exports) { //Node
        module.exports = factory(require('jquery'));
    } else {
        window['toastr'] = factory(window['jQuery']);
    }
}));
;/* ========================================================================
 * SaRibe: eModal.js v1.2.65
 * http://saribe.github.io/eModal
 * ========================================================================
 * Copyright Samuel Ribeiro.
 * Licensed under MIT.
 * ======================================================================== */

/**
 * Easy Modal for bootstrap, is a simple way to create modal dialogs using javascript.
 * @params allowed elements:
 *     buttons  {array}:           An array of objects to configure buttons to modal footer; only able if message == string
 *     css      {object}:          CSS object try apply into message body; only able if message == string
 *     loading  {boolean}:         Set loading progress as message.
 *     message  {string|object}:   The body message string or the HTML element. e.g.: $(selector);
 *     size     {string}:          sm || lg || xl -> define the modal size.
 *     subtitle {string}:          The header subtitle string. This appear in a smaller text.
 *     title    {string}:          The header title string.
 *     useBin   {boolean}:         Set message as recyclable.
 * </summary>
 * <param name="params"   >Modal options parameters of string body message.</param>
 * <param name="title"    >The string header title or a flag to set default parameters.</param>
 * <returns type="Promise">{ then, element }.</returns>
 */

;
(function (define) {
    define(['jquery'], function ($, root) {
        var $modal;
        var BIN = 'recycle-bin';
        var DIV = '<div>';
        var EMPTY = '';
        var EVENT_CLICK = 'click';
        var EVENT_HIDE = 'hide';
        var EVENT_SHOW = 'shown.bs.modal';
        var EVENT_SUBMIT = 'submit';
        var FOOTER_ID = 'eFooter';
        var HIDE = EVENT_HIDE + '.bs.modal';
        var INPUT = 'input';
        var KEY_DANGER = 'gray';
        var LABEL = {
            OK: 'Cancel',
            True: 'False',
            Yes: 'No'
        };
        var lastParams = {};
        var MODAL_BODY = 'modal-body';
        var MODAL_DIALOG = '.modal-dialog';
        var options = {};
        var REC_MODAL_CONTENT = 'modal-rec';
        var SIZE = {
            sm: 'sm',
            lg: 'lg',
            xl: 'xl'
        };
        var TMP_MODAL_CONTENT = 'modal-tmp';

        var defaultSettings = {
            allowContentRecycle: true,
            confirmLabel: Object.keys(LABEL)[0],
            labels: LABEL,
            loadingHtml: '<h5>Loading...</h5><div class=progress><div class="progress-bar progress-bar-striped active" style="width: 100%"></div></div>',
            size: EMPTY,
            title: 'Attention'
        };

        root.addLabel = addLabel;
        root.ajax = ajax;
        root.alert = alert;
        root.close = close;
        root.confirm = confirm;
        root.emptyBin = emptyBin;
        root.iframe = iframe;
        root.prompt = prompt;
        root.setId = setId;
        root.setEModalOptions = setEModalOptions;
        root.setModalOptions = setModalOptions;
        root.size = SIZE;
        root.version = '1.2.65';

        return root;

        //#region /////////////////////////* Private Logic */////////////////////////
        /**
         * Find modal body and append message to it.
         * @param {String | DOM} message
         */
        function _build(message) {
            $modal
                .modal(options)
                .find('.modal-content')
                .append(message);
        }

        /**
         * Will find what Promises approach the developer is using.
         * Will use Promises A+ if Q.js is present, otherwise will use Promises A from jQuery.
         * @returns {Promise}
         */
        function _createDeferred() {
            var defer;

            // try native promise
            //if (Promise) defer = Promise.defer();

            var q;

            try {
                q = require('Q');
            } // Load option Q by require if exist
            catch (e) {
                q = window.Q;
            }

            if (q) { // try Q
                defer = q.defer();
            } else { // Use jQuery :(
                defer = $.Deferred();
                defer.promise = defer.promise();
            }

            defer.promise.element = _getModalInstance(true).find(MODAL_DIALOG);
            return defer;
        }

        /**
         * Will create modal DOM footer with all buttons.
         * @param {Array} buttons - all custom buttons, if none, will generate defaults
         * @returns {$DOM} footer DOM element
         */
        function _getFooter(buttons) {
            if (buttons === false) {
                return EMPTY;
            }

            var messageFotter = $(DIV).addClass('modal-footer').prop('id', FOOTER_ID);
            if (buttons) {
                for (var i = 0, k = buttons.length; i < k; i++) {
                    var btnOp = buttons[i];
                    var btn = $('<button>').addClass('btn btn-pattern btn-' + (btnOp.style || 'orange'));

                    for (var index in btnOp) {
                        if (btnOp.hasOwnProperty(index)) {
                            switch (index) {
                                case 'close':
                                    //add close event
                                    if (btnOp[index]) {
                                        btn.attr('data-dismiss', 'modal')
                                            .addClass('x');
                                    }
                                    break;
                                case EVENT_CLICK:
                                    //click event
                                    var fn = btnOp.click.bind(_getModalInstance(true).find('.modal-content'));
                                    btn.click(fn);
                                    break;
                                case 'text':
                                    btn.html(btnOp[index]);
                                    break;
                                default:
                                    //all other possible HTML attributes to button element
                                    btn.attr(index, btnOp[index]);
                            }
                        }
                    }

                    messageFotter.append(btn);
                }
            } else {
                //if no buttons defined by user, add a standard close button.
                messageFotter.append('<button class="x btn btn-primary" data-dismiss=modal type=button>Close</button>');
            }
            return messageFotter;
        }

        /**
         * Extract message from arguments.
         * @param {Object | String} data - this can be the message string or the full detailed object
         * @returns {$DOM}
         */
        function _getMessage(data) {
            var $message;
            var content = data.loading ?
                defaultSettings.loadingHtml :
                (data.message || data);

            if (content.on || content.onclick) {
                $message = data.clone === true ?
                    $(content).clone() :
                    $(content);

                $message.addClass(data.useBin && !data.loading ? REC_MODAL_CONTENT : TMP_MODAL_CONTENT);
            } else {
                $message = $(DIV)
                    .attr('style', 'position:relative;word-wrap:break-word;line-height: 1.4;font-weight: 400;font-size: 16px;')
                    .addClass(MODAL_BODY)
                    .html(content);
            }

            return data.css && (data.css !== $message.css && $message.css(data.css)), $message;
        }

        /**
         * Return a new modal object if is the first request or the already created model.
         * @param {boolean} skipEventChageIfExists
         * @returns {jQuery Object}
         */
        function _getModalInstance(skipEventChageIfExists) {
            if (!$modal) {
                //add recycle bin container to document
                if (!$('#' + BIN).length) {
                    $('body').append($(DIV).prop('id', BIN).hide());
                }

                $modal = createModalElement();
            }

            if (skipEventChageIfExists && $modal) {
                return $modal;
            }

            return $modal
                .on(EVENT_SHOW, function () {
                    $(this).find(INPUT).first().focus();
                });

            function createModalElement() {
                return $('<div class="modal fade" tabindex="-1"><style>.modal-xl{width:100%; margin: 200px auto;}.modal-body{max-height: calc(100vh - 145px);overflow-y: auto;}</style>' +
                        '<div class=modal-dialog>' +
                        '<div class=modal-content>' +
                        ' <div class=modal-header><button type=button class="x close" data-dismiss=modal><span aria-hidden=true>&times;</span><span class=sr-only>Close</span></button><h4 class=modal-title></h4></div>' +
                        '</div>' +
                        '</div>' +
                        '</div>')
                    .on('hidden.bs.modal', _recycleModal)
                    .on(EVENT_CLICK, 'button.x', function (ev) {
                        var btn = $(ev.currentTarget);

                        if (btn.prop('type') !== EVENT_SUBMIT)
                            return $modal.modal(EVENT_HIDE);

                        try {
                            if (btn.closest('form')[0].checkValidity())
                                return close();
                        } catch (e) {
                            return close();
                        }

                        return $modal;
                    });
            }
        }

        /**
         * Move content to recycle bin if is a DOM object defined by user,
         * delete it if is a simple string message.
         * All modal messages can be deleted if default setting "allowContentRecycle" = false.
         */
        function _recycleModal() {
            if (!$modal) return;

            var $content = $modal.find('.' + REC_MODAL_CONTENT).removeClass(REC_MODAL_CONTENT)
                .appendTo('#' + BIN);

            $modal
                .off(HIDE)
                .off(EVENT_SHOW)
                .find('.modal-content > div:not(:first-child)')
                .remove();

            if (!defaultSettings.allowContentRecycle || lastParams.clone) {
                $content.remove();
            }
        }

        /**
         * Handle default values and toggle between {Object | String}.
         * Create or get Modal element
         * @param {Object | String} data - this can be the message string or the full detailed object
         * @param {String} title - the string that will be shown in modal header
         * @returns {Promise} Promise with modal $DOM element
         */
        function _setup(params, title) {
            if (!params) throw new Error('Invalid parameters!');

            _recycleModal();
            lastParams = params;

            // Lazy loading
            var $ref = _getModalInstance();

            //#region change size
            $ref.find(MODAL_DIALOG)
                .removeClass('modal-sm modal-lg modal-xl')
                .addClass(params.size ? 'modal-' + params.size : defaultSettings.size);
            //#endregion

            //#region change title
            $ref.find('.modal-title')
                .html((params.title || title || defaultSettings.title) + ' ')
                .append($('<small>').html(params.subtitle || EMPTY));
            //#endregion

            $ref.on(HIDE, params.onHide);
        }
        //#endregion

        //#region /////////////////////////* Public Methods */////////////////////////

        function addLabel(yes, no) {
            LABEL[yes] = no;
        }

        /**
         * Gets data from URL to eModal body
         * @param {Object | String} data - this can be the message string or the full detailed object
         * @param {String} title - the string that will be shown in modal header
         * @returns {Promise} Promise with modal $DOM element
         */
        function ajax(data, title) {
            var dfd = _createDeferred();

            var params = {
                async: true,
                deferred: dfd,
                loading: true,
                title: data.title || title || defaultSettings.title,
                url: data.url || data,
                dataType: data.dataType || 'text'
            };

            if (data.url) {
                $.extend(params, data);
            }

            $.ajax(params)
                .done(ok)
                .fail(error);

            return alert(params, title);

            function ok(html) {
                $modal
                    .find('.' + MODAL_BODY)
                    .html(data.success ? data.success(html) : html);

                return dfd.resolve($modal);
            }

            function error(responseText, textStatus) {
                var msg = data.error ?
                    data.error(responseText, textStatus, params) :
                    '<div class="alert alert-danger">' +
                    '<strong>XHR Fail: </strong>URL [ ' + params.url + '] load fail.' +
                    '</div>';

                $modal
                    .find('.' + MODAL_BODY)
                    .html(msg);
                return dfd.reject(responseText);
            }
        }

        /**
         * Non blocking alert whit bootstrap.
         * @param {Object | String} data - this can be the message string or the full detailed object.
         * @param {String} title - the string that will be shown in modal header.
         * @returns {Promise} Promise with modal $DOM element
         */
        function alert(data, title) {
            _setup(data, title);

            var dfd = data.deferred || _createDeferred();
            var $message = $(DIV).append(_getMessage(data), _getFooter(data.buttons));

            _build($message);

            if (!data.async) {
                $modal.on(EVENT_SHOW, dfd.resolve);
            }

            return dfd.promise;
        }

        /**
         * Non blocking confirm dialog with bootstrap.
         * @param {Object | String} data - this can be the message string or the full detailed object.
         * @param {String} title - the string that will be shown in modal header.
         * @returns {Promise} Promise with modal $DOM element
         */
        function confirm(data, title) {
            var dfd = _createDeferred();

            return alert({
                async: true,
                buttons: [{
                    close: true,
                    click: click,
                    text: LABEL[data.label] ? LABEL[data.label] : LABEL[defaultSettings.confirmLabel],
                    style: data.style && data.style[0] || KEY_DANGER
                }, {
                    close: true,
                    click: click,
                    text: LABEL[data.label] ? data.label : defaultSettings.confirmLabel,
                    style: data.style && data.style[1]
                }],
                deferred: dfd,
                message: data.message || data,
                onHide: click,
                size: data.size,
                title: data.title || title
            });

            function click(ev) {
                close();

                var key = $(ev.currentTarget).html();
                return LABEL[key] ? dfd.resolve() : dfd.reject();
            }
        }

        /**
         * Will load a URL in iFrame inside the modal body.
         * @param {Object | String} data - this can be the URL string or the full detailed object.
         * @param {String} title - the string that will be shown in modal header.
         * @returns {Promise} Promise with modal $DOM element
         */
        function iframe(params, title) {
            var dfd = _createDeferred();
            var html = ('<div class=modal-body style="position: absolute;width: 100%;background-color: rgba(255,255,255,0.8);height: 100%;">%1%</div>' +
                    '<iframe class="embed-responsive-item" frameborder=0 src="%0%" style="width:100%;height:75vh;display:block;"/>')
                .replace('%0%', params.message || params.url || params)
                .replace('%1%', defaultSettings.loadingHtml);

            var message = $(html)
                .load(iframeReady);

            return alert({
                async: true,
                buttons: params.buttons || false,
                deferred: dfd,
                message: message,
                size: params.size || SIZE.xl,
                title: params.title || title
            });
            //////////

            function iframeReady() {
                $(this)
                    .parent()
                    .find('div.' + TMP_MODAL_CONTENT)
                    .fadeOut(function () {
                        $(this).remove();
                    });

                return dfd.resolve();
            }
        }

        /**
         * Remove all Dom elements in recycle bin.
         * @returns {Array} All removed elements
         */
        function emptyBin() {
            return $('#' + BIN + ' > *').remove();
        }

        /**
         * Provides one value form.
         * @param {Object | String} data - this can be the value string label or the full detailed object.
         * @param {String} title - the string that will be shown in modal header.
         * @returns {Promise} Promise with modal $DOM element
         */
        function prompt(data, title) {
            var dfd = _createDeferred();
            var params = {
                deferred: dfd
            };

            if (typeof data === 'object') {
                $.extend(params, data);
            } else {
                params.message = data;
                params.title = title;
            }

            params.async = true;

            if (params.buttons) {
                var btn;
                for (var i = 0, k = params.buttons.length; i < k; i++) {
                    btn = params.buttons[i];
                    btn.style = (btn.style || 'default') + ' pull-left';
                    btn.type = btn.type || 'button';
                }
            }

            var buttons = _getFooter([{
                close: true,
                type: 'reset',
                text: LABEL.OK,
                style: KEY_DANGER
            }, {
                close: false,
                type: EVENT_SUBMIT,
                text: defaultSettings.confirmLabel
            }].concat(params.buttons || []));

            params.buttons = false;
            params.onHide = submit;

            params.message = $('<form role=form style="margin-bottom:0;">' +
                    '<div class=modal-body>' +
                    '<label for=prompt-input class=control-label>' + (params.message || EMPTY) + '</label>' +
                    '<input type=text class=form-control required autocomplete="on" value="' + (params.value || EMPTY) + (params.pattern ? '" pattern="' + params.pattern : EMPTY) + '">' +
                    '</div></form>')
                .append(buttons)
                .on(EVENT_SUBMIT, submit);

            return alert(params);

            function submit(ev) {
                var value = $modal.find(INPUT).val();
                close();

                //TODO:
                ev.type !== EVENT_SUBMIT ?
                    dfd.reject(value) :
                    dfd.resolve(value);

                return false;
            }
        }

        function setId(id) {
            _getModalInstance(true)
                .find(MODAL_DIALOG)
                .prop('id', id);
        }

        /**
         * Set or change eModal options.
         * @param {Object} overrideOptions
         * @returns {Object} merged eModal options
         */
        function setEModalOptions(overrideOptions) {
            return $.extend(defaultSettings, overrideOptions);
        }

        /**
         * Set or change bootstrap modal options.
         * @param {Object} overrideOptions
         * @returns {Object} merged eModal options
         */
        function setModalOptions(overrideOptions) {
            $modal && $modal.remove();

            return $.extend(options, overrideOptions);
        }

        /**
         * Close the current open eModal
         * @returns {$DOM} eModal DOM element
         */
        function close() {
            if ($modal) {
                $modal.off(HIDE).modal(EVENT_HIDE);
            }
            return $modal;
        }
        //#endregion
    });
}(typeof define == 'function' && define.amd ?
    define :
    function (args, mName) {
        this.eModal = typeof module != 'undefined' && module.exports ?
            mName(require(args[0]), module.exports) :
            mName(window.$, {});
    }));;!function(){"use strict";function e(e){function t(t,n){var s,h,k=t==window,y=n&&void 0!==n.message?n.message:void 0;if(n=e.extend({},e.blockUI.defaults,n||{}),!n.ignoreIfBlocked||!e(t).data("blockUI.isBlocked")){if(n.overlayCSS=e.extend({},e.blockUI.defaults.overlayCSS,n.overlayCSS||{}),s=e.extend({},e.blockUI.defaults.css,n.css||{}),n.onOverlayClick&&(n.overlayCSS.cursor="pointer"),h=e.extend({},e.blockUI.defaults.themedCSS,n.themedCSS||{}),y=void 0===y?n.message:y,k&&p&&o(window,{fadeOut:0}),y&&"string"!=typeof y&&(y.parentNode||y.jquery)){var m=y.jquery?y[0]:y,v={};e(t).data("blockUI.history",v),v.el=m,v.parent=m.parentNode,v.display=m.style.display,v.position=m.style.position,v.parent&&v.parent.removeChild(m)}e(t).data("blockUI.onUnblock",n.onUnblock);var g,I,w,U,x=n.baseZ;g=e(r||n.forceIframe?'<iframe class="blockUI" style="z-index:'+x++ +';display:none;border:none;margin:0;padding:0;position:absolute;width:100%;height:100%;top:0;left:0" src="'+n.iframeSrc+'"></iframe>':'<div class="blockUI" style="display:none"></div>'),I=e(n.theme?'<div class="blockUI blockOverlay ui-widget-overlay" style="z-index:'+x++ +';display:none"></div>':'<div class="blockUI blockOverlay" style="z-index:'+x++ +';display:none;border:none;margin:0;padding:0;width:100%;height:100%;top:0;left:0"></div>'),n.theme&&k?(U='<div class="blockUI '+n.blockMsgClass+' blockPage ui-dialog ui-widget ui-corner-all" style="z-index:'+(x+10)+';display:none;position:fixed">',n.title&&(U+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(n.title||"&nbsp;")+"</div>"),U+='<div class="ui-widget-content ui-dialog-content"></div>',U+="</div>"):n.theme?(U='<div class="blockUI '+n.blockMsgClass+' blockElement ui-dialog ui-widget ui-corner-all" style="z-index:'+(x+10)+';display:none;position:absolute">',n.title&&(U+='<div class="ui-widget-header ui-dialog-titlebar ui-corner-all blockTitle">'+(n.title||"&nbsp;")+"</div>"),U+='<div class="ui-widget-content ui-dialog-content"></div>',U+="</div>"):U=k?'<div class="blockUI '+n.blockMsgClass+' blockPage" style="z-index:'+(x+10)+';display:none;position:fixed"></div>':'<div class="blockUI '+n.blockMsgClass+' blockElement" style="z-index:'+(x+10)+';display:none;position:absolute"></div>',w=e(U),y&&(n.theme?(w.css(h),w.addClass("ui-widget-content")):w.css(s)),n.theme||I.css(n.overlayCSS),I.css("position",k?"fixed":"absolute"),(r||n.forceIframe)&&g.css("opacity",0);var C=[g,I,w],S=e(k?"body":t);e.each(C,function(){this.appendTo(S)}),n.theme&&n.draggable&&e.fn.draggable&&w.draggable({handle:".ui-dialog-titlebar",cancel:"li"});var O=f&&(!e.support.boxModel||e("object,embed",k?null:t).length>0);if(u||O){if(k&&n.allowBodyStretch&&e.support.boxModel&&e("html,body").css("height","100%"),(u||!e.support.boxModel)&&!k)var E=d(t,"borderTopWidth"),T=d(t,"borderLeftWidth"),M=E?"(0 - "+E+")":0,B=T?"(0 - "+T+")":0;e.each(C,function(e,t){var o=t[0].style;if(o.position="absolute",2>e)k?o.setExpression("height","Math.max(document.body.scrollHeight, document.body.offsetHeight) - (jQuery.support.boxModel?0:"+n.quirksmodeOffsetHack+') + "px"'):o.setExpression("height",'this.parentNode.offsetHeight + "px"'),k?o.setExpression("width",'jQuery.support.boxModel && document.documentElement.clientWidth || document.body.clientWidth + "px"'):o.setExpression("width",'this.parentNode.offsetWidth + "px"'),B&&o.setExpression("left",B),M&&o.setExpression("top",M);else if(n.centerY)k&&o.setExpression("top",'(document.documentElement.clientHeight || document.body.clientHeight) / 2 - (this.offsetHeight / 2) + (blah = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "px"'),o.marginTop=0;else if(!n.centerY&&k){var i=n.css&&n.css.top?parseInt(n.css.top,10):0,s="((document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop) + "+i+') + "px"';o.setExpression("top",s)}})}if(y&&(n.theme?w.find(".ui-widget-content").append(y):w.append(y),(y.jquery||y.nodeType)&&e(y).show()),(r||n.forceIframe)&&n.showOverlay&&g.show(),n.fadeIn){var j=n.onBlock?n.onBlock:c,H=n.showOverlay&&!y?j:c,z=y?j:c;n.showOverlay&&I._fadeIn(n.fadeIn,H),y&&w._fadeIn(n.fadeIn,z)}else n.showOverlay&&I.show(),y&&w.show(),n.onBlock&&n.onBlock.bind(w)();if(i(1,t,n),k?(p=w[0],b=e(n.focusableElements,p),n.focusInput&&setTimeout(l,20)):a(w[0],n.centerX,n.centerY),n.timeout){var W=setTimeout(function(){k?e.unblockUI(n):e(t).unblock(n)},n.timeout);e(t).data("blockUI.timeout",W)}}}function o(t,o){var s,l=t==window,a=e(t),d=a.data("blockUI.history"),c=a.data("blockUI.timeout");c&&(clearTimeout(c),a.removeData("blockUI.timeout")),o=e.extend({},e.blockUI.defaults,o||{}),i(0,t,o),null===o.onUnblock&&(o.onUnblock=a.data("blockUI.onUnblock"),a.removeData("blockUI.onUnblock"));var r;r=l?e("body").children().filter(".blockUI").add("body > .blockUI"):a.find(">.blockUI"),o.cursorReset&&(r.length>1&&(r[1].style.cursor=o.cursorReset),r.length>2&&(r[2].style.cursor=o.cursorReset)),l&&(p=b=null),o.fadeOut?(s=r.length,r.stop().fadeOut(o.fadeOut,function(){0===--s&&n(r,d,o,t)})):n(r,d,o,t)}function n(t,o,n,i){var s=e(i);if(!s.data("blockUI.isBlocked")){t.each(function(e,t){this.parentNode&&this.parentNode.removeChild(this)}),o&&o.el&&(o.el.style.display=o.display,o.el.style.position=o.position,o.el.style.cursor="default",o.parent&&o.parent.appendChild(o.el),s.removeData("blockUI.history")),s.data("blockUI.static")&&s.css("position","static"),"function"==typeof n.onUnblock&&n.onUnblock(i,n);var l=e(document.body),a=l.width(),d=l[0].style.width;l.width(a-1).width(a),l[0].style.width=d}}function i(t,o,n){var i=o==window,l=e(o);if((t||(!i||p)&&(i||l.data("blockUI.isBlocked")))&&(l.data("blockUI.isBlocked",t),i&&n.bindEvents&&(!t||n.showOverlay))){var a="mousedown mouseup keydown keypress keyup touchstart touchend touchmove";t?e(document).bind(a,n,s):e(document).unbind(a,s)}}function s(t){if("keydown"===t.type&&t.keyCode&&9==t.keyCode&&p&&t.data.constrainTabKey){var o=b,n=!t.shiftKey&&t.target===o[o.length-1],i=t.shiftKey&&t.target===o[0];if(n||i)return setTimeout(function(){l(i)},10),!1}var s=t.data,a=e(t.target);return a.hasClass("blockOverlay")&&s.onOverlayClick&&s.onOverlayClick(t),a.parents("div."+s.blockMsgClass).length>0?!0:0===a.parents().children().filter("div.blockUI").length}function l(e){if(b){var t=b[e===!0?b.length-1:0];t&&t.focus()}}function a(e,t,o){var n=e.parentNode,i=e.style,s=(n.offsetWidth-e.offsetWidth)/2-d(n,"borderLeftWidth"),l=(n.offsetHeight-e.offsetHeight)/2-d(n,"borderTopWidth");t&&(i.left=s>0?s+"px":"0"),o&&(i.top=l>0?l+"px":"0")}function d(t,o){return parseInt(e.css(t,o),10)||0}e.fn._fadeIn=e.fn.fadeIn;var c=e.noop||function(){},r=/MSIE/.test(navigator.userAgent),u=/MSIE 6.0/.test(navigator.userAgent)&&!/MSIE 8.0/.test(navigator.userAgent),f=(document.documentMode||0,e.isFunction(document.createElement("div").style.setExpression));e.blockUI=function(e){t(window,e)},e.unblockUI=function(e){o(window,e)},e.growlUI=function(t,o,n,i){var s=e('<div class="growlUI"></div>');t&&s.append("<h1>"+t+"</h1>"),o&&s.append("<h2>"+o+"</h2>"),void 0===n&&(n=3e3);var l=function(t){t=t||{},e.blockUI({message:s,fadeIn:"undefined"!=typeof t.fadeIn?t.fadeIn:700,fadeOut:"undefined"!=typeof t.fadeOut?t.fadeOut:1e3,timeout:"undefined"!=typeof t.timeout?t.timeout:n,centerY:!1,showOverlay:!1,onUnblock:i,css:e.blockUI.defaults.growlCSS})};l();s.css("opacity");s.mouseover(function(){l({fadeIn:0,timeout:3e4});var t=e(".blockMsg");t.stop(),t.fadeTo(300,1)}).mouseout(function(){e(".blockMsg").fadeOut(1e3)})},e.fn.block=function(o){if(this[0]===window)return e.blockUI(o),this;var n=e.extend({},e.blockUI.defaults,o||{});return this.each(function(){var t=e(this);n.ignoreIfBlocked&&t.data("blockUI.isBlocked")||t.unblock({fadeOut:0})}),this.each(function(){"static"==e.css(this,"position")&&(this.style.position="relative",e(this).data("blockUI.static",!0)),this.style.zoom=1,t(this,o)})},e.fn.unblock=function(t){return this[0]===window?(e.unblockUI(t),this):this.each(function(){o(this,t)})},e.blockUI.version=2.7,e.blockUI.defaults={message:"<h1>Please wait...</h1>",title:null,draggable:!0,theme:!1,css:{padding:0,margin:0,width:"30%",top:"40%",left:"35%",textAlign:"center",color:"#000",border:"3px solid #aaa",backgroundColor:"#fff",cursor:"wait"},themedCSS:{width:"30%",top:"40%",left:"35%"},overlayCSS:{backgroundColor:"#000",opacity:.6,cursor:"wait"},cursorReset:"default",growlCSS:{width:"350px",top:"10px",left:"",right:"10px",border:"none",padding:"5px",opacity:.6,cursor:"default",color:"#fff",backgroundColor:"#000","-webkit-border-radius":"10px","-moz-border-radius":"10px","border-radius":"10px"},iframeSrc:/^https/i.test(window.location.href||"")?"javascript:false":"about:blank",forceIframe:!1,baseZ:1e3,centerX:!0,centerY:!0,allowBodyStretch:!0,bindEvents:!0,constrainTabKey:!0,fadeIn:200,fadeOut:400,timeout:0,showOverlay:!0,focusInput:!0,focusableElements:":input:enabled:visible",onBlock:null,onUnblock:null,onOverlayClick:null,quirksmodeOffsetHack:4,blockMsgClass:"blockMsg",ignoreIfBlocked:!1};var p=null,b=[]}"function"==typeof define&&define.amd&&define.amd.jQuery?define(["jquery"],e):e(jQuery)}();;