Skip to content

Instantly share code, notes, and snippets.

@alivedise
Created November 7, 2014 06:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alivedise/5bd1e8b966dd2d862aa8 to your computer and use it in GitHub Desktop.
Save alivedise/5bd1e8b966dd2d862aa8 to your computer and use it in GitHub Desktop.
sound cloud source
This file has been truncated, but you can view the full file.
!function(e) {
function t(r) {
if (n[r])
return n[r].exports;
var i = n[r] = {exports: {},id: r,loaded: !1};
return e[r].call(i.exports, i, i.exports, t), i.loaded = !0, i.exports
}
var r = window.webpackJsonp;
window.webpackJsonp = function(a, o) {
for (var s, u, l = 0, c = []; l < a.length; l++)
u = a[l], i[u] && c.push.apply(c, i[u]), i[u] = 0;
for (s in o)
e[s] = o[s];
for (r && r(a, o); c.length; )
c.shift().call(null, t);
o[0] && (n[0] = 0, t(0))
};
var n = {}, i = {0: 0};
t.e = function(e, r) {
if (0 === i[e])
return r.call(null, t);
if (void 0 !== i[e])
i[e].push(r);
else {
i[e] = [r];
var n = document.getElementsByTagName("head")[0], a = document.createElement("script");
a.type = "text/javascript", a.charset = "utf-8", a.async = !0, a.src = t.p + window.webpackManifest[e], n.appendChild(a)
}
}, t.m = e, t.c = n, t.p = "https://a-v2.sndcdn.com/"
}([, function(e, t) {
var r, n; /*!
* jQuery JavaScript Library v2.1.0
* http://jquery.com/
*
* Includes Sizzle.js
* http://sizzlejs.com/
*
* Copyright 2005, 2014 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-01-23T21:10Z
*/
!function(t, r) {
"object" == typeof e && "object" == typeof e.exports ? e.exports = t.document ? r(t, !0) : function(e) {
if (!e.document)
throw new Error("jQuery requires a window with a document");
return r(e)
} : r(t)
}("undefined" != typeof window ? window : this, function(i, a) {
function o(e) {
var t = e.length, r = it.type(e);
return "function" === r || it.isWindow(e) ? !1 : 1 === e.nodeType && t ? !0 : "array" === r || 0 === t || "number" == typeof t && t > 0 && t - 1 in e
}
function s(e, t, r) {
if (it.isFunction(t))
return it.grep(e, function(e, n) {
return !!t.call(e, n, e) !== r
});
if (t.nodeType)
return it.grep(e, function(e) {
return e === t !== r
});
if ("string" == typeof t) {
if (pt.test(t))
return it.filter(t, e, r);
t = it.filter(t, e)
}
return it.grep(e, function(e) {
return X.call(t, e) >= 0 !== r
})
}
function u(e, t) {
for (; (e = e[t]) && 1 !== e.nodeType; )
;
return e
}
function l(e) {
var t = vt[e] = {};
return it.each(e.match(mt) || [], function(e, r) {
t[r] = !0
}), t
}
function c() {
rt.removeEventListener("DOMContentLoaded", c, !1), i.removeEventListener("load", c, !1), it.ready()
}
function p() {
Object.defineProperty(this.cache = {}, 0, {get: function() {
return {}
}}), this.expando = it.expando + Math.random()
}
function f(e, t, r) {
var n;
if (void 0 === r && 1 === e.nodeType)
if (n = "data-" + t.replace(At, "-$1").toLowerCase(), r = e.getAttribute(n), "string" == typeof r) {
try {
r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : +r + "" === r ? +r : St.test(r) ? it.parseJSON(r) : r
} catch (i) {
}
Ct.set(e, t, r)
} else
r = void 0;
return r
}
function d() {
return !0
}
function h() {
return !1
}
function g() {
try {
return rt.activeElement
} catch (e) {
}
}
function y(e, t) {
return it.nodeName(e, "table") && it.nodeName(11 !== t.nodeType ? t : t.firstChild, "tr") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
}
function m(e) {
return e.type = (null !== e.getAttribute("type")) + "/" + e.type, e
}
function v(e) {
var t = jt.exec(e.type);
return t ? e.type = t[1] : e.removeAttribute("type"), e
}
function b(e, t) {
for (var r = 0, n = e.length; n > r; r++)
Et.set(e[r], "globalEval", !t || Et.get(t[r], "globalEval"))
}
function _(e, t) {
var r, n, i, a, o, s, u, l;
if (1 === t.nodeType) {
if (Et.hasData(e) && (a = Et.access(e), o = Et.set(t, a), l = a.events)) {
delete o.handle, o.events = {};
for (i in l)
for (r = 0, n = l[i].length; n > r; r++)
it.event.add(t, i, l[i][r])
}
Ct.hasData(e) && (s = Ct.access(e), u = it.extend({}, s), Ct.set(t, u))
}
}
function E(e, t) {
var r = e.getElementsByTagName ? e.getElementsByTagName(t || "*") : e.querySelectorAll ? e.querySelectorAll(t || "*") : [];
return void 0 === t || t && it.nodeName(e, t) ? it.merge([e], r) : r
}
function C(e, t) {
var r = t.nodeName.toLowerCase();
"input" === r && It.test(e.type) ? t.checked = e.checked : ("input" === r || "textarea" === r) && (t.defaultValue = e.defaultValue)
}
function S(e, t) {
var r = it(t.createElement(e)).appendTo(t.body), n = i.getDefaultComputedStyle ? i.getDefaultComputedStyle(r[0]).display : it.css(r[0], "display");
return r.detach(), n
}
function A(e) {
var t = rt, r = Kt[e];
return r || (r = S(e, t), "none" !== r && r || (qt = (qt || it("<iframe frameborder='0' width='0' height='0'/>")).appendTo(t.documentElement), t = qt[0].contentDocument, t.write(), t.close(), r = S(e, t), qt.detach()), Kt[e] = r), r
}
function T(e, t, r) {
var n, i, a, o, s = e.style;
return r = r || Wt(e), r && (o = r.getPropertyValue(t) || r[t]), r && ("" !== o || it.contains(e.ownerDocument, e) || (o = it.style(e, t)), Yt.test(o) && Gt.test(t) && (n = s.width, i = s.minWidth, a = s.maxWidth, s.minWidth = s.maxWidth = s.width = o, o = r.width, s.width = n, s.minWidth = i, s.maxWidth = a)), void 0 !== o ? o + "" : o
}
function w(e, t) {
return {get: function() {
return e() ? void delete this.get : (this.get = t).apply(this, arguments)
}}
}
function k(e, t) {
if (t in e)
return t;
for (var r = t[0].toUpperCase() + t.slice(1), n = t, i = Zt.length; i--; )
if (t = Zt[i] + r, t in e)
return t;
return n
}
function I(e, t, r) {
var n = Qt.exec(t);
return n ? Math.max(0, n[1] - (r || 0)) + (n[2] || "px") : t
}
function x(e, t, r, n, i) {
for (var a = r === (n ? "border" : "content") ? 4 : "width" === t ? 1 : 0, o = 0; 4 > a; a += 2)
"margin" === r && (o += it.css(e, r + wt[a], !0, i)), n ? ("content" === r && (o -= it.css(e, "padding" + wt[a], !0, i)), "margin" !== r && (o -= it.css(e, "border" + wt[a] + "Width", !0, i))) : (o += it.css(e, "padding" + wt[a], !0, i), "padding" !== r && (o += it.css(e, "border" + wt[a] + "Width", !0, i)));
return o
}
function D(e, t, r) {
var n = !0, i = "width" === t ? e.offsetWidth : e.offsetHeight, a = Wt(e), o = "border-box" === it.css(e, "boxSizing", !1, a);
if (0 >= i || null == i) {
if (i = T(e, t, a), (0 > i || null == i) && (i = e.style[t]), Yt.test(i))
return i;
n = o && (tt.boxSizingReliable() || i === e.style[t]), i = parseFloat(i) || 0
}
return i + x(e, t, r || (o ? "border" : "content"), n, a) + "px"
}
function N(e, t) {
for (var r, n, i, a = [], o = 0, s = e.length; s > o; o++)
n = e[o], n.style && (a[o] = Et.get(n, "olddisplay"), r = n.style.display, t ? (a[o] || "none" !== r || (n.style.display = ""), "" === n.style.display && kt(n) && (a[o] = Et.access(n, "olddisplay", A(n.nodeName)))) : a[o] || (i = kt(n), (r && "none" !== r || !i) && Et.set(n, "olddisplay", i ? r : it.css(n, "display"))));
for (o = 0; s > o; o++)
n = e[o], n.style && (t && "none" !== n.style.display && "" !== n.style.display || (n.style.display = t ? a[o] || "" : "none"));
return e
}
function B(e, t, r, n, i) {
return new B.prototype.init(e, t, r, n, i)
}
function L() {
return setTimeout(function() {
er = void 0
}), er = it.now()
}
function R(e, t) {
var r, n = 0, i = {height: e};
for (t = t ? 1 : 0; 4 > n; n += 2 - t)
r = wt[n], i["margin" + r] = i["padding" + r] = e;
return t && (i.opacity = i.width = e), i
}
function P(e, t, r) {
for (var n, i = (or[t] || []).concat(or["*"]), a = 0, o = i.length; o > a; a++)
if (n = i[a].call(r, t, e))
return n
}
function O(e, t, r) {
var n, i, a, o, s, u, l, c = this, p = {}, f = e.style, d = e.nodeType && kt(e), h = Et.get(e, "fxshow");
r.queue || (s = it._queueHooks(e, "fx"), null == s.unqueued && (s.unqueued = 0, u = s.empty.fire, s.empty.fire = function() {
s.unqueued || u()
}), s.unqueued++, c.always(function() {
c.always(function() {
s.unqueued--, it.queue(e, "fx").length || s.empty.fire()
})
})), 1 === e.nodeType && ("height" in t || "width" in t) && (r.overflow = [f.overflow, f.overflowX, f.overflowY], l = it.css(e, "display"), "none" === l && (l = A(e.nodeName)), "inline" === l && "none" === it.css(e, "float") && (f.display = "inline-block")), r.overflow && (f.overflow = "hidden", c.always(function() {
f.overflow = r.overflow[0], f.overflowX = r.overflow[1], f.overflowY = r.overflow[2]
}));
for (n in t)
if (i = t[n], rr.exec(i)) {
if (delete t[n], a = a || "toggle" === i, i === (d ? "hide" : "show")) {
if ("show" !== i || !h || void 0 === h[n])
continue;
d = !0
}
p[n] = h && h[n] || it.style(e, n)
}
if (!it.isEmptyObject(p)) {
h ? "hidden" in h && (d = h.hidden) : h = Et.access(e, "fxshow", {}), a && (h.hidden = !d), d ? it(e).show() : c.done(function() {
it(e).hide()
}), c.done(function() {
var t;
Et.remove(e, "fxshow");
for (t in p)
it.style(e, t, p[t])
});
for (n in p)
o = P(d ? h[n] : 0, n, c), n in h || (h[n] = o.start, d && (o.end = o.start, o.start = "width" === n || "height" === n ? 1 : 0))
}
}
function U(e, t) {
var r, n, i, a, o;
for (r in e)
if (n = it.camelCase(r), i = t[n], a = e[r], it.isArray(a) && (i = a[1], a = e[r] = a[0]), r !== n && (e[n] = a, delete e[r]), o = it.cssHooks[n], o && "expand" in o) {
a = o.expand(a), delete e[n];
for (r in a)
r in e || (e[r] = a[r], t[r] = i)
} else
t[n] = i
}
function M(e, t, r) {
var n, i, a = 0, o = ar.length, s = it.Deferred().always(function() {
delete u.elem
}), u = function() {
if (i)
return !1;
for (var t = er || L(), r = Math.max(0, l.startTime + l.duration - t), n = r / l.duration || 0, a = 1 - n, o = 0, u = l.tweens.length; u > o; o++)
l.tweens[o].run(a);
return s.notifyWith(e, [l, a, r]), 1 > a && u ? r : (s.resolveWith(e, [l]), !1)
}, l = s.promise({elem: e,props: it.extend({}, t),opts: it.extend(!0, {specialEasing: {}}, r),originalProperties: t,originalOptions: r,startTime: er || L(),duration: r.duration,tweens: [],createTween: function(t, r) {
var n = it.Tween(e, l.opts, t, r, l.opts.specialEasing[t] || l.opts.easing);
return l.tweens.push(n), n
},stop: function(t) {
var r = 0, n = t ? l.tweens.length : 0;
if (i)
return this;
for (i = !0; n > r; r++)
l.tweens[r].run(1);
return t ? s.resolveWith(e, [l, t]) : s.rejectWith(e, [l, t]), this
}}), c = l.props;
for (U(c, l.opts.specialEasing); o > a; a++)
if (n = ar[a].call(l, e, c, l.opts))
return n;
return it.map(c, P, l), it.isFunction(l.opts.start) && l.opts.start.call(e, l), it.fx.timer(it.extend(u, {elem: e,anim: l,queue: l.opts.queue})), l.progress(l.opts.progress).done(l.opts.done, l.opts.complete).fail(l.opts.fail).always(l.opts.always)
}
function F(e) {
return function(t, r) {
"string" != typeof t && (r = t, t = "*");
var n, i = 0, a = t.toLowerCase().match(mt) || [];
if (it.isFunction(r))
for (; n = a[i++]; )
"+" === n[0] ? (n = n.slice(1) || "*", (e[n] = e[n] || []).unshift(r)) : (e[n] = e[n] || []).push(r)
}
}
function j(e, t, r, n) {
function i(s) {
var u;
return a[s] = !0, it.each(e[s] || [], function(e, s) {
var l = s(t, r, n);
return "string" != typeof l || o || a[l] ? o ? !(u = l) : void 0 : (t.dataTypes.unshift(l), i(l), !1)
}), u
}
var a = {}, o = e === Tr;
return i(t.dataTypes[0]) || !a["*"] && i("*")
}
function V(e, t) {
var r, n, i = it.ajaxSettings.flatOptions || {};
for (r in t)
void 0 !== t[r] && ((i[r] ? e : n || (n = {}))[r] = t[r]);
return n && it.extend(!0, e, n), e
}
function H(e, t, r) {
for (var n, i, a, o, s = e.contents, u = e.dataTypes; "*" === u[0]; )
u.shift(), void 0 === n && (n = e.mimeType || t.getResponseHeader("Content-Type"));
if (n)
for (i in s)
if (s[i] && s[i].test(n)) {
u.unshift(i);
break
}
if (u[0] in r)
a = u[0];
else {
for (i in r) {
if (!u[0] || e.converters[i + " " + u[0]]) {
a = i;
break
}
o || (o = i)
}
a = a || o
}
return a ? (a !== u[0] && u.unshift(a), r[a]) : void 0
}
function q(e, t, r, n) {
var i, a, o, s, u, l = {}, c = e.dataTypes.slice();
if (c[1])
for (o in e.converters)
l[o.toLowerCase()] = e.converters[o];
for (a = c.shift(); a; )
if (e.responseFields[a] && (r[e.responseFields[a]] = t), !u && n && e.dataFilter && (t = e.dataFilter(t, e.dataType)), u = a, a = c.shift())
if ("*" === a)
a = u;
else if ("*" !== u && u !== a) {
if (o = l[u + " " + a] || l["* " + a], !o)
for (i in l)
if (s = i.split(" "), s[1] === a && (o = l[u + " " + s[0]] || l["* " + s[0]])) {
o === !0 ? o = l[i] : l[i] !== !0 && (a = s[0], c.unshift(s[1]));
break
}
if (o !== !0)
if (o && e["throws"])
t = o(t);
else
try {
t = o(t)
} catch (p) {
return {state: "parsererror",error: o ? p : "No conversion from " + u + " to " + a}
}
}
return {state: "success",data: t}
}
function K(e, t, r, n) {
var i;
if (it.isArray(t))
it.each(t, function(t, i) {
r || xr.test(e) ? n(e, i) : K(e + "[" + ("object" == typeof i ? t : "") + "]", i, r, n)
});
else if (r || "object" !== it.type(t))
n(e, t);
else
for (i in t)
K(e + "[" + i + "]", t[i], r, n)
}
function G(e) {
return it.isWindow(e) ? e : 9 === e.nodeType && e.defaultView
}
var Y = [], W = Y.slice, z = Y.concat, Q = Y.push, X = Y.indexOf, $ = {}, J = $.toString, Z = $.hasOwnProperty, et = "".trim, tt = {}, rt = i.document, nt = "2.1.0", it = function(e, t) {
return new it.fn.init(e, t)
}, at = /^-ms-/, ot = /-([\da-z])/gi, st = function(e, t) {
return t.toUpperCase()
};
it.fn = it.prototype = {jquery: nt,constructor: it,selector: "",length: 0,toArray: function() {
return W.call(this)
},get: function(e) {
return null != e ? 0 > e ? this[e + this.length] : this[e] : W.call(this)
},pushStack: function(e) {
var t = it.merge(this.constructor(), e);
return t.prevObject = this, t.context = this.context, t
},each: function(e, t) {
return it.each(this, e, t)
},map: function(e) {
return this.pushStack(it.map(this, function(t, r) {
return e.call(t, r, t)
}))
},slice: function() {
return this.pushStack(W.apply(this, arguments))
},first: function() {
return this.eq(0)
},last: function() {
return this.eq(-1)
},eq: function(e) {
var t = this.length, r = +e + (0 > e ? t : 0);
return this.pushStack(r >= 0 && t > r ? [this[r]] : [])
},end: function() {
return this.prevObject || this.constructor(null)
},push: Q,sort: Y.sort,splice: Y.splice}, it.extend = it.fn.extend = function() {
var e, t, r, n, i, a, o = arguments[0] || {}, s = 1, u = arguments.length, l = !1;
for ("boolean" == typeof o && (l = o, o = arguments[s] || {}, s++), "object" == typeof o || it.isFunction(o) || (o = {}), s === u && (o = this, s--); u > s; s++)
if (null != (e = arguments[s]))
for (t in e)
r = o[t], n = e[t], o !== n && (l && n && (it.isPlainObject(n) || (i = it.isArray(n))) ? (i ? (i = !1, a = r && it.isArray(r) ? r : []) : a = r && it.isPlainObject(r) ? r : {}, o[t] = it.extend(l, a, n)) : void 0 !== n && (o[t] = n));
return o
}, it.extend({expando: "jQuery" + (nt + Math.random()).replace(/\D/g, ""),isReady: !0,error: function(e) {
throw new Error(e)
},noop: function() {
},isFunction: function(e) {
return "function" === it.type(e)
},isArray: Array.isArray,isWindow: function(e) {
return null != e && e === e.window
},isNumeric: function(e) {
return e - parseFloat(e) >= 0
},isPlainObject: function(e) {
if ("object" !== it.type(e) || e.nodeType || it.isWindow(e))
return !1;
try {
if (e.constructor && !Z.call(e.constructor.prototype, "isPrototypeOf"))
return !1
} catch (t) {
return !1
}
return !0
},isEmptyObject: function(e) {
var t;
for (t in e)
return !1;
return !0
},type: function(e) {
return null == e ? e + "" : "object" == typeof e || "function" == typeof e ? $[J.call(e)] || "object" : typeof e
},globalEval: function(e) {
var t, r = eval;
e = it.trim(e), e && (1 === e.indexOf("use strict") ? (t = rt.createElement("script"), t.text = e, rt.head.appendChild(t).parentNode.removeChild(t)) : r(e))
},camelCase: function(e) {
return e.replace(at, "ms-").replace(ot, st)
},nodeName: function(e, t) {
return e.nodeName && e.nodeName.toLowerCase() === t.toLowerCase()
},each: function(e, t, r) {
var n, i = 0, a = e.length, s = o(e);
if (r) {
if (s)
for (; a > i && (n = t.apply(e[i], r), n !== !1); i++)
;
else
for (i in e)
if (n = t.apply(e[i], r), n === !1)
break
} else if (s)
for (; a > i && (n = t.call(e[i], i, e[i]), n !== !1); i++)
;
else
for (i in e)
if (n = t.call(e[i], i, e[i]), n === !1)
break;
return e
},trim: function(e) {
return null == e ? "" : et.call(e)
},makeArray: function(e, t) {
var r = t || [];
return null != e && (o(Object(e)) ? it.merge(r, "string" == typeof e ? [e] : e) : Q.call(r, e)), r
},inArray: function(e, t, r) {
return null == t ? -1 : X.call(t, e, r)
},merge: function(e, t) {
for (var r = +t.length, n = 0, i = e.length; r > n; n++)
e[i++] = t[n];
return e.length = i, e
},grep: function(e, t, r) {
for (var n, i = [], a = 0, o = e.length, s = !r; o > a; a++)
n = !t(e[a], a), n !== s && i.push(e[a]);
return i
},map: function(e, t, r) {
var n, i = 0, a = e.length, s = o(e), u = [];
if (s)
for (; a > i; i++)
n = t(e[i], i, r), null != n && u.push(n);
else
for (i in e)
n = t(e[i], i, r), null != n && u.push(n);
return z.apply([], u)
},guid: 1,proxy: function(e, t) {
var r, n, i;
return "string" == typeof t && (r = e[t], t = e, e = r), it.isFunction(e) ? (n = W.call(arguments, 2), i = function() {
return e.apply(t || this, n.concat(W.call(arguments)))
}, i.guid = e.guid = e.guid || it.guid++, i) : void 0
},now: Date.now,support: tt}), it.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(e, t) {
$["[object " + t + "]"] = t.toLowerCase()
});
var ut = /*!
* Sizzle CSS Selector Engine v1.10.16
* http://sizzlejs.com/
*
* Copyright 2013 jQuery Foundation, Inc. and other contributors
* Released under the MIT license
* http://jquery.org/license
*
* Date: 2014-01-13
*/
function(e) {
function t(e, t, r, n) {
var i, a, o, s, u, l, p, h, g, y;
if ((t ? t.ownerDocument || t : j) !== B && N(t), t = t || B, r = r || [], !e || "string" != typeof e)
return r;
if (1 !== (s = t.nodeType) && 9 !== s)
return [];
if (R && !n) {
if (i = vt.exec(e))
if (o = i[1]) {
if (9 === s) {
if (a = t.getElementById(o), !a || !a.parentNode)
return r;
if (a.id === o)
return r.push(a), r
} else if (t.ownerDocument && (a = t.ownerDocument.getElementById(o)) && M(t, a) && a.id === o)
return r.push(a), r
} else {
if (i[2])
return Z.apply(r, t.getElementsByTagName(e)), r;
if ((o = i[3]) && S.getElementsByClassName && t.getElementsByClassName)
return Z.apply(r, t.getElementsByClassName(o)), r
}
if (S.qsa && (!P || !P.test(e))) {
if (h = p = F, g = t, y = 9 === s && e, 1 === s && "object" !== t.nodeName.toLowerCase()) {
for (l = f(e), (p = t.getAttribute("id")) ? h = p.replace(_t, "\\$&") : t.setAttribute("id", h), h = "[id='" + h + "'] ", u = l.length; u--; )
l[u] = h + d(l[u]);
g = bt.test(e) && c(t.parentNode) || t, y = l.join(",")
}
if (y)
try {
return Z.apply(r, g.querySelectorAll(y)), r
} catch (m) {
}finally {
p || t.removeAttribute("id")
}
}
}
return E(e.replace(ut, "$1"), t, r, n)
}
function r() {
function e(r, n) {
return t.push(r + " ") > A.cacheLength && delete e[t.shift()], e[r + " "] = n
}
var t = [];
return e
}
function n(e) {
return e[F] = !0, e
}
function i(e) {
var t = B.createElement("div");
try {
return !!e(t)
} catch (r) {
return !1
}finally {
t.parentNode && t.parentNode.removeChild(t), t = null
}
}
function a(e, t) {
for (var r = e.split("|"), n = e.length; n--; )
A.attrHandle[r[n]] = t
}
function o(e, t) {
var r = t && e, n = r && 1 === e.nodeType && 1 === t.nodeType && (~t.sourceIndex || z) - (~e.sourceIndex || z);
if (n)
return n;
if (r)
for (; r = r.nextSibling; )
if (r === t)
return -1;
return e ? 1 : -1
}
function s(e) {
return function(t) {
var r = t.nodeName.toLowerCase();
return "input" === r && t.type === e
}
}
function u(e) {
return function(t) {
var r = t.nodeName.toLowerCase();
return ("input" === r || "button" === r) && t.type === e
}
}
function l(e) {
return n(function(t) {
return t = +t, n(function(r, n) {
for (var i, a = e([], r.length, t), o = a.length; o--; )
r[i = a[o]] && (r[i] = !(n[i] = r[i]))
})
})
}
function c(e) {
return e && typeof e.getElementsByTagName !== W && e
}
function p() {
}
function f(e, r) {
var n, i, a, o, s, u, l, c = K[e + " "];
if (c)
return r ? 0 : c.slice(0);
for (s = e, u = [], l = A.preFilter; s; ) {
(!n || (i = lt.exec(s))) && (i && (s = s.slice(i[0].length) || s), u.push(a = [])), n = !1, (i = ct.exec(s)) && (n = i.shift(), a.push({value: n,type: i[0].replace(ut, " ")}), s = s.slice(n.length));
for (o in A.filter)
!(i = ht[o].exec(s)) || l[o] && !(i = l[o](i)) || (n = i.shift(), a.push({value: n,type: o,matches: i}), s = s.slice(n.length));
if (!n)
break
}
return r ? s.length : s ? t.error(e) : K(e, u).slice(0)
}
function d(e) {
for (var t = 0, r = e.length, n = ""; r > t; t++)
n += e[t].value;
return n
}
function h(e, t, r) {
var n = t.dir, i = r && "parentNode" === n, a = H++;
return t.first ? function(t, r, a) {
for (; t = t[n]; )
if (1 === t.nodeType || i)
return e(t, r, a)
} : function(t, r, o) {
var s, u, l = [V, a];
if (o) {
for (; t = t[n]; )
if ((1 === t.nodeType || i) && e(t, r, o))
return !0
} else
for (; t = t[n]; )
if (1 === t.nodeType || i) {
if (u = t[F] || (t[F] = {}), (s = u[n]) && s[0] === V && s[1] === a)
return l[2] = s[2];
if (u[n] = l, l[2] = e(t, r, o))
return !0
}
}
}
function g(e) {
return e.length > 1 ? function(t, r, n) {
for (var i = e.length; i--; )
if (!e[i](t, r, n))
return !1;
return !0
} : e[0]
}
function y(e, t, r, n, i) {
for (var a, o = [], s = 0, u = e.length, l = null != t; u > s; s++)
(a = e[s]) && (!r || r(a, n, i)) && (o.push(a), l && t.push(s));
return o
}
function m(e, t, r, i, a, o) {
return i && !i[F] && (i = m(i)), a && !a[F] && (a = m(a, o)), n(function(n, o, s, u) {
var l, c, p, f = [], d = [], h = o.length, g = n || _(t || "*", s.nodeType ? [s] : s, []), m = !e || !n && t ? g : y(g, f, e, s, u), v = r ? a || (n ? e : h || i) ? [] : o : m;
if (r && r(m, v, s, u), i)
for (l = y(v, d), i(l, [], s, u), c = l.length; c--; )
(p = l[c]) && (v[d[c]] = !(m[d[c]] = p));
if (n) {
if (a || e) {
if (a) {
for (l = [], c = v.length; c--; )
(p = v[c]) && l.push(m[c] = p);
a(null, v = [], l, u)
}
for (c = v.length; c--; )
(p = v[c]) && (l = a ? tt.call(n, p) : f[c]) > -1 && (n[l] = !(o[l] = p))
}
} else
v = y(v === o ? v.splice(h, v.length) : v), a ? a(null, o, v, u) : Z.apply(o, v)
})
}
function v(e) {
for (var t, r, n, i = e.length, a = A.relative[e[0].type], o = a || A.relative[" "], s = a ? 1 : 0, u = h(function(e) {
return e === t
}, o, !0), l = h(function(e) {
return tt.call(t, e) > -1
}, o, !0), c = [function(e, r, n) {
return !a && (n || r !== I) || ((t = r).nodeType ? u(e, r, n) : l(e, r, n))
}]; i > s; s++)
if (r = A.relative[e[s].type])
c = [h(g(c), r)];
else {
if (r = A.filter[e[s].type].apply(null, e[s].matches), r[F]) {
for (n = ++s; i > n && !A.relative[e[n].type]; n++)
;
return m(s > 1 && g(c), s > 1 && d(e.slice(0, s - 1).concat({value: " " === e[s - 2].type ? "*" : ""})).replace(ut, "$1"), r, n > s && v(e.slice(s, n)), i > n && v(e = e.slice(n)), i > n && d(e))
}
c.push(r)
}
return g(c)
}
function b(e, r) {
var i = r.length > 0, a = e.length > 0, o = function(n, o, s, u, l) {
var c, p, f, d = 0, h = "0", g = n && [], m = [], v = I, b = n || a && A.find.TAG("*", l), _ = V += null == v ? 1 : Math.random() || .1, E = b.length;
for (l && (I = o !== B && o); h !== E && null != (c = b[h]); h++) {
if (a && c) {
for (p = 0; f = e[p++]; )
if (f(c, o, s)) {
u.push(c);
break
}
l && (V = _)
}
i && ((c = !f && c) && d--, n && g.push(c))
}
if (d += h, i && h !== d) {
for (p = 0; f = r[p++]; )
f(g, m, o, s);
if (n) {
if (d > 0)
for (; h--; )
g[h] || m[h] || (m[h] = $.call(u));
m = y(m)
}
Z.apply(u, m), l && !n && m.length > 0 && d + r.length > 1 && t.uniqueSort(u)
}
return l && (V = _, I = v), g
};
return i ? n(o) : o
}
function _(e, r, n) {
for (var i = 0, a = r.length; a > i; i++)
t(e, r[i], n);
return n
}
function E(e, t, r, n) {
var i, a, o, s, u, l = f(e);
if (!n && 1 === l.length) {
if (a = l[0] = l[0].slice(0), a.length > 2 && "ID" === (o = a[0]).type && S.getById && 9 === t.nodeType && R && A.relative[a[1].type]) {
if (t = (A.find.ID(o.matches[0].replace(Et, Ct), t) || [])[0], !t)
return r;
e = e.slice(a.shift().value.length)
}
for (i = ht.needsContext.test(e) ? 0 : a.length; i-- && (o = a[i], !A.relative[s = o.type]); )
if ((u = A.find[s]) && (n = u(o.matches[0].replace(Et, Ct), bt.test(a[0].type) && c(t.parentNode) || t))) {
if (a.splice(i, 1), e = n.length && d(a), !e)
return Z.apply(r, n), r;
break
}
}
return k(e, l)(n, t, !R, r, bt.test(e) && c(t.parentNode) || t), r
}
var C, S, A, T, w, k, I, x, D, N, B, L, R, P, O, U, M, F = "sizzle" + -new Date, j = e.document, V = 0, H = 0, q = r(), K = r(), G = r(), Y = function(e, t) {
return e === t && (D = !0), 0
}, W = "undefined", z = 1 << 31, Q = {}.hasOwnProperty, X = [], $ = X.pop, J = X.push, Z = X.push, et = X.slice, tt = X.indexOf || function(e) {
for (var t = 0, r = this.length; r > t; t++)
if (this[t] === e)
return t;
return -1
}, rt = "checked|selected|async|autofocus|autoplay|controls|defer|disabled|hidden|ismap|loop|multiple|open|readonly|required|scoped", nt = "[\\x20\\t\\r\\n\\f]", it = "(?:\\\\.|[\\w-]|[^\\x00-\\xa0])+", at = it.replace("w", "w#"), ot = "\\[" + nt + "*(" + it + ")" + nt + "*(?:([*^$|!~]?=)" + nt + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + at + ")|)|)" + nt + "*\\]", st = ":(" + it + ")(?:\\(((['\"])((?:\\\\.|[^\\\\])*?)\\3|((?:\\\\.|[^\\\\()[\\]]|" + ot.replace(3, 8) + ")*)|.*)\\)|)", ut = new RegExp("^" + nt + "+|((?:^|[^\\\\])(?:\\\\.)*)" + nt + "+$", "g"), lt = new RegExp("^" + nt + "*," + nt + "*"), ct = new RegExp("^" + nt + "*([>+~]|" + nt + ")" + nt + "*"), pt = new RegExp("=" + nt + "*([^\\]'\"]*?)" + nt + "*\\]", "g"), ft = new RegExp(st), dt = new RegExp("^" + at + "$"), ht = {ID: new RegExp("^#(" + it + ")"),CLASS: new RegExp("^\\.(" + it + ")"),TAG: new RegExp("^(" + it.replace("w", "w*") + ")"),ATTR: new RegExp("^" + ot),PSEUDO: new RegExp("^" + st),CHILD: new RegExp("^:(only|first|last|nth|nth-last)-(child|of-type)(?:\\(" + nt + "*(even|odd|(([+-]|)(\\d*)n|)" + nt + "*(?:([+-]|)" + nt + "*(\\d+)|))" + nt + "*\\)|)", "i"),bool: new RegExp("^(?:" + rt + ")$", "i"),needsContext: new RegExp("^" + nt + "*[>+~]|:(even|odd|eq|gt|lt|nth|first|last)(?:\\(" + nt + "*((?:-\\d)?\\d*)" + nt + "*\\)|)(?=[^-]|$)", "i")}, gt = /^(?:input|select|textarea|button)$/i, yt = /^h\d$/i, mt = /^[^{]+\{\s*\[native \w/, vt = /^(?:#([\w-]+)|(\w+)|\.([\w-]+))$/, bt = /[+~]/, _t = /'|\\/g, Et = new RegExp("\\\\([\\da-f]{1,6}" + nt + "?|(" + nt + ")|.)", "ig"), Ct = function(e, t, r) {
var n = "0x" + t - 65536;
return n !== n || r ? t : 0 > n ? String.fromCharCode(n + 65536) : String.fromCharCode(n >> 10 | 55296, 1023 & n | 56320)
};
try {
Z.apply(X = et.call(j.childNodes), j.childNodes), X[j.childNodes.length].nodeType
} catch (St) {
Z = {apply: X.length ? function(e, t) {
J.apply(e, et.call(t))
} : function(e, t) {
for (var r = e.length, n = 0; e[r++] = t[n++]; )
;
e.length = r - 1
}}
}
S = t.support = {}, w = t.isXML = function(e) {
var t = e && (e.ownerDocument || e).documentElement;
return t ? "HTML" !== t.nodeName : !1
}, N = t.setDocument = function(e) {
var t, r = e ? e.ownerDocument || e : j, n = r.defaultView;
return r !== B && 9 === r.nodeType && r.documentElement ? (B = r, L = r.documentElement, R = !w(r), n && n !== n.top && (n.addEventListener ? n.addEventListener("unload", function() {
N()
}, !1) : n.attachEvent && n.attachEvent("onunload", function() {
N()
})), S.attributes = i(function(e) {
return e.className = "i", !e.getAttribute("className")
}), S.getElementsByTagName = i(function(e) {
return e.appendChild(r.createComment("")), !e.getElementsByTagName("*").length
}), S.getElementsByClassName = mt.test(r.getElementsByClassName) && i(function(e) {
return e.innerHTML = "<div class='a'></div><div class='a i'></div>", e.firstChild.className = "i", 2 === e.getElementsByClassName("i").length
}), S.getById = i(function(e) {
return L.appendChild(e).id = F, !r.getElementsByName || !r.getElementsByName(F).length
}), S.getById ? (A.find.ID = function(e, t) {
if (typeof t.getElementById !== W && R) {
var r = t.getElementById(e);
return r && r.parentNode ? [r] : []
}
}, A.filter.ID = function(e) {
var t = e.replace(Et, Ct);
return function(e) {
return e.getAttribute("id") === t
}
}) : (delete A.find.ID, A.filter.ID = function(e) {
var t = e.replace(Et, Ct);
return function(e) {
var r = typeof e.getAttributeNode !== W && e.getAttributeNode("id");
return r && r.value === t
}
}), A.find.TAG = S.getElementsByTagName ? function(e, t) {
return typeof t.getElementsByTagName !== W ? t.getElementsByTagName(e) : void 0
} : function(e, t) {
var r, n = [], i = 0, a = t.getElementsByTagName(e);
if ("*" === e) {
for (; r = a[i++]; )
1 === r.nodeType && n.push(r);
return n
}
return a
}, A.find.CLASS = S.getElementsByClassName && function(e, t) {
return typeof t.getElementsByClassName !== W && R ? t.getElementsByClassName(e) : void 0
}, O = [], P = [], (S.qsa = mt.test(r.querySelectorAll)) && (i(function(e) {
e.innerHTML = "<select t=''><option selected=''></option></select>", e.querySelectorAll("[t^='']").length && P.push("[*^$]=" + nt + "*(?:''|\"\")"), e.querySelectorAll("[selected]").length || P.push("\\[" + nt + "*(?:value|" + rt + ")"), e.querySelectorAll(":checked").length || P.push(":checked")
}), i(function(e) {
var t = r.createElement("input");
t.setAttribute("type", "hidden"), e.appendChild(t).setAttribute("name", "D"), e.querySelectorAll("[name=d]").length && P.push("name" + nt + "*[*^$|!~]?="), e.querySelectorAll(":enabled").length || P.push(":enabled", ":disabled"), e.querySelectorAll("*,:x"), P.push(",.*:")
})), (S.matchesSelector = mt.test(U = L.webkitMatchesSelector || L.mozMatchesSelector || L.oMatchesSelector || L.msMatchesSelector)) && i(function(e) {
S.disconnectedMatch = U.call(e, "div"), U.call(e, "[s!='']:x"), O.push("!=", st)
}), P = P.length && new RegExp(P.join("|")), O = O.length && new RegExp(O.join("|")), t = mt.test(L.compareDocumentPosition), M = t || mt.test(L.contains) ? function(e, t) {
var r = 9 === e.nodeType ? e.documentElement : e, n = t && t.parentNode;
return e === n || !(!n || 1 !== n.nodeType || !(r.contains ? r.contains(n) : e.compareDocumentPosition && 16 & e.compareDocumentPosition(n)))
} : function(e, t) {
if (t)
for (; t = t.parentNode; )
if (t === e)
return !0;
return !1
}, Y = t ? function(e, t) {
if (e === t)
return D = !0, 0;
var n = !e.compareDocumentPosition - !t.compareDocumentPosition;
return n ? n : (n = (e.ownerDocument || e) === (t.ownerDocument || t) ? e.compareDocumentPosition(t) : 1, 1 & n || !S.sortDetached && t.compareDocumentPosition(e) === n ? e === r || e.ownerDocument === j && M(j, e) ? -1 : t === r || t.ownerDocument === j && M(j, t) ? 1 : x ? tt.call(x, e) - tt.call(x, t) : 0 : 4 & n ? -1 : 1)
} : function(e, t) {
if (e === t)
return D = !0, 0;
var n, i = 0, a = e.parentNode, s = t.parentNode, u = [e], l = [t];
if (!a || !s)
return e === r ? -1 : t === r ? 1 : a ? -1 : s ? 1 : x ? tt.call(x, e) - tt.call(x, t) : 0;
if (a === s)
return o(e, t);
for (n = e; n = n.parentNode; )
u.unshift(n);
for (n = t; n = n.parentNode; )
l.unshift(n);
for (; u[i] === l[i]; )
i++;
return i ? o(u[i], l[i]) : u[i] === j ? -1 : l[i] === j ? 1 : 0
}, r) : B
}, t.matches = function(e, r) {
return t(e, null, null, r)
}, t.matchesSelector = function(e, r) {
if ((e.ownerDocument || e) !== B && N(e), r = r.replace(pt, "='$1']"), !(!S.matchesSelector || !R || O && O.test(r) || P && P.test(r)))
try {
var n = U.call(e, r);
if (n || S.disconnectedMatch || e.document && 11 !== e.document.nodeType)
return n
} catch (i) {
}
return t(r, B, null, [e]).length > 0
}, t.contains = function(e, t) {
return (e.ownerDocument || e) !== B && N(e), M(e, t)
}, t.attr = function(e, t) {
(e.ownerDocument || e) !== B && N(e);
var r = A.attrHandle[t.toLowerCase()], n = r && Q.call(A.attrHandle, t.toLowerCase()) ? r(e, t, !R) : void 0;
return void 0 !== n ? n : S.attributes || !R ? e.getAttribute(t) : (n = e.getAttributeNode(t)) && n.specified ? n.value : null
}, t.error = function(e) {
throw new Error("Syntax error, unrecognized expression: " + e)
}, t.uniqueSort = function(e) {
var t, r = [], n = 0, i = 0;
if (D = !S.detectDuplicates, x = !S.sortStable && e.slice(0), e.sort(Y), D) {
for (; t = e[i++]; )
t === e[i] && (n = r.push(i));
for (; n--; )
e.splice(r[n], 1)
}
return x = null, e
}, T = t.getText = function(e) {
var t, r = "", n = 0, i = e.nodeType;
if (i) {
if (1 === i || 9 === i || 11 === i) {
if ("string" == typeof e.textContent)
return e.textContent;
for (e = e.firstChild; e; e = e.nextSibling)
r += T(e)
} else if (3 === i || 4 === i)
return e.nodeValue
} else
for (; t = e[n++]; )
r += T(t);
return r
}, A = t.selectors = {cacheLength: 50,createPseudo: n,match: ht,attrHandle: {},find: {},relative: {">": {dir: "parentNode",first: !0}," ": {dir: "parentNode"},"+": {dir: "previousSibling",first: !0},"~": {dir: "previousSibling"}},preFilter: {ATTR: function(e) {
return e[1] = e[1].replace(Et, Ct), e[3] = (e[4] || e[5] || "").replace(Et, Ct), "~=" === e[2] && (e[3] = " " + e[3] + " "), e.slice(0, 4)
},CHILD: function(e) {
return e[1] = e[1].toLowerCase(), "nth" === e[1].slice(0, 3) ? (e[3] || t.error(e[0]), e[4] = +(e[4] ? e[5] + (e[6] || 1) : 2 * ("even" === e[3] || "odd" === e[3])), e[5] = +(e[7] + e[8] || "odd" === e[3])) : e[3] && t.error(e[0]), e
},PSEUDO: function(e) {
var t, r = !e[5] && e[2];
return ht.CHILD.test(e[0]) ? null : (e[3] && void 0 !== e[4] ? e[2] = e[4] : r && ft.test(r) && (t = f(r, !0)) && (t = r.indexOf(")", r.length - t) - r.length) && (e[0] = e[0].slice(0, t), e[2] = r.slice(0, t)), e.slice(0, 3))
}},filter: {TAG: function(e) {
var t = e.replace(Et, Ct).toLowerCase();
return "*" === e ? function() {
return !0
} : function(e) {
return e.nodeName && e.nodeName.toLowerCase() === t
}
},CLASS: function(e) {
var t = q[e + " "];
return t || (t = new RegExp("(^|" + nt + ")" + e + "(" + nt + "|$)")) && q(e, function(e) {
return t.test("string" == typeof e.className && e.className || typeof e.getAttribute !== W && e.getAttribute("class") || "")
})
},ATTR: function(e, r, n) {
return function(i) {
var a = t.attr(i, e);
return null == a ? "!=" === r : r ? (a += "", "=" === r ? a === n : "!=" === r ? a !== n : "^=" === r ? n && 0 === a.indexOf(n) : "*=" === r ? n && a.indexOf(n) > -1 : "$=" === r ? n && a.slice(-n.length) === n : "~=" === r ? (" " + a + " ").indexOf(n) > -1 : "|=" === r ? a === n || a.slice(0, n.length + 1) === n + "-" : !1) : !0
}
},CHILD: function(e, t, r, n, i) {
var a = "nth" !== e.slice(0, 3), o = "last" !== e.slice(-4), s = "of-type" === t;
return 1 === n && 0 === i ? function(e) {
return !!e.parentNode
} : function(t, r, u) {
var l, c, p, f, d, h, g = a !== o ? "nextSibling" : "previousSibling", y = t.parentNode, m = s && t.nodeName.toLowerCase(), v = !u && !s;
if (y) {
if (a) {
for (; g; ) {
for (p = t; p = p[g]; )
if (s ? p.nodeName.toLowerCase() === m : 1 === p.nodeType)
return !1;
h = g = "only" === e && !h && "nextSibling"
}
return !0
}
if (h = [o ? y.firstChild : y.lastChild], o && v) {
for (c = y[F] || (y[F] = {}), l = c[e] || [], d = l[0] === V && l[1], f = l[0] === V && l[2], p = d && y.childNodes[d]; p = ++d && p && p[g] || (f = d = 0) || h.pop(); )
if (1 === p.nodeType && ++f && p === t) {
c[e] = [V, d, f];
break
}
} else if (v && (l = (t[F] || (t[F] = {}))[e]) && l[0] === V)
f = l[1];
else
for (; (p = ++d && p && p[g] || (f = d = 0) || h.pop()) && ((s ? p.nodeName.toLowerCase() !== m : 1 !== p.nodeType) || !++f || (v && ((p[F] || (p[F] = {}))[e] = [V, f]), p !== t)); )
;
return f -= i, f === n || f % n === 0 && f / n >= 0
}
}
},PSEUDO: function(e, r) {
var i, a = A.pseudos[e] || A.setFilters[e.toLowerCase()] || t.error("unsupported pseudo: " + e);
return a[F] ? a(r) : a.length > 1 ? (i = [e, e, "", r], A.setFilters.hasOwnProperty(e.toLowerCase()) ? n(function(e, t) {
for (var n, i = a(e, r), o = i.length; o--; )
n = tt.call(e, i[o]), e[n] = !(t[n] = i[o])
}) : function(e) {
return a(e, 0, i)
}) : a
}},pseudos: {not: n(function(e) {
var t = [], r = [], i = k(e.replace(ut, "$1"));
return i[F] ? n(function(e, t, r, n) {
for (var a, o = i(e, null, n, []), s = e.length; s--; )
(a = o[s]) && (e[s] = !(t[s] = a))
}) : function(e, n, a) {
return t[0] = e, i(t, null, a, r), !r.pop()
}
}),has: n(function(e) {
return function(r) {
return t(e, r).length > 0
}
}),contains: n(function(e) {
return function(t) {
return (t.textContent || t.innerText || T(t)).indexOf(e) > -1
}
}),lang: n(function(e) {
return dt.test(e || "") || t.error("unsupported lang: " + e), e = e.replace(Et, Ct).toLowerCase(), function(t) {
var r;
do
if (r = R ? t.lang : t.getAttribute("xml:lang") || t.getAttribute("lang"))
return r = r.toLowerCase(), r === e || 0 === r.indexOf(e + "-");
while ((t = t.parentNode) && 1 === t.nodeType);
return !1
}
}),target: function(t) {
var r = e.location && e.location.hash;
return r && r.slice(1) === t.id
},root: function(e) {
return e === L
},focus: function(e) {
return e === B.activeElement && (!B.hasFocus || B.hasFocus()) && !!(e.type || e.href || ~e.tabIndex)
},enabled: function(e) {
return e.disabled === !1
},disabled: function(e) {
return e.disabled === !0
},checked: function(e) {
var t = e.nodeName.toLowerCase();
return "input" === t && !!e.checked || "option" === t && !!e.selected
},selected: function(e) {
return e.parentNode && e.parentNode.selectedIndex, e.selected === !0
},empty: function(e) {
for (e = e.firstChild; e; e = e.nextSibling)
if (e.nodeType < 6)
return !1;
return !0
},parent: function(e) {
return !A.pseudos.empty(e)
},header: function(e) {
return yt.test(e.nodeName)
},input: function(e) {
return gt.test(e.nodeName)
},button: function(e) {
var t = e.nodeName.toLowerCase();
return "input" === t && "button" === e.type || "button" === t
},text: function(e) {
var t;
return "input" === e.nodeName.toLowerCase() && "text" === e.type && (null == (t = e.getAttribute("type")) || "text" === t.toLowerCase())
},first: l(function() {
return [0]
}),last: l(function(e, t) {
return [t - 1]
}),eq: l(function(e, t, r) {
return [0 > r ? r + t : r]
}),even: l(function(e, t) {
for (var r = 0; t > r; r += 2)
e.push(r);
return e
}),odd: l(function(e, t) {
for (var r = 1; t > r; r += 2)
e.push(r);
return e
}),lt: l(function(e, t, r) {
for (var n = 0 > r ? r + t : r; --n >= 0; )
e.push(n);
return e
}),gt: l(function(e, t, r) {
for (var n = 0 > r ? r + t : r; ++n < t; )
e.push(n);
return e
})}}, A.pseudos.nth = A.pseudos.eq;
for (C in {radio: !0,checkbox: !0,file: !0,password: !0,image: !0})
A.pseudos[C] = s(C);
for (C in {submit: !0,reset: !0})
A.pseudos[C] = u(C);
return p.prototype = A.filters = A.pseudos, A.setFilters = new p, k = t.compile = function(e, t) {
var r, n = [], i = [], a = G[e + " "];
if (!a) {
for (t || (t = f(e)), r = t.length; r--; )
a = v(t[r]), a[F] ? n.push(a) : i.push(a);
a = G(e, b(i, n))
}
return a
}, S.sortStable = F.split("").sort(Y).join("") === F, S.detectDuplicates = !!D, N(), S.sortDetached = i(function(e) {
return 1 & e.compareDocumentPosition(B.createElement("div"))
}), i(function(e) {
return e.innerHTML = "<a href='#'></a>", "#" === e.firstChild.getAttribute("href")
}) || a("type|href|height|width", function(e, t, r) {
return r ? void 0 : e.getAttribute(t, "type" === t.toLowerCase() ? 1 : 2)
}), S.attributes && i(function(e) {
return e.innerHTML = "<input/>", e.firstChild.setAttribute("value", ""), "" === e.firstChild.getAttribute("value")
}) || a("value", function(e, t, r) {
return r || "input" !== e.nodeName.toLowerCase() ? void 0 : e.defaultValue
}), i(function(e) {
return null == e.getAttribute("disabled")
}) || a(rt, function(e, t, r) {
var n;
return r ? void 0 : e[t] === !0 ? t.toLowerCase() : (n = e.getAttributeNode(t)) && n.specified ? n.value : null
}), t
}(i);
it.find = ut, it.expr = ut.selectors, it.expr[":"] = it.expr.pseudos, it.unique = ut.uniqueSort, it.text = ut.getText, it.isXMLDoc = ut.isXML, it.contains = ut.contains;
var lt = it.expr.match.needsContext, ct = /^<(\w+)\s*\/?>(?:<\/\1>|)$/, pt = /^.[^:#\[\.,]*$/;
it.filter = function(e, t, r) {
var n = t[0];
return r && (e = ":not(" + e + ")"), 1 === t.length && 1 === n.nodeType ? it.find.matchesSelector(n, e) ? [n] : [] : it.find.matches(e, it.grep(t, function(e) {
return 1 === e.nodeType
}))
}, it.fn.extend({find: function(e) {
var t, r = this.length, n = [], i = this;
if ("string" != typeof e)
return this.pushStack(it(e).filter(function() {
for (t = 0; r > t; t++)
if (it.contains(i[t], this))
return !0
}));
for (t = 0; r > t; t++)
it.find(e, i[t], n);
return n = this.pushStack(r > 1 ? it.unique(n) : n), n.selector = this.selector ? this.selector + " " + e : e, n
},filter: function(e) {
return this.pushStack(s(this, e || [], !1))
},not: function(e) {
return this.pushStack(s(this, e || [], !0))
},is: function(e) {
return !!s(this, "string" == typeof e && lt.test(e) ? it(e) : e || [], !1).length
}});
var ft, dt = /^(?:\s*(<[\w\W]+>)[^>]*|#([\w-]*))$/, ht = it.fn.init = function(e, t) {
var r, n;
if (!e)
return this;
if ("string" == typeof e) {
if (r = "<" === e[0] && ">" === e[e.length - 1] && e.length >= 3 ? [null, e, null] : dt.exec(e), !r || !r[1] && t)
return !t || t.jquery ? (t || ft).find(e) : this.constructor(t).find(e);
if (r[1]) {
if (t = t instanceof it ? t[0] : t, it.merge(this, it.parseHTML(r[1], t && t.nodeType ? t.ownerDocument || t : rt, !0)), ct.test(r[1]) && it.isPlainObject(t))
for (r in t)
it.isFunction(this[r]) ? this[r](t[r]) : this.attr(r, t[r]);
return this
}
return n = rt.getElementById(r[2]), n && n.parentNode && (this.length = 1, this[0] = n), this.context = rt, this.selector = e, this
}
return e.nodeType ? (this.context = this[0] = e, this.length = 1, this) : it.isFunction(e) ? "undefined" != typeof ft.ready ? ft.ready(e) : e(it) : (void 0 !== e.selector && (this.selector = e.selector, this.context = e.context), it.makeArray(e, this))
};
ht.prototype = it.fn, ft = it(rt);
var gt = /^(?:parents|prev(?:Until|All))/, yt = {children: !0,contents: !0,next: !0,prev: !0};
it.extend({dir: function(e, t, r) {
for (var n = [], i = void 0 !== r; (e = e[t]) && 9 !== e.nodeType; )
if (1 === e.nodeType) {
if (i && it(e).is(r))
break;
n.push(e)
}
return n
},sibling: function(e, t) {
for (var r = []; e; e = e.nextSibling)
1 === e.nodeType && e !== t && r.push(e);
return r
}}), it.fn.extend({has: function(e) {
var t = it(e, this), r = t.length;
return this.filter(function() {
for (var e = 0; r > e; e++)
if (it.contains(this, t[e]))
return !0
})
},closest: function(e, t) {
for (var r, n = 0, i = this.length, a = [], o = lt.test(e) || "string" != typeof e ? it(e, t || this.context) : 0; i > n; n++)
for (r = this[n]; r && r !== t; r = r.parentNode)
if (r.nodeType < 11 && (o ? o.index(r) > -1 : 1 === r.nodeType && it.find.matchesSelector(r, e))) {
a.push(r);
break
}
return this.pushStack(a.length > 1 ? it.unique(a) : a)
},index: function(e) {
return e ? "string" == typeof e ? X.call(it(e), this[0]) : X.call(this, e.jquery ? e[0] : e) : this[0] && this[0].parentNode ? this.first().prevAll().length : -1
},add: function(e, t) {
return this.pushStack(it.unique(it.merge(this.get(), it(e, t))))
},addBack: function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
}}), it.each({parent: function(e) {
var t = e.parentNode;
return t && 11 !== t.nodeType ? t : null
},parents: function(e) {
return it.dir(e, "parentNode")
},parentsUntil: function(e, t, r) {
return it.dir(e, "parentNode", r)
},next: function(e) {
return u(e, "nextSibling")
},prev: function(e) {
return u(e, "previousSibling")
},nextAll: function(e) {
return it.dir(e, "nextSibling")
},prevAll: function(e) {
return it.dir(e, "previousSibling")
},nextUntil: function(e, t, r) {
return it.dir(e, "nextSibling", r)
},prevUntil: function(e, t, r) {
return it.dir(e, "previousSibling", r)
},siblings: function(e) {
return it.sibling((e.parentNode || {}).firstChild, e)
},children: function(e) {
return it.sibling(e.firstChild)
},contents: function(e) {
return e.contentDocument || it.merge([], e.childNodes)
}}, function(e, t) {
it.fn[e] = function(r, n) {
var i = it.map(this, t, r);
return "Until" !== e.slice(-5) && (n = r), n && "string" == typeof n && (i = it.filter(n, i)), this.length > 1 && (yt[e] || it.unique(i), gt.test(e) && i.reverse()), this.pushStack(i)
}
});
var mt = /\S+/g, vt = {};
it.Callbacks = function(e) {
e = "string" == typeof e ? vt[e] || l(e) : it.extend({}, e);
var t, r, n, i, a, o, s = [], u = !e.once && [], c = function(l) {
for (t = e.memory && l, r = !0, o = i || 0, i = 0, a = s.length, n = !0; s && a > o; o++)
if (s[o].apply(l[0], l[1]) === !1 && e.stopOnFalse) {
t = !1;
break
}
n = !1, s && (u ? u.length && c(u.shift()) : t ? s = [] : p.disable())
}, p = {add: function() {
if (s) {
var r = s.length;
!function o(t) {
it.each(t, function(t, r) {
var n = it.type(r);
"function" === n ? e.unique && p.has(r) || s.push(r) : r && r.length && "string" !== n && o(r)
})
}(arguments), n ? a = s.length : t && (i = r, c(t))
}
return this
},remove: function() {
return s && it.each(arguments, function(e, t) {
for (var r; (r = it.inArray(t, s, r)) > -1; )
s.splice(r, 1), n && (a >= r && a--, o >= r && o--)
}), this
},has: function(e) {
return e ? it.inArray(e, s) > -1 : !(!s || !s.length)
},empty: function() {
return s = [], a = 0, this
},disable: function() {
return s = u = t = void 0, this
},disabled: function() {
return !s
},lock: function() {
return u = void 0, t || p.disable(), this
},locked: function() {
return !u
},fireWith: function(e, t) {
return !s || r && !u || (t = t || [], t = [e, t.slice ? t.slice() : t], n ? u.push(t) : c(t)), this
},fire: function() {
return p.fireWith(this, arguments), this
},fired: function() {
return !!r
}};
return p
}, it.extend({Deferred: function(e) {
var t = [["resolve", "done", it.Callbacks("once memory"), "resolved"], ["reject", "fail", it.Callbacks("once memory"), "rejected"], ["notify", "progress", it.Callbacks("memory")]], r = "pending", n = {state: function() {
return r
},always: function() {
return i.done(arguments).fail(arguments), this
},then: function() {
var e = arguments;
return it.Deferred(function(r) {
it.each(t, function(t, a) {
var o = it.isFunction(e[t]) && e[t];
i[a[1]](function() {
var e = o && o.apply(this, arguments);
e && it.isFunction(e.promise) ? e.promise().done(r.resolve).fail(r.reject).progress(r.notify) : r[a[0] + "With"](this === n ? r.promise() : this, o ? [e] : arguments)
})
}), e = null
}).promise()
},promise: function(e) {
return null != e ? it.extend(e, n) : n
}}, i = {};
return n.pipe = n.then, it.each(t, function(e, a) {
var o = a[2], s = a[3];
n[a[1]] = o.add, s && o.add(function() {
r = s
}, t[1 ^ e][2].disable, t[2][2].lock), i[a[0]] = function() {
return i[a[0] + "With"](this === i ? n : this, arguments), this
}, i[a[0] + "With"] = o.fireWith
}), n.promise(i), e && e.call(i, i), i
},when: function(e) {
var t, r, n, i = 0, a = W.call(arguments), o = a.length, s = 1 !== o || e && it.isFunction(e.promise) ? o : 0, u = 1 === s ? e : it.Deferred(), l = function(e, r, n) {
return function(i) {
r[e] = this, n[e] = arguments.length > 1 ? W.call(arguments) : i, n === t ? u.notifyWith(r, n) : --s || u.resolveWith(r, n)
}
};
if (o > 1)
for (t = new Array(o), r = new Array(o), n = new Array(o); o > i; i++)
a[i] && it.isFunction(a[i].promise) ? a[i].promise().done(l(i, n, a)).fail(u.reject).progress(l(i, r, t)) : --s;
return s || u.resolveWith(n, a), u.promise()
}});
var bt;
it.fn.ready = function(e) {
return it.ready.promise().done(e), this
}, it.extend({isReady: !1,readyWait: 1,holdReady: function(e) {
e ? it.readyWait++ : it.ready(!0)
},ready: function(e) {
(e === !0 ? --it.readyWait : it.isReady) || (it.isReady = !0, e !== !0 && --it.readyWait > 0 || (bt.resolveWith(rt, [it]), it.fn.trigger && it(rt).trigger("ready").off("ready")))
}}), it.ready.promise = function(e) {
return bt || (bt = it.Deferred(), "complete" === rt.readyState ? setTimeout(it.ready) : (rt.addEventListener("DOMContentLoaded", c, !1), i.addEventListener("load", c, !1))), bt.promise(e)
}, it.ready.promise();
var _t = it.access = function(e, t, r, n, i, a, o) {
var s = 0, u = e.length, l = null == r;
if ("object" === it.type(r)) {
i = !0;
for (s in r)
it.access(e, t, s, r[s], !0, a, o)
} else if (void 0 !== n && (i = !0, it.isFunction(n) || (o = !0), l && (o ? (t.call(e, n), t = null) : (l = t, t = function(e, t, r) {
return l.call(it(e), r)
})), t))
for (; u > s; s++)
t(e[s], r, o ? n : n.call(e[s], s, t(e[s], r)));
return i ? e : l ? t.call(e) : u ? t(e[0], r) : a
};
it.acceptData = function(e) {
return 1 === e.nodeType || 9 === e.nodeType || !+e.nodeType
}, p.uid = 1, p.accepts = it.acceptData, p.prototype = {key: function(e) {
if (!p.accepts(e))
return 0;
var t = {}, r = e[this.expando];
if (!r) {
r = p.uid++;
try {
t[this.expando] = {value: r}, Object.defineProperties(e, t)
} catch (n) {
t[this.expando] = r, it.extend(e, t)
}
}
return this.cache[r] || (this.cache[r] = {}), r
},set: function(e, t, r) {
var n, i = this.key(e), a = this.cache[i];
if ("string" == typeof t)
a[t] = r;
else if (it.isEmptyObject(a))
it.extend(this.cache[i], t);
else
for (n in t)
a[n] = t[n];
return a
},get: function(e, t) {
var r = this.cache[this.key(e)];
return void 0 === t ? r : r[t]
},access: function(e, t, r) {
var n;
return void 0 === t || t && "string" == typeof t && void 0 === r ? (n = this.get(e, t), void 0 !== n ? n : this.get(e, it.camelCase(t))) : (this.set(e, t, r), void 0 !== r ? r : t)
},remove: function(e, t) {
var r, n, i, a = this.key(e), o = this.cache[a];
if (void 0 === t)
this.cache[a] = {};
else {
it.isArray(t) ? n = t.concat(t.map(it.camelCase)) : (i = it.camelCase(t), t in o ? n = [t, i] : (n = i, n = n in o ? [n] : n.match(mt) || [])), r = n.length;
for (; r--; )
delete o[n[r]]
}
},hasData: function(e) {
return !it.isEmptyObject(this.cache[e[this.expando]] || {})
},discard: function(e) {
e[this.expando] && delete this.cache[e[this.expando]]
}};
var Et = new p, Ct = new p, St = /^(?:\{[\w\W]*\}|\[[\w\W]*\])$/, At = /([A-Z])/g;
it.extend({hasData: function(e) {
return Ct.hasData(e) || Et.hasData(e)
},data: function(e, t, r) {
return Ct.access(e, t, r)
},removeData: function(e, t) {
Ct.remove(e, t)
},_data: function(e, t, r) {
return Et.access(e, t, r)
},_removeData: function(e, t) {
Et.remove(e, t)
}}), it.fn.extend({data: function(e, t) {
var r, n, i, a = this[0], o = a && a.attributes;
if (void 0 === e) {
if (this.length && (i = Ct.get(a), 1 === a.nodeType && !Et.get(a, "hasDataAttrs"))) {
for (r = o.length; r--; )
n = o[r].name, 0 === n.indexOf("data-") && (n = it.camelCase(n.slice(5)), f(a, n, i[n]));
Et.set(a, "hasDataAttrs", !0)
}
return i
}
return "object" == typeof e ? this.each(function() {
Ct.set(this, e)
}) : _t(this, function(t) {
var r, n = it.camelCase(e);
if (a && void 0 === t) {
if (r = Ct.get(a, e), void 0 !== r)
return r;
if (r = Ct.get(a, n), void 0 !== r)
return r;
if (r = f(a, n, void 0), void 0 !== r)
return r
} else
this.each(function() {
var r = Ct.get(this, n);
Ct.set(this, n, t), -1 !== e.indexOf("-") && void 0 !== r && Ct.set(this, e, t)
})
}, null, t, arguments.length > 1, null, !0)
},removeData: function(e) {
return this.each(function() {
Ct.remove(this, e)
})
}}), it.extend({queue: function(e, t, r) {
var n;
return e ? (t = (t || "fx") + "queue", n = Et.get(e, t), r && (!n || it.isArray(r) ? n = Et.access(e, t, it.makeArray(r)) : n.push(r)), n || []) : void 0
},dequeue: function(e, t) {
t = t || "fx";
var r = it.queue(e, t), n = r.length, i = r.shift(), a = it._queueHooks(e, t), o = function() {
it.dequeue(e, t)
};
"inprogress" === i && (i = r.shift(), n--), i && ("fx" === t && r.unshift("inprogress"), delete a.stop, i.call(e, o, a)), !n && a && a.empty.fire()
},_queueHooks: function(e, t) {
var r = t + "queueHooks";
return Et.get(e, r) || Et.access(e, r, {empty: it.Callbacks("once memory").add(function() {
Et.remove(e, [t + "queue", r])
})})
}}), it.fn.extend({queue: function(e, t) {
var r = 2;
return "string" != typeof e && (t = e, e = "fx", r--), arguments.length < r ? it.queue(this[0], e) : void 0 === t ? this : this.each(function() {
var r = it.queue(this, e, t);
it._queueHooks(this, e), "fx" === e && "inprogress" !== r[0] && it.dequeue(this, e)
})
},dequeue: function(e) {
return this.each(function() {
it.dequeue(this, e)
})
},clearQueue: function(e) {
return this.queue(e || "fx", [])
},promise: function(e, t) {
var r, n = 1, i = it.Deferred(), a = this, o = this.length, s = function() {
--n || i.resolveWith(a, [a])
};
for ("string" != typeof e && (t = e, e = void 0), e = e || "fx"; o--; )
r = Et.get(a[o], e + "queueHooks"), r && r.empty && (n++, r.empty.add(s));
return s(), i.promise(t)
}});
var Tt = /[+-]?(?:\d*\.|)\d+(?:[eE][+-]?\d+|)/.source, wt = ["Top", "Right", "Bottom", "Left"], kt = function(e, t) {
return e = t || e, "none" === it.css(e, "display") || !it.contains(e.ownerDocument, e)
}, It = /^(?:checkbox|radio)$/i;
!function() {
var e = rt.createDocumentFragment(), t = e.appendChild(rt.createElement("div"));
t.innerHTML = "<input type='radio' checked='checked' name='t'/>", tt.checkClone = t.cloneNode(!0).cloneNode(!0).lastChild.checked, t.innerHTML = "<textarea>x</textarea>", tt.noCloneChecked = !!t.cloneNode(!0).lastChild.defaultValue
}();
var xt = "undefined";
tt.focusinBubbles = "onfocusin" in i;
var Dt = /^key/, Nt = /^(?:mouse|contextmenu)|click/, Bt = /^(?:focusinfocus|focusoutblur)$/, Lt = /^([^.]*)(?:\.(.+)|)$/;
it.event = {global: {},add: function(e, t, r, n, i) {
var a, o, s, u, l, c, p, f, d, h, g, y = Et.get(e);
if (y)
for (r.handler && (a = r, r = a.handler, i = a.selector), r.guid || (r.guid = it.guid++), (u = y.events) || (u = y.events = {}), (o = y.handle) || (o = y.handle = function(t) {
return typeof it !== xt && it.event.triggered !== t.type ? it.event.dispatch.apply(e, arguments) : void 0
}), t = (t || "").match(mt) || [""], l = t.length; l--; )
s = Lt.exec(t[l]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d && (p = it.event.special[d] || {}, d = (i ? p.delegateType : p.bindType) || d, p = it.event.special[d] || {}, c = it.extend({type: d,origType: g,data: n,handler: r,guid: r.guid,selector: i,needsContext: i && it.expr.match.needsContext.test(i),namespace: h.join(".")}, a), (f = u[d]) || (f = u[d] = [], f.delegateCount = 0, p.setup && p.setup.call(e, n, h, o) !== !1 || e.addEventListener && e.addEventListener(d, o, !1)), p.add && (p.add.call(e, c), c.handler.guid || (c.handler.guid = r.guid)), i ? f.splice(f.delegateCount++, 0, c) : f.push(c), it.event.global[d] = !0)
},remove: function(e, t, r, n, i) {
var a, o, s, u, l, c, p, f, d, h, g, y = Et.hasData(e) && Et.get(e);
if (y && (u = y.events)) {
for (t = (t || "").match(mt) || [""], l = t.length; l--; )
if (s = Lt.exec(t[l]) || [], d = g = s[1], h = (s[2] || "").split(".").sort(), d) {
for (p = it.event.special[d] || {}, d = (n ? p.delegateType : p.bindType) || d, f = u[d] || [], s = s[2] && new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)"), o = a = f.length; a--; )
c = f[a], !i && g !== c.origType || r && r.guid !== c.guid || s && !s.test(c.namespace) || n && n !== c.selector && ("**" !== n || !c.selector) || (f.splice(a, 1), c.selector && f.delegateCount--, p.remove && p.remove.call(e, c));
o && !f.length && (p.teardown && p.teardown.call(e, h, y.handle) !== !1 || it.removeEvent(e, d, y.handle), delete u[d])
} else
for (d in u)
it.event.remove(e, d + t[l], r, n, !0);
it.isEmptyObject(u) && (delete y.handle, Et.remove(e, "events"))
}
},trigger: function(e, t, r, n) {
var a, o, s, u, l, c, p, f = [r || rt], d = Z.call(e, "type") ? e.type : e, h = Z.call(e, "namespace") ? e.namespace.split(".") : [];
if (o = s = r = r || rt, 3 !== r.nodeType && 8 !== r.nodeType && !Bt.test(d + it.event.triggered) && (d.indexOf(".") >= 0 && (h = d.split("."), d = h.shift(), h.sort()), l = d.indexOf(":") < 0 && "on" + d, e = e[it.expando] ? e : new it.Event(d, "object" == typeof e && e), e.isTrigger = n ? 2 : 3, e.namespace = h.join("."), e.namespace_re = e.namespace ? new RegExp("(^|\\.)" + h.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, e.result = void 0, e.target || (e.target = r), t = null == t ? [e] : it.makeArray(t, [e]), p = it.event.special[d] || {}, n || !p.trigger || p.trigger.apply(r, t) !== !1)) {
if (!n && !p.noBubble && !it.isWindow(r)) {
for (u = p.delegateType || d, Bt.test(u + d) || (o = o.parentNode); o; o = o.parentNode)
f.push(o), s = o;
s === (r.ownerDocument || rt) && f.push(s.defaultView || s.parentWindow || i)
}
for (a = 0; (o = f[a++]) && !e.isPropagationStopped(); )
e.type = a > 1 ? u : p.bindType || d, c = (Et.get(o, "events") || {})[e.type] && Et.get(o, "handle"), c && c.apply(o, t), c = l && o[l], c && c.apply && it.acceptData(o) && (e.result = c.apply(o, t), e.result === !1 && e.preventDefault());
return e.type = d, n || e.isDefaultPrevented() || p._default && p._default.apply(f.pop(), t) !== !1 || !it.acceptData(r) || l && it.isFunction(r[d]) && !it.isWindow(r) && (s = r[l], s && (r[l] = null), it.event.triggered = d, r[d](), it.event.triggered = void 0, s && (r[l] = s)), e.result
}
},dispatch: function(e) {
e = it.event.fix(e);
var t, r, n, i, a, o = [], s = W.call(arguments), u = (Et.get(this, "events") || {})[e.type] || [], l = it.event.special[e.type] || {};
if (s[0] = e, e.delegateTarget = this, !l.preDispatch || l.preDispatch.call(this, e) !== !1) {
for (o = it.event.handlers.call(this, e, u), t = 0; (i = o[t++]) && !e.isPropagationStopped(); )
for (e.currentTarget = i.elem, r = 0; (a = i.handlers[r++]) && !e.isImmediatePropagationStopped(); )
(!e.namespace_re || e.namespace_re.test(a.namespace)) && (e.handleObj = a, e.data = a.data, n = ((it.event.special[a.origType] || {}).handle || a.handler).apply(i.elem, s), void 0 !== n && (e.result = n) === !1 && (e.preventDefault(), e.stopPropagation()));
return l.postDispatch && l.postDispatch.call(this, e), e.result
}
},handlers: function(e, t) {
var r, n, i, a, o = [], s = t.delegateCount, u = e.target;
if (s && u.nodeType && (!e.button || "click" !== e.type))
for (; u !== this; u = u.parentNode || this)
if (u.disabled !== !0 || "click" !== e.type) {
for (n = [], r = 0; s > r; r++)
a = t[r], i = a.selector + " ", void 0 === n[i] && (n[i] = a.needsContext ? it(i, this).index(u) >= 0 : it.find(i, this, null, [u]).length), n[i] && n.push(a);
n.length && o.push({elem: u,handlers: n})
}
return s < t.length && o.push({elem: this,handlers: t.slice(s)}), o
},props: "altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),fixHooks: {},keyHooks: {props: "char charCode key keyCode".split(" "),filter: function(e, t) {
return null == e.which && (e.which = null != t.charCode ? t.charCode : t.keyCode), e
}},mouseHooks: {props: "button buttons clientX clientY offsetX offsetY pageX pageY screenX screenY toElement".split(" "),filter: function(e, t) {
var r, n, i, a = t.button;
return null == e.pageX && null != t.clientX && (r = e.target.ownerDocument || rt, n = r.documentElement, i = r.body, e.pageX = t.clientX + (n && n.scrollLeft || i && i.scrollLeft || 0) - (n && n.clientLeft || i && i.clientLeft || 0), e.pageY = t.clientY + (n && n.scrollTop || i && i.scrollTop || 0) - (n && n.clientTop || i && i.clientTop || 0)), e.which || void 0 === a || (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0), e
}},fix: function(e) {
if (e[it.expando])
return e;
var t, r, n, i = e.type, a = e, o = this.fixHooks[i];
for (o || (this.fixHooks[i] = o = Nt.test(i) ? this.mouseHooks : Dt.test(i) ? this.keyHooks : {}), n = o.props ? this.props.concat(o.props) : this.props, e = new it.Event(a), t = n.length; t--; )
r = n[t], e[r] = a[r];
return e.target || (e.target = rt), 3 === e.target.nodeType && (e.target = e.target.parentNode), o.filter ? o.filter(e, a) : e
},special: {load: {noBubble: !0},focus: {trigger: function() {
return this !== g() && this.focus ? (this.focus(), !1) : void 0
},delegateType: "focusin"},blur: {trigger: function() {
return this === g() && this.blur ? (this.blur(), !1) : void 0
},delegateType: "focusout"},click: {trigger: function() {
return "checkbox" === this.type && this.click && it.nodeName(this, "input") ? (this.click(), !1) : void 0
},_default: function(e) {
return it.nodeName(e.target, "a")
}},beforeunload: {postDispatch: function(e) {
void 0 !== e.result && (e.originalEvent.returnValue = e.result)
}}},simulate: function(e, t, r, n) {
var i = it.extend(new it.Event, r, {type: e,isSimulated: !0,originalEvent: {}});
n ? it.event.trigger(i, null, t) : it.event.dispatch.call(t, i), i.isDefaultPrevented() && r.preventDefault()
}}, it.removeEvent = function(e, t, r) {
e.removeEventListener && e.removeEventListener(t, r, !1)
}, it.Event = function(e, t) {
return this instanceof it.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || void 0 === e.defaultPrevented && e.getPreventDefault && e.getPreventDefault() ? d : h) : this.type = e, t && it.extend(this, t), this.timeStamp = e && e.timeStamp || it.now(), void (this[it.expando] = !0)) : new it.Event(e, t)
}, it.Event.prototype = {isDefaultPrevented: h,isPropagationStopped: h,isImmediatePropagationStopped: h,preventDefault: function() {
var e = this.originalEvent;
this.isDefaultPrevented = d, e && e.preventDefault && e.preventDefault()
},stopPropagation: function() {
var e = this.originalEvent;
this.isPropagationStopped = d, e && e.stopPropagation && e.stopPropagation()
},stopImmediatePropagation: function() {
this.isImmediatePropagationStopped = d, this.stopPropagation()
}}, it.each({mouseenter: "mouseover",mouseleave: "mouseout"}, function(e, t) {
it.event.special[e] = {delegateType: t,bindType: t,handle: function(e) {
var r, n = this, i = e.relatedTarget, a = e.handleObj;
return (!i || i !== n && !it.contains(n, i)) && (e.type = a.origType, r = a.handler.apply(this, arguments), e.type = t), r
}}
}), tt.focusinBubbles || it.each({focus: "focusin",blur: "focusout"}, function(e, t) {
var r = function(e) {
it.event.simulate(t, e.target, it.event.fix(e), !0)
};
it.event.special[t] = {setup: function() {
var n = this.ownerDocument || this, i = Et.access(n, t);
i || n.addEventListener(e, r, !0), Et.access(n, t, (i || 0) + 1)
},teardown: function() {
var n = this.ownerDocument || this, i = Et.access(n, t) - 1;
i ? Et.access(n, t, i) : (n.removeEventListener(e, r, !0), Et.remove(n, t))
}}
}), it.fn.extend({on: function(e, t, r, n, i) {
var a, o;
if ("object" == typeof e) {
"string" != typeof t && (r = r || t, t = void 0);
for (o in e)
this.on(o, t, r, e[o], i);
return this
}
if (null == r && null == n ? (n = t, r = t = void 0) : null == n && ("string" == typeof t ? (n = r, r = void 0) : (n = r, r = t, t = void 0)), n === !1)
n = h;
else if (!n)
return this;
return 1 === i && (a = n, n = function(e) {
return it().off(e), a.apply(this, arguments)
}, n.guid = a.guid || (a.guid = it.guid++)), this.each(function() {
it.event.add(this, e, n, r, t)
})
},one: function(e, t, r, n) {
return this.on(e, t, r, n, 1)
},off: function(e, t, r) {
var n, i;
if (e && e.preventDefault && e.handleObj)
return n = e.handleObj, it(e.delegateTarget).off(n.namespace ? n.origType + "." + n.namespace : n.origType, n.selector, n.handler), this;
if ("object" == typeof e) {
for (i in e)
this.off(i, t, e[i]);
return this
}
return (t === !1 || "function" == typeof t) && (r = t, t = void 0), r === !1 && (r = h), this.each(function() {
it.event.remove(this, e, r, t)
})
},trigger: function(e, t) {
return this.each(function() {
it.event.trigger(e, t, this)
})
},triggerHandler: function(e, t) {
var r = this[0];
return r ? it.event.trigger(e, t, r, !0) : void 0
}});
var Rt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi, Pt = /<([\w:]+)/, Ot = /<|&#?\w+;/, Ut = /<(?:script|style|link)/i, Mt = /checked\s*(?:[^=]|=\s*.checked.)/i, Ft = /^$|\/(?:java|ecma)script/i, jt = /^true\/(.*)/, Vt = /^\s*<!(?:\[CDATA\[|--)|(?:\]\]|--)>\s*$/g, Ht = {option: [1, "<select multiple='multiple'>", "</select>"],thead: [1, "<table>", "</table>"],col: [2, "<table><colgroup>", "</colgroup></table>"],tr: [2, "<table><tbody>", "</tbody></table>"],td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],_default: [0, "", ""]};
Ht.optgroup = Ht.option, Ht.tbody = Ht.tfoot = Ht.colgroup = Ht.caption = Ht.thead, Ht.th = Ht.td, it.extend({clone: function(e, t, r) {
var n, i, a, o, s = e.cloneNode(!0), u = it.contains(e.ownerDocument, e);
if (!(tt.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || it.isXMLDoc(e)))
for (o = E(s), a = E(e), n = 0, i = a.length; i > n; n++)
C(a[n], o[n]);
if (t)
if (r)
for (a = a || E(e), o = o || E(s), n = 0, i = a.length; i > n; n++)
_(a[n], o[n]);
else
_(e, s);
return o = E(s, "script"), o.length > 0 && b(o, !u && E(e, "script")), s
},buildFragment: function(e, t, r, n) {
for (var i, a, o, s, u, l, c = t.createDocumentFragment(), p = [], f = 0, d = e.length; d > f; f++)
if (i = e[f], i || 0 === i)
if ("object" === it.type(i))
it.merge(p, i.nodeType ? [i] : i);
else if (Ot.test(i)) {
for (a = a || c.appendChild(t.createElement("div")), o = (Pt.exec(i) || ["", ""])[1].toLowerCase(), s = Ht[o] || Ht._default, a.innerHTML = s[1] + i.replace(Rt, "<$1></$2>") + s[2], l = s[0]; l--; )
a = a.lastChild;
it.merge(p, a.childNodes), a = c.firstChild, a.textContent = ""
} else
p.push(t.createTextNode(i));
for (c.textContent = "", f = 0; i = p[f++]; )
if ((!n || -1 === it.inArray(i, n)) && (u = it.contains(i.ownerDocument, i), a = E(c.appendChild(i), "script"), u && b(a), r))
for (l = 0; i = a[l++]; )
Ft.test(i.type || "") && r.push(i);
return c
},cleanData: function(e) {
for (var t, r, n, i, a, o, s = it.event.special, u = 0; void 0 !== (r = e[u]); u++) {
if (it.acceptData(r) && (a = r[Et.expando], a && (t = Et.cache[a]))) {
if (n = Object.keys(t.events || {}), n.length)
for (o = 0; void 0 !== (i = n[o]); o++)
s[i] ? it.event.remove(r, i) : it.removeEvent(r, i, t.handle);
Et.cache[a] && delete Et.cache[a]
}
delete Ct.cache[r[Ct.expando]]
}
}}), it.fn.extend({text: function(e) {
return _t(this, function(e) {
return void 0 === e ? it.text(this) : this.empty().each(function() {
(1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) && (this.textContent = e)
})
}, null, e, arguments.length)
},append: function() {
return this.domManip(arguments, function(e) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var t = y(this, e);
t.appendChild(e)
}
})
},prepend: function() {
return this.domManip(arguments, function(e) {
if (1 === this.nodeType || 11 === this.nodeType || 9 === this.nodeType) {
var t = y(this, e);
t.insertBefore(e, t.firstChild)
}
})
},before: function() {
return this.domManip(arguments, function(e) {
this.parentNode && this.parentNode.insertBefore(e, this)
})
},after: function() {
return this.domManip(arguments, function(e) {
this.parentNode && this.parentNode.insertBefore(e, this.nextSibling)
})
},remove: function(e, t) {
for (var r, n = e ? it.filter(e, this) : this, i = 0; null != (r = n[i]); i++)
t || 1 !== r.nodeType || it.cleanData(E(r)), r.parentNode && (t && it.contains(r.ownerDocument, r) && b(E(r, "script")), r.parentNode.removeChild(r));
return this
},empty: function() {
for (var e, t = 0; null != (e = this[t]); t++)
1 === e.nodeType && (it.cleanData(E(e, !1)), e.textContent = "");
return this
},clone: function(e, t) {
return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function() {
return it.clone(this, e, t)
})
},html: function(e) {
return _t(this, function(e) {
var t = this[0] || {}, r = 0, n = this.length;
if (void 0 === e && 1 === t.nodeType)
return t.innerHTML;
if ("string" == typeof e && !Ut.test(e) && !Ht[(Pt.exec(e) || ["", ""])[1].toLowerCase()]) {
e = e.replace(Rt, "<$1></$2>");
try {
for (; n > r; r++)
t = this[r] || {}, 1 === t.nodeType && (it.cleanData(E(t, !1)), t.innerHTML = e);
t = 0
} catch (i) {
}
}
t && this.empty().append(e)
}, null, e, arguments.length)
},replaceWith: function() {
var e = arguments[0];
return this.domManip(arguments, function(t) {
e = this.parentNode, it.cleanData(E(this)), e && e.replaceChild(t, this)
}), e && (e.length || e.nodeType) ? this : this.remove()
},detach: function(e) {
return this.remove(e, !0)
},domManip: function(e, t) {
e = z.apply([], e);
var r, n, i, a, o, s, u = 0, l = this.length, c = this, p = l - 1, f = e[0], d = it.isFunction(f);
if (d || l > 1 && "string" == typeof f && !tt.checkClone && Mt.test(f))
return this.each(function(r) {
var n = c.eq(r);
d && (e[0] = f.call(this, r, n.html())), n.domManip(e, t)
});
if (l && (r = it.buildFragment(e, this[0].ownerDocument, !1, this), n = r.firstChild, 1 === r.childNodes.length && (r = n), n)) {
for (i = it.map(E(r, "script"), m), a = i.length; l > u; u++)
o = r, u !== p && (o = it.clone(o, !0, !0), a && it.merge(i, E(o, "script"))), t.call(this[u], o, u);
if (a)
for (s = i[i.length - 1].ownerDocument, it.map(i, v), u = 0; a > u; u++)
o = i[u], Ft.test(o.type || "") && !Et.access(o, "globalEval") && it.contains(s, o) && (o.src ? it._evalUrl && it._evalUrl(o.src) : it.globalEval(o.textContent.replace(Vt, "")))
}
return this
}}), it.each({appendTo: "append",prependTo: "prepend",insertBefore: "before",insertAfter: "after",replaceAll: "replaceWith"}, function(e, t) {
it.fn[e] = function(e) {
for (var r, n = [], i = it(e), a = i.length - 1, o = 0; a >= o; o++)
r = o === a ? this : this.clone(!0), it(i[o])[t](r), Q.apply(n, r.get());
return this.pushStack(n)
}
});
var qt, Kt = {}, Gt = /^margin/, Yt = new RegExp("^(" + Tt + ")(?!px)[a-z%]+$", "i"), Wt = function(e) {
return e.ownerDocument.defaultView.getComputedStyle(e, null)
};
!function() {
function e() {
s.style.cssText = "-webkit-box-sizing:border-box;-moz-box-sizing:border-box;box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%", a.appendChild(o);
var e = i.getComputedStyle(s, null);
t = "1%" !== e.top, r = "4px" === e.width, a.removeChild(o)
}
var t, r, n = "padding:0;margin:0;border:0;display:block;-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box", a = rt.documentElement, o = rt.createElement("div"), s = rt.createElement("div");
s.style.backgroundClip = "content-box", s.cloneNode(!0).style.backgroundClip = "", tt.clearCloneStyle = "content-box" === s.style.backgroundClip, o.style.cssText = "border:0;width:0;height:0;position:absolute;top:0;left:-9999px;margin-top:1px", o.appendChild(s), i.getComputedStyle && it.extend(tt, {pixelPosition: function() {
return e(), t
},boxSizingReliable: function() {
return null == r && e(), r
},reliableMarginRight: function() {
var e, t = s.appendChild(rt.createElement("div"));
return t.style.cssText = s.style.cssText = n, t.style.marginRight = t.style.width = "0", s.style.width = "1px", a.appendChild(o), e = !parseFloat(i.getComputedStyle(t, null).marginRight), a.removeChild(o), s.innerHTML = "", e
}})
}(), it.swap = function(e, t, r, n) {
var i, a, o = {};
for (a in t)
o[a] = e.style[a], e.style[a] = t[a];
i = r.apply(e, n || []);
for (a in t)
e.style[a] = o[a];
return i
};
var zt = /^(none|table(?!-c[ea]).+)/, Qt = new RegExp("^(" + Tt + ")(.*)$", "i"), Xt = new RegExp("^([+-])=(" + Tt + ")", "i"), $t = {position: "absolute",visibility: "hidden",display: "block"}, Jt = {letterSpacing: 0,fontWeight: 400}, Zt = ["Webkit", "O", "Moz", "ms"];
it.extend({cssHooks: {opacity: {get: function(e, t) {
if (t) {
var r = T(e, "opacity");
return "" === r ? "1" : r
}
}}},cssNumber: {columnCount: !0,fillOpacity: !0,fontWeight: !0,lineHeight: !0,opacity: !0,order: !0,orphans: !0,widows: !0,zIndex: !0,zoom: !0},cssProps: {"float": "cssFloat"},style: function(e, t, r, n) {
if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
var i, a, o, s = it.camelCase(t), u = e.style;
return t = it.cssProps[s] || (it.cssProps[s] = k(u, s)), o = it.cssHooks[t] || it.cssHooks[s], void 0 === r ? o && "get" in o && void 0 !== (i = o.get(e, !1, n)) ? i : u[t] : (a = typeof r, "string" === a && (i = Xt.exec(r)) && (r = (i[1] + 1) * i[2] + parseFloat(it.css(e, t)), a = "number"), null != r && r === r && ("number" !== a || it.cssNumber[s] || (r += "px"), tt.clearCloneStyle || "" !== r || 0 !== t.indexOf("background") || (u[t] = "inherit"), o && "set" in o && void 0 === (r = o.set(e, r, n)) || (u[t] = "", u[t] = r)), void 0)
}
},css: function(e, t, r, n) {
var i, a, o, s = it.camelCase(t);
return t = it.cssProps[s] || (it.cssProps[s] = k(e.style, s)), o = it.cssHooks[t] || it.cssHooks[s], o && "get" in o && (i = o.get(e, !0, r)), void 0 === i && (i = T(e, t, n)), "normal" === i && t in Jt && (i = Jt[t]), "" === r || r ? (a = parseFloat(i), r === !0 || it.isNumeric(a) ? a || 0 : i) : i
}}), it.each(["height", "width"], function(e, t) {
it.cssHooks[t] = {get: function(e, r, n) {
return r ? 0 === e.offsetWidth && zt.test(it.css(e, "display")) ? it.swap(e, $t, function() {
return D(e, t, n)
}) : D(e, t, n) : void 0
},set: function(e, r, n) {
var i = n && Wt(e);
return I(e, r, n ? x(e, t, n, "border-box" === it.css(e, "boxSizing", !1, i), i) : 0)
}}
}), it.cssHooks.marginRight = w(tt.reliableMarginRight, function(e, t) {
return t ? it.swap(e, {display: "inline-block"}, T, [e, "marginRight"]) : void 0
}), it.each({margin: "",padding: "",border: "Width"}, function(e, t) {
it.cssHooks[e + t] = {expand: function(r) {
for (var n = 0, i = {}, a = "string" == typeof r ? r.split(" ") : [r]; 4 > n; n++)
i[e + wt[n] + t] = a[n] || a[n - 2] || a[0];
return i
}}, Gt.test(e) || (it.cssHooks[e + t].set = I)
}), it.fn.extend({css: function(e, t) {
return _t(this, function(e, t, r) {
var n, i, a = {}, o = 0;
if (it.isArray(t)) {
for (n = Wt(e), i = t.length; i > o; o++)
a[t[o]] = it.css(e, t[o], !1, n);
return a
}
return void 0 !== r ? it.style(e, t, r) : it.css(e, t)
}, e, t, arguments.length > 1)
},show: function() {
return N(this, !0)
},hide: function() {
return N(this)
},toggle: function(e) {
return "boolean" == typeof e ? e ? this.show() : this.hide() : this.each(function() {
kt(this) ? it(this).show() : it(this).hide()
})
}}), it.Tween = B, B.prototype = {constructor: B,init: function(e, t, r, n, i, a) {
this.elem = e, this.prop = r, this.easing = i || "swing", this.options = t, this.start = this.now = this.cur(), this.end = n, this.unit = a || (it.cssNumber[r] ? "" : "px")
},cur: function() {
var e = B.propHooks[this.prop];
return e && e.get ? e.get(this) : B.propHooks._default.get(this)
},run: function(e) {
var t, r = B.propHooks[this.prop];
return this.pos = t = this.options.duration ? it.easing[this.easing](e, this.options.duration * e, 0, 1, this.options.duration) : e, this.now = (this.end - this.start) * t + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), r && r.set ? r.set(this) : B.propHooks._default.set(this), this
}}, B.prototype.init.prototype = B.prototype, B.propHooks = {_default: {get: function(e) {
var t;
return null == e.elem[e.prop] || e.elem.style && null != e.elem.style[e.prop] ? (t = it.css(e.elem, e.prop, ""), t && "auto" !== t ? t : 0) : e.elem[e.prop]
},set: function(e) {
it.fx.step[e.prop] ? it.fx.step[e.prop](e) : e.elem.style && (null != e.elem.style[it.cssProps[e.prop]] || it.cssHooks[e.prop]) ? it.style(e.elem, e.prop, e.now + e.unit) : e.elem[e.prop] = e.now
}}}, B.propHooks.scrollTop = B.propHooks.scrollLeft = {set: function(e) {
e.elem.nodeType && e.elem.parentNode && (e.elem[e.prop] = e.now)
}}, it.easing = {linear: function(e) {
return e
},swing: function(e) {
return .5 - Math.cos(e * Math.PI) / 2
}}, it.fx = B.prototype.init, it.fx.step = {};
var er, tr, rr = /^(?:toggle|show|hide)$/, nr = new RegExp("^(?:([+-])=|)(" + Tt + ")([a-z%]*)$", "i"), ir = /queueHooks$/, ar = [O], or = {"*": [function(e, t) {
var r = this.createTween(e, t), n = r.cur(), i = nr.exec(t), a = i && i[3] || (it.cssNumber[e] ? "" : "px"), o = (it.cssNumber[e] || "px" !== a && +n) && nr.exec(it.css(r.elem, e)), s = 1, u = 20;
if (o && o[3] !== a) {
a = a || o[3], i = i || [], o = +n || 1;
do
s = s || ".5", o /= s, it.style(r.elem, e, o + a);
while (s !== (s = r.cur() / n) && 1 !== s && --u)
}
return i && (o = r.start = +o || +n || 0, r.unit = a, r.end = i[1] ? o + (i[1] + 1) * i[2] : +i[2]), r
}]};
it.Animation = it.extend(M, {tweener: function(e, t) {
it.isFunction(e) ? (t = e, e = ["*"]) : e = e.split(" ");
for (var r, n = 0, i = e.length; i > n; n++)
r = e[n], or[r] = or[r] || [], or[r].unshift(t)
},prefilter: function(e, t) {
t ? ar.unshift(e) : ar.push(e)
}}), it.speed = function(e, t, r) {
var n = e && "object" == typeof e ? it.extend({}, e) : {complete: r || !r && t || it.isFunction(e) && e,duration: e,easing: r && t || t && !it.isFunction(t) && t};
return n.duration = it.fx.off ? 0 : "number" == typeof n.duration ? n.duration : n.duration in it.fx.speeds ? it.fx.speeds[n.duration] : it.fx.speeds._default, (null == n.queue || n.queue === !0) && (n.queue = "fx"), n.old = n.complete, n.complete = function() {
it.isFunction(n.old) && n.old.call(this), n.queue && it.dequeue(this, n.queue)
}, n
}, it.fn.extend({fadeTo: function(e, t, r, n) {
return this.filter(kt).css("opacity", 0).show().end().animate({opacity: t}, e, r, n)
},animate: function(e, t, r, n) {
var i = it.isEmptyObject(e), a = it.speed(t, r, n), o = function() {
var t = M(this, it.extend({}, e), a);
(i || Et.get(this, "finish")) && t.stop(!0)
};
return o.finish = o, i || a.queue === !1 ? this.each(o) : this.queue(a.queue, o)
},stop: function(e, t, r) {
var n = function(e) {
var t = e.stop;
delete e.stop, t(r)
};
return "string" != typeof e && (r = t, t = e, e = void 0), t && e !== !1 && this.queue(e || "fx", []), this.each(function() {
var t = !0, i = null != e && e + "queueHooks", a = it.timers, o = Et.get(this);
if (i)
o[i] && o[i].stop && n(o[i]);
else
for (i in o)
o[i] && o[i].stop && ir.test(i) && n(o[i]);
for (i = a.length; i--; )
a[i].elem !== this || null != e && a[i].queue !== e || (a[i].anim.stop(r), t = !1, a.splice(i, 1));
(t || !r) && it.dequeue(this, e)
})
},finish: function(e) {
return e !== !1 && (e = e || "fx"), this.each(function() {
var t, r = Et.get(this), n = r[e + "queue"], i = r[e + "queueHooks"], a = it.timers, o = n ? n.length : 0;
for (r.finish = !0, it.queue(this, e, []), i && i.stop && i.stop.call(this, !0), t = a.length; t--; )
a[t].elem === this && a[t].queue === e && (a[t].anim.stop(!0), a.splice(t, 1));
for (t = 0; o > t; t++)
n[t] && n[t].finish && n[t].finish.call(this);
delete r.finish
})
}}), it.each(["toggle", "show", "hide"], function(e, t) {
var r = it.fn[t];
it.fn[t] = function(e, n, i) {
return null == e || "boolean" == typeof e ? r.apply(this, arguments) : this.animate(R(t, !0), e, n, i)
}
}), it.each({slideDown: R("show"),slideUp: R("hide"),slideToggle: R("toggle"),fadeIn: {opacity: "show"},fadeOut: {opacity: "hide"},fadeToggle: {opacity: "toggle"}}, function(e, t) {
it.fn[e] = function(e, r, n) {
return this.animate(t, e, r, n)
}
}), it.timers = [], it.fx.tick = function() {
var e, t = 0, r = it.timers;
for (er = it.now(); t < r.length; t++)
e = r[t], e() || r[t] !== e || r.splice(t--, 1);
r.length || it.fx.stop(), er = void 0
}, it.fx.timer = function(e) {
it.timers.push(e), e() ? it.fx.start() : it.timers.pop()
}, it.fx.interval = 13, it.fx.start = function() {
tr || (tr = setInterval(it.fx.tick, it.fx.interval))
}, it.fx.stop = function() {
clearInterval(tr), tr = null
}, it.fx.speeds = {slow: 600,fast: 200,_default: 400}, it.fn.delay = function(e, t) {
return e = it.fx ? it.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function(t, r) {
var n = setTimeout(t, e);
r.stop = function() {
clearTimeout(n)
}
})
}, function() {
var e = rt.createElement("input"), t = rt.createElement("select"), r = t.appendChild(rt.createElement("option"));
e.type = "checkbox", tt.checkOn = "" !== e.value, tt.optSelected = r.selected, t.disabled = !0, tt.optDisabled = !r.disabled, e = rt.createElement("input"), e.value = "t", e.type = "radio", tt.radioValue = "t" === e.value
}();
var sr, ur, lr = it.expr.attrHandle;
it.fn.extend({attr: function(e, t) {
return _t(this, it.attr, e, t, arguments.length > 1)
},removeAttr: function(e) {
return this.each(function() {
it.removeAttr(this, e)
})
}}), it.extend({attr: function(e, t, r) {
var n, i, a = e.nodeType;
if (e && 3 !== a && 8 !== a && 2 !== a)
return typeof e.getAttribute === xt ? it.prop(e, t, r) : (1 === a && it.isXMLDoc(e) || (t = t.toLowerCase(), n = it.attrHooks[t] || (it.expr.match.bool.test(t) ? ur : sr)), void 0 === r ? n && "get" in n && null !== (i = n.get(e, t)) ? i : (i = it.find.attr(e, t), null == i ? void 0 : i) : null !== r ? n && "set" in n && void 0 !== (i = n.set(e, r, t)) ? i : (e.setAttribute(t, r + ""), r) : void it.removeAttr(e, t))
},removeAttr: function(e, t) {
var r, n, i = 0, a = t && t.match(mt);
if (a && 1 === e.nodeType)
for (; r = a[i++]; )
n = it.propFix[r] || r, it.expr.match.bool.test(r) && (e[n] = !1), e.removeAttribute(r)
},attrHooks: {type: {set: function(e, t) {
if (!tt.radioValue && "radio" === t && it.nodeName(e, "input")) {
var r = e.value;
return e.setAttribute("type", t), r && (e.value = r), t
}
}}}}), ur = {set: function(e, t, r) {
return t === !1 ? it.removeAttr(e, r) : e.setAttribute(r, r), r
}}, it.each(it.expr.match.bool.source.match(/\w+/g), function(e, t) {
var r = lr[t] || it.find.attr;
lr[t] = function(e, t, n) {
var i, a;
return n || (a = lr[t], lr[t] = i, i = null != r(e, t, n) ? t.toLowerCase() : null, lr[t] = a), i
}
});
var cr = /^(?:input|select|textarea|button)$/i;
it.fn.extend({prop: function(e, t) {
return _t(this, it.prop, e, t, arguments.length > 1)
},removeProp: function(e) {
return this.each(function() {
delete this[it.propFix[e] || e]
})
}}), it.extend({propFix: {"for": "htmlFor","class": "className"},prop: function(e, t, r) {
var n, i, a, o = e.nodeType;
if (e && 3 !== o && 8 !== o && 2 !== o)
return a = 1 !== o || !it.isXMLDoc(e), a && (t = it.propFix[t] || t, i = it.propHooks[t]), void 0 !== r ? i && "set" in i && void 0 !== (n = i.set(e, r, t)) ? n : e[t] = r : i && "get" in i && null !== (n = i.get(e, t)) ? n : e[t]
},propHooks: {tabIndex: {get: function(e) {
return e.hasAttribute("tabindex") || cr.test(e.nodeName) || e.href ? e.tabIndex : -1
}}}}), tt.optSelected || (it.propHooks.selected = {get: function(e) {
var t = e.parentNode;
return t && t.parentNode && t.parentNode.selectedIndex, null
}}), it.each(["tabIndex", "readOnly", "maxLength", "cellSpacing", "cellPadding", "rowSpan", "colSpan", "useMap", "frameBorder", "contentEditable"], function() {
it.propFix[this.toLowerCase()] = this
});
var pr = /[\t\r\n\f]/g;
it.fn.extend({addClass: function(e) {
var t, r, n, i, a, o, s = "string" == typeof e && e, u = 0, l = this.length;
if (it.isFunction(e))
return this.each(function(t) {
it(this).addClass(e.call(this, t, this.className))
});
if (s)
for (t = (e || "").match(mt) || []; l > u; u++)
if (r = this[u], n = 1 === r.nodeType && (r.className ? (" " + r.className + " ").replace(pr, " ") : " ")) {
for (a = 0; i = t[a++]; )
n.indexOf(" " + i + " ") < 0 && (n += i + " ");
o = it.trim(n), r.className !== o && (r.className = o)
}
return this
},removeClass: function(e) {
var t, r, n, i, a, o, s = 0 === arguments.length || "string" == typeof e && e, u = 0, l = this.length;
if (it.isFunction(e))
return this.each(function(t) {
it(this).removeClass(e.call(this, t, this.className))
});
if (s)
for (t = (e || "").match(mt) || []; l > u; u++)
if (r = this[u], n = 1 === r.nodeType && (r.className ? (" " + r.className + " ").replace(pr, " ") : "")) {
for (a = 0; i = t[a++]; )
for (; n.indexOf(" " + i + " ") >= 0; )
n = n.replace(" " + i + " ", " ");
o = e ? it.trim(n) : "", r.className !== o && (r.className = o)
}
return this
},toggleClass: function(e, t) {
var r = typeof e;
return "boolean" == typeof t && "string" === r ? t ? this.addClass(e) : this.removeClass(e) : this.each(it.isFunction(e) ? function(r) {
it(this).toggleClass(e.call(this, r, this.className, t), t)
} : function() {
if ("string" === r)
for (var t, n = 0, i = it(this), a = e.match(mt) || []; t = a[n++]; )
i.hasClass(t) ? i.removeClass(t) : i.addClass(t);
else
(r === xt || "boolean" === r) && (this.className && Et.set(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : Et.get(this, "__className__") || "")
})
},hasClass: function(e) {
for (var t = " " + e + " ", r = 0, n = this.length; n > r; r++)
if (1 === this[r].nodeType && (" " + this[r].className + " ").replace(pr, " ").indexOf(t) >= 0)
return !0;
return !1
}});
var fr = /\r/g;
it.fn.extend({val: function(e) {
var t, r, n, i = this[0];
{
if (arguments.length)
return n = it.isFunction(e), this.each(function(r) {
var i;
1 === this.nodeType && (i = n ? e.call(this, r, it(this).val()) : e, null == i ? i = "" : "number" == typeof i ? i += "" : it.isArray(i) && (i = it.map(i, function(e) {
return null == e ? "" : e + ""
})), t = it.valHooks[this.type] || it.valHooks[this.nodeName.toLowerCase()], t && "set" in t && void 0 !== t.set(this, i, "value") || (this.value = i))
});
if (i)
return t = it.valHooks[i.type] || it.valHooks[i.nodeName.toLowerCase()], t && "get" in t && void 0 !== (r = t.get(i, "value")) ? r : (r = i.value, "string" == typeof r ? r.replace(fr, "") : null == r ? "" : r)
}
}}), it.extend({valHooks: {select: {get: function(e) {
for (var t, r, n = e.options, i = e.selectedIndex, a = "select-one" === e.type || 0 > i, o = a ? null : [], s = a ? i + 1 : n.length, u = 0 > i ? s : a ? i : 0; s > u; u++)
if (r = n[u], !(!r.selected && u !== i || (tt.optDisabled ? r.disabled : null !== r.getAttribute("disabled")) || r.parentNode.disabled && it.nodeName(r.parentNode, "optgroup"))) {
if (t = it(r).val(), a)
return t;
o.push(t)
}
return o
},set: function(e, t) {
for (var r, n, i = e.options, a = it.makeArray(t), o = i.length; o--; )
n = i[o], (n.selected = it.inArray(it(n).val(), a) >= 0) && (r = !0);
return r || (e.selectedIndex = -1), a
}}}}), it.each(["radio", "checkbox"], function() {
it.valHooks[this] = {set: function(e, t) {
return it.isArray(t) ? e.checked = it.inArray(it(e).val(), t) >= 0 : void 0
}}, tt.checkOn || (it.valHooks[this].get = function(e) {
return null === e.getAttribute("value") ? "on" : e.value
})
}), it.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(e, t) {
it.fn[t] = function(e, r) {
return arguments.length > 0 ? this.on(t, null, e, r) : this.trigger(t)
}
}), it.fn.extend({hover: function(e, t) {
return this.mouseenter(e).mouseleave(t || e)
},bind: function(e, t, r) {
return this.on(e, null, t, r)
},unbind: function(e, t) {
return this.off(e, null, t)
},delegate: function(e, t, r, n) {
return this.on(t, e, r, n)
},undelegate: function(e, t, r) {
return 1 === arguments.length ? this.off(e, "**") : this.off(t, e || "**", r)
}});
var dr = it.now(), hr = /\?/;
it.parseJSON = function(e) {
return JSON.parse(e + "")
}, it.parseXML = function(e) {
var t, r;
if (!e || "string" != typeof e)
return null;
try {
r = new DOMParser, t = r.parseFromString(e, "text/xml")
} catch (n) {
t = void 0
}
return (!t || t.getElementsByTagName("parsererror").length) && it.error("Invalid XML: " + e), t
};
var gr, yr, mr = /#.*$/, vr = /([?&])_=[^&]*/, br = /^(.*?):[ \t]*([^\r\n]*)$/gm, _r = /^(?:about|app|app-storage|.+-extension|file|res|widget):$/, Er = /^(?:GET|HEAD)$/, Cr = /^\/\//, Sr = /^([\w.+-]+:)(?:\/\/(?:[^\/?#]*@|)([^\/?#:]*)(?::(\d+)|)|)/, Ar = {}, Tr = {}, wr = "*/".concat("*");
try {
yr = location.href
} catch (kr) {
yr = rt.createElement("a"), yr.href = "", yr = yr.href
}
gr = Sr.exec(yr.toLowerCase()) || [], it.extend({active: 0,lastModified: {},etag: {},ajaxSettings: {url: yr,type: "GET",isLocal: _r.test(gr[1]),global: !0,processData: !0,async: !0,contentType: "application/x-www-form-urlencoded; charset=UTF-8",accepts: {"*": wr,text: "text/plain",html: "text/html",xml: "application/xml, text/xml",json: "application/json, text/javascript"},contents: {xml: /xml/,html: /html/,json: /json/},responseFields: {xml: "responseXML",text: "responseText",json: "responseJSON"},converters: {"* text": String,"text html": !0,"text json": it.parseJSON,"text xml": it.parseXML},flatOptions: {url: !0,context: !0}},ajaxSetup: function(e, t) {
return t ? V(V(e, it.ajaxSettings), t) : V(it.ajaxSettings, e)
},ajaxPrefilter: F(Ar),ajaxTransport: F(Tr),ajax: function(e, t) {
function r(e, t, r, o) {
var u, c, m, v, _, C = t;
2 !== b && (b = 2, s && clearTimeout(s), n = void 0, a = o || "", E.readyState = e > 0 ? 4 : 0, u = e >= 200 && 300 > e || 304 === e, r && (v = H(p, E, r)), v = q(p, v, E, u), u ? (p.ifModified && (_ = E.getResponseHeader("Last-Modified"), _ && (it.lastModified[i] = _), _ = E.getResponseHeader("etag"), _ && (it.etag[i] = _)), 204 === e || "HEAD" === p.type ? C = "nocontent" : 304 === e ? C = "notmodified" : (C = v.state, c = v.data, m = v.error, u = !m)) : (m = C, (e || !C) && (C = "error", 0 > e && (e = 0))), E.status = e, E.statusText = (t || C) + "", u ? h.resolveWith(f, [c, C, E]) : h.rejectWith(f, [E, C, m]), E.statusCode(y), y = void 0, l && d.trigger(u ? "ajaxSuccess" : "ajaxError", [E, p, u ? c : m]), g.fireWith(f, [E, C]), l && (d.trigger("ajaxComplete", [E, p]), --it.active || it.event.trigger("ajaxStop")))
}
"object" == typeof e && (t = e, e = void 0), t = t || {};
var n, i, a, o, s, u, l, c, p = it.ajaxSetup({}, t), f = p.context || p, d = p.context && (f.nodeType || f.jquery) ? it(f) : it.event, h = it.Deferred(), g = it.Callbacks("once memory"), y = p.statusCode || {}, m = {}, v = {}, b = 0, _ = "canceled", E = {readyState: 0,getResponseHeader: function(e) {
var t;
if (2 === b) {
if (!o)
for (o = {}; t = br.exec(a); )
o[t[1].toLowerCase()] = t[2];
t = o[e.toLowerCase()]
}
return null == t ? null : t
},getAllResponseHeaders: function() {
return 2 === b ? a : null
},setRequestHeader: function(e, t) {
var r = e.toLowerCase();
return b || (e = v[r] = v[r] || e, m[e] = t), this
},overrideMimeType: function(e) {
return b || (p.mimeType = e), this
},statusCode: function(e) {
var t;
if (e)
if (2 > b)
for (t in e)
y[t] = [y[t], e[t]];
else
E.always(e[E.status]);
return this
},abort: function(e) {
var t = e || _;
return n && n.abort(t), r(0, t), this
}};
if (h.promise(E).complete = g.add, E.success = E.done, E.error = E.fail, p.url = ((e || p.url || yr) + "").replace(mr, "").replace(Cr, gr[1] + "//"), p.type = t.method || t.type || p.method || p.type, p.dataTypes = it.trim(p.dataType || "*").toLowerCase().match(mt) || [""], null == p.crossDomain && (u = Sr.exec(p.url.toLowerCase()), p.crossDomain = !(!u || u[1] === gr[1] && u[2] === gr[2] && (u[3] || ("http:" === u[1] ? "80" : "443")) === (gr[3] || ("http:" === gr[1] ? "80" : "443")))), p.data && p.processData && "string" != typeof p.data && (p.data = it.param(p.data, p.traditional)), j(Ar, p, t, E), 2 === b)
return E;
l = p.global, l && 0 === it.active++ && it.event.trigger("ajaxStart"), p.type = p.type.toUpperCase(), p.hasContent = !Er.test(p.type), i = p.url, p.hasContent || (p.data && (i = p.url += (hr.test(i) ? "&" : "?") + p.data, delete p.data), p.cache === !1 && (p.url = vr.test(i) ? i.replace(vr, "$1_=" + dr++) : i + (hr.test(i) ? "&" : "?") + "_=" + dr++)), p.ifModified && (it.lastModified[i] && E.setRequestHeader("If-Modified-Since", it.lastModified[i]), it.etag[i] && E.setRequestHeader("If-None-Match", it.etag[i])), (p.data && p.hasContent && p.contentType !== !1 || t.contentType) && E.setRequestHeader("Content-Type", p.contentType), E.setRequestHeader("Accept", p.dataTypes[0] && p.accepts[p.dataTypes[0]] ? p.accepts[p.dataTypes[0]] + ("*" !== p.dataTypes[0] ? ", " + wr + "; q=0.01" : "") : p.accepts["*"]);
for (c in p.headers)
E.setRequestHeader(c, p.headers[c]);
if (p.beforeSend && (p.beforeSend.call(f, E, p) === !1 || 2 === b))
return E.abort();
_ = "abort";
for (c in {success: 1,error: 1,complete: 1})
E[c](p[c]);
if (n = j(Tr, p, t, E)) {
E.readyState = 1, l && d.trigger("ajaxSend", [E, p]), p.async && p.timeout > 0 && (s = setTimeout(function() {
E.abort("timeout")
}, p.timeout));
try {
b = 1, n.send(m, r)
} catch (C) {
if (!(2 > b))
throw C;
r(-1, C)
}
} else
r(-1, "No Transport");
return E
},getJSON: function(e, t, r) {
return it.get(e, t, r, "json")
},getScript: function(e, t) {
return it.get(e, void 0, t, "script")
}}), it.each(["get", "post"], function(e, t) {
it[t] = function(e, r, n, i) {
return it.isFunction(r) && (i = i || n, n = r, r = void 0), it.ajax({url: e,type: t,dataType: i,data: r,success: n})
}
}), it.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(e, t) {
it.fn[t] = function(e) {
return this.on(t, e)
}
}), it._evalUrl = function(e) {
return it.ajax({url: e,type: "GET",dataType: "script",async: !1,global: !1,"throws": !0})
}, it.fn.extend({wrapAll: function(e) {
var t;
return it.isFunction(e) ? this.each(function(t) {
it(this).wrapAll(e.call(this, t))
}) : (this[0] && (t = it(e, this[0].ownerDocument).eq(0).clone(!0), this[0].parentNode && t.insertBefore(this[0]), t.map(function() {
for (var e = this; e.firstElementChild; )
e = e.firstElementChild;
return e
}).append(this)), this)
},wrapInner: function(e) {
return this.each(it.isFunction(e) ? function(t) {
it(this).wrapInner(e.call(this, t))
} : function() {
var t = it(this), r = t.contents();
r.length ? r.wrapAll(e) : t.append(e)
})
},wrap: function(e) {
var t = it.isFunction(e);
return this.each(function(r) {
it(this).wrapAll(t ? e.call(this, r) : e)
})
},unwrap: function() {
return this.parent().each(function() {
it.nodeName(this, "body") || it(this).replaceWith(this.childNodes)
}).end()
}}), it.expr.filters.hidden = function(e) {
return e.offsetWidth <= 0 && e.offsetHeight <= 0
}, it.expr.filters.visible = function(e) {
return !it.expr.filters.hidden(e)
};
var Ir = /%20/g, xr = /\[\]$/, Dr = /\r?\n/g, Nr = /^(?:submit|button|image|reset|file)$/i, Br = /^(?:input|select|textarea|keygen)/i;
it.param = function(e, t) {
var r, n = [], i = function(e, t) {
t = it.isFunction(t) ? t() : null == t ? "" : t, n[n.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
};
if (void 0 === t && (t = it.ajaxSettings && it.ajaxSettings.traditional), it.isArray(e) || e.jquery && !it.isPlainObject(e))
it.each(e, function() {
i(this.name, this.value)
});
else
for (r in e)
K(r, e[r], t, i);
return n.join("&").replace(Ir, "+")
}, it.fn.extend({serialize: function() {
return it.param(this.serializeArray())
},serializeArray: function() {
return this.map(function() {
var e = it.prop(this, "elements");
return e ? it.makeArray(e) : this
}).filter(function() {
var e = this.type;
return this.name && !it(this).is(":disabled") && Br.test(this.nodeName) && !Nr.test(e) && (this.checked || !It.test(e))
}).map(function(e, t) {
var r = it(this).val();
return null == r ? null : it.isArray(r) ? it.map(r, function(e) {
return {name: t.name,value: e.replace(Dr, "\r\n")}
}) : {name: t.name,value: r.replace(Dr, "\r\n")}
}).get()
}}), it.ajaxSettings.xhr = function() {
try {
return new XMLHttpRequest
} catch (e) {
}
};
var Lr = 0, Rr = {}, Pr = {0: 200,1223: 204}, Or = it.ajaxSettings.xhr();
i.ActiveXObject && it(i).on("unload", function() {
for (var e in Rr)
Rr[e]()
}), tt.cors = !!Or && "withCredentials" in Or, tt.ajax = Or = !!Or, it.ajaxTransport(function(e) {
var t;
return tt.cors || Or && !e.crossDomain ? {send: function(r, n) {
var i, a = e.xhr(), o = ++Lr;
if (a.open(e.type, e.url, e.async, e.username, e.password), e.xhrFields)
for (i in e.xhrFields)
a[i] = e.xhrFields[i];
e.mimeType && a.overrideMimeType && a.overrideMimeType(e.mimeType), e.crossDomain || r["X-Requested-With"] || (r["X-Requested-With"] = "XMLHttpRequest");
for (i in r)
a.setRequestHeader(i, r[i]);
t = function(e) {
return function() {
t && (delete Rr[o], t = a.onload = a.onerror = null, "abort" === e ? a.abort() : "error" === e ? n(a.status, a.statusText) : n(Pr[a.status] || a.status, a.statusText, "string" == typeof a.responseText ? {text: a.responseText} : void 0, a.getAllResponseHeaders()))
}
}, a.onload = t(), a.onerror = t("error"), t = Rr[o] = t("abort"), a.send(e.hasContent && e.data || null)
},abort: function() {
t && t()
}} : void 0
}), it.ajaxSetup({accepts: {script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents: {script: /(?:java|ecma)script/},converters: {"text script": function(e) {
return it.globalEval(e), e
}}}), it.ajaxPrefilter("script", function(e) {
void 0 === e.cache && (e.cache = !1), e.crossDomain && (e.type = "GET")
}), it.ajaxTransport("script", function(e) {
if (e.crossDomain) {
var t, r;
return {send: function(n, i) {
t = it("<script>").prop({async: !0,charset: e.scriptCharset,src: e.url}).on("load error", r = function(e) {
t.remove(), r = null, e && i("error" === e.type ? 404 : 200, e.type)
}), rt.head.appendChild(t[0])
},abort: function() {
r && r()
}}
}
});
var Ur = [], Mr = /(=)\?(?=&|$)|\?\?/;
it.ajaxSetup({jsonp: "callback",jsonpCallback: function() {
var e = Ur.pop() || it.expando + "_" + dr++;
return this[e] = !0, e
}}), it.ajaxPrefilter("json jsonp", function(e, t, r) {
var n, a, o, s = e.jsonp !== !1 && (Mr.test(e.url) ? "url" : "string" == typeof e.data && !(e.contentType || "").indexOf("application/x-www-form-urlencoded") && Mr.test(e.data) && "data");
return s || "jsonp" === e.dataTypes[0] ? (n = e.jsonpCallback = it.isFunction(e.jsonpCallback) ? e.jsonpCallback() : e.jsonpCallback, s ? e[s] = e[s].replace(Mr, "$1" + n) : e.jsonp !== !1 && (e.url += (hr.test(e.url) ? "&" : "?") + e.jsonp + "=" + n), e.converters["script json"] = function() {
return o || it.error(n + " was not called"), o[0]
}, e.dataTypes[0] = "json", a = i[n], i[n] = function() {
o = arguments
}, r.always(function() {
i[n] = a, e[n] && (e.jsonpCallback = t.jsonpCallback, Ur.push(n)), o && it.isFunction(a) && a(o[0]), o = a = void 0
}), "script") : void 0
}), it.parseHTML = function(e, t, r) {
if (!e || "string" != typeof e)
return null;
"boolean" == typeof t && (r = t, t = !1), t = t || rt;
var n = ct.exec(e), i = !r && [];
return n ? [t.createElement(n[1])] : (n = it.buildFragment([e], t, i), i && i.length && it(i).remove(), it.merge([], n.childNodes))
};
var Fr = it.fn.load;
it.fn.load = function(e, t, r) {
if ("string" != typeof e && Fr)
return Fr.apply(this, arguments);
var n, i, a, o = this, s = e.indexOf(" ");
return s >= 0 && (n = e.slice(s), e = e.slice(0, s)), it.isFunction(t) ? (r = t, t = void 0) : t && "object" == typeof t && (i = "POST"), o.length > 0 && it.ajax({url: e,type: i,dataType: "html",data: t}).done(function(e) {
a = arguments, o.html(n ? it("<div>").append(it.parseHTML(e)).find(n) : e)
}).complete(r && function(e, t) {
o.each(r, a || [e.responseText, t, e])
}), this
}, it.expr.filters.animated = function(e) {
return it.grep(it.timers, function(t) {
return e === t.elem
}).length
};
var jr = i.document.documentElement;
it.offset = {setOffset: function(e, t, r) {
var n, i, a, o, s, u, l, c = it.css(e, "position"), p = it(e), f = {};
"static" === c && (e.style.position = "relative"), s = p.offset(), a = it.css(e, "top"), u = it.css(e, "left"), l = ("absolute" === c || "fixed" === c) && (a + u).indexOf("auto") > -1, l ? (n = p.position(), o = n.top, i = n.left) : (o = parseFloat(a) || 0, i = parseFloat(u) || 0), it.isFunction(t) && (t = t.call(e, r, s)), null != t.top && (f.top = t.top - s.top + o), null != t.left && (f.left = t.left - s.left + i), "using" in t ? t.using.call(e, f) : p.css(f)
}}, it.fn.extend({offset: function(e) {
if (arguments.length)
return void 0 === e ? this : this.each(function(t) {
it.offset.setOffset(this, e, t)
});
var t, r, n = this[0], i = {top: 0,left: 0}, a = n && n.ownerDocument;
if (a)
return t = a.documentElement, it.contains(t, n) ? (typeof n.getBoundingClientRect !== xt && (i = n.getBoundingClientRect()), r = G(a), {top: i.top + r.pageYOffset - t.clientTop,left: i.left + r.pageXOffset - t.clientLeft}) : i
},position: function() {
if (this[0]) {
var e, t, r = this[0], n = {top: 0,left: 0};
return "fixed" === it.css(r, "position") ? t = r.getBoundingClientRect() : (e = this.offsetParent(), t = this.offset(), it.nodeName(e[0], "html") || (n = e.offset()), n.top += it.css(e[0], "borderTopWidth", !0), n.left += it.css(e[0], "borderLeftWidth", !0)), {top: t.top - n.top - it.css(r, "marginTop", !0),left: t.left - n.left - it.css(r, "marginLeft", !0)}
}
},offsetParent: function() {
return this.map(function() {
for (var e = this.offsetParent || jr; e && !it.nodeName(e, "html") && "static" === it.css(e, "position"); )
e = e.offsetParent;
return e || jr
})
}}), it.each({scrollLeft: "pageXOffset",scrollTop: "pageYOffset"}, function(e, t) {
var r = "pageYOffset" === t;
it.fn[e] = function(n) {
return _t(this, function(e, n, a) {
var o = G(e);
return void 0 === a ? o ? o[t] : e[n] : void (o ? o.scrollTo(r ? i.pageXOffset : a, r ? a : i.pageYOffset) : e[n] = a)
}, e, n, arguments.length, null)
}
}), it.each(["top", "left"], function(e, t) {
it.cssHooks[t] = w(tt.pixelPosition, function(e, r) {
return r ? (r = T(e, t), Yt.test(r) ? it(e).position()[t] + "px" : r) : void 0
})
}), it.each({Height: "height",Width: "width"}, function(e, t) {
it.each({padding: "inner" + e,content: t,"": "outer" + e}, function(r, n) {
it.fn[n] = function(n, i) {
var a = arguments.length && (r || "boolean" != typeof n), o = r || (n === !0 || i === !0 ? "margin" : "border");
return _t(this, function(t, r, n) {
var i;
return it.isWindow(t) ? t.document.documentElement["client" + e] : 9 === t.nodeType ? (i = t.documentElement, Math.max(t.body["scroll" + e], i["scroll" + e], t.body["offset" + e], i["offset" + e], i["client" + e])) : void 0 === n ? it.css(t, r, o) : it.style(t, r, n, o)
}, t, a ? n : void 0, a, null)
}
})
}), it.fn.size = function() {
return this.length
}, it.fn.andSelf = it.fn.addBack, r = [], n = function() {
return it
}.apply(t, r), !(void 0 !== n && (e.exports = n));
var Vr = i.jQuery, Hr = i.$;
return it.noConflict = function(e) {
return i.$ === it && (i.$ = Hr), e && i.jQuery === it && (i.jQuery = Vr), it
}, typeof a === xt && (i.jQuery = i.$ = it), it
})
}, function(e) { /*!
handlebars v1.3.0
Copyright (C) 2011 by Yehuda Katz
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@license
*/
var t = function() {
var e = function() {
"use strict";
function e(e) {
this.string = e
}
var t;
return e.prototype.toString = function() {
return "" + this.string
}, t = e
}(), t = function(e) {
"use strict";
function t(e) {
return s[e] || "&amp;"
}
function r(e, t) {
for (var r in t)
Object.prototype.hasOwnProperty.call(t, r) && (e[r] = t[r])
}
function n(e) {
return e instanceof o ? e.toString() : e || 0 === e ? (e = "" + e, l.test(e) ? e.replace(u, t) : e) : ""
}
function i(e) {
return e || 0 === e ? f(e) && 0 === e.length ? !0 : !1 : !0
}
var a = {}, o = e, s = {"&": "&amp;","<": "&lt;",">": "&gt;",'"': "&quot;","'": "&#x27;","`": "&#x60;"}, u = /[&<>"'`]/g, l = /[&<>"'`]/;
a.extend = r;
var c = Object.prototype.toString;
a.toString = c;
var p = function(e) {
return "function" == typeof e
};
p(/x/) && (p = function(e) {
return "function" == typeof e && "[object Function]" === c.call(e)
});
var p;
a.isFunction = p;
var f = Array.isArray || function(e) {
return e && "object" == typeof e ? "[object Array]" === c.call(e) : !1
};
return a.isArray = f, a.escapeExpression = n, a.isEmpty = i, a
}(e), r = function() {
"use strict";
function e(e, t) {
var n;
t && t.firstLine && (n = t.firstLine, e += " - " + n + ":" + t.firstColumn);
for (var i = Error.prototype.constructor.call(this, e), a = 0; a < r.length; a++)
this[r[a]] = i[r[a]];
n && (this.lineNumber = n, this.column = t.firstColumn)
}
var t, r = ["description", "fileName", "lineNumber", "message", "name", "number", "stack"];
return e.prototype = new Error, t = e
}(), n = function(e, t) {
"use strict";
function r(e, t) {
this.helpers = e || {}, this.partials = t || {}, n(this)
}
function n(e) {
e.registerHelper("helperMissing", function(e) {
if (2 === arguments.length)
return void 0;
throw new s("Missing helper: '" + e + "'")
}), e.registerHelper("blockHelperMissing", function(t, r) {
var n = r.inverse || function() {
}, i = r.fn;
return f(t) && (t = t.call(this)), t === !0 ? i(this) : t === !1 || null == t ? n(this) : p(t) ? t.length > 0 ? e.helpers.each(t, r) : n(this) : i(t)
}), e.registerHelper("each", function(e, t) {
var r, n = t.fn, i = t.inverse, a = 0, o = "";
if (f(e) && (e = e.call(this)), t.data && (r = y(t.data)), e && "object" == typeof e)
if (p(e))
for (var s = e.length; s > a; a++)
r && (r.index = a, r.first = 0 === a, r.last = a === e.length - 1), o += n(e[a], {data: r});
else
for (var u in e)
e.hasOwnProperty(u) && (r && (r.key = u, r.index = a, r.first = 0 === a), o += n(e[u], {data: r}), a++);
return 0 === a && (o = i(this)), o
}), e.registerHelper("if", function(e, t) {
return f(e) && (e = e.call(this)), !t.hash.includeZero && !e || o.isEmpty(e) ? t.inverse(this) : t.fn(this)
}), e.registerHelper("unless", function(t, r) {
return e.helpers["if"].call(this, t, {fn: r.inverse,inverse: r.fn,hash: r.hash})
}), e.registerHelper("with", function(e, t) {
return f(e) && (e = e.call(this)), o.isEmpty(e) ? void 0 : t.fn(e)
}), e.registerHelper("log", function(t, r) {
var n = r.data && null != r.data.level ? parseInt(r.data.level, 10) : 1;
e.log(n, t)
})
}
function i(e, t) {
g.log(e, t)
}
var a = {}, o = e, s = t, u = "1.3.0";
a.VERSION = u;
var l = 4;
a.COMPILER_REVISION = l;
var c = {1: "<= 1.0.rc.2",2: "== 1.0.0-rc.3",3: "== 1.0.0-rc.4",4: ">= 1.0.0"};
a.REVISION_CHANGES = c;
var p = o.isArray, f = o.isFunction, d = o.toString, h = "[object Object]";
a.HandlebarsEnvironment = r, r.prototype = {constructor: r,logger: g,log: i,registerHelper: function(e, t, r) {
if (d.call(e) === h) {
if (r || t)
throw new s("Arg not supported with multiple helpers");
o.extend(this.helpers, e)
} else
r && (t.not = r), this.helpers[e] = t
},registerPartial: function(e, t) {
d.call(e) === h ? o.extend(this.partials, e) : this.partials[e] = t
}};
var g = {methodMap: {0: "debug",1: "info",2: "warn",3: "error"},DEBUG: 0,INFO: 1,WARN: 2,ERROR: 3,level: 3,log: function(e, t) {
if (g.level <= e) {
var r = g.methodMap[e];
"undefined" != typeof console && console[r] && console[r].call(console, t)
}
}};
a.logger = g, a.log = i;
var y = function(e) {
var t = {};
return o.extend(t, e), t
};
return a.createFrame = y, a
}(t, r), i = function(e, t, r) {
"use strict";
function n(e) {
var t = e && e[0] || 1, r = f;
if (t !== r) {
if (r > t) {
var n = d[r], i = d[t];
throw new p("Template was precompiled with an older version of Handlebars than the current runtime. Please update your precompiler to a newer version (" + n + ") or downgrade your runtime to an older version (" + i + ").")
}
throw new p("Template was precompiled with a newer version of Handlebars than the current runtime. Please update your runtime to a newer version (" + e[1] + ").")
}
}
function i(e, t) {
if (!t)
throw new p("No environment passed to template");
var r = function(e, r, n, i, a, o) {
var s = t.VM.invokePartial.apply(this, arguments);
if (null != s)
return s;
if (t.compile) {
var u = {helpers: i,partials: a,data: o};
return a[r] = t.compile(e, {data: void 0 !== o}, t), a[r](n, u)
}
throw new p("The partial " + r + " could not be compiled when running in runtime-only mode")
}, n = {escapeExpression: c.escapeExpression,invokePartial: r,programs: [],program: function(e, t, r) {
var n = this.programs[e];
return r ? n = o(e, t, r) : n || (n = this.programs[e] = o(e, t)), n
},merge: function(e, t) {
var r = e || t;
return e && t && e !== t && (r = {}, c.extend(r, t), c.extend(r, e)), r
},programWithDepth: t.VM.programWithDepth,noop: t.VM.noop,compilerInfo: null};
return function(r, i) {
i = i || {};
var a, o, s = i.partial ? i : t;
i.partial || (a = i.helpers, o = i.partials);
var u = e.call(n, s, r, a, o, i.data);
return i.partial || t.VM.checkRevision(n.compilerInfo), u
}
}
function a(e, t, r) {
var n = Array.prototype.slice.call(arguments, 3), i = function(e, i) {
return i = i || {}, t.apply(this, [e, i.data || r].concat(n))
};
return i.program = e, i.depth = n.length, i
}
function o(e, t, r) {
var n = function(e, n) {
return n = n || {}, t(e, n.data || r)
};
return n.program = e, n.depth = 0, n
}
function s(e, t, r, n, i, a) {
var o = {partial: !0,helpers: n,partials: i,data: a};
if (void 0 === e)
throw new p("The partial " + t + " could not be found");
return e instanceof Function ? e(r, o) : void 0
}
function u() {
return ""
}
var l = {}, c = e, p = t, f = r.COMPILER_REVISION, d = r.REVISION_CHANGES;
return l.checkRevision = n, l.template = i, l.programWithDepth = a, l.program = o, l.invokePartial = s, l.noop = u, l
}(t, r, n), a = function(e, t, r, n, i) {
"use strict";
var a, o = e, s = t, u = r, l = n, c = i, p = function() {
var e = new o.HandlebarsEnvironment;
return l.extend(e, o), e.SafeString = s, e.Exception = u, e.Utils = l, e.VM = c, e.template = function(t) {
return c.template(t, e)
}, e
}, f = p();
return f.create = p, a = f
}(n, e, r, t, i);
return a
}();
e.exports = t
}, function(e, t) {
var r, n;
(function() {
var i = this, a = i._, o = Array.prototype, s = Object.prototype, u = Function.prototype, l = o.push, c = o.slice, p = o.concat, f = s.toString, d = s.hasOwnProperty, h = Array.isArray, g = Object.keys, y = u.bind, m = function(e) {
return e instanceof m ? e : this instanceof m ? void (this._wrapped = e) : new m(e)
};
"undefined" != typeof e && e.exports && (t = e.exports = m), t._ = m, m.VERSION = "1.7.0";
var v = function(e, t, r) {
if (void 0 === t)
return e;
switch (null == r ? 3 : r) {
case 1:
return function(r) {
return e.call(t, r)
};
case 2:
return function(r, n) {
return e.call(t, r, n)
};
case 3:
return function(r, n, i) {
return e.call(t, r, n, i)
};
case 4:
return function(r, n, i, a) {
return e.call(t, r, n, i, a)
}
}
return function() {
return e.apply(t, arguments)
}
};
m.iteratee = function(e, t, r) {
return null == e ? m.identity : m.isFunction(e) ? v(e, t, r) : m.isObject(e) ? m.matches(e) : m.property(e)
}, m.each = m.forEach = function(e, t, r) {
if (null == e)
return e;
t = v(t, r);
var n, i = e.length;
if (i === +i)
for (n = 0; i > n; n++)
t(e[n], n, e);
else {
var a = m.keys(e);
for (n = 0, i = a.length; i > n; n++)
t(e[a[n]], a[n], e)
}
return e
}, m.map = m.collect = function(e, t, r) {
if (null == e)
return [];
t = m.iteratee(t, r);
for (var n, i = e.length !== +e.length && m.keys(e), a = (i || e).length, o = Array(a), s = 0; a > s; s++)
n = i ? i[s] : s, o[s] = t(e[n], n, e);
return o
};
var b = "Reduce of empty array with no initial value";
m.reduce = m.foldl = m.inject = function(e, t, r, n) {
null == e && (e = []), t = v(t, n, 4);
var i, a = e.length !== +e.length && m.keys(e), o = (a || e).length, s = 0;
if (arguments.length < 3) {
if (!o)
throw new TypeError(b);
r = e[a ? a[s++] : s++]
}
for (; o > s; s++)
i = a ? a[s] : s, r = t(r, e[i], i, e);
return r
}, m.reduceRight = m.foldr = function(e, t, r, n) {
null == e && (e = []), t = v(t, n, 4);
var i, a = e.length !== +e.length && m.keys(e), o = (a || e).length;
if (arguments.length < 3) {
if (!o)
throw new TypeError(b);
r = e[a ? a[--o] : --o]
}
for (; o--; )
i = a ? a[o] : o, r = t(r, e[i], i, e);
return r
}, m.find = m.detect = function(e, t, r) {
var n;
return t = m.iteratee(t, r), m.some(e, function(e, r, i) {
return t(e, r, i) ? (n = e, !0) : void 0
}), n
}, m.filter = m.select = function(e, t, r) {
var n = [];
return null == e ? n : (t = m.iteratee(t, r), m.each(e, function(e, r, i) {
t(e, r, i) && n.push(e)
}), n)
}, m.reject = function(e, t, r) {
return m.filter(e, m.negate(m.iteratee(t)), r)
}, m.every = m.all = function(e, t, r) {
if (null == e)
return !0;
t = m.iteratee(t, r);
var n, i, a = e.length !== +e.length && m.keys(e), o = (a || e).length;
for (n = 0; o > n; n++)
if (i = a ? a[n] : n, !t(e[i], i, e))
return !1;
return !0
}, m.some = m.any = function(e, t, r) {
if (null == e)
return !1;
t = m.iteratee(t, r);
var n, i, a = e.length !== +e.length && m.keys(e), o = (a || e).length;
for (n = 0; o > n; n++)
if (i = a ? a[n] : n, t(e[i], i, e))
return !0;
return !1
}, m.contains = m.include = function(e, t) {
return null == e ? !1 : (e.length !== +e.length && (e = m.values(e)), m.indexOf(e, t) >= 0)
}, m.invoke = function(e, t) {
var r = c.call(arguments, 2), n = m.isFunction(t);
return m.map(e, function(e) {
return (n ? t : e[t]).apply(e, r)
})
}, m.pluck = function(e, t) {
return m.map(e, m.property(t))
}, m.where = function(e, t) {
return m.filter(e, m.matches(t))
}, m.findWhere = function(e, t) {
return m.find(e, m.matches(t))
}, m.max = function(e, t, r) {
var n, i, a = -1 / 0, o = -1 / 0;
if (null == t && null != e) {
e = e.length === +e.length ? e : m.values(e);
for (var s = 0, u = e.length; u > s; s++)
n = e[s], n > a && (a = n)
} else
t = m.iteratee(t, r), m.each(e, function(e, r, n) {
i = t(e, r, n), (i > o || i === -1 / 0 && a === -1 / 0) && (a = e, o = i)
});
return a
}, m.min = function(e, t, r) {
var n, i, a = 1 / 0, o = 1 / 0;
if (null == t && null != e) {
e = e.length === +e.length ? e : m.values(e);
for (var s = 0, u = e.length; u > s; s++)
n = e[s], a > n && (a = n)
} else
t = m.iteratee(t, r), m.each(e, function(e, r, n) {
i = t(e, r, n), (o > i || 1 / 0 === i && 1 / 0 === a) && (a = e, o = i)
});
return a
}, m.shuffle = function(e) {
for (var t, r = e && e.length === +e.length ? e : m.values(e), n = r.length, i = Array(n), a = 0; n > a; a++)
t = m.random(0, a), t !== a && (i[a] = i[t]), i[t] = r[a];
return i
}, m.sample = function(e, t, r) {
return null == t || r ? (e.length !== +e.length && (e = m.values(e)), e[m.random(e.length - 1)]) : m.shuffle(e).slice(0, Math.max(0, t))
}, m.sortBy = function(e, t, r) {
return t = m.iteratee(t, r), m.pluck(m.map(e, function(e, r, n) {
return {value: e,index: r,criteria: t(e, r, n)}
}).sort(function(e, t) {
var r = e.criteria, n = t.criteria;
if (r !== n) {
if (r > n || void 0 === r)
return 1;
if (n > r || void 0 === n)
return -1
}
return e.index - t.index
}), "value")
};
var _ = function(e) {
return function(t, r, n) {
var i = {};
return r = m.iteratee(r, n), m.each(t, function(n, a) {
var o = r(n, a, t);
e(i, n, o)
}), i
}
};
m.groupBy = _(function(e, t, r) {
m.has(e, r) ? e[r].push(t) : e[r] = [t]
}), m.indexBy = _(function(e, t, r) {
e[r] = t
}), m.countBy = _(function(e, t, r) {
m.has(e, r) ? e[r]++ : e[r] = 1
}), m.sortedIndex = function(e, t, r, n) {
r = m.iteratee(r, n, 1);
for (var i = r(t), a = 0, o = e.length; o > a; ) {
var s = a + o >>> 1;
r(e[s]) < i ? a = s + 1 : o = s
}
return a
}, m.toArray = function(e) {
return e ? m.isArray(e) ? c.call(e) : e.length === +e.length ? m.map(e, m.identity) : m.values(e) : []
}, m.size = function(e) {
return null == e ? 0 : e.length === +e.length ? e.length : m.keys(e).length
}, m.partition = function(e, t, r) {
t = m.iteratee(t, r);
var n = [], i = [];
return m.each(e, function(e, r, a) {
(t(e, r, a) ? n : i).push(e)
}), [n, i]
}, m.first = m.head = m.take = function(e, t, r) {
return null == e ? void 0 : null == t || r ? e[0] : 0 > t ? [] : c.call(e, 0, t)
}, m.initial = function(e, t, r) {
return c.call(e, 0, Math.max(0, e.length - (null == t || r ? 1 : t)))
}, m.last = function(e, t, r) {
return null == e ? void 0 : null == t || r ? e[e.length - 1] : c.call(e, Math.max(e.length - t, 0))
}, m.rest = m.tail = m.drop = function(e, t, r) {
return c.call(e, null == t || r ? 1 : t)
}, m.compact = function(e) {
return m.filter(e, m.identity)
};
var E = function(e, t, r, n) {
if (t && m.every(e, m.isArray))
return p.apply(n, e);
for (var i = 0, a = e.length; a > i; i++) {
var o = e[i];
m.isArray(o) || m.isArguments(o) ? t ? l.apply(n, o) : E(o, t, r, n) : r || n.push(o)
}
return n
};
m.flatten = function(e, t) {
return E(e, t, !1, [])
}, m.without = function(e) {
return m.difference(e, c.call(arguments, 1))
}, m.uniq = m.unique = function(e, t, r, n) {
if (null == e)
return [];
m.isBoolean(t) || (n = r, r = t, t = !1), null != r && (r = m.iteratee(r, n));
for (var i = [], a = [], o = 0, s = e.length; s > o; o++) {
var u = e[o];
if (t)
o && a === u || i.push(u), a = u;
else if (r) {
var l = r(u, o, e);
m.indexOf(a, l) < 0 && (a.push(l), i.push(u))
} else
m.indexOf(i, u) < 0 && i.push(u)
}
return i
}, m.union = function() {
return m.uniq(E(arguments, !0, !0, []))
}, m.intersection = function(e) {
if (null == e)
return [];
for (var t = [], r = arguments.length, n = 0, i = e.length; i > n; n++) {
var a = e[n];
if (!m.contains(t, a)) {
for (var o = 1; r > o && m.contains(arguments[o], a); o++)
;
o === r && t.push(a)
}
}
return t
}, m.difference = function(e) {
var t = E(c.call(arguments, 1), !0, !0, []);
return m.filter(e, function(e) {
return !m.contains(t, e)
})
}, m.zip = function(e) {
if (null == e)
return [];
for (var t = m.max(arguments, "length").length, r = Array(t), n = 0; t > n; n++)
r[n] = m.pluck(arguments, n);
return r
}, m.object = function(e, t) {
if (null == e)
return {};
for (var r = {}, n = 0, i = e.length; i > n; n++)
t ? r[e[n]] = t[n] : r[e[n][0]] = e[n][1];
return r
}, m.indexOf = function(e, t, r) {
if (null == e)
return -1;
var n = 0, i = e.length;
if (r) {
if ("number" != typeof r)
return n = m.sortedIndex(e, t), e[n] === t ? n : -1;
n = 0 > r ? Math.max(0, i + r) : r
}
for (; i > n; n++)
if (e[n] === t)
return n;
return -1
}, m.lastIndexOf = function(e, t, r) {
if (null == e)
return -1;
var n = e.length;
for ("number" == typeof r && (n = 0 > r ? n + r + 1 : Math.min(n, r + 1)); --n >= 0; )
if (e[n] === t)
return n;
return -1
}, m.range = function(e, t, r) {
arguments.length <= 1 && (t = e || 0, e = 0), r = r || 1;
for (var n = Math.max(Math.ceil((t - e) / r), 0), i = Array(n), a = 0; n > a; a++, e += r)
i[a] = e;
return i
};
var C = function() {
};
m.bind = function(e, t) {
var r, n;
if (y && e.bind === y)
return y.apply(e, c.call(arguments, 1));
if (!m.isFunction(e))
throw new TypeError("Bind must be called on a function");
return r = c.call(arguments, 2), n = function() {
if (!(this instanceof n))
return e.apply(t, r.concat(c.call(arguments)));
C.prototype = e.prototype;
var i = new C;
C.prototype = null;
var a = e.apply(i, r.concat(c.call(arguments)));
return m.isObject(a) ? a : i
}
}, m.partial = function(e) {
var t = c.call(arguments, 1);
return function() {
for (var r = 0, n = t.slice(), i = 0, a = n.length; a > i; i++)
n[i] === m && (n[i] = arguments[r++]);
for (; r < arguments.length; )
n.push(arguments[r++]);
return e.apply(this, n)
}
}, m.bindAll = function(e) {
var t, r, n = arguments.length;
if (1 >= n)
throw new Error("bindAll must be passed function names");
for (t = 1; n > t; t++)
r = arguments[t], e[r] = m.bind(e[r], e);
return e
}, m.memoize = function(e, t) {
var r = function(n) {
var i = r.cache, a = t ? t.apply(this, arguments) : n;
return m.has(i, a) || (i[a] = e.apply(this, arguments)), i[a]
};
return r.cache = {}, r
}, m.delay = function(e, t) {
var r = c.call(arguments, 2);
return setTimeout(function() {
return e.apply(null, r)
}, t)
}, m.defer = function(e) {
return m.delay.apply(m, [e, 1].concat(c.call(arguments, 1)))
}, m.throttle = function(e, t, r) {
var n, i, a, o = null, s = 0;
r || (r = {});
var u = function() {
s = r.leading === !1 ? 0 : m.now(), o = null, a = e.apply(n, i), o || (n = i = null)
};
return function() {
var l = m.now();
s || r.leading !== !1 || (s = l);
var c = t - (l - s);
return n = this, i = arguments, 0 >= c || c > t ? (clearTimeout(o), o = null, s = l, a = e.apply(n, i), o || (n = i = null)) : o || r.trailing === !1 || (o = setTimeout(u, c)), a
}
}, m.debounce = function(e, t, r) {
var n, i, a, o, s, u = function() {
var l = m.now() - o;
t > l && l > 0 ? n = setTimeout(u, t - l) : (n = null, r || (s = e.apply(a, i), n || (a = i = null)))
};
return function() {
a = this, i = arguments, o = m.now();
var l = r && !n;
return n || (n = setTimeout(u, t)), l && (s = e.apply(a, i), a = i = null), s
}
}, m.wrap = function(e, t) {
return m.partial(t, e)
}, m.negate = function(e) {
return function() {
return !e.apply(this, arguments)
}
}, m.compose = function() {
var e = arguments, t = e.length - 1;
return function() {
for (var r = t, n = e[t].apply(this, arguments); r--; )
n = e[r].call(this, n);
return n
}
}, m.after = function(e, t) {
return function() {
return --e < 1 ? t.apply(this, arguments) : void 0
}
}, m.before = function(e, t) {
var r;
return function() {
return --e > 0 ? r = t.apply(this, arguments) : t = null, r
}
}, m.once = m.partial(m.before, 2), m.keys = function(e) {
if (!m.isObject(e))
return [];
if (g)
return g(e);
var t = [];
for (var r in e)
m.has(e, r) && t.push(r);
return t
}, m.values = function(e) {
for (var t = m.keys(e), r = t.length, n = Array(r), i = 0; r > i; i++)
n[i] = e[t[i]];
return n
}, m.pairs = function(e) {
for (var t = m.keys(e), r = t.length, n = Array(r), i = 0; r > i; i++)
n[i] = [t[i], e[t[i]]];
return n
}, m.invert = function(e) {
for (var t = {}, r = m.keys(e), n = 0, i = r.length; i > n; n++)
t[e[r[n]]] = r[n];
return t
}, m.functions = m.methods = function(e) {
var t = [];
for (var r in e)
m.isFunction(e[r]) && t.push(r);
return t.sort()
}, m.extend = function(e) {
if (!m.isObject(e))
return e;
for (var t, r, n = 1, i = arguments.length; i > n; n++) {
t = arguments[n];
for (r in t)
d.call(t, r) && (e[r] = t[r])
}
return e
}, m.pick = function(e, t, r) {
var n, i = {};
if (null == e)
return i;
if (m.isFunction(t)) {
t = v(t, r);
for (n in e) {
var a = e[n];
t(a, n, e) && (i[n] = a)
}
} else {
var o = p.apply([], c.call(arguments, 1));
e = new Object(e);
for (var s = 0, u = o.length; u > s; s++)
n = o[s], n in e && (i[n] = e[n])
}
return i
}, m.omit = function(e, t, r) {
if (m.isFunction(t))
t = m.negate(t);
else {
var n = m.map(p.apply([], c.call(arguments, 1)), String);
t = function(e, t) {
return !m.contains(n, t)
}
}
return m.pick(e, t, r)
}, m.defaults = function(e) {
if (!m.isObject(e))
return e;
for (var t = 1, r = arguments.length; r > t; t++) {
var n = arguments[t];
for (var i in n)
void 0 === e[i] && (e[i] = n[i])
}
return e
}, m.clone = function(e) {
return m.isObject(e) ? m.isArray(e) ? e.slice() : m.extend({}, e) : e
}, m.tap = function(e, t) {
return t(e), e
};
var S = function(e, t, r, n) {
if (e === t)
return 0 !== e || 1 / e === 1 / t;
if (null == e || null == t)
return e === t;
e instanceof m && (e = e._wrapped), t instanceof m && (t = t._wrapped);
var i = f.call(e);
if (i !== f.call(t))
return !1;
switch (i) {
case "[object RegExp]":
case "[object String]":
return "" + e == "" + t;
case "[object Number]":
return +e !== +e ? +t !== +t : 0 === +e ? 1 / +e === 1 / t : +e === +t;
case "[object Date]":
case "[object Boolean]":
return +e === +t
}
if ("object" != typeof e || "object" != typeof t)
return !1;
for (var a = r.length; a--; )
if (r[a] === e)
return n[a] === t;
var o = e.constructor, s = t.constructor;
if (o !== s && "constructor" in e && "constructor" in t && !(m.isFunction(o) && o instanceof o && m.isFunction(s) && s instanceof s))
return !1;
r.push(e), n.push(t);
var u, l;
if ("[object Array]" === i) {
if (u = e.length, l = u === t.length)
for (; u-- && (l = S(e[u], t[u], r, n)); )
;
} else {
var c, p = m.keys(e);
if (u = p.length, l = m.keys(t).length === u)
for (; u-- && (c = p[u], l = m.has(t, c) && S(e[c], t[c], r, n)); )
;
}
return r.pop(), n.pop(), l
};
m.isEqual = function(e, t) {
return S(e, t, [], [])
}, m.isEmpty = function(e) {
if (null == e)
return !0;
if (m.isArray(e) || m.isString(e) || m.isArguments(e))
return 0 === e.length;
for (var t in e)
if (m.has(e, t))
return !1;
return !0
}, m.isElement = function(e) {
return !(!e || 1 !== e.nodeType)
}, m.isArray = h || function(e) {
return "[object Array]" === f.call(e)
}, m.isObject = function(e) {
var t = typeof e;
return "function" === t || "object" === t && !!e
}, m.each(["Arguments", "Function", "String", "Number", "Date", "RegExp"], function(e) {
m["is" + e] = function(t) {
return f.call(t) === "[object " + e + "]"
}
}), m.isArguments(arguments) || (m.isArguments = function(e) {
return m.has(e, "callee")
}), m.isFunction = function(e) {
return "function" == typeof e || !1
}, m.isFinite = function(e) {
return isFinite(e) && !isNaN(parseFloat(e))
}, m.isNaN = function(e) {
return m.isNumber(e) && e !== +e
}, m.isBoolean = function(e) {
return e === !0 || e === !1 || "[object Boolean]" === f.call(e)
}, m.isNull = function(e) {
return null === e
}, m.isUndefined = function(e) {
return void 0 === e
}, m.has = function(e, t) {
return null != e && d.call(e, t)
}, m.noConflict = function() {
return i._ = a, this
}, m.identity = function(e) {
return e
}, m.constant = function(e) {
return function() {
return e
}
}, m.noop = function() {
}, m.property = function(e) {
return function(t) {
return t[e]
}
}, m.matches = function(e) {
var t = m.pairs(e), r = t.length;
return function(e) {
if (null == e)
return !r;
e = new Object(e);
for (var n = 0; r > n; n++) {
var i = t[n], a = i[0];
if (i[1] !== e[a] || !(a in e))
return !1
}
return !0
}
}, m.times = function(e, t, r) {
var n = Array(Math.max(0, e));
t = v(t, r, 1);
for (var i = 0; e > i; i++)
n[i] = t(i);
return n
}, m.random = function(e, t) {
return null == t && (t = e, e = 0), e + Math.floor(Math.random() * (t - e + 1))
}, m.now = Date.now || function() {
return (new Date).getTime()
};
var A = {"&": "&amp;","<": "&lt;",">": "&gt;",'"': "&quot;","'": "&#x27;","`": "&#x60;"}, T = m.invert(A), w = function(e) {
var t = function(t) {
return e[t]
}, r = "(?:" + m.keys(e).join("|") + ")", n = RegExp(r), i = RegExp(r, "g");
return function(e) {
return e = null == e ? "" : "" + e, n.test(e) ? e.replace(i, t) : e
}
};
m.escape = w(A), m.unescape = w(T), m.result = function(e, t) {
if (null == e)
return void 0;
var r = e[t];
return m.isFunction(r) ? e[t]() : r
};
var k = 0;
m.uniqueId = function(e) {
var t = ++k + "";
return e ? e + t : t
}, m.templateSettings = {evaluate: /<%([\s\S]+?)%>/g,interpolate: /<%=([\s\S]+?)%>/g,escape: /<%-([\s\S]+?)%>/g};
var I = /(.)^/, x = {"'": "'","\\": "\\","\r": "r","\n": "n","\u2028": "u2028","\u2029": "u2029"}, D = /\\|'|\r|\n|\u2028|\u2029/g, N = function(e) {
return "\\" + x[e]
};
m.template = function(e, t, r) {
!t && r && (t = r), t = m.defaults({}, t, m.templateSettings);
var n = RegExp([(t.escape || I).source, (t.interpolate || I).source, (t.evaluate || I).source].join("|") + "|$", "g"), i = 0, a = "__p+='";
e.replace(n, function(t, r, n, o, s) {
return a += e.slice(i, s).replace(D, N), i = s + t.length, r ? a += "'+\n((__t=(" + r + "))==null?'':_.escape(__t))+\n'" : n ? a += "'+\n((__t=(" + n + "))==null?'':__t)+\n'" : o && (a += "';\n" + o + "\n__p+='"), t
}), a += "';\n", t.variable || (a = "with(obj||{}){\n" + a + "}\n"), a = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + a + "return __p;\n";
try {
var o = new Function(t.variable || "obj", "_", a)
} catch (s) {
throw s.source = a, s
}
var u = function(e) {
return o.call(this, e, m)
}, l = t.variable || "obj";
return u.source = "function(" + l + "){\n" + a + "}", u
}, m.chain = function(e) {
var t = m(e);
return t._chain = !0, t
};
var B = function(e) {
return this._chain ? m(e).chain() : e
};
m.mixin = function(e) {
m.each(m.functions(e), function(t) {
var r = m[t] = e[t];
m.prototype[t] = function() {
var e = [this._wrapped];
return l.apply(e, arguments), B.call(this, r.apply(m, e))
}
})
}, m.mixin(m), m.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(e) {
var t = o[e];
m.prototype[e] = function() {
var r = this._wrapped;
return t.apply(r, arguments), "shift" !== e && "splice" !== e || 0 !== r.length || delete r[0], B.call(this, r)
}
}), m.each(["concat", "join", "slice"], function(e) {
var t = o[e];
m.prototype[e] = function() {
return B.call(this, t.apply(this._wrapped, arguments))
}
}), m.prototype.value = function() {
return this._wrapped
}, r = [], n = function() {
return m
}.apply(t, r), !(void 0 !== n && (e.exports = n))
}).call(this)
}, , , , function(e, t) {
(function(t) {
!function() {
var r, n, i, a, o, s, u, l = /\b((?:https?:\/\/|www\d{0,3}\.|(?:[a-z0-9\-]+\.)+[a-z]{2,4}\/)[^\s'’"]*[^\s`!()\[\]{};:'".,<>?«»“”‘’])/gi, c = /(\b(?:[0-5]?[0-9])(?::[0-5][0-9]){1,2}\b)/g, p = /([a-z0-9._%+\-]+@[a-z0-9.\-]+\.[a-z]{2,6})/gi, f = /(\s|[^\w]|^)@([\w\-]+)/g, d = /( |^)(#([\w-]+))/gm, h = /^((?:https?:\/\/)?(?:www\.|m\.)?soundcloud\.(?:com|dev))\/?|^\//i, g = /^(?:ht|f)tps?:\/\//i, y = /(?:[ \t]*\r?\n[ \t]*){2,}/, m = /[ \t][ \t]+/g, v = /<a\s+[^>]*?href=(['"]([^'"\s]+)['"]|[^'"\s]+)[^>]*?>(.+?)<\/a>/gi, b = function() {
var e = {"<": "&lt;",">": "&gt;",'"': "&quot;","'": "&#x27;","`": "&#x60;"}, t = /&(?!\w+;)|[<>"'`]/g, r = /[&<>"'`]/, n = function(t) {
return e[t] || "&amp;"
};
return function(e) {
return null == e || e === !1 ? "" : r.test(e) ? e.replace(t, n) : e
}
}(), _ = function() {
var e;
return function(t) {
return e || (e = document.createElement("textarea")), e.innerHTML = t, e.value
}
}(), E = function() {
var e = [], t = Math.floor(1e4 * Math.random()), r = /xxxLINK[0-9]+\|([0-9]+)xxx/g;
return {addPlaceholder: function(r, n) {
return e.push({href: r,text: n}), "xxxLINK" + t + "|" + (e.length - 1) + "xxx"
},flatten: function(t, n) {
var i = t.replace(r, function(t, r) {
var i = e[parseInt(r, 10)];
return i ? n(i.href, i.text) : t
});
return e.length = 0, i
}}
};
n = {paragraphs: !0,links: !0,externalLinks: !0,internalLinks: !0,userLinks: !0,deepLinks: !1,whitelist: [],internalLinksBaseUrl: "/",isOpeningNewWindow: !1,maxLength: null,truncateExternalLinks: !0,maxExternalLinksLength: 50,hashtagLinks: !0}, i = function(e) {
var t, r, n, i, a, o;
for (a = [].slice.call(arguments, 1), t = 0, r = a.length; r > t; ++t) {
i = a[t];
for (o in i)
i[o] !== n && (e[o] = i[o])
}
return e
}, a = function(e) {
return e.replace(/^\s+/, "").replace(/\s+$/, "")
}, o = function(e) {
return e.textContent || e.innerText || ""
}, s = function(e, t) {
if (e.length < t)
return e;
var r, n, i = document.createElement("div"), a = document.createElement("div");
return r = function(e) {
if (t > 0) {
var r = e.data.length;
t -= r, 0 >= t && (e.data = e.substringData(0, e.data.length + t))
} else
e.data = ""
}, n = function(e, r) {
var i, a = e.firstChild;
if (a)
do
3 === a.nodeType ? r(a) : 1 === a.nodeType && n(a, r);
while ((a = a.nextSibling) && t > 0);
for (; a; )
i = a, a = a.nextSibling, e.removeChild(i)
}, a.innerHTML = i.innerHTML = e, n(i, r), i.innerHTML + (i.innerHTML === a.innerHTML ? "" : "&hellip;")
}, u = function(e, t, r) {
e = r ? e : e.replace(g, "");
var n, i, a = /\.[a-z]{2,4}\//, o = e.match(a);
return o && o[0] && e.length > t ? (n = e.search(a) + o[0].length, i = Math.floor((t - n) / 2), e.slice(0, n + i) + "&hellip;" + e.slice(-i)) : e
}, r = function(e, t) {
var o, C, S = i({}, n, t), A = S.whitelist && S.whitelist.slice(), T = (document.createElement("div"), E()), w = S.escapeExpression !== !1;
if ("string" != typeof e)
return "";
if (S.links ? S.userLinks || S.internalLinks || S.externalLinks || (S.links = !1) : S.userLinks = S.internalLinks = S.externalLinks = !1, l.lastIndex = f.lastIndex = p.lastIndex = 0, e = _(e), S.links && (e = e.replace(v, function(e, t, r, n) {
var i = r || t;
return T.addPlaceholder(i, n !== i ? n : null)
}).replace(l, function(e, t) {
return T.addPlaceholder(t)
})), e = e.replace(/<\/p>/g, "\n\n").replace(/<br\s*\/?>/g, "\n").replace(m, " "), e = A && A.length ? e.replace(new RegExp("<(?!\\s*\\/?(" + A.join("|") + ")\\b)[^>]*>", "ig"), "") : e.replace(/<\/?[a-z].*?>/gi, ""), w && (e = b(e)), S.links && (e = e.replace(p, '<a href="mailto:$1">$1</a>'), e = T.flatten(e, function(e, t) {
var n = {}, a = "";
return 0 === e.indexOf("mailto:") ? (n.href = e, n.text = e.replace("mailto:", "")) : S.internalLinks && h.test(e) ? (n.href = e.replace(h, S.internalLinksBaseUrl), n.text = e.replace(g, "")) : S.externalLinks ? (n.href = g.test(e) ? e : "http://" + e, n.text = u(e, S.maxExternalLinksLength), n.rel = "nofollow", n.target = "_blank") : n.href = e, t && (w ? a = r(t, i({}, S, {paragraphs: !1})).trim() + (/[!?:;.]$/.test(t) ? " " : ": ") : n.text = t), a + (n.text ? '<a href="' + b(n.href) + '"' + (n.rel ? ' rel="' + n.rel + '"' : "") + (n.target ? ' target="' + n.target + '"' : "") + ">" + (w ? b(n.text) : n.text) + "</a>" : n.href)
}), S.userLinks && (e = e.replace(f, '$1@<a href="' + S.internalLinksBaseUrl + '$2"' + (S.isOpeningNewWindow ? ' target="_blank"' : "") + ">$2</a>")), S.hashtagLinks && (e = e.replace(d, '$1<a href="/tags/$3">$2</a>')), S.deepLinks && (e = e.replace(c, '<a href="#t=$1">$1</a>'))), S.maxLength && (e = s(e, S.maxLength)), S.paragraphs) {
for (e = e.split(y), o = 0, C = e.length; C > o; o++)
e[o] = a(e[o]), e[o] = e[o].replace(/\r?\n/g, "<br>"), e[o] = "<p>" + e[o] + "</p>";
e = e.join("")
} else
e = e.replace(/[\r\n]+/g, " ").replace(m, " ");
return e
}, r.withDefaults = function(e) {
var t = i({}, n, e);
return function(e, n) {
var a = n ? i({}, t, n) : t;
return r.call(this, e, a)
}
}, "undefined" != typeof e && e.exports ? e.exports = r : (t = function() {
return this
}(), t.SC = t.SC || {}, t.SC.usertext = r)
}()
}).call(t, function() {
return this
}())
}, function(e, t, r) {
var n = r(3), i = r(2);
e.exports = function(e) {
var t, r;
return t = n.defaults(e.hash, {href: null,className: null,label: null,type: null}), r = '<<%-tag%> class="<%-className%>"' + (t.href ? ' href="<%-href%>" target="blank"' : "") + "><%-label%></<%-tag%>>", new i.SafeString(n.template(r)({tag: t.href ? "a" : "span",className: ("sc-label sc-label-small sc-label-" + t.type + " " + t.className).trim(),label: t.label,href: t.href}))
}
}, , function(e, t, r) {
!function(e, n) {
var i = r(3);
n(e, t, i)
}(this, function(e, t, r, n) {
{
var i = e.Backbone, a = [], o = (a.push, a.slice);
a.splice
}
t.VERSION = "1.1.2", t.$ = n, t.noConflict = function() {
return e.Backbone = i, this
}, t.emulateHTTP = !1, t.emulateJSON = !1;
var s = t.Events = {on: function(e, t, r) {
if (!l(this, "on", e, [t, r]) || !t)
return this;
this._events || (this._events = {});
var n = this._events[e] || (this._events[e] = []);
return n.push({callback: t,context: r,ctx: r || this}), this
},once: function(e, t, n) {
if (!l(this, "once", e, [t, n]) || !t)
return this;
var i = this, a = r.once(function() {
i.off(e, a), t.apply(this, arguments)
});
return a._callback = t, this.on(e, a, n)
},off: function(e, t, n) {
var i, a, o, s, u, c, p, f;
if (!this._events || !l(this, "off", e, [t, n]))
return this;
if (!e && !t && !n)
return this._events = void 0, this;
for (s = e ? [e] : r.keys(this._events), u = 0, c = s.length; c > u; u++)
if (e = s[u], o = this._events[e]) {
if (this._events[e] = i = [], t || n)
for (p = 0, f = o.length; f > p; p++)
a = o[p], (t && t !== a.callback && t !== a.callback._callback || n && n !== a.context) && i.push(a);
i.length || delete this._events[e]
}
return this
},trigger: function(e) {
if (!this._events)
return this;
var t = o.call(arguments, 1);
if (!l(this, "trigger", e, t))
return this;
var r = this._events[e], n = this._events.all;
return r && c(r, t), n && c(n, arguments), this
},stopListening: function(e, t, n) {
var i = this._listeningTo;
if (!i)
return this;
var a = !t && !n;
n || "object" != typeof t || (n = this), e && ((i = {})[e._listenId] = e);
for (var o in i)
e = i[o], e.off(t, n, this), (a || r.isEmpty(e._events)) && delete this._listeningTo[o];
return this
}}, u = /\s+/, l = function(e, t, r, n) {
if (!r)
return !0;
if ("object" == typeof r) {
for (var i in r)
e[t].apply(e, [i, r[i]].concat(n));
return !1
}
if (u.test(r)) {
for (var a = r.split(u), o = 0, s = a.length; s > o; o++)
e[t].apply(e, [a[o]].concat(n));
return !1
}
return !0
}, c = function(e, t) {
var r, n = -1, i = e.length, a = t[0], o = t[1], s = t[2];
switch (t.length) {
case 0:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx);
return;
case 1:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx, a);
return;
case 2:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx, a, o);
return;
case 3:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx, a, o, s);
return;
default:
for (; ++n < i; )
(r = e[n]).callback.apply(r.ctx, t);
return
}
}, p = {listenTo: "on",listenToOnce: "once"};
r.each(p, function(e, t) {
s[t] = function(t, n, i) {
var a = this._listeningTo || (this._listeningTo = {}), o = t._listenId || (t._listenId = r.uniqueId("l"));
return a[o] = t, i || "object" != typeof n || (i = this), t[e](n, i, this), this
}
}), s.bind = s.on, s.unbind = s.off, r.extend(t, s);
var f = 0, d = t.Model = function(e, t) {
var n = e || {};
t || (t = {}), this.cid = r.uniqueId("c"), this.attributes = {}, t.collection && (this.collection = t.collection), t.parse && (n = this.parse(n, t) || {}), n = r.defaults({}, n, r.result(this, "defaults")), this.set(n, t), this.changed = {}, this.initialize.apply(this, arguments)
};
r.extend(d.prototype, s, {changed: null,validationError: null,idAttribute: "id",initialize: function() {
},toJSON: function() {
return r.clone(this.attributes)
},sync: function() {
return t.sync.apply(this, arguments)
},get: function(e) {
return this.attributes[e]
},escape: function(e) {
return r.escape(this.get(e))
},has: function(e) {
return null != this.get(e)
},set: function(e, t, n) {
var i, a, o, s, u, l, c, p;
if (null == e)
return this;
if ("object" == typeof e ? (a = e, n = t) : (a = {})[e] = t, n || (n = {}), !this._validate(a, n))
return !1;
o = n.unset, u = n.silent, s = [], l = this._changing, this._changing = !0, l || (this._previousAttributes = r.clone(this.attributes), this.changed = {}), p = this.attributes, c = this._previousAttributes, this.idAttribute in a && (this.id = a[this.idAttribute]);
for (i in a)
t = a[i], r.isEqual(p[i], t) || s.push(i), r.isEqual(c[i], t) ? delete this.changed[i] : this.changed[i] = t, o ? delete p[i] : p[i] = t;
if (f++, !u) {
s.length && (this._pending = n);
for (var d = 0, h = s.length; h > d; d++)
this.trigger("change:" + s[d], this, p[s[d]], n, f)
}
if (l)
return this;
if (!u)
for (; this._pending; )
n = this._pending, this._pending = !1, this.trigger("change", this, n, f);
return this._pending = !1, this._changing = !1, this
},unset: function(e, t) {
return this.set(e, void 0, r.extend({}, t, {unset: !0}))
},clear: function(e) {
var t = {};
for (var n in this.attributes)
t[n] = void 0;
return this.set(t, r.extend({}, e, {unset: !0}))
},hasChanged: function(e) {
return null == e ? !r.isEmpty(this.changed) : r.has(this.changed, e)
},changedAttributes: function(e) {
if (!e)
return this.hasChanged() ? r.clone(this.changed) : !1;
var t, n = !1, i = this._changing ? this._previousAttributes : this.attributes;
for (var a in e)
r.isEqual(i[a], t = e[a]) || ((n || (n = {}))[a] = t);
return n
},previous: function(e) {
return null != e && this._previousAttributes ? this._previousAttributes[e] : null
},previousAttributes: function() {
return r.clone(this._previousAttributes)
},fetch: function(e) {
e = e ? r.clone(e) : {}, void 0 === e.parse && (e.parse = !0);
var t = this, n = e.success;
return e.success = function(r) {
return t.lastFetchTime = Date.now(), t.set(t.parse(r, e), e) ? (n && n(t, r, e), void t.trigger("sync", t, r, e)) : !1
}, M(this, e), this.sync("read", this, e)
},save: function(e, t, n) {
var i, a, o, s = this.attributes;
if (null == e || "object" == typeof e ? (i = e, n = t) : (i = {})[e] = t, n = r.extend({validate: !0}, n), i && !n.wait) {
if (!this.set(i, n))
return !1
} else if (!this._validate(i, n))
return !1;
i && n.wait && (this.attributes = r.extend({}, s, i)), void 0 === n.parse && (n.parse = !0);
var u = this, l = n.success;
return n.success = function(e) {
u.attributes = s;
var t = u.parse(e, n);
return n.wait && (t = r.extend(i || {}, t)), r.isObject(t) && !u.set(t, n) ? !1 : (l && l(u, e, n), void u.trigger("sync", u, e, n))
}, M(this, n), a = this.isNew() ? "create" : n.patch ? "patch" : "update", "patch" === a && (n.attrs = i), o = this.sync(a, this, n), i && n.wait && (this.attributes = s), o
},destroy: function(e) {
e = e ? r.clone(e) : {};
var t = this, n = e.success, i = function() {
t.trigger("destroy", t, t.collection, e)
};
if (e.success = function(r) {
(e.wait || t.isNew()) && i(), n && n(t, r, e), t.isNew() || t.trigger("sync", t, r, e)
}, this.isNew())
return e.success(), !1;
M(this, e);
var a = this.sync("delete", this, e);
return e.wait || i(), a
},url: function() {
var e = r.result(this, "urlRoot") || r.result(this.collection, "url") || U();
return this.isNew() ? e : e.replace(/([^\/])$/, "$1/") + encodeURIComponent(this.id)
},parse: function(e) {
return e
},clone: function() {
return new this.constructor(this.attributes)
},isNew: function() {
return !this.has(this.idAttribute)
},isValid: function(e) {
return this._validate({}, r.extend(e || {}, {validate: !0}))
},_validate: function(e, t) {
if (!t.validate || !this.validate)
return !0;
e = r.extend({}, this.attributes, e);
var n = this.validationError = this.validate(e, t) || null;
return n ? (this.trigger("invalid", this, n, r.extend(t, {validationError: n})), !1) : !0
}});
var h = ["keys", "values", "pairs", "invert", "pick", "omit"];
r.each(h, function(e) {
d.prototype[e] = function() {
var t = o.call(arguments);
return t.unshift(this.attributes), r[e].apply(r, t)
}
});
var g = t.Collection = function(e, t) {
t || (t = {}), t.model && (this.model = t.model), void 0 !== t.comparator && (this.comparator = t.comparator), this._reset(), this.initialize.apply(this, arguments), e && this.reset(e, r.extend({silent: !0}, t))
}, y = {add: !0,remove: !0,merge: !0}, m = {add: !0,remove: !1};
r.extend(g.prototype, s, {model: d,initialize: function() {
},toJSON: function(e) {
return this.map(function(t) {
return t.toJSON(e)
})
},sync: function() {
return t.sync.apply(this, arguments)
},add: function(e, t) {
return this.set(e, r.extend({merge: !1}, t, m))
},remove: function(e, t) {
var n = !r.isArray(e);
e = n ? [e] : r.clone(e), t || (t = {});
var i, a, o, s;
for (i = 0, a = e.length; a > i; i++)
s = e[i] = this.get(e[i]), s && (delete this._byId[s.id], delete this._byId[s.cid], o = this.indexOf(s), this.models.splice(o, 1), this.length--, t.silent || (t.index = o, s.trigger("remove", s, this, t)), this._removeReference(s, t));
return n ? e[0] : e
},set: function(e, t) {
t = r.defaults({}, t, y), t.parse && (e = this.parse(e, t));
var n = !r.isArray(e);
e = n ? e ? [e] : [] : r.clone(e);
var i, a, o, s, u, l, c, p = t.at, f = this.model, h = this.comparator && null == p && t.sort !== !1, g = r.isString(this.comparator) ? this.comparator : null, m = [], v = [], b = {}, _ = t.add, E = t.merge, C = t.remove, S = !h && _ && C ? [] : !1;
for (i = 0, a = e.length; a > i; i++) {
if (u = e[i] || {}, o = u instanceof d ? s = u : u[f.prototype.idAttribute || "id"], l = this.get(o))
C && (b[l.cid] = !0), E && (u = u === s ? s.attributes : u, t.parse && (u = l.parse(u, t)), l.set(u, t), h && !c && l.hasChanged(g) && (c = !0)), e[i] = l;
else if (_) {
if (s = e[i] = this._prepareModel(u, t), this.indexOfEquivalentModel && (-1 !== this.indexOfEquivalentModel(s, e.slice(0, i)) || -1 !== this.indexOfEquivalentModel(s)) && (s.release(this._usageCount()), s = null), !s)
continue;
m.push(s), this._addReference(s, t)
}
s = l || s, !S || !s.isNew() && b[s.id] || S.push(s), b[s.id] = !0
}
if (C) {
for (i = 0, a = this.length; a > i; ++i)
b[(s = this.models[i]).cid] || v.push(s);
v.length && this.remove(v, t)
}
if (m.length || S && S.length)
if (h && (c = !0), this.length += m.length, null != p)
for (i = 0, a = m.length; a > i; i++)
this.models.splice(p + i, 0, m[i]);
else {
S && (this.models.length = 0);
var A = S || m;
for (i = 0, a = A.length; a > i; i++)
this.models.push(A[i])
}
if (c && this.sort({silent: !0}), !t.silent) {
for (i = 0, a = m.length; a > i; i++)
(s = m[i]).trigger("add", s, this, t);
(c || S && S.length) && this.trigger("sort", this, t)
}
return n ? e[0] : e
},reset: function(e, t) {
t || (t = {});
for (var n = 0, i = this.models.length; i > n; n++)
this._removeReference(this.models[n], t);
return t.previousModels = this.models, this._reset(), e = this.add(e, r.extend({silent: !0}, t)), t.silent || this.trigger("reset", this, t), e
},push: function(e, t) {
return this.add(e, r.extend({at: this.length}, t))
},pop: function(e) {
var t = this.at(this.length - 1);
return this.remove(t, e), t
},unshift: function(e, t) {
return this.add(e, r.extend({at: 0}, t))
},shift: function(e) {
var t = this.at(0);
return this.remove(t, e), t
},slice: function() {
return o.apply(this.models, arguments)
},get: function(e) {
return null == e ? void 0 : this._byId[e] || this._byId[e.id] || this._byId[e.cid]
},at: function(e) {
return this.models[e]
},where: function(e, t) {
return r.isEmpty(e) ? t ? void 0 : [] : this[t ? "find" : "filter"](function(t) {
for (var r in e)
if (e[r] !== t.get(r))
return !1;
return !0
})
},findWhere: function(e) {
return this.where(e, !0)
},sort: function(e) {
if (!this.comparator)
throw new Error("Cannot sort a set without a comparator");
return e || (e = {}), r.isString(this.comparator) || 1 === this.comparator.length ? this.models = this.sortBy(this.comparator, this) : this.models.sort(r.bind(this.comparator, this)), e.silent || this.trigger("sort", this, e), this
},pluck: function(e) {
return r.invoke(this.models, "get", e)
},fetch: function(e) {
e = e ? r.clone(e) : {}, void 0 === e.parse && (e.parse = !0);
var t = e.success, n = this;
return e.success = function(r) {
n.lastFetchTime = Date.now(), n.next_href = r.next_href || !1;
var i = e.reset ? "reset" : "set";
n[i](r, e), t && t(n, r, e), n.trigger("sync", n, r, e)
}, M(this, e), this.sync("read", this, e)
},create: function(e, t) {
if (t = t ? r.clone(t) : {}, !(e = this._prepareModel(e, t)))
return !1;
t.wait || this.add(e, t);
var n = this, i = t.success;
return t.success = function(e, r) {
t.wait && n.add(e, t), i && i(e, r, t)
}, e.save(null, t), e
},parse: function(e) {
return e
},clone: function() {
return new this.constructor(this.models)
},_reset: function() {
this.length = 0, this.models = [], this._byId = {}
},_prepareModel: function(e, t) {
if (e instanceof d)
return e;
t = t ? r.clone(t) : {}, t.collection = this;
var n = new this.model(e, t);
return n.validationError ? (this.trigger("invalid", this, n.validationError, t), !1) : n
},_addReference: function(e) {
this._byId[e.cid] = e, null != e.id && (this._byId[e.id] = e), e.collection || (e.collection = this), e.on("all", this._onModelEvent, this)
},_removeReference: function(e) {
this === e.collection && delete e.collection, e.off("all", this._onModelEvent, this)
},_onModelEvent: function(e, t, r, n) {
("add" !== e && "remove" !== e || r === this) && ("destroy" === e && this.remove(t, n), t && e === "change:" + t.idAttribute && (delete this._byId[t.previous(t.idAttribute)], null != t.id && (this._byId[t.id] = t)), this.trigger.apply(this, arguments))
}});
var v = ["forEach", "each", "map", "collect", "reduce", "foldl", "inject", "reduceRight", "foldr", "find", "detect", "filter", "select", "reject", "every", "all", "some", "any", "include", "contains", "invoke", "max", "min", "toArray", "size", "first", "head", "take", "initial", "rest", "tail", "drop", "last", "without", "difference", "indexOf", "shuffle", "lastIndexOf", "isEmpty", "chain", "sample"];
r.each(v, function(e) {
g.prototype[e] = function() {
var t = o.call(arguments);
return t.unshift(this.models), r[e].apply(r, t)
}
});
var b = ["groupBy", "countBy", "sortBy", "indexBy"];
r.each(b, function(e) {
g.prototype[e] = function(t, n) {
var i = r.isFunction(t) ? t : function(e) {
return e.get(t)
};
return r[e](this.models, i, n)
}
});
var _ = t.View = function(e) {
this.cid = r.uniqueId("view"), e || (e = {}), r.extend(this, r.pick(e, C)), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents()
}, E = /^(\S+)\s*(.*)$/, C = ["model", "collection", "el", "id", "attributes", "className", "tagName", "events"];
r.extend(_.prototype, s, {tagName: "div",$: function(e) {
return this.$el.find(e)
},initialize: function() {
},render: function() {
return this
},remove: function() {
return this.$el.remove(), this.stopListening(), this
},setElement: function(e, r) {
return this.$el && this.undelegateEvents(), this.$el = e instanceof t.$ ? e : t.$(e), this.el = this.$el[0], r !== !1 && this.delegateEvents(), this
},delegateEvents: function(e) {
if (!e && !(e = r.result(this, "events")))
return this;
this.undelegateEvents();
for (var t in e) {
var n = e[t];
if (r.isFunction(n) || (n = this[e[t]]), n) {
var i = t.match(E), a = i[1], o = i[2];
n = r.bind(n, this), a += ".delegateEvents" + this.cid, "" === o ? this.$el.on(a, n) : this.$el.on(a, o, n)
}
}
return this
},undelegateEvents: function() {
return this.$el.off(".delegateEvents" + this.cid), this
},_ensureElement: function() {
if (this.el)
this.setElement(r.result(this, "el"), !1);
else {
var e = r.extend({}, r.result(this, "attributes"));
this.id && (e.id = r.result(this, "id")), this.className && (e["class"] = r.result(this, "className"));
var n = t.$("<" + r.result(this, "tagName") + ">").attr(e);
this.setElement(n, !1)
}
}}), t.sync = function(e, n, i) {
var a = A[e];
r.defaults(i || (i = {}), {emulateHTTP: t.emulateHTTP,emulateJSON: t.emulateJSON});
var o = {type: a,dataType: "json"};
if (i.url || (o.url = r.result(n, "url") || U()), null != i.data || !n || "create" !== e && "update" !== e && "patch" !== e || (o.contentType = "application/json", o.data = JSON.stringify(i.attrs || n.toJSON(i))), i.emulateJSON && (o.contentType = "application/x-www-form-urlencoded", o.data = o.data ? {model: o.data} : {}), i.emulateHTTP && ("PUT" === a || "DELETE" === a || "PATCH" === a)) {
o.type = "POST", i.emulateJSON && (o.data._method = a);
var s = i.beforeSend;
i.beforeSend = function(e) {
return e.setRequestHeader("X-HTTP-Method-Override", a), s ? s.apply(this, arguments) : void 0
}
}
"GET" === o.type || i.emulateJSON || (o.processData = !1), "PATCH" === o.type && S && (o.xhr = function() {
return new ActiveXObject("Microsoft.XMLHTTP")
});
var u = i.xhr = t.ajax(r.extend(o, i));
return n.trigger("request", n, u, i), u
};
var S = !("undefined" == typeof window || !window.ActiveXObject || window.XMLHttpRequest && (new XMLHttpRequest).dispatchEvent), A = {create: "POST",update: "PUT",patch: "PATCH","delete": "DELETE",read: "GET"};
t.ajax = function() {
return t.$.ajax.apply(t.$, arguments)
};
var T = t.Router = function(e) {
e || (e = {}), e.routes && (this.routes = e.routes), this._bindRoutes(), this.initialize.apply(this, arguments)
}, w = /\((.*?)\)/g, k = /(\(\?)?:\w+/g, I = /\*\w+/g, x = /[\-{}\[\]+?.,\\\^$|#\s]/g;
r.extend(T.prototype, s, {initialize: function() {
},route: function(e, n, i) {
r.isRegExp(e) || (e = this._routeToRegExp(e)), r.isFunction(n) && (i = n, n = ""), i || (i = this[n]);
var a = this;
return t.history.route(e, function(r) {
var o = a._extractParameters(e, r);
a.execute(i, o), a.trigger.apply(a, ["route:" + n].concat(o)), a.trigger("route", n, o), t.history.trigger("route", a, n, o)
}), this
},execute: function(e, t) {
e && e.apply(this, t)
},navigate: function(e, r) {
return t.history.navigate(e, r), this
},_bindRoutes: function() {
if (this.routes) {
this.routes = r.result(this, "routes");
for (var e, t = r.keys(this.routes); null != (e = t.pop()); )
this.route(e, this.routes[e])
}
},_routeToRegExp: function(e) {
return e = e.replace(x, "\\$&").replace(w, "(?:$1)?").replace(k, function(e, t) {
return t ? e : "([^/?]+)"
}).replace(I, "([^?]*?)"), new RegExp("^" + e + "(?:\\?([\\s\\S]*))?$")
},_extractParameters: function(e, t) {
var n = e.exec(t).slice(1);
return r.map(n, function(e, t) {
return t === n.length - 1 ? e || null : e ? decodeURIComponent(e) : null
})
}});
var D = t.History = function() {
this.handlers = [], r.bindAll(this, "checkUrl"), "undefined" != typeof window && (this.location = window.location, this.history = window.history)
}, N = /^[#\/]|\s+$/g, B = /^\/+|\/+$/g, L = /msie [\w.]+/, R = /\/$/, P = /#.*$/;
D.started = !1, r.extend(D.prototype, s, {interval: 50,atRoot: function() {
return this.location.pathname.replace(/[^\/]$/, "$&/") === this.root
},getHash: function(e) {
var t = (e || this).location.href.match(/#(.*)$/);
return t ? t[1] : ""
},getFragment: function(e, t) {
if (null == e)
if (this._hasPushState || !this._wantsHashChange || t) {
e = decodeURI(this.location.pathname + this.location.search);
var r = this.root.replace(R, "");
e.indexOf(r) || (e = e.slice(r.length))
} else
e = this.getHash();
return e.replace(N, "")
},start: function(e) {
if (D.started)
throw new Error("Backbone.history has already been started");
D.started = !0, this.options = r.extend({root: "/"}, this.options, e), this.root = this.options.root, this._wantsHashChange = this.options.hashChange !== !1, this._wantsPushState = !!this.options.pushState, this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState);
var n = this.getFragment(), i = document.documentMode, a = L.exec(navigator.userAgent.toLowerCase()) && (!i || 7 >= i);
if (this.root = ("/" + this.root + "/").replace(B, "/"), a && this._wantsHashChange) {
var o = t.$('<iframe src="javascript:0" tabindex="-1">');
this.iframe = o.hide().appendTo("body")[0].contentWindow, this.navigate(n)
}
this._hasPushState ? t.$(window).on("popstate", this.checkUrl) : this._wantsHashChange && "onhashchange" in window && !a ? t.$(window).on("hashchange", this.checkUrl) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), this.fragment = n;
this.location;
return this._wantsHashChange && this._wantsPushState && !this._hasPushState && !this.atRoot() ? (this.fragment = this.getFragment(null, !0), this.location.replace(this.root + "#" + this.fragment), !0) : this.options.silent ? void 0 : this.loadUrl()
},stop: function() {
t.$(window).off("popstate", this.checkUrl).off("hashchange", this.checkUrl), this._checkUrlInterval && clearInterval(this._checkUrlInterval), D.started = !1
},route: function(e, t) {
this.handlers.unshift({route: e,callback: t})
},checkUrl: function() {
var e = this.getFragment();
return e === this.fragment && this.iframe && (e = this.getFragment(this.getHash(this.iframe))), e === this.fragment ? !1 : (this.iframe && this.navigate(e), void this.loadUrl())
},loadUrl: function(e) {
return e = this.fragment = this.getFragment(e), r.any(this.handlers, function(t) {
return t.route.test(e) ? (t.callback(e), !0) : void 0
})
},navigate: function(e, t) {
if (!D.started)
return !1;
t && t !== !0 || (t = {trigger: !!t});
var r = this.root + (e = this.getFragment(e || ""));
if (e = e.replace(P, ""), this.fragment !== e) {
if (this.fragment = e, "" === e && "/" !== r && (r = r.slice(0, -1)), this._hasPushState)
this.history[t.replace ? "replaceState" : "pushState"]({}, document.title, r);
else {
if (!this._wantsHashChange)
return this.location.assign(r);
this._updateHash(this.location, e, t.replace), this.iframe && e !== this.getFragment(this.getHash(this.iframe)) && (t.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, e, t.replace))
}
return t.trigger ? this.loadUrl(e) : void 0
}
},_updateHash: function(e, t, r) {
if (r) {
var n = e.href.replace(/(javascript:|#).*$/, "");
e.replace(n + "#" + t)
} else
e.hash = "#" + t
}}), t.history = new D;
var O = function(e, t) {
var n, i = this;
n = e && r.has(e, "constructor") ? e.constructor : function() {
return i.apply(this, arguments)
}, r.extend(n, i, t);
var a = function() {
this.constructor = n
};
return a.prototype = i.prototype, n.prototype = new a, e && r.extend(n.prototype, e), n.__super__ = i.prototype, n
};
d.extend = g.extend = T.extend = _.extend = D.extend = O;
var U = function() {
throw new Error('A "url" property or function must be specified')
}, M = function(e, t) {
var r = t.error;
t.error = function(n) {
r && r(e, n, t), e.trigger("error", e, n, t)
}
};
return t
})
}, function(e, t, r) {
t = e.exports = r(5)(), t.push([e.id, '/*!\n * jQuery UI CSS Framework 1.10.3\n * http://jqueryui.com\n *\n * Copyright 2013 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Theming/API\n */.ui-helper-hidden{display:none}.ui-helper-hidden-accessible{border:0;clip:rect(0 0 0 0);height:1px;margin:-1px;overflow:hidden;padding:0;position:absolute;width:1px}.ui-helper-reset{margin:0;padding:0;border:0;outline:0;line-height:1.3;text-decoration:none;font-size:100%;list-style:none}.ui-helper-clearfix:before,.ui-helper-clearfix:after{content:"";display:table;border-collapse:collapse}.ui-helper-clearfix:after{clear:both}.ui-helper-clearfix{min-height:0}.ui-helper-zfix{width:100%;height:100%;top:0;left:0;position:absolute;opacity:0;filter:Alpha(Opacity=0)}.ui-front{z-index:100}.ui-state-disabled{cursor:default!important}.ui-icon{display:block;text-indent:-99999px;overflow:hidden;background-repeat:no-repeat}.ui-widget-overlay{position:fixed;top:0;left:0;width:100%;height:100%}', ""])
}, function(e, t, r) {
t = e.exports = r(5)(), t.push([e.id, "/*!\n * jQuery UI Datepicker 1.10.3\n * http://jqueryui.com\n *\n * Copyright 2013 jQuery Foundation and other contributors\n * Released under the MIT license.\n * http://jquery.org/license\n *\n * http://docs.jquery.com/UI/Datepicker#theming\n */.ui-datepicker{width:17em;padding:.2em .2em 0;display:none}.ui-datepicker .ui-datepicker-header{position:relative;padding:.2em 0}.ui-datepicker .ui-datepicker-prev,.ui-datepicker .ui-datepicker-next{position:absolute;top:2px;width:1.8em;height:1.8em}.ui-datepicker .ui-datepicker-prev-hover,.ui-datepicker .ui-datepicker-next-hover{top:1px}.ui-datepicker .ui-datepicker-prev{left:2px}.ui-datepicker .ui-datepicker-next{right:2px}.ui-datepicker .ui-datepicker-prev-hover{left:1px}.ui-datepicker .ui-datepicker-next-hover{right:1px}.ui-datepicker .ui-datepicker-prev span,.ui-datepicker .ui-datepicker-next span{display:block;position:absolute;left:50%;margin-left:-8px;top:50%;margin-top:-8px}.ui-datepicker .ui-datepicker-title{margin:0 2.3em;line-height:1.8em;text-align:center}.ui-datepicker .ui-datepicker-title select{font-size:1em;margin:1px 0}.ui-datepicker select.ui-datepicker-month-year{width:100%}.ui-datepicker select.ui-datepicker-month,.ui-datepicker select.ui-datepicker-year{width:49%}.ui-datepicker table{width:100%;font-size:.9em;border-collapse:collapse;margin:0 0 .4em}.ui-datepicker th{padding:.7em .3em;text-align:center;font-weight:700;border:0}.ui-datepicker td{border:0;padding:1px}.ui-datepicker td span,.ui-datepicker td a{display:block;padding:.2em;text-align:right;text-decoration:none}.ui-datepicker .ui-datepicker-buttonpane{background-image:none;margin:.7em 0 0 0;padding:0 .2em;border-left:0;border-right:0;border-bottom:0}.ui-datepicker .ui-datepicker-buttonpane button{float:right;margin:.5em .2em .4em;cursor:pointer;padding:.2em .6em .3em .6em;width:auto;overflow:visible}.ui-datepicker .ui-datepicker-buttonpane button.ui-datepicker-current{float:left}.ui-datepicker.ui-datepicker-multi{width:auto}.ui-datepicker-multi .ui-datepicker-group{float:left}.ui-datepicker-multi .ui-datepicker-group table{width:95%;margin:0 auto .4em}.ui-datepicker-multi-2 .ui-datepicker-group{width:50%}.ui-datepicker-multi-3 .ui-datepicker-group{width:33.3%}.ui-datepicker-multi-4 .ui-datepicker-group{width:25%}.ui-datepicker-multi .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-multi .ui-datepicker-group-middle .ui-datepicker-header{border-left-width:0}.ui-datepicker-multi .ui-datepicker-buttonpane{clear:left}.ui-datepicker-row-break{clear:both;width:100%;font-size:0}.ui-datepicker-rtl{direction:rtl}.ui-datepicker-rtl .ui-datepicker-prev{right:2px;left:auto}.ui-datepicker-rtl .ui-datepicker-next{left:2px;right:auto}.ui-datepicker-rtl .ui-datepicker-prev:hover{right:1px;left:auto}.ui-datepicker-rtl .ui-datepicker-next:hover{left:1px;right:auto}.ui-datepicker-rtl .ui-datepicker-buttonpane{clear:right}.ui-datepicker-rtl .ui-datepicker-buttonpane button{float:left}.ui-datepicker-rtl .ui-datepicker-buttonpane button.ui-datepicker-current,.ui-datepicker-rtl .ui-datepicker-group{float:right}.ui-datepicker-rtl .ui-datepicker-group-last .ui-datepicker-header,.ui-datepicker-rtl .ui-datepicker-group-middle .ui-datepicker-header{border-right-width:0;border-left-width:1px}", ""])
}, function(e, t, r) {
t = e.exports = r(5)(), t.push([e.id, ".sp-container{position:absolute;top:0;left:0;display:inline-block;*display:inline;*zoom:1;z-index:2147483647;overflow:hidden}.sp-container.sp-flat{position:relative}.sp-top{position:relative;width:100%;display:inline-block}.sp-top-inner{position:absolute;top:0;left:0;bottom:0;right:0}.sp-color{position:absolute;top:0;left:0;bottom:0;right:20%}.sp-hue{position:absolute;top:0;right:0;bottom:0;left:84%;height:100%}.sp-fill{padding-top:80%}.sp-sat,.sp-val{position:absolute;top:0;left:0;right:0;bottom:0}.sp-alpha-enabled .sp-top{margin-bottom:18px}.sp-alpha-enabled .sp-alpha{display:block}.sp-alpha-handle{position:absolute;top:-4px;bottom:-4px;width:6px;left:50%;cursor:pointer;border:1px solid #000;background:#fff;opacity:.8}.sp-alpha{display:none;position:absolute;bottom:-14px;right:0;left:0;height:8px}.sp-alpha-inner{border:solid 1px #333}.sp-container,.sp-replacer,.sp-preview,.sp-dragger,.sp-slider,.sp-alpha,.sp-alpha-handle,.sp-container.sp-dragging .sp-input,.sp-container button{-webkit-user-select:none;-moz-user-select:-moz-none;-ms-user-select:none;user-select:none}.sp-container.sp-input-disabled .sp-input-container{display:none}.sp-container.sp-buttons-disabled .sp-button-container{display:none}.sp-palette-only .sp-picker-container{display:none}.sp-palette-disabled .sp-palette-container{display:none}.sp-initial-disabled .sp-initial{display:none}.sp-sat{background-image:-webkit-gradient(linear,0 0,100% 0,from(#FFF),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(left,#FFF,rgba(204,154,129,0));background-image:-webkit-linear-gradient(left,#fff,rgba(204,154,129,0));background-image:linear-gradient(to right,#fff,rgba(204,154,129,0));-ms-filter:\"progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr=#FFFFFFFF, endColorstr=#00CC9A81)\";filter:progid:DXImageTransform.Microsoft.gradient(GradientType = 1, startColorstr='#FFFFFFFF', endColorstr='#00CC9A81')}.sp-val{background-image:-webkit-gradient(linear,0 100%,0 0,from(#000),to(rgba(204,154,129,0)));background-image:-webkit-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:-webkit-linear-gradient(bottom,#000,rgba(204,154,129,0));background-image:linear-gradient(to top,#000,rgba(204,154,129,0));-ms-filter:\"progid:DXImageTransform.Microsoft.gradient(startColorstr=#00CC9A81, endColorstr=#FF000000)\";filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00CC9A81', endColorstr='#FF000000')}.sp-hue{background:-webkit-gradient(linear,left top,left bottom,from(red),color-stop(.17,#ff0),color-stop(.33,#0f0),color-stop(.5,#0ff),color-stop(.67,#00f),color-stop(.83,#f0f),to(red));background:-webkit-linear-gradient(top,red 0%,#ff0 17%,#0f0 33%,#0ff 50%,#00f 67%,#f0f 83%,red 100%)}.sp-1{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff0000', endColorstr='#ffff00')}.sp-2{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ffff00', endColorstr='#00ff00')}.sp-3{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ff00', endColorstr='#00ffff')}.sp-4{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#00ffff', endColorstr='#0000ff')}.sp-5{height:16%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#0000ff', endColorstr='#ff00ff')}.sp-6{height:17%;filter:progid:DXImageTransform.Microsoft.gradient(startColorstr='#ff00ff', endColorstr='#ff0000')}.sp-cf:before,.sp-cf:after{content:\"\";display:table}.sp-cf:after{clear:both}.sp-cf{*zoom:1}@media (max-device-width:480px){.sp-color{right:40%}.sp-hue{left:63%}.sp-fill{padding-top:60%}}.sp-dragger{border-radius:5px;height:5px;width:5px;border:1px solid #fff;background:#000;cursor:pointer;position:absolute;top:0;left:0}.sp-slider{position:absolute;top:0;cursor:pointer;height:3px;left:-1px;right:-1px;border:1px solid #000;background:#fff;opacity:.8}.sp-container{border-radius:0;background-color:#ECECEC;border:solid 1px #f0c49B;padding:0}.sp-container,.sp-container button,.sp-container input,.sp-color,.sp-hue{font:12px \"Lucida Grande\",\"Lucida Sans Unicode\",\"Lucida Sans\",Geneva,Verdana,sans-serif;-ms-box-sizing:border-box;box-sizing:border-box}.sp-top{margin-bottom:3px}.sp-color,.sp-hue{border:solid 1px #666}.sp-input-container{float:right;width:100px;margin-bottom:4px}.sp-initial-disabled .sp-input-container{width:100%}.sp-input{font-size:12px!important;border:1px inset;padding:4px 5px;margin:0;width:100%;background:0 0;border-radius:3px;color:#222}.sp-input:focus{border:1px solid orange}.sp-input.sp-validation-error{border:1px solid red;background:#fdd}.sp-picker-container,.sp-palette-container{float:left;position:relative;padding:10px;padding-bottom:300px;margin-bottom:-290px}.sp-picker-container{width:172px;border-left:solid 1px #fff}.sp-palette-container{border-right:solid 1px #ccc}.sp-palette .sp-thumb-el{display:block;position:relative;float:left;width:24px;height:15px;margin:3px;cursor:pointer;border:solid 2px transparent}.sp-palette .sp-thumb-el:hover,.sp-palette .sp-thumb-el.sp-thumb-active{border-color:orange}.sp-thumb-el{position:relative}.sp-initial{float:left;border:solid 1px #333}.sp-initial span{width:30px;height:25px;border:none;display:block;float:left;margin:0}.sp-button-container{float:right}.sp-replacer{margin:0;overflow:hidden;cursor:pointer;padding:4px;display:inline-block;*zoom:1;*display:inline;border:solid 1px #91765d;background:#eee;color:#333;vertical-align:middle}.sp-replacer:hover,.sp-replacer.sp-active{border-color:#F0C49B;color:#111}.sp-dd{padding:2px 0;height:16px;line-height:16px;float:left;font-size:10px}.sp-preview{position:relative;width:25px;height:20px;border:solid 1px #222;margin-right:5px;float:left;z-index:0}.sp-palette{*width:220px;max-width:220px}.sp-palette .sp-thumb-el{width:16px;height:16px;margin:2px 1px;border:solid 1px #ccc}.sp-container{padding-bottom:0}.sp-container button{background-color:#eee;background-image:-webkit-linear-gradient(top,#eee,#ccc);background-image:linear-gradient(to bottom,#eee,#ccc);border:1px solid #ccc;border-bottom:1px solid #bbb;border-radius:3px;color:#333;font-size:14px;line-height:1;padding:5px 4px;text-align:center;text-shadow:0 1px 0 #eee;vertical-align:middle}.sp-container button:hover{background-color:#ddd;background-image:-webkit-linear-gradient(top,#ddd,#bbb);background-image:linear-gradient(to bottom,#ddd,#bbb);border:1px solid #bbb;border-bottom:1px solid #999;cursor:pointer;text-shadow:0 1px 0 #ddd}.sp-container button:active{border:1px solid #aaa;border-bottom:1px solid #888;-ms-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;-o-box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee;box-shadow:inset 0 0 5px 2px #aaa,0 1px 0 0 #eee}.sp-cancel{font-size:11px;color:#d93f3f!important;margin:0;padding:2px;margin-right:5px;vertical-align:middle;text-decoration:none}.sp-cancel:hover{color:#d93f3f!important;text-decoration:underline}.sp-palette span:hover,.sp-palette span.sp-thumb-active{border-color:#000}.sp-preview,.sp-alpha,.sp-thumb-el{position:relative;background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAwAAAAMCAIAAADZF8uwAAAAGUlEQVQYV2M4gwH+YwCGIasIUwhT25BVBADtzYNYrHvv4gAAAABJRU5ErkJggg==)}.sp-preview-inner,.sp-alpha-inner,.sp-thumb-inner{display:block;position:absolute;top:0;left:0;bottom:0;right:0}.sp-palette .sp-thumb-light.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAIVJREFUeNpiYBhsgJFMffxAXABlN5JruT4Q3wfi/0DsT64h8UD8HmpIPCWG/KemIfOJCUB+Aoacx6EGBZyHBqI+WsDCwuQ9mhxeg2A210Ntfo8klk9sOMijaURm7yc1UP2RNCMbKE9ODK1HM6iegYLkfx8pligC9lCD7KmRof0ZhjQACDAAceovrtpVBRkAAAAASUVORK5CYII=)}.sp-palette .sp-thumb-dark.sp-thumb-active .sp-thumb-inner{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABIAAAASCAYAAABWzo5XAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsMAAA7DAcdvqGQAAAAadEVYdFNvZnR3YXJlAFBhaW50Lk5FVCB2My41LjEwMPRyoQAAAMdJREFUOE+tkgsNwzAMRMugEAahEAahEAZhEAqlEAZhEAohEAYh81X2dIm8fKpEspLGvudPOsUYpxE2BIJCroJmEW9qJ+MKaBFhEMNabSy9oIcIPwrB+afvAUFoK4H0tMaQ3XtlrggDhOVVMuT4E5MMG0FBbCEYzjYT7OxLEvIHQLY2zWwQ3D+9luyOQTfKDiFD3iUIfPk8VqrKjgAiSfGFPecrg6HN6m/iBcwiDAo7WiBeawa+Kwh7tZoSCGLMqwlSAzVDhoK+6vH4G0P5wdkAAAAASUVORK5CYII=)}", ""])
}, function(e, t, r) {
var n = r(2), i = r(43);
e.exports = function() {
return new n.SafeString(i.handlebarHelper.apply(this, arguments))
}
}, function(e, t, r) {
var n = r(19);
e.exports = function() {
var e = Array.prototype.slice.call(arguments, 0, -1);
return n.getRoute.apply(n, e)
}
}, , , , , function(e, t, r) {
var n = r(41), i = r(2);
e.exports = function(e) {
return new i.SafeString(n.getAccessibleMarkup(e.hash))
}
}, function(e, t, r) {
(function(t) {
var n, i = r(3), a = r(10), o = r(17), s = a.Collection, u = a.Model, l = s.prototype, c = u.prototype, p = a.History.prototype;
e.exports = a, a.$ = t, p.loadUrl = function() {
var e = /\/*(?:[#?].*)?$/;
return function(t) {
return t = this.fragment = this.getFragment(t).replace(e, ""), i.any(this.handlers, function(e) {
return e.route.test(t) ? (e.callback(t), !0) : void 0
})
}
}(), window.history && window.history.pushState && (n = function() {
window.history.replaceState({scrollTop: document.body.scrollTop || document.documentElement.scrollTop}, "", window.location.href)
}, p.navigate = function(e) {
return function() {
return n(), e.apply(this, arguments)
}
}(p.navigate), t(window).on("unload", n)), function() {
function e(e, t) {
return function() {
delete e._requests[t]
}
}
function r(r) {
return function(n) {
var a;
return n = i.extend({url: i.result(this, "url"),jqAjax: !1,saveRequest: !1}, n), this._requests || (this._requests = {}), a = this._requests[n.url], a ? (n.success && a.done(n.success.bind(n, this)), n.error && a.fail(n.error)) : (a = this._requests[n.url] = n.jqAjax ? t.ajax(n) : r.call(this, n), a[n.saveRequest ? "fail" : "always"](e(this, n.url))), a
}
}
c.fetch = r(c.fetch), l.fetch = r(l.fetch)
}(), c.resetChanges = function() {
delete this._changed, this._previousAttributes = i.clone(this.attributes)
}, u.extend = s.extend = a.View.extend = function(e) {
return function() {
var t = i.toArray(arguments), r = t.filter(function(e) {
return e instanceof o
}), n = r.length, a = e.apply(this, t.slice(n));
return r.forEach(function(e) {
e.applyTo(a.prototype)
}), a
}
}(a.View.extend), l._prepareModel = function(e) {
return function() {
var t = e.apply(this, arguments);
return t.collection = this, t
}
}(l._prepareModel)
}).call(t, r(1))
}, , function(e, t, r) {
var n = r(2), i = r(42);
e.exports = function(e) {
return new n.SafeString(i.render(e.hash))
}
}, function(e, t, r) {
var n = r(2), i = r(26);
e.exports = function(e, t) {
return new n.SafeString(i.markup(e, t.hash))
}
}, function(e, t, r) {
var n = r(22);
e.exports = n.plural
}, , function(e, t, r) {
var n = r(2), i = r(7), a = i.withDefaults({paragraphs: !1,whitelist: [],externalLinks: !1});
e.exports = function(e, t) {
return (void 0 === t.hash.escapeExpression || t.hash.escapeExpression) && (e = n.Utils.escapeExpression(e)), new n.SafeString(a(e, t.hash))
}
}, , function(e) {
e.exports = function(e) {
return e.replace(/^https?:.+?\w\//, "/")
}
}, function(e, t, r) {
var n = r(2), i = r(7);
e.exports = function(e, t) {
return (void 0 === t.hash.escapeExpression || t.hash.escapeExpression) && (e = n.Utils.escapeExpression(e)), new n.SafeString(i(e, t.hash))
}
}, function(e, t, r) {
var n = r(9);
e.exports = function(e, t) {
return n.render(e, t && t.hash)
}
}, function(e, t, r) {
var n = r(9);
e.exports = function(e) {
return n.render(e, {useSIUnits: !0,decimals: 1})
}
}, function(e, t, r) {
var n = r(3), i = r(8);
e.exports = function(e) {
var t = n.defaults({type: "private",label: "Private"}, e.hash);
return i({hash: t})
}
}, function(e) {
!function() {
function t(e) {
var t, r = "." + window.location.hostname.replace(/.*\.(.+\..+)/, "$1"), n = new Date;
n.setTime(n.getTime() + 31536e7), t = "; expires=" + n.toGMTString(), document.cookie = C + "=" + e + t + "; path=/; domain=" + r
}
function r() {
var e = document.cookie.split(C + "=");
return e.length > 1 && e[1].split(";")[0]
}
function n() {
return Math.floor(1e6 * Math.random())
}
function i(e) {
var t, r = {};
for (t in e)
e.hasOwnProperty(t) && (r[t] = e[t]);
return r
}
function a(e, t) {
var r, n = i(e);
for (r in t)
t.hasOwnProperty(r) && (n[r] = t[r]);
return n
}
function o(e) {
return e = "object" == typeof e ? e : {}, e.context = e.context || {}, e.context.scope = e.context.scope || [], e
}
function s(e, t) {
var r, n, i, a;
n = [], r = _ + e + "?", r += ["anonymous_id=" + encodeURIComponent(g), "client_id=" + b, "ts=" + Date.now(), "url=" + window.location.href.split("/").map(encodeURIComponent).join("/")].join("&"), v && Object.keys(v).forEach(function(e) {
n.push("exp_" + e + "=" + v[e])
}), m && n.push("origin=" + m), document.referrer.length > 0 && n.push("referrer=" + encodeURIComponent(document.referrer));
for (i in t)
t.hasOwnProperty(i) && null != t[i] && n.push(encodeURIComponent(i) + "=" + encodeURIComponent(t[i]));
return r += "&" + n.join("&"), a = new Image, a.onload = u.bind(null, a), a.onerror = l.bind(null, a, T), a.src = r, r
}
function u(e) {
e.onload = e.onerror = null
}
function l(e, t) {
var r = e.src;
e.onload = e.onerror = null, e.src = w, setTimeout(function() {
e.src = r
}, t)
}
function c(e, t) {
for (var r = 0, n = t.length; n > r; r++)
if (void 0 === e[t[r]])
return !0;
return !1
}
function p(e) {
return e ? "soundcloud:users:" + e : g
}
function f() {
}
function d(e, t) {
t && (e.page_params = [t.qid, t.position].join(";"))
}
var h, g, y, m, v, b, _, E, C = "sc_anonymous_id", S = 3e4, A = 1e3, T = 3e4, w = "data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==";
E = function() {
throw new Error("EventLogger must be initialized")
}, h = {_anonymousId: null,initialize: function(e) {
if (!y) {
if (!e.id)
throw new Error("EventLogger: You need to pass an id");
m = e.origin, g = this._anonymousId = h.getAnonymousId(), this.checkpointIntervals = {}, b = e.id, _ = e.trackingUrl || "https://eventlogger.soundcloud.com", y = !0, E = f
}
},setExperiments: function(e) {
v = e
},getAnonymousId: function() {
var e = r();
return e && "undefined" !== e || (e = [n(), n(), n(), n()].join("-"), t(e)), e
},pageview: function(e, t, r) {
E();
var n = p(e);
return s("/pageview", {user: n,level: t,chapter: r.join("::")})
},impression: function(e, t, r) {
E(), r = o(r);
var n = {ad_urn: r.ad_urn,campaign: r.context.campaign,context: r.context.scope.join(":"),external_media: r.external_media,impression_name: r.impression_name,impression_object: r.impression_object,level: t,monetization_type: r.monetization_type,monetized_object: r.monetized_object,promoted_by: r.promoted_by,urn: r.urn,user: p(e)};
s("/impression", a(n, r.params))
},click: function(e, t, r, n) {
E(), n = o(n);
var i = {ad_urn: n.ad_urn,campaign: n.context.campaign,chapter: r.join("::"),context: n.context.scope.join(":"),external_media: n.external_media,level: t,monetization_type: n.monetization_type,monetized_object: n.monetized_object,promoted_by: n.promoted_by,urn: n.urn,user: p(e),click_name: n.click_name,click_object: n.click_object,click_target: n.click_target,page_name: n.page_name,page_urn: n.page_urn};
return d(i, n.context.searchTracking), s("/click", a(i, n.params))
},audio: function(e) {
if (E(), c(e, ["level", "action", "id", "duration"]))
throw new Error("EventLogger — Audio : One or multiple mandatory arguments are missing");
var t, r, n, a, o = e.id, u = "soundcloud:sounds:" + o, l = Math.floor(1e3 * e.duration), f = this.checkpointIntervals, h = "number" == typeof e.checkpointInterval && e.checkpointInterval >= A ? e.checkpointInterval : null;
return t = {action: e.action,ad_urn: e.ad_urn,context: e.context,duration: l,level: e.level,monetization_type: e.monetization_type,monetized_object: e.monetized_object,policy: e.policy,promoted_by: e.promoted_by,protocol: e.protocol,set_id: e.setId,set_position: e.setPosition,sound: u,source: e.source,source_version: e.sourceVersion,trigger: e.trigger,user: p(e.user)}, d(t, e.searchTracking), r = s("/audio", t), clearInterval(f[o]), "play" === e.action ? (n = Date.now(), a = i(t), a.action = "checkpoint", f[o] = setInterval(function() {
Date.now() < n + l ? s("/audio", a) : clearInterval(f[o])
}, h || S)) : delete f[o], r
},audioPerformance: function(e) {
if (E(), c(e, ["type", "latency", "protocol", "playertype", "host"]))
throw new Error("EventLogger — AudioPerformance : One or multiple mandatory arguments are missing");
var t = {type: e.type,latency: e.latency,protocol: e.protocol,player_type: e.playertype,host: e.host};
return s("/audio_performance", t)
},appLoad: function(e, t) {
E();
var r = {latency: t.latency,user: p(e),level: t.level};
return s("/appload", r)
},performRequestWithUser: function(e, t, r) {
return s(t, a({user: p(e)}, r))
}}, "undefined" != typeof e && e.exports ? e.exports = h : (window.SC = window.SC || {}, window.SC.EventLogger = h)
}()
}, function(e, t, r) {
(function(t) { /*!
* jQuery UI Core 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/category/ui-core/
*/
!function(e, t) {
function r(t, r) {
var i, a, o, s = t.nodeName.toLowerCase();
return "area" === s ? (i = t.parentNode, a = i.name, t.href && a && "map" === i.nodeName.toLowerCase() ? (o = e("img[usemap=#" + a + "]")[0], !!o && n(o)) : !1) : (/input|select|textarea|button|object/.test(s) ? !t.disabled : "a" === s ? t.href || r : r) && n(t)
}
function n(t) {
return e.expr.filters.visible(t) && !e(t).parents().addBack().filter(function() {
return "hidden" === e.css(this, "visibility")
}).length
}
var i = 0, a = /^ui-id-\d+$/;
e.ui = e.ui || {}, e.extend(e.ui, {version: "1.10.3",keyCode: {BACKSPACE: 8,COMMA: 188,DELETE: 46,DOWN: 40,END: 35,ENTER: 13,ESCAPE: 27,HOME: 36,LEFT: 37,NUMPAD_ADD: 107,NUMPAD_DECIMAL: 110,NUMPAD_DIVIDE: 111,NUMPAD_ENTER: 108,NUMPAD_MULTIPLY: 106,NUMPAD_SUBTRACT: 109,PAGE_DOWN: 34,PAGE_UP: 33,PERIOD: 190,RIGHT: 39,SPACE: 32,TAB: 9,UP: 38}}), e.fn.extend({focus: function(t) {
return function(r, n) {
return "number" == typeof r ? this.each(function() {
var t = this;
setTimeout(function() {
e(t).focus(), n && n.call(t)
}, r)
}) : t.apply(this, arguments)
}
}(e.fn.focus),scrollParent: function() {
var t;
return t = e.ui.ie && /(static|relative)/.test(this.css("position")) || /absolute/.test(this.css("position")) ? this.parents().filter(function() {
return /(relative|absolute|fixed)/.test(e.css(this, "position")) && /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
}).eq(0) : this.parents().filter(function() {
return /(auto|scroll)/.test(e.css(this, "overflow") + e.css(this, "overflow-y") + e.css(this, "overflow-x"))
}).eq(0), /fixed/.test(this.css("position")) || !t.length ? e(document) : t
},zIndex: function(r) {
if (r !== t)
return this.css("zIndex", r);
if (this.length)
for (var n, i, a = e(this[0]); a.length && a[0] !== document; ) {
if (n = a.css("position"), ("absolute" === n || "relative" === n || "fixed" === n) && (i = parseInt(a.css("zIndex"), 10), !isNaN(i) && 0 !== i))
return i;
a = a.parent()
}
return 0
},uniqueId: function() {
return this.each(function() {
this.id || (this.id = "ui-id-" + ++i)
})
},removeUniqueId: function() {
return this.each(function() {
a.test(this.id) && e(this).removeAttr("id")
})
}}), e.extend(e.expr[":"], {data: e.expr.createPseudo ? e.expr.createPseudo(function(t) {
return function(r) {
return !!e.data(r, t)
}
}) : function(t, r, n) {
return !!e.data(t, n[3])
},focusable: function(t) {
return r(t, !isNaN(e.attr(t, "tabindex")))
},tabbable: function(t) {
var n = e.attr(t, "tabindex"), i = isNaN(n);
return (i || n >= 0) && r(t, !i)
}}), e("<a>").outerWidth(1).jquery || e.each(["Width", "Height"], function(r, n) {
function i(t, r, n, i) {
return e.each(a, function() {
r -= parseFloat(e.css(t, "padding" + this)) || 0, n && (r -= parseFloat(e.css(t, "border" + this + "Width")) || 0), i && (r -= parseFloat(e.css(t, "margin" + this)) || 0)
}), r
}
var a = "Width" === n ? ["Left", "Right"] : ["Top", "Bottom"], o = n.toLowerCase(), s = {innerWidth: e.fn.innerWidth,innerHeight: e.fn.innerHeight,outerWidth: e.fn.outerWidth,outerHeight: e.fn.outerHeight};
e.fn["inner" + n] = function(r) {
return r === t ? s["inner" + n].call(this) : this.each(function() {
e(this).css(o, i(this, r) + "px")
})
}, e.fn["outer" + n] = function(t, r) {
return "number" != typeof t ? s["outer" + n].call(this, t) : this.each(function() {
e(this).css(o, i(this, t, !0, r) + "px")
})
}
}), e.fn.addBack || (e.fn.addBack = function(e) {
return this.add(null == e ? this.prevObject : this.prevObject.filter(e))
}), e("<a>").data("a-b", "a").removeData("a-b").data("a-b") && (e.fn.removeData = function(t) {
return function(r) {
return arguments.length ? t.call(this, e.camelCase(r)) : t.call(this)
}
}(e.fn.removeData)), e.ui.ie = !!/msie [\w.]+/.exec(navigator.userAgent.toLowerCase()), e.support.selectstart = "onselectstart" in document.createElement("div"), e.fn.extend({disableSelection: function() {
return this.bind((e.support.selectstart ? "selectstart" : "mousedown") + ".ui-disableSelection", function(e) {
e.preventDefault()
})
},enableSelection: function() {
return this.unbind(".ui-disableSelection")
}}), e.extend(e.ui, {plugin: {add: function(t, r, n) {
var i, a = e.ui[t].prototype;
for (i in n)
a.plugins[i] = a.plugins[i] || [], a.plugins[i].push([r, n[i]])
},call: function(e, t, r) {
var n, i = e.plugins[t];
if (i && e.element[0].parentNode && 11 !== e.element[0].parentNode.nodeType)
for (n = 0; n < i.length; n++)
e.options[i[n][0]] && i[n][1].apply(e.element, r)
}},hasScroll: function(t, r) {
if ("hidden" === e(t).css("overflow"))
return !1;
var n = r && "left" === r ? "scrollLeft" : "scrollTop", i = !1;
return t[n] > 0 ? !0 : (t[n] = 1, i = t[n] > 0, t[n] = 0, i)
}})
}(t), e.exports = t.ui
}).call(t, r(1))
}, function(e, t, r) {
(function(t) { /*!
* jQuery UI Datepicker 1.10.3
* http://jqueryui.com
*
* Copyright 2013 jQuery Foundation and other contributors
* Released under the MIT license.
* http://jquery.org/license
*
* http://api.jqueryui.com/datepicker/
*
* Depends:
* jquery.ui.core.js
*/
!function(e, t) {
function r() {
this._curInst = null, this._keyEvent = !1, this._disabledInputs = [], this._datepickerShowing = !1, this._inDialog = !1, this._mainDivId = "ui-datepicker-div", this._inlineClass = "ui-datepicker-inline", this._appendClass = "ui-datepicker-append", this._triggerClass = "ui-datepicker-trigger", this._dialogClass = "ui-datepicker-dialog", this._disableClass = "ui-datepicker-disabled", this._unselectableClass = "ui-datepicker-unselectable", this._currentClass = "ui-datepicker-current-day", this._dayOverClass = "ui-datepicker-days-cell-over", this.regional = [], this.regional[""] = {closeText: "Done",prevText: "Prev",nextText: "Next",currentText: "Today",monthNames: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],monthNamesShort: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"],dayNames: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],dayNamesShort: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],dayNamesMin: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],weekHeader: "Wk",dateFormat: "mm/dd/yy",firstDay: 0,isRTL: !1,showMonthAfterYear: !1,yearSuffix: ""}, this._defaults = {showOn: "focus",showAnim: "fadeIn",showOptions: {},defaultDate: null,appendText: "",buttonText: "...",buttonImage: "",buttonImageOnly: !1,hideIfNoPrevNext: !1,navigationAsDateFormat: !1,gotoCurrent: !1,changeMonth: !1,changeYear: !1,yearRange: "c-10:c+10",showOtherMonths: !1,selectOtherMonths: !1,showWeek: !1,calculateWeek: this.iso8601Week,shortYearCutoff: "+10",minDate: null,maxDate: null,duration: "fast",beforeShowDay: null,beforeShow: null,onSelect: null,onChangeMonthYear: null,onClose: null,numberOfMonths: 1,showCurrentAtPos: 0,stepMonths: 1,stepBigMonths: 12,altField: "",altFormat: "",constrainInput: !0,showButtonPanel: !1,autoSize: !1,disabled: !1}, e.extend(this._defaults, this.regional[""]), this.dpDiv = n(e("<div id='" + this._mainDivId + "' class='ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>"))
}
function n(t) {
var r = "button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a";
return t.delegate(r, "mouseout", function() {
e(this).removeClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).removeClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).removeClass("ui-datepicker-next-hover")
}).delegate(r, "mouseover", function() {
e.datepicker._isDisabledDatepicker(a.inline ? t.parent()[0] : a.input[0]) || (e(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover"), e(this).addClass("ui-state-hover"), -1 !== this.className.indexOf("ui-datepicker-prev") && e(this).addClass("ui-datepicker-prev-hover"), -1 !== this.className.indexOf("ui-datepicker-next") && e(this).addClass("ui-datepicker-next-hover"))
})
}
function i(t, r) {
e.extend(t, r);
for (var n in r)
null == r[n] && (t[n] = r[n]);
return t
}
e.extend(e.ui, {datepicker: {version: "1.10.3"}});
var a, o = "datepicker";
e.extend(r.prototype, {markerClassName: "hasDatepicker",maxRows: 4,_widgetDatepicker: function() {
return this.dpDiv
},setDefaults: function(e) {
return i(this._defaults, e || {}), this
},_attachDatepicker: function(t, r) {
var n, i, a;
n = t.nodeName.toLowerCase(), i = "div" === n || "span" === n, t.id || (this.uuid += 1, t.id = "dp" + this.uuid), a = this._newInst(e(t), i), a.settings = e.extend({}, r || {}), "input" === n ? this._connectDatepicker(t, a) : i && this._inlineDatepicker(t, a)
},_newInst: function(t, r) {
var i = t[0].id.replace(/([^A-Za-z0-9_\-])/g, "\\\\$1");
return {id: i,input: t,selectedDay: 0,selectedMonth: 0,selectedYear: 0,drawMonth: 0,drawYear: 0,inline: r,dpDiv: r ? n(e("<div class='" + this._inlineClass + " ui-datepicker ui-widget ui-widget-content ui-helper-clearfix ui-corner-all'></div>")) : this.dpDiv}
},_connectDatepicker: function(t, r) {
var n = e(t);
r.append = e([]), r.trigger = e([]), n.hasClass(this.markerClassName) || (this._attachments(n, r), n.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp), this._autoSize(r), e.data(t, o, r), r.settings.disabled && this._disableDatepicker(t))
},_attachments: function(t, r) {
var n, i, a, o = this._get(r, "appendText"), s = this._get(r, "isRTL");
r.append && r.append.remove(), o && (r.append = e("<span class='" + this._appendClass + "'>" + o + "</span>"), t[s ? "before" : "after"](r.append)), t.unbind("focus", this._showDatepicker), r.trigger && r.trigger.remove(), n = this._get(r, "showOn"), ("focus" === n || "both" === n) && t.focus(this._showDatepicker), ("button" === n || "both" === n) && (i = this._get(r, "buttonText"), a = this._get(r, "buttonImage"), r.trigger = e(this._get(r, "buttonImageOnly") ? e("<img/>").addClass(this._triggerClass).attr({src: a,alt: i,title: i}) : e("<button type='button'></button>").addClass(this._triggerClass).html(a ? e("<img/>").attr({src: a,alt: i,title: i}) : i)), t[s ? "before" : "after"](r.trigger), r.trigger.click(function() {
return e.datepicker._datepickerShowing && e.datepicker._lastInput === t[0] ? e.datepicker._hideDatepicker() : e.datepicker._datepickerShowing && e.datepicker._lastInput !== t[0] ? (e.datepicker._hideDatepicker(), e.datepicker._showDatepicker(t[0])) : e.datepicker._showDatepicker(t[0]), !1
}))
},_autoSize: function(e) {
if (this._get(e, "autoSize") && !e.inline) {
var t, r, n, i, a = new Date(2009, 11, 20), o = this._get(e, "dateFormat");
o.match(/[DM]/) && (t = function(e) {
for (r = 0, n = 0, i = 0; i < e.length; i++)
e[i].length > r && (r = e[i].length, n = i);
return n
}, a.setMonth(t(this._get(e, o.match(/MM/) ? "monthNames" : "monthNamesShort"))), a.setDate(t(this._get(e, o.match(/DD/) ? "dayNames" : "dayNamesShort")) + 20 - a.getDay())), e.input.attr("size", this._formatDate(e, a).length)
}
},_inlineDatepicker: function(t, r) {
var n = e(t);
n.hasClass(this.markerClassName) || (n.addClass(this.markerClassName).append(r.dpDiv), e.data(t, o, r), this._setDate(r, this._getDefaultDate(r), !0), this._updateDatepicker(r), this._updateAlternate(r), r.settings.disabled && this._disableDatepicker(t), r.dpDiv.css("display", "block"))
},_dialogDatepicker: function(t, r, n, a, s) {
var u, l, c, p, f, d = this._dialogInst;
return d || (this.uuid += 1, u = "dp" + this.uuid, this._dialogInput = e("<input type='text' id='" + u + "' style='position: absolute; top: -100px; width: 0px;'/>"), this._dialogInput.keydown(this._doKeyDown), e("body").append(this._dialogInput), d = this._dialogInst = this._newInst(this._dialogInput, !1), d.settings = {}, e.data(this._dialogInput[0], o, d)), i(d.settings, a || {}), r = r && r.constructor === Date ? this._formatDate(d, r) : r, this._dialogInput.val(r), this._pos = s ? s.length ? s : [s.pageX, s.pageY] : null, this._pos || (l = document.documentElement.clientWidth, c = document.documentElement.clientHeight, p = document.documentElement.scrollLeft || document.body.scrollLeft, f = document.documentElement.scrollTop || document.body.scrollTop, this._pos = [l / 2 - 100 + p, c / 2 - 150 + f]), this._dialogInput.css("left", this._pos[0] + 20 + "px").css("top", this._pos[1] + "px"), d.settings.onSelect = n, this._inDialog = !0, this.dpDiv.addClass(this._dialogClass), this._showDatepicker(this._dialogInput[0]), e.blockUI && e.blockUI(this.dpDiv), e.data(this._dialogInput[0], o, d), this
},_destroyDatepicker: function(t) {
var r, n = e(t), i = e.data(t, o);
n.hasClass(this.markerClassName) && (r = t.nodeName.toLowerCase(), e.removeData(t, o), "input" === r ? (i.append.remove(), i.trigger.remove(), n.removeClass(this.markerClassName).unbind("focus", this._showDatepicker).unbind("keydown", this._doKeyDown).unbind("keypress", this._doKeyPress).unbind("keyup", this._doKeyUp)) : ("div" === r || "span" === r) && n.removeClass(this.markerClassName).empty())
},_enableDatepicker: function(t) {
var r, n, i = e(t), a = e.data(t, o);
i.hasClass(this.markerClassName) && (r = t.nodeName.toLowerCase(), "input" === r ? (t.disabled = !1, a.trigger.filter("button").each(function() {
this.disabled = !1
}).end().filter("img").css({opacity: "1.0",cursor: ""})) : ("div" === r || "span" === r) && (n = i.children("." + this._inlineClass), n.children().removeClass("ui-state-disabled"), n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !1)), this._disabledInputs = e.map(this._disabledInputs, function(e) {
return e === t ? null : e
}))
},_disableDatepicker: function(t) {
var r, n, i = e(t), a = e.data(t, o);
i.hasClass(this.markerClassName) && (r = t.nodeName.toLowerCase(), "input" === r ? (t.disabled = !0, a.trigger.filter("button").each(function() {
this.disabled = !0
}).end().filter("img").css({opacity: "0.5",cursor: "default"})) : ("div" === r || "span" === r) && (n = i.children("." + this._inlineClass), n.children().addClass("ui-state-disabled"), n.find("select.ui-datepicker-month, select.ui-datepicker-year").prop("disabled", !0)), this._disabledInputs = e.map(this._disabledInputs, function(e) {
return e === t ? null : e
}), this._disabledInputs[this._disabledInputs.length] = t)
},_isDisabledDatepicker: function(e) {
if (!e)
return !1;
for (var t = 0; t < this._disabledInputs.length; t++)
if (this._disabledInputs[t] === e)
return !0;
return !1
},_getInst: function(t) {
try {
return e.data(t, o)
} catch (r) {
throw "Missing instance data for this datepicker"
}
},_optionDatepicker: function(r, n, a) {
var o, s, u, l, c = this._getInst(r);
return 2 === arguments.length && "string" == typeof n ? "defaults" === n ? e.extend({}, e.datepicker._defaults) : c ? "all" === n ? e.extend({}, c.settings) : this._get(c, n) : null : (o = n || {}, "string" == typeof n && (o = {}, o[n] = a), void (c && (this._curInst === c && this._hideDatepicker(), s = this._getDateDatepicker(r, !0), u = this._getMinMaxDate(c, "min"), l = this._getMinMaxDate(c, "max"), i(c.settings, o), null !== u && o.dateFormat !== t && o.minDate === t && (c.settings.minDate = this._formatDate(c, u)), null !== l && o.dateFormat !== t && o.maxDate === t && (c.settings.maxDate = this._formatDate(c, l)), "disabled" in o && (o.disabled ? this._disableDatepicker(r) : this._enableDatepicker(r)), this._attachments(e(r), c), this._autoSize(c), this._setDate(c, s), this._updateAlternate(c), this._updateDatepicker(c))))
},_changeDatepicker: function(e, t, r) {
this._optionDatepicker(e, t, r)
},_refreshDatepicker: function(e) {
var t = this._getInst(e);
t && this._updateDatepicker(t)
},_setDateDatepicker: function(e, t) {
var r = this._getInst(e);
r && (this._setDate(r, t), this._updateDatepicker(r), this._updateAlternate(r))
},_getDateDatepicker: function(e, t) {
var r = this._getInst(e);
return r && !r.inline && this._setDateFromField(r, t), r ? this._getDate(r) : null
},_doKeyDown: function(t) {
var r, n, i, a = e.datepicker._getInst(t.target), o = !0, s = a.dpDiv.is(".ui-datepicker-rtl");
if (a._keyEvent = !0, e.datepicker._datepickerShowing)
switch (t.keyCode) {
case 9:
e.datepicker._hideDatepicker(), o = !1;
break;
case 13:
return i = e("td." + e.datepicker._dayOverClass + ":not(." + e.datepicker._currentClass + ")", a.dpDiv), i[0] && e.datepicker._selectDay(t.target, a.selectedMonth, a.selectedYear, i[0]), r = e.datepicker._get(a, "onSelect"), r ? (n = e.datepicker._formatDate(a), r.apply(a.input ? a.input[0] : null, [n, a])) : e.datepicker._hideDatepicker(), !1;
case 27:
e.datepicker._hideDatepicker();
break;
case 33:
e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(a, "stepBigMonths") : -e.datepicker._get(a, "stepMonths"), "M");
break;
case 34:
e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(a, "stepBigMonths") : +e.datepicker._get(a, "stepMonths"), "M");
break;
case 35:
(t.ctrlKey || t.metaKey) && e.datepicker._clearDate(t.target), o = t.ctrlKey || t.metaKey;
break;
case 36:
(t.ctrlKey || t.metaKey) && e.datepicker._gotoToday(t.target), o = t.ctrlKey || t.metaKey;
break;
case 37:
(t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, s ? 1 : -1, "D"), o = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? -e.datepicker._get(a, "stepBigMonths") : -e.datepicker._get(a, "stepMonths"), "M");
break;
case 38:
(t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, -7, "D"), o = t.ctrlKey || t.metaKey;
break;
case 39:
(t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, s ? -1 : 1, "D"), o = t.ctrlKey || t.metaKey, t.originalEvent.altKey && e.datepicker._adjustDate(t.target, t.ctrlKey ? +e.datepicker._get(a, "stepBigMonths") : +e.datepicker._get(a, "stepMonths"), "M");
break;
case 40:
(t.ctrlKey || t.metaKey) && e.datepicker._adjustDate(t.target, 7, "D"), o = t.ctrlKey || t.metaKey;
break;
default:
o = !1
}
else
36 === t.keyCode && t.ctrlKey ? e.datepicker._showDatepicker(this) : o = !1;
o && (t.preventDefault(), t.stopPropagation())
},_doKeyPress: function(t) {
var r, n, i = e.datepicker._getInst(t.target);
return e.datepicker._get(i, "constrainInput") ? (r = e.datepicker._possibleChars(e.datepicker._get(i, "dateFormat")), n = String.fromCharCode(null == t.charCode ? t.keyCode : t.charCode), t.ctrlKey || t.metaKey || " " > n || !r || r.indexOf(n) > -1) : void 0
},_doKeyUp: function(t) {
var r, n = e.datepicker._getInst(t.target);
if (n.input.val() !== n.lastVal)
try {
r = e.datepicker.parseDate(e.datepicker._get(n, "dateFormat"), n.input ? n.input.val() : null, e.datepicker._getFormatConfig(n)), r && (e.datepicker._setDateFromField(n), e.datepicker._updateAlternate(n), e.datepicker._updateDatepicker(n))
} catch (i) {
}
return !0
},_showDatepicker: function(t) {
if (t = t.target || t, "input" !== t.nodeName.toLowerCase() && (t = e("input", t.parentNode)[0]), !e.datepicker._isDisabledDatepicker(t) && e.datepicker._lastInput !== t) {
var r, n, a, o, s, u, l;
r = e.datepicker._getInst(t), e.datepicker._curInst && e.datepicker._curInst !== r && (e.datepicker._curInst.dpDiv.stop(!0, !0), r && e.datepicker._datepickerShowing && e.datepicker._hideDatepicker(e.datepicker._curInst.input[0])), n = e.datepicker._get(r, "beforeShow"), a = n ? n.apply(t, [t, r]) : {}, a !== !1 && (i(r.settings, a), r.lastVal = null, e.datepicker._lastInput = t, e.datepicker._setDateFromField(r), e.datepicker._inDialog && (t.value = ""), e.datepicker._pos || (e.datepicker._pos = e.datepicker._findPos(t), e.datepicker._pos[1] += t.offsetHeight), o = !1, e(t).parents().each(function() {
return o |= "fixed" === e(this).css("position"), !o
}), s = {left: e.datepicker._pos[0],top: e.datepicker._pos[1]}, e.datepicker._pos = null, r.dpDiv.empty(), r.dpDiv.css({position: "absolute",display: "block",top: "-1000px"}), e.datepicker._updateDatepicker(r), s = e.datepicker._checkOffset(r, s, o), r.dpDiv.css({position: e.datepicker._inDialog && e.blockUI ? "static" : o ? "fixed" : "absolute",display: "none",left: s.left + "px",top: s.top + "px"}), r.inline || (u = e.datepicker._get(r, "showAnim"), l = e.datepicker._get(r, "duration"), r.dpDiv.zIndex(e(t).zIndex() + 1), e.datepicker._datepickerShowing = !0, e.effects && e.effects.effect[u] ? r.dpDiv.show(u, e.datepicker._get(r, "showOptions"), l) : r.dpDiv[u || "show"](u ? l : null), e.datepicker._shouldFocusInput(r) && r.input.focus(), e.datepicker._curInst = r))
}
},_updateDatepicker: function(t) {
this.maxRows = 4, a = t, t.dpDiv.empty().append(this._generateHTML(t)), this._attachHandlers(t), t.dpDiv.find("." + this._dayOverClass + " a").mouseover();
var r, n = this._getNumberOfMonths(t), i = n[1], o = 17;
t.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width(""), i > 1 && t.dpDiv.addClass("ui-datepicker-multi-" + i).css("width", o * i + "em"), t.dpDiv[(1 !== n[0] || 1 !== n[1] ? "add" : "remove") + "Class"]("ui-datepicker-multi"), t.dpDiv[(this._get(t, "isRTL") ? "add" : "remove") + "Class"]("ui-datepicker-rtl"), t === e.datepicker._curInst && e.datepicker._datepickerShowing && e.datepicker._shouldFocusInput(t) && t.input.focus(), t.yearshtml && (r = t.yearshtml, setTimeout(function() {
r === t.yearshtml && t.yearshtml && t.dpDiv.find("select.ui-datepicker-year:first").replaceWith(t.yearshtml), r = t.yearshtml = null
}, 0))
},_shouldFocusInput: function(e) {
return e.input && e.input.is(":visible") && !e.input.is(":disabled") && !e.input.is(":focus")
},_checkOffset: function(t, r, n) {
var i = t.dpDiv.outerWidth(), a = t.dpDiv.outerHeight(), o = t.input ? t.input.outerWidth() : 0, s = t.input ? t.input.outerHeight() : 0, u = document.documentElement.clientWidth + (n ? 0 : e(document).scrollLeft()), l = document.documentElement.clientHeight + (n ? 0 : e(document).scrollTop());
return r.left -= this._get(t, "isRTL") ? i - o : 0, r.left -= n && r.left === t.input.offset().left ? e(document).scrollLeft() : 0, r.top -= n && r.top === t.input.offset().top + s ? e(document).scrollTop() : 0, r.left -= Math.min(r.left, r.left + i > u && u > i ? Math.abs(r.left + i - u) : 0), r.top -= Math.min(r.top, r.top + a > l && l > a ? Math.abs(a + s) : 0), r
},_findPos: function(t) {
for (var r, n = this._getInst(t), i = this._get(n, "isRTL"); t && ("hidden" === t.type || 1 !== t.nodeType || e.expr.filters.hidden(t)); )
t = t[i ? "previousSibling" : "nextSibling"];
return r = e(t).offset(), [r.left, r.top]
},_hideDatepicker: function(t) {
var r, n, i, a, s = this._curInst;
!s || t && s !== e.data(t, o) || this._datepickerShowing && (r = this._get(s, "showAnim"), n = this._get(s, "duration"), i = function() {
e.datepicker._tidyDialog(s)
}, e.effects && (e.effects.effect[r] || e.effects[r]) ? s.dpDiv.hide(r, e.datepicker._get(s, "showOptions"), n, i) : s.dpDiv["slideDown" === r ? "slideUp" : "fadeIn" === r ? "fadeOut" : "hide"](r ? n : null, i), r || i(), this._datepickerShowing = !1, a = this._get(s, "onClose"), a && a.apply(s.input ? s.input[0] : null, [s.input ? s.input.val() : "", s]), this._lastInput = null, this._inDialog && (this._dialogInput.css({position: "absolute",left: "0",top: "-100px"}), e.blockUI && (e.unblockUI(), e("body").append(this.dpDiv))), this._inDialog = !1)
},_tidyDialog: function(e) {
e.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")
},_checkExternalClick: function(t) {
if (e.datepicker._curInst) {
var r = e(t.target), n = e.datepicker._getInst(r[0]);
(r[0].id !== e.datepicker._mainDivId && 0 === r.parents("#" + e.datepicker._mainDivId).length && !r.hasClass(e.datepicker.markerClassName) && !r.closest("." + e.datepicker._triggerClass).length && e.datepicker._datepickerShowing && (!e.datepicker._inDialog || !e.blockUI) || r.hasClass(e.datepicker.markerClassName) && e.datepicker._curInst !== n) && e.datepicker._hideDatepicker()
}
},_adjustDate: function(t, r, n) {
var i = e(t), a = this._getInst(i[0]);
this._isDisabledDatepicker(i[0]) || (this._adjustInstDate(a, r + ("M" === n ? this._get(a, "showCurrentAtPos") : 0), n), this._updateDatepicker(a))
},_gotoToday: function(t) {
var r, n = e(t), i = this._getInst(n[0]);
this._get(i, "gotoCurrent") && i.currentDay ? (i.selectedDay = i.currentDay, i.drawMonth = i.selectedMonth = i.currentMonth, i.drawYear = i.selectedYear = i.currentYear) : (r = new Date, i.selectedDay = r.getDate(), i.drawMonth = i.selectedMonth = r.getMonth(), i.drawYear = i.selectedYear = r.getFullYear()), this._notifyChange(i), this._adjustDate(n)
},_selectMonthYear: function(t, r, n) {
var i = e(t), a = this._getInst(i[0]);
a["selected" + ("M" === n ? "Month" : "Year")] = a["draw" + ("M" === n ? "Month" : "Year")] = parseInt(r.options[r.selectedIndex].value, 10), this._notifyChange(a), this._adjustDate(i)
},_selectDay: function(t, r, n, i) {
var a, o = e(t);
e(i).hasClass(this._unselectableClass) || this._isDisabledDatepicker(o[0]) || (a = this._getInst(o[0]), a.selectedDay = a.currentDay = e("a", i).html(), a.selectedMonth = a.currentMonth = r, a.selectedYear = a.currentYear = n, this._selectDate(t, this._formatDate(a, a.currentDay, a.currentMonth, a.currentYear)))
},_clearDate: function(t) {
var r = e(t);
this._selectDate(r, "")
},_selectDate: function(t, r) {
var n, i = e(t), a = this._getInst(i[0]);
r = null != r ? r : this._formatDate(a), a.input && a.input.val(r), this._updateAlternate(a), n = this._get(a, "onSelect"), n ? n.apply(a.input ? a.input[0] : null, [r, a]) : a.input && a.input.trigger("change"), a.inline ? this._updateDatepicker(a) : (this._hideDatepicker(), this._lastInput = a.input[0], "object" != typeof a.input[0] && a.input.focus(), this._lastInput = null)
},_updateAlternate: function(t) {
var r, n, i, a = this._get(t, "altField");
a && (r = this._get(t, "altFormat") || this._get(t, "dateFormat"), n = this._getDate(t), i = this.formatDate(r, n, this._getFormatConfig(t)), e(a).each(function() {
e(this).val(i)
}))
},noWeekends: function(e) {
var t = e.getDay();
return [t > 0 && 6 > t, ""]
},iso8601Week: function(e) {
var t, r = new Date(e.getTime());
return r.setDate(r.getDate() + 4 - (r.getDay() || 7)), t = r.getTime(), r.setMonth(0), r.setDate(1), Math.floor(Math.round((t - r) / 864e5) / 7) + 1
},parseDate: function(t, r, n) {
if (null == t || null == r)
throw "Invalid arguments";
if (r = "object" == typeof r ? r.toString() : r + "", "" === r)
return null;
var i, a, o, s, u = 0, l = (n ? n.shortYearCutoff : null) || this._defaults.shortYearCutoff, c = "string" != typeof l ? l : (new Date).getFullYear() % 100 + parseInt(l, 10), p = (n ? n.dayNamesShort : null) || this._defaults.dayNamesShort, f = (n ? n.dayNames : null) || this._defaults.dayNames, d = (n ? n.monthNamesShort : null) || this._defaults.monthNamesShort, h = (n ? n.monthNames : null) || this._defaults.monthNames, g = -1, y = -1, m = -1, v = -1, b = !1, _ = function(e) {
var r = i + 1 < t.length && t.charAt(i + 1) === e;
return r && i++, r
}, E = function(e) {
var t = _(e), n = "@" === e ? 14 : "!" === e ? 20 : "y" === e && t ? 4 : "o" === e ? 3 : 2, i = new RegExp("^\\d{1," + n + "}"), a = r.substring(u).match(i);
if (!a)
throw "Missing number at position " + u;
return u += a[0].length, parseInt(a[0], 10)
}, C = function(t, n, i) {
var a = -1, o = e.map(_(t) ? i : n, function(e, t) {
return [[t, e]]
}).sort(function(e, t) {
return -(e[1].length - t[1].length)
});
if (e.each(o, function(e, t) {
var n = t[1];
return r.substr(u, n.length).toLowerCase() === n.toLowerCase() ? (a = t[0], u += n.length, !1) : void 0
}), -1 !== a)
return a + 1;
throw "Unknown name at position " + u
}, S = function() {
if (r.charAt(u) !== t.charAt(i))
throw "Unexpected literal at position " + u;
u++
};
for (i = 0; i < t.length; i++)
if (b)
"'" !== t.charAt(i) || _("'") ? S() : b = !1;
else
switch (t.charAt(i)) {
case "d":
m = E("d");
break;
case "D":
C("D", p, f);
break;
case "o":
v = E("o");
break;
case "m":
y = E("m");
break;
case "M":
y = C("M", d, h);
break;
case "y":
g = E("y");
break;
case "@":
s = new Date(E("@")), g = s.getFullYear(), y = s.getMonth() + 1, m = s.getDate();
break;
case "!":
s = new Date((E("!") - this._ticksTo1970) / 1e4), g = s.getFullYear(), y = s.getMonth() + 1, m = s.getDate();
break;
case "'":
_("'") ? S() : b = !0;
break;
default:
S()
}
if (u < r.length && (o = r.substr(u), !/^\s+/.test(o)))
throw "Extra/unparsed characters found in date: " + o;
if (-1 === g ? g = (new Date).getFullYear() : 100 > g && (g += (new Date).getFullYear() - (new Date).getFullYear() % 100 + (c >= g ? 0 : -100)), v > -1)
for (y = 1, m = v; ; ) {
if (a = this._getDaysInMonth(g, y - 1), a >= m)
break;
y++, m -= a
}
if (s = this._daylightSavingAdjust(new Date(g, y - 1, m)), s.getFullYear() !== g || s.getMonth() + 1 !== y || s.getDate() !== m)
throw "Invalid date";
return s
},ATOM: "yy-mm-dd",COOKIE: "D, dd M yy",ISO_8601: "yy-mm-dd",RFC_822: "D, d M y",RFC_850: "DD, dd-M-y",RFC_1036: "D, d M y",RFC_1123: "D, d M yy",RFC_2822: "D, d M yy",RSS: "D, d M y",TICKS: "!",TIMESTAMP: "@",W3C: "yy-mm-dd",_ticksTo1970: 24 * (718685 + Math.floor(492.5) - Math.floor(19.7) + Math.floor(4.925)) * 60 * 60 * 1e7,formatDate: function(e, t, r) {
if (!t)
return "";
var n, i = (r ? r.dayNamesShort : null) || this._defaults.dayNamesShort, a = (r ? r.dayNames : null) || this._defaults.dayNames, o = (r ? r.monthNamesShort : null) || this._defaults.monthNamesShort, s = (r ? r.monthNames : null) || this._defaults.monthNames, u = function(t) {
var r = n + 1 < e.length && e.charAt(n + 1) === t;
return r && n++, r
}, l = function(e, t, r) {
var n = "" + t;
if (u(e))
for (; n.length < r; )
n = "0" + n;
return n
}, c = function(e, t, r, n) {
return u(e) ? n[t] : r[t]
}, p = "", f = !1;
if (t)
for (n = 0; n < e.length; n++)
if (f)
"'" !== e.charAt(n) || u("'") ? p += e.charAt(n) : f = !1;
else
switch (e.charAt(n)) {
case "d":
p += l("d", t.getDate(), 2);
break;
case "D":
p += c("D", t.getDay(), i, a);
break;
case "o":
p += l("o", Math.round((new Date(t.getFullYear(), t.getMonth(), t.getDate()).getTime() - new Date(t.getFullYear(), 0, 0).getTime()) / 864e5), 3);
break;
case "m":
p += l("m", t.getMonth() + 1, 2);
break;
case "M":
p += c("M", t.getMonth(), o, s);
break;
case "y":
p += u("y") ? t.getFullYear() : (t.getYear() % 100 < 10 ? "0" : "") + t.getYear() % 100;
break;
case "@":
p += t.getTime();
break;
case "!":
p += 1e4 * t.getTime() + this._ticksTo1970;
break;
case "'":
u("'") ? p += "'" : f = !0;
break;
default:
p += e.charAt(n)
}
return p
},_possibleChars: function(e) {
var t, r = "", n = !1, i = function(r) {
var n = t + 1 < e.length && e.charAt(t + 1) === r;
return n && t++, n
};
for (t = 0; t < e.length; t++)
if (n)
"'" !== e.charAt(t) || i("'") ? r += e.charAt(t) : n = !1;
else
switch (e.charAt(t)) {
case "d":
case "m":
case "y":
case "@":
r += "0123456789";
break;
case "D":
case "M":
return null;
case "'":
i("'") ? r += "'" : n = !0;
break;
default:
r += e.charAt(t)
}
return r
},_get: function(e, r) {
return e.settings[r] !== t ? e.settings[r] : this._defaults[r]
},_setDateFromField: function(e, t) {
if (e.input.val() !== e.lastVal) {
var r = this._get(e, "dateFormat"), n = e.lastVal = e.input ? e.input.val() : null, i = this._getDefaultDate(e), a = i, o = this._getFormatConfig(e);
try {
a = this.parseDate(r, n, o) || i
} catch (s) {
n = t ? "" : n
}
e.selectedDay = a.getDate(), e.drawMonth = e.selectedMonth = a.getMonth(), e.drawYear = e.selectedYear = a.getFullYear(), e.currentDay = n ? a.getDate() : 0, e.currentMonth = n ? a.getMonth() : 0, e.currentYear = n ? a.getFullYear() : 0, this._adjustInstDate(e)
}
},_getDefaultDate: function(e) {
return this._restrictMinMax(e, this._determineDate(e, this._get(e, "defaultDate"), new Date))
},_determineDate: function(t, r, n) {
var i = function(e) {
var t = new Date;
return t.setDate(t.getDate() + e), t
}, a = function(r) {
try {
return e.datepicker.parseDate(e.datepicker._get(t, "dateFormat"), r, e.datepicker._getFormatConfig(t))
} catch (n) {
}
for (var i = (r.toLowerCase().match(/^c/) ? e.datepicker._getDate(t) : null) || new Date, a = i.getFullYear(), o = i.getMonth(), s = i.getDate(), u = /([+\-]?[0-9]+)\s*(d|D|w|W|m|M|y|Y)?/g, l = u.exec(r); l; ) {
switch (l[2] || "d") {
case "d":
case "D":
s += parseInt(l[1], 10);
break;
case "w":
case "W":
s += 7 * parseInt(l[1], 10);
break;
case "m":
case "M":
o += parseInt(l[1], 10), s = Math.min(s, e.datepicker._getDaysInMonth(a, o));
break;
case "y":
case "Y":
a += parseInt(l[1], 10), s = Math.min(s, e.datepicker._getDaysInMonth(a, o))
}
l = u.exec(r)
}
return new Date(a, o, s)
}, o = null == r || "" === r ? n : "string" == typeof r ? a(r) : "number" == typeof r ? isNaN(r) ? n : i(r) : new Date(r.getTime());
return o = o && "Invalid Date" === o.toString() ? n : o, o && (o.setHours(0), o.setMinutes(0), o.setSeconds(0), o.setMilliseconds(0)), this._daylightSavingAdjust(o)
},_daylightSavingAdjust: function(e) {
return e ? (e.setHours(e.getHours() > 12 ? e.getHours() + 2 : 0), e) : null
},_setDate: function(e, t, r) {
var n = !t, i = e.selectedMonth, a = e.selectedYear, o = this._restrictMinMax(e, this._determineDate(e, t, new Date));
e.selectedDay = e.currentDay = o.getDate(), e.drawMonth = e.selectedMonth = e.currentMonth = o.getMonth(), e.drawYear = e.selectedYear = e.currentYear = o.getFullYear(), i === e.selectedMonth && a === e.selectedYear || r || this._notifyChange(e), this._adjustInstDate(e), e.input && e.input.val(n ? "" : this._formatDate(e))
},_getDate: function(e) {
var t = !e.currentYear || e.input && "" === e.input.val() ? null : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay));
return t
},_attachHandlers: function(t) {
var r = this._get(t, "stepMonths"), n = "#" + t.id.replace(/\\\\/g, "\\");
t.dpDiv.find("[data-handler]").map(function() {
var t = {prev: function() {
e.datepicker._adjustDate(n, -r, "M")
},next: function() {
e.datepicker._adjustDate(n, +r, "M")
},hide: function() {
e.datepicker._hideDatepicker()
},today: function() {
e.datepicker._gotoToday(n)
},selectDay: function() {
return e.datepicker._selectDay(n, +this.getAttribute("data-month"), +this.getAttribute("data-year"), this), !1
},selectMonth: function() {
return e.datepicker._selectMonthYear(n, this, "M"), !1
},selectYear: function() {
return e.datepicker._selectMonthYear(n, this, "Y"), !1
}};
e(this).bind(this.getAttribute("data-event"), t[this.getAttribute("data-handler")])
})
},_generateHTML: function(e) {
var t, r, n, i, a, o, s, u, l, c, p, f, d, h, g, y, m, v, b, _, E, C, S, A, T, w, k, I, x, D, N, B, L, R, P, O, U, M, F, j = new Date, V = this._daylightSavingAdjust(new Date(j.getFullYear(), j.getMonth(), j.getDate())), H = this._get(e, "isRTL"), q = this._get(e, "showButtonPanel"), K = this._get(e, "hideIfNoPrevNext"), G = this._get(e, "navigationAsDateFormat"), Y = this._getNumberOfMonths(e), W = this._get(e, "showCurrentAtPos"), z = this._get(e, "stepMonths"), Q = 1 !== Y[0] || 1 !== Y[1], X = this._daylightSavingAdjust(e.currentDay ? new Date(e.currentYear, e.currentMonth, e.currentDay) : new Date(9999, 9, 9)), $ = this._getMinMaxDate(e, "min"), J = this._getMinMaxDate(e, "max"), Z = e.drawMonth - W, et = e.drawYear;
if (0 > Z && (Z += 12, et--), J)
for (t = this._daylightSavingAdjust(new Date(J.getFullYear(), J.getMonth() - Y[0] * Y[1] + 1, J.getDate())), t = $ && $ > t ? $ : t; this._daylightSavingAdjust(new Date(et, Z, 1)) > t; )
Z--, 0 > Z && (Z = 11, et--);
for (e.drawMonth = Z, e.drawYear = et, r = this._get(e, "prevText"), r = G ? this.formatDate(r, this._daylightSavingAdjust(new Date(et, Z - z, 1)), this._getFormatConfig(e)) : r, n = this._canAdjustMonth(e, -1, et, Z) ? "<a class='ui-datepicker-prev ui-corner-all' data-handler='prev' data-event='click' title='" + r + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "e" : "w") + "'>" + r + "</span></a>" : K ? "" : "<a class='ui-datepicker-prev ui-corner-all ui-state-disabled' title='" + r + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "e" : "w") + "'>" + r + "</span></a>", i = this._get(e, "nextText"), i = G ? this.formatDate(i, this._daylightSavingAdjust(new Date(et, Z + z, 1)), this._getFormatConfig(e)) : i, a = this._canAdjustMonth(e, 1, et, Z) ? "<a class='ui-datepicker-next ui-corner-all' data-handler='next' data-event='click' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "w" : "e") + "'>" + i + "</span></a>" : K ? "" : "<a class='ui-datepicker-next ui-corner-all ui-state-disabled' title='" + i + "'><span class='ui-icon ui-icon-circle-triangle-" + (H ? "w" : "e") + "'>" + i + "</span></a>", o = this._get(e, "currentText"), s = this._get(e, "gotoCurrent") && e.currentDay ? X : V, o = G ? this.formatDate(o, s, this._getFormatConfig(e)) : o, u = e.inline ? "" : "<button type='button' class='ui-datepicker-close ui-state-default ui-priority-primary ui-corner-all' data-handler='hide' data-event='click'>" + this._get(e, "closeText") + "</button>", l = q ? "<div class='ui-datepicker-buttonpane ui-widget-content'>" + (H ? u : "") + (this._isInRange(e, s) ? "<button type='button' class='ui-datepicker-current ui-state-default ui-priority-secondary ui-corner-all' data-handler='today' data-event='click'>" + o + "</button>" : "") + (H ? "" : u) + "</div>" : "", c = parseInt(this._get(e, "firstDay"), 10), c = isNaN(c) ? 0 : c, p = this._get(e, "showWeek"), f = this._get(e, "dayNames"), d = this._get(e, "dayNamesMin"), h = this._get(e, "monthNames"), g = this._get(e, "monthNamesShort"), y = this._get(e, "beforeShowDay"), m = this._get(e, "showOtherMonths"), v = this._get(e, "selectOtherMonths"), b = this._getDefaultDate(e), _ = "", C = 0; C < Y[0]; C++) {
for (S = "", this.maxRows = 4, A = 0; A < Y[1]; A++) {
if (T = this._daylightSavingAdjust(new Date(et, Z, e.selectedDay)), w = " ui-corner-all", k = "", Q) {
if (k += "<div class='ui-datepicker-group", Y[1] > 1)
switch (A) {
case 0:
k += " ui-datepicker-group-first", w = " ui-corner-" + (H ? "right" : "left");
break;
case Y[1] - 1:
k += " ui-datepicker-group-last", w = " ui-corner-" + (H ? "left" : "right");
break;
default:
k += " ui-datepicker-group-middle", w = ""
}
k += "'>"
}
for (k += "<div class='ui-datepicker-header ui-widget-header ui-helper-clearfix" + w + "'>" + (/all|left/.test(w) && 0 === C ? H ? a : n : "") + (/all|right/.test(w) && 0 === C ? H ? n : a : "") + this._generateMonthYearHeader(e, Z, et, $, J, C > 0 || A > 0, h, g) + "</div><table class='ui-datepicker-calendar'><thead><tr>", I = p ? "<th class='ui-datepicker-week-col'>" + this._get(e, "weekHeader") + "</th>" : "", E = 0; 7 > E; E++)
x = (E + c) % 7, I += "<th" + ((E + c + 6) % 7 >= 5 ? " class='ui-datepicker-week-end'" : "") + "><span title='" + f[x] + "'>" + d[x] + "</span></th>";
for (k += I + "</tr></thead><tbody>", D = this._getDaysInMonth(et, Z), et === e.selectedYear && Z === e.selectedMonth && (e.selectedDay = Math.min(e.selectedDay, D)), N = (this._getFirstDayOfMonth(et, Z) - c + 7) % 7, B = Math.ceil((N + D) / 7), L = Q && this.maxRows > B ? this.maxRows : B, this.maxRows = L, R = this._daylightSavingAdjust(new Date(et, Z, 1 - N)), P = 0; L > P; P++) {
for (k += "<tr>", O = p ? "<td class='ui-datepicker-week-col'>" + this._get(e, "calculateWeek")(R) + "</td>" : "", E = 0; 7 > E; E++)
U = y ? y.apply(e.input ? e.input[0] : null, [R]) : [!0, ""], M = R.getMonth() !== Z, F = M && !v || !U[0] || $ && $ > R || J && R > J, O += "<td class='" + ((E + c + 6) % 7 >= 5 ? " ui-datepicker-week-end" : "") + (M ? " ui-datepicker-other-month" : "") + (R.getTime() === T.getTime() && Z === e.selectedMonth && e._keyEvent || b.getTime() === R.getTime() && b.getTime() === T.getTime() ? " " + this._dayOverClass : "") + (F ? " " + this._unselectableClass + " ui-state-disabled" : "") + (M && !m ? "" : " " + U[1] + (R.getTime() === X.getTime() ? " " + this._currentClass : "") + (R.getTime() === V.getTime() ? " ui-datepicker-today" : "")) + "'" + (M && !m || !U[2] ? "" : " title='" + U[2].replace(/'/g, "&#39;") + "'") + (F ? "" : " data-handler='selectDay' data-event='click' data-month='" + R.getMonth() + "' data-year='" + R.getFullYear() + "'") + ">" + (M && !m ? "&#xa0;" : F ? "<span class='ui-state-default'>" + R.getDate() + "</span>" : "<a class='ui-state-default" + (R.getTime() === V.getTime() ? " ui-state-highlight" : "") + (R.getTime() === X.getTime() ? " ui-state-active" : "") + (M ? " ui-priority-secondary" : "") + "' href='#'>" + R.getDate() + "</a>") + "</td>", R.setDate(R.getDate() + 1), R = this._daylightSavingAdjust(R);
k += O + "</tr>"
}
Z++, Z > 11 && (Z = 0, et++), k += "</tbody></table>" + (Q ? "</div>" + (Y[0] > 0 && A === Y[1] - 1 ? "<div class='ui-datepicker-row-break'></div>" : "") : ""), S += k
}
_ += S
}
return _ += l, e._keyEvent = !1, _
},_generateMonthYearHeader: function(e, t, r, n, i, a, o, s) {
var u, l, c, p, f, d, h, g, y = this._get(e, "changeMonth"), m = this._get(e, "changeYear"), v = this._get(e, "showMonthAfterYear"), b = "<div class='ui-datepicker-title'>", _ = "";
if (a || !y)
_ += "<span class='ui-datepicker-month'>" + o[t] + "</span>";
else {
for (u = n && n.getFullYear() === r, l = i && i.getFullYear() === r, _ += "<select class='ui-datepicker-month' data-handler='selectMonth' data-event='change'>", c = 0; 12 > c; c++)
(!u || c >= n.getMonth()) && (!l || c <= i.getMonth()) && (_ += "<option value='" + c + "'" + (c === t ? " selected='selected'" : "") + ">" + s[c] + "</option>");
_ += "</select>"
}
if (v || (b += _ + (!a && y && m ? "" : "&#xa0;")), !e.yearshtml)
if (e.yearshtml = "", a || !m)
b += "<span class='ui-datepicker-year'>" + r + "</span>";
else {
for (p = this._get(e, "yearRange").split(":"), f = (new Date).getFullYear(), d = function(e) {
var t = e.match(/c[+\-].*/) ? r + parseInt(e.substring(1), 10) : e.match(/[+\-].*/) ? f + parseInt(e, 10) : parseInt(e, 10);
return isNaN(t) ? f : t
}, h = d(p[0]), g = Math.max(h, d(p[1] || "")), h = n ? Math.max(h, n.getFullYear()) : h, g = i ? Math.min(g, i.getFullYear()) : g, e.yearshtml += "<select class='ui-datepicker-year' data-handler='selectYear' data-event='change'>"; g >= h; h++)
e.yearshtml += "<option value='" + h + "'" + (h === r ? " selected='selected'" : "") + ">" + h + "</option>";
e.yearshtml += "</select>", b += e.yearshtml, e.yearshtml = null
}
return b += this._get(e, "yearSuffix"), v && (b += (!a && y && m ? "" : "&#xa0;") + _), b += "</div>"
},_adjustInstDate: function(e, t, r) {
var n = e.drawYear + ("Y" === r ? t : 0), i = e.drawMonth + ("M" === r ? t : 0), a = Math.min(e.selectedDay, this._getDaysInMonth(n, i)) + ("D" === r ? t : 0), o = this._restrictMinMax(e, this._daylightSavingAdjust(new Date(n, i, a)));
e.selectedDay = o.getDate(), e.drawMonth = e.selectedMonth = o.getMonth(), e.drawYear = e.selectedYear = o.getFullYear(), ("M" === r || "Y" === r) && this._notifyChange(e)
},_restrictMinMax: function(e, t) {
var r = this._getMinMaxDate(e, "min"), n = this._getMinMaxDate(e, "max"), i = r && r > t ? r : t;
return n && i > n ? n : i
},_notifyChange: function(e) {
var t = this._get(e, "onChangeMonthYear");
t && t.apply(e.input ? e.input[0] : null, [e.selectedYear, e.selectedMonth + 1, e])
},_getNumberOfMonths: function(e) {
var t = this._get(e, "numberOfMonths");
return null == t ? [1, 1] : "number" == typeof t ? [1, t] : t
},_getMinMaxDate: function(e, t) {
return this._determineDate(e, this._get(e, t + "Date"), null)
},_getDaysInMonth: function(e, t) {
return 32 - this._daylightSavingAdjust(new Date(e, t, 32)).getDate()
},_getFirstDayOfMonth: function(e, t) {
return new Date(e, t, 1).getDay()
},_canAdjustMonth: function(e, t, r, n) {
var i = this._getNumberOfMonths(e), a = this._daylightSavingAdjust(new Date(r, n + (0 > t ? t : i[0] * i[1]), 1));
return 0 > t && a.setDate(this._getDaysInMonth(a.getFullYear(), a.getMonth())), this._isInRange(e, a)
},_isInRange: function(e, t) {
var r, n, i = this._getMinMaxDate(e, "min"), a = this._getMinMaxDate(e, "max"), o = null, s = null, u = this._get(e, "yearRange");
return u && (r = u.split(":"), n = (new Date).getFullYear(), o = parseInt(r[0], 10), s = parseInt(r[1], 10), r[0].match(/[+\-].*/) && (o += n), r[1].match(/[+\-].*/) && (s += n)), (!i || t.getTime() >= i.getTime()) && (!a || t.getTime() <= a.getTime()) && (!o || t.getFullYear() >= o) && (!s || t.getFullYear() <= s)
},_getFormatConfig: function(e) {
var t = this._get(e, "shortYearCutoff");
return t = "string" != typeof t ? t : (new Date).getFullYear() % 100 + parseInt(t, 10), {shortYearCutoff: t,dayNamesShort: this._get(e, "dayNamesShort"),dayNames: this._get(e, "dayNames"),monthNamesShort: this._get(e, "monthNamesShort"),monthNames: this._get(e, "monthNames")}
},_formatDate: function(e, t, r, n) {
t || (e.currentDay = e.selectedDay, e.currentMonth = e.selectedMonth, e.currentYear = e.selectedYear);
var i = t ? "object" == typeof t ? t : this._daylightSavingAdjust(new Date(n, r, t)) : this._daylightSavingAdjust(new Date(e.currentYear, e.currentMonth, e.currentDay));
return this.formatDate(this._get(e, "dateFormat"), i, this._getFormatConfig(e))
}}), e.fn.datepicker = function(t) {
if (!this.length)
return this;
e.datepicker.initialized || (e(document).mousedown(e.datepicker._checkExternalClick), e.datepicker.initialized = !0), 0 === e("#" + e.datepicker._mainDivId).length && e("body").append(e.datepicker.dpDiv);
var r = Array.prototype.slice.call(arguments, 1);
return "string" != typeof t || "isDisabled" !== t && "getDate" !== t && "widget" !== t ? "option" === t && 2 === arguments.length && "string" == typeof arguments[1] ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(r)) : this.each(function() {
"string" == typeof t ? e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this].concat(r)) : e.datepicker._attachDatepicker(this, t)
}) : e.datepicker["_" + t + "Datepicker"].apply(e.datepicker, [this[0]].concat(r))
}, e.datepicker = new r, e.datepicker.initialized = !1, e.datepicker.uuid = (new Date).getTime(), e.datepicker.version = "1.10.3"
}(t), e.exports = t.ui.datepicker
}).call(t, r(1))
}, function(e, t, r) {
var n = r(11);
"string" == typeof n && (n = [[e.id, n, ""]]);
r(2003)(n, {})
}, function(e, t, r) {
var n = r(12);
"string" == typeof n && (n = [[e.id, n, ""]]);
r(2003)(n, {})
}, function(e, t, r) {
(function(t) {
!function() {
function r(e) {
n._localStorageEnabled && localStorage.setItem(n._localStorageKey, e)
}
var n, i = "assignments";
n = {_initialized: !1,_assignments: null,_localStorageKey: null,_localStorageEnabled: null,_availableLayers: null,_assignmentServiceUrl: null,_version: null,_anonymousId: null,initialize: function(e) {
return e = e || {}, n._availableLayers = e.availableLayers || [], n._localStorageKey = e.localStorageKey || i, n._assignmentServiceUrl = e.assignmentServiceUrl + e.anonymousUserId, n._version = e.version, n._anonymousId = e.anonymousUserId, n._localStorageEnabled = e.hasOwnProperty("localStorageEnabled") ? e.localStorageEnabled : !0, n._assignments = n.loadAssignments(), n._initialized = !0, n
},reset: function() {
n._availableLayers = [], n._localStorageKey = i, n._assignmentServiceUrl = "", n._version = null, n._anonymousId = null, n._assignments = null
},get: function(e, t) {
if (!n._initialized)
return !1;
var r = n.getLayers() || {};
return r.hasOwnProperty(e) && r[e].experimentName === t ? r[e].variantName : !1
},set: function(e, t, r) {
var i = n.getLayers();
i[e] = {experimentName: t,variantName: r}
},fetchAssignments: function() {
var e = t.Deferred(), r = n.getAssignments(), i = n._availableLayers, a = !!i.length, o = {layers: i.join(",")};
return n.isUpToDate(r, n._version) ? e.resolve(n.formatAssignments()) : a ? (n.clearAssignments(), t.ajax({url: n._assignmentServiceUrl,type: "GET",dataType: "json",data: o,timeout: 5e3}).done(function(t) {
n.buildAssignments(t), n.storeAssignments(), e.resolve(n.formatAssignments())
}).fail(e.reject)) : (n.clearAssignments(), e.resolve(n.formatAssignments())), e.promise()
},isUpToDate: function(e, t) {
return e && e._version === t
},loadAssignments: function() {
var e;
try {
e = JSON.parse(localStorage.getItem(n._localStorageKey))
} catch (t) {
e = {}
}
return e
},buildAssignments: function(e) {
n._assignments = {_version: n._version,layers: n.formatLayers(e)}
},storeAssignments: function() {
var e = n.getAssignments() || {};
r(JSON.stringify(e))
},clearAssignments: function() {
n._assignments = {}, r(JSON.stringify({}))
},getAssignments: function() {
return n._assignments
},getLayers: function() {
return n.getAssignments().layers
},formatAssignments: function() {
var e, t = {}, r = n.getLayers();
return r && (e = Object.keys(r), e.forEach(function(e) {
t[e] = r[e].variantId
})), t
},formatLayers: function(e) {
var t = {};
return e.forEach(function(e) {
t[e.layer_name] = {experimentName: e.experiment_name,variantName: e.variant_name,variantId: e.variant_id}
}), t
},serialize: function() {
var e, t, r = n.getLayers(), i = [];
for (t in r)
e = r[t], e && e.experimentName && e.variantName && i.push("[" + t + "] " + e.experimentName + ": " + e.variantName);
return i.join(", ")
}}, "undefined" != typeof e && e.exports ? e.exports = n : (window.SC = window.SC || {}, window.SC.Experiments = n)
}()
}).call(t, r(1))
}, function(e) {
!function() {
var t = {a: /[\u0061\u24D0\uFF41\u1E9A\u00E0\u00E1\u00E2\u1EA7\u1EA5\u1EAB\u1EA9\u00E3\u0101\u0103\u1EB1\u1EAF\u1EB5\u1EB3\u0227\u01E1\u00E4\u01DF\u1EA3\u00E5\u01FB\u01CE\u0201\u0203\u1EA1\u1EAD\u1EB7\u1E01\u0105\u2C65\u0250]/gi,aa: /[\uA733]/gi,ae: /[\u00E6\u01FD\u01E3]/gi,ao: /[\uA735]/gi,au: /[\uA737]/gi,av: /[\uA739\uA73B]/gi,ay: /[\uA73D]/gi,b: /[\u0062\u24D1\uFF42\u1E03\u1E05\u1E07\u0180\u0183\u0253]/gi,c: /[\u0063\u24D2\uFF43\u0107\u0109\u010B\u010D\u00E7\u1E09\u0188\u023C\uA73F\u2184]/gi,d: /[\u0064\u24D3\uFF44\u1E0B\u010F\u1E0D\u1E11\u1E13\u1E0F\u0111\u018C\u0256\u0257\uA77A]/gi,dz: /[\u01F3\u01C6]/gi,e: /[\u0065\u24D4\uFF45\u00E8\u00E9\u00EA\u1EC1\u1EBF\u1EC5\u1EC3\u1EBD\u0113\u1E15\u1E17\u0115\u0117\u00EB\u1EBB\u011B\u0205\u0207\u1EB9\u1EC7\u0229\u1E1D\u0119\u1E19\u1E1B\u0247\u025B\u01DD]/gi,f: /[\u0066\u24D5\uFF46\u1E1F\u0192\uA77C]/gi,g: /[\u0067\u24D6\uFF47\u01F5\u011D\u1E21\u011F\u0121\u01E7\u0123\u01E5\u0260\uA7A1\u1D79\uA77F]/gi,h: /[\u0068\u24D7\uFF48\u0125\u1E23\u1E27\u021F\u1E25\u1E29\u1E2B\u1E96\u0127\u2C68\u2C76\u0265]/gi,hv: /[\u0195]/gi,i: /[\u0069\u24D8\uFF49\u00EC\u00ED\u00EE\u0129\u012B\u012D\u00EF\u1E2F\u1EC9\u01D0\u0209\u020B\u1ECB\u012F\u1E2D\u0268\u0131]/gi,j: /[\u006A\u24D9\uFF4A\u0135\u01F0\u0249]/gi,k: /[\u006B\u24DA\uFF4B\u1E31\u01E9\u1E33\u0137\u1E35\u0199\u2C6A\uA741\uA743\uA745\uA7A3]/gi,l: /[\u006C\u24DB\uFF4C\u0140\u013A\u013E\u1E37\u1E39\u013C\u1E3D\u1E3B\u0142\u019A\u026B\u2C61\uA749\uA781\uA747]/gi,lj: /[\u01C9]/gi,m: /[\u006D\u24DC\uFF4D\u1E3F\u1E41\u1E43\u0271\u026F]/gi,n: /[\u006E\u24DD\uFF4E\u01F9\u0144\u00F1\u1E45\u0148\u1E47\u0146\u1E4B\u1E49\u019E\u0272\u0149\uA791\uA7A5]/gi,nj: /[\u01CC]/gi,o: /[\u006F\u24DE\uFF4F\u00F2\u00F3\u00F4\u1ED3\u1ED1\u1ED7\u1ED5\u00F5\u1E4D\u022D\u1E4F\u014D\u1E51\u1E53\u014F\u022F\u0231\u00F6\u022B\u1ECF\u0151\u01D2\u020D\u020F\u01A1\u1EDD\u1EDB\u1EE1\u1EDF\u1EE3\u1ECD\u1ED9\u01EB\u01ED\u00F8\u01FF\u0254\uA74B\uA74D\u0275]/gi,oi: /[\u01A3]/gi,ou: /[\u0223]/gi,oo: /[\uA74F]/gi,p: /[\u0070\u24DF\uFF50\u1E55\u1E57\u01A5\u1D7D\uA751\uA753\uA755]/gi,q: /[\u0071\u24E0\uFF51\u024B\uA757\uA759]/gi,r: /[\u0072\u24E1\uFF52\u0155\u1E59\u0159\u0211\u0213\u1E5B\u1E5D\u0157\u1E5F\u024D\u027D\uA75B\uA7A7\uA783]/gi,s: /[\u0073\u24E2\uFF53\u00DF\u015B\u1E65\u015D\u1E61\u0161\u1E67\u1E63\u1E69\u0219\u015F\u023F\uA7A9\uA785\u1E9B\u017F]/gi,t: /[\u0074\u24E3\uFF54\u1E6B\u1E97\u0165\u1E6D\u021B\u0163\u1E71\u1E6F\u0167\u01AD\u0288\u2C66\uA787]/gi,tz: /[\uA729]/gi,u: /[\u0075\u24E4\uFF55\u00F9\u00FA\u00FB\u0169\u1E79\u016B\u1E7B\u016D\u00FC\u01DC\u01D8\u01D6\u01DA\u1EE7\u016F\u0171\u01D4\u0215\u0217\u01B0\u1EEB\u1EE9\u1EEF\u1EED\u1EF1\u1EE5\u1E73\u0173\u1E77\u1E75\u0289]/gi,v: /[\u0076\u24E5\uFF56\u1E7D\u1E7F\u028B\uA75F\u028C]/gi,vy: /[\uA761]/gi,w: /[\u0077\u24E6\uFF57\u1E81\u1E83\u0175\u1E87\u1E85\u1E98\u1E89\u2C73]/gi,x: /[\u0078\u24E7\uFF58\u1E8B\u1E8D]/gi,y: /[\u0079\u24E8\uFF59\u1EF3\u00FD\u0177\u1EF9\u0233\u1E8F\u00FF\u1EF7\u1E99\u1EF5\u01B4\u024F\u1EFF]/gi,z: /[\u007A\u24E9\uFF5A\u017A\u1E91\u017C\u017E\u1E93\u1E95\u01B6\u0225\u0240\u2C6C\uA763]/gi}, r = function(e) {
for (var r in t)
e = e.replace(t[r], r);
return e
};
"undefined" != typeof e && e.exports ? e.exports = r : (window.SC = window.SC || {}, window.SC.replaceDiacritics = r)
}()
}, , , , function() {
window.atob = window.atob || function(e) {
var t, r, n, i, a, o = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
if (e = e.replace(/=+$/, ""), e.length % 4 === 1)
throw new Error("'atob' failed: The string to be decoded is not correctly encoded.");
for (t = 0, r = 0, n = ""; a = e.charAt(r++); ~a && (i = t % 4 ? 64 * i + a : a, t++ % 4) ? n += String.fromCharCode(255 & i >> (-2 * t & 6)) : 0)
a = o.indexOf(a);
return n
}
}, function() {
Function.prototype.bind || (Function.prototype.bind = function(e) {
var t = Array.prototype.slice, r = t.call(arguments, 1), n = this, i = function() {
}, a = function() {
if (i.prototype && this instanceof i) {
var a = n.apply(new i, r.concat(t.call(arguments)));
return Object(a) === a ? a : n
}
return n.apply(e, r.concat(t.call(arguments)))
};
return i.prototype = n.prototype, a.prototype = new i, a
})
}, function() {
!function(e) {
function t(e) {
return ("0" + e).substr(-2)
}
var r = e.prototype, n = 6e4, i = 864e5, a = {millisecond: 1,sec: 1e3,min: 60,hour: 60,day: 24,month: 30,year: 12}, o = ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"], s = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"], u = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
r.toRelativeTime = function(t, r) {
r = r || e.now();
var n, i = r - this, o = i > 0, s = null;
if (t = t && parseInt(t, 10) || 1e3, i = Math.abs(i), t >= i)
return o ? "Just now" : "Right now";
for (n in a)
if (a.hasOwnProperty(n)) {
if (i < a[n])
break;
s = n, i /= a[n]
}
return i = Math.floor(i), 1 !== i && (s += "s"), [o ? "" : "In", i, s].filter(Boolean).join(" ")
}, r.format = function(e) {
var r, n, i, a, l;
if ("relative" === e)
return this.toRelativeTime();
switch (r = this.getDate(), n = this.getDay(), i = this.getMonth(), a = this.getFullYear(), l = t(this.getMinutes()), e) {
case "iso":
return a + "-" + t(i + 1) + "-" + t(r);
case "readable":
return r + " " + o[i] + " " + a;
case "readable_time":
return [r, o[i], a, [this.getHours(), l].join(":")].join(" ");
case "readable_abbreviated":
return s[i] + " " + r + ", " + a;
case "readable_with_weekday":
return u[n] + ", " + [r, o[i], a].join(" ");
default:
return r + "/" + (i + 1) + "/" + a
}
}, e.fromString = function(t) {
var r = e.parse(t);
return new e(r ? r : t)
}, function() {
var t = 0;
e.setServerTime = function(r) {
var n, a;
return n = "number" == typeof r ? new e(r) : e.fromString(r), a = n - e.now(), Math.abs(a) > 7 * i ? !1 : (t = a, !0)
}, e.atServer = function() {
return new e(e.now() + t)
}, e.nowAtServer = function() {
return e.now() + t
}, e.guessTimezone = function() {
var r = t % i, a = (new e).getTimezoneOffset();
return Math.abs(r) > 20 * n && (r = 30 * Math.round(r / (30 * n)) * n, a += r / n), a
}, e.getTimezoneFormatted = function(e) {
var t = e > 0 ? "-" : "+";
return e = Math.abs(e), t + ("0" + Math.floor(e / 60)).substr(-2) + ("0" + e % 60).substr(-2)
}
}()
}(Date)
}, function() {
!function(e, t, r) {
function n(e, t, n, a) {
if (!e[t]) {
var o = i(t);
r.some(function(r) {
return a && (r = i(r)), e[t] = e[r + o], e[t]
}), e[t] = e[t] || n
}
}
function i(e) {
return e && (e = e[0].toUpperCase() + e.substr(1)), e
}
n(e, "MutationObserver", null, !0), n(t, "getUserMedia"), n(e, "AudioContext"), n(e, "URL"), n(e, "requestAnimationFrame", function(t) {
return e.setTimeout(t, 16)
}), n(e, "cancelAnimationFrame", function(t) {
e.clearTimeout(t)
})
}(window, navigator, ["webkit", "moz", "o", "ms"])
}, function(e, t, r) {
(function(e) {
e.extend(e.Event.prototype, {isMetaKey: function() {
return this.metaKey || this.shiftKey || this.ctrlKey || this.altKey
},isInput: function() {
return this.target && /input|textarea|select/i.test(this.target.nodeName)
},isMiddleClick: function() {
return 2 === this.which
}}), e.event.props.push("dataTransfer")
}).call(t, r(1))
}, function(e, t, r) {
(function(e, t) {
e.extend(e.expr[":"], {data: function(e, r, n) {
return !!t.data(e, n[3])
},focusable: function(e) {
var r = e.nodeName.toLowerCase(), n = t.attr(e, "tabindex");
return (/input|select|textarea|button|object/.test(r) ? !e.disabled : "a" === r || "area" === r ? e.href || !isNaN(n) : !isNaN(n)) && !t(e)["area" === r ? "parents" : "closest"](":hidden").length
},tabbable: function(e) {
var r = t.attr(e, "tabindex");
return (isNaN(r) || r >= 0) && t(e).is(":focusable")
}})
}).call(t, r(1), r(1))
}, function(e, t, r) {
(function(e) {
e.whenAll = function(t) {
if (t && t.length) {
var r, n, i = e.Deferred(), a = t.length, o = !1, s = [];
return n = function(e) {
s[e] = [].slice.call(arguments, 1), --a || i[o ? "reject" : "resolve"].apply(i, s)
}, r = function() {
o = !0
}, s.length = t.length, t.forEach(function(e, t) {
e.fail(r).always(n.bind(null, t))
}), i
}
return e.Deferred().resolve()
}
}).call(t, r(1))
}, function() {
RegExp.escape = function(e) {
return e.replace(/[-\/\\$\^*+?.()|\[\]{}]/g, "\\$&")
}
}, function(e, t, r) {
(function(e, t) {
!function(e) {
"withCredentials" in new window.XMLHttpRequest || !window.XDomainRequest || (e.ajaxTransport(function(t) {
if (t.crossDomain && t.async) {
t.timeout && (t.xdrTimeout = t.timeout, delete t.timeout);
var r;
return {send: function(n, i) {
function a(t, n, a, o) {
r.onload = r.onerror = r.ontimeout = e.noop, r = void 0, i(t, n, a, o)
}
var o;
t.url = t.url.replace(/\?|(.)$/, "$1?format=json&"), n.Authorization && (o = n.Authorization.split(" ")[1], t.url = t.url.replace(/\?|(.)$/, "$1?oauth_token=" + o + "&")), r = new window.XDomainRequest, r.open(t.type, t.url), r.onload = function() {
a(200, "OK", {text: r.responseText}, "Content-Type: " + r.contentType)
}, r.onerror = function() {
a(404, "Not Found")
}, r.onprogress = function() {
}, t.xdrTimeout && (r.ontimeout = function() {
a(0, "timeout")
}, r.timeout = t.xdrTimeout), r.send(t.hasContent && t.data || null)
},abort: function() {
r && (r.onerror = e.noop(), r.abort())
}}
}
}), t.ajaxPrefilter(function(e, r) {
var n = (e.type || "").toUpperCase(), i = r.data;
if ("POST" !== n && "GET" !== n) {
if (e.type = "POST", "string" == typeof i)
try {
i = JSON.parse(i)
} catch (a) {
}
e.data = t.param(t.extend(i, {_method: n})), "application/json" === e.contentType && (e.data = decodeURI(e.data), e.data = e.data.replace(/\[[0-9]+\]/g, "[]"), e.data = encodeURI(e.data))
}
}))
}(e)
}).call(t, r(1), r(1))
}, function(e, t, r) {
(function(e, t, r, n) {
!function(e, t) {
"undefined" != typeof n && n.exports ? n.exports = t() : e.AudioManager = t()
}(this, function() {
var i, a, o; /*! SWFObject v2.3.20130521 <http://github.com/swfobject/swfobject>
is released under the MIT License <http://www.opensource.org/licenses/mit-license.php>
*/
return function(e) {
function t(e, t) {
return _.call(e, t)
}
function r(e, t) {
var r, n, i, a, o, s, u, l, c, p, f = t && t.split("/"), d = v.map, h = d && d["*"] || {};
if (e && "." === e.charAt(0))
if (t) {
for (f = f.slice(0, f.length - 1), e = f.concat(e.split("/")), l = 0; l < e.length; l += 1)
if (p = e[l], "." === p)
e.splice(l, 1), l -= 1;
else if (".." === p) {
if (1 === l && (".." === e[2] || ".." === e[0]))
break;
l > 0 && (e.splice(l - 1, 2), l -= 2)
}
e = e.join("/")
} else
0 === e.indexOf("./") && (e = e.substring(2));
if ((f || h) && d) {
for (r = e.split("/"), l = r.length; l > 0; l -= 1) {
if (n = r.slice(0, l).join("/"), f)
for (c = f.length; c > 0; c -= 1)
if (i = d[f.slice(0, c).join("/")], i && (i = i[n])) {
a = i, o = l;
break
}
if (a)
break;
!s && h && h[n] && (s = h[n], u = l)
}
!a && s && (a = s, o = u), a && (r.splice(0, o, a), e = r.join("/"))
}
return e
}
function n(t, r) {
return function() {
return d.apply(e, E.call(arguments, 0).concat([t, r]))
}
}
function s(e) {
return function(t) {
return r(t, e)
}
}
function u(e) {
return function(t) {
y[e] = t
}
}
function l(r) {
if (t(m, r)) {
var n = m[r];
delete m[r], b[r] = !0, f.apply(e, n)
}
if (!t(y, r) && !t(b, r))
throw new Error("No " + r);
return y[r]
}
function c(e) {
var t, r = e ? e.indexOf("!") : -1;
return r > -1 && (t = e.substring(0, r), e = e.substring(r + 1, e.length)), [t, e]
}
function p(e) {
return function() {
return v && v.config && v.config[e] || {}
}
}
var f, d, h, g, y = {}, m = {}, v = {}, b = {}, _ = Object.prototype.hasOwnProperty, E = [].slice;
h = function(e, t) {
var n, i = c(e), a = i[0];
return e = i[1], a && (a = r(a, t), n = l(a)), a ? e = n && n.normalize ? n.normalize(e, s(t)) : r(e, t) : (e = r(e, t), i = c(e), a = i[0], e = i[1], a && (n = l(a))), {f: a ? a + "!" + e : e,n: e,pr: a,p: n}
}, g = {require: function(e) {
return n(e)
},exports: function(e) {
var t = y[e];
return "undefined" != typeof t ? t : y[e] = {}
},module: function(e) {
return {id: e,uri: "",exports: y[e],config: p(e)}
}}, f = function(r, i, a, o) {
var s, c, p, f, d, v, _ = [];
if (o = o || r, "function" == typeof a) {
for (i = !i.length && a.length ? ["require", "exports", "module"] : i, d = 0; d < i.length; d += 1)
if (f = h(i[d], o), c = f.f, "require" === c)
_[d] = g.require(r);
else if ("exports" === c)
_[d] = g.exports(r), v = !0;
else if ("module" === c)
s = _[d] = g.module(r);
else if (t(y, c) || t(m, c) || t(b, c))
_[d] = l(c);
else {
if (!f.p)
throw new Error(r + " missing " + c);
f.p.load(f.n, n(o, !0), u(c), {}), _[d] = y[c]
}
p = a.apply(y[r], _), r && (s && s.exports !== e && s.exports !== y[r] ? y[r] = s.exports : p === e && v || (y[r] = p))
} else
r && (y[r] = a)
}, i = a = d = function(t, r, n, i, a) {
return "string" == typeof t ? g[t] ? g[t](r) : l(h(t, r).f) : (t.splice || (v = t, r.splice ? (t = r, r = n, n = null) : t = e), r = r || function() {
}, "function" == typeof n && (n = i, i = a), i ? f(e, t, r, n) : setTimeout(function() {
f(e, t, r, n)
}, 4), d)
}, d.config = function(e) {
return v = e, v.deps && d(v.deps, v.callback), d
}, o = function(e, r, n) {
r.splice || (n = r, r = []), t(y, e) || t(m, e) || (m[e] = [e, r, n])
}, o.amd = {jQuery: !0}
}(), o("vendor/almond", function() {
}), function(t) {
function r() {
return D.pop() || []
}
function n() {
return N.pop() || {args: "",array: null,bottom: "",cache: null,"false": !1,firstArg: "",init: "",loop: "","null": !1,number: null,object: null,push: null,shadowedProps: null,string: null,top: "","true": !1,undefined: !1,useHas: !1,useKeys: !1}
}
function i(e) {
return "function" != typeof e.toString && "string" == typeof (e + "")
}
function a() {
}
function s(e) {
e.length = 0, D.length < R && D.push(e)
}
function u(e) {
var t = e.cache;
t && u(t), e.array = e.cache = e.object = e.number = e.string = null, N.length < R && N.push(e)
}
function l() {
}
function c(e, t, r, n) {
function i() {
var n = arguments, l = o ? this : t;
if (a || (e = t[s]), r.length && (n = n.length ? (n = lt.call(n), u ? n.concat(r) : r.concat(n)) : r), this instanceof i) {
l = f(e.prototype);
var c = e.apply(l, n);
return m(c) ? c : l
}
return e.apply(l, n)
}
var a = y(e), o = !r, s = t;
if (o) {
var u = n;
r = t
} else if (!a) {
if (!n)
throw new TypeError;
t = e
}
return i
}
function p() {
var e = n();
e.shadowedProps = O, e.array = e.bottom = e.loop = e.top = "", e.init = "iterable", e.useHas = !0, e.useKeys = !!_t;
for (var t, r = 0; t = arguments[r]; r++)
for (var i in t)
e[i] = t[i];
var a = e.args;
e.firstArg = /^[^,]+/.exec(a)[0];
var o = Function("errorClass, errorProto, hasOwnProperty, isArguments, isArray, isString, keys, lodash, objectProto, objectTypes, nonEnumProps, stringClass, stringProto, toString", "return function(" + a + ") {\n" + ht(e) + "\n}");
return u(e), o(V, X, rt, d, vt, v, _t, l, $, W, ft, Y, J, it)
}
function f(e) {
return m(e) ? ot(e) : {}
}
function d(e) {
return it.call(e) == U
}
function h(e) {
var t = [];
return At(e, function(e, r) {
y(e) && t.push(r)
}), t.sort()
}
function g(e, t, n, a, o, u) {
var c = n === L;
if ("function" == typeof n && !c) {
n = l.createCallback(n, a, 2);
var p = n(e, t);
if ("undefined" != typeof p)
return !!p
}
if (e === t)
return 0 !== e || 1 / e == 1 / t;
var f = typeof e, h = typeof t;
if (e === e && (!e || "function" != f && "object" != f) && (!t || "function" != h && "object" != h))
return !1;
if (null == e || null == t)
return e === t;
var m = it.call(e), v = it.call(t);
if (m == U && (m = K), v == U && (v = K), m != v)
return !1;
switch (m) {
case F:
case j:
return +e == +t;
case q:
return e != +e ? t != +t : 0 == e ? 1 / e == 1 / t : e == +t;
case G:
case Y:
return e == String(t)
}
var b = m == M;
if (!b) {
if (rt.call(e, "__wrapped__ ") || rt.call(t, "__wrapped__"))
return g(e.__wrapped__ || e, t.__wrapped__ || t, n, a, o, u);
if (m != K || !dt.nodeClass && (i(e) || i(t)))
return !1;
var _ = !dt.argsObject && d(e) ? Object : e.constructor, E = !dt.argsObject && d(t) ? Object : t.constructor;
if (_ != E && !(y(_) && _ instanceof _ && y(E) && E instanceof E))
return !1
}
var C = !o;
o || (o = r()), u || (u = r());
for (var S = o.length; S--; )
if (o[S] == e)
return u[S] == t;
var A = 0;
if (p = !0, o.push(e), u.push(t), b) {
if (S = e.length, A = t.length, p = A == e.length, !p && !c)
return p;
for (; A--; ) {
var T = S, w = t[A];
if (c)
for (; T-- && !(p = g(e[T], w, n, a, o, u)); )
;
else if (!(p = g(e[A], w, n, a, o, u)))
break
}
return p
}
return At(t, function(t, r, i) {
return rt.call(i, r) ? (A++, p = rt.call(e, r) && g(e[r], t, n, a, o, u)) : void 0
}), p && !c && At(e, function(e, t, r) {
return rt.call(r, t) ? p = --A > -1 : void 0
}), C && (s(o), s(u)), p
}
function y(e) {
return "function" == typeof e
}
function m(e) {
return !(!e || !W[typeof e])
}
function v(e) {
return "string" == typeof e || it.call(e) == Y
}
function b(e, t, r) {
var n = {};
if ("function" != typeof t)
for (var i = -1, a = et.apply(Q, lt.call(arguments, 1)), o = m(e) ? a.length : 0; ++i < o; ) {
var s = a[i];
s in e && (n[s] = e[s])
}
else
t = l.createCallback(t, r), At(e, function(e, r, i) {
t(e, r, i) && (n[r] = e)
});
return n
}
function _(e) {
for (var t = -1, r = _t(e), n = r.length, i = Array(n); ++t < n; )
i[t] = e[r[t]];
return i
}
function E(e, t, r) {
if (t && "undefined" == typeof r && vt(e))
for (var n = -1, i = e.length; ++n < i && t(e[n], n, e) !== !1; )
;
else
Et(e, t, r);
return e
}
function C(e, t) {
var r = lt.call(arguments, 2), n = -1, i = "function" == typeof t, a = e ? e.length : 0, o = Array("number" == typeof a ? a : 0);
return E(e, function(e) {
o[++n] = (i ? t : e[t]).apply(e, r)
}), o
}
function S(e, t) {
return dt.fastBind || at && arguments.length > 2 ? at.call.apply(at, arguments) : c(e, t, lt.call(arguments, 2))
}
function A(e) {
for (var t = arguments.length > 1 ? et.apply(Q, lt.call(arguments, 1)) : h(e), r = -1, n = t.length; ++r < n; ) {
var i = t[r];
e[i] = S(e[i], e)
}
return e
}
function T(e, t, r) {
if (null == e)
return I;
var n = typeof e;
if ("function" != n) {
if ("object" != n)
return function(t) {
return t[e]
};
var i = _t(e);
return function(t) {
for (var r = i.length, n = !1; r-- && (n = g(t[i[r]], e[i[r]], L)); )
;
return n
}
}
return "undefined" == typeof t || P && !P.test(tt.call(e)) ? e : 1 === r ? function(r) {
return e.call(t, r)
} : 2 === r ? function(r, n) {
return e.call(t, r, n)
} : 4 === r ? function(r, n, i, a) {
return e.call(t, r, n, i, a)
} : function(r, n, i) {
return e.call(t, r, n, i)
}
}
function w(e) {
var t, r;
return function() {
return t ? r : (t = !0, r = e.apply(this, arguments), e = null, r)
}
}
function I(e) {
return e
}
function x(e) {
var t = ++B;
return String(null == e ? "" : e) + t
}
var D = [], N = [], B = 0, L = {}, R = (+new Date + "", 40), P = (P = /\bthis\b/) && P.test(function() {
return this
}) && P, O = ["constructor", "hasOwnProperty", "isPrototypeOf", "propertyIsEnumerable", "toLocaleString", "toString", "valueOf"], U = "[object Arguments]", M = "[object Array]", F = "[object Boolean]", j = "[object Date]", V = "[object Error]", H = "[object Function]", q = "[object Number]", K = "[object Object]", G = "[object RegExp]", Y = "[object String]", W = {"boolean": !1,"function": !0,object: !0,number: !1,string: !1,undefined: !1}, z = W[typeof e] && e;
!z || z.global !== z && z.window !== z || (t = z);
var Q = [], X = Error.prototype, $ = Object.prototype, J = String.prototype, Z = (t._, RegExp("^" + String($.valueOf).replace(/[.*+?^${}()|[\]\\]/g, "\\$&").replace(/valueOf|for [^\]]+/g, ".+?") + "$")), et = (Math.ceil, t.clearTimeout, Q.concat), tt = (Math.floor, Function.prototype.toString), rt = $.hasOwnProperty, nt = (Q.push, $.propertyIsEnumerable), it = (t.setTimeout, $.toString), at = Z.test(at = it.bind) && at, ot = Z.test(ot = Object.create) && ot, st = Z.test(st = Array.isArray) && st, ut = (t.isFinite, t.isNaN, Z.test(ut = Object.keys) && ut), lt = (Math.max, Math.min, Math.random, Q.slice), ct = Z.test(t.attachEvent), pt = at && !/\n|true/.test(at + ct), ft = {};
ft[M] = ft[j] = ft[q] = {constructor: !0,toLocaleString: !0,toString: !0,valueOf: !0}, ft[F] = ft[Y] = {constructor: !0,toString: !0,valueOf: !0}, ft[V] = ft[H] = ft[G] = {constructor: !0,toString: !0}, ft[K] = {constructor: !0}, function() {
for (var e = O.length; e--; ) {
var t = O[e];
for (var r in ft)
rt.call(ft, r) && !rt.call(ft[r], t) && (ft[r][t] = !1)
}
}();
var dt = l.support = {};
!function() {
var e = function() {
this.x = 1
}, t = [];
e.prototype = {valueOf: 1,y: 1};
for (var r in new e)
t.push(r);
for (r in arguments)
;
dt.argsObject = arguments.constructor == Object && !(arguments instanceof Array), dt.argsClass = d(arguments), dt.enumErrorProps = nt.call(X, "message") || nt.call(X, "name"), dt.enumPrototypes = nt.call(e, "prototype"), dt.fastBind = at && !pt, dt.nonEnumArgs = 0 != r, dt.nonEnumShadows = !/valueOf/.test(t), dt.unindexedChars = "x"[0] + Object("x")[0] != "xx";
try {
dt.nodeClass = !(it.call(document) == K && !({toString: 0} + ""))
} catch (n) {
dt.nodeClass = !0
}
}(1);
var ht = function(e) {
var t = "var index, iterable = " + e.firstArg + ", result = " + e.init + ";\nif (!iterable) return result;\n" + e.top + ";";
e.array ? (t += "\nvar length = iterable.length; index = -1;\nif (" + e.array + ") { ", dt.unindexedChars && (t += "\n if (isString(iterable)) {\n iterable = iterable.split('')\n } "), t += "\n while (++index < length) {\n " + e.loop + ";\n }\n}\nelse { ") : dt.nonEnumArgs && (t += "\n var length = iterable.length; index = -1;\n if (length && isArguments(iterable)) {\n while (++index < length) {\n index += '';\n " + e.loop + ";\n }\n } else { "), dt.enumPrototypes && (t += "\n var skipProto = typeof iterable == 'function';\n "), dt.enumErrorProps && (t += "\n var skipErrorProps = iterable === errorProto || iterable instanceof Error;\n ");
var r = [];
if (dt.enumPrototypes && r.push('!(skipProto && index == "prototype")'), dt.enumErrorProps && r.push('!(skipErrorProps && (index == "message" || index == "name"))'), e.useHas && e.useKeys)
t += "\n var ownIndex = -1,\n ownProps = objectTypes[typeof iterable] && keys(iterable),\n length = ownProps ? ownProps.length : 0;\n\n while (++ownIndex < length) {\n index = ownProps[ownIndex];\n", r.length && (t += " if (" + r.join(" && ") + ") {\n "), t += e.loop + "; ", r.length && (t += "\n }"), t += "\n } ";
else if (t += "\n for (index in iterable) {\n", e.useHas && r.push("hasOwnProperty.call(iterable, index)"), r.length && (t += " if (" + r.join(" && ") + ") {\n "), t += e.loop + "; ", r.length && (t += "\n }"), t += "\n } ", dt.nonEnumShadows) {
for (t += "\n\n if (iterable !== objectProto) {\n var ctor = iterable.constructor,\n isProto = iterable === (ctor && ctor.prototype),\n className = iterable === stringProto ? stringClass : iterable === errorProto ? errorClass : toString.call(iterable),\n nonEnum = nonEnumProps[className];\n ", k = 0; 7 > k; k++)
t += "\n index = '" + e.shadowedProps[k] + "';\n if ((!(isProto && nonEnum[index]) && hasOwnProperty.call(iterable, index))", e.useHas || (t += " || (!nonEnum[index] && iterable[index] !== objectProto[index])"), t += ") {\n " + e.loop + ";\n } ";
t += "\n } "
}
return (e.array || dt.nonEnumArgs) && (t += "\n}"), t += e.bottom + ";\nreturn result"
}, gt = {args: "object, source, guard",top: "var args = arguments,\n argsIndex = 0,\n argsLength = typeof guard == 'number' ? 2 : args.length;\nwhile (++argsIndex < argsLength) {\n iterable = args[argsIndex];\n if (iterable && objectTypes[typeof iterable]) {",loop: "if (typeof result[index] == 'undefined') result[index] = iterable[index]",bottom: " }\n}"}, yt = {args: "collection, callback, thisArg",top: "callback = callback && typeof thisArg == 'undefined' ? callback : lodash.createCallback(callback, thisArg)",array: "typeof length == 'number'",loop: "if (callback(iterable[index], index, collection) === false) return result"}, mt = {top: "if (!objectTypes[typeof iterable]) return result;\n" + yt.top,array: !1};
if (!ot)
var f = function(e) {
if (m(e)) {
a.prototype = e;
var t = new a;
a.prototype = null
}
return t || {}
};
dt.argsClass || (d = function(e) {
return e ? rt.call(e, "callee") : !1
});
var vt = st || function(e) {
return e ? "object" == typeof e && it.call(e) == M : !1
}, bt = p({args: "object",init: "[]",top: "if (!(objectTypes[typeof object])) return result",loop: "result.push(index)"}), _t = ut ? function(e) {
return m(e) ? dt.enumPrototypes && "function" == typeof e || dt.nonEnumArgs && e.length && d(e) ? bt(e) : ut(e) : []
} : bt, Et = p(yt), Ct = p(gt, {top: gt.top.replace(";", ";\nif (argsLength > 3 && typeof args[argsLength - 2] == 'function') {\n var callback = lodash.createCallback(args[--argsLength - 1], args[argsLength--], 2);\n} else if (argsLength > 2 && typeof args[argsLength - 1] == 'function') {\n callback = args[--argsLength];\n}"),loop: "result[index] = callback ? callback(result[index], iterable[index]) : iterable[index]"}), St = p(gt), At = p(yt, mt, {useHas: !1});
y(/x/) && (y = function(e) {
return "function" == typeof e && it.call(e) == H
}), l.assign = Ct, l.bind = S, l.bindAll = A, l.createCallback = T, l.defaults = St, l.forEach = E, l.forIn = At, l.functions = h, l.invoke = C, l.keys = _t, l.once = w, l.pick = b, l.values = _, l.each = E, l.extend = Ct, l.methods = h, l.identity = I, l.isArguments = d, l.isArray = vt, l.isEqual = g, l.isFunction = y, l.isObject = m, l.isString = v, l.uniqueId = x, l.VERSION = "1.3.1", "function" == typeof o && "object" == typeof o.amd && o.amd && o("underscore", [], function() {
return l
})
}(this), o("browserutils", {supportHTML5Audio: function() {
var e;
try {
if (window.HTMLAudioElement && "undefined" != typeof Audio)
return e = new Audio, !0
} catch (t) {
return !1
}
},supportSourceSwappingWithPreload: function() {
return /Firefox/i.test(navigator.userAgent)
},isMobile: function() {
var e = window.navigator.userAgent, t = ["mobile", "iPhone", "iPad", "iPod", "Android", "Skyfire"];
return t.some(function(t) {
return t = new RegExp(t, "i"), t.test(e)
})
},canPlayType: function(e) {
var t = document.createElement("audio");
return t && t.canPlayType && t.canPlayType(e).match(/maybe|probably/i) ? !0 : !1
},isNativeHlsSupported: function() {
var e, t, r, n = navigator.userAgent, i = ["iPhone", "iPad", "iPod"];
return e = function(e) {
return e.test(n)
}, t = !e(/chrome/i) && !e(/opera/i) && e(/safari/i), r = i.some(function(t) {
return e(new RegExp(t, "i"))
}), r || t
},isMSESupported: function() {
return !(!window.MediaSource && !window.WebKitMediaSource)
},isMSESupportMPEG: function() {
var e = window.MediaSource || window.WebKitMediaSource;
return e ? e.isTypeSupported("audio/mpeg") : !1
}}), o("errors", {FLASH_HLS_PLAYLIST_NOT_FOUND: "HLS_PLAYLIST_NOT_FOUND",FLASH_HLS_PLAYLIST_SECURITY_ERROR: "HLS_SECURITY_ERROR",FLASH_HLS_NOT_VALID_PLAYLIST: "HLS_NOT_VALID_PLAYLIST",FLASH_HLS_NO_TS_IN_PLAYLIST: "HLS_NO_TS_IN_PLAYLIST",FLASH_HLS_NO_PLAYLIST_IN_MANIFEST: "HLS_NO_PLAYLIST_IN_MANIFEST",FLASH_HLS_TS_IS_CORRUPT: "HLS_TS_IS_CORRUPT",FLASH_HLS_FLV_TAG_CORRUPT: "HLS_FLV_TAG_CORRUPT",FLASH_HTTP_FILE_NOT_FOUND: "HTTP_FILE_NOT_FOUND",FLASH_RTMP_CONNECT_FAILED: "RTMP_CONNECT_FAILED",FLASH_RTMP_CONNECT_CLOSED: "RTMP_CONNECT_CLOSED",FLASH_RTMP_CANNOT_PLAY_STREAM: "RTMP_CANNOT_PLAY_STREAM",FLASH_PROXY_CANT_LOAD_FLASH: "CANT_LOAD_FLASH",FLASH_PROXY_FLASH_BLOCKED: "FLASH_PROXY_FLASH_BLOCKED",HTML5_AUDIO_ABORTED: "HTML5_AUDIO_ABORTED",HTML5_AUDIO_NETWORK: "HTML5_AUDIO_NETWORK",HTML5_AUDIO_DECODE: "HTML5_AUDIO_DECODE",HTML5_AUDIO_SRC_NOT_SUPPORTED: "HTML5_AUDIO_SRC_NOT_SUPPORTED",HTML5_AUDIO_ENDED_EARLY: "HTML5_AUDIO_ENDED_EARLY",HTML5_AUDIO_OVERRUN: "HTML5_AUDIO_OVERRUN",MSE_NOT_SUPPORTED: "MSE_NOT_SUPPORTED",MSE_MP3_NOT_SUPPORTED: "MSE_MP3_NOT_SUPPORTED",MSE_HLS_NOT_VALID_PLAYLIST: "MSE_HLS_NOT_VALID_PLAYLIST",MSE_HLS_PLAYLIST_NOT_FOUND: "MSE_HLS_PLAYLIST_NOT_FOUND",MSE_HLS_SEGMENT_NOT_FOUND: "MSE_HLS_SEGMENT_NOT_FOUND"}), o("vendor/events", ["require", "exports", "module", "underscore"], function(e, t, r) {
var n = e("underscore"), i = [], a = (i.push, i.slice), o = (i.splice, /\s+/), s = function(e, t, r, n) {
if (!r)
return !0;
if ("object" == typeof r)
for (var i in r)
e[t].apply(e, [i, r[i]].concat(n));
else {
if (!o.test(r))
return !0;
for (var a = r.split(o), s = 0, u = a.length; u > s; s++)
e[t].apply(e, [a[s]].concat(n))
}
}, u = function(e, t) {
var r, n = -1, i = e.length;
switch (t.length) {
case 0:
for (; ++n < i; )
r = e[n], r.callback.call(r.ctx);
return;
case 1:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx, t[0]);
return;
case 2:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx, t[0], t[1]);
return;
case 3:
for (; ++n < i; )
(r = e[n]).callback.call(r.ctx, t[0], t[1], t[2]);
return;
default:
for (; ++n < i; )
(r = e[n]).callback.apply(r.ctx, t)
}
}, l = {on: function(e, t, r) {
if (!s(this, "on", e, [t, r]) || !t)
return this;
this._events || (this._events = {});
var n = this._events[e] || (this._events[e] = []);
return n.push({callback: t,context: r,ctx: r || this}), this
},once: function(e, t, r) {
if (!s(this, "once", e, [t, r]) || !t)
return this;
var i = this, a = n.once(function() {
i.off(e, a), t.apply(this, arguments)
});
return a._callback = t, this.on(e, a, r)
},off: function(e, t, r) {
var i, a, o, u, l, c, p, f;
if (!this._events || !s(this, "off", e, [t, r]))
return this;
if (!e && !t && !r)
return this._events = {}, this;
for (u = e ? [e] : n.keys(this._events), l = 0, c = u.length; c > l; l++)
if (e = u[l], o = this._events[e]) {
if (this._events[e] = i = [], t || r)
for (p = 0, f = o.length; f > p; p++)
a = o[p], (t && t !== a.callback && t !== a.callback._callback || r && r !== a.context) && i.push(a);
i.length || delete this._events[e]
}
return this
},trigger: function(e, t) {
if (!this._events)
return this;
var t = a.call(arguments, 1);
if (!s(this, "trigger", e, t))
return this;
var r = this._events[e], n = this._events.all;
return r && u(r, t), n && u(n, arguments), this
},stopListening: function(e, t, r) {
var n = this._listeners;
if (!n)
return this;
var i = !t && !r;
"object" == typeof t && (r = this), e && ((n = {})[e._listenerId] = e);
for (var a in n)
n[a].off(t, r, this), i && delete this._listeners[a];
return this
}}, c = {listenTo: "on",listenToOnce: "once"};
n.each(c, function(e, t) {
l[t] = function(t, r, i) {
var a = this._listeners || (this._listeners = {}), o = t._listenerId || (t._listenerId = n.uniqueId("l"));
return a[o] = t, "object" == typeof r && (i = this), t[e](r, i, this), this
}
}), l.bind = l.on, l.unbind = l.off, r.exports = l
}), o("logger", ["require", "exports", "module"], function(e, t, r) {
var n;
r.exports = n = function(e, t, r) {
this.enabled = r.debug, this.type = e, this.id = t
}, n.prototype.log = function(e) {
this.enabled && window.console.log("#" + this.type + " " + this.id + "# " + e)
}
}), o("states", {PLAYING: "playing",LOADING: "loading",SEEKING: "seeking",PAUSED: "paused",ERROR: "error",IDLE: "idle",INITIALIZE: "initialize",ENDED: "ended",DEAD: "dead"}), o("vendor/swfobject", [], function() {
function e() {
if (!Y && document.getElementsByTagName("body")[0]) {
try {
var e, t = m("span");
t.style.display = "none", e = F.getElementsByTagName("body")[0].appendChild(t), e.parentNode.removeChild(e), e = null, t = null
} catch (r) {
return
}
Y = !0;
for (var n = H.length, i = 0; n > i; i++)
H[i]()
}
}
function t(e) {
Y ? e() : H[H.length] = e
}
function r(e) {
if (typeof M.addEventListener != N)
M.addEventListener("load", e, !1);
else if (typeof F.addEventListener != N)
F.addEventListener("load", e, !1);
else if (typeof M.attachEvent != N)
b(M, "onload", e);
else if ("function" == typeof M.onload) {
var t = M.onload;
M.onload = function() {
t(), e()
}
} else
M.onload = e
}
function n() {
var e = F.getElementsByTagName("body")[0], t = m(B);
t.setAttribute("style", "visibility: hidden;"), t.setAttribute("type", P);
var r = e.appendChild(t);
if (r) {
var n = 0;
!function a() {
if (typeof r.GetVariable != N)
try {
var o = r.GetVariable("$version");
o && (o = o.split(" ")[1].split(","), X.pv = [v(o[0]), v(o[1]), v(o[2])])
} catch (s) {
X.pv = [8, 0, 0]
}
else if (10 > n)
return n++, void setTimeout(a, 10);
e.removeChild(t), r = null, i()
}()
} else
i()
}
function i() {
var e = q.length;
if (e > 0)
for (var t = 0; e > t; t++) {
var r = q[t].id, n = q[t].callbackFn, i = {success: !1,id: r};
if (X.pv[0] > 0) {
var l = y(r);
if (l)
if (!_(q[t].swfVersion) || X.wk && X.wk < 312)
if (q[t].expressInstall && o()) {
var c = {};
c.data = q[t].expressInstall, c.width = l.getAttribute("width") || "0", c.height = l.getAttribute("height") || "0", l.getAttribute("class") && (c.styleclass = l.getAttribute("class")), l.getAttribute("align") && (c.align = l.getAttribute("align"));
for (var p = {}, f = l.getElementsByTagName("param"), d = f.length, h = 0; d > h; h++)
"movie" != f[h].getAttribute("name").toLowerCase() && (p[f[h].getAttribute("name")] = f[h].getAttribute("value"));
s(c, p, r, n)
} else
u(l), n && n(i);
else
C(r, !0), n && (i.success = !0, i.ref = a(r), i.id = r, n(i))
} else if (C(r, !0), n) {
var g = a(r);
g && typeof g.SetVariable != N && (i.success = !0, i.ref = g, i.id = g.id), n(i)
}
}
}
function a(e) {
var t = null, r = y(e);
return r && "OBJECT" === r.nodeName.toUpperCase() && (t = typeof r.SetVariable !== N ? r : r.getElementsByTagName(B)[0] || r), t
}
function o() {
return !W && _("6.0.65") && (X.win || X.mac) && !(X.wk && X.wk < 312)
}
function s(e, t, r, n) {
var i = y(r);
if (r = g(r), W = !0, k = n || null, I = {success: !1,id: r}, i) {
"OBJECT" == i.nodeName.toUpperCase() ? (T = l(i), w = null) : (T = i, w = r), e.id = O, (typeof e.width == N || !/%$/.test(e.width) && v(e.width) < 310) && (e.width = "310"), (typeof e.height == N || !/%$/.test(e.height) && v(e.height) < 137) && (e.height = "137");
var a = X.ie ? "ActiveX" : "PlugIn", o = "MMredirectURL=" + encodeURIComponent(M.location.toString().replace(/&/g, "%26")) + "&MMplayerType=" + a + "&MMdoctitle=" + encodeURIComponent(F.title.slice(0, 47) + " - Flash Player Installation");
if (typeof t.flashvars != N ? t.flashvars += "&" + o : t.flashvars = o, X.ie && 4 != i.readyState) {
var s = m("div");
r += "SWFObjectNew", s.setAttribute("id", r), i.parentNode.insertBefore(s, i), i.style.display = "none", d(i)
}
p(e, t, r)
}
}
function u(e) {
if (X.ie && 4 != e.readyState) {
e.style.display = "none";
var t = m("div");
e.parentNode.insertBefore(t, e), t.parentNode.replaceChild(l(e), t), d(e)
} else
e.parentNode.replaceChild(l(e), e)
}
function l(e) {
var t = m("div");
if (X.win && X.ie)
t.innerHTML = e.innerHTML;
else {
var r = e.getElementsByTagName(B)[0];
if (r) {
var n = r.childNodes;
if (n)
for (var i = n.length, a = 0; i > a; a++)
1 == n[a].nodeType && "PARAM" == n[a].nodeName || 8 == n[a].nodeType || t.appendChild(n[a].cloneNode(!0))
}
}
return t
}
function c(e, t) {
var r = m("div");
return r.innerHTML = "<object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000'><param name='movie' value='" + e + "'>" + t + "</object>", r.firstChild
}
function p(e, t, r) {
var n, i = y(r);
if (r = g(r), X.wk && X.wk < 312)
return n;
if (i) {
var a, o, s, u = m(X.ie ? "div" : B);
typeof e.id == N && (e.id = r);
for (s in t)
t.hasOwnProperty(s) && "movie" !== s.toLowerCase() && f(u, s, t[s]);
X.ie && (u = c(e.data, u.innerHTML));
for (a in e)
e.hasOwnProperty(a) && (o = a.toLowerCase(), "styleclass" === o ? u.setAttribute("class", e[a]) : "classid" !== o && "data" !== o && u.setAttribute(a, e[a]));
X.ie ? K[K.length] = e.id : (u.setAttribute("type", P), u.setAttribute("data", e.data)), i.parentNode.replaceChild(u, i), n = u
}
return n
}
function f(e, t, r) {
var n = m("param");
n.setAttribute("name", t), n.setAttribute("value", r), e.appendChild(n)
}
function d(e) {
var t = y(e);
t && "OBJECT" == t.nodeName.toUpperCase() && (X.ie ? (t.style.display = "none", function r() {
if (4 == t.readyState) {
for (var e in t)
"function" == typeof t[e] && (t[e] = null);
t.parentNode.removeChild(t)
} else
setTimeout(r, 10)
}()) : t.parentNode.removeChild(t))
}
function h(e) {
return e && e.nodeType && 1 === e.nodeType
}
function g(e) {
return h(e) ? e.id : e
}
function y(e) {
if (h(e))
return e;
var t = null;
try {
t = F.getElementById(e)
} catch (r) {
}
return t
}
function m(e) {
return F.createElement(e)
}
function v(e) {
return parseInt(e, 10)
}
function b(e, t, r) {
e.attachEvent(t, r), G[G.length] = [e, t, r]
}
function _(e) {
e += "";
var t = X.pv, r = e.split(".");
return r[0] = v(r[0]), r[1] = v(r[1]) || 0, r[2] = v(r[2]) || 0, t[0] > r[0] || t[0] == r[0] && t[1] > r[1] || t[0] == r[0] && t[1] == r[1] && t[2] >= r[2] ? !0 : !1
}
function E(e, t, r, n) {
var i = F.getElementsByTagName("head")[0];
if (i) {
var a = "string" == typeof r ? r : "screen";
if (n && (x = null, D = null), !x || D != a) {
var o = m("style");
o.setAttribute("type", "text/css"), o.setAttribute("media", a), x = i.appendChild(o), X.ie && typeof F.styleSheets != N && F.styleSheets.length > 0 && (x = F.styleSheets[F.styleSheets.length - 1]), D = a
}
x && (typeof x.addRule != N ? x.addRule(e, t) : typeof F.createTextNode != N && x.appendChild(F.createTextNode(e + " {" + t + "}")))
}
}
function C(e, t) {
if (z) {
var r = t ? "visible" : "hidden", n = y(e);
Y && n ? n.style.visibility = r : "string" == typeof e && E("#" + e, "visibility:" + r)
}
}
function S(e) {
var t = /[\\\"<>\.;]/, r = null != t.exec(e);
return r && typeof encodeURIComponent != N ? encodeURIComponent(e) : e
}
{
var A, T, w, k, I, x, D, N = "undefined", B = "object", L = "Shockwave Flash", R = "ShockwaveFlash.ShockwaveFlash", P = "application/x-shockwave-flash", O = "SWFObjectExprInst", U = "onreadystatechange", M = window, F = document, j = navigator, V = !1, H = [], q = [], K = [], G = [], Y = !1, W = !1, z = !0, Q = !1, X = function() {
var e = typeof F.getElementById != N && typeof F.getElementsByTagName != N && typeof F.createElement != N, t = j.userAgent.toLowerCase(), r = j.platform.toLowerCase(), n = /win/.test(r ? r : t), i = /mac/.test(r ? r : t), a = /webkit/.test(t) ? parseFloat(t.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : !1, o = "Microsoft Internet Explorer" === j.appName, s = [0, 0, 0], u = null;
if (typeof j.plugins != N && typeof j.plugins[L] == B)
u = j.plugins[L].description, u && typeof j.mimeTypes != N && j.mimeTypes[P] && j.mimeTypes[P].enabledPlugin && (V = !0, o = !1, u = u.replace(/^.*\s+(\S+\s+\S+$)/, "$1"), s[0] = v(u.replace(/^(.*)\..*$/, "$1")), s[1] = v(u.replace(/^.*\.(.*)\s.*$/, "$1")), s[2] = /[a-zA-Z]/.test(u) ? v(u.replace(/^.*[a-zA-Z]+(.*)$/, "$1")) : 0);
else if (typeof M.ActiveXObject != N)
try {
var l = new ActiveXObject(R);
l && (u = l.GetVariable("$version"), u && (o = !0, u = u.split(" ")[1].split(","), s = [v(u[0]), v(u[1]), v(u[2])]))
} catch (c) {
}
return {w3: e,pv: s,wk: a,ie: o,win: n,mac: i}
}();
!function() {
X.w3 && ((typeof F.readyState != N && ("complete" === F.readyState || "interactive" === F.readyState) || typeof F.readyState == N && (F.getElementsByTagName("body")[0] || F.body)) && e(), Y || (typeof F.addEventListener != N && F.addEventListener("DOMContentLoaded", e, !1), X.ie && (F.attachEvent(U, function t() {
"complete" == F.readyState && (F.detachEvent(U, t), e())
}), M == top && !function r() {
if (!Y) {
try {
F.documentElement.doScroll("left")
} catch (t) {
return void setTimeout(r, 0)
}
e()
}
}()), X.wk && !function n() {
return Y ? void 0 : /loaded|complete/.test(F.readyState) ? void e() : void setTimeout(n, 0)
}()))
}()
}
H[0] = function() {
V ? n() : i()
};
!function() {
X.ie && window.attachEvent("onunload", function() {
for (var e = G.length, t = 0; e > t; t++)
G[t][0].detachEvent(G[t][1], G[t][2]);
for (var r = K.length, n = 0; r > n; n++)
d(K[n]);
for (var i in X)
X[i] = null;
X = null;
for (var a in A)
A[a] = null;
A = null
})
}();
return A = {registerObject: function(e, t, r, n) {
if (X.w3 && e && t) {
var i = {};
i.id = e, i.swfVersion = t, i.expressInstall = r, i.callbackFn = n, q[q.length] = i, C(e, !1)
} else
n && n({success: !1,id: e})
},getObjectById: function(e) {
return X.w3 ? a(e) : void 0
},embedSWF: function(e, r, n, i, a, u, l, c, f, d) {
var h = g(r), y = {success: !1,id: h};
X.w3 && !(X.wk && X.wk < 312) && e && r && n && i && a ? (C(h, !1), t(function() {
n += "", i += "";
var t = {};
if (f && typeof f === B)
for (var g in f)
t[g] = f[g];
t.data = e, t.width = n, t.height = i;
var m = {};
if (c && typeof c === B)
for (var v in c)
m[v] = c[v];
if (l && typeof l === B)
for (var b in l)
if (l.hasOwnProperty(b)) {
var E = Q ? encodeURIComponent(b) : b, S = Q ? encodeURIComponent(l[b]) : l[b];
typeof m.flashvars != N ? m.flashvars += "&" + E + "=" + S : m.flashvars = E + "=" + S
}
if (_(a)) {
var A = p(t, m, r);
t.id == h && C(h, !0), y.success = !0, y.ref = A, y.id = A.id
} else {
if (u && o())
return t.data = u, void s(t, m, r, d);
C(h, !0)
}
d && d(y)
})) : d && d(y)
},switchOffAutoHideShow: function() {
z = !1
},enableUriEncoding: function(e) {
Q = typeof e === N ? !0 : e
},ua: X,getFlashPlayerVersion: function() {
return {major: X.pv[0],minor: X.pv[1],release: X.pv[2]}
},hasFlashPlayerVersion: _,createSWF: function(e, t, r) {
return X.w3 ? p(e, t, r) : void 0
},showExpressInstall: function(e, t, r, n) {
X.w3 && o() && s(e, t, r, n)
},removeSWF: function(e) {
X.w3 && d(e)
},createCSS: function(e, t, r, n) {
X.w3 && E(e, t, r, n)
},addDomLoadEvent: t,addLoadEvent: r,getQueryParamValue: function(e) {
var t = F.location.search || F.location.hash;
if (t) {
if (/\?/.test(t) && (t = t.split("?")[1]), null == e)
return S(t);
for (var r = t.split("&"), n = 0; n < r.length; n++)
if (r[n].substring(0, r[n].indexOf("=")) == e)
return S(r[n].substring(r[n].indexOf("=") + 1))
}
return ""
},expressInstallCallback: function() {
if (W) {
var e = y(O);
e && T && (e.parentNode.replaceChild(T, e), w && (C(w, !0), X.ie && (T.style.display = "block")), k && k(I)), W = !1
}
},version: "2.3"}
}), o("flashaudioproxy", ["require", "exports", "module", "underscore", "errors", "vendor/events", "logger", "states", "vendor/swfobject"], function(e, t, r) {
var n, i = e("underscore"), a = e("errors"), o = e("vendor/events"), s = e("logger"), u = e("states"), l = e("vendor/swfobject");
r.exports = n = function(e, t) {
this._descriptor = e, this._id = e.id, this._autoPlay = e.autoPlay || !1, n.players[e.id] = this, this._errorMessage = null, this._errorID = null, this._state = u.INITIALIZE, this._settings = t, this._volume = 1, this._muted = !1, this._logger = new s(this.getType(), this._id, t), n.creatingFlashAudio || (n.flashAudio ? this._createFlashAudio() : n.createFlashObject(t))
}, n.createFlashObject = function(e) {
n.creatingFlashAudio = !0, n.containerElement = document.createElement("div"), n.containerElement.setAttribute("id", e.flashObjectID + "-container"), n.flashElementTarget = document.createElement("div"), n.flashElementTarget.setAttribute("id", e.flashObjectID + "-target"), n.containerElement.appendChild(n.flashElementTarget), document.body.appendChild(n.containerElement);
var t = function(t) {
if (t.success)
n.flashAudio = document.getElementById(e.flashObjectID), setTimeout(function() {
if (n.flashAudio && !("PercentLoaded" in n.flashAudio))
for (var e in n.players)
n.players.hasOwnProperty(e) && (n.players[e]._errorID = a.FLASH_PROXY_FLASH_BLOCKED, n.players[e]._errorMessage = "Flash object blocked", n.players[e]._setState(u.ERROR), n.players[e]._logger.type = n.players[e].getType(), n.players[e]._logger.log(n.players[e]._errorMessage))
}, e.flashLoadTimeout), n.flashAudio.triggerEvent = function(e, t) {
n.players[e]._triggerEvent(t)
}, n.flashAudio.onPositionChange = function(e, t, r, i) {
n.players[e]._onPositionChange(t, r, i)
}, n.flashAudio.onDebug = function(e, t, r) {
n.players[e]._logger.type = t, n.players[e]._logger.log(r)
}, n.flashAudio.onStateChange = function(e, t) {
n.players[e]._setState(t), t === u.DEAD && delete n.players[e]
}, n.flashAudio.onInit = function() {
n.creatingFlashAudio = !1, i.invoke(i.values(n.players), "_createFlashAudio")
};
else
for (var r in n.players)
n.players.hasOwnProperty(r) && (n.players[r]._errorID = a.FLASH_PROXY_CANT_LOAD_FLASH, n.players[r]._errorMessage = "Cannot create flash object", n.players[r]._setState(u.ERROR))
};
document.getElementById(e.flashObjectID) || l.embedSWF(e.flashAudioPath, e.flashObjectID + "-target", "1", "1", "9.0.24", "", {json: encodeURIComponent(JSON.stringify(e))}, {allowscriptaccess: "always"}, {id: e.flashObjectID}, t)
}, n._ready = function() {
return n.flashAudio && !n.creatingFlashAudio
}, i.extend(n.prototype, o), n.players = {}, n.prototype._createFlashAudio = function() {
n.flashAudio.createAudio(this._descriptor), this._state = n.flashAudio.getState(this._id), this.setVolume(this._volume), this.setMute(this._muted), this._autoPlay && this.play()
}, n.prototype._triggerEvent = function(e) {
this._logger.log("Flash element triggered event: " + e), this.trigger(e, this)
}, n.prototype._setState = function(e) {
this._state !== e && (this._state = e, this.trigger("stateChange", e, this))
}, n.prototype._onPositionChange = function(e, t, r) {
this.trigger("positionChange", e, t, r, this)
}, n.prototype.getId = function() {
return this._id
}, n.prototype.getType = function() {
return n._ready() ? n.flashAudio.getType(this._id) : "Flash ..."
}, n.prototype.getContainerElement = function() {
return n.containerElement
}, n.prototype.play = function(e) {
if (n._ready()) {
if (this.getState() === u.PAUSED || this.getState() === u.ENDED)
return void this.resume();
e = void 0 === e ? 0 : e, n.flashAudio.playAudio(this._id, e)
}
}, n.prototype.pause = function() {
n._ready() && n.flashAudio.pauseAudio(this._id)
}, n.prototype.seek = function(e) {
n._ready() && n.flashAudio.seekAudio(this._id, e)
}, n.prototype.resume = function() {
n._ready() && n.flashAudio.resumeAudio(this._id)
}, n.prototype.setVolume = function(e) {
this._volume = e, n._ready() && n.flashAudio.setVolume(this._id, e)
}, n.prototype.getVolume = function() {
return n._ready() ? n.flashAudio.getVolume(this._id) : this._volume
}, n.prototype.setMute = function(e) {
this._muted = e, n._ready() && n.flashAudio.setMute(this._id, e)
}, n.prototype.getMute = function() {
return n._ready() ? n.flashAudio.getMute(this._id) : this._muted
}, n.prototype.getState = function() {
return this._state
}, n.prototype.getCurrentPosition = function() {
return n._ready() ? n.flashAudio.getCurrentPosition(this._id) : 0
}, n.prototype.getLoadedPosition = function() {
return n._ready() ? n.flashAudio.getLoadedPosition(this._id) : 0
}, n.prototype.getDuration = function() {
return n._ready() ? n.flashAudio.getDuration(this._id) : 0
}, n.prototype.kill = function() {
return n._ready() ? void n.flashAudio.killAudio(this._id) : 0
}, n.prototype.getErrorMessage = function() {
return this._errorMessage ? this._errorMessage : n.flashAudio.getErrorMessage(this._id)
}, n.prototype.getErrorID = function() {
return this._errorID ? this._errorID : n.flashAudio.getErrorID(this._id)
}, n.prototype.getLevelNum = function() {
return n._ready() ? n.flashAudio.getLevelNum(this._id) : 0
}, n.prototype.getLevel = function() {
return n._ready() ? n.flashAudio.getLevel(this._id) : 0
}, n.prototype.setLevel = function(e) {
return n._ready() ? n.flashAudio.setLevel(this._id, e) : 0
}, n.prototype.preload = function() {
return !1
}
}), o("html5audioplayer", ["require", "exports", "module", "underscore", "vendor/events", "states", "errors", "logger"], function(e, t, r) {
var n, i = e("underscore"), a = e("vendor/events"), o = e("states"), s = e("errors"), u = e("logger");
r.exports = n = function(e, t) {
this._id = e.id, this._descriptor = e, this._isLoaded = !1, this._settings = t, this._bufferingTimeout = null, this._currentPosition = 0, this._loadedPosition = 0, this._prevCurrentPosition = 0, this._prevCheckTime = 0, this._positionUpdateTimer = 0, this._playRequested = !1, this._startFromPosition = 0, e.duration && (this._duration = e.duration), i.bindAll(this, "_onPositionChange", "_onHtml5AudioStateChange", "_onLoaded", "_onLoadedMetadata", "_onBuffering"), this._init(), this._toggleEventListeners(!0), this._descriptor.preload && this._preload(), e.autoPlay ? this.play() : this._setState(o.IDLE)
}, i.extend(n.prototype, a), n.prototype.getId = function() {
return this._id
}, n.prototype.getType = function() {
return "HTML5 audio"
}, n.prototype.play = function(e) {
if (!this._isInOneOfStates(o.ERROR, o.DEAD)) {
if (this._isInOneOfStates(o.PAUSED, o.ENDED))
return void this.resume();
this._logger.log("play"), this._startFromPosition = e || 0, this._setState(o.LOADING), this._playRequested = !0, this._isLoaded ? this._playAfterLoaded() : (this._preload(), this.once("loaded", this._playAfterLoaded))
}
}, n.prototype.pause = function() {
this._playRequested = !1, this._isInOneOfStates(o.ERROR, o.DEAD) || (this._logger.log("pause"), this._html5Audio.pause(), clearTimeout(this._bufferingTimeout), clearInterval(this._positionUpdateTimer))
}, n.prototype.seek = function(e) {
var t, r = !1, n = e / 1e3, i = this._html5Audio.seekable;
if (!this._isInOneOfStates(o.ERROR, o.DEAD)) {
if (!this._isLoaded)
return void this.once("loaded", function() {
this.seek(e)
});
for (t = 0; t < i.length; t++)
if (n <= i.end(t) && n >= i.start(t)) {
r = !0;
break
}
r && (this._logger.log("seek"), this._setState(o.SEEKING), this._html5Audio.currentTime = n, this._currentPosition = e, clearTimeout(this._bufferingTimeout))
}
}, n.prototype.resume = function() {
this._isInOneOfStates(o.ERROR, o.DEAD) || (this._logger.log("resume"), this.getState() === o.PAUSED ? (this._setState(o.LOADING), this._html5Audio.play(this._html5Audio.currentTime)) : this.getState() === o.ENDED && (this._setState(o.LOADING), this._html5Audio.play(0)), clearInterval(this._positionUpdateTimer), this._positionUpdateTimer = setInterval(this._onPositionChange, this._settings.updateInterval))
}, n.prototype.setVolume = function(e) {
this._html5Audio && (this._html5Audio.volume = e)
}, n.prototype.getVolume = function() {
return this._html5Audio ? this._html5Audio.volume : 1
}, n.prototype.setMute = function(e) {
this._html5Audio && (this._html5Audio.muted = e)
}, n.prototype.getMute = function() {
return this._html5Audio ? this._html5Audio.muted : !1
}, n.prototype.getState = function() {
return this._state
}, n.prototype.getCurrentPosition = function() {
return this._currentPosition
}, n.prototype.getLoadedPosition = function() {
return this._loadedPosition
}, n.prototype.getDuration = function() {
return this._duration
}, n.prototype.kill = function() {
this._state !== o.DEAD && (clearInterval(this._positionUpdateTimer), clearTimeout(this._bufferingTimeout), this._playRequested = !1, this._toggleEventListeners(!1), this._html5Audio.pause(), this._html5Audio.src = null, delete this._html5Audio, this._setState(o.DEAD))
}, n.prototype.getErrorMessage = function() {
return this._errorMessage
}, n.prototype.getErrorID = function() {
return this._errorID
}, n.prototype._init = function() {
this._html5Audio = new Audio, this._html5Audio.mozAudioChannelType = "content", this._html5Audio.id = this._settings.audioObjectID + "_" + this._descriptor.id, this._html5Audio.preload = "none", this._logger = new u(this.getType(), this._id, this._settings)
}, n.prototype._preload = function() {
"auto" !== this._html5Audio.preload && (this._logger.log("setting up preload"), this._html5Audio.preload = "auto", this._html5Audio.type = this._descriptor.mimeType, this._html5Audio.src = this._descriptor.src, this._html5Audio.load())
}, n.prototype._playAfterLoaded = function() {
this._playRequested && (this._trySeekToStartPosition(), this._html5Audio.play(), clearInterval(this._positionUpdateTimer), this._positionUpdateTimer = setInterval(this._onPositionChange, this._settings.updateInterval))
}, n.prototype._setState = function(e) {
this._state !== e && (this._logger.log('state changed "' + e + '"'), this._logger.log("_currentPosition = " + this._currentPosition + ", _loadedPosition = " + this._loadedPosition), this._state = e, this.trigger("stateChange", e, this))
}, n.prototype._isInOneOfStates = function() {
for (var e in arguments)
if (arguments[e] === this._state)
return !0;
return !1
}, n.prototype._toggleEventListeners = function(e) {
if (this._html5Audio) {
var t = e ? "addEventListener" : "removeEventListener";
["ended", "play", "playing", "pause", "seeking", "waiting", "seeked", "error"].forEach(function(e) {
this._html5Audio[t](e, this._onHtml5AudioStateChange)
}, this), this._html5Audio[t]("loadeddata", this._onLoaded), this._html5Audio[t]("loadedmetadata", this._onLoadedMetadata)
}
}, n.prototype._updatePositions = function() {
this._currentPosition = 1e3 * this._html5Audio.currentTime, this._html5Audio.seekable.length > 0 && (this._loadedPosition = 1e3 * this._html5Audio.seekable.end(0))
}, n.prototype._trySeekToStartPosition = function() {
var e;
return this._startFromPosition > 0 && (this._logger.log("seek to start position=" + this._startFromPosition), e = this._startFromPosition / 1e3, this._html5Audio.currentTime = e, this._html5Audio.currentTime === e) ? (this._startFromPosition = 0, !0) : !1
}, n.prototype._onBuffering = function() {
this._setState(o.LOADING)
}, n.prototype._onLoaded = function(e) {
this._logger.log('html5 audio event (loaded handler) "' + e.type + '"'), (void 0 === this._duration || 0 === this._duration) && (this._duration = 1e3 * this._html5Audio.duration), this._isLoaded = !0, this.trigger("loaded", this)
}, n.prototype._onLoadedMetadata = function(e) {
this._logger.log('html5 audio event (loadedmetadata handler) "' + e.type + '"'), this.trigger("loadedmetadata", this)
}, n.prototype._onPositionChange = function() {
this._updatePositions();
var e, t, r, n = this._currentPosition - this._prevCurrentPosition;
return this.trigger("positionChange", this.getCurrentPosition(), this._loadedPosition, this._duration, this), this._isInOneOfStates(o.PLAYING, o.LOADING) ? (0 !== this._duration && (this._currentPosition > this._duration || this._currentPosition > this._loadedPosition) && this._onHtml5AudioStateChange({type: "ended"}), e = (new Date).valueOf(), t = e - this._prevCheckTime, void (0 !== t && (r = n / t, r > .7 ? (clearTimeout(this._bufferingTimeout), this._setState(o.PLAYING), this._bufferingTimeout = null) : this._state === o.PLAYING && null == this._bufferingTimeout && (this._bufferingTimeout = setTimeout(this._onBuffering, this._settings.bufferingDelay)), this._prevCurrentPosition = this._currentPosition, this._prevCheckTime = e))) : void (this._state === o.SEEKING && n > 0 && this._setState(o.PLAYING))
}, n.prototype._onHtml5AudioStateChange = function(e) {
switch (this._logger.log('html5 audio event (state change handler) "' + e.type + '"'), clearTimeout(this._bufferingTimeout), e.type) {
case "playing":
if (this._trySeekToStartPosition())
return;
this._updatePositions(), this._setState(o.PLAYING);
break;
case "pause":
this._setState(o.PAUSED);
break;
case "ended":
this._currentPosition = this._loadedPosition = this._duration, this.trigger("positionChange", this.getCurrentPosition(), this._loadedPosition, this._duration, this), this._setState(o.ENDED), clearInterval(this._positionUpdateTimer);
break;
case "waiting":
if (this.getState() === o.SEEKING)
break;
this._setState(o.LOADING);
break;
case "seeking":
this._setState(o.SEEKING);
break;
case "seeked":
this._updatePositions(), this._setState(this._html5Audio.paused ? o.PAUSED : o.PLAYING);
break;
case "error":
this._error(this._html5AudioErrorCodeToErrorId(), !0)
}
}, n.prototype._html5AudioErrorCodeToErrorId = function() {
return {1: s.HTML5_AUDIO_ABORTED,2: s.HTML5_AUDIO_NETWORK,3: s.HTML5_AUDIO_DECODE,4: s.HTML5_AUDIO_SRC_NOT_SUPPORTED}[this._html5Audio.error.code]
}, n.prototype._error = function(e, t) {
var r = "error: ";
t && (r = "error (native): "), this._errorID = e, this._errorMessage = this._getErrorMessage(this._errorID), this._logger.log(r + this._errorID + " " + this._errorMessage), this._setState(o.ERROR), this._toggleEventListeners(!1)
}, n.prototype._getErrorMessage = function(e) {
var t = {};
return t[s.HTML5_AUDIO_ABORTED] = "The fetching process was aborted by the user.", t[s.HTML5_AUDIO_NETWORK] = "A network connection lost.", t[s.HTML5_AUDIO_DECODE] = "An error occurred while decoding the media resource.", t[s.HTML5_AUDIO_SRC_NOT_SUPPORTED] = "The media resource is not suitable.", t[s.HTML5_AUDIO_ENDED_EARLY] = "Audio playback ended before the indicated duration of the track.", t[s.HTML5_AUDIO_OVERRUN] = "Audio playback continued past end of the track.", t[e]
}
}), o("hlsaudioplayer", ["require", "exports", "module", "underscore", "errors", "vendor/events", "html5audioplayer", "logger", "states"], function(e, t, r) {
var n, i = e("underscore"), a = e("errors"), o = (e("vendor/events"), e("html5audioplayer")), s = (e("logger"), e("states")), u = 1;
r.exports = n = function() {
o.apply(this, arguments), this._seekPosition = 0
}, i.extend(n.prototype, o.prototype), n.prototype.getType = function() {
return "HTML5 HLS audio"
}, n.prototype.seek = function(e) {
o.prototype.seek.apply(this, arguments), this._isInOneOfStates(s.LOADING, s.SEEKING) && (this._seekPosition = e)
}, n.prototype.getCurrentPosition = function() {
if (this._isInOneOfStates(s.LOADING) && this._seekPosition > 0)
return this._seekPosition;
if (this._isInOneOfStates(s.PLAYING, s.SEEKING)) {
if (this._seekPosition >= this._currentPosition)
return this._seekPosition;
this._seekPosition = 0
}
return o.prototype.getCurrentPosition.apply(this, arguments)
}, n.prototype._onStateChange = function(e) {
switch (this._logger.log('hls html5 audio event "' + e.type + '"'), clearTimeout(this._bufferingTimeout), e.type) {
case "playing":
if (this._trySeekToStartPosition())
return;
this.updatePositions(), this._setState(s.PLAYING);
break;
case "pause":
this._setState(s.PAUSED);
break;
case "ended":
if (this._currentPosition + u < this._duration) {
this._errorID = a.HTML5_AUDIO_ENDED_EARLY, this._errorMessage = this._getErrorMessage(this._errorID), this._logger.log("hls html5 audio error: " + this._errorID + " " + this._errorMessage), this._setState(s.ERROR), this.toggleEventListeners(!1);
break
}
this._currentPosition = this._loadedPosition = this._duration, this.trigger("positionChange", this._currentPosition, this._loadedPosition, this._duration, this), this._setState(s.ENDED), clearInterval(this._positionUpdateTimer);
break;
case "waiting":
if (this.getState() === s.SEEKING)
break;
this._setState(s.LOADING);
break;
case "seeking":
this._setState(s.SEEKING);
break;
case "seeked":
this.updatePositions(), this._html5Audio.paused && this._setState(s.PAUSED);
break;
case "error":
this._errorID = {1: a.HTML5_AUDIO_ABORTED,2: a.HTML5_AUDIO_NETWORK,3: a.HTML5_AUDIO_DECODE,4: a.HTML5_AUDIO_SRC_NOT_SUPPORTED}[this._html5Audio.error.code], this._errorMessage = this._getErrorMessage(this._errorID), this._logger.log("hls html5 audio error: " + this._errorID + " " + this._errorMessage), this._setState(s.ERROR), this.toggleEventListeners(!1)
}
}
}), o("singleaudioplayer", ["require", "exports", "module", "underscore", "browserutils", "errors", "vendor/events", "html5audioplayer", "logger", "states"], function(e, t, r) {
var n, i = e("underscore"), a = e("browserutils"), o = (e("errors"), e("vendor/events"), e("html5audioplayer")), s = e("logger"), u = e("states"), l = {};
r.exports = n = function() {
o.apply(this, arguments)
}, i.extend(n.prototype, o.prototype), n.prototype._init = function() {
if (!n._html5Audio) {
var e = new Audio;
e.mozAudioChannelType = "content", e.id = this._settings.audioObjectID + "_Single", e.preload = "none", n._html5Audio = e, this._preloadAudio = e, this._addGlobalListeners()
}
this._html5Audio = n._html5Audio, this._playRequested = !1, this._logger = new s(this.getType(), this._id, this._settings)
}, n.prototype._toggleEventListeners = function(e) {
e ? l[this._id] = this : delete l[this._id]
}, n.prototype._addGlobalListeners = function() {
var e = n._html5Audio, t = function(t, r) {
var n = l[e._playerId];
Object.keys(l).forEach(function(e) {
var t = l[e];
t !== n && t._isInOneOfStates(u.PLAYING, u.LOADING) && t.pause()
}), n && n[t](r)
}, r = t.bind(null, "_onHtml5AudioStateChange"), i = t.bind(null, "_onLoaded"), a = t.bind(null, "_onLoadedMetadata");
["ended", "play", "playing", "pause", "seeking", "waiting", "seeked", "error"].forEach(function(t) {
e.addEventListener(t, r)
}), e.addEventListener("loadeddata", i), e.addEventListener("loadedmetadata", a)
}, n.prototype.getType = function() {
return "HTML5 single audio"
}, n.prototype.play = function(e) {
if (this._playRequested = !0, this._html5Audio._playerId === this._descriptor.id && this._isInOneOfStates(u.PAUSED, u.ENDED))
return void o.prototype.resume.apply(this, arguments);
this._isInOneOfStates(u.PAUSED) && (e = this._currentPosition), this._startFromPosition = e || 0, this._html5Audio._playerId = this._descriptor.id, this._toggleEventListeners(!0), this._setState(u.LOADING);
var t = function() {
this._playRequested && (this._logger.log("play after loaded"), this._trySeekToStartPosition(), this._html5Audio.play(), clearInterval(this._positionUpdateTimer), this._positionUpdateTimer = setInterval(this._onPositionChange, this._settings.updateInterval))
};
this._html5Audio.readyState > 0 && this._descriptor.src === this._html5Audio.src ? t.apply(this) : (this.once("loaded", t), this._html5Audio.type = this._descriptor.mimeType, this._html5Audio.src = this._descriptor.src, this._html5Audio.preload = "auto", this._html5Audio.load())
}, n.prototype.pause = function() {
this._playRequested = !1, this._isInOneOfStates(u.ERROR, u.DEAD) || (this._logger.log("pause"), this._html5Audio._playerId === this._descriptor.id ? this._html5Audio.pause() : (this._toggleEventListeners(!1), this._setState(u.PAUSED)), clearTimeout(this._bufferingTimeout), clearInterval(this._positionUpdateTimer))
}, n.prototype.seek = function(e) {
return this._html5Audio._playerId !== this._descriptor.id ? (this._currentPosition = e, void this.trigger("positionChange", this._currentPosition, this._loadedPosition, this._duration, this)) : void o.prototype.seek.apply(this, arguments)
}, n.prototype.kill = function() {
this._state !== u.DEAD && (this._playRequested = !1, clearInterval(this._positionUpdateTimer), clearTimeout(this._bufferingTimeout), this._toggleEventListeners(!1), this._setState(u.DEAD))
}, n.prototype.resume = function() {
return this._isInOneOfStates(u.ERROR, u.DEAD) ? void 0 : this._html5Audio._playerId !== this._descriptor.id ? void this.play(this._currentPosition) : void o.prototype.resume.apply(this, arguments)
}, n.prototype.preload = function() {
!this._preloadAudio && a.supportSourceSwappingWithPreload() && (this._preloadAudio = new Audio, this._preloadAudio.preload = "none");
var e = this._preloadAudio;
e && "auto" !== e.preload && (this._logger.log("preload"), e.preload = "auto", e._playerId = this._id, e.type = this._descriptor.mimeType, e.src = this._descriptor.src, e.load())
}
}), o("hlssingleaudioplayer", ["require", "exports", "module", "underscore", "errors", "vendor/events", "hlsaudioplayer", "logger", "singleaudioplayer", "states"], function(e, t, r) {
{
var n, i = e("underscore"), a = (e("errors"), e("vendor/events"), e("hlsaudioplayer")), o = (e("logger"), e("singleaudioplayer"));
e("states")
}
r.exports = n = function() {
o.apply(this, arguments)
}, i.extend(n.prototype, o.prototype), i.extend(n.prototype, i.pick(a.prototype, "_seekPosition", "seek", "getCurrentPosition", "_onStateChange")), n.prototype.getType = function() {
return "HTML5 HLS single audio"
}
}), o("mimetypes", {AAC: "audio/aac",M3U8: "application/x-mpegURL",MP4: "audio/mp4",MPEG: "audio/mpeg",OGG: "audio/ogg",WAV: "audio/wav",WEBM: "audio/webm",getTypeByExtension: function(e) {
var t = {mp1: this.MPEG,mp2: this.MPEG,mp3: this.MPEG,mpeg: this.MPEG,mpg: this.MPEG,aac: this.AAC,mp4: this.MP4,ogg: this.OGG,oga: this.OGG,opus: this.OGG,webm: this.WEBM,wav: this.WAV,m3u8: this.M3U8};
return t[e] || null
}}), function(e, t) {
"function" == typeof o && o.amd ? o("vendor/forge", [], t) : e.forge = t()
}(this, function() { /**
* @license almond 0.2.9 Copyright (c) 2011-2014, The Dojo Foundation All Rights Reserved.
* Available via the MIT or new BSD license.
* see: http://github.com/jrburke/almond for details
*/
var e, i, a;
return function(t) {
function r(e, t) {
return _.call(e, t)
}
function n(e, t) {
var r, n, i, a, o, s, u, l, c, p, f, d = t && t.split("/"), h = v.map, g = h && h["*"] || {};
if (e && "." === e.charAt(0))
if (t) {
for (d = d.slice(0, d.length - 1), e = e.split("/"), o = e.length - 1, v.nodeIdCompat && C.test(e[o]) && (e[o] = e[o].replace(C, "")), e = d.concat(e), c = 0; c < e.length; c += 1)
if (f = e[c], "." === f)
e.splice(c, 1), c -= 1;
else if (".." === f) {
if (1 === c && (".." === e[2] || ".." === e[0]))
break;
c > 0 && (e.splice(c - 1, 2), c -= 2)
}
e = e.join("/")
} else
0 === e.indexOf("./") && (e = e.substring(2));
if ((d || g) && h) {
for (r = e.split("/"), c = r.length; c > 0; c -= 1) {
if (n = r.slice(0, c).join("/"), d)
for (p = d.length; p > 0; p -= 1)
if (i = h[d.slice(0, p).join("/")], i && (i = i[n])) {
a = i, s = c;
break
}
if (a)
break;
!u && g && g[n] && (u = g[n], l = c)
}
!a && u && (a = u, s = l), a && (r.splice(0, s, a), e = r.join("/"))
}
return e
}
function o(e, r) {
return function() {
return d.apply(t, E.call(arguments, 0).concat([e, r]))
}
}
function s(e) {
return function(t) {
return n(t, e)
}
}
function u(e) {
return function(t) {
y[e] = t
}
}
function l(e) {
if (r(m, e)) {
var n = m[e];
delete m[e], b[e] = !0, f.apply(t, n)
}
if (!r(y, e) && !r(b, e))
throw new Error("No " + e);
return y[e]
}
function c(e) {
var t, r = e ? e.indexOf("!") : -1;
return r > -1 && (t = e.substring(0, r), e = e.substring(r + 1, e.length)), [t, e]
}
function p(e) {
return function() {
return v && v.config && v.config[e] || {}
}
}
var f, d, h, g, y = {}, m = {}, v = {}, b = {}, _ = Object.prototype.hasOwnProperty, E = [].slice, C = /\.js$/;
h = function(e, t) {
var r, i = c(e), a = i[0];
return e = i[1], a && (a = n(a, t), r = l(a)), a ? e = r && r.normalize ? r.normalize(e, s(t)) : n(e, t) : (e = n(e, t), i = c(e), a = i[0], e = i[1], a && (r = l(a))), {f: a ? a + "!" + e : e,n: e,pr: a,p: r}
}, g = {require: function(e) {
return o(e)
},exports: function(e) {
var t = y[e];
return "undefined" != typeof t ? t : y[e] = {}
},module: function(e) {
return {id: e,uri: "",exports: y[e],config: p(e)}
}}, f = function(e, n, i, a) {
var s, c, p, f, d, v, _ = [], E = typeof i;
if (a = a || e, "undefined" === E || "function" === E) {
for (n = !n.length && i.length ? ["require", "exports", "module"] : n, d = 0; d < n.length; d += 1)
if (f = h(n[d], a), c = f.f, "require" === c)
_[d] = g.require(e);
else if ("exports" === c)
_[d] = g.exports(e), v = !0;
else if ("module" === c)
s = _[d] = g.module(e);
else if (r(y, c) || r(m, c) || r(b, c))
_[d] = l(c);
else {
if (!f.p)
throw new Error(e + " missing " + c);
f.p.load(f.n, o(a, !0), u(c), {}), _[d] = y[c]
}
p = i ? i.apply(y[e], _) : void 0, e && (s && s.exports !== t && s.exports !== y[e] ? y[e] = s.exports : p === t && v || (y[e] = p))
} else
e && (y[e] = i)
}, e = i = d = function(e, r, n, i, a) {
if ("string" == typeof e)
return g[e] ? g[e](r) : l(h(e, r).f);
if (!e.splice) {
if (v = e, v.deps && d(v.deps, v.callback), !r)
return;
r.splice ? (e = r, r = n, n = null) : e = t
}
return r = r || function() {
}, "function" == typeof n && (n = i, i = a), i ? f(t, e, r, n) : setTimeout(function() {
f(t, e, r, n)
}, 4), d
}, d.config = function(e) {
return d(e)
}, e._defined = y, a = function(e, t, n) {
t.splice || (n = t, t = []), r(y, e) || r(m, e) || (m[e] = [e, t, n])
}, a.amd = {jQuery: !0}
}(), a("node_modules/almond/almond", [], function() {
}), function() {
function e(e) {
function n(e) {
if (this.data = "", this.read = 0, "string" == typeof e)
this.data = e;
else if (a.isArrayBuffer(e) || a.isArrayBufferView(e)) {
var t = new Uint8Array(e);
try {
this.data = String.fromCharCode.apply(null, t)
} catch (r) {
for (var i = 0; i < t.length; ++i)
this.putByte(t[i])
}
} else
(e instanceof n || "object" == typeof e && "string" == typeof e.data && "number" == typeof e.read) && (this.data = e.data, this.read = e.read)
}
function i(e, t) {
t = t || {}, this.read = t.readOffset || 0, this.growSize = t.growSize || 1024;
var r = a.isArrayBuffer(e), n = a.isArrayBufferView(e);
return r || n ? (this.data = r ? new DataView(e) : new DataView(e.buffer, e.byteOffset, e.byteLength), void (this.write = "writeOffset" in t ? t.writeOffset : this.data.byteLength)) : (this.data = new DataView(new ArrayBuffer(0)), this.write = 0, null !== e && void 0 !== e && this.putBytes(e), void ("writeOffset" in t && (this.write = t.writeOffset)))
}
var a = e.util = e.util || {};
"undefined" != typeof t && t.nextTick ? (a.nextTick = t.nextTick, a.setImmediate = "function" == typeof setImmediate ? setImmediate : a.nextTick) : "function" == typeof setImmediate ? (a.setImmediate = setImmediate, a.nextTick = function(e) {
return setImmediate(e)
}) : (a.setImmediate = function(e) {
setTimeout(e, 0)
}, a.nextTick = a.setImmediate), a.isArray = Array.isArray || function(e) {
return "[object Array]" === Object.prototype.toString.call(e)
}, a.isArrayBuffer = function(e) {
return "undefined" != typeof ArrayBuffer && e instanceof ArrayBuffer
};
var o = [];
"undefined" != typeof DataView && o.push(DataView), "undefined" != typeof Int8Array && o.push(Int8Array), "undefined" != typeof Uint8Array && o.push(Uint8Array), "undefined" != typeof Uint8ClampedArray && o.push(Uint8ClampedArray), "undefined" != typeof Int16Array && o.push(Int16Array), "undefined" != typeof Uint16Array && o.push(Uint16Array), "undefined" != typeof Int32Array && o.push(Int32Array), "undefined" != typeof Uint32Array && o.push(Uint32Array), "undefined" != typeof Float32Array && o.push(Float32Array), "undefined" != typeof Float64Array && o.push(Float64Array), a.isArrayBufferView = function(e) {
for (var t = 0; t < o.length; ++t)
if (e instanceof o[t])
return !0;
return !1
}, a.ByteBuffer = n, a.ByteStringBuffer = n, a.ByteStringBuffer.prototype.length = function() {
return this.data.length - this.read
}, a.ByteStringBuffer.prototype.isEmpty = function() {
return this.length() <= 0
}, a.ByteStringBuffer.prototype.putByte = function(e) {
return this.data += String.fromCharCode(e), this
}, a.ByteStringBuffer.prototype.fillWithByte = function(e, t) {
e = String.fromCharCode(e);
for (var r = this.data; t > 0; )
1 & t && (r += e), t >>>= 1, t > 0 && (e += e);
return this.data = r, this
}, a.ByteStringBuffer.prototype.putBytes = function(e) {
return this.data += e, this
}, a.ByteStringBuffer.prototype.putString = function(e) {
return this.data += a.encodeUtf8(e), this
}, a.ByteStringBuffer.prototype.putInt16 = function(e) {
return this.data += String.fromCharCode(e >> 8 & 255) + String.fromCharCode(255 & e), this
}, a.ByteStringBuffer.prototype.putInt24 = function(e) {
return this.data += String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(255 & e), this
}, a.ByteStringBuffer.prototype.putInt32 = function(e) {
return this.data += String.fromCharCode(e >> 24 & 255) + String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(255 & e), this
}, a.ByteStringBuffer.prototype.putInt16Le = function(e) {
return this.data += String.fromCharCode(255 & e) + String.fromCharCode(e >> 8 & 255), this
}, a.ByteStringBuffer.prototype.putInt24Le = function(e) {
return this.data += String.fromCharCode(255 & e) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e >> 16 & 255), this
}, a.ByteStringBuffer.prototype.putInt32Le = function(e) {
return this.data += String.fromCharCode(255 & e) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 24 & 255), this
}, a.ByteStringBuffer.prototype.putInt = function(e, t) {
do
t -= 8, this.data += String.fromCharCode(e >> t & 255);
while (t > 0);
return this
}, a.ByteStringBuffer.prototype.putSignedInt = function(e, t) {
return 0 > e && (e += 2 << t - 1), this.putInt(e, t)
}, a.ByteStringBuffer.prototype.putBuffer = function(e) {
return this.data += e.getBytes(), this
}, a.ByteStringBuffer.prototype.getByte = function() {
return this.data.charCodeAt(this.read++)
}, a.ByteStringBuffer.prototype.getInt16 = function() {
var e = this.data.charCodeAt(this.read) << 8 ^ this.data.charCodeAt(this.read + 1);
return this.read += 2, e
}, a.ByteStringBuffer.prototype.getInt24 = function() {
var e = this.data.charCodeAt(this.read) << 16 ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2);
return this.read += 3, e
}, a.ByteStringBuffer.prototype.getInt32 = function() {
var e = this.data.charCodeAt(this.read) << 24 ^ this.data.charCodeAt(this.read + 1) << 16 ^ this.data.charCodeAt(this.read + 2) << 8 ^ this.data.charCodeAt(this.read + 3);
return this.read += 4, e
}, a.ByteStringBuffer.prototype.getInt16Le = function() {
var e = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8;
return this.read += 2, e
}, a.ByteStringBuffer.prototype.getInt24Le = function() {
var e = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16;
return this.read += 3, e
}, a.ByteStringBuffer.prototype.getInt32Le = function() {
var e = this.data.charCodeAt(this.read) ^ this.data.charCodeAt(this.read + 1) << 8 ^ this.data.charCodeAt(this.read + 2) << 16 ^ this.data.charCodeAt(this.read + 3) << 24;
return this.read += 4, e
}, a.ByteStringBuffer.prototype.getInt = function(e) {
var t = 0;
do
t = (t << 8) + this.data.charCodeAt(this.read++), e -= 8;
while (e > 0);
return t
}, a.ByteStringBuffer.prototype.getSignedInt = function(e) {
var t = this.getInt(e), r = 2 << e - 2;
return t >= r && (t -= r << 1), t
}, a.ByteStringBuffer.prototype.getBytes = function(e) {
var t;
return e ? (e = Math.min(this.length(), e), t = this.data.slice(this.read, this.read + e), this.read += e) : 0 === e ? t = "" : (t = 0 === this.read ? this.data : this.data.slice(this.read), this.clear()), t
}, a.ByteStringBuffer.prototype.bytes = function(e) {
return "undefined" == typeof e ? this.data.slice(this.read) : this.data.slice(this.read, this.read + e)
}, a.ByteStringBuffer.prototype.at = function(e) {
return this.data.charCodeAt(this.read + e)
}, a.ByteStringBuffer.prototype.setAt = function(e, t) {
return this.data = this.data.substr(0, this.read + e) + String.fromCharCode(t) + this.data.substr(this.read + e + 1), this
}, a.ByteStringBuffer.prototype.last = function() {
return this.data.charCodeAt(this.data.length - 1)
}, a.ByteStringBuffer.prototype.copy = function() {
var e = a.createBuffer(this.data);
return e.read = this.read, e
}, a.ByteStringBuffer.prototype.compact = function() {
return this.read > 0 && (this.data = this.data.slice(this.read), this.read = 0), this
}, a.ByteStringBuffer.prototype.clear = function() {
return this.data = "", this.read = 0, this
}, a.ByteStringBuffer.prototype.truncate = function(e) {
var t = Math.max(0, this.length() - e);
return this.data = this.data.substr(this.read, t), this.read = 0, this
}, a.ByteStringBuffer.prototype.toHex = function() {
for (var e = "", t = this.read; t < this.data.length; ++t) {
var r = this.data.charCodeAt(t);
16 > r && (e += "0"), e += r.toString(16)
}
return e
}, a.ByteStringBuffer.prototype.toString = function() {
return a.decodeUtf8(this.bytes())
}, a.DataBuffer = i, a.DataBuffer.prototype.length = function() {
return this.write - this.read
}, a.DataBuffer.prototype.isEmpty = function() {
return this.length() <= 0
}, a.DataBuffer.prototype.accommodate = function(e, t) {
if (this.length() >= e)
return this;
t = Math.max(t || this.growSize, e);
var r = new Uint8Array(this.data.buffer, this.data.byteOffset, this.data.byteLength), n = new Uint8Array(this.length() + t);
return n.set(r), this.data = new DataView(n.buffer), this
}, a.DataBuffer.prototype.putByte = function(e) {
return this.accommodate(1), this.data.setUint8(this.write++, e), this
}, a.DataBuffer.prototype.fillWithByte = function(e, t) {
this.accommodate(t);
for (var r = 0; t > r; ++r)
this.data.setUint8(e);
return this
}, a.DataBuffer.prototype.putBytes = function(e, t) {
if (a.isArrayBufferView(e)) {
var r = new Uint8Array(e.buffer, e.byteOffset, e.byteLength), n = r.byteLength - r.byteOffset;
this.accommodate(n);
var i = new Uint8Array(this.data.buffer, this.write);
return i.set(r), this.write += n, this
}
if (a.isArrayBuffer(e)) {
var r = new Uint8Array(e);
this.accommodate(r.byteLength);
var i = new Uint8Array(this.data.buffer);
return i.set(r, this.write), this.write += r.byteLength, this
}
if (e instanceof a.DataBuffer || "object" == typeof e && "number" == typeof e.read && "number" == typeof e.write && a.isArrayBufferView(e.data)) {
var r = new Uint8Array(e.data.byteLength, e.read, e.length());
this.accommodate(r.byteLength);
var i = new Uint8Array(e.data.byteLength, this.write);
return i.set(r), this.write += r.byteLength, this
}
if (e instanceof a.ByteStringBuffer && (e = e.data, t = "binary"), t = t || "binary", "string" == typeof e) {
var o;
if ("hex" === t)
return this.accommodate(Math.ceil(e.length / 2)), o = new Uint8Array(this.data.buffer, this.write), this.write += a.binary.hex.decode(e, o, this.write), this;
if ("base64" === t)
return this.accommodate(3 * Math.ceil(e.length / 4)), o = new Uint8Array(this.data.buffer, this.write), this.write += a.binary.base64.decode(e, o, this.write), this;
if ("utf8" === t && (e = a.encodeUtf8(e), t = "binary"), "binary" === t || "raw" === t)
return this.accommodate(e.length), o = new Uint8Array(this.data.buffer, this.write), this.write += a.binary.raw.decode(o), this;
if ("utf16" === t)
return this.accommodate(2 * e.length), o = new Uint16Array(this.data.buffer, this.write), this.write += a.text.utf16.encode(o), this;
throw new Error("Invalid encoding: " + t)
}
throw Error("Invalid parameter: " + e)
}, a.DataBuffer.prototype.putBuffer = function(e) {
return this.putBytes(e), e.clear(), this
}, a.DataBuffer.prototype.putString = function(e) {
return this.putBytes(e, "utf16")
}, a.DataBuffer.prototype.putInt16 = function(e) {
return this.accommodate(2), this.data.setInt16(this.write, e), this.write += 2, this
}, a.DataBuffer.prototype.putInt24 = function(e) {
return this.accommodate(3), this.data.setInt16(this.write, e >> 8 & 65535), this.data.setInt8(this.write, e >> 16 & 255), this.write += 3, this
}, a.DataBuffer.prototype.putInt32 = function(e) {
return this.accommodate(4), this.data.setInt32(this.write, e), this.write += 4, this
}, a.DataBuffer.prototype.putInt16Le = function(e) {
return this.accommodate(2), this.data.setInt16(this.write, e, !0), this.write += 2, this
}, a.DataBuffer.prototype.putInt24Le = function(e) {
return this.accommodate(3), this.data.setInt8(this.write, e >> 16 & 255), this.data.setInt16(this.write, e >> 8 & 65535, !0), this.write += 3, this
}, a.DataBuffer.prototype.putInt32Le = function(e) {
return this.accommodate(4), this.data.setInt32(this.write, e, !0), this.write += 4, this
}, a.DataBuffer.prototype.putInt = function(e, t) {
this.accommodate(t / 8);
do
t -= 8, this.data.setInt8(this.write++, e >> t & 255);
while (t > 0);
return this
}, a.DataBuffer.prototype.putSignedInt = function(e, t) {
return this.accommodate(t / 8), 0 > e && (e += 2 << t - 1), this.putInt(e, t)
}, a.DataBuffer.prototype.getByte = function() {
return this.data.getInt8(this.read++)
}, a.DataBuffer.prototype.getInt16 = function() {
var e = this.data.getInt16(this.read);
return this.read += 2, e
}, a.DataBuffer.prototype.getInt24 = function() {
var e = this.data.getInt16(this.read) << 8 ^ this.data.getInt8(this.read + 2);
return this.read += 3, e
}, a.DataBuffer.prototype.getInt32 = function() {
var e = this.data.getInt32(this.read);
return this.read += 4, e
}, a.DataBuffer.prototype.getInt16Le = function() {
var e = this.data.getInt16(this.read, !0);
return this.read += 2, e
}, a.DataBuffer.prototype.getInt24Le = function() {
var e = this.data.getInt8(this.read) ^ this.data.getInt16(this.read + 1, !0) << 8;
return this.read += 3, e
}, a.DataBuffer.prototype.getInt32Le = function() {
var e = this.data.getInt32(this.read, !0);
return this.read += 4, e
}, a.DataBuffer.prototype.getInt = function(e) {
var t = 0;
do
t = (t << 8) + this.data.getInt8(this.read++), e -= 8;
while (e > 0);
return t
}, a.DataBuffer.prototype.getSignedInt = function(e) {
var t = this.getInt(e), r = 2 << e - 2;
return t >= r && (t -= r << 1), t
}, a.DataBuffer.prototype.getBytes = function(e) {
var t;
return e ? (e = Math.min(this.length(), e), t = this.data.slice(this.read, this.read + e), this.read += e) : 0 === e ? t = "" : (t = 0 === this.read ? this.data : this.data.slice(this.read), this.clear()), t
}, a.DataBuffer.prototype.bytes = function(e) {
return "undefined" == typeof e ? this.data.slice(this.read) : this.data.slice(this.read, this.read + e)
}, a.DataBuffer.prototype.at = function(e) {
return this.data.getUint8(this.read + e)
}, a.DataBuffer.prototype.setAt = function(e, t) {
return this.data.setUint8(e, t), this
}, a.DataBuffer.prototype.last = function() {
return this.data.getUint8(this.write - 1)
}, a.DataBuffer.prototype.copy = function() {
return new a.DataBuffer(this)
}, a.DataBuffer.prototype.compact = function() {
if (this.read > 0) {
var e = new Uint8Array(this.data.buffer, this.read), t = new Uint8Array(e.byteLength);
t.set(e), this.data = new DataView(t), this.write -= this.read, this.read = 0
}
return this
}, a.DataBuffer.prototype.clear = function() {
return this.data = new DataView(new ArrayBuffer(0)), this.read = this.write = 0, this
}, a.DataBuffer.prototype.truncate = function(e) {
return this.write = Math.max(0, this.length() - e), this.read = Math.min(this.read, this.write), this
}, a.DataBuffer.prototype.toHex = function() {
for (var e = "", t = this.read; t < this.data.byteLength; ++t) {
var r = this.data.getUint8(t);
16 > r && (e += "0"), e += r.toString(16)
}
return e
}, a.DataBuffer.prototype.toString = function(e) {
var t = new Uint8Array(this.data, this.read, this.length());
if (e = e || "utf8", "binary" === e || "raw" === e)
return a.binary.raw.encode(t);
if ("hex" === e)
return a.binary.hex.encode(t);
if ("base64" === e)
return a.binary.base64.encode(t);
if ("utf8" === e)
return a.text.utf8.decode(t);
if ("utf16" === e)
return a.text.utf16.decode(t);
throw new Error("Invalid encoding: " + e)
}, a.createBuffer = function(e, t) {
return t = t || "raw", void 0 !== e && "utf8" === t && (e = a.encodeUtf8(e)), new a.ByteBuffer(e)
}, a.fillString = function(e, t) {
for (var r = ""; t > 0; )
1 & t && (r += e), t >>>= 1, t > 0 && (e += e);
return r
}, a.xorBytes = function(e, t, r) {
for (var n = "", i = "", a = "", o = 0, s = 0; r > 0; --r, ++o)
i = e.charCodeAt(o) ^ t.charCodeAt(o), s >= 10 && (n += a, a = "", s = 0), a += String.fromCharCode(i), ++s;
return n += a
}, a.hexToBytes = function(e) {
var t = "", r = 0;
for (e.length & !0 && (r = 1, t += String.fromCharCode(parseInt(e[0], 16))); r < e.length; r += 2)
t += String.fromCharCode(parseInt(e.substr(r, 2), 16));
return t
}, a.bytesToHex = function(e) {
return a.createBuffer(e).toHex()
}, a.int32ToBytes = function(e) {
return String.fromCharCode(e >> 24 & 255) + String.fromCharCode(e >> 16 & 255) + String.fromCharCode(e >> 8 & 255) + String.fromCharCode(255 & e)
};
var s = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=", u = [62, -1, -1, -1, 63, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, -1, -1, -1, 64, -1, -1, -1, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, -1, -1, -1, -1, -1, -1, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51];
a.encode64 = function(e, t) {
for (var r, n, i, a = "", o = "", u = 0; u < e.length; )
r = e.charCodeAt(u++), n = e.charCodeAt(u++), i = e.charCodeAt(u++), a += s.charAt(r >> 2), a += s.charAt((3 & r) << 4 | n >> 4), isNaN(n) ? a += "==" : (a += s.charAt((15 & n) << 2 | i >> 6), a += isNaN(i) ? "=" : s.charAt(63 & i)), t && a.length > t && (o += a.substr(0, t) + "\r\n", a = a.substr(t));
return o += a
}, a.decode64 = function(e) {
e = e.replace(/[^A-Za-z0-9\+\/\=]/g, "");
for (var t, r, n, i, a = "", o = 0; o < e.length; )
t = u[e.charCodeAt(o++) - 43], r = u[e.charCodeAt(o++) - 43], n = u[e.charCodeAt(o++) - 43], i = u[e.charCodeAt(o++) - 43], a += String.fromCharCode(t << 2 | r >> 4), 64 !== n && (a += String.fromCharCode((15 & r) << 4 | n >> 2), 64 !== i && (a += String.fromCharCode((3 & n) << 6 | i)));
return a
}, a.encodeUtf8 = function(e) {
return unescape(encodeURIComponent(e))
}, a.decodeUtf8 = function(e) {
return decodeURIComponent(escape(e))
}, a.binary = {raw: {},hex: {},base64: {}}, a.binary.raw.encode = function(e) {
return String.fromCharCode.apply(null, e)
}, a.binary.raw.decode = function(e, t, r) {
var n = t;
n || (n = new Uint8Array(e.length)), r = r || 0;
for (var i = r, a = 0; a < e.length; ++a)
n[i++] = e.charCodeAt(a);
return t ? i - r : n
}, a.binary.hex.encode = a.bytesToHex, a.binary.hex.decode = function(e, t, r) {
var n = t;
n || (n = new Uint8Array(Math.ceil(e.length / 2))), r = r || 0;
var i = 0, a = r;
for (1 & e.length && (i = 1, n[a++] = parseInt(e[0], 16)); i < e.length; i += 2)
n[a++] = parseInt(e.substr(i, 2), 16);
return t ? a - r : n
}, a.binary.base64.encode = function(e, t) {
for (var r, n, i, a = "", o = "", u = 0; u < e.byteLength; )
r = e[u++], n = e[u++], i = e[u++], a += s.charAt(r >> 2), a += s.charAt((3 & r) << 4 | n >> 4), isNaN(n) ? a += "==" : (a += s.charAt((15 & n) << 2 | i >> 6), a += isNaN(i) ? "=" : s.charAt(63 & i)), t && a.length > t && (o += a.substr(0, t) + "\r\n", a = a.substr(t));
return o += a
}, a.binary.base64.decode = function(e, t, r) {
var n = t;
n || (n = new Uint8Array(3 * Math.ceil(e.length / 4))), e = e.replace(/[^A-Za-z0-9\+\/\=]/g, ""), r = r || 0;
for (var i, a, o, s, l = 0, c = r; l < e.length; )
i = u[e.charCodeAt(l++) - 43], a = u[e.charCodeAt(l++) - 43], o = u[e.charCodeAt(l++) - 43], s = u[e.charCodeAt(l++) - 43], n[c++] = i << 2 | a >> 4, 64 !== o && (n[c++] = (15 & a) << 4 | o >> 2, 64 !== s && (n[c++] = (3 & o) << 6 | s));
return t ? c - r : n
}, a.text = {utf8: {},utf16: {}}, a.text.utf8.encode = function(e, t, r) {
e = a.encodeUtf8(e);
var n = t;
n || (n = new Uint8Array(e.length)), r = r || 0;
for (var i = r, o = 0; o < e.length; ++o)
n[i++] = e.charCodeAt(o);
return t ? i - r : n
}, a.text.utf8.decode = function(e) {
return a.decodeUtf8(String.fromCharCode.apply(null, e))
}, a.text.utf16.encode = function(e, t, r) {
var n = t;
n || (n = new Uint8Array(e.length));
var i = new Uint16Array(n);
r = r || 0;
for (var a = r, o = r, s = 0; s < e.length; ++s)
i[o++] = e.charCodeAt(s), a += 2;
return t ? a - r : n
}, a.text.utf16.decode = function(e) {
return String.fromCharCode.apply(null, new Uint16Array(e))
}, a.deflate = function(e, t, r) {
if (t = a.decode64(e.deflate(a.encode64(t)).rval), r) {
var n = 2, i = t.charCodeAt(1);
32 & i && (n = 6), t = t.substring(n, t.length - 4)
}
return t
}, a.inflate = function(e, t) {
var r = e.inflate(a.encode64(t)).rval;
return null === r ? null : a.decode64(r)
};
var l = function(e, t, r) {
if (!e)
throw new Error("WebStorage not available.");
var n;
if (null === r ? n = e.removeItem(t) : (r = a.encode64(JSON.stringify(r)), n = e.setItem(t, r)), "undefined" != typeof n && n.rval !== !0) {
var i = new Error(n.error.message);
throw i.id = n.error.id, i.name = n.error.name, i
}
}, c = function(e, t) {
if (!e)
throw new Error("WebStorage not available.");
var r = e.getItem(t);
if (e.init)
if (null === r.rval) {
if (r.error) {
var n = new Error(r.error.message);
throw n.id = r.error.id, n.name = r.error.name, n
}
r = null
} else
r = r.rval;
return null !== r && (r = JSON.parse(a.decode64(r))), r
}, p = function(e, t, r, n) {
var i = c(e, t);
null === i && (i = {}), i[r] = n, l(e, t, i)
}, f = function(e, t, r) {
var n = c(e, t);
return null !== n && (n = r in n ? n[r] : null), n
}, d = function(e, t, r) {
var n = c(e, t);
if (null !== n && r in n) {
delete n[r];
var i = !0;
for (var a in n) {
i = !1;
break
}
i && (n = null), l(e, t, n)
}
}, h = function(e, t) {
l(e, t, null)
}, g = function(e, t, r) {
var n = null;
"undefined" == typeof r && (r = ["web", "flash"]);
var i, a = !1, o = null;
for (var s in r) {
i = r[s];
try {
if ("flash" === i || "both" === i) {
if (null === t[0])
throw new Error("Flash local storage not available.");
n = e.apply(this, t), a = "flash" === i
}
("web" === i || "both" === i) && (t[0] = localStorage, n = e.apply(this, t), a = !0)
} catch (u) {
o = u
}
if (a)
break
}
if (!a)
throw o;
return n
};
a.setItem = function(e, t, r, n, i) {
g(p, arguments, i)
}, a.getItem = function(e, t, r, n) {
return g(f, arguments, n)
}, a.removeItem = function(e, t, r, n) {
g(d, arguments, n)
}, a.clearItems = function(e, t, r) {
g(h, arguments, r)
}, a.parseUrl = function(e) {
var t = /^(https?):\/\/([^:&^\/]*):?(\d*)(.*)$/g;
t.lastIndex = 0;
var r = t.exec(e), n = null === r ? null : {full: e,scheme: r[1],host: r[2],port: r[3],path: r[4]};
return n && (n.fullHost = n.host, n.port ? 80 !== n.port && "http" === n.scheme ? n.fullHost += ":" + n.port : 443 !== n.port && "https" === n.scheme && (n.fullHost += ":" + n.port) : "http" === n.scheme ? n.port = 80 : "https" === n.scheme && (n.port = 443), n.full = n.scheme + "://" + n.fullHost), n
};
var y = null;
a.getQueryVariables = function(e) {
var t, r = function(e) {
for (var t = {}, r = e.split("&"), n = 0; n < r.length; n++) {
var i, a, o = r[n].indexOf("=");
o > 0 ? (i = r[n].substring(0, o), a = r[n].substring(o + 1)) : (i = r[n], a = null), i in t || (t[i] = []), i in Object.prototype || null === a || t[i].push(unescape(a))
}
return t
};
return "undefined" == typeof e ? (null === y && (y = "undefined" == typeof window ? {} : r(window.location.search.substring(1))), t = y) : t = r(e), t
}, a.parseFragment = function(e) {
var t = e, r = "", n = e.indexOf("?");
n > 0 && (t = e.substring(0, n), r = e.substring(n + 1));
var i = t.split("/");
i.length > 0 && "" === i[0] && i.shift();
var o = "" === r ? {} : a.getQueryVariables(r);
return {pathString: t,queryString: r,path: i,query: o}
}, a.makeRequest = function(e) {
var t = a.parseFragment(e), r = {path: t.pathString,query: t.queryString,getPath: function(e) {
return "undefined" == typeof e ? t.path : t.path[e]
},getQuery: function(e, r) {
var n;
return "undefined" == typeof e ? n = t.query : (n = t.query[e], n && "undefined" != typeof r && (n = n[r])), n
},getQueryLast: function(e, t) {
var n, i = r.getQuery(e);
return n = i ? i[i.length - 1] : t
}};
return r
}, a.makeLink = function(e, t, n) {
e = r.isArray(e) ? e.join("/") : e;
var i = r.param(t || {});
return n = n || "", e + (i.length > 0 ? "?" + i : "") + (n.length > 0 ? "#" + n : "")
}, a.setPath = function(e, t, r) {
if ("object" == typeof e && null !== e)
for (var n = 0, i = t.length; i > n; ) {
var a = t[n++];
if (n == i)
e[a] = r;
else {
var o = a in e;
(!o || o && "object" != typeof e[a] || o && null === e[a]) && (e[a] = {}), e = e[a]
}
}
}, a.getPath = function(e, t, r) {
for (var n = 0, i = t.length, a = !0; a && i > n && "object" == typeof e && null !== e; ) {
var o = t[n++];
a = o in e, a && (e = e[o])
}
return a ? e : r
}, a.deletePath = function(e, t) {
if ("object" == typeof e && null !== e)
for (var r = 0, n = t.length; n > r; ) {
var i = t[r++];
if (r == n)
delete e[i];
else {
if (!(i in e) || "object" != typeof e[i] || null === e[i])
break;
e = e[i]
}
}
}, a.isEmpty = function(e) {
for (var t in e)
if (e.hasOwnProperty(t))
return !1;
return !0
}, a.format = function(e) {
for (var t, r, n = /%./g, i = 0, a = [], o = 0; t = n.exec(e); ) {
r = e.substring(o, n.lastIndex - 2), r.length > 0 && a.push(r), o = n.lastIndex;
var s = t[0][1];
switch (s) {
case "s":
case "o":
a.push(i < arguments.length ? arguments[i++ + 1] : "<?>");
break;
case "%":
a.push("%");
break;
default:
a.push("<%" + s + "?>")
}
}
return a.push(e.substring(o)), a.join("")
}, a.formatNumber = function(e, t, r, n) {
var i = e, a = isNaN(t = Math.abs(t)) ? 2 : t, o = void 0 === r ? "," : r, s = void 0 === n ? "." : n, u = 0 > i ? "-" : "", l = parseInt(i = Math.abs(+i || 0).toFixed(a), 10) + "", c = l.length > 3 ? l.length % 3 : 0;
return u + (c ? l.substr(0, c) + s : "") + l.substr(c).replace(/(\d{3})(?=\d)/g, "$1" + s) + (a ? o + Math.abs(i - l).toFixed(a).slice(2) : "")
}, a.formatSize = function(e) {
return e = e >= 1073741824 ? a.formatNumber(e / 1073741824, 2, ".", "") + " GiB" : e >= 1048576 ? a.formatNumber(e / 1048576, 2, ".", "") + " MiB" : e >= 1024 ? a.formatNumber(e / 1024, 0) + " KiB" : a.formatNumber(e, 0) + " bytes"
}, a.bytesFromIP = function(e) {
return -1 !== e.indexOf(".") ? a.bytesFromIPv4(e) : -1 !== e.indexOf(":") ? a.bytesFromIPv6(e) : null
}, a.bytesFromIPv4 = function(e) {
if (e = e.split("."), 4 !== e.length)
return null;
for (var t = a.createBuffer(), r = 0; r < e.length; ++r) {
var n = parseInt(e[r], 10);
if (isNaN(n))
return null;
t.putByte(n)
}
return t.getBytes()
}, a.bytesFromIPv6 = function(e) {
var t = 0;
e = e.split(":").filter(function(e) {
return 0 === e.length && ++t, !0
});
for (var r = 2 * (8 - e.length + t), n = a.createBuffer(), i = 0; 8 > i; ++i)
if (e[i] && 0 !== e[i].length) {
var o = a.hexToBytes(e[i]);
o.length < 2 && n.putByte(0), n.putBytes(o)
} else
n.fillWithByte(0, r), r = 0;
return n.getBytes()
}, a.bytesToIP = function(e) {
return 4 === e.length ? a.bytesToIPv4(e) : 16 === e.length ? a.bytesToIPv6(e) : null
}, a.bytesToIPv4 = function(e) {
if (4 !== e.length)
return null;
for (var t = [], r = 0; r < e.length; ++r)
t.push(e.charCodeAt(r));
return t.join(".")
}, a.bytesToIPv6 = function(e) {
if (16 !== e.length)
return null;
for (var t = [], r = [], n = 0, i = 0; i < e.length; i += 2) {
for (var o = a.bytesToHex(e[i] + e[i + 1]); "0" === o[0] && "0" !== o; )
o = o.substr(1);
if ("0" === o) {
var s = r[r.length - 1], u = t.length;
s && u === s.end + 1 ? (s.end = u, s.end - s.start > r[n].end - r[n].start && (n = r.length - 1)) : r.push({start: u,end: u})
}
t.push(o)
}
if (r.length > 0) {
var l = r[n];
l.end - l.start > 0 && (t.splice(l.start, l.end - l.start + 1, ""), 0 === l.start && t.unshift(""), 7 === l.end && t.push(""))
}
return t.join(":")
}, a.estimateCores = function(e, t) {
function r(e, s, u) {
if (0 === s) {
var l = Math.floor(e.reduce(function(e, t) {
return e + t
}, 0) / e.length);
return a.cores = Math.max(1, l), URL.revokeObjectURL(o), t(null, a.cores)
}
n(u, function(t, n) {
e.push(i(u, n)), r(e, s - 1, u)
})
}
function n(e, t) {
for (var r = [], n = [], i = 0; e > i; ++i) {
var a = new Worker(o);
a.addEventListener("message", function(i) {
if (n.push(i.data), n.length === e) {
for (var a = 0; e > a; ++a)
r[a].terminate();
t(null, n)
}
}), r.push(a)
}
for (var i = 0; e > i; ++i)
r[i].postMessage(i)
}
function i(e, t) {
for (var r = [], n = 0; e > n; ++n)
for (var i = t[n], a = r[n] = [], o = 0; e > o; ++o)
if (n !== o) {
var s = t[o];
(i.st > s.st && i.st < s.et || s.st > i.st && s.st < i.et) && a.push(o)
}
return r.reduce(function(e, t) {
return Math.max(e, t.length)
}, 0)
}
if ("function" == typeof e && (t = e, e = {}), e = e || {}, "cores" in a && !e.update)
return t(null, a.cores);
if (void 0 === typeof Worker)
return a.cores = 1, t(null, a.cores);
if (void 0 === typeof Blob)
return a.cores = 2, t(null, a.cores);
var o = URL.createObjectURL(new Blob(["(", function() {
self.addEventListener("message", function() {
for (var e = Date.now(), t = e + 4; Date.now() < t; )
;
self.postMessage({st: e,et: t})
})
}.toString(), ")()"], {type: "application/javascript"}));
r([], 5, 16)
}
}
var o = "util";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var s = !0;
a = function(e, t) {
t(i, n)
}
}
var u, l = function(t, r) {
r.exports = function(r) {
var n = u.map(function(e) {
return t(e)
}).concat(e);
if (r = r || {}, r.defined = r.defined || {}, r.defined[o])
return r[o];
r.defined[o] = !0;
for (var i = 0; i < n.length; ++i)
n[i](r);
return r[o]
}
}, c = a;
(a = function(e, t) {
return u = "string" == typeof e ? t.slice(2) : e.slice(2), s ? (delete a, c.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = c, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/util", ["require", "module"], function() {
l.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
e.cipher = e.cipher || {}, e.cipher.algorithms = e.cipher.algorithms || {}, e.cipher.createCipher = function(t, r) {
var n = t;
if ("string" == typeof n && (n = e.cipher.getAlgorithm(n), n && (n = n())), !n)
throw new Error("Unsupported algorithm: " + t);
return new e.cipher.BlockCipher({algorithm: n,key: r,decrypt: !1})
}, e.cipher.createDecipher = function(t, r) {
var n = t;
if ("string" == typeof n && (n = e.cipher.getAlgorithm(n), n && (n = n())), !n)
throw new Error("Unsupported algorithm: " + t);
return new e.cipher.BlockCipher({algorithm: n,key: r,decrypt: !0})
}, e.cipher.registerAlgorithm = function(t, r) {
t = t.toUpperCase(), e.cipher.algorithms[t] = r
}, e.cipher.getAlgorithm = function(t) {
return t = t.toUpperCase(), t in e.cipher.algorithms ? e.cipher.algorithms[t] : null
};
var t = e.cipher.BlockCipher = function(e) {
this.algorithm = e.algorithm, this.mode = this.algorithm.mode, this.blockSize = this.mode.blockSize, this._finish = !1, this._input = null, this.output = null, this._op = e.decrypt ? this.mode.decrypt : this.mode.encrypt, this._decrypt = e.decrypt, this.algorithm.initialize(e)
};
t.prototype.start = function(t) {
t = t || {};
var r = {};
for (var n in t)
r[n] = t[n];
r.decrypt = this._decrypt, this._finish = !1, this._input = e.util.createBuffer(), this.output = t.output || e.util.createBuffer(), this.mode.start(r)
}, t.prototype.update = function(e) {
for (this._finish || this._input.putBuffer(e); this._input.length() >= this.blockSize || this._input.length() > 0 && this._finish; )
this._op.call(this.mode, this._input, this.output);
this._input.compact()
}, t.prototype.finish = function(e) {
e && "CBC" === this.mode.name && (this.mode.pad = function(t) {
return e(this.blockSize, t, !1)
}, this.mode.unpad = function(t) {
return e(this.blockSize, t, !0)
});
var t = {};
return t.decrypt = this._decrypt, t.overflow = this._input.length() % this.blockSize, this._decrypt || !this.mode.pad || this.mode.pad(this._input, t) ? (this._finish = !0, this.update(), this._decrypt && this.mode.unpad && !this.mode.unpad(this.output, t) ? !1 : this.mode.afterFinish && !this.mode.afterFinish(this.output, t) ? !1 : !0) : !1
}
}
var t = "cipher";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/cipher", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(t) {
if ("string" == typeof t && (t = e.util.createBuffer(t)), e.util.isArray(t) && t.length > 4) {
var r = t;
t = e.util.createBuffer();
for (var n = 0; n < t.length; ++n)
t.putByte(r[n])
}
return e.util.isArray(t) || (t = [t.getInt32(), t.getInt32(), t.getInt32(), t.getInt32()]), t
}
function r(e) {
e[e.length - 1] = e[e.length - 1] + 1 & 4294967295
}
function n(e) {
return [e / 4294967296 | 0, 4294967295 & e]
}
e.cipher = e.cipher || {};
var i = e.cipher.modes = e.cipher.modes || {};
i.ecb = function(e) {
e = e || {}, this.name = "ECB", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._blocks = this.blockSize / 4, this._inBlock = new Array(this._blocks), this._outBlock = new Array(this._blocks)
}, i.ecb.prototype.start = function() {
}, i.ecb.prototype.encrypt = function(e, t) {
for (var r = 0; r < this._blocks; ++r)
this._inBlock[r] = e.getInt32();
this.cipher.encrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
t.putInt32(this._outBlock[r])
}, i.ecb.prototype.decrypt = function(e, t) {
for (var r = 0; r < this._blocks; ++r)
this._inBlock[r] = e.getInt32();
this.cipher.decrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
t.putInt32(this._outBlock[r])
}, i.ecb.prototype.pad = function(e) {
var t = e.length() === this.blockSize ? this.blockSize : this.blockSize - e.length();
return e.fillWithByte(t, t), !0
}, i.ecb.prototype.unpad = function(e, t) {
if (t.overflow > 0)
return !1;
var r = e.length(), n = e.at(r - 1);
return n > this.blockSize << 2 ? !1 : (e.truncate(n), !0)
}, i.cbc = function(e) {
e = e || {}, this.name = "CBC", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._blocks = this.blockSize / 4, this._inBlock = new Array(this._blocks), this._outBlock = new Array(this._blocks)
}, i.cbc.prototype.start = function(e) {
if (null === e.iv) {
if (!this._prev)
throw new Error("Invalid IV parameter.");
this._iv = this._prev.slice(0)
} else {
if (!("iv" in e))
throw new Error("Invalid IV parameter.");
this._iv = t(e.iv), this._prev = this._iv.slice(0)
}
}, i.cbc.prototype.encrypt = function(e, t) {
for (var r = 0; r < this._blocks; ++r)
this._inBlock[r] = this._prev[r] ^ e.getInt32();
this.cipher.encrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
t.putInt32(this._outBlock[r]);
this._prev = this._outBlock
}, i.cbc.prototype.decrypt = function(e, t) {
for (var r = 0; r < this._blocks; ++r)
this._inBlock[r] = e.getInt32();
this.cipher.decrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
t.putInt32(this._prev[r] ^ this._outBlock[r]);
this._prev = this._inBlock.slice(0)
}, i.cbc.prototype.pad = function(e) {
var t = e.length() === this.blockSize ? this.blockSize : this.blockSize - e.length();
return e.fillWithByte(t, t), !0
}, i.cbc.prototype.unpad = function(e, t) {
if (t.overflow > 0)
return !1;
var r = e.length(), n = e.at(r - 1);
return n > this.blockSize << 2 ? !1 : (e.truncate(n), !0)
}, i.cfb = function(e) {
e = e || {}, this.name = "CFB", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._blocks = this.blockSize / 4, this._inBlock = null, this._outBlock = new Array(this._blocks)
}, i.cfb.prototype.start = function(e) {
if (!("iv" in e))
throw new Error("Invalid IV parameter.");
this._iv = t(e.iv), this._inBlock = this._iv.slice(0)
}, i.cfb.prototype.encrypt = function(e, t) {
this.cipher.encrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
this._inBlock[r] = e.getInt32() ^ this._outBlock[r], t.putInt32(this._inBlock[r])
}, i.cfb.prototype.decrypt = function(e, t) {
this.cipher.encrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
this._inBlock[r] = e.getInt32(), t.putInt32(this._inBlock[r] ^ this._outBlock[r])
}, i.cfb.prototype.afterFinish = function(e, t) {
return t.overflow > 0 && e.truncate(this.blockSize - t.overflow), !0
}, i.ofb = function(e) {
e = e || {}, this.name = "OFB", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._blocks = this.blockSize / 4, this._inBlock = null, this._outBlock = new Array(this._blocks)
}, i.ofb.prototype.start = function(e) {
if (!("iv" in e))
throw new Error("Invalid IV parameter.");
this._iv = t(e.iv), this._inBlock = this._iv.slice(0)
}, i.ofb.prototype.encrypt = function(e, t) {
this.cipher.encrypt(this._inBlock, this._outBlock);
for (var r = 0; r < this._blocks; ++r)
t.putInt32(e.getInt32() ^ this._outBlock[r]), this._inBlock[r] = this._outBlock[r]
}, i.ofb.prototype.decrypt = i.ofb.prototype.encrypt, i.ofb.prototype.afterFinish = function(e, t) {
return t.overflow > 0 && e.truncate(this.blockSize - t.overflow), !0
}, i.ctr = function(e) {
e = e || {}, this.name = "CTR", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._blocks = this.blockSize / 4, this._inBlock = null, this._outBlock = new Array(this._blocks)
}, i.ctr.prototype.start = function(e) {
if (!("iv" in e))
throw new Error("Invalid IV parameter.");
this._iv = t(e.iv), this._inBlock = this._iv.slice(0)
}, i.ctr.prototype.encrypt = function(e, t) {
this.cipher.encrypt(this._inBlock, this._outBlock), r(this._inBlock);
for (var n = 0; n < this._blocks; ++n)
t.putInt32(e.getInt32() ^ this._outBlock[n])
}, i.ctr.prototype.decrypt = i.ctr.prototype.encrypt, i.ctr.prototype.afterFinish = function(e, t) {
return t.overflow > 0 && e.truncate(this.blockSize - t.overflow), !0
}, i.gcm = function(e) {
e = e || {}, this.name = "GCM", this.cipher = e.cipher, this.blockSize = e.blockSize || 16, this._blocks = this.blockSize / 4, this._inBlock = new Array(this._blocks), this._outBlock = new Array(this._blocks), this._R = 3774873600
}, i.gcm.prototype.start = function(t) {
if (!("iv" in t))
throw new Error("Invalid IV parameter.");
var i = e.util.createBuffer(t.iv);
this._cipherLength = 0;
var a;
if (a = "additionalData" in t ? e.util.createBuffer(t.additionalData) : e.util.createBuffer(), this._tagLength = "tagLength" in t ? t.tagLength : 128, this._tag = null, t.decrypt && (this._tag = e.util.createBuffer(t.tag).getBytes(), this._tag.length !== this._tagLength / 8))
throw new Error("Authentication tag does not match tag length.");
this._hashBlock = new Array(this._blocks), this.tag = null, this._hashSubkey = new Array(this._blocks), this.cipher.encrypt([0, 0, 0, 0], this._hashSubkey), this.componentBits = 4, this._m = this.generateHashTable(this._hashSubkey, this.componentBits);
var o = i.length();
if (12 === o)
this._j0 = [i.getInt32(), i.getInt32(), i.getInt32(), 1];
else {
for (this._j0 = [0, 0, 0, 0]; i.length() > 0; )
this._j0 = this.ghash(this._hashSubkey, this._j0, [i.getInt32(), i.getInt32(), i.getInt32(), i.getInt32()]);
this._j0 = this.ghash(this._hashSubkey, this._j0, [0, 0].concat(n(8 * o)))
}
this._inBlock = this._j0.slice(0), r(this._inBlock), a = e.util.createBuffer(a), this._aDataLength = n(8 * a.length());
var s = a.length() % this.blockSize;
for (s && a.fillWithByte(0, this.blockSize - s), this._s = [0, 0, 0, 0]; a.length() > 0; )
this._s = this.ghash(this._hashSubkey, this._s, [a.getInt32(), a.getInt32(), a.getInt32(), a.getInt32()])
}, i.gcm.prototype.encrypt = function(t, n) {
this.cipher.encrypt(this._inBlock, this._outBlock), r(this._inBlock);
for (var i = t.length(), a = 0; a < this._blocks; ++a)
this._outBlock[a] ^= t.getInt32();
if (i < this.blockSize) {
var o = i % this.blockSize;
this._cipherLength += o;
var s = e.util.createBuffer();
s.putInt32(this._outBlock[0]), s.putInt32(this._outBlock[1]), s.putInt32(this._outBlock[2]), s.putInt32(this._outBlock[3]), s.truncate(this.blockSize - o), this._outBlock[0] = s.getInt32(), this._outBlock[1] = s.getInt32(), this._outBlock[2] = s.getInt32(), this._outBlock[3] = s.getInt32()
} else
this._cipherLength += this.blockSize;
for (var a = 0; a < this._blocks; ++a)
n.putInt32(this._outBlock[a]);
this._s = this.ghash(this._hashSubkey, this._s, this._outBlock)
}, i.gcm.prototype.decrypt = function(e, t) {
this.cipher.encrypt(this._inBlock, this._outBlock), r(this._inBlock);
var n = e.length();
this._hashBlock[0] = e.getInt32(), this._hashBlock[1] = e.getInt32(), this._hashBlock[2] = e.getInt32(), this._hashBlock[3] = e.getInt32(), this._s = this.ghash(this._hashSubkey, this._s, this._hashBlock);
for (var i = 0; i < this._blocks; ++i)
t.putInt32(this._outBlock[i] ^ this._hashBlock[i]);
this._cipherLength += n < this.blockSize ? n % this.blockSize : this.blockSize
}, i.gcm.prototype.afterFinish = function(t, r) {
var i = !0;
r.overflow && t.truncate(this.blockSize - r.overflow), this.tag = e.util.createBuffer();
var a = this._aDataLength.concat(n(8 * this._cipherLength));
this._s = this.ghash(this._hashSubkey, this._s, a);
var o = [];
this.cipher.encrypt(this._j0, o);
for (var s = 0; s < this._blocks; ++s)
this.tag.putInt32(this._s[s] ^ o[s]);
return this.tag.truncate(this.tag.length() % (this._tagLength / 8)), r.decrypt && this.tag.bytes() !== this._tag && (i = !1), i
}, i.gcm.prototype.multiply = function(e, t) {
for (var r = [0, 0, 0, 0], n = t.slice(0), i = 0; 128 > i; ++i) {
var a = e[i / 32 | 0] & 1 << 31 - i % 32;
a && (r[0] ^= n[0], r[1] ^= n[1], r[2] ^= n[2], r[3] ^= n[3]), this.pow(n, n)
}
return r
}, i.gcm.prototype.pow = function(e, t) {
for (var r = 1 & e[3], n = 3; n > 0; --n)
t[n] = e[n] >>> 1 | (1 & e[n - 1]) << 31;
t[0] = e[0] >>> 1, r && (t[0] ^= this._R)
}, i.gcm.prototype.tableMultiply = function(e) {
for (var t = [0, 0, 0, 0], r = 0; 32 > r; ++r) {
var n = r / 8 | 0, i = e[n] >>> 4 * (7 - r % 8) & 15, a = this._m[r][i];
t[0] ^= a[0], t[1] ^= a[1], t[2] ^= a[2], t[3] ^= a[3]
}
return t
}, i.gcm.prototype.ghash = function(e, t, r) {
return t[0] ^= r[0], t[1] ^= r[1], t[2] ^= r[2], t[3] ^= r[3], this.tableMultiply(t)
}, i.gcm.prototype.generateHashTable = function(e, t) {
for (var r = 8 / t, n = 4 * r, i = 16 * r, a = new Array(i), o = 0; i > o; ++o) {
var s = [0, 0, 0, 0], u = o / n | 0, l = (n - 1 - o % n) * t;
s[u] = 1 << t - 1 << l, a[o] = this.generateSubHashTable(this.multiply(s, e), t)
}
return a
}, i.gcm.prototype.generateSubHashTable = function(e, t) {
var r = 1 << t, n = r >>> 1, i = new Array(r);
i[n] = e.slice(0);
for (var a = n >>> 1; a > 0; )
this.pow(i[2 * a], i[a] = []), a >>= 1;
for (a = 2; n > a; ) {
for (var o = 1; a > o; ++o) {
var s = i[a], u = i[o];
i[a + o] = [s[0] ^ u[0], s[1] ^ u[1], s[2] ^ u[2], s[3] ^ u[3]]
}
a *= 2
}
for (i[0] = [0, 0, 0, 0], a = n + 1; r > a; ++a) {
var l = i[a ^ n];
i[a] = [e[0] ^ l[0], e[1] ^ l[1], e[2] ^ l[2], e[3] ^ l[3]]
}
return i
}
}
var t = "cipherModes";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/cipherModes", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(t, r) {
var n = function() {
return new e.aes.Algorithm(t, r)
};
e.cipher.registerAlgorithm(t, n)
}
function r() {
p = !0, u = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54];
for (var e = new Array(256), t = 0; 128 > t; ++t)
e[t] = t << 1, e[t + 128] = t + 128 << 1 ^ 283;
o = new Array(256), s = new Array(256), l = new Array(4), c = new Array(4);
for (var t = 0; 4 > t; ++t)
l[t] = new Array(256), c[t] = new Array(256);
for (var r, n, i, a, f, d, h, g = 0, y = 0, t = 0; 256 > t; ++t) {
a = y ^ y << 1 ^ y << 2 ^ y << 3 ^ y << 4, a = a >> 8 ^ 255 & a ^ 99, o[g] = a, s[a] = g, f = e[a], r = e[g], n = e[r], i = e[n], d = f << 24 ^ a << 16 ^ a << 8 ^ (a ^ f), h = (r ^ n ^ i) << 24 ^ (g ^ i) << 16 ^ (g ^ n ^ i) << 8 ^ (g ^ r ^ i);
for (var m = 0; 4 > m; ++m)
l[m][g] = d, c[m][a] = h, d = d << 24 | d >>> 8, h = h << 24 | h >>> 8;
0 === g ? g = y = 1 : (g = r ^ e[e[e[r ^ i]]], y ^= e[e[y]])
}
}
function n(e, t) {
for (var r, n = e.slice(0), i = 1, a = n.length, s = a + 6 + 1, l = f * s, p = a; l > p; ++p)
r = n[p - 1], p % a === 0 ? (r = o[r >>> 16 & 255] << 24 ^ o[r >>> 8 & 255] << 16 ^ o[255 & r] << 8 ^ o[r >>> 24] ^ u[i] << 24, i++) : a > 6 && p % a === 4 && (r = o[r >>> 24] << 24 ^ o[r >>> 16 & 255] << 16 ^ o[r >>> 8 & 255] << 8 ^ o[255 & r]), n[p] = n[p - a] ^ r;
if (t) {
var d, h = c[0], g = c[1], y = c[2], m = c[3], v = n.slice(0);
l = n.length;
for (var p = 0, b = l - f; l > p; p += f, b -= f)
if (0 === p || p === l - f)
v[p] = n[b], v[p + 1] = n[b + 3], v[p + 2] = n[b + 2], v[p + 3] = n[b + 1];
else
for (var _ = 0; f > _; ++_)
d = n[b + _], v[p + (3 & -_)] = h[o[d >>> 24]] ^ g[o[d >>> 16 & 255]] ^ y[o[d >>> 8 & 255]] ^ m[o[255 & d]];
n = v
}
return n
}
function i(e, t, r, n) {
var i, a, u, p, f, d = e.length / 4 - 1;
n ? (i = c[0], a = c[1], u = c[2], p = c[3], f = s) : (i = l[0], a = l[1], u = l[2], p = l[3], f = o);
var h, g, y, m, v, b, _;
h = t[0] ^ e[0], g = t[n ? 3 : 1] ^ e[1], y = t[2] ^ e[2], m = t[n ? 1 : 3] ^ e[3];
for (var E = 3, C = 1; d > C; ++C)
v = i[h >>> 24] ^ a[g >>> 16 & 255] ^ u[y >>> 8 & 255] ^ p[255 & m] ^ e[++E], b = i[g >>> 24] ^ a[y >>> 16 & 255] ^ u[m >>> 8 & 255] ^ p[255 & h] ^ e[++E], _ = i[y >>> 24] ^ a[m >>> 16 & 255] ^ u[h >>> 8 & 255] ^ p[255 & g] ^ e[++E], m = i[m >>> 24] ^ a[h >>> 16 & 255] ^ u[g >>> 8 & 255] ^ p[255 & y] ^ e[++E], h = v, g = b, y = _;
r[0] = f[h >>> 24] << 24 ^ f[g >>> 16 & 255] << 16 ^ f[y >>> 8 & 255] << 8 ^ f[255 & m] ^ e[++E], r[n ? 3 : 1] = f[g >>> 24] << 24 ^ f[y >>> 16 & 255] << 16 ^ f[m >>> 8 & 255] << 8 ^ f[255 & h] ^ e[++E], r[2] = f[y >>> 24] << 24 ^ f[m >>> 16 & 255] << 16 ^ f[h >>> 8 & 255] << 8 ^ f[255 & g] ^ e[++E], r[n ? 1 : 3] = f[m >>> 24] << 24 ^ f[h >>> 16 & 255] << 16 ^ f[g >>> 8 & 255] << 8 ^ f[255 & y] ^ e[++E]
}
function a(t) {
t = t || {};
var r, n = (t.mode || "CBC").toUpperCase(), i = "AES-" + n;
r = t.decrypt ? e.cipher.createDecipher(i, t.key) : e.cipher.createCipher(i, t.key);
var a = r.start;
return r.start = function(t, n) {
var i = null;
n instanceof e.util.ByteBuffer && (i = n, n = {}), n = n || {}, n.output = i, n.iv = t, a.call(r, n)
}, r
}
e.aes = e.aes || {}, e.aes.startEncrypting = function(e, t, r, n) {
var i = a({key: e,output: r,decrypt: !1,mode: n});
return i.start(t), i
}, e.aes.createEncryptionCipher = function(e, t) {
return a({key: e,output: null,decrypt: !1,mode: t})
}, e.aes.startDecrypting = function(e, t, r, n) {
var i = a({key: e,output: r,decrypt: !0,mode: n});
return i.start(t), i
}, e.aes.createDecryptionCipher = function(e, t) {
return a({key: e,output: null,decrypt: !0,mode: t})
}, e.aes.Algorithm = function(e, t) {
p || r();
var n = this;
n.name = e, n.mode = new t({blockSize: 16,cipher: {encrypt: function(e, t) {
return i(n._w, e, t, !1)
},decrypt: function(e, t) {
return i(n._w, e, t, !0)
}}}), n._init = !1
}, e.aes.Algorithm.prototype.initialize = function(t) {
if (!this._init) {
var r, i = t.key;
if ("string" != typeof i || 16 !== i.length && 24 !== i.length && 32 !== i.length) {
if (e.util.isArray(i) && (16 === i.length || 24 === i.length || 32 === i.length)) {
r = i, i = e.util.createBuffer();
for (var a = 0; a < r.length; ++a)
i.putByte(r[a])
}
} else
i = e.util.createBuffer(i);
if (!e.util.isArray(i)) {
r = i, i = [];
var o = r.length();
if (16 === o || 24 === o || 32 === o) {
o >>>= 2;
for (var a = 0; o > a; ++a)
i.push(r.getInt32())
}
}
if (!e.util.isArray(i) || 4 !== i.length && 6 !== i.length && 8 !== i.length)
throw new Error("Invalid key parameter.");
var s = this.mode.name, u = -1 !== ["CFB", "OFB", "CTR", "GCM"].indexOf(s);
this._w = n(i, t.decrypt && !u), this._init = !0
}
}, e.aes._expandKey = function(e, t) {
return p || r(), n(e, t)
}, e.aes._updateBlock = i, t("AES-CBC", e.cipher.modes.cbc), t("AES-CFB", e.cipher.modes.cfb), t("AES-OFB", e.cipher.modes.ofb), t("AES-CTR", e.cipher.modes.ctr), t("AES-GCM", e.cipher.modes.gcm);
var o, s, u, l, c, p = !1, f = 4
}
var t = "aes";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/aes", ["require", "module", "./cipher", "./cipherModes", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
e.pki = e.pki || {};
var t = e.pki.oids = e.oids = e.oids || {};
t["1.2.840.113549.1.1.1"] = "rsaEncryption", t.rsaEncryption = "1.2.840.113549.1.1.1", t["1.2.840.113549.1.1.4"] = "md5WithRSAEncryption", t.md5WithRSAEncryption = "1.2.840.113549.1.1.4", t["1.2.840.113549.1.1.5"] = "sha1WithRSAEncryption", t.sha1WithRSAEncryption = "1.2.840.113549.1.1.5", t["1.2.840.113549.1.1.7"] = "RSAES-OAEP", t["RSAES-OAEP"] = "1.2.840.113549.1.1.7", t["1.2.840.113549.1.1.8"] = "mgf1", t.mgf1 = "1.2.840.113549.1.1.8", t["1.2.840.113549.1.1.9"] = "pSpecified", t.pSpecified = "1.2.840.113549.1.1.9", t["1.2.840.113549.1.1.10"] = "RSASSA-PSS", t["RSASSA-PSS"] = "1.2.840.113549.1.1.10", t["1.2.840.113549.1.1.11"] = "sha256WithRSAEncryption", t.sha256WithRSAEncryption = "1.2.840.113549.1.1.11", t["1.2.840.113549.1.1.12"] = "sha384WithRSAEncryption", t.sha384WithRSAEncryption = "1.2.840.113549.1.1.12", t["1.2.840.113549.1.1.13"] = "sha512WithRSAEncryption", t.sha512WithRSAEncryption = "1.2.840.113549.1.1.13", t["1.3.14.3.2.7"] = "desCBC", t.desCBC = "1.3.14.3.2.7", t["1.3.14.3.2.26"] = "sha1", t.sha1 = "1.3.14.3.2.26", t["2.16.840.1.101.3.4.2.1"] = "sha256", t.sha256 = "2.16.840.1.101.3.4.2.1", t["2.16.840.1.101.3.4.2.2"] = "sha384", t.sha384 = "2.16.840.1.101.3.4.2.2", t["2.16.840.1.101.3.4.2.3"] = "sha512", t.sha512 = "2.16.840.1.101.3.4.2.3", t["1.2.840.113549.2.5"] = "md5", t.md5 = "1.2.840.113549.2.5", t["1.2.840.113549.1.7.1"] = "data", t.data = "1.2.840.113549.1.7.1", t["1.2.840.113549.1.7.2"] = "signedData", t.signedData = "1.2.840.113549.1.7.2", t["1.2.840.113549.1.7.3"] = "envelopedData", t.envelopedData = "1.2.840.113549.1.7.3", t["1.2.840.113549.1.7.4"] = "signedAndEnvelopedData", t.signedAndEnvelopedData = "1.2.840.113549.1.7.4", t["1.2.840.113549.1.7.5"] = "digestedData", t.digestedData = "1.2.840.113549.1.7.5", t["1.2.840.113549.1.7.6"] = "encryptedData", t.encryptedData = "1.2.840.113549.1.7.6", t["1.2.840.113549.1.9.1"] = "emailAddress", t.emailAddress = "1.2.840.113549.1.9.1", t["1.2.840.113549.1.9.2"] = "unstructuredName", t.unstructuredName = "1.2.840.113549.1.9.2", t["1.2.840.113549.1.9.3"] = "contentType", t.contentType = "1.2.840.113549.1.9.3", t["1.2.840.113549.1.9.4"] = "messageDigest", t.messageDigest = "1.2.840.113549.1.9.4", t["1.2.840.113549.1.9.5"] = "signingTime", t.signingTime = "1.2.840.113549.1.9.5", t["1.2.840.113549.1.9.6"] = "counterSignature", t.counterSignature = "1.2.840.113549.1.9.6", t["1.2.840.113549.1.9.7"] = "challengePassword", t.challengePassword = "1.2.840.113549.1.9.7", t["1.2.840.113549.1.9.8"] = "unstructuredAddress", t.unstructuredAddress = "1.2.840.113549.1.9.8", t["1.2.840.113549.1.9.20"] = "friendlyName", t.friendlyName = "1.2.840.113549.1.9.20", t["1.2.840.113549.1.9.21"] = "localKeyId", t.localKeyId = "1.2.840.113549.1.9.21", t["1.2.840.113549.1.9.22.1"] = "x509Certificate", t.x509Certificate = "1.2.840.113549.1.9.22.1", t["1.2.840.113549.1.12.10.1.1"] = "keyBag", t.keyBag = "1.2.840.113549.1.12.10.1.1", t["1.2.840.113549.1.12.10.1.2"] = "pkcs8ShroudedKeyBag", t.pkcs8ShroudedKeyBag = "1.2.840.113549.1.12.10.1.2", t["1.2.840.113549.1.12.10.1.3"] = "certBag", t.certBag = "1.2.840.113549.1.12.10.1.3", t["1.2.840.113549.1.12.10.1.4"] = "crlBag", t.crlBag = "1.2.840.113549.1.12.10.1.4", t["1.2.840.113549.1.12.10.1.5"] = "secretBag", t.secretBag = "1.2.840.113549.1.12.10.1.5", t["1.2.840.113549.1.12.10.1.6"] = "safeContentsBag", t.safeContentsBag = "1.2.840.113549.1.12.10.1.6", t["1.2.840.113549.1.5.13"] = "pkcs5PBES2", t.pkcs5PBES2 = "1.2.840.113549.1.5.13", t["1.2.840.113549.1.5.12"] = "pkcs5PBKDF2", t.pkcs5PBKDF2 = "1.2.840.113549.1.5.12", t["1.2.840.113549.1.12.1.1"] = "pbeWithSHAAnd128BitRC4", t.pbeWithSHAAnd128BitRC4 = "1.2.840.113549.1.12.1.1", t["1.2.840.113549.1.12.1.2"] = "pbeWithSHAAnd40BitRC4", t.pbeWithSHAAnd40BitRC4 = "1.2.840.113549.1.12.1.2", t["1.2.840.113549.1.12.1.3"] = "pbeWithSHAAnd3-KeyTripleDES-CBC", t["pbeWithSHAAnd3-KeyTripleDES-CBC"] = "1.2.840.113549.1.12.1.3", t["1.2.840.113549.1.12.1.4"] = "pbeWithSHAAnd2-KeyTripleDES-CBC", t["pbeWithSHAAnd2-KeyTripleDES-CBC"] = "1.2.840.113549.1.12.1.4", t["1.2.840.113549.1.12.1.5"] = "pbeWithSHAAnd128BitRC2-CBC", t["pbeWithSHAAnd128BitRC2-CBC"] = "1.2.840.113549.1.12.1.5", t["1.2.840.113549.1.12.1.6"] = "pbewithSHAAnd40BitRC2-CBC", t["pbewithSHAAnd40BitRC2-CBC"] = "1.2.840.113549.1.12.1.6", t["1.2.840.113549.3.7"] = "des-EDE3-CBC", t["des-EDE3-CBC"] = "1.2.840.113549.3.7", t["2.16.840.1.101.3.4.1.2"] = "aes128-CBC", t["aes128-CBC"] = "2.16.840.1.101.3.4.1.2", t["2.16.840.1.101.3.4.1.22"] = "aes192-CBC", t["aes192-CBC"] = "2.16.840.1.101.3.4.1.22", t["2.16.840.1.101.3.4.1.42"] = "aes256-CBC", t["aes256-CBC"] = "2.16.840.1.101.3.4.1.42", t["2.5.4.3"] = "commonName", t.commonName = "2.5.4.3", t["2.5.4.5"] = "serialName", t.serialName = "2.5.4.5", t["2.5.4.6"] = "countryName", t.countryName = "2.5.4.6", t["2.5.4.7"] = "localityName", t.localityName = "2.5.4.7", t["2.5.4.8"] = "stateOrProvinceName", t.stateOrProvinceName = "2.5.4.8", t["2.5.4.10"] = "organizationName", t.organizationName = "2.5.4.10", t["2.5.4.11"] = "organizationalUnitName", t.organizationalUnitName = "2.5.4.11", t["2.16.840.1.113730.1.1"] = "nsCertType", t.nsCertType = "2.16.840.1.113730.1.1", t["2.5.29.1"] = "authorityKeyIdentifier", t["2.5.29.2"] = "keyAttributes", t["2.5.29.3"] = "certificatePolicies", t["2.5.29.4"] = "keyUsageRestriction", t["2.5.29.5"] = "policyMapping", t["2.5.29.6"] = "subtreesConstraint", t["2.5.29.7"] = "subjectAltName", t["2.5.29.8"] = "issuerAltName", t["2.5.29.9"] = "subjectDirectoryAttributes", t["2.5.29.10"] = "basicConstraints", t["2.5.29.11"] = "nameConstraints", t["2.5.29.12"] = "policyConstraints", t["2.5.29.13"] = "basicConstraints", t["2.5.29.14"] = "subjectKeyIdentifier", t.subjectKeyIdentifier = "2.5.29.14", t["2.5.29.15"] = "keyUsage", t.keyUsage = "2.5.29.15", t["2.5.29.16"] = "privateKeyUsagePeriod", t["2.5.29.17"] = "subjectAltName", t.subjectAltName = "2.5.29.17", t["2.5.29.18"] = "issuerAltName", t.issuerAltName = "2.5.29.18", t["2.5.29.19"] = "basicConstraints", t.basicConstraints = "2.5.29.19", t["2.5.29.20"] = "cRLNumber", t["2.5.29.21"] = "cRLReason", t["2.5.29.22"] = "expirationDate", t["2.5.29.23"] = "instructionCode", t["2.5.29.24"] = "invalidityDate", t["2.5.29.25"] = "cRLDistributionPoints", t["2.5.29.26"] = "issuingDistributionPoint", t["2.5.29.27"] = "deltaCRLIndicator", t["2.5.29.28"] = "issuingDistributionPoint", t["2.5.29.29"] = "certificateIssuer", t["2.5.29.30"] = "nameConstraints", t["2.5.29.31"] = "cRLDistributionPoints", t["2.5.29.32"] = "certificatePolicies", t["2.5.29.33"] = "policyMappings", t["2.5.29.34"] = "policyConstraints", t["2.5.29.35"] = "authorityKeyIdentifier", t["2.5.29.36"] = "policyConstraints", t["2.5.29.37"] = "extKeyUsage", t.extKeyUsage = "2.5.29.37", t["2.5.29.46"] = "freshestCRL", t["2.5.29.54"] = "inhibitAnyPolicy", t["1.3.6.1.5.5.7.3.1"] = "serverAuth", t.serverAuth = "1.3.6.1.5.5.7.3.1", t["1.3.6.1.5.5.7.3.2"] = "clientAuth", t.clientAuth = "1.3.6.1.5.5.7.3.2", t["1.3.6.1.5.5.7.3.3"] = "codeSigning", t.codeSigning = "1.3.6.1.5.5.7.3.3", t["1.3.6.1.5.5.7.3.4"] = "emailProtection", t.emailProtection = "1.3.6.1.5.5.7.3.4", t["1.3.6.1.5.5.7.3.8"] = "timeStamping", t.timeStamping = "1.3.6.1.5.5.7.3.8"
}
var t = "oids";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/oids", ["require", "module"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = e.asn1 = e.asn1 || {};
t.Class = {UNIVERSAL: 0,APPLICATION: 64,CONTEXT_SPECIFIC: 128,PRIVATE: 192}, t.Type = {NONE: 0,BOOLEAN: 1,INTEGER: 2,BITSTRING: 3,OCTETSTRING: 4,NULL: 5,OID: 6,ODESC: 7,EXTERNAL: 8,REAL: 9,ENUMERATED: 10,EMBEDDED: 11,UTF8: 12,ROID: 13,SEQUENCE: 16,SET: 17,PRINTABLESTRING: 19,IA5STRING: 22,UTCTIME: 23,GENERALIZEDTIME: 24,BMPSTRING: 30}, t.create = function(t, r, n, i) {
if (e.util.isArray(i)) {
for (var a = [], o = 0; o < i.length; ++o)
void 0 !== i[o] && a.push(i[o]);
i = a
}
return {tagClass: t,type: r,constructed: n,composed: n || e.util.isArray(i),value: i}
};
var r = function(e) {
var t = e.getByte();
if (128 === t)
return void 0;
var r, n = 128 & t;
return r = n ? e.getInt((127 & t) << 3) : t
};
t.fromDer = function(n, i) {
if (void 0 === i && (i = !0), "string" == typeof n && (n = e.util.createBuffer(n)), n.length() < 2) {
var a = new Error("Too few bytes to parse DER.");
throw a.bytes = n.length(), a
}
var o = n.getByte(), s = 192 & o, u = 31 & o, l = r(n);
if (n.length() < l) {
if (i) {
var a = new Error("Too few bytes to read ASN.1 value.");
throw a.detail = n.length() + " < " + l, a
}
l = n.length()
}
var c, p = 32 === (32 & o), f = p;
if (!f && s === t.Class.UNIVERSAL && u === t.Type.BITSTRING && l > 1) {
var d = n.read, h = n.getByte();
if (0 === h) {
o = n.getByte();
var g = 192 & o;
if (g === t.Class.UNIVERSAL || g === t.Class.CONTEXT_SPECIFIC)
try {
var y = r(n);
f = y === l - (n.read - d), f && (++d, --l)
} catch (m) {
}
}
n.read = d
}
if (f)
if (c = [], void 0 === l)
for (; ; ) {
if (n.bytes(2) === String.fromCharCode(0, 0)) {
n.getBytes(2);
break
}
c.push(t.fromDer(n, i))
}
else
for (var v = n.length(); l > 0; )
c.push(t.fromDer(n, i)), l -= v - n.length(), v = n.length();
else {
if (void 0 === l) {
if (i)
throw new Error("Non-constructed ASN.1 object of indefinite length.");
l = n.length()
}
if (u === t.Type.BMPSTRING) {
c = "";
for (var b = 0; l > b; b += 2)
c += String.fromCharCode(n.getInt16())
} else
c = n.getBytes(l)
}
return t.create(s, u, p, c)
}, t.toDer = function(r) {
var n = e.util.createBuffer(), i = r.tagClass | r.type, a = e.util.createBuffer();
if (r.composed) {
r.constructed ? i |= 32 : a.putByte(0);
for (var o = 0; o < r.value.length; ++o)
void 0 !== r.value[o] && a.putBuffer(t.toDer(r.value[o]))
} else if (r.type === t.Type.BMPSTRING)
for (var o = 0; o < r.value.length; ++o)
a.putInt16(r.value.charCodeAt(o));
else
a.putBytes(r.value);
if (n.putByte(i), a.length() <= 127)
n.putByte(127 & a.length());
else {
var s = a.length(), u = "";
do
u += String.fromCharCode(255 & s), s >>>= 8;
while (s > 0);
n.putByte(128 | u.length);
for (var o = u.length - 1; o >= 0; --o)
n.putByte(u.charCodeAt(o))
}
return n.putBuffer(a), n
}, t.oidToDer = function(t) {
var r = t.split("."), n = e.util.createBuffer();
n.putByte(40 * parseInt(r[0], 10) + parseInt(r[1], 10));
for (var i, a, o, s, u = 2; u < r.length; ++u) {
i = !0, a = [], o = parseInt(r[u], 10);
do
s = 127 & o, o >>>= 7, i || (s |= 128), a.push(s), i = !1;
while (o > 0);
for (var l = a.length - 1; l >= 0; --l)
n.putByte(a[l])
}
return n
}, t.derToOid = function(t) {
var r;
"string" == typeof t && (t = e.util.createBuffer(t));
var n = t.getByte();
r = Math.floor(n / 40) + "." + n % 40;
for (var i = 0; t.length() > 0; )
n = t.getByte(), i <<= 7, 128 & n ? i += 127 & n : (r += "." + (i + n), i = 0);
return r
}, t.utcTimeToDate = function(e) {
var t = new Date, r = parseInt(e.substr(0, 2), 10);
r = r >= 50 ? 1900 + r : 2e3 + r;
var n = parseInt(e.substr(2, 2), 10) - 1, i = parseInt(e.substr(4, 2), 10), a = parseInt(e.substr(6, 2), 10), o = parseInt(e.substr(8, 2), 10), s = 0;
if (e.length > 11) {
var u = e.charAt(10), l = 10;
"+" !== u && "-" !== u && (s = parseInt(e.substr(10, 2), 10), l += 2)
}
if (t.setUTCFullYear(r, n, i), t.setUTCHours(a, o, s, 0), l && (u = e.charAt(l), "+" === u || "-" === u)) {
var c = parseInt(e.substr(l + 1, 2), 10), p = parseInt(e.substr(l + 4, 2), 10), f = 60 * c + p;
f *= 6e4, t.setTime("+" === u ? +t - f : +t + f)
}
return t
}, t.generalizedTimeToDate = function(e) {
var t = new Date, r = parseInt(e.substr(0, 4), 10), n = parseInt(e.substr(4, 2), 10) - 1, i = parseInt(e.substr(6, 2), 10), a = parseInt(e.substr(8, 2), 10), o = parseInt(e.substr(10, 2), 10), s = parseInt(e.substr(12, 2), 10), u = 0, l = 0, c = !1;
"Z" === e.charAt(e.length - 1) && (c = !0);
var p = e.length - 5, f = e.charAt(p);
if ("+" === f || "-" === f) {
var d = parseInt(e.substr(p + 1, 2), 10), h = parseInt(e.substr(p + 4, 2), 10);
l = 60 * d + h, l *= 6e4, "+" === f && (l *= -1), c = !0
}
return "." === e.charAt(14) && (u = 1e3 * parseFloat(e.substr(14), 10)), c ? (t.setUTCFullYear(r, n, i), t.setUTCHours(a, o, s, u), t.setTime(+t + l)) : (t.setFullYear(r, n, i), t.setHours(a, o, s, u)), t
}, t.dateToUtcTime = function(e) {
var t = "", r = [];
r.push(("" + e.getUTCFullYear()).substr(2)), r.push("" + (e.getUTCMonth() + 1)), r.push("" + e.getUTCDate()), r.push("" + e.getUTCHours()), r.push("" + e.getUTCMinutes()), r.push("" + e.getUTCSeconds());
for (var n = 0; n < r.length; ++n)
r[n].length < 2 && (t += "0"), t += r[n];
return t += "Z"
}, t.integerToDer = function(t) {
var r = e.util.createBuffer();
if (t >= -128 && 128 > t)
return r.putSignedInt(t, 8);
if (t >= -32768 && 32768 > t)
return r.putSignedInt(t, 16);
if (t >= -8388608 && 8388608 > t)
return r.putSignedInt(t, 24);
if (t >= -2147483648 && 2147483648 > t)
return r.putSignedInt(t, 32);
var n = new Error("Integer too large; max is 32-bits.");
throw n.integer = t, n
}, t.derToInteger = function(t) {
"string" == typeof t && (t = e.util.createBuffer(t));
var r = 8 * t.length();
if (r > 32)
throw new Error("Integer too large; max is 32-bits.");
return t.getSignedInt(r)
}, t.validate = function(r, n, i, a) {
var o = !1;
if (r.tagClass !== n.tagClass && "undefined" != typeof n.tagClass || r.type !== n.type && "undefined" != typeof n.type)
a && (r.tagClass !== n.tagClass && a.push("[" + n.name + '] Expected tag class "' + n.tagClass + '", got "' + r.tagClass + '"'), r.type !== n.type && a.push("[" + n.name + '] Expected type "' + n.type + '", got "' + r.type + '"'));
else if (r.constructed === n.constructed || "undefined" == typeof n.constructed) {
if (o = !0, n.value && e.util.isArray(n.value))
for (var s = 0, u = 0; o && u < n.value.length; ++u)
o = n.value[u].optional || !1, r.value[s] && (o = t.validate(r.value[s], n.value[u], i, a), o ? ++s : n.value[u].optional && (o = !0)), !o && a && a.push("[" + n.name + '] Tag class "' + n.tagClass + '", type "' + n.type + '" expected value length "' + n.value.length + '", got "' + r.value.length + '"');
o && i && (n.capture && (i[n.capture] = r.value), n.captureAsn1 && (i[n.captureAsn1] = r))
} else
a && a.push("[" + n.name + '] Expected constructed "' + n.constructed + '", got "' + r.constructed + '"');
return o
};
var n = /[^\\u0000-\\u00ff]/;
t.prettyPrint = function(r, i, a) {
var o = "";
i = i || 0, a = a || 2, i > 0 && (o += "\n");
for (var s = "", u = 0; i * a > u; ++u)
s += " ";
switch (o += s + "Tag: ", r.tagClass) {
case t.Class.UNIVERSAL:
o += "Universal:";
break;
case t.Class.APPLICATION:
o += "Application:";
break;
case t.Class.CONTEXT_SPECIFIC:
o += "Context-Specific:";
break;
case t.Class.PRIVATE:
o += "Private:"
}
if (r.tagClass === t.Class.UNIVERSAL)
switch (o += r.type, r.type) {
case t.Type.NONE:
o += " (None)";
break;
case t.Type.BOOLEAN:
o += " (Boolean)";
break;
case t.Type.BITSTRING:
o += " (Bit string)";
break;
case t.Type.INTEGER:
o += " (Integer)";
break;
case t.Type.OCTETSTRING:
o += " (Octet string)";
break;
case t.Type.NULL:
o += " (Null)";
break;
case t.Type.OID:
o += " (Object Identifier)";
break;
case t.Type.ODESC:
o += " (Object Descriptor)";
break;
case t.Type.EXTERNAL:
o += " (External or Instance of)";
break;
case t.Type.REAL:
o += " (Real)";
break;
case t.Type.ENUMERATED:
o += " (Enumerated)";
break;
case t.Type.EMBEDDED:
o += " (Embedded PDV)";
break;
case t.Type.UTF8:
o += " (UTF8)";
break;
case t.Type.ROID:
o += " (Relative Object Identifier)";
break;
case t.Type.SEQUENCE:
o += " (Sequence)";
break;
case t.Type.SET:
o += " (Set)";
break;
case t.Type.PRINTABLESTRING:
o += " (Printable String)";
break;
case t.Type.IA5String:
o += " (IA5String (ASCII))";
break;
case t.Type.UTCTIME:
o += " (UTC time)";
break;
case t.Type.GENERALIZEDTIME:
o += " (Generalized time)";
break;
case t.Type.BMPSTRING:
o += " (BMP String)"
}
else
o += r.type;
if (o += "\n", o += s + "Constructed: " + r.constructed + "\n", r.composed) {
for (var l = 0, c = "", u = 0; u < r.value.length; ++u)
void 0 !== r.value[u] && (l += 1, c += t.prettyPrint(r.value[u], i + 1, a), u + 1 < r.value.length && (c += ","));
o += s + "Sub values: " + l + c
} else {
if (o += s + "Value: ", r.type === t.Type.OID) {
var p = t.derToOid(r.value);
o += p, e.pki && e.pki.oids && p in e.pki.oids && (o += " (" + e.pki.oids[p] + ") ")
}
if (r.type === t.Type.INTEGER)
try {
o += t.derToInteger(r.value)
} catch (f) {
o += "0x" + e.util.bytesToHex(r.value)
}
else
r.type === t.Type.OCTETSTRING ? (n.test(r.value) || (o += "(" + r.value + ") "), o += "0x" + e.util.bytesToHex(r.value)) : o += r.type === t.Type.UTF8 ? e.util.decodeUtf8(r.value) : r.type === t.Type.PRINTABLESTRING || r.type === t.Type.IA5String ? r.value : n.test(r.value) ? "0x" + e.util.bytesToHex(r.value) : 0 === r.value.length ? "[null]" : r.value
}
return o
}
}
var t = "asn1";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/asn1", ["require", "module", "./util", "./oids"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t() {
i = String.fromCharCode(128), i += e.util.fillString(String.fromCharCode(0), 64), a = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 1, 6, 11, 0, 5, 10, 15, 4, 9, 14, 3, 8, 13, 2, 7, 12, 5, 8, 11, 14, 1, 4, 7, 10, 13, 0, 3, 6, 9, 12, 15, 2, 0, 7, 14, 5, 12, 3, 10, 1, 8, 15, 6, 13, 4, 11, 2, 9], o = [7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 7, 12, 17, 22, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 5, 9, 14, 20, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 4, 11, 16, 23, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21, 6, 10, 15, 21], s = new Array(64);
for (var t = 0; 64 > t; ++t)
s[t] = Math.floor(4294967296 * Math.abs(Math.sin(t + 1)));
u = !0
}
function r(e, t, r) {
for (var n, i, u, l, c, p, f, d, h = r.length(); h >= 64; ) {
for (i = e.h0, u = e.h1, l = e.h2, c = e.h3, d = 0; 16 > d; ++d)
t[d] = r.getInt32Le(), p = c ^ u & (l ^ c), n = i + p + s[d] + t[d], f = o[d], i = c, c = l, l = u, u += n << f | n >>> 32 - f;
for (; 32 > d; ++d)
p = l ^ c & (u ^ l), n = i + p + s[d] + t[a[d]], f = o[d], i = c, c = l, l = u, u += n << f | n >>> 32 - f;
for (; 48 > d; ++d)
p = u ^ l ^ c, n = i + p + s[d] + t[a[d]], f = o[d], i = c, c = l, l = u, u += n << f | n >>> 32 - f;
for (; 64 > d; ++d)
p = l ^ (u | ~c), n = i + p + s[d] + t[a[d]], f = o[d], i = c, c = l, l = u, u += n << f | n >>> 32 - f;
e.h0 = e.h0 + i | 0, e.h1 = e.h1 + u | 0, e.h2 = e.h2 + l | 0, e.h3 = e.h3 + c | 0, h -= 64
}
}
var n = e.md5 = e.md5 || {};
e.md = e.md || {}, e.md.algorithms = e.md.algorithms || {}, e.md.md5 = e.md.algorithms.md5 = n, n.create = function() {
u || t();
var n = null, a = e.util.createBuffer(), o = new Array(16), s = {algorithm: "md5",blockLength: 64,digestLength: 16,messageLength: 0,messageLength64: [0, 0]};
return s.start = function() {
return s.messageLength = 0, s.messageLength64 = [0, 0], a = e.util.createBuffer(), n = {h0: 1732584193,h1: 4023233417,h2: 2562383102,h3: 271733878}, s
}, s.start(), s.update = function(t, i) {
return "utf8" === i && (t = e.util.encodeUtf8(t)), s.messageLength += t.length, s.messageLength64[0] += t.length / 4294967296 >>> 0, s.messageLength64[1] += t.length >>> 0, a.putBytes(t), r(n, o, a), (a.read > 2048 || 0 === a.length()) && a.compact(), s
}, s.digest = function() {
var t = e.util.createBuffer();
t.putBytes(a.bytes()), t.putBytes(i.substr(0, 64 - (s.messageLength64[1] + 8 & 63))), t.putInt32Le(s.messageLength64[1] << 3), t.putInt32Le(s.messageLength64[0] << 3 | s.messageLength64[0] >>> 28);
var u = {h0: n.h0,h1: n.h1,h2: n.h2,h3: n.h3};
r(u, o, t);
var l = e.util.createBuffer();
return l.putInt32Le(u.h0), l.putInt32Le(u.h1), l.putInt32Le(u.h2), l.putInt32Le(u.h3), l
}, s
};
var i = null, a = null, o = null, s = null, u = !1
}
var t = "md5";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/md5", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t() {
i = String.fromCharCode(128), i += e.util.fillString(String.fromCharCode(0), 64), a = !0
}
function r(e, t, r) {
for (var n, i, a, o, s, u, l, c, p = r.length(); p >= 64; ) {
for (i = e.h0, a = e.h1, o = e.h2, s = e.h3, u = e.h4, c = 0; 16 > c; ++c)
n = r.getInt32(), t[c] = n, l = s ^ a & (o ^ s), n = (i << 5 | i >>> 27) + l + u + 1518500249 + n, u = s, s = o, o = a << 30 | a >>> 2, a = i, i = n;
for (; 20 > c; ++c)
n = t[c - 3] ^ t[c - 8] ^ t[c - 14] ^ t[c - 16], n = n << 1 | n >>> 31, t[c] = n, l = s ^ a & (o ^ s), n = (i << 5 | i >>> 27) + l + u + 1518500249 + n, u = s, s = o, o = a << 30 | a >>> 2, a = i, i = n;
for (; 32 > c; ++c)
n = t[c - 3] ^ t[c - 8] ^ t[c - 14] ^ t[c - 16], n = n << 1 | n >>> 31, t[c] = n, l = a ^ o ^ s, n = (i << 5 | i >>> 27) + l + u + 1859775393 + n, u = s, s = o, o = a << 30 | a >>> 2, a = i, i = n;
for (; 40 > c; ++c)
n = t[c - 6] ^ t[c - 16] ^ t[c - 28] ^ t[c - 32], n = n << 2 | n >>> 30, t[c] = n, l = a ^ o ^ s, n = (i << 5 | i >>> 27) + l + u + 1859775393 + n, u = s, s = o, o = a << 30 | a >>> 2, a = i, i = n;
for (; 60 > c; ++c)
n = t[c - 6] ^ t[c - 16] ^ t[c - 28] ^ t[c - 32], n = n << 2 | n >>> 30, t[c] = n, l = a & o | s & (a ^ o), n = (i << 5 | i >>> 27) + l + u + 2400959708 + n, u = s, s = o, o = a << 30 | a >>> 2, a = i, i = n;
for (; 80 > c; ++c)
n = t[c - 6] ^ t[c - 16] ^ t[c - 28] ^ t[c - 32], n = n << 2 | n >>> 30, t[c] = n, l = a ^ o ^ s, n = (i << 5 | i >>> 27) + l + u + 3395469782 + n, u = s, s = o, o = a << 30 | a >>> 2, a = i, i = n;
e.h0 = e.h0 + i | 0, e.h1 = e.h1 + a | 0, e.h2 = e.h2 + o | 0, e.h3 = e.h3 + s | 0, e.h4 = e.h4 + u | 0, p -= 64
}
}
var n = e.sha1 = e.sha1 || {};
e.md = e.md || {}, e.md.algorithms = e.md.algorithms || {}, e.md.sha1 = e.md.algorithms.sha1 = n, n.create = function() {
a || t();
var n = null, o = e.util.createBuffer(), s = new Array(80), u = {algorithm: "sha1",blockLength: 64,digestLength: 20,messageLength: 0,messageLength64: [0, 0]};
return u.start = function() {
return u.messageLength = 0, u.messageLength64 = [0, 0], o = e.util.createBuffer(), n = {h0: 1732584193,h1: 4023233417,h2: 2562383102,h3: 271733878,h4: 3285377520}, u
}, u.start(), u.update = function(t, i) {
return "utf8" === i && (t = e.util.encodeUtf8(t)), u.messageLength += t.length, u.messageLength64[0] += t.length / 4294967296 >>> 0, u.messageLength64[1] += t.length >>> 0, o.putBytes(t), r(n, s, o), (o.read > 2048 || 0 === o.length()) && o.compact(), u
}, u.digest = function() {
var t = e.util.createBuffer();
t.putBytes(o.bytes()), t.putBytes(i.substr(0, 64 - (u.messageLength64[1] + 8 & 63))), t.putInt32(u.messageLength64[0] << 3 | u.messageLength64[0] >>> 28), t.putInt32(u.messageLength64[1] << 3);
var a = {h0: n.h0,h1: n.h1,h2: n.h2,h3: n.h3,h4: n.h4};
r(a, s, t);
var l = e.util.createBuffer();
return l.putInt32(a.h0), l.putInt32(a.h1), l.putInt32(a.h2), l.putInt32(a.h3), l.putInt32(a.h4), l
}, u
};
var i = null, a = !1
}
var t = "sha1";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/sha1", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t() {
i = String.fromCharCode(128), i += e.util.fillString(String.fromCharCode(0), 64), o = [1116352408, 1899447441, 3049323471, 3921009573, 961987163, 1508970993, 2453635748, 2870763221, 3624381080, 310598401, 607225278, 1426881987, 1925078388, 2162078206, 2614888103, 3248222580, 3835390401, 4022224774, 264347078, 604807628, 770255983, 1249150122, 1555081692, 1996064986, 2554220882, 2821834349, 2952996808, 3210313671, 3336571891, 3584528711, 113926993, 338241895, 666307205, 773529912, 1294757372, 1396182291, 1695183700, 1986661051, 2177026350, 2456956037, 2730485921, 2820302411, 3259730800, 3345764771, 3516065817, 3600352804, 4094571909, 275423344, 430227734, 506948616, 659060556, 883997877, 958139571, 1322822218, 1537002063, 1747873779, 1955562222, 2024104815, 2227730452, 2361852424, 2428436474, 2756734187, 3204031479, 3329325298], a = !0
}
function r(e, t, r) {
for (var n, i, a, s, u, l, c, p, f, d, h, g, y, m, v, b = r.length(); b >= 64; ) {
for (c = 0; 16 > c; ++c)
t[c] = r.getInt32();
for (; 64 > c; ++c)
n = t[c - 2], n = (n >>> 17 | n << 15) ^ (n >>> 19 | n << 13) ^ n >>> 10, i = t[c - 15], i = (i >>> 7 | i << 25) ^ (i >>> 18 | i << 14) ^ i >>> 3, t[c] = n + t[c - 7] + i + t[c - 16] | 0;
for (p = e.h0, f = e.h1, d = e.h2, h = e.h3, g = e.h4, y = e.h5, m = e.h6, v = e.h7, c = 0; 64 > c; ++c)
s = (g >>> 6 | g << 26) ^ (g >>> 11 | g << 21) ^ (g >>> 25 | g << 7), u = m ^ g & (y ^ m), a = (p >>> 2 | p << 30) ^ (p >>> 13 | p << 19) ^ (p >>> 22 | p << 10), l = p & f | d & (p ^ f), n = v + s + u + o[c] + t[c], i = a + l, v = m, m = y, y = g, g = h + n | 0, h = d, d = f, f = p, p = n + i | 0;
e.h0 = e.h0 + p | 0, e.h1 = e.h1 + f | 0, e.h2 = e.h2 + d | 0, e.h3 = e.h3 + h | 0, e.h4 = e.h4 + g | 0, e.h5 = e.h5 + y | 0, e.h6 = e.h6 + m | 0, e.h7 = e.h7 + v | 0, b -= 64
}
}
var n = e.sha256 = e.sha256 || {};
e.md = e.md || {}, e.md.algorithms = e.md.algorithms || {}, e.md.sha256 = e.md.algorithms.sha256 = n, n.create = function() {
a || t();
var n = null, o = e.util.createBuffer(), s = new Array(64), u = {algorithm: "sha256",blockLength: 64,digestLength: 32,messageLength: 0,messageLength64: [0, 0]};
return u.start = function() {
return u.messageLength = 0, u.messageLength64 = [0, 0], o = e.util.createBuffer(), n = {h0: 1779033703,h1: 3144134277,h2: 1013904242,h3: 2773480762,h4: 1359893119,h5: 2600822924,h6: 528734635,h7: 1541459225}, u
}, u.start(), u.update = function(t, i) {
return "utf8" === i && (t = e.util.encodeUtf8(t)), u.messageLength += t.length, u.messageLength64[0] += t.length / 4294967296 >>> 0, u.messageLength64[1] += t.length >>> 0, o.putBytes(t), r(n, s, o), (o.read > 2048 || 0 === o.length()) && o.compact(), u
}, u.digest = function() {
var t = e.util.createBuffer();
t.putBytes(o.bytes()), t.putBytes(i.substr(0, 64 - (u.messageLength64[1] + 8 & 63))), t.putInt32(u.messageLength64[0] << 3 | u.messageLength64[0] >>> 28), t.putInt32(u.messageLength64[1] << 3);
var a = {h0: n.h0,h1: n.h1,h2: n.h2,h3: n.h3,h4: n.h4,h5: n.h5,h6: n.h6,h7: n.h7};
r(a, s, t);
var l = e.util.createBuffer();
return l.putInt32(a.h0), l.putInt32(a.h1), l.putInt32(a.h2), l.putInt32(a.h3), l.putInt32(a.h4), l.putInt32(a.h5), l.putInt32(a.h6), l.putInt32(a.h7), l
}, u
};
var i = null, a = !1, o = null
}
var t = "sha256";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/sha256", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t() {
a = String.fromCharCode(128), a += e.util.fillString(String.fromCharCode(0), 128), s = [[1116352408, 3609767458], [1899447441, 602891725], [3049323471, 3964484399], [3921009573, 2173295548], [961987163, 4081628472], [1508970993, 3053834265], [2453635748, 2937671579], [2870763221, 3664609560], [3624381080, 2734883394], [310598401, 1164996542], [607225278, 1323610764], [1426881987, 3590304994], [1925078388, 4068182383], [2162078206, 991336113], [2614888103, 633803317], [3248222580, 3479774868], [3835390401, 2666613458], [4022224774, 944711139], [264347078, 2341262773], [604807628, 2007800933], [770255983, 1495990901], [1249150122, 1856431235], [1555081692, 3175218132], [1996064986, 2198950837], [2554220882, 3999719339], [2821834349, 766784016], [2952996808, 2566594879], [3210313671, 3203337956], [3336571891, 1034457026], [3584528711, 2466948901], [113926993, 3758326383], [338241895, 168717936], [666307205, 1188179964], [773529912, 1546045734], [1294757372, 1522805485], [1396182291, 2643833823], [1695183700, 2343527390], [1986661051, 1014477480], [2177026350, 1206759142], [2456956037, 344077627], [2730485921, 1290863460], [2820302411, 3158454273], [3259730800, 3505952657], [3345764771, 106217008], [3516065817, 3606008344], [3600352804, 1432725776], [4094571909, 1467031594], [275423344, 851169720], [430227734, 3100823752], [506948616, 1363258195], [659060556, 3750685593], [883997877, 3785050280], [958139571, 3318307427], [1322822218, 3812723403], [1537002063, 2003034995], [1747873779, 3602036899], [1955562222, 1575990012], [2024104815, 1125592928], [2227730452, 2716904306], [2361852424, 442776044], [2428436474, 593698344], [2756734187, 3733110249], [3204031479, 2999351573], [3329325298, 3815920427], [3391569614, 3928383900], [3515267271, 566280711], [3940187606, 3454069534], [4118630271, 4000239992], [116418474, 1914138554], [174292421, 2731055270], [289380356, 3203993006], [460393269, 320620315], [685471733, 587496836], [852142971, 1086792851], [1017036298, 365543100], [1126000580, 2618297676], [1288033470, 3409855158], [1501505948, 4234509866], [1607167915, 987167468], [1816402316, 1246189591]], u = {}, u["SHA-512"] = [[1779033703, 4089235720], [3144134277, 2227873595], [1013904242, 4271175723], [2773480762, 1595750129], [1359893119, 2917565137], [2600822924, 725511199], [528734635, 4215389547], [1541459225, 327033209]], u["SHA-384"] = [[3418070365, 3238371032], [1654270250, 914150663], [2438529370, 812702999], [355462360, 4144912697], [1731405415, 4290775857], [2394180231, 1750603025], [3675008525, 1694076839], [1203062813, 3204075428]], u["SHA-512/256"] = [[573645204, 4230739756], [2673172387, 3360449730], [596883563, 1867755857], [2520282905, 1497426621], [2519219938, 2827943907], [3193839141, 1401305490], [721525244, 746961066], [246885852, 2177182882]], u["SHA-512/224"] = [[2352822216, 424955298], [1944164710, 2312950998], [502970286, 855612546], [1738396948, 1479516111], [258812777, 2077511080], [2011393907, 79989058], [1067287976, 1780299464], [286451373, 2446758561]], o = !0
}
function r(e, t, r) {
for (var n, i, a, o, u, l, c, p, f, d, h, g, y, m, v, b, _, E, C, S, A, T, w, k, I, x, D, N, B, L, R, P, O, U, M, F = r.length(); F >= 128; ) {
for (B = 0; 16 > B; ++B)
t[B][0] = r.getInt32() >>> 0, t[B][1] = r.getInt32() >>> 0;
for (; 80 > B; ++B)
P = t[B - 2], L = P[0], R = P[1], n = ((L >>> 19 | R << 13) ^ (R >>> 29 | L << 3) ^ L >>> 6) >>> 0, i = ((L << 13 | R >>> 19) ^ (R << 3 | L >>> 29) ^ (L << 26 | R >>> 6)) >>> 0, U = t[B - 15], L = U[0], R = U[1], a = ((L >>> 1 | R << 31) ^ (L >>> 8 | R << 24) ^ L >>> 7) >>> 0, o = ((L << 31 | R >>> 1) ^ (L << 24 | R >>> 8) ^ (L << 25 | R >>> 7)) >>> 0, O = t[B - 7], M = t[B - 16], R = i + O[1] + o + M[1], t[B][0] = n + O[0] + a + M[0] + (R / 4294967296 >>> 0) >>> 0, t[B][1] = R >>> 0;
for (y = e[0][0], m = e[0][1], v = e[1][0], b = e[1][1], _ = e[2][0], E = e[2][1], C = e[3][0], S = e[3][1], A = e[4][0], T = e[4][1], w = e[5][0], k = e[5][1], I = e[6][0], x = e[6][1], D = e[7][0], N = e[7][1], B = 0; 80 > B; ++B)
c = ((A >>> 14 | T << 18) ^ (A >>> 18 | T << 14) ^ (T >>> 9 | A << 23)) >>> 0, p = ((A << 18 | T >>> 14) ^ (A << 14 | T >>> 18) ^ (T << 23 | A >>> 9)) >>> 0, f = (I ^ A & (w ^ I)) >>> 0, d = (x ^ T & (k ^ x)) >>> 0, u = ((y >>> 28 | m << 4) ^ (m >>> 2 | y << 30) ^ (m >>> 7 | y << 25)) >>> 0, l = ((y << 4 | m >>> 28) ^ (m << 30 | y >>> 2) ^ (m << 25 | y >>> 7)) >>> 0, h = (y & v | _ & (y ^ v)) >>> 0, g = (m & b | E & (m ^ b)) >>> 0, R = N + p + d + s[B][1] + t[B][1], n = D + c + f + s[B][0] + t[B][0] + (R / 4294967296 >>> 0) >>> 0, i = R >>> 0, R = l + g, a = u + h + (R / 4294967296 >>> 0) >>> 0, o = R >>> 0, D = I, N = x, I = w, x = k, w = A, k = T, R = S + i, A = C + n + (R / 4294967296 >>> 0) >>> 0, T = R >>> 0, C = _, S = E, _ = v, E = b, v = y, b = m, R = i + o, y = n + a + (R / 4294967296 >>> 0) >>> 0, m = R >>> 0;
R = e[0][1] + m, e[0][0] = e[0][0] + y + (R / 4294967296 >>> 0) >>> 0, e[0][1] = R >>> 0, R = e[1][1] + b, e[1][0] = e[1][0] + v + (R / 4294967296 >>> 0) >>> 0, e[1][1] = R >>> 0, R = e[2][1] + E, e[2][0] = e[2][0] + _ + (R / 4294967296 >>> 0) >>> 0, e[2][1] = R >>> 0, R = e[3][1] + S, e[3][0] = e[3][0] + C + (R / 4294967296 >>> 0) >>> 0, e[3][1] = R >>> 0, R = e[4][1] + T, e[4][0] = e[4][0] + A + (R / 4294967296 >>> 0) >>> 0, e[4][1] = R >>> 0, R = e[5][1] + k, e[5][0] = e[5][0] + w + (R / 4294967296 >>> 0) >>> 0, e[5][1] = R >>> 0, R = e[6][1] + x, e[6][0] = e[6][0] + I + (R / 4294967296 >>> 0) >>> 0, e[6][1] = R >>> 0, R = e[7][1] + N, e[7][0] = e[7][0] + D + (R / 4294967296 >>> 0) >>> 0, e[7][1] = R >>> 0, F -= 128
}
}
var n = e.sha512 = e.sha512 || {};
e.md = e.md || {}, e.md.algorithms = e.md.algorithms || {}, e.md.sha512 = e.md.algorithms.sha512 = n;
var i = e.sha384 = e.sha512.sha384 = e.sha512.sha384 || {};
i.create = function() {
return n.create("SHA-384")
}, e.md.sha384 = e.md.algorithms.sha384 = i, e.sha512.sha256 = e.sha512.sha256 || {create: function() {
return n.create("SHA-512/256")
}}, e.md["sha512/256"] = e.md.algorithms["sha512/256"] = e.sha512.sha256, e.sha512.sha224 = e.sha512.sha224 || {create: function() {
return n.create("SHA-512/224")
}}, e.md["sha512/224"] = e.md.algorithms["sha512/224"] = e.sha512.sha224, n.create = function(n) {
if (o || t(), "undefined" == typeof n && (n = "SHA-512"), !(n in u))
throw new Error("Invalid SHA-512 algorithm: " + n);
for (var i = u[n], s = null, l = e.util.createBuffer(), c = new Array(80), p = 0; 80 > p; ++p)
c[p] = new Array(2);
var f = {algorithm: n.replace("-", "").toLowerCase(),blockLength: 128,digestLength: 64,messageLength: 0,messageLength128: [0, 0, 0, 0]};
return f.start = function() {
f.messageLength = 0, f.messageLength128 = [0, 0, 0, 0], l = e.util.createBuffer(), s = new Array(i.length);
for (var t = 0; t < i.length; ++t)
s[t] = i[t].slice(0);
return f
}, f.start(), f.update = function(t, n) {
"utf8" === n && (t = e.util.encodeUtf8(t)), f.messageLength += t.length;
var i = t.length;
i = [i / 4294967296 >>> 0, i >>> 0];
for (var a = 3; a >= 0; --a)
f.messageLength128[a] += i[1], i[1] = i[0] + (f.messageLength128[a] / 4294967296 >>> 0), f.messageLength128[a] = f.messageLength128[a] >>> 0, i[0] = i[1] / 4294967296 >>> 0;
return l.putBytes(t), r(s, c, l), (l.read > 2048 || 0 === l.length()) && l.compact(), f
}, f.digest = function() {
var t = e.util.createBuffer();
t.putBytes(l.bytes()), t.putBytes(a.substr(0, 128 - (f.messageLength128[3] + 16 & 127)));
for (var i = [], o = 0; 3 > o; ++o)
i[o] = f.messageLength128[o] << 3 | f.messageLength128[o - 1] >>> 28;
i[3] = f.messageLength128[3] << 3, t.putInt32(i[0]), t.putInt32(i[1]), t.putInt32(i[2]), t.putInt32(i[3]);
for (var u = new Array(s.length), o = 0; o < s.length; ++o)
u[o] = s[o].slice(0);
r(u, c, t);
var p, d = e.util.createBuffer();
p = "SHA-512" === n ? u.length : "SHA-384" === n ? u.length - 2 : u.length - 4;
for (var o = 0; p > o; ++o)
d.putInt32(u[o][0]), (o !== p - 1 || "SHA-512/224" !== n) && d.putInt32(u[o][1]);
return d
}, f
};
var a = null, o = !1, s = null, u = null
}
var t = "sha512";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/sha512", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
e.md = e.md || {}, e.md.algorithms = {md5: e.md5,sha1: e.sha1,sha256: e.sha256}, e.md.md5 = e.md5, e.md.sha1 = e.sha1, e.md.sha256 = e.sha256
}
var t = "md";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/md", ["require", "module", "./md5", "./sha1", "./sha256", "./sha512"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = e.hmac = e.hmac || {};
t.create = function() {
var t = null, r = null, n = null, i = null, a = {};
return a.start = function(a, o) {
if (null !== a)
if ("string" == typeof a) {
if (a = a.toLowerCase(), !(a in e.md.algorithms))
throw new Error('Unknown hash algorithm "' + a + '"');
r = e.md.algorithms[a].create()
} else
r = a;
if (null === o)
o = t;
else {
if ("string" == typeof o)
o = e.util.createBuffer(o);
else if (e.util.isArray(o)) {
var s = o;
o = e.util.createBuffer();
for (var u = 0; u < s.length; ++u)
o.putByte(s[u])
}
var l = o.length();
l > r.blockLength && (r.start(), r.update(o.bytes()), o = r.digest()), n = e.util.createBuffer(), i = e.util.createBuffer(), l = o.length();
for (var u = 0; l > u; ++u) {
var s = o.at(u);
n.putByte(54 ^ s), i.putByte(92 ^ s)
}
if (l < r.blockLength)
for (var s = r.blockLength - l, u = 0; s > u; ++u)
n.putByte(54), i.putByte(92);
t = o, n = n.bytes(), i = i.bytes()
}
r.start(), r.update(n)
}, a.update = function(e) {
r.update(e)
}, a.getMac = function() {
var e = r.digest().bytes();
return r.start(), r.update(i), r.update(e), r.digest()
}, a.digest = a.getMac, a
}
}
var t = "hmac";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/hmac", ["require", "module", "./md", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(e) {
for (var t = e.name + ": ", r = [], n = function(e, t) {
return " " + t
}, i = 0; i < e.values.length; ++i)
r.push(e.values[i].replace(/^(\S+\r\n)/, n));
t += r.join(",") + "\r\n";
for (var a = 0, o = -1, i = 0; i < t.length; ++i, ++a)
if (a > 65 && -1 !== o) {
var s = t[o];
"," === s ? (++o, t = t.substr(0, o) + "\r\n " + t.substr(o)) : t = t.substr(0, o) + "\r\n" + s + t.substr(o + 1), a = i - o - 1, o = -1, ++i
} else
(" " === t[i] || " " === t[i] || "," === t[i]) && (o = i);
return t
}
function r(e) {
return e.replace(/^\s+/, "")
}
var n = e.pem = e.pem || {};
n.encode = function(r, n) {
n = n || {};
var i, a = "-----BEGIN " + r.type + "-----\r\n";
if (r.procType && (i = {name: "Proc-Type",values: [String(r.procType.version), r.procType.type]}, a += t(i)), r.contentDomain && (i = {name: "Content-Domain",values: [r.contentDomain]}, a += t(i)), r.dekInfo && (i = {name: "DEK-Info",values: [r.dekInfo.algorithm]}, r.dekInfo.parameters && i.values.push(r.dekInfo.parameters), a += t(i)), r.headers)
for (var o = 0; o < r.headers.length; ++o)
a += t(r.headers[o]);
return r.procType && (a += "\r\n"), a += e.util.encode64(r.body, n.maxline || 64) + "\r\n", a += "-----END " + r.type + "-----\r\n"
}, n.decode = function(t) {
for (var n, i = [], a = /\s*-----BEGIN ([A-Z0-9- ]+)-----\r?\n?([\x21-\x7e\s]+?(?:\r?\n\r?\n))?([:A-Za-z0-9+\/=\s]+?)-----END \1-----/g, o = /([\x21-\x7e]+):\s*([\x21-\x7e\s^:]+)/, s = /\r?\n/; ; ) {
if (n = a.exec(t), !n)
break;
var u = {type: n[1],procType: null,contentDomain: null,dekInfo: null,headers: [],body: e.util.decode64(n[3])};
if (i.push(u), n[2]) {
for (var l = n[2].split(s), c = 0; n && c < l.length; ) {
for (var p = l[c].replace(/\s+$/, ""), f = c + 1; f < l.length; ++f) {
var d = l[f];
if (!/\s/.test(d[0]))
break;
p += d, c = f
}
if (n = p.match(o)) {
for (var h = {name: n[1],values: []}, g = n[2].split(","), y = 0; y < g.length; ++y)
h.values.push(r(g[y]));
if (u.procType)
if (u.contentDomain || "Content-Domain" !== h.name)
if (u.dekInfo || "DEK-Info" !== h.name)
u.headers.push(h);
else {
if (0 === h.values.length)
throw new Error('Invalid PEM formatted message. The "DEK-Info" header must have at least one subfield.');
u.dekInfo = {algorithm: g[0],parameters: g[1] || null}
}
else
u.contentDomain = g[0] || "";
else {
if ("Proc-Type" !== h.name)
throw new Error('Invalid PEM formatted message. The first encapsulated header must be "Proc-Type".');
if (2 !== h.values.length)
throw new Error('Invalid PEM formatted message. The "Proc-Type" header must have two subfields.');
u.procType = {version: g[0],type: g[1]}
}
}
++c
}
if ("ENCRYPTED" === u.procType && !u.dekInfo)
throw new Error('Invalid PEM formatted message. The "DEK-Info" header must be present if "Proc-Type" is "ENCRYPTED".')
}
}
if (0 === i.length)
throw new Error("Invalid PEM formatted message.");
return i
}
}
var t = "pem";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pem", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(t, r) {
var n = function() {
return new e.des.Algorithm(t, r)
};
e.cipher.registerAlgorithm(t, n)
}
function r(e) {
for (var t, r = [0, 4, 536870912, 536870916, 65536, 65540, 536936448, 536936452, 512, 516, 536871424, 536871428, 66048, 66052, 536936960, 536936964], n = [0, 1, 1048576, 1048577, 67108864, 67108865, 68157440, 68157441, 256, 257, 1048832, 1048833, 67109120, 67109121, 68157696, 68157697], i = [0, 8, 2048, 2056, 16777216, 16777224, 16779264, 16779272, 0, 8, 2048, 2056, 16777216, 16777224, 16779264, 16779272], a = [0, 2097152, 134217728, 136314880, 8192, 2105344, 134225920, 136323072, 131072, 2228224, 134348800, 136445952, 139264, 2236416, 134356992, 136454144], o = [0, 262144, 16, 262160, 0, 262144, 16, 262160, 4096, 266240, 4112, 266256, 4096, 266240, 4112, 266256], s = [0, 1024, 32, 1056, 0, 1024, 32, 1056, 33554432, 33555456, 33554464, 33555488, 33554432, 33555456, 33554464, 33555488], u = [0, 268435456, 524288, 268959744, 2, 268435458, 524290, 268959746, 0, 268435456, 524288, 268959744, 2, 268435458, 524290, 268959746], l = [0, 65536, 2048, 67584, 536870912, 536936448, 536872960, 536938496, 131072, 196608, 133120, 198656, 537001984, 537067520, 537004032, 537069568], c = [0, 262144, 0, 262144, 2, 262146, 2, 262146, 33554432, 33816576, 33554432, 33816576, 33554434, 33816578, 33554434, 33816578], p = [0, 268435456, 8, 268435464, 0, 268435456, 8, 268435464, 1024, 268436480, 1032, 268436488, 1024, 268436480, 1032, 268436488], f = [0, 32, 0, 32, 1048576, 1048608, 1048576, 1048608, 8192, 8224, 8192, 8224, 1056768, 1056800, 1056768, 1056800], d = [0, 16777216, 512, 16777728, 2097152, 18874368, 2097664, 18874880, 67108864, 83886080, 67109376, 83886592, 69206016, 85983232, 69206528, 85983744], h = [0, 4096, 134217728, 134221824, 524288, 528384, 134742016, 134746112, 16, 4112, 134217744, 134221840, 524304, 528400, 134742032, 134746128], g = [0, 4, 256, 260, 0, 4, 256, 260, 1, 5, 257, 261, 1, 5, 257, 261], y = e.length() > 8 ? 3 : 1, m = [], v = [0, 0, 1, 1, 1, 1, 1, 1, 0, 1, 1, 1, 1, 1, 1, 0], b = 0, _ = 0; y > _; _++) {
var E = e.getInt32(), C = e.getInt32();
t = 252645135 & (E >>> 4 ^ C), C ^= t, E ^= t << 4, t = 65535 & (C >>> -16 ^ E), E ^= t, C ^= t << -16, t = 858993459 & (E >>> 2 ^ C), C ^= t, E ^= t << 2, t = 65535 & (C >>> -16 ^ E), E ^= t, C ^= t << -16, t = 1431655765 & (E >>> 1 ^ C), C ^= t, E ^= t << 1, t = 16711935 & (C >>> 8 ^ E), E ^= t, C ^= t << 8, t = 1431655765 & (E >>> 1 ^ C), C ^= t, E ^= t << 1, t = E << 8 | C >>> 20 & 240, E = C << 24 | C << 8 & 16711680 | C >>> 8 & 65280 | C >>> 24 & 240, C = t;
for (var S = 0; S < v.length; ++S) {
v[S] ? (E = E << 2 | E >>> 26, C = C << 2 | C >>> 26) : (E = E << 1 | E >>> 27, C = C << 1 | C >>> 27), E &= -15, C &= -15;
var A = r[E >>> 28] | n[E >>> 24 & 15] | i[E >>> 20 & 15] | a[E >>> 16 & 15] | o[E >>> 12 & 15] | s[E >>> 8 & 15] | u[E >>> 4 & 15], T = l[C >>> 28] | c[C >>> 24 & 15] | p[C >>> 20 & 15] | f[C >>> 16 & 15] | d[C >>> 12 & 15] | h[C >>> 8 & 15] | g[C >>> 4 & 15];
t = 65535 & (T >>> 16 ^ A), m[b++] = A ^ t, m[b++] = T ^ t << 16
}
}
return m
}
function n(e, t, r, n) {
var i, d = 32 === e.length ? 3 : 9;
i = 3 === d ? n ? [30, -2, -2] : [0, 32, 2] : n ? [94, 62, -2, 32, 64, 2, 30, -2, -2] : [0, 32, 2, 62, 30, -2, 64, 96, 2];
var h, g = t[0], y = t[1];
h = 252645135 & (g >>> 4 ^ y), y ^= h, g ^= h << 4, h = 65535 & (g >>> 16 ^ y), y ^= h, g ^= h << 16, h = 858993459 & (y >>> 2 ^ g), g ^= h, y ^= h << 2, h = 16711935 & (y >>> 8 ^ g), g ^= h, y ^= h << 8, h = 1431655765 & (g >>> 1 ^ y), y ^= h, g ^= h << 1, g = g << 1 | g >>> 31, y = y << 1 | y >>> 31;
for (var m = 0; d > m; m += 3) {
for (var v = i[m + 1], b = i[m + 2], _ = i[m]; _ != v; _ += b) {
var E = y ^ e[_], C = (y >>> 4 | y << 28) ^ e[_ + 1];
h = g, g = y, y = h ^ (o[E >>> 24 & 63] | u[E >>> 16 & 63] | c[E >>> 8 & 63] | f[63 & E] | a[C >>> 24 & 63] | s[C >>> 16 & 63] | l[C >>> 8 & 63] | p[63 & C])
}
h = g, g = y, y = h
}
g = g >>> 1 | g << 31, y = y >>> 1 | y << 31, h = 1431655765 & (g >>> 1 ^ y), y ^= h, g ^= h << 1, h = 16711935 & (y >>> 8 ^ g), g ^= h, y ^= h << 8, h = 858993459 & (y >>> 2 ^ g), g ^= h, y ^= h << 2, h = 65535 & (g >>> 16 ^ y), y ^= h, g ^= h << 16, h = 252645135 & (g >>> 4 ^ y), y ^= h, g ^= h << 4, r[0] = g, r[1] = y
}
function i(t) {
t = t || {};
var r, n = (t.mode || "CBC").toUpperCase(), i = "DES-" + n;
r = t.decrypt ? e.cipher.createDecipher(i, t.key) : e.cipher.createCipher(i, t.key);
var a = r.start;
return r.start = function(t, n) {
var i = null;
n instanceof e.util.ByteBuffer && (i = n, n = {}), n = n || {}, n.output = i, n.iv = t, a.call(r, n)
}, r
}
e.des = e.des || {}, e.des.startEncrypting = function(e, t, r, n) {
var a = i({key: e,output: r,decrypt: !1,mode: n || (null === t ? "ECB" : "CBC")});
return a.start(t), a
}, e.des.createEncryptionCipher = function(e, t) {
return i({key: e,output: null,decrypt: !1,mode: t})
}, e.des.startDecrypting = function(e, t, r, n) {
var a = i({key: e,output: r,decrypt: !0,mode: n || (null === t ? "ECB" : "CBC")});
return a.start(t), a
}, e.des.createDecryptionCipher = function(e, t) {
return i({key: e,output: null,decrypt: !0,mode: t})
}, e.des.Algorithm = function(e, t) {
var r = this;
r.name = e, r.mode = new t({blockSize: 8,cipher: {encrypt: function(e, t) {
return n(r._keys, e, t, !1)
},decrypt: function(e, t) {
return n(r._keys, e, t, !0)
}}}), r._init = !1
}, e.des.Algorithm.prototype.initialize = function(t) {
if (!this._init) {
var n = e.util.createBuffer(t.key);
if (0 === this.name.indexOf("3DES") && 24 !== n.length())
throw new Error("Invalid Triple-DES key size: " + 8 * n.length());
this._keys = r(n), this._init = !0
}
}, t("DES-ECB", e.cipher.modes.ecb), t("DES-CBC", e.cipher.modes.cbc), t("DES-CFB", e.cipher.modes.cfb), t("DES-OFB", e.cipher.modes.ofb), t("DES-CTR", e.cipher.modes.ctr), t("3DES-ECB", e.cipher.modes.ecb), t("3DES-CBC", e.cipher.modes.cbc), t("3DES-CFB", e.cipher.modes.cfb), t("3DES-OFB", e.cipher.modes.ofb), t("3DES-CTR", e.cipher.modes.ctr);
var a = [16843776, 0, 65536, 16843780, 16842756, 66564, 4, 65536, 1024, 16843776, 16843780, 1024, 16778244, 16842756, 16777216, 4, 1028, 16778240, 16778240, 66560, 66560, 16842752, 16842752, 16778244, 65540, 16777220, 16777220, 65540, 0, 1028, 66564, 16777216, 65536, 16843780, 4, 16842752, 16843776, 16777216, 16777216, 1024, 16842756, 65536, 66560, 16777220, 1024, 4, 16778244, 66564, 16843780, 65540, 16842752, 16778244, 16777220, 1028, 66564, 16843776, 1028, 16778240, 16778240, 0, 65540, 66560, 0, 16842756], o = [-2146402272, -2147450880, 32768, 1081376, 1048576, 32, -2146435040, -2147450848, -2147483616, -2146402272, -2146402304, -2147483648, -2147450880, 1048576, 32, -2146435040, 1081344, 1048608, -2147450848, 0, -2147483648, 32768, 1081376, -2146435072, 1048608, -2147483616, 0, 1081344, 32800, -2146402304, -2146435072, 32800, 0, 1081376, -2146435040, 1048576, -2147450848, -2146435072, -2146402304, 32768, -2146435072, -2147450880, 32, -2146402272, 1081376, 32, 32768, -2147483648, 32800, -2146402304, 1048576, -2147483616, 1048608, -2147450848, -2147483616, 1048608, 1081344, 0, -2147450880, 32800, -2147483648, -2146435040, -2146402272, 1081344], s = [520, 134349312, 0, 134348808, 134218240, 0, 131592, 134218240, 131080, 134217736, 134217736, 131072, 134349320, 131080, 134348800, 520, 134217728, 8, 134349312, 512, 131584, 134348800, 134348808, 131592, 134218248, 131584, 131072, 134218248, 8, 134349320, 512, 134217728, 134349312, 134217728, 131080, 520, 131072, 134349312, 134218240, 0, 512, 131080, 134349320, 134218240, 134217736, 512, 0, 134348808, 134218248, 131072, 134217728, 134349320, 8, 131592, 131584, 134217736, 134348800, 134218248, 520, 134348800, 131592, 8, 134348808, 131584], u = [8396801, 8321, 8321, 128, 8396928, 8388737, 8388609, 8193, 0, 8396800, 8396800, 8396929, 129, 0, 8388736, 8388609, 1, 8192, 8388608, 8396801, 128, 8388608, 8193, 8320, 8388737, 1, 8320, 8388736, 8192, 8396928, 8396929, 129, 8388736, 8388609, 8396800, 8396929, 129, 0, 0, 8396800, 8320, 8388736, 8388737, 1, 8396801, 8321, 8321, 128, 8396929, 129, 1, 8192, 8388609, 8193, 8396928, 8388737, 8193, 8320, 8388608, 8396801, 128, 8388608, 8192, 8396928], l = [256, 34078976, 34078720, 1107296512, 524288, 256, 1073741824, 34078720, 1074266368, 524288, 33554688, 1074266368, 1107296512, 1107820544, 524544, 1073741824, 33554432, 1074266112, 1074266112, 0, 1073742080, 1107820800, 1107820800, 33554688, 1107820544, 1073742080, 0, 1107296256, 34078976, 33554432, 1107296256, 524544, 524288, 1107296512, 256, 33554432, 1073741824, 34078720, 1107296512, 1074266368, 33554688, 1073741824, 1107820544, 34078976, 1074266368, 256, 33554432, 1107820544, 1107820800, 524544, 1107296256, 1107820800, 34078720, 0, 1074266112, 1107296256, 524544, 33554688, 1073742080, 524288, 0, 1074266112, 34078976, 1073742080], c = [536870928, 541065216, 16384, 541081616, 541065216, 16, 541081616, 4194304, 536887296, 4210704, 4194304, 536870928, 4194320, 536887296, 536870912, 16400, 0, 4194320, 536887312, 16384, 4210688, 536887312, 16, 541065232, 541065232, 0, 4210704, 541081600, 16400, 4210688, 541081600, 536870912, 536887296, 16, 541065232, 4210688, 541081616, 4194304, 16400, 536870928, 4194304, 536887296, 536870912, 16400, 536870928, 541081616, 4210688, 541065216, 4210704, 541081600, 0, 541065232, 16, 16384, 541065216, 4210704, 16384, 4194320, 536887312, 0, 541081600, 536870912, 4194320, 536887312], p = [2097152, 69206018, 67110914, 0, 2048, 67110914, 2099202, 69208064, 69208066, 2097152, 0, 67108866, 2, 67108864, 69206018, 2050, 67110912, 2099202, 2097154, 67110912, 67108866, 69206016, 69208064, 2097154, 69206016, 2048, 2050, 69208066, 2099200, 2, 67108864, 2099200, 67108864, 2099200, 2097152, 67110914, 67110914, 69206018, 69206018, 2, 2097154, 67108864, 67110912, 2097152, 69208064, 2050, 2099202, 69208064, 2050, 67108866, 69208066, 69206016, 2099200, 0, 2, 69208066, 0, 2099202, 69206016, 2048, 67108866, 67110912, 2048, 2097154], f = [268439616, 4096, 262144, 268701760, 268435456, 268439616, 64, 268435456, 262208, 268697600, 268701760, 266240, 268701696, 266304, 4096, 64, 268697600, 268435520, 268439552, 4160, 266240, 262208, 268697664, 268701696, 4160, 0, 0, 268697664, 268435520, 268439552, 266304, 262144, 266304, 262144, 268701696, 4096, 64, 268697664, 4096, 266304, 268439552, 64, 268435520, 268697600, 268697664, 268435456, 262144, 268439616, 0, 268701760, 262208, 268435520, 268697600, 268439552, 268439616, 0, 268701760, 266240, 266240, 4160, 4160, 262208, 268435456, 268701696]
}
var t = "des";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/des", ["require", "module", "./cipher", "./cipherModes", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = e.pkcs5 = e.pkcs5 || {};
e.pbkdf2 = t.pbkdf2 = function(t, r, n, i, a) {
("undefined" == typeof a || null === a) && (a = e.md.sha1.create());
var o = a.digestLength;
if (i > 4294967295 * o)
throw new Error("Derived key is too long.");
var s = Math.ceil(i / o), u = i - (s - 1) * o, l = e.hmac.create();
l.start(a, t);
for (var c, p, f, d = "", h = 1; s >= h; ++h) {
l.start(null, null), l.update(r), l.update(e.util.int32ToBytes(h)), c = f = l.digest().getBytes();
for (var g = 2; n >= g; ++g)
l.start(null, null), l.update(f), p = l.digest().getBytes(), c = e.util.xorBytes(c, p, o), f = p;
d += s > h ? c : c.substr(0, u)
}
return d
}
}
var t = "pbkdf2";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pbkdf2", ["require", "module", "./hmac", "./md", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var r = "undefined" != typeof t && t.versions && t.versions.node, n = null;
e.disableNativeCode || !r || t.versions["node-webkit"] || (n = i("crypto"));
var a = e.prng = e.prng || {};
a.create = function(t) {
function r(e) {
if (s.pools[0].messageLength >= 32)
return a(), e();
var t = 32 - s.pools[0].messageLength << 5;
s.seedFile(t, function(t, r) {
return t ? e(t) : (s.collect(r), a(), void e())
})
}
function i() {
if (s.pools[0].messageLength >= 32)
return a();
var e = 32 - s.pools[0].messageLength << 5;
s.collect(s.seedFileSync(e)), a()
}
function a() {
var e = s.plugin.md.create();
e.update(s.pools[0].digest().getBytes()), s.pools[0].start();
for (var t = 1, r = 1; 32 > r; ++r)
t = 31 === t ? 2147483648 : t << 2, t % s.reseeds === 0 && (e.update(s.pools[r].digest().getBytes()), s.pools[r].start());
var n = e.digest().getBytes();
e.start(), e.update(n);
var i = e.digest().getBytes();
s.key = s.plugin.formatKey(n), s.seed = s.plugin.formatSeed(i), s.reseeds = 4294967295 === s.reseeds ? 0 : s.reseeds + 1, s.generated = 0
}
function o(t) {
var r = null;
if ("undefined" != typeof window) {
var n = window.crypto || window.msCrypto;
n && n.getRandomValues && (r = function(e) {
return n.getRandomValues(e)
})
}
var i = e.util.createBuffer();
if (r)
for (; i.length() < t; ) {
var a = Math.max(1, Math.min(t - i.length(), 65536) / 4), o = new Uint32Array(Math.floor(a));
try {
r(o);
for (var s = 0; s < o.length; ++s)
i.putInt32(o[s])
} catch (u) {
if (!("undefined" != typeof QuotaExceededError && u instanceof QuotaExceededError))
throw u
}
}
if (i.length() < t)
for (var l, c, p, f = Math.floor(65536 * Math.random()); i.length() < t; ) {
c = 16807 * (65535 & f), l = 16807 * (f >> 16), c += (32767 & l) << 16, c += l >> 15, c = (2147483647 & c) + (c >> 31), f = 4294967295 & c;
for (var s = 0; 3 > s; ++s)
p = f >>> (s << 3), p ^= Math.floor(256 * Math.random()), i.putByte(String.fromCharCode(255 & p))
}
return i.getBytes(t)
}
for (var s = {plugin: t,key: null,seed: null,time: null,reseeds: 0,generated: 0}, u = t.md, l = new Array(32), c = 0; 32 > c; ++c)
l[c] = u.create();
return s.pools = l, s.pool = 0, s.generate = function(t, n) {
function i(p) {
if (p)
return n(p);
if (c.length() >= t)
return n(null, c.getBytes(t));
if (s.generated > 1048575 && (s.key = null), null === s.key)
return e.util.nextTick(function() {
r(i)
});
var f = a(s.key, s.seed);
s.generated += f.length, c.putBytes(f), s.key = u(a(s.key, o(s.seed))), s.seed = l(a(s.key, s.seed)), e.util.setImmediate(i)
}
if (!n)
return s.generateSync(t);
var a = s.plugin.cipher, o = s.plugin.increment, u = s.plugin.formatKey, l = s.plugin.formatSeed, c = e.util.createBuffer();
s.key = null, i()
}, s.generateSync = function(t) {
var r = s.plugin.cipher, n = s.plugin.increment, a = s.plugin.formatKey, o = s.plugin.formatSeed;
s.key = null;
for (var u = e.util.createBuffer(); u.length() < t; ) {
s.generated > 1048575 && (s.key = null), null === s.key && i();
var l = r(s.key, s.seed);
s.generated += l.length, u.putBytes(l), s.key = a(r(s.key, n(s.seed))), s.seed = o(r(s.key, s.seed))
}
return u.getBytes(t)
}, n ? (s.seedFile = function(e, t) {
n.randomBytes(e, function(e, r) {
return e ? t(e) : void t(null, r.toString())
})
}, s.seedFileSync = function(e) {
return n.randomBytes(e).toString()
}) : (s.seedFile = function(e, t) {
try {
t(null, o(e))
} catch (r) {
t(r)
}
}, s.seedFileSync = o), s.collect = function(e) {
for (var t = e.length, r = 0; t > r; ++r)
s.pools[s.pool].update(e.substr(r, 1)), s.pool = 31 === s.pool ? 0 : s.pool + 1
}, s.collectInt = function(e, t) {
for (var r = "", n = 0; t > n; n += 8)
r += String.fromCharCode(e >> n & 255);
s.collect(r)
}, s.registerWorker = function(e) {
if (e === self)
s.seedFile = function(e, t) {
function r(e) {
var n = e.data;
n.forge && n.forge.prng && (self.removeEventListener("message", r), t(n.forge.prng.err, n.forge.prng.bytes))
}
self.addEventListener("message", r), self.postMessage({forge: {prng: {needed: e}}})
};
else {
var t = function(t) {
var r = t.data;
r.forge && r.forge.prng && s.seedFile(r.forge.prng.needed, function(t, r) {
e.postMessage({forge: {prng: {err: t,bytes: r}}})
})
};
e.addEventListener("message", t)
}
}, s
}
}
var r = "prng";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var o = !0;
a = function(e, t) {
t(i, n)
}
}
var s, u = function(t, n) {
n.exports = function(n) {
var i = s.map(function(e) {
return t(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[r])
return n[r];
n.defined[r] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[r]
}
}, l = a;
(a = function(e, t) {
return s = "string" == typeof e ? t.slice(2) : e.slice(2), o ? (delete a, l.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = l, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/prng", ["require", "module", "./md", "./util"], function() {
u.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
e.random && e.random.getBytes || !function(r) {
function n() {
var t = e.prng.create(i);
return t.getBytes = function(e, r) {
return t.generate(e, r)
}, t.getBytesSync = function(e) {
return t.generate(e)
}, t
}
var i = {}, a = new Array(4), o = e.util.createBuffer();
i.formatKey = function(t) {
var r = e.util.createBuffer(t);
return t = new Array(4), t[0] = r.getInt32(), t[1] = r.getInt32(), t[2] = r.getInt32(), t[3] = r.getInt32(), e.aes._expandKey(t, !1)
}, i.formatSeed = function(t) {
var r = e.util.createBuffer(t);
return t = new Array(4), t[0] = r.getInt32(), t[1] = r.getInt32(), t[2] = r.getInt32(), t[3] = r.getInt32(), t
}, i.cipher = function(t, r) {
return e.aes._updateBlock(t, r, a, !1), o.putInt32(a[0]), o.putInt32(a[1]), o.putInt32(a[2]), o.putInt32(a[3]), o.getBytes()
}, i.increment = function(e) {
return ++e[3], e
}, i.md = e.md.sha256;
var s = n(), u = "undefined" != typeof t && t.versions && t.versions.node, l = null;
if ("undefined" != typeof window) {
var c = window.crypto || window.msCrypto;
c && c.getRandomValues && (l = function(e) {
return c.getRandomValues(e)
})
}
if (e.disableNativeCode || !u && !l) {
if ("undefined" == typeof window || void 0 === window.document, s.collectInt(+new Date, 32), "undefined" != typeof navigator) {
var p = "";
for (var f in navigator)
try {
"string" == typeof navigator[f] && (p += navigator[f])
} catch (d) {
}
s.collect(p), p = null
}
r && (r().mousemove(function(e) {
s.collectInt(e.clientX, 16), s.collectInt(e.clientY, 16)
}), r().keypress(function(e) {
s.collectInt(e.charCode, 8)
}))
}
if (e.random)
for (var f in s)
e.random[f] = s[f];
else
e.random = s;
e.random.createInstance = n
}("undefined" != typeof r ? r : null)
}
var o = "random";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var s = !0;
a = function(e, t) {
t(i, n)
}
}
var u, l = function(t, r) {
r.exports = function(r) {
var n = u.map(function(e) {
return t(e)
}).concat(e);
if (r = r || {}, r.defined = r.defined || {}, r.defined[o])
return r[o];
r.defined[o] = !0;
for (var i = 0; i < n.length; ++i)
n[i](r);
return r[o]
}
}, c = a;
(a = function(e, t) {
return u = "string" == typeof e ? t.slice(2) : e.slice(2), s ? (delete a, c.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = c, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/random", ["require", "module", "./aes", "./md", "./prng", "./util"], function() {
l.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = [217, 120, 249, 196, 25, 221, 181, 237, 40, 233, 253, 121, 74, 160, 216, 157, 198, 126, 55, 131, 43, 118, 83, 142, 98, 76, 100, 136, 68, 139, 251, 162, 23, 154, 89, 245, 135, 179, 79, 19, 97, 69, 109, 141, 9, 129, 125, 50, 189, 143, 64, 235, 134, 183, 123, 11, 240, 149, 33, 34, 92, 107, 78, 130, 84, 214, 101, 147, 206, 96, 178, 28, 115, 86, 192, 20, 167, 140, 241, 220, 18, 117, 202, 31, 59, 190, 228, 209, 66, 61, 212, 48, 163, 60, 182, 38, 111, 191, 14, 218, 70, 105, 7, 87, 39, 242, 29, 155, 188, 148, 67, 3, 248, 17, 199, 246, 144, 239, 62, 231, 6, 195, 213, 47, 200, 102, 30, 215, 8, 232, 234, 222, 128, 82, 238, 247, 132, 170, 114, 172, 53, 77, 106, 42, 150, 26, 210, 113, 90, 21, 73, 116, 75, 159, 208, 94, 4, 24, 164, 236, 194, 224, 65, 110, 15, 81, 203, 204, 36, 145, 175, 80, 161, 244, 112, 57, 153, 124, 58, 133, 35, 184, 180, 122, 252, 2, 54, 91, 37, 85, 151, 49, 45, 93, 250, 152, 227, 138, 146, 174, 5, 223, 41, 16, 103, 108, 186, 201, 211, 0, 230, 207, 225, 158, 168, 44, 99, 22, 1, 63, 88, 226, 137, 169, 13, 56, 52, 27, 171, 51, 255, 176, 187, 72, 12, 95, 185, 177, 205, 46, 197, 243, 219, 71, 229, 165, 156, 119, 10, 166, 32, 104, 254, 127, 193, 173], r = [1, 2, 3, 5], n = function(e, t) {
return e << t & 65535 | (65535 & e) >> 16 - t
}, i = function(e, t) {
return (65535 & e) >> t | e << 16 - t & 65535
};
e.rc2 = e.rc2 || {}, e.rc2.expandKey = function(r, n) {
"string" == typeof r && (r = e.util.createBuffer(r)), n = n || 128;
var i, a = r, o = r.length(), s = n, u = Math.ceil(s / 8), l = 255 >> (7 & s);
for (i = o; 128 > i; i++)
a.putByte(t[a.at(i - 1) + a.at(i - o) & 255]);
for (a.setAt(128 - u, t[a.at(128 - u) & l]), i = 127 - u; i >= 0; i--)
a.setAt(i, t[a.at(i + 1) ^ a.at(i + u)]);
return a
};
var a = function(t, a, o) {
var s, u, l, c, p = !1, f = null, d = null, h = null, g = [];
for (t = e.rc2.expandKey(t, a), l = 0; 64 > l; l++)
g.push(t.getInt16Le());
o ? (s = function(e) {
for (l = 0; 4 > l; l++)
e[l] += g[c] + (e[(l + 3) % 4] & e[(l + 2) % 4]) + (~e[(l + 3) % 4] & e[(l + 1) % 4]), e[l] = n(e[l], r[l]), c++
}, u = function(e) {
for (l = 0; 4 > l; l++)
e[l] += g[63 & e[(l + 3) % 4]]
}) : (s = function(e) {
for (l = 3; l >= 0; l--)
e[l] = i(e[l], r[l]), e[l] -= g[c] + (e[(l + 3) % 4] & e[(l + 2) % 4]) + (~e[(l + 3) % 4] & e[(l + 1) % 4]), c--
}, u = function(e) {
for (l = 3; l >= 0; l--)
e[l] -= g[63 & e[(l + 3) % 4]]
});
var y = function(e) {
var t = [];
for (l = 0; 4 > l; l++) {
var r = f.getInt16Le();
null !== h && (o ? r ^= h.getInt16Le() : h.putInt16Le(r)), t.push(65535 & r)
}
c = o ? 0 : 63;
for (var n = 0; n < e.length; n++)
for (var i = 0; i < e[n][0]; i++)
e[n][1](t);
for (l = 0; 4 > l; l++)
null !== h && (o ? h.putInt16Le(t[l]) : t[l] ^= h.getInt16Le()), d.putInt16Le(t[l])
}, m = null;
return m = {start: function(t, r) {
t && "string" == typeof t && (t = e.util.createBuffer(t)), p = !1, f = e.util.createBuffer(), d = r || new e.util.createBuffer, h = t, m.output = d
},update: function(e) {
for (p || f.putBuffer(e); f.length() >= 8; )
y([[5, s], [1, u], [6, s], [1, u], [5, s]])
},finish: function(e) {
var t = !0;
if (o)
if (e)
t = e(8, f, !o);
else {
var r = 8 === f.length() ? 8 : 8 - f.length();
f.fillWithByte(r, r)
}
if (t && (p = !0, m.update()), !o && (t = 0 === f.length()))
if (e)
t = e(8, d, !o);
else {
var n = d.length(), i = d.at(n - 1);
i > n ? t = !1 : d.truncate(i)
}
return t
}}
};
e.rc2.startEncrypting = function(t, r, n) {
var i = e.rc2.createEncryptionCipher(t, 128);
return i.start(r, n), i
}, e.rc2.createEncryptionCipher = function(e, t) {
return a(e, t, !0)
}, e.rc2.startDecrypting = function(t, r, n) {
var i = e.rc2.createDecryptionCipher(t, 128);
return i.start(r, n), i
}, e.rc2.createDecryptionCipher = function(e, t) {
return a(e, t, !1)
}
}
var t = "rc2";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/rc2", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(e, t, r) {
this.data = [], null != e && ("number" == typeof e ? this.fromNumber(e, t, r) : null == t && "string" != typeof e ? this.fromString(e, 256) : this.fromString(e, t))
}
function r() {
return new t(null)
}
function n(e, t, r, n, i, a) {
for (; --a >= 0; ) {
var o = t * this.data[e++] + r.data[n] + i;
i = Math.floor(o / 67108864), r.data[n++] = 67108863 & o
}
return i
}
function i(e, t, r, n, i, a) {
for (var o = 32767 & t, s = t >> 15; --a >= 0; ) {
var u = 32767 & this.data[e], l = this.data[e++] >> 15, c = s * u + l * o;
u = o * u + ((32767 & c) << 15) + r.data[n] + (1073741823 & i), i = (u >>> 30) + (c >>> 15) + s * l + (i >>> 30), r.data[n++] = 1073741823 & u
}
return i
}
function a(e, t, r, n, i, a) {
for (var o = 16383 & t, s = t >> 14; --a >= 0; ) {
var u = 16383 & this.data[e], l = this.data[e++] >> 14, c = s * u + l * o;
u = o * u + ((16383 & c) << 14) + r.data[n] + i, i = (u >> 28) + (c >> 14) + s * l, r.data[n++] = 268435455 & u
}
return i
}
function o(e) {
return ar.charAt(e)
}
function s(e, t) {
var r = or[e.charCodeAt(t)];
return null == r ? -1 : r
}
function u(e) {
for (var t = this.t - 1; t >= 0; --t)
e.data[t] = this.data[t];
e.t = this.t, e.s = this.s
}
function l(e) {
this.t = 1, this.s = 0 > e ? -1 : 0, e > 0 ? this.data[0] = e : -1 > e ? this.data[0] = e + this.DV : this.t = 0
}
function c(e) {
var t = r();
return t.fromInt(e), t
}
function p(e, r) {
var n;
if (16 == r)
n = 4;
else if (8 == r)
n = 3;
else if (256 == r)
n = 8;
else if (2 == r)
n = 1;
else if (32 == r)
n = 5;
else {
if (4 != r)
return void this.fromRadix(e, r);
n = 2
}
this.t = 0, this.s = 0;
for (var i = e.length, a = !1, o = 0; --i >= 0; ) {
var u = 8 == n ? 255 & e[i] : s(e, i);
0 > u ? "-" == e.charAt(i) && (a = !0) : (a = !1, 0 == o ? this.data[this.t++] = u : o + n > this.DB ? (this.data[this.t - 1] |= (u & (1 << this.DB - o) - 1) << o, this.data[this.t++] = u >> this.DB - o) : this.data[this.t - 1] |= u << o, o += n, o >= this.DB && (o -= this.DB))
}
8 == n && 0 != (128 & e[0]) && (this.s = -1, o > 0 && (this.data[this.t - 1] |= (1 << this.DB - o) - 1 << o)), this.clamp(), a && t.ZERO.subTo(this, this)
}
function f() {
for (var e = this.s & this.DM; this.t > 0 && this.data[this.t - 1] == e; )
--this.t
}
function d(e) {
if (this.s < 0)
return "-" + this.negate().toString(e);
var t;
if (16 == e)
t = 4;
else if (8 == e)
t = 3;
else if (2 == e)
t = 1;
else if (32 == e)
t = 5;
else {
if (4 != e)
return this.toRadix(e);
t = 2
}
var r, n = (1 << t) - 1, i = !1, a = "", s = this.t, u = this.DB - s * this.DB % t;
if (s-- > 0)
for (u < this.DB && (r = this.data[s] >> u) > 0 && (i = !0, a = o(r)); s >= 0; )
t > u ? (r = (this.data[s] & (1 << u) - 1) << t - u, r |= this.data[--s] >> (u += this.DB - t)) : (r = this.data[s] >> (u -= t) & n, 0 >= u && (u += this.DB, --s)), r > 0 && (i = !0), i && (a += o(r));
return i ? a : "0"
}
function h() {
var e = r();
return t.ZERO.subTo(this, e), e
}
function g() {
return this.s < 0 ? this.negate() : this
}
function y(e) {
var t = this.s - e.s;
if (0 != t)
return t;
var r = this.t;
if (t = r - e.t, 0 != t)
return this.s < 0 ? -t : t;
for (; --r >= 0; )
if (0 != (t = this.data[r] - e.data[r]))
return t;
return 0
}
function m(e) {
var t, r = 1;
return 0 != (t = e >>> 16) && (e = t, r += 16), 0 != (t = e >> 8) && (e = t, r += 8), 0 != (t = e >> 4) && (e = t, r += 4), 0 != (t = e >> 2) && (e = t, r += 2), 0 != (t = e >> 1) && (e = t, r += 1), r
}
function v() {
return this.t <= 0 ? 0 : this.DB * (this.t - 1) + m(this.data[this.t - 1] ^ this.s & this.DM)
}
function b(e, t) {
var r;
for (r = this.t - 1; r >= 0; --r)
t.data[r + e] = this.data[r];
for (r = e - 1; r >= 0; --r)
t.data[r] = 0;
t.t = this.t + e, t.s = this.s
}
function _(e, t) {
for (var r = e; r < this.t; ++r)
t.data[r - e] = this.data[r];
t.t = Math.max(this.t - e, 0), t.s = this.s
}
function E(e, t) {
var r, n = e % this.DB, i = this.DB - n, a = (1 << i) - 1, o = Math.floor(e / this.DB), s = this.s << n & this.DM;
for (r = this.t - 1; r >= 0; --r)
t.data[r + o + 1] = this.data[r] >> i | s, s = (this.data[r] & a) << n;
for (r = o - 1; r >= 0; --r)
t.data[r] = 0;
t.data[o] = s, t.t = this.t + o + 1, t.s = this.s, t.clamp()
}
function C(e, t) {
t.s = this.s;
var r = Math.floor(e / this.DB);
if (r >= this.t)
return void (t.t = 0);
var n = e % this.DB, i = this.DB - n, a = (1 << n) - 1;
t.data[0] = this.data[r] >> n;
for (var o = r + 1; o < this.t; ++o)
t.data[o - r - 1] |= (this.data[o] & a) << i, t.data[o - r] = this.data[o] >> n;
n > 0 && (t.data[this.t - r - 1] |= (this.s & a) << i), t.t = this.t - r, t.clamp()
}
function S(e, t) {
for (var r = 0, n = 0, i = Math.min(e.t, this.t); i > r; )
n += this.data[r] - e.data[r], t.data[r++] = n & this.DM, n >>= this.DB;
if (e.t < this.t) {
for (n -= e.s; r < this.t; )
n += this.data[r], t.data[r++] = n & this.DM, n >>= this.DB;
n += this.s
} else {
for (n += this.s; r < e.t; )
n -= e.data[r], t.data[r++] = n & this.DM, n >>= this.DB;
n -= e.s
}
t.s = 0 > n ? -1 : 0, -1 > n ? t.data[r++] = this.DV + n : n > 0 && (t.data[r++] = n), t.t = r, t.clamp()
}
function A(e, r) {
var n = this.abs(), i = e.abs(), a = n.t;
for (r.t = a + i.t; --a >= 0; )
r.data[a] = 0;
for (a = 0; a < i.t; ++a)
r.data[a + n.t] = n.am(0, i.data[a], r, a, 0, n.t);
r.s = 0, r.clamp(), this.s != e.s && t.ZERO.subTo(r, r)
}
function T(e) {
for (var t = this.abs(), r = e.t = 2 * t.t; --r >= 0; )
e.data[r] = 0;
for (r = 0; r < t.t - 1; ++r) {
var n = t.am(r, t.data[r], e, 2 * r, 0, 1);
(e.data[r + t.t] += t.am(r + 1, 2 * t.data[r], e, 2 * r + 1, n, t.t - r - 1)) >= t.DV && (e.data[r + t.t] -= t.DV, e.data[r + t.t + 1] = 1)
}
e.t > 0 && (e.data[e.t - 1] += t.am(r, t.data[r], e, 2 * r, 0, 1)), e.s = 0, e.clamp()
}
function w(e, n, i) {
var a = e.abs();
if (!(a.t <= 0)) {
var o = this.abs();
if (o.t < a.t)
return null != n && n.fromInt(0), void (null != i && this.copyTo(i));
null == i && (i = r());
var s = r(), u = this.s, l = e.s, c = this.DB - m(a.data[a.t - 1]);
c > 0 ? (a.lShiftTo(c, s), o.lShiftTo(c, i)) : (a.copyTo(s), o.copyTo(i));
var p = s.t, f = s.data[p - 1];
if (0 != f) {
var d = f * (1 << this.F1) + (p > 1 ? s.data[p - 2] >> this.F2 : 0), h = this.FV / d, g = (1 << this.F1) / d, y = 1 << this.F2, v = i.t, b = v - p, _ = null == n ? r() : n;
for (s.dlShiftTo(b, _), i.compareTo(_) >= 0 && (i.data[i.t++] = 1, i.subTo(_, i)), t.ONE.dlShiftTo(p, _), _.subTo(s, s); s.t < p; )
s.data[s.t++] = 0;
for (; --b >= 0; ) {
var E = i.data[--v] == f ? this.DM : Math.floor(i.data[v] * h + (i.data[v - 1] + y) * g);
if ((i.data[v] += s.am(0, E, i, b, 0, p)) < E)
for (s.dlShiftTo(b, _), i.subTo(_, i); i.data[v] < --E; )
i.subTo(_, i)
}
null != n && (i.drShiftTo(p, n), u != l && t.ZERO.subTo(n, n)), i.t = p, i.clamp(), c > 0 && i.rShiftTo(c, i), 0 > u && t.ZERO.subTo(i, i)
}
}
}
function k(e) {
var n = r();
return this.abs().divRemTo(e, null, n), this.s < 0 && n.compareTo(t.ZERO) > 0 && e.subTo(n, n), n
}
function I(e) {
this.m = e
}
function x(e) {
return e.s < 0 || e.compareTo(this.m) >= 0 ? e.mod(this.m) : e
}
function D(e) {
return e
}
function N(e) {
e.divRemTo(this.m, null, e)
}
function B(e, t, r) {
e.multiplyTo(t, r), this.reduce(r)
}
function L(e, t) {
e.squareTo(t), this.reduce(t)
}
function R() {
if (this.t < 1)
return 0;
var e = this.data[0];
if (0 == (1 & e))
return 0;
var t = 3 & e;
return t = t * (2 - (15 & e) * t) & 15, t = t * (2 - (255 & e) * t) & 255, t = t * (2 - ((65535 & e) * t & 65535)) & 65535, t = t * (2 - e * t % this.DV) % this.DV, t > 0 ? this.DV - t : -t
}
function P(e) {
this.m = e, this.mp = e.invDigit(), this.mpl = 32767 & this.mp, this.mph = this.mp >> 15, this.um = (1 << e.DB - 15) - 1, this.mt2 = 2 * e.t
}
function O(e) {
var n = r();
return e.abs().dlShiftTo(this.m.t, n), n.divRemTo(this.m, null, n), e.s < 0 && n.compareTo(t.ZERO) > 0 && this.m.subTo(n, n), n
}
function U(e) {
var t = r();
return e.copyTo(t), this.reduce(t), t
}
function M(e) {
for (; e.t <= this.mt2; )
e.data[e.t++] = 0;
for (var t = 0; t < this.m.t; ++t) {
var r = 32767 & e.data[t], n = r * this.mpl + ((r * this.mph + (e.data[t] >> 15) * this.mpl & this.um) << 15) & e.DM;
for (r = t + this.m.t, e.data[r] += this.m.am(0, n, e, t, 0, this.m.t); e.data[r] >= e.DV; )
e.data[r] -= e.DV, e.data[++r]++
}
e.clamp(), e.drShiftTo(this.m.t, e), e.compareTo(this.m) >= 0 && e.subTo(this.m, e)
}
function F(e, t) {
e.squareTo(t), this.reduce(t)
}
function j(e, t, r) {
e.multiplyTo(t, r), this.reduce(r)
}
function V() {
return 0 == (this.t > 0 ? 1 & this.data[0] : this.s)
}
function H(e, n) {
if (e > 4294967295 || 1 > e)
return t.ONE;
var i = r(), a = r(), o = n.convert(this), s = m(e) - 1;
for (o.copyTo(i); --s >= 0; )
if (n.sqrTo(i, a), (e & 1 << s) > 0)
n.mulTo(a, o, i);
else {
var u = i;
i = a, a = u
}
return n.revert(i)
}
function q(e, t) {
var r;
return r = 256 > e || t.isEven() ? new I(t) : new P(t), this.exp(e, r)
}
function K() {
var e = r();
return this.copyTo(e), e
}
function G() {
if (this.s < 0) {
if (1 == this.t)
return this.data[0] - this.DV;
if (0 == this.t)
return -1
} else {
if (1 == this.t)
return this.data[0];
if (0 == this.t)
return 0
}
return (this.data[1] & (1 << 32 - this.DB) - 1) << this.DB | this.data[0]
}
function Y() {
return 0 == this.t ? this.s : this.data[0] << 24 >> 24
}
function W() {
return 0 == this.t ? this.s : this.data[0] << 16 >> 16
}
function z(e) {
return Math.floor(Math.LN2 * this.DB / Math.log(e))
}
function Q() {
return this.s < 0 ? -1 : this.t <= 0 || 1 == this.t && this.data[0] <= 0 ? 0 : 1
}
function X(e) {
if (null == e && (e = 10), 0 == this.signum() || 2 > e || e > 36)
return "0";
var t = this.chunkSize(e), n = Math.pow(e, t), i = c(n), a = r(), o = r(), s = "";
for (this.divRemTo(i, a, o); a.signum() > 0; )
s = (n + o.intValue()).toString(e).substr(1) + s, a.divRemTo(i, a, o);
return o.intValue().toString(e) + s
}
function $(e, r) {
this.fromInt(0), null == r && (r = 10);
for (var n = this.chunkSize(r), i = Math.pow(r, n), a = !1, o = 0, u = 0, l = 0; l < e.length; ++l) {
var c = s(e, l);
0 > c ? "-" == e.charAt(l) && 0 == this.signum() && (a = !0) : (u = r * u + c, ++o >= n && (this.dMultiply(i), this.dAddOffset(u, 0), o = 0, u = 0))
}
o > 0 && (this.dMultiply(Math.pow(r, o)), this.dAddOffset(u, 0)), a && t.ZERO.subTo(this, this)
}
function J(e, r, n) {
if ("number" == typeof r)
if (2 > e)
this.fromInt(1);
else
for (this.fromNumber(e, n), this.testBit(e - 1) || this.bitwiseTo(t.ONE.shiftLeft(e - 1), ot, this), this.isEven() && this.dAddOffset(1, 0); !this.isProbablePrime(r); )
this.dAddOffset(2, 0), this.bitLength() > e && this.subTo(t.ONE.shiftLeft(e - 1), this);
else {
var i = new Array, a = 7 & e;
i.length = (e >> 3) + 1, r.nextBytes(i), a > 0 ? i[0] &= (1 << a) - 1 : i[0] = 0, this.fromString(i, 256)
}
}
function Z() {
var e = this.t, t = new Array;
t[0] = this.s;
var r, n = this.DB - e * this.DB % 8, i = 0;
if (e-- > 0)
for (n < this.DB && (r = this.data[e] >> n) != (this.s & this.DM) >> n && (t[i++] = r | this.s << this.DB - n); e >= 0; )
8 > n ? (r = (this.data[e] & (1 << n) - 1) << 8 - n, r |= this.data[--e] >> (n += this.DB - 8)) : (r = this.data[e] >> (n -= 8) & 255, 0 >= n && (n += this.DB, --e)), 0 != (128 & r) && (r |= -256), 0 == i && (128 & this.s) != (128 & r) && ++i, (i > 0 || r != this.s) && (t[i++] = r);
return t
}
function et(e) {
return 0 == this.compareTo(e)
}
function tt(e) {
return this.compareTo(e) < 0 ? this : e
}
function rt(e) {
return this.compareTo(e) > 0 ? this : e
}
function nt(e, t, r) {
var n, i, a = Math.min(e.t, this.t);
for (n = 0; a > n; ++n)
r.data[n] = t(this.data[n], e.data[n]);
if (e.t < this.t) {
for (i = e.s & this.DM, n = a; n < this.t; ++n)
r.data[n] = t(this.data[n], i);
r.t = this.t
} else {
for (i = this.s & this.DM, n = a; n < e.t; ++n)
r.data[n] = t(i, e.data[n]);
r.t = e.t
}
r.s = t(this.s, e.s), r.clamp()
}
function it(e, t) {
return e & t
}
function at(e) {
var t = r();
return this.bitwiseTo(e, it, t), t
}
function ot(e, t) {
return e | t
}
function st(e) {
var t = r();
return this.bitwiseTo(e, ot, t), t
}
function ut(e, t) {
return e ^ t
}
function lt(e) {
var t = r();
return this.bitwiseTo(e, ut, t), t
}
function ct(e, t) {
return e & ~t
}
function pt(e) {
var t = r();
return this.bitwiseTo(e, ct, t), t
}
function ft() {
for (var e = r(), t = 0; t < this.t; ++t)
e.data[t] = this.DM & ~this.data[t];
return e.t = this.t, e.s = ~this.s, e
}
function dt(e) {
var t = r();
return 0 > e ? this.rShiftTo(-e, t) : this.lShiftTo(e, t), t
}
function ht(e) {
var t = r();
return 0 > e ? this.lShiftTo(-e, t) : this.rShiftTo(e, t), t
}
function gt(e) {
if (0 == e)
return -1;
var t = 0;
return 0 == (65535 & e) && (e >>= 16, t += 16), 0 == (255 & e) && (e >>= 8, t += 8), 0 == (15 & e) && (e >>= 4, t += 4), 0 == (3 & e) && (e >>= 2, t += 2), 0 == (1 & e) && ++t, t
}
function yt() {
for (var e = 0; e < this.t; ++e)
if (0 != this.data[e])
return e * this.DB + gt(this.data[e]);
return this.s < 0 ? this.t * this.DB : -1
}
function mt(e) {
for (var t = 0; 0 != e; )
e &= e - 1, ++t;
return t
}
function vt() {
for (var e = 0, t = this.s & this.DM, r = 0; r < this.t; ++r)
e += mt(this.data[r] ^ t);
return e
}
function bt(e) {
var t = Math.floor(e / this.DB);
return t >= this.t ? 0 != this.s : 0 != (this.data[t] & 1 << e % this.DB)
}
function _t(e, r) {
var n = t.ONE.shiftLeft(e);
return this.bitwiseTo(n, r, n), n
}
function Et(e) {
return this.changeBit(e, ot)
}
function Ct(e) {
return this.changeBit(e, ct)
}
function St(e) {
return this.changeBit(e, ut)
}
function At(e, t) {
for (var r = 0, n = 0, i = Math.min(e.t, this.t); i > r; )
n += this.data[r] + e.data[r], t.data[r++] = n & this.DM, n >>= this.DB;
if (e.t < this.t) {
for (n += e.s; r < this.t; )
n += this.data[r], t.data[r++] = n & this.DM, n >>= this.DB;
n += this.s
} else {
for (n += this.s; r < e.t; )
n += e.data[r], t.data[r++] = n & this.DM, n >>= this.DB;
n += e.s
}
t.s = 0 > n ? -1 : 0, n > 0 ? t.data[r++] = n : -1 > n && (t.data[r++] = this.DV + n), t.t = r, t.clamp()
}
function Tt(e) {
var t = r();
return this.addTo(e, t), t
}
function wt(e) {
var t = r();
return this.subTo(e, t), t
}
function kt(e) {
var t = r();
return this.multiplyTo(e, t), t
}
function It(e) {
var t = r();
return this.divRemTo(e, t, null), t
}
function xt(e) {
var t = r();
return this.divRemTo(e, null, t), t
}
function Dt(e) {
var t = r(), n = r();
return this.divRemTo(e, t, n), new Array(t, n)
}
function Nt(e) {
this.data[this.t] = this.am(0, e - 1, this, 0, 0, this.t), ++this.t, this.clamp()
}
function Bt(e, t) {
if (0 != e) {
for (; this.t <= t; )
this.data[this.t++] = 0;
for (this.data[t] += e; this.data[t] >= this.DV; )
this.data[t] -= this.DV, ++t >= this.t && (this.data[this.t++] = 0), ++this.data[t]
}
}
function Lt() {
}
function Rt(e) {
return e
}
function Pt(e, t, r) {
e.multiplyTo(t, r)
}
function Ot(e, t) {
e.squareTo(t)
}
function Ut(e) {
return this.exp(e, new Lt)
}
function Mt(e, t, r) {
var n = Math.min(this.t + e.t, t);
for (r.s = 0, r.t = n; n > 0; )
r.data[--n] = 0;
var i;
for (i = r.t - this.t; i > n; ++n)
r.data[n + this.t] = this.am(0, e.data[n], r, n, 0, this.t);
for (i = Math.min(e.t, t); i > n; ++n)
this.am(0, e.data[n], r, n, 0, t - n);
r.clamp()
}
function Ft(e, t, r) {
--t;
var n = r.t = this.t + e.t - t;
for (r.s = 0; --n >= 0; )
r.data[n] = 0;
for (n = Math.max(t - this.t, 0); n < e.t; ++n)
r.data[this.t + n - t] = this.am(t - n, e.data[n], r, 0, 0, this.t + n - t);
r.clamp(), r.drShiftTo(1, r)
}
function jt(e) {
this.r2 = r(), this.q3 = r(), t.ONE.dlShiftTo(2 * e.t, this.r2), this.mu = this.r2.divide(e), this.m = e
}
function Vt(e) {
if (e.s < 0 || e.t > 2 * this.m.t)
return e.mod(this.m);
if (e.compareTo(this.m) < 0)
return e;
var t = r();
return e.copyTo(t), this.reduce(t), t
}
function Ht(e) {
return e
}
function qt(e) {
for (e.drShiftTo(this.m.t - 1, this.r2), e.t > this.m.t + 1 && (e.t = this.m.t + 1, e.clamp()), this.mu.multiplyUpperTo(this.r2, this.m.t + 1, this.q3), this.m.multiplyLowerTo(this.q3, this.m.t + 1, this.r2); e.compareTo(this.r2) < 0; )
e.dAddOffset(1, this.m.t + 1);
for (e.subTo(this.r2, e); e.compareTo(this.m) >= 0; )
e.subTo(this.m, e)
}
function Kt(e, t) {
e.squareTo(t), this.reduce(t)
}
function Gt(e, t, r) {
e.multiplyTo(t, r), this.reduce(r)
}
function Yt(e, t) {
var n, i, a = e.bitLength(), o = c(1);
if (0 >= a)
return o;
n = 18 > a ? 1 : 48 > a ? 3 : 144 > a ? 4 : 768 > a ? 5 : 6, i = 8 > a ? new I(t) : t.isEven() ? new jt(t) : new P(t);
var s = new Array, u = 3, l = n - 1, p = (1 << n) - 1;
if (s[1] = i.convert(this), n > 1) {
var f = r();
for (i.sqrTo(s[1], f); p >= u; )
s[u] = r(), i.mulTo(f, s[u - 2], s[u]), u += 2
}
var d, h, g = e.t - 1, y = !0, v = r();
for (a = m(e.data[g]) - 1; g >= 0; ) {
for (a >= l ? d = e.data[g] >> a - l & p : (d = (e.data[g] & (1 << a + 1) - 1) << l - a, g > 0 && (d |= e.data[g - 1] >> this.DB + a - l)), u = n; 0 == (1 & d); )
d >>= 1, --u;
if ((a -= u) < 0 && (a += this.DB, --g), y)
s[d].copyTo(o), y = !1;
else {
for (; u > 1; )
i.sqrTo(o, v), i.sqrTo(v, o), u -= 2;
u > 0 ? i.sqrTo(o, v) : (h = o, o = v, v = h), i.mulTo(v, s[d], o)
}
for (; g >= 0 && 0 == (e.data[g] & 1 << a); )
i.sqrTo(o, v), h = o, o = v, v = h, --a < 0 && (a = this.DB - 1, --g)
}
return i.revert(o)
}
function Wt(e) {
var t = this.s < 0 ? this.negate() : this.clone(), r = e.s < 0 ? e.negate() : e.clone();
if (t.compareTo(r) < 0) {
var n = t;
t = r, r = n
}
var i = t.getLowestSetBit(), a = r.getLowestSetBit();
if (0 > a)
return t;
for (a > i && (a = i), a > 0 && (t.rShiftTo(a, t), r.rShiftTo(a, r)); t.signum() > 0; )
(i = t.getLowestSetBit()) > 0 && t.rShiftTo(i, t), (i = r.getLowestSetBit()) > 0 && r.rShiftTo(i, r), t.compareTo(r) >= 0 ? (t.subTo(r, t), t.rShiftTo(1, t)) : (r.subTo(t, r), r.rShiftTo(1, r));
return a > 0 && r.lShiftTo(a, r), r
}
function zt(e) {
if (0 >= e)
return 0;
var t = this.DV % e, r = this.s < 0 ? e - 1 : 0;
if (this.t > 0)
if (0 == t)
r = this.data[0] % e;
else
for (var n = this.t - 1; n >= 0; --n)
r = (t * r + this.data[n]) % e;
return r
}
function Qt(e) {
var r = e.isEven();
if (this.isEven() && r || 0 == e.signum())
return t.ZERO;
for (var n = e.clone(), i = this.clone(), a = c(1), o = c(0), s = c(0), u = c(1); 0 != n.signum(); ) {
for (; n.isEven(); )
n.rShiftTo(1, n), r ? (a.isEven() && o.isEven() || (a.addTo(this, a), o.subTo(e, o)), a.rShiftTo(1, a)) : o.isEven() || o.subTo(e, o), o.rShiftTo(1, o);
for (; i.isEven(); )
i.rShiftTo(1, i), r ? (s.isEven() && u.isEven() || (s.addTo(this, s), u.subTo(e, u)), s.rShiftTo(1, s)) : u.isEven() || u.subTo(e, u), u.rShiftTo(1, u);
n.compareTo(i) >= 0 ? (n.subTo(i, n), r && a.subTo(s, a), o.subTo(u, o)) : (i.subTo(n, i), r && s.subTo(a, s), u.subTo(o, u))
}
return 0 != i.compareTo(t.ONE) ? t.ZERO : u.compareTo(e) >= 0 ? u.subtract(e) : u.signum() < 0 ? (u.addTo(e, u), u.signum() < 0 ? u.add(e) : u) : u
}
function Xt(e) {
var t, r = this.abs();
if (1 == r.t && r.data[0] <= sr[sr.length - 1]) {
for (t = 0; t < sr.length; ++t)
if (r.data[0] == sr[t])
return !0;
return !1
}
if (r.isEven())
return !1;
for (t = 1; t < sr.length; ) {
for (var n = sr[t], i = t + 1; i < sr.length && ur > n; )
n *= sr[i++];
for (n = r.modInt(n); i > t; )
if (n % sr[t++] == 0)
return !1
}
return r.millerRabin(e)
}
function $t(e) {
var r = this.subtract(t.ONE), n = r.getLowestSetBit();
if (0 >= n)
return !1;
for (var i, a = r.shiftRight(n), o = Jt(), s = 0; e > s; ++s) {
do
i = new t(this.bitLength(), o);
while (i.compareTo(t.ONE) <= 0 || i.compareTo(r) >= 0);
var u = i.modPow(a, this);
if (0 != u.compareTo(t.ONE) && 0 != u.compareTo(r)) {
for (var l = 1; l++ < n && 0 != u.compareTo(r); )
if (u = u.modPowInt(2, this), 0 == u.compareTo(t.ONE))
return !1;
if (0 != u.compareTo(r))
return !1
}
}
return !0
}
function Jt() {
return {nextBytes: function(e) {
for (var t = 0; t < e.length; ++t)
e[t] = Math.floor(255 * Math.random())
}}
}
var Zt, er = 0xdeadbeefcafe, tr = 15715070 == (16777215 & er);
"undefined" == typeof navigator ? (t.prototype.am = a, Zt = 28) : tr && "Microsoft Internet Explorer" == navigator.appName ? (t.prototype.am = i, Zt = 30) : tr && "Netscape" != navigator.appName ? (t.prototype.am = n, Zt = 26) : (t.prototype.am = a, Zt = 28), t.prototype.DB = Zt, t.prototype.DM = (1 << Zt) - 1, t.prototype.DV = 1 << Zt;
var rr = 52;
t.prototype.FV = Math.pow(2, rr), t.prototype.F1 = rr - Zt, t.prototype.F2 = 2 * Zt - rr;
var nr, ir, ar = "0123456789abcdefghijklmnopqrstuvwxyz", or = new Array;
for (nr = "0".charCodeAt(0), ir = 0; 9 >= ir; ++ir)
or[nr++] = ir;
for (nr = "a".charCodeAt(0), ir = 10; 36 > ir; ++ir)
or[nr++] = ir;
for (nr = "A".charCodeAt(0), ir = 10; 36 > ir; ++ir)
or[nr++] = ir;
I.prototype.convert = x, I.prototype.revert = D, I.prototype.reduce = N, I.prototype.mulTo = B, I.prototype.sqrTo = L, P.prototype.convert = O, P.prototype.revert = U, P.prototype.reduce = M, P.prototype.mulTo = j, P.prototype.sqrTo = F, t.prototype.copyTo = u, t.prototype.fromInt = l, t.prototype.fromString = p, t.prototype.clamp = f, t.prototype.dlShiftTo = b, t.prototype.drShiftTo = _, t.prototype.lShiftTo = E, t.prototype.rShiftTo = C, t.prototype.subTo = S, t.prototype.multiplyTo = A, t.prototype.squareTo = T, t.prototype.divRemTo = w, t.prototype.invDigit = R, t.prototype.isEven = V, t.prototype.exp = H, t.prototype.toString = d, t.prototype.negate = h, t.prototype.abs = g, t.prototype.compareTo = y, t.prototype.bitLength = v, t.prototype.mod = k, t.prototype.modPowInt = q, t.ZERO = c(0), t.ONE = c(1), Lt.prototype.convert = Rt, Lt.prototype.revert = Rt, Lt.prototype.mulTo = Pt, Lt.prototype.sqrTo = Ot, jt.prototype.convert = Vt, jt.prototype.revert = Ht, jt.prototype.reduce = qt, jt.prototype.mulTo = Gt, jt.prototype.sqrTo = Kt;
var sr = [2, 3, 5, 7, 11, 13, 17, 19, 23, 29, 31, 37, 41, 43, 47, 53, 59, 61, 67, 71, 73, 79, 83, 89, 97, 101, 103, 107, 109, 113, 127, 131, 137, 139, 149, 151, 157, 163, 167, 173, 179, 181, 191, 193, 197, 199, 211, 223, 227, 229, 233, 239, 241, 251, 257, 263, 269, 271, 277, 281, 283, 293, 307, 311, 313, 317, 331, 337, 347, 349, 353, 359, 367, 373, 379, 383, 389, 397, 401, 409, 419, 421, 431, 433, 439, 443, 449, 457, 461, 463, 467, 479, 487, 491, 499, 503, 509], ur = (1 << 26) / sr[sr.length - 1];
t.prototype.chunkSize = z, t.prototype.toRadix = X, t.prototype.fromRadix = $, t.prototype.fromNumber = J, t.prototype.bitwiseTo = nt, t.prototype.changeBit = _t, t.prototype.addTo = At, t.prototype.dMultiply = Nt, t.prototype.dAddOffset = Bt, t.prototype.multiplyLowerTo = Mt, t.prototype.multiplyUpperTo = Ft, t.prototype.modInt = zt, t.prototype.millerRabin = $t, t.prototype.clone = K, t.prototype.intValue = G, t.prototype.byteValue = Y, t.prototype.shortValue = W, t.prototype.signum = Q, t.prototype.toByteArray = Z, t.prototype.equals = et, t.prototype.min = tt, t.prototype.max = rt, t.prototype.and = at, t.prototype.or = st, t.prototype.xor = lt, t.prototype.andNot = pt, t.prototype.not = ft, t.prototype.shiftLeft = dt, t.prototype.shiftRight = ht, t.prototype.getLowestSetBit = yt, t.prototype.bitCount = vt, t.prototype.testBit = bt, t.prototype.setBit = Et, t.prototype.clearBit = Ct, t.prototype.flipBit = St, t.prototype.add = Tt, t.prototype.subtract = wt, t.prototype.multiply = kt, t.prototype.divide = It, t.prototype.remainder = xt, t.prototype.divideAndRemainder = Dt, t.prototype.modPow = Yt, t.prototype.modInverse = Qt, t.prototype.pow = Ut, t.prototype.gcd = Wt, t.prototype.isProbablePrime = Xt, e.jsbn = e.jsbn || {}, e.jsbn.BigInteger = t
}
var t = "jsbn";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/jsbn", ["require", "module"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(t, r, n) {
n || (n = e.md.sha1.create());
for (var i = "", a = Math.ceil(r / n.digestLength), o = 0; a > o; ++o) {
var s = String.fromCharCode(o >> 24 & 255, o >> 16 & 255, o >> 8 & 255, 255 & o);
n.start(), n.update(t + s), i += n.digest().getBytes()
}
return i.substring(0, r)
}
var r = e.pkcs1 = e.pkcs1 || {};
r.encode_rsa_oaep = function(r, n, i) {
var a, o, s, u;
"string" == typeof i ? (a = i, o = arguments[3] || void 0, s = arguments[4] || void 0) : i && (a = i.label || void 0, o = i.seed || void 0, s = i.md || void 0, i.mgf1 && i.mgf1.md && (u = i.mgf1.md)), s ? s.start() : s = e.md.sha1.create(), u || (u = s);
var l = Math.ceil(r.n.bitLength() / 8), c = l - 2 * s.digestLength - 2;
if (n.length > c) {
var p = new Error("RSAES-OAEP input message length is too long.");
throw p.length = n.length, p.maxLength = c, p
}
a || (a = ""), s.update(a, "raw");
for (var f = s.digest(), d = "", h = c - n.length, g = 0; h > g; g++)
d += "\x00";
var y = f.getBytes() + d + "" + n;
if (o) {
if (o.length !== s.digestLength) {
var p = new Error("Invalid RSAES-OAEP seed. The seed length must match the digest length.");
throw p.seedLength = o.length, p.digestLength = s.digestLength, p
}
} else
o = e.random.getBytes(s.digestLength);
var m = t(o, l - s.digestLength - 1, u), v = e.util.xorBytes(y, m, y.length), b = t(v, s.digestLength, u), _ = e.util.xorBytes(o, b, o.length);
return "\x00" + _ + v
}, r.decode_rsa_oaep = function(r, n, i) {
var a, o, s;
"string" == typeof i ? (a = i, o = arguments[3] || void 0) : i && (a = i.label || void 0, o = i.md || void 0, i.mgf1 && i.mgf1.md && (s = i.mgf1.md));
var u = Math.ceil(r.n.bitLength() / 8);
if (n.length !== u) {
var l = new Error("RSAES-OAEP encoded message length is invalid.");
throw l.length = n.length, l.expectedLength = u, l
}
if (void 0 === o ? o = e.md.sha1.create() : o.start(), s || (s = o), u < 2 * o.digestLength + 2)
throw new Error("RSAES-OAEP key is too short for the hash function.");
a || (a = ""), o.update(a, "raw");
for (var c = o.digest().getBytes(), p = n.charAt(0), f = n.substring(1, o.digestLength + 1), d = n.substring(1 + o.digestLength), h = t(d, o.digestLength, s), g = e.util.xorBytes(f, h, f.length), y = t(g, u - o.digestLength - 1, s), m = e.util.xorBytes(d, y, d.length), v = m.substring(0, o.digestLength), l = "\x00" !== p, b = 0; b < o.digestLength; ++b)
l |= c.charAt(b) !== v.charAt(b);
for (var _ = 1, E = o.digestLength, C = o.digestLength; C < m.length; C++) {
var S = m.charCodeAt(C), A = 1 & S ^ 1, T = _ ? 65534 : 0;
l |= S & T, _ &= A, E += _
}
if (l || 1 !== m.charCodeAt(E))
throw new Error("Invalid RSAES-OAEP padding.");
return m.substring(E + 1)
}
}
var t = "pkcs1";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pkcs1", ["require", "module", "./util", "./random", "./sha1"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(e, t, i, a) {
return "workers" in i ? n(e, t, i, a) : r(e, t, i, a)
}
function r(t, n, o, s) {
var l = i(t, n), c = 0, p = a(l.bitLength());
"millerRabinTests" in o && (p = o.millerRabinTests);
var f = 10;
"maxBlockTime" in o && (f = o.maxBlockTime);
var d = +new Date;
do {
if (l.bitLength() > t && (l = i(t, n)), l.isProbablePrime(p))
return s(null, l);
l.dAddOffset(u[c++ % 8], 0)
} while (0 > f || +new Date - d < f);
e.util.setImmediate(function() {
r(t, n, o, s)
})
}
function n(t, n, a, o) {
function u() {
function e(e) {
if (!h) {
--u;
var a = e.data;
if (a.found) {
for (var c = 0; c < r.length; ++c)
r[c].terminate();
return h = !0, o(null, new s(a.prime, 16))
}
l.bitLength() > t && (l = i(t, n));
var d = l.toString(16);
e.target.postMessage({hex: d,workLoad: p}), l.dAddOffset(f, 0)
}
}
c = Math.max(1, c);
for (var r = [], a = 0; c > a; ++a)
r[a] = new Worker(d);
for (var u = c, a = 0; c > a; ++a)
r[a].addEventListener("message", e);
var h = !1
}
if ("undefined" == typeof Worker)
return r(t, n, a, o);
var l = i(t, n), c = a.workers, p = a.workLoad || 100, f = 30 * p / 8, d = a.workerScript || "forge/prime.worker.js";
return -1 === c ? e.util.estimateCores(function(e, t) {
e && (t = 2), c = t - 1, u()
}) : void u()
}
function i(e, t) {
var r = new s(e, t), n = e - 1;
return r.testBit(n) || r.bitwiseTo(s.ONE.shiftLeft(n), c, r), r.dAddOffset(31 - r.mod(l).byteValue(), 0), r
}
function a(e) {
return 100 >= e ? 27 : 150 >= e ? 18 : 200 >= e ? 15 : 250 >= e ? 12 : 300 >= e ? 9 : 350 >= e ? 8 : 400 >= e ? 7 : 500 >= e ? 6 : 600 >= e ? 5 : 800 >= e ? 4 : 1250 >= e ? 3 : 2
}
if (!e.prime) {
var o = e.prime = e.prime || {}, s = e.jsbn.BigInteger, u = [6, 4, 2, 4, 2, 4, 6, 2], l = new s(null);
l.fromInt(30);
var c = function(e, t) {
return e | t
};
o.generateProbablePrime = function(r, n, i) {
"function" == typeof n && (i = n, n = {}), n = n || {};
var a = n.algorithm || "PRIMEINC";
"string" == typeof a && (a = {name: a}), a.options = a.options || {};
var o = n.prng || e.random, s = {nextBytes: function(e) {
for (var t = o.getBytesSync(e.length), r = 0; r < e.length; ++r)
e[r] = t.charCodeAt(r)
}};
if ("PRIMEINC" === a.name)
return t(r, s, a.options, i);
throw new Error("Invalid prime generation algorithm: " + a.name)
}
}
}
var t = "prime";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/prime", ["require", "module", "./util", "./jsbn", "./random"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(t, r, n) {
var i = e.util.createBuffer(), a = Math.ceil(r.n.bitLength() / 8);
if (t.length > a - 11) {
var o = new Error("Message is too long for PKCS#1 v1.5 padding.");
throw o.length = t.length, o.max = a - 11, o
}
i.putByte(0), i.putByte(n);
var s, u = a - 3 - t.length;
if (0 === n || 1 === n) {
s = 0 === n ? 0 : 255;
for (var l = 0; u > l; ++l)
i.putByte(s)
} else
for (; u > 0; ) {
for (var c = 0, p = e.random.getBytes(u), l = 0; u > l; ++l)
s = p.charCodeAt(l), 0 === s ? ++c : i.putByte(s);
u = c
}
return i.putByte(0), i.putBytes(t), i
}
function r(t, r, n, i) {
var a = Math.ceil(r.n.bitLength() / 8), o = e.util.createBuffer(t), s = o.getByte(), u = o.getByte();
if (0 !== s || n && 0 !== u && 1 !== u || !n && 2 != u || n && 0 === u && "undefined" == typeof i)
throw new Error("Encryption block is invalid.");
var l = 0;
if (0 === u) {
l = a - 3 - i;
for (var c = 0; l > c; ++c)
if (0 !== o.getByte())
throw new Error("Encryption block is invalid.")
} else if (1 === u)
for (l = 0; o.length() > 1; ) {
if (255 !== o.getByte()) {
--o.read;
break
}
++l
}
else if (2 === u)
for (l = 0; o.length() > 1; ) {
if (0 === o.getByte()) {
--o.read;
break
}
++l
}
var p = o.getByte();
if (0 !== p || l !== a - 3 - o.length())
throw new Error("Encryption block is invalid.");
return o.getBytes()
}
function n(t, r, n) {
function i() {
a(t.pBits, function(e, r) {
return e ? n(e) : (t.p = r, null !== t.q ? s(e, t.q) : void a(t.qBits, s))
})
}
function a(t, r) {
e.prime.generateProbablePrime(t, l, r)
}
function s(e, r) {
if (e)
return n(e);
if (t.q = r, t.p.compareTo(t.q) < 0) {
var l = t.p;
t.p = t.q, t.q = l
}
if (0 !== t.p.subtract(o.ONE).gcd(t.e).compareTo(o.ONE))
return t.p = null, void i();
if (0 !== t.q.subtract(o.ONE).gcd(t.e).compareTo(o.ONE))
return t.q = null, void a(t.qBits, s);
if (t.p1 = t.p.subtract(o.ONE), t.q1 = t.q.subtract(o.ONE), t.phi = t.p1.multiply(t.q1), 0 !== t.phi.gcd(t.e).compareTo(o.ONE))
return t.p = t.q = null, void i();
if (t.n = t.p.multiply(t.q), t.n.bitLength() !== t.bits)
return t.q = null, void a(t.qBits, s);
var c = t.e.modInverse(t.phi);
t.keys = {privateKey: u.rsa.setPrivateKey(t.n, t.e, c, t.p, t.q, c.mod(t.p1), c.mod(t.q1), t.q.modInverse(t.p)),publicKey: u.rsa.setPublicKey(t.n, t.e)}, n(null, t.keys)
}
"function" == typeof r && (n = r, r = {}), r = r || {};
var l = {algorithm: {name: r.algorithm || "PRIMEINC",options: {workers: r.workers || 2,workLoad: r.workLoad || 100,workerScript: r.workerScript}}};
"prng" in r && (l.prng = r.prng), i()
}
function i(t) {
var r = t.toString(16);
return r[0] >= "8" && (r = "00" + r), e.util.hexToBytes(r)
}
function a(e) {
return 100 >= e ? 27 : 150 >= e ? 18 : 200 >= e ? 15 : 250 >= e ? 12 : 300 >= e ? 9 : 350 >= e ? 8 : 400 >= e ? 7 : 500 >= e ? 6 : 600 >= e ? 5 : 800 >= e ? 4 : 1250 >= e ? 3 : 2
}
if ("undefined" == typeof o)
var o = e.jsbn.BigInteger;
var s = e.asn1;
e.pki = e.pki || {}, e.pki.rsa = e.rsa = e.rsa || {};
var u = e.pki, l = [6, 4, 2, 4, 2, 4, 6, 2], c = {name: "PrivateKeyInfo",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "PrivateKeyInfo.version",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyVersion"}, {name: "PrivateKeyInfo.privateKeyAlgorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "AlgorithmIdentifier.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "privateKeyOid"}]}, {name: "PrivateKeyInfo",tagClass: s.Class.UNIVERSAL,type: s.Type.OCTETSTRING,constructed: !1,capture: "privateKey"}]}, p = {name: "RSAPrivateKey",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "RSAPrivateKey.version",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyVersion"}, {name: "RSAPrivateKey.modulus",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyModulus"}, {name: "RSAPrivateKey.publicExponent",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyPublicExponent"}, {name: "RSAPrivateKey.privateExponent",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyPrivateExponent"}, {name: "RSAPrivateKey.prime1",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyPrime1"}, {name: "RSAPrivateKey.prime2",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyPrime2"}, {name: "RSAPrivateKey.exponent1",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyExponent1"}, {name: "RSAPrivateKey.exponent2",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyExponent2"}, {name: "RSAPrivateKey.coefficient",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "privateKeyCoefficient"}]}, f = {name: "RSAPublicKey",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "RSAPublicKey.modulus",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "publicKeyModulus"}, {name: "RSAPublicKey.exponent",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "publicKeyExponent"}]}, d = e.pki.rsa.publicKeyValidator = {name: "SubjectPublicKeyInfo",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "subjectPublicKeyInfo",value: [{name: "SubjectPublicKeyInfo.AlgorithmIdentifier",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "AlgorithmIdentifier.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "publicKeyOid"}]}, {name: "SubjectPublicKeyInfo.subjectPublicKey",tagClass: s.Class.UNIVERSAL,type: s.Type.BITSTRING,constructed: !1,value: [{name: "SubjectPublicKeyInfo.subjectPublicKey.RSAPublicKey",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,optional: !0,captureAsn1: "rsaPublicKey"}]}]}, h = function(e) {
var t;
if (!(e.algorithm in u.oids)) {
var r = new Error("Unknown message digest algorithm.");
throw r.algorithm = e.algorithm, r
}
t = u.oids[e.algorithm];
var n = s.oidToDer(t).getBytes(), i = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []), a = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []);
a.value.push(s.create(s.Class.UNIVERSAL, s.Type.OID, !1, n)), a.value.push(s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, ""));
var o = s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, e.digest().getBytes());
return i.value.push(a), i.value.push(o), s.toDer(i).getBytes()
}, g = function(t, r, n) {
if (n)
return t.modPow(r.e, r.n);
if (!r.p || !r.q)
return t.modPow(r.d, r.n);
r.dP || (r.dP = r.d.mod(r.p.subtract(o.ONE))), r.dQ || (r.dQ = r.d.mod(r.q.subtract(o.ONE))), r.qInv || (r.qInv = r.q.modInverse(r.p));
var i;
do
i = new o(e.util.bytesToHex(e.random.getBytes(r.n.bitLength() / 8)), 16).mod(r.n);
while (i.equals(o.ZERO));
t = t.multiply(i.modPow(r.e, r.n)).mod(r.n);
for (var a = t.mod(r.p).modPow(r.dP, r.p), s = t.mod(r.q).modPow(r.dQ, r.q); a.compareTo(s) < 0; )
a = a.add(r.p);
var u = a.subtract(s).multiply(r.qInv).mod(r.p).multiply(r.q).add(s);
return u = u.multiply(i.modInverse(r.n)).mod(r.n)
};
u.rsa.encrypt = function(r, n, i) {
var a, s = i, u = Math.ceil(n.n.bitLength() / 8);
i !== !1 && i !== !0 ? (s = 2 === i, a = t(r, n, i)) : (a = e.util.createBuffer(), a.putBytes(r));
for (var l = new o(a.toHex(), 16), c = g(l, n, s), p = c.toString(16), f = e.util.createBuffer(), d = u - Math.ceil(p.length / 2); d > 0; )
f.putByte(0), --d;
return f.putBytes(e.util.hexToBytes(p)), f.getBytes()
}, u.rsa.decrypt = function(t, n, i, a) {
var s = Math.ceil(n.n.bitLength() / 8);
if (t.length !== s) {
var u = new Error("Encrypted message length is invalid.");
throw u.length = t.length, u.expected = s, u
}
var l = new o(e.util.createBuffer(t).toHex(), 16);
if (l.compareTo(n.n) >= 0)
throw new Error("Encrypted message is invalid.");
for (var c = g(l, n, i), p = c.toString(16), f = e.util.createBuffer(), d = s - Math.ceil(p.length / 2); d > 0; )
f.putByte(0), --d;
return f.putBytes(e.util.hexToBytes(p)), a !== !1 ? r(f.getBytes(), n, i) : f.getBytes()
}, u.rsa.createKeyPairGenerationState = function(t, r, n) {
"string" == typeof t && (t = parseInt(t, 10)), t = t || 2048, n = n || {};
var i, a = n.prng || e.random, s = {nextBytes: function(e) {
for (var t = a.getBytesSync(e.length), r = 0; r < e.length; ++r)
e[r] = t.charCodeAt(r)
}}, u = n.algorithm || "PRIMEINC";
if ("PRIMEINC" !== u)
throw new Error("Invalid key generation algorithm: " + u);
return i = {algorithm: u,state: 0,bits: t,rng: s,eInt: r || 65537,e: new o(null),p: null,q: null,qBits: t >> 1,pBits: t - (t >> 1),pqState: 0,num: null,keys: null}, i.e.fromInt(i.eInt), i
}, u.rsa.stepKeyPairGenerationState = function(e, t) {
"algorithm" in e || (e.algorithm = "PRIMEINC");
var r = new o(null);
r.fromInt(30);
for (var n, i = 0, s = function(e, t) {
return e | t
}, c = +new Date, p = 0; null === e.keys && (0 >= t || t > p); ) {
if (0 === e.state) {
var f = null === e.p ? e.pBits : e.qBits, d = f - 1;
0 === e.pqState ? (e.num = new o(f, e.rng), e.num.testBit(d) || e.num.bitwiseTo(o.ONE.shiftLeft(d), s, e.num), e.num.dAddOffset(31 - e.num.mod(r).byteValue(), 0), i = 0, ++e.pqState) : 1 === e.pqState ? e.num.bitLength() > f ? e.pqState = 0 : e.num.isProbablePrime(a(e.num.bitLength())) ? ++e.pqState : e.num.dAddOffset(l[i++ % 8], 0) : 2 === e.pqState ? e.pqState = 0 === e.num.subtract(o.ONE).gcd(e.e).compareTo(o.ONE) ? 3 : 0 : 3 === e.pqState && (e.pqState = 0, null === e.p ? e.p = e.num : e.q = e.num, null !== e.p && null !== e.q && ++e.state, e.num = null)
} else if (1 === e.state)
e.p.compareTo(e.q) < 0 && (e.num = e.p, e.p = e.q, e.q = e.num), ++e.state;
else if (2 === e.state)
e.p1 = e.p.subtract(o.ONE), e.q1 = e.q.subtract(o.ONE), e.phi = e.p1.multiply(e.q1), ++e.state;
else if (3 === e.state)
0 === e.phi.gcd(e.e).compareTo(o.ONE) ? ++e.state : (e.p = null, e.q = null, e.state = 0);
else if (4 === e.state)
e.n = e.p.multiply(e.q), e.n.bitLength() === e.bits ? ++e.state : (e.q = null, e.state = 0);
else if (5 === e.state) {
var h = e.e.modInverse(e.phi);
e.keys = {privateKey: u.rsa.setPrivateKey(e.n, e.e, h, e.p, e.q, h.mod(e.p1), h.mod(e.q1), e.q.modInverse(e.p)),publicKey: u.rsa.setPublicKey(e.n, e.e)}
}
n = +new Date, p += n - c, c = n
}
return null !== e.keys
}, u.rsa.generateKeyPair = function(e, t, r, i) {
1 === arguments.length ? "object" == typeof e ? (r = e, e = void 0) : "function" == typeof e && (i = e, e = void 0) : 2 === arguments.length ? "number" == typeof e ? "function" == typeof t ? (i = t, t = void 0) : "number" != typeof t && (r = t, t = void 0) : (r = e, i = t, e = void 0, t = void 0) : 3 === arguments.length && ("number" == typeof t ? "function" == typeof r && (i = r, r = void 0) : (i = r, r = t, t = void 0)), r = r || {}, void 0 === e && (e = r.bits || 2048), void 0 === t && (t = r.e || 65537);
var a = u.rsa.createKeyPairGenerationState(e, t, r);
return i ? void n(a, r, i) : (u.rsa.stepKeyPairGenerationState(a, 0), a.keys)
}, u.setRsaPublicKey = u.rsa.setPublicKey = function(n, i) {
var a = {n: n,e: i};
return a.encrypt = function(r, n, i) {
if ("string" == typeof n ? n = n.toUpperCase() : void 0 === n && (n = "RSAES-PKCS1-V1_5"), "RSAES-PKCS1-V1_5" === n)
n = {encode: function(e, r) {
return t(e, r, 2).getBytes()
}};
else if ("RSA-OAEP" === n || "RSAES-OAEP" === n)
n = {encode: function(t, r) {
return e.pkcs1.encode_rsa_oaep(r, t, i)
}};
else if (-1 !== ["RAW", "NONE", "NULL", null].indexOf(n))
n = {encode: function(e) {
return e
}};
else if ("string" == typeof n)
throw new Error('Unsupported encryption scheme: "' + n + '".');
var o = n.encode(r, a, !0);
return u.rsa.encrypt(o, a, !0)
}, a.verify = function(e, t, n) {
"string" == typeof n ? n = n.toUpperCase() : void 0 === n && (n = "RSASSA-PKCS1-V1_5"), "RSASSA-PKCS1-V1_5" === n ? n = {verify: function(e, t) {
t = r(t, a, !0);
var n = s.fromDer(t);
return e === n.value[1].value
}} : ("NONE" === n || "NULL" === n || null === n) && (n = {verify: function(e, t) {
return t = r(t, a, !0), e === t
}});
var i = u.rsa.decrypt(t, a, !0, !1);
return n.verify(e, i, a.n.bitLength())
}, a
}, u.setRsaPrivateKey = u.rsa.setPrivateKey = function(t, n, i, a, o, s, l, c) {
var p = {n: t,e: n,d: i,p: a,q: o,dP: s,dQ: l,qInv: c};
return p.decrypt = function(t, n, i) {
"string" == typeof n ? n = n.toUpperCase() : void 0 === n && (n = "RSAES-PKCS1-V1_5");
var a = u.rsa.decrypt(t, p, !1, !1);
if ("RSAES-PKCS1-V1_5" === n)
n = {decode: r};
else if ("RSA-OAEP" === n || "RSAES-OAEP" === n)
n = {decode: function(t, r) {
return e.pkcs1.decode_rsa_oaep(r, t, i)
}};
else {
if (-1 === ["RAW", "NONE", "NULL", null].indexOf(n))
throw new Error('Unsupported encryption scheme: "' + n + '".');
n = {decode: function(e) {
return e
}}
}
return n.decode(a, p, !1)
}, p.sign = function(e, t) {
var r = !1;
"string" == typeof t && (t = t.toUpperCase()), void 0 === t || "RSASSA-PKCS1-V1_5" === t ? (t = {encode: h}, r = 1) : ("NONE" === t || "NULL" === t || null === t) && (t = {encode: function() {
return e
}}, r = 1);
var n = t.encode(e, p.n.bitLength());
return u.rsa.encrypt(n, p, r)
}, p
}, u.wrapRsaPrivateKey = function(e) {
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(0).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.rsaEncryption).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")]), s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, s.toDer(e).getBytes())])
}, u.privateKeyFromAsn1 = function(t) {
var r = {}, n = [];
if (s.validate(t, c, r, n) && (t = s.fromDer(e.util.createBuffer(r.privateKey))), r = {}, n = [], !s.validate(t, p, r, n)) {
var i = new Error("Cannot read private key. ASN.1 object does not contain an RSAPrivateKey.");
throw i.errors = n, i
}
var a, l, f, d, h, g, y, m;
return a = e.util.createBuffer(r.privateKeyModulus).toHex(), l = e.util.createBuffer(r.privateKeyPublicExponent).toHex(), f = e.util.createBuffer(r.privateKeyPrivateExponent).toHex(), d = e.util.createBuffer(r.privateKeyPrime1).toHex(), h = e.util.createBuffer(r.privateKeyPrime2).toHex(), g = e.util.createBuffer(r.privateKeyExponent1).toHex(), y = e.util.createBuffer(r.privateKeyExponent2).toHex(), m = e.util.createBuffer(r.privateKeyCoefficient).toHex(), u.setRsaPrivateKey(new o(a, 16), new o(l, 16), new o(f, 16), new o(d, 16), new o(h, 16), new o(g, 16), new o(y, 16), new o(m, 16))
}, u.privateKeyToAsn1 = u.privateKeyToRSAPrivateKey = function(e) {
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(0).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.n)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.e)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.d)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.p)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.q)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.dP)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.dQ)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.qInv))])
}, u.publicKeyFromAsn1 = function(t) {
var r = {}, n = [];
if (s.validate(t, d, r, n)) {
var i = s.derToOid(r.publicKeyOid);
if (i !== u.oids.rsaEncryption) {
var a = new Error("Cannot read public key. Unknown OID.");
throw a.oid = i, a
}
t = r.rsaPublicKey
}
if (n = [], !s.validate(t, f, r, n)) {
var a = new Error("Cannot read public key. ASN.1 object does not contain an RSAPublicKey.");
throw a.errors = n, a
}
var l = e.util.createBuffer(r.publicKeyModulus).toHex(), c = e.util.createBuffer(r.publicKeyExponent).toHex();
return u.setRsaPublicKey(new o(l, 16), new o(c, 16))
}, u.publicKeyToAsn1 = u.publicKeyToSubjectPublicKeyInfo = function(e) {
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.rsaEncryption).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")]), s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, [u.publicKeyToRSAPublicKey(e)])])
}, u.publicKeyToRSAPublicKey = function(e) {
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.n)), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, i(e.e))])
}
}
var t = "rsa";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/rsa", ["require", "module", "./asn1", "./jsbn", "./oids", "./pkcs1", "./prime", "./random", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(e, t, n) {
for (var i = [r(e + t)], a = 16, o = 1; n > a; ++o, a += 16)
i.push(r(i[o - 1] + e + t));
return i.join("").substr(0, n)
}
function r(t) {
return e.md.md5.create().update(t).digest().getBytes()
}
if ("undefined" == typeof n)
var n = e.jsbn.BigInteger;
var i = e.asn1, a = e.pki = e.pki || {};
a.pbe = e.pbe = e.pbe || {};
var o = a.oids, s = {name: "EncryptedPrivateKeyInfo",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "EncryptedPrivateKeyInfo.encryptionAlgorithm",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "AlgorithmIdentifier.algorithm",tagClass: i.Class.UNIVERSAL,type: i.Type.OID,constructed: !1,capture: "encryptionOid"}, {name: "AlgorithmIdentifier.parameters",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,captureAsn1: "encryptionParams"}]}, {name: "EncryptedPrivateKeyInfo.encryptedData",tagClass: i.Class.UNIVERSAL,type: i.Type.OCTETSTRING,constructed: !1,capture: "encryptedData"}]}, u = {name: "PBES2Algorithms",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "PBES2Algorithms.keyDerivationFunc",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "PBES2Algorithms.keyDerivationFunc.oid",tagClass: i.Class.UNIVERSAL,type: i.Type.OID,constructed: !1,capture: "kdfOid"}, {name: "PBES2Algorithms.params",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "PBES2Algorithms.params.salt",tagClass: i.Class.UNIVERSAL,type: i.Type.OCTETSTRING,constructed: !1,capture: "kdfSalt"}, {name: "PBES2Algorithms.params.iterationCount",tagClass: i.Class.UNIVERSAL,type: i.Type.INTEGER,onstructed: !0,capture: "kdfIterationCount"}]}]}, {name: "PBES2Algorithms.encryptionScheme",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "PBES2Algorithms.encryptionScheme.oid",tagClass: i.Class.UNIVERSAL,type: i.Type.OID,constructed: !1,capture: "encOid"}, {name: "PBES2Algorithms.encryptionScheme.iv",tagClass: i.Class.UNIVERSAL,type: i.Type.OCTETSTRING,constructed: !1,capture: "encIv"}]}]}, l = {name: "pkcs-12PbeParams",tagClass: i.Class.UNIVERSAL,type: i.Type.SEQUENCE,constructed: !0,value: [{name: "pkcs-12PbeParams.salt",tagClass: i.Class.UNIVERSAL,type: i.Type.OCTETSTRING,constructed: !1,capture: "salt"}, {name: "pkcs-12PbeParams.iterations",tagClass: i.Class.UNIVERSAL,type: i.Type.INTEGER,constructed: !1,capture: "iterations"}]};
a.encryptPrivateKeyInfo = function(t, r, n) {
n = n || {}, n.saltSize = n.saltSize || 8, n.count = n.count || 2048, n.algorithm = n.algorithm || "aes128";
var s, u, l, c = e.random.getBytesSync(n.saltSize), p = n.count, f = i.integerToDer(p);
if (0 === n.algorithm.indexOf("aes") || "des" === n.algorithm) {
var d, h, g;
switch (n.algorithm) {
case "aes128":
s = 16, d = 16, h = o["aes128-CBC"], g = e.aes.createEncryptionCipher;
break;
case "aes192":
s = 24, d = 16, h = o["aes192-CBC"], g = e.aes.createEncryptionCipher;
break;
case "aes256":
s = 32, d = 16, h = o["aes256-CBC"], g = e.aes.createEncryptionCipher;
break;
case "des":
s = 8, d = 8, h = o.desCBC, g = e.des.createEncryptionCipher;
break;
default:
var y = new Error("Cannot encrypt private key. Unknown encryption algorithm.");
throw y.algorithm = n.algorithm, y
}
var m = e.pkcs5.pbkdf2(r, c, p, s), v = e.random.getBytesSync(d), b = g(m);
b.start(v), b.update(i.toDer(t)), b.finish(), l = b.output.getBytes(), u = i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.OID, !1, i.oidToDer(o.pkcs5PBES2).getBytes()), i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.OID, !1, i.oidToDer(o.pkcs5PBKDF2).getBytes()), i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.OCTETSTRING, !1, c), i.create(i.Class.UNIVERSAL, i.Type.INTEGER, !1, f.getBytes())])]), i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.OID, !1, i.oidToDer(h).getBytes()), i.create(i.Class.UNIVERSAL, i.Type.OCTETSTRING, !1, v)])])])
} else {
if ("3des" !== n.algorithm) {
var y = new Error("Cannot encrypt private key. Unknown encryption algorithm.");
throw y.algorithm = n.algorithm, y
}
s = 24;
var _ = new e.util.ByteBuffer(c), m = a.pbe.generatePkcs12Key(r, _, 1, p, s), v = a.pbe.generatePkcs12Key(r, _, 2, p, s), b = e.des.createEncryptionCipher(m);
b.start(v), b.update(i.toDer(t)), b.finish(), l = b.output.getBytes(), u = i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.OID, !1, i.oidToDer(o["pbeWithSHAAnd3-KeyTripleDES-CBC"]).getBytes()), i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [i.create(i.Class.UNIVERSAL, i.Type.OCTETSTRING, !1, c), i.create(i.Class.UNIVERSAL, i.Type.INTEGER, !1, f.getBytes())])])
}
var E = i.create(i.Class.UNIVERSAL, i.Type.SEQUENCE, !0, [u, i.create(i.Class.UNIVERSAL, i.Type.OCTETSTRING, !1, l)]);
return E
}, a.decryptPrivateKeyInfo = function(t, r) {
var n = null, o = {}, u = [];
if (!i.validate(t, s, o, u)) {
var l = new Error("Cannot read encrypted private key. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");
throw l.errors = u, l
}
var c = i.derToOid(o.encryptionOid), p = a.pbe.getCipher(c, o.encryptionParams, r), f = e.util.createBuffer(o.encryptedData);
return p.update(f), p.finish() && (n = i.fromDer(p.output)), n
}, a.encryptedPrivateKeyToPem = function(t, r) {
var n = {type: "ENCRYPTED PRIVATE KEY",body: i.toDer(t).getBytes()};
return e.pem.encode(n, {maxline: r})
}, a.encryptedPrivateKeyFromPem = function(t) {
var r = e.pem.decode(t)[0];
if ("ENCRYPTED PRIVATE KEY" !== r.type) {
var n = new Error('Could not convert encrypted private key from PEM; PEM header type is "ENCRYPTED PRIVATE KEY".');
throw n.headerType = r.type, n
}
if (r.procType && "ENCRYPTED" === r.procType.type)
throw new Error("Could not convert encrypted private key from PEM; PEM is encrypted.");
return i.fromDer(r.body)
}, a.encryptRsaPrivateKey = function(r, n, o) {
if (o = o || {}, !o.legacy) {
var s = a.wrapRsaPrivateKey(a.privateKeyToAsn1(r));
return s = a.encryptPrivateKeyInfo(s, n, o), a.encryptedPrivateKeyToPem(s)
}
var u, l, c, p;
switch (o.algorithm) {
case "aes128":
u = "AES-128-CBC", c = 16, l = e.random.getBytesSync(16), p = e.aes.createEncryptionCipher;
break;
case "aes192":
u = "AES-192-CBC", c = 24, l = e.random.getBytesSync(16), p = e.aes.createEncryptionCipher;
break;
case "aes256":
u = "AES-256-CBC", c = 32, l = e.random.getBytesSync(16), p = e.aes.createEncryptionCipher;
break;
case "3des":
u = "DES-EDE3-CBC", c = 24, l = e.random.getBytesSync(8), p = e.des.createEncryptionCipher;
break;
case "des":
u = "DES-CBC", c = 8, l = e.random.getBytesSync(8), p = e.des.createEncryptionCipher;
break;
default:
var f = new Error('Could not encrypt RSA private key; unsupported encryption algorithm "' + o.algorithm + '".');
throw f.algorithm = o.algorithm, f
}
var d = t(n, l.substr(0, 8), c), h = p(d);
h.start(l), h.update(i.toDer(a.privateKeyToAsn1(r))), h.finish();
var g = {type: "RSA PRIVATE KEY",procType: {version: "4",type: "ENCRYPTED"},dekInfo: {algorithm: u,parameters: e.util.bytesToHex(l).toUpperCase()},body: h.output.getBytes()};
return e.pem.encode(g)
}, a.decryptRsaPrivateKey = function(r, n) {
var o = null, s = e.pem.decode(r)[0];
if ("ENCRYPTED PRIVATE KEY" !== s.type && "PRIVATE KEY" !== s.type && "RSA PRIVATE KEY" !== s.type) {
var u = new Error('Could not convert private key from PEM; PEM header type is not "ENCRYPTED PRIVATE KEY", "PRIVATE KEY", or "RSA PRIVATE KEY".');
throw u.headerType = u, u
}
if (s.procType && "ENCRYPTED" === s.procType.type) {
var l, c;
switch (s.dekInfo.algorithm) {
case "DES-CBC":
l = 8, c = e.des.createDecryptionCipher;
break;
case "DES-EDE3-CBC":
l = 24, c = e.des.createDecryptionCipher;
break;
case "AES-128-CBC":
l = 16, c = e.aes.createDecryptionCipher;
break;
case "AES-192-CBC":
l = 24, c = e.aes.createDecryptionCipher;
break;
case "AES-256-CBC":
l = 32, c = e.aes.createDecryptionCipher;
break;
case "RC2-40-CBC":
l = 5, c = function(t) {
return e.rc2.createDecryptionCipher(t, 40)
};
break;
case "RC2-64-CBC":
l = 8, c = function(t) {
return e.rc2.createDecryptionCipher(t, 64)
};
break;
case "RC2-128-CBC":
l = 16, c = function(t) {
return e.rc2.createDecryptionCipher(t, 128)
};
break;
default:
var u = new Error('Could not decrypt private key; unsupported encryption algorithm "' + s.dekInfo.algorithm + '".');
throw u.algorithm = s.dekInfo.algorithm, u
}
var p = e.util.hexToBytes(s.dekInfo.parameters), f = t(n, p.substr(0, 8), l), d = c(f);
if (d.start(p), d.update(e.util.createBuffer(s.body)), !d.finish())
return o;
o = d.output.getBytes()
} else
o = s.body;
return o = "ENCRYPTED PRIVATE KEY" === s.type ? a.decryptPrivateKeyInfo(i.fromDer(o), n) : i.fromDer(o), null !== o && (o = a.privateKeyFromAsn1(o)), o
}, a.pbe.generatePkcs12Key = function(t, r, n, i, a, o) {
var s, u;
("undefined" == typeof o || null === o) && (o = e.md.sha1.create());
var l = o.digestLength, c = o.blockLength, p = new e.util.ByteBuffer, f = new e.util.ByteBuffer;
if (null !== t && void 0 !== t) {
for (u = 0; u < t.length; u++)
f.putInt16(t.charCodeAt(u));
f.putInt16(0)
}
var d = f.length(), h = r.length(), g = new e.util.ByteBuffer;
g.fillWithByte(n, c);
var y = c * Math.ceil(h / c), m = new e.util.ByteBuffer;
for (u = 0; y > u; u++)
m.putByte(r.at(u % h));
var v = c * Math.ceil(d / c), b = new e.util.ByteBuffer;
for (u = 0; v > u; u++)
b.putByte(f.at(u % d));
var _ = m;
_.putBuffer(b);
for (var E = Math.ceil(a / l), C = 1; E >= C; C++) {
var S = new e.util.ByteBuffer;
S.putBytes(g.bytes()), S.putBytes(_.bytes());
for (var A = 0; i > A; A++)
o.start(), o.update(S.getBytes()), S = o.digest();
var T = new e.util.ByteBuffer;
for (u = 0; c > u; u++)
T.putByte(S.at(u % l));
var w = Math.ceil(h / c) + Math.ceil(d / c), k = new e.util.ByteBuffer;
for (s = 0; w > s; s++) {
var I = new e.util.ByteBuffer(_.getBytes(c)), x = 511;
for (u = T.length() - 1; u >= 0; u--)
x >>= 8, x += T.at(u) + I.at(u), I.setAt(u, 255 & x);
k.putBuffer(I)
}
_ = k, p.putBuffer(S)
}
return p.truncate(p.length() - a), p
}, a.pbe.getCipher = function(e, t, r) {
switch (e) {
case a.oids.pkcs5PBES2:
return a.pbe.getCipherForPBES2(e, t, r);
case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:
case a.oids["pbewithSHAAnd40BitRC2-CBC"]:
return a.pbe.getCipherForPKCS12PBE(e, t, r);
default:
var n = new Error("Cannot read encrypted PBE data block. Unsupported OID.");
throw n.oid = e, n.supportedOids = ["pkcs5PBES2", "pbeWithSHAAnd3-KeyTripleDES-CBC", "pbewithSHAAnd40BitRC2-CBC"], n
}
}, a.pbe.getCipherForPBES2 = function(t, r, n) {
var o = {}, s = [];
if (!i.validate(r, u, o, s)) {
var l = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");
throw l.errors = s, l
}
if (t = i.derToOid(o.kdfOid), t !== a.oids.pkcs5PBKDF2) {
var l = new Error("Cannot read encrypted private key. Unsupported key derivation function OID.");
throw l.oid = t, l.supportedOids = ["pkcs5PBKDF2"], l
}
if (t = i.derToOid(o.encOid), t !== a.oids["aes128-CBC"] && t !== a.oids["aes192-CBC"] && t !== a.oids["aes256-CBC"] && t !== a.oids["des-EDE3-CBC"] && t !== a.oids.desCBC) {
var l = new Error("Cannot read encrypted private key. Unsupported encryption scheme OID.");
throw l.oid = t, l.supportedOids = ["aes128-CBC", "aes192-CBC", "aes256-CBC", "des-EDE3-CBC", "desCBC"], l
}
var c = o.kdfSalt, p = e.util.createBuffer(o.kdfIterationCount);
p = p.getInt(p.length() << 3);
var f, d;
switch (a.oids[t]) {
case "aes128-CBC":
f = 16, d = e.aes.createDecryptionCipher;
break;
case "aes192-CBC":
f = 24, d = e.aes.createDecryptionCipher;
break;
case "aes256-CBC":
f = 32, d = e.aes.createDecryptionCipher;
break;
case "des-EDE3-CBC":
f = 24, d = e.des.createDecryptionCipher;
break;
case "desCBC":
f = 8, d = e.des.createDecryptionCipher
}
var h = e.pkcs5.pbkdf2(n, c, p, f), g = o.encIv, y = d(h);
return y.start(g), y
}, a.pbe.getCipherForPKCS12PBE = function(t, r, n) {
var o = {}, s = [];
if (!i.validate(r, l, o, s)) {
var u = new Error("Cannot read password-based-encryption algorithm parameters. ASN.1 object is not a supported EncryptedPrivateKeyInfo.");
throw u.errors = s, u
}
var c = e.util.createBuffer(o.salt), p = e.util.createBuffer(o.iterations);
p = p.getInt(p.length() << 3);
var f, d, h;
switch (t) {
case a.oids["pbeWithSHAAnd3-KeyTripleDES-CBC"]:
f = 24, d = 8, h = e.des.startDecrypting;
break;
case a.oids["pbewithSHAAnd40BitRC2-CBC"]:
f = 5, d = 8, h = function(t, r) {
var n = e.rc2.createDecryptionCipher(t, 40);
return n.start(r, null), n
};
break;
default:
var u = new Error("Cannot read PKCS #12 PBE data block. Unsupported OID.");
throw u.oid = t, u
}
var g = a.pbe.generatePkcs12Key(n, c, 1, p, f), y = a.pbe.generatePkcs12Key(n, c, 2, p, d);
return h(g, y)
}
}
var t = "pbe";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pbe", ["require", "module", "./aes", "./asn1", "./des", "./md", "./oids", "./pem", "./pbkdf2", "./random", "./rc2", "./rsa", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = e.asn1, r = e.pkcs7asn1 = e.pkcs7asn1 || {};
e.pkcs7 = e.pkcs7 || {}, e.pkcs7.asn1 = r;
var n = {name: "ContentInfo",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "ContentInfo.ContentType",tagClass: t.Class.UNIVERSAL,type: t.Type.OID,constructed: !1,capture: "contentType"}, {name: "ContentInfo.content",tagClass: t.Class.CONTEXT_SPECIFIC,type: 0,constructed: !0,optional: !0,captureAsn1: "content"}]};
r.contentInfoValidator = n;
var i = {name: "EncryptedContentInfo",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "EncryptedContentInfo.contentType",tagClass: t.Class.UNIVERSAL,type: t.Type.OID,constructed: !1,capture: "contentType"}, {name: "EncryptedContentInfo.contentEncryptionAlgorithm",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "EncryptedContentInfo.contentEncryptionAlgorithm.algorithm",tagClass: t.Class.UNIVERSAL,type: t.Type.OID,constructed: !1,capture: "encAlgorithm"}, {name: "EncryptedContentInfo.contentEncryptionAlgorithm.parameter",tagClass: t.Class.UNIVERSAL,captureAsn1: "encParameter"}]}, {name: "EncryptedContentInfo.encryptedContent",tagClass: t.Class.CONTEXT_SPECIFIC,type: 0,capture: "encryptedContent",captureAsn1: "encryptedContentAsn1"}]};
r.envelopedDataValidator = {name: "EnvelopedData",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "EnvelopedData.Version",tagClass: t.Class.UNIVERSAL,type: t.Type.INTEGER,constructed: !1,capture: "version"}, {name: "EnvelopedData.RecipientInfos",tagClass: t.Class.UNIVERSAL,type: t.Type.SET,constructed: !0,captureAsn1: "recipientInfos"}].concat(i)}, r.encryptedDataValidator = {name: "EncryptedData",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "EncryptedData.Version",tagClass: t.Class.UNIVERSAL,type: t.Type.INTEGER,constructed: !1,capture: "version"}].concat(i)};
var a = {name: "SignerInfo",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "SignerInfo.Version",tagClass: t.Class.UNIVERSAL,type: t.Type.INTEGER,constructed: !1}, {name: "SignerInfo.IssuerAndSerialNumber",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0}, {name: "SignerInfo.DigestAlgorithm",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0}, {name: "SignerInfo.AuthenticatedAttributes",tagClass: t.Class.CONTEXT_SPECIFIC,type: 0,constructed: !0,optional: !0,capture: "authenticatedAttributes"}, {name: "SignerInfo.DigestEncryptionAlgorithm",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0}, {name: "SignerInfo.EncryptedDigest",tagClass: t.Class.UNIVERSAL,type: t.Type.OCTETSTRING,constructed: !1,capture: "signature"}, {name: "SignerInfo.UnauthenticatedAttributes",tagClass: t.Class.CONTEXT_SPECIFIC,type: 1,constructed: !0,optional: !0}]};
r.signedDataValidator = {name: "SignedData",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "SignedData.Version",tagClass: t.Class.UNIVERSAL,type: t.Type.INTEGER,constructed: !1,capture: "version"}, {name: "SignedData.DigestAlgorithms",tagClass: t.Class.UNIVERSAL,type: t.Type.SET,constructed: !0,captureAsn1: "digestAlgorithms"}, n, {name: "SignedData.Certificates",tagClass: t.Class.CONTEXT_SPECIFIC,type: 0,optional: !0,captureAsn1: "certificates"}, {name: "SignedData.CertificateRevocationLists",tagClass: t.Class.CONTEXT_SPECIFIC,type: 1,optional: !0,captureAsn1: "crls"}, {name: "SignedData.SignerInfos",tagClass: t.Class.UNIVERSAL,type: t.Type.SET,capture: "signerInfos",optional: !0,value: [a]}]}, r.recipientInfoValidator = {name: "RecipientInfo",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "RecipientInfo.version",tagClass: t.Class.UNIVERSAL,type: t.Type.INTEGER,constructed: !1,capture: "version"}, {name: "RecipientInfo.issuerAndSerial",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "RecipientInfo.issuerAndSerial.issuer",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,captureAsn1: "issuer"}, {name: "RecipientInfo.issuerAndSerial.serialNumber",tagClass: t.Class.UNIVERSAL,type: t.Type.INTEGER,constructed: !1,capture: "serial"}]}, {name: "RecipientInfo.keyEncryptionAlgorithm",tagClass: t.Class.UNIVERSAL,type: t.Type.SEQUENCE,constructed: !0,value: [{name: "RecipientInfo.keyEncryptionAlgorithm.algorithm",tagClass: t.Class.UNIVERSAL,type: t.Type.OID,constructed: !1,capture: "encAlgorithm"}, {name: "RecipientInfo.keyEncryptionAlgorithm.parameter",tagClass: t.Class.UNIVERSAL,constructed: !1,captureAsn1: "encParameter"}]}, {name: "RecipientInfo.encryptedKey",tagClass: t.Class.UNIVERSAL,type: t.Type.OCTETSTRING,constructed: !1,capture: "encKey"}]}
}
var t = "pkcs7asn1";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pkcs7asn1", ["require", "module", "./asn1", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
e.mgf = e.mgf || {};
var t = e.mgf.mgf1 = e.mgf1 = e.mgf1 || {};
t.create = function(t) {
var r = {generate: function(r, n) {
for (var i = new e.util.ByteBuffer, a = Math.ceil(n / t.digestLength), o = 0; a > o; o++) {
var s = new e.util.ByteBuffer;
s.putInt32(o), t.start(), t.update(r + s.getBytes()), i.putBuffer(t.digest())
}
return i.truncate(i.length() - n), i.getBytes()
}};
return r
}
}
var t = "mgf1";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/mgf1", ["require", "module", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
e.mgf = e.mgf || {}, e.mgf.mgf1 = e.mgf1
}
var t = "mgf";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/mgf", ["require", "module", "./mgf1"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = e.pss = e.pss || {};
t.create = function(t) {
3 === arguments.length && (t = {md: arguments[0],mgf: arguments[1],saltLength: arguments[2]});
var r = t.md, n = t.mgf, i = r.digestLength, a = t.salt || null;
"string" == typeof a && (a = e.util.createBuffer(a));
var o;
if ("saltLength" in t)
o = t.saltLength;
else {
if (null === a)
throw new Error("Salt length not specified or specific salt not given.");
o = a.length()
}
if (null !== a && a.length() !== o)
throw new Error("Given salt length does not match length of given salt.");
var s = t.prng || e.random, u = {};
return u.encode = function(t, u) {
var l, c = u - 1, p = Math.ceil(c / 8), f = t.digest().getBytes();
if (i + o + 2 > p)
throw new Error("Message is too long to encrypt.");
var d;
d = null === a ? s.getBytesSync(o) : a.bytes();
var h = new e.util.ByteBuffer;
h.fillWithByte(0, 8), h.putBytes(f), h.putBytes(d), r.start(), r.update(h.getBytes());
var g = r.digest().getBytes(), y = new e.util.ByteBuffer;
y.fillWithByte(0, p - o - i - 2), y.putByte(1), y.putBytes(d);
var m = y.getBytes(), v = p - i - 1, b = n.generate(g, v), _ = "";
for (l = 0; v > l; l++)
_ += String.fromCharCode(m.charCodeAt(l) ^ b.charCodeAt(l));
var E = 65280 >> 8 * p - c & 255;
return _ = String.fromCharCode(_.charCodeAt(0) & ~E) + _.substr(1), _ + g + String.fromCharCode(188)
}, u.verify = function(t, a, s) {
var u, l = s - 1, c = Math.ceil(l / 8);
if (a = a.substr(-c), i + o + 2 > c)
throw new Error("Inconsistent parameters to PSS signature verification.");
if (188 !== a.charCodeAt(c - 1))
throw new Error("Encoded message does not end in 0xBC.");
var p = c - i - 1, f = a.substr(0, p), d = a.substr(p, i), h = 65280 >> 8 * c - l & 255;
if (0 !== (f.charCodeAt(0) & h))
throw new Error("Bits beyond keysize not zero as expected.");
var g = n.generate(d, p), y = "";
for (u = 0; p > u; u++)
y += String.fromCharCode(f.charCodeAt(u) ^ g.charCodeAt(u));
y = String.fromCharCode(y.charCodeAt(0) & ~h) + y.substr(1);
var m = c - i - o - 2;
for (u = 0; m > u; u++)
if (0 !== y.charCodeAt(u))
throw new Error("Leftmost octets not zero as expected");
if (1 !== y.charCodeAt(m))
throw new Error("Inconsistent PSS signature, 0x01 marker not found");
var v = y.substr(-o), b = new e.util.ByteBuffer;
b.fillWithByte(0, 8), b.putBytes(t), b.putBytes(v), r.start(), r.update(b.getBytes());
var _ = r.digest().getBytes();
return d === _
}, u
}
}
var t = "pss";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pss", ["require", "module", "./random", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(e, t) {
"string" == typeof t && (t = {shortName: t});
for (var r, n = null, i = 0; null === n && i < e.attributes.length; ++i)
r = e.attributes[i], t.type && t.type === r.type ? n = r : t.name && t.name === r.name ? n = r : t.shortName && t.shortName === r.shortName && (n = r);
return n
}
function r(t) {
for (var r, n, i = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []), a = t.attributes, o = 0; o < a.length; ++o) {
r = a[o];
var u = r.value, l = s.Type.PRINTABLESTRING;
"valueTagClass" in r && (l = r.valueTagClass, l === s.Type.UTF8 && (u = e.util.encodeUtf8(u))), n = s.create(s.Class.UNIVERSAL, s.Type.SET, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(r.type).getBytes()), s.create(s.Class.UNIVERSAL, l, !1, u)])]), i.value.push(n)
}
return i
}
function n(e) {
var t = s.create(s.Class.CONTEXT_SPECIFIC, 3, !0, []), r = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []);
t.value.push(r);
for (var n, i, a = 0; a < e.length; ++a) {
n = e[a], i = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []), r.value.push(i), i.value.push(s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(n.id).getBytes())), n.critical && i.value.push(s.create(s.Class.UNIVERSAL, s.Type.BOOLEAN, !1, String.fromCharCode(255)));
var o = n.value;
"string" != typeof n.value && (o = s.toDer(o).getBytes()), i.value.push(s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, o))
}
return t
}
function i(e) {
for (var t, r = 0; r < e.length; ++r) {
if (t = e[r], "undefined" == typeof t.name && (t.type && t.type in u.oids ? t.name = u.oids[t.type] : t.shortName && t.shortName in c && (t.name = u.oids[c[t.shortName]])), "undefined" == typeof t.type) {
if (!(t.name && t.name in u.oids)) {
var n = new Error("Attribute type not specified.");
throw n.attribute = t, n
}
t.type = u.oids[t.name]
}
if ("undefined" == typeof t.shortName && t.name && t.name in c && (t.shortName = c[t.name]), "undefined" == typeof t.value) {
var n = new Error("Attribute value not specified.");
throw n.attribute = t, n
}
}
}
function a(e, t) {
switch (e) {
case l["RSASSA-PSS"]:
var r = [];
return void 0 !== t.hash.algorithmOid && r.push(s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(t.hash.algorithmOid).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")])])), void 0 !== t.mgf.algorithmOid && r.push(s.create(s.Class.CONTEXT_SPECIFIC, 1, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(t.mgf.algorithmOid).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(t.mgf.hash.algorithmOid).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")])])])), void 0 !== t.saltLength && r.push(s.create(s.Class.CONTEXT_SPECIFIC, 2, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(t.saltLength).getBytes())])), s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, r);
default:
return s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")
}
}
function o(t) {
var r = s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, []);
if (0 === t.attributes.length)
return r;
for (var n = t.attributes, i = 0; i < n.length; ++i) {
var a = n[i], o = a.value, u = s.Type.UTF8;
"valueTagClass" in a && (u = a.valueTagClass), u === s.Type.UTF8 && (o = e.util.encodeUtf8(o));
var l = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(a.type).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.SET, !0, [s.create(s.Class.UNIVERSAL, u, !1, o)])]);
r.value.push(l)
}
return r
}
var s = e.asn1, u = e.pki = e.pki || {}, l = u.oids, c = {};
c.CN = l.commonName, c.commonName = "CN", c.C = l.countryName, c.countryName = "C", c.L = l.localityName, c.localityName = "L", c.ST = l.stateOrProvinceName, c.stateOrProvinceName = "ST", c.O = l.organizationName, c.organizationName = "O", c.OU = l.organizationalUnitName, c.organizationalUnitName = "OU", c.E = l.emailAddress, c.emailAddress = "E";
var p = e.pki.rsa.publicKeyValidator, f = {name: "Certificate",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "Certificate.TBSCertificate",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "tbsCertificate",value: [{name: "Certificate.TBSCertificate.version",tagClass: s.Class.CONTEXT_SPECIFIC,type: 0,constructed: !0,optional: !0,value: [{name: "Certificate.TBSCertificate.version.integer",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "certVersion"}]}, {name: "Certificate.TBSCertificate.serialNumber",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "certSerialNumber"}, {name: "Certificate.TBSCertificate.signature",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "Certificate.TBSCertificate.signature.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "certinfoSignatureOid"}, {name: "Certificate.TBSCertificate.signature.parameters",tagClass: s.Class.UNIVERSAL,optional: !0,captureAsn1: "certinfoSignatureParams"}]}, {name: "Certificate.TBSCertificate.issuer",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "certIssuer"}, {name: "Certificate.TBSCertificate.validity",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "Certificate.TBSCertificate.validity.notBefore (utc)",tagClass: s.Class.UNIVERSAL,type: s.Type.UTCTIME,constructed: !1,optional: !0,capture: "certValidity1UTCTime"}, {name: "Certificate.TBSCertificate.validity.notBefore (generalized)",tagClass: s.Class.UNIVERSAL,type: s.Type.GENERALIZEDTIME,constructed: !1,optional: !0,capture: "certValidity2GeneralizedTime"}, {name: "Certificate.TBSCertificate.validity.notAfter (utc)",tagClass: s.Class.UNIVERSAL,type: s.Type.UTCTIME,constructed: !1,optional: !0,capture: "certValidity3UTCTime"}, {name: "Certificate.TBSCertificate.validity.notAfter (generalized)",tagClass: s.Class.UNIVERSAL,type: s.Type.GENERALIZEDTIME,constructed: !1,optional: !0,capture: "certValidity4GeneralizedTime"}]}, {name: "Certificate.TBSCertificate.subject",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "certSubject"}, p, {name: "Certificate.TBSCertificate.issuerUniqueID",tagClass: s.Class.CONTEXT_SPECIFIC,type: 1,constructed: !0,optional: !0,value: [{name: "Certificate.TBSCertificate.issuerUniqueID.id",tagClass: s.Class.UNIVERSAL,type: s.Type.BITSTRING,constructed: !1,capture: "certIssuerUniqueId"}]}, {name: "Certificate.TBSCertificate.subjectUniqueID",tagClass: s.Class.CONTEXT_SPECIFIC,type: 2,constructed: !0,optional: !0,value: [{name: "Certificate.TBSCertificate.subjectUniqueID.id",tagClass: s.Class.UNIVERSAL,type: s.Type.BITSTRING,constructed: !1,capture: "certSubjectUniqueId"}]}, {name: "Certificate.TBSCertificate.extensions",tagClass: s.Class.CONTEXT_SPECIFIC,type: 3,constructed: !0,captureAsn1: "certExtensions",optional: !0}]}, {name: "Certificate.signatureAlgorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "Certificate.signatureAlgorithm.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "certSignatureOid"}, {name: "Certificate.TBSCertificate.signature.parameters",tagClass: s.Class.UNIVERSAL,optional: !0,captureAsn1: "certSignatureParams"}]}, {name: "Certificate.signatureValue",tagClass: s.Class.UNIVERSAL,type: s.Type.BITSTRING,constructed: !1,capture: "certSignature"}]}, d = {name: "rsapss",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "rsapss.hashAlgorithm",tagClass: s.Class.CONTEXT_SPECIFIC,type: 0,constructed: !0,value: [{name: "rsapss.hashAlgorithm.AlgorithmIdentifier",tagClass: s.Class.UNIVERSAL,type: s.Class.SEQUENCE,constructed: !0,optional: !0,value: [{name: "rsapss.hashAlgorithm.AlgorithmIdentifier.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "hashOid"}]}]}, {name: "rsapss.maskGenAlgorithm",tagClass: s.Class.CONTEXT_SPECIFIC,type: 1,constructed: !0,value: [{name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier",tagClass: s.Class.UNIVERSAL,type: s.Class.SEQUENCE,constructed: !0,optional: !0,value: [{name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "maskGenOid"}, {name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.params",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "rsapss.maskGenAlgorithm.AlgorithmIdentifier.params.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "maskGenHashOid"}]}]}]}, {name: "rsapss.saltLength",tagClass: s.Class.CONTEXT_SPECIFIC,type: 2,optional: !0,value: [{name: "rsapss.saltLength.saltLength",tagClass: s.Class.UNIVERSAL,type: s.Class.INTEGER,constructed: !1,capture: "saltLength"}]}, {name: "rsapss.trailerField",tagClass: s.Class.CONTEXT_SPECIFIC,type: 3,optional: !0,value: [{name: "rsapss.trailer.trailer",tagClass: s.Class.UNIVERSAL,type: s.Class.INTEGER,constructed: !1,capture: "trailer"}]}]}, h = {name: "CertificationRequestInfo",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "certificationRequestInfo",value: [{name: "CertificationRequestInfo.integer",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "certificationRequestInfoVersion"}, {name: "CertificationRequestInfo.subject",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "certificationRequestInfoSubject"}, p, {name: "CertificationRequestInfo.attributes",tagClass: s.Class.CONTEXT_SPECIFIC,type: 0,constructed: !0,optional: !0,capture: "certificationRequestInfoAttributes",value: [{name: "CertificationRequestInfo.attributes",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "CertificationRequestInfo.attributes.type",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1}, {name: "CertificationRequestInfo.attributes.value",tagClass: s.Class.UNIVERSAL,type: s.Type.SET,constructed: !0}]}]}]}, g = {name: "CertificationRequest",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,captureAsn1: "csr",value: [h, {name: "CertificationRequest.signatureAlgorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "CertificationRequest.signatureAlgorithm.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "csrSignatureOid"}, {name: "CertificationRequest.signatureAlgorithm.parameters",tagClass: s.Class.UNIVERSAL,optional: !0,captureAsn1: "csrSignatureParams"}]}, {name: "CertificationRequest.signature",tagClass: s.Class.UNIVERSAL,type: s.Type.BITSTRING,constructed: !1,capture: "csrSignature"}]};
u.RDNAttributesAsArray = function(e, t) {
for (var r, n, i, a = [], o = 0; o < e.value.length; ++o) {
r = e.value[o];
for (var u = 0; u < r.value.length; ++u)
i = {}, n = r.value[u], i.type = s.derToOid(n.value[0].value), i.value = n.value[1].value, i.valueTagClass = n.value[1].type, i.type in l && (i.name = l[i.type], i.name in c && (i.shortName = c[i.name])), t && (t.update(i.type), t.update(i.value)), a.push(i)
}
return a
}, u.CRIAttributesAsArray = function(e) {
for (var t = [], r = 0; r < e.length; ++r)
for (var n = e[r], i = s.derToOid(n.value[0].value), a = n.value[1].value, o = 0; o < a.length; ++o) {
var u = {};
u.type = i, u.value = a[o].value, u.valueTagClass = a[o].type, u.type in l && (u.name = l[u.type], u.name in c && (u.shortName = c[u.name])), t.push(u)
}
return t
};
var y = function(t) {
for (var r, n, i, a = [], o = 0; o < t.value.length; ++o) {
i = t.value[o];
for (var u = 0; u < i.value.length; ++u) {
if (n = i.value[u], r = {}, r.id = s.derToOid(n.value[0].value), r.critical = !1, n.value[1].type === s.Type.BOOLEAN ? (r.critical = 0 !== n.value[1].value.charCodeAt(0), r.value = n.value[2].value) : r.value = n.value[1].value, r.id in l)
if (r.name = l[r.id], "keyUsage" === r.name) {
var c = s.fromDer(r.value), p = 0, f = 0;
c.value.length > 1 && (p = c.value.charCodeAt(1), f = c.value.length > 2 ? c.value.charCodeAt(2) : 0), r.digitalSignature = 128 === (128 & p), r.nonRepudiation = 64 === (64 & p), r.keyEncipherment = 32 === (32 & p), r.dataEncipherment = 16 === (16 & p), r.keyAgreement = 8 === (8 & p), r.keyCertSign = 4 === (4 & p), r.cRLSign = 2 === (2 & p), r.encipherOnly = 1 === (1 & p), r.decipherOnly = 128 === (128 & f)
} else if ("basicConstraints" === r.name) {
var c = s.fromDer(r.value);
r.cA = c.value.length > 0 && c.value[0].type === s.Type.BOOLEAN ? 0 !== c.value[0].value.charCodeAt(0) : !1;
var d = null;
c.value.length > 0 && c.value[0].type === s.Type.INTEGER ? d = c.value[0].value : c.value.length > 1 && (d = c.value[1].value), null !== d && (r.pathLenConstraint = s.derToInteger(d))
} else if ("extKeyUsage" === r.name)
for (var c = s.fromDer(r.value), h = 0; h < c.value.length; ++h) {
var g = s.derToOid(c.value[h].value);
g in l ? r[l[g]] = !0 : r[g] = !0
}
else if ("nsCertType" === r.name) {
var c = s.fromDer(r.value), p = 0;
c.value.length > 1 && (p = c.value.charCodeAt(1)), r.client = 128 === (128 & p), r.server = 64 === (64 & p), r.email = 32 === (32 & p), r.objsign = 16 === (16 & p), r.reserved = 8 === (8 & p), r.sslCA = 4 === (4 & p), r.emailCA = 2 === (2 & p), r.objCA = 1 === (1 & p)
} else if ("subjectAltName" === r.name || "issuerAltName" === r.name) {
r.altNames = [];
for (var y, c = s.fromDer(r.value), m = 0; m < c.value.length; ++m) {
y = c.value[m];
var v = {type: y.type,value: y.value};
switch (r.altNames.push(v), y.type) {
case 1:
case 2:
case 6:
break;
case 7:
v.ip = e.util.bytesToIP(y.value);
break;
case 8:
v.oid = s.derToOid(y.value)
}
}
} else if ("subjectKeyIdentifier" === r.name) {
var c = s.fromDer(r.value);
r.subjectKeyIdentifier = e.util.bytesToHex(c.value)
}
a.push(r)
}
}
return a
}, m = function(e, t, r) {
var n = {};
if (e !== l["RSASSA-PSS"])
return n;
r && (n = {hash: {algorithmOid: l.sha1},mgf: {algorithmOid: l.mgf1,hash: {algorithmOid: l.sha1}},saltLength: 20});
var i = {}, a = [];
if (!s.validate(t, d, i, a)) {
var o = new Error("Cannot read RSASSA-PSS parameter block.");
throw o.errors = a, o
}
return void 0 !== i.hashOid && (n.hash = n.hash || {}, n.hash.algorithmOid = s.derToOid(i.hashOid)), void 0 !== i.maskGenOid && (n.mgf = n.mgf || {}, n.mgf.algorithmOid = s.derToOid(i.maskGenOid), n.mgf.hash = n.mgf.hash || {}, n.mgf.hash.algorithmOid = s.derToOid(i.maskGenHashOid)), void 0 !== i.saltLength && (n.saltLength = i.saltLength.charCodeAt(0)), n
};
u.certificateFromPem = function(t, r, n) {
var i = e.pem.decode(t)[0];
if ("CERTIFICATE" !== i.type && "X509 CERTIFICATE" !== i.type && "TRUSTED CERTIFICATE" !== i.type) {
var a = new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');
throw a.headerType = i.type, a
}
if (i.procType && "ENCRYPTED" === i.procType.type)
throw new Error("Could not convert certificate from PEM; PEM is encrypted.");
var o = s.fromDer(i.body, n);
return u.certificateFromAsn1(o, r)
}, u.certificateToPem = function(t, r) {
var n = {type: "CERTIFICATE",body: s.toDer(u.certificateToAsn1(t)).getBytes()};
return e.pem.encode(n, {maxline: r})
}, u.publicKeyFromPem = function(t) {
var r = e.pem.decode(t)[0];
if ("PUBLIC KEY" !== r.type && "RSA PUBLIC KEY" !== r.type) {
var n = new Error('Could not convert public key from PEM; PEM header type is not "PUBLIC KEY" or "RSA PUBLIC KEY".');
throw n.headerType = r.type, n
}
if (r.procType && "ENCRYPTED" === r.procType.type)
throw new Error("Could not convert public key from PEM; PEM is encrypted.");
var i = s.fromDer(r.body);
return u.publicKeyFromAsn1(i)
}, u.publicKeyToPem = function(t, r) {
var n = {type: "PUBLIC KEY",body: s.toDer(u.publicKeyToAsn1(t)).getBytes()};
return e.pem.encode(n, {maxline: r})
}, u.publicKeyToRSAPublicKeyPem = function(t, r) {
var n = {type: "RSA PUBLIC KEY",body: s.toDer(u.publicKeyToRSAPublicKey(t)).getBytes()};
return e.pem.encode(n, {maxline: r})
}, u.getPublicKeyFingerprint = function(t, r) {
r = r || {};
var n, i = r.md || e.md.sha1.create(), a = r.type || "RSAPublicKey";
switch (a) {
case "RSAPublicKey":
n = s.toDer(u.publicKeyToRSAPublicKey(t)).getBytes();
break;
case "SubjectPublicKeyInfo":
n = s.toDer(u.publicKeyToAsn1(t)).getBytes();
break;
default:
throw new Error('Unknown fingerprint type "' + r.type + '".')
}
i.start(), i.update(n);
var o = i.digest();
if ("hex" === r.encoding) {
var l = o.toHex();
return r.delimiter ? l.match(/.{2}/g).join(r.delimiter) : l
}
if ("binary" === r.encoding)
return o.getBytes();
if (r.encoding)
throw new Error('Unknown encoding "' + r.encoding + '".');
return o
}, u.certificationRequestFromPem = function(t, r, n) {
var i = e.pem.decode(t)[0];
if ("CERTIFICATE REQUEST" !== i.type) {
var a = new Error('Could not convert certification request from PEM; PEM header type is not "CERTIFICATE REQUEST".');
throw a.headerType = i.type, a
}
if (i.procType && "ENCRYPTED" === i.procType.type)
throw new Error("Could not convert certification request from PEM; PEM is encrypted.");
var o = s.fromDer(i.body, n);
return u.certificationRequestFromAsn1(o, r)
}, u.certificationRequestToPem = function(t, r) {
var n = {type: "CERTIFICATE REQUEST",body: s.toDer(u.certificationRequestToAsn1(t)).getBytes()};
return e.pem.encode(n, {maxline: r})
}, u.createCertificate = function() {
var r = {};
return r.version = 2, r.serialNumber = "00", r.signatureOid = null, r.signature = null, r.siginfo = {}, r.siginfo.algorithmOid = null, r.validity = {}, r.validity.notBefore = new Date, r.validity.notAfter = new Date, r.issuer = {}, r.issuer.getField = function(e) {
return t(r.issuer, e)
}, r.issuer.addField = function(e) {
i([e]), r.issuer.attributes.push(e)
}, r.issuer.attributes = [], r.issuer.hash = null, r.subject = {}, r.subject.getField = function(e) {
return t(r.subject, e)
}, r.subject.addField = function(e) {
i([e]), r.subject.attributes.push(e)
}, r.subject.attributes = [], r.subject.hash = null, r.extensions = [], r.publicKey = null, r.md = null, r.setSubject = function(e, t) {
i(e), r.subject.attributes = e, delete r.subject.uniqueId, t && (r.subject.uniqueId = t), r.subject.hash = null
}, r.setIssuer = function(e, t) {
i(e), r.issuer.attributes = e, delete r.issuer.uniqueId, t && (r.issuer.uniqueId = t), r.issuer.hash = null
}, r.setExtensions = function(t) {
for (var n, i = 0; i < t.length; ++i) {
if (n = t[i], "undefined" == typeof n.name && n.id && n.id in u.oids && (n.name = u.oids[n.id]), "undefined" == typeof n.id) {
if (!(n.name && n.name in u.oids)) {
var a = new Error("Extension ID not specified.");
throw a.extension = n, a
}
n.id = u.oids[n.name]
}
if ("undefined" == typeof n.value) {
if ("keyUsage" === n.name) {
var o = 0, c = 0, p = 0;
n.digitalSignature && (c |= 128, o = 7), n.nonRepudiation && (c |= 64, o = 6), n.keyEncipherment && (c |= 32, o = 5), n.dataEncipherment && (c |= 16, o = 4), n.keyAgreement && (c |= 8, o = 3), n.keyCertSign && (c |= 4, o = 2), n.cRLSign && (c |= 2, o = 1), n.encipherOnly && (c |= 1, o = 0), n.decipherOnly && (p |= 128, o = 7);
var f = String.fromCharCode(o);
0 !== p ? f += String.fromCharCode(c) + String.fromCharCode(p) : 0 !== c && (f += String.fromCharCode(c)), n.value = s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, f)
} else if ("basicConstraints" === n.name)
n.value = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []), n.cA && n.value.value.push(s.create(s.Class.UNIVERSAL, s.Type.BOOLEAN, !1, String.fromCharCode(255))), "pathLenConstraint" in n && n.value.value.push(s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(n.pathLenConstraint).getBytes()));
else if ("extKeyUsage" === n.name) {
n.value = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []);
var d = n.value.value;
for (var h in n)
n[h] === !0 && (h in l ? d.push(s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(l[h]).getBytes())) : -1 !== h.indexOf(".") && d.push(s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(h).getBytes())))
} else if ("nsCertType" === n.name) {
var o = 0, c = 0;
n.client && (c |= 128, o = 7), n.server && (c |= 64, o = 6), n.email && (c |= 32, o = 5), n.objsign && (c |= 16, o = 4), n.reserved && (c |= 8, o = 3), n.sslCA && (c |= 4, o = 2), n.emailCA && (c |= 2, o = 1), n.objCA && (c |= 1, o = 0);
var f = String.fromCharCode(o);
0 !== c && (f += String.fromCharCode(c)), n.value = s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, f)
} else if ("subjectAltName" === n.name || "issuerAltName" === n.name) {
n.value = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, []);
for (var g, y = 0; y < n.altNames.length; ++y) {
g = n.altNames[y];
var f = g.value;
if (7 === g.type && g.ip) {
if (f = e.util.bytesFromIP(g.ip), null === f) {
var a = new Error('Extension "ip" value is not a valid IPv4 or IPv6 address.');
throw a.extension = n, a
}
} else
8 === g.type && (f = s.oidToDer(g.oid ? s.oidToDer(g.oid) : f));
n.value.value.push(s.create(s.Class.CONTEXT_SPECIFIC, g.type, !1, f))
}
} else if ("subjectKeyIdentifier" === n.name) {
var m = r.generateSubjectKeyIdentifier();
n.subjectKeyIdentifier = m.toHex(), n.value = s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, m.getBytes())
}
if ("undefined" == typeof n.value) {
var a = new Error("Extension value not specified.");
throw a.extension = n, a
}
}
}
r.extensions = t
}, r.getExtension = function(e) {
"string" == typeof e && (e = {name: e});
for (var t, n = null, i = 0; null === n && i < r.extensions.length; ++i)
t = r.extensions[i], e.id && t.id === e.id ? n = t : e.name && t.name === e.name && (n = t);
return n
}, r.sign = function(t, n) {
r.md = n || e.md.sha1.create();
var i = l[r.md.algorithm + "WithRSAEncryption"];
if (!i) {
var a = new Error("Could not compute certificate digest. Unknown message digest algorithm OID.");
throw a.algorithm = r.md.algorithm, a
}
r.signatureOid = r.siginfo.algorithmOid = i, r.tbsCertificate = u.getTBSCertificate(r);
var o = s.toDer(r.tbsCertificate);
r.md.update(o.getBytes()), r.signature = t.sign(r.md)
}, r.verify = function(t) {
var n = !1;
if (!r.issued(t)) {
var i = t.issuer, a = r.subject, o = new Error("The parent certificate did not issue the given child certificate; the child certificate's issuer does not match the parent's subject.");
throw o.expectedIssuer = i.attributes, o.actualIssuer = a.attributes, o
}
var c = t.md;
if (null === c) {
if (t.signatureOid in l) {
var p = l[t.signatureOid];
switch (p) {
case "sha1WithRSAEncryption":
c = e.md.sha1.create();
break;
case "md5WithRSAEncryption":
c = e.md.md5.create();
break;
case "sha256WithRSAEncryption":
c = e.md.sha256.create();
break;
case "RSASSA-PSS":
c = e.md.sha256.create()
}
}
if (null === c) {
var o = new Error("Could not compute certificate digest. Unknown signature OID.");
throw o.signatureOid = t.signatureOid, o
}
var f = t.tbsCertificate || u.getTBSCertificate(t), d = s.toDer(f);
c.update(d.getBytes())
}
if (null !== c) {
var h;
switch (t.signatureOid) {
case l.sha1WithRSAEncryption:
h = void 0;
break;
case l["RSASSA-PSS"]:
var g, y;
if (g = l[t.signatureParameters.mgf.hash.algorithmOid], void 0 === g || void 0 === e.md[g]) {
var o = new Error("Unsupported MGF hash function.");
throw o.oid = t.signatureParameters.mgf.hash.algorithmOid, o.name = g, o
}
if (y = l[t.signatureParameters.mgf.algorithmOid], void 0 === y || void 0 === e.mgf[y]) {
var o = new Error("Unsupported MGF function.");
throw o.oid = t.signatureParameters.mgf.algorithmOid, o.name = y, o
}
if (y = e.mgf[y].create(e.md[g].create()), g = l[t.signatureParameters.hash.algorithmOid], void 0 === g || void 0 === e.md[g])
throw {message: "Unsupported RSASSA-PSS hash function.",oid: t.signatureParameters.hash.algorithmOid,name: g};
h = e.pss.create(e.md[g].create(), y, t.signatureParameters.saltLength)
}
n = r.publicKey.verify(c.digest().getBytes(), t.signature, h)
}
return n
}, r.isIssuer = function(e) {
var t = !1, n = r.issuer, i = e.subject;
if (n.hash && i.hash)
t = n.hash === i.hash;
else if (n.attributes.length === i.attributes.length) {
t = !0;
for (var a, o, s = 0; t && s < n.attributes.length; ++s)
a = n.attributes[s], o = i.attributes[s], (a.type !== o.type || a.value !== o.value) && (t = !1)
}
return t
}, r.issued = function(e) {
return e.isIssuer(r)
}, r.generateSubjectKeyIdentifier = function() {
return u.getPublicKeyFingerprint(r.publicKey, {type: "RSAPublicKey"})
}, r.verifySubjectKeyIdentifier = function() {
for (var t = l.subjectKeyIdentifier, n = 0; n < r.extensions.length; ++n) {
var i = r.extensions[n];
if (i.id === t) {
var a = r.generateSubjectKeyIdentifier().getBytes();
return e.util.hexToBytes(i.subjectKeyIdentifier) === a
}
}
return !1
}, r
}, u.certificateFromAsn1 = function(r, n) {
var a = {}, o = [];
if (!s.validate(r, f, a, o)) {
var c = new Error("Cannot read X.509 certificate. ASN.1 object is not an X509v3 Certificate.");
throw c.errors = o, c
}
if ("string" != typeof a.certSignature) {
for (var p = "\x00", d = 0; d < a.certSignature.length; ++d)
p += s.toDer(a.certSignature[d]).getBytes();
a.certSignature = p
}
var h = s.derToOid(a.publicKeyOid);
if (h !== u.oids.rsaEncryption)
throw new Error("Cannot read public key. OID is not RSA.");
var g = u.createCertificate();
g.version = a.certVersion ? a.certVersion.charCodeAt(0) : 0;
var v = e.util.createBuffer(a.certSerialNumber);
g.serialNumber = v.toHex(), g.signatureOid = e.asn1.derToOid(a.certSignatureOid), g.signatureParameters = m(g.signatureOid, a.certSignatureParams, !0), g.siginfo.algorithmOid = e.asn1.derToOid(a.certinfoSignatureOid), g.siginfo.parameters = m(g.siginfo.algorithmOid, a.certinfoSignatureParams, !1);
var b = e.util.createBuffer(a.certSignature);
++b.read, g.signature = b.getBytes();
var _ = [];
if (void 0 !== a.certValidity1UTCTime && _.push(s.utcTimeToDate(a.certValidity1UTCTime)), void 0 !== a.certValidity2GeneralizedTime && _.push(s.generalizedTimeToDate(a.certValidity2GeneralizedTime)), void 0 !== a.certValidity3UTCTime && _.push(s.utcTimeToDate(a.certValidity3UTCTime)), void 0 !== a.certValidity4GeneralizedTime && _.push(s.generalizedTimeToDate(a.certValidity4GeneralizedTime)), _.length > 2)
throw new Error("Cannot read notBefore/notAfter validity times; more than two times were provided in the certificate.");
if (_.length < 2)
throw new Error("Cannot read notBefore/notAfter validity times; they were not provided as either UTCTime or GeneralizedTime.");
if (g.validity.notBefore = _[0], g.validity.notAfter = _[1], g.tbsCertificate = a.tbsCertificate, n) {
if (g.md = null, g.signatureOid in l) {
var h = l[g.signatureOid];
switch (h) {
case "sha1WithRSAEncryption":
g.md = e.md.sha1.create();
break;
case "md5WithRSAEncryption":
g.md = e.md.md5.create();
break;
case "sha256WithRSAEncryption":
g.md = e.md.sha256.create();
break;
case "RSASSA-PSS":
g.md = e.md.sha256.create()
}
}
if (null === g.md) {
var c = new Error("Could not compute certificate digest. Unknown signature OID.");
throw c.signatureOid = g.signatureOid, c
}
var E = s.toDer(g.tbsCertificate);
g.md.update(E.getBytes())
}
var C = e.md.sha1.create();
g.issuer.getField = function(e) {
return t(g.issuer, e)
}, g.issuer.addField = function(e) {
i([e]), g.issuer.attributes.push(e)
}, g.issuer.attributes = u.RDNAttributesAsArray(a.certIssuer, C), a.certIssuerUniqueId && (g.issuer.uniqueId = a.certIssuerUniqueId), g.issuer.hash = C.digest().toHex();
var S = e.md.sha1.create();
return g.subject.getField = function(e) {
return t(g.subject, e)
}, g.subject.addField = function(e) {
i([e]), g.subject.attributes.push(e)
}, g.subject.attributes = u.RDNAttributesAsArray(a.certSubject, S), a.certSubjectUniqueId && (g.subject.uniqueId = a.certSubjectUniqueId), g.subject.hash = S.digest().toHex(), g.extensions = a.certExtensions ? y(a.certExtensions) : [], g.publicKey = u.publicKeyFromAsn1(a.subjectPublicKeyInfo), g
}, u.certificationRequestFromAsn1 = function(r, n) {
var a = {}, o = [];
if (!s.validate(r, g, a, o)) {
var c = new Error("Cannot read PKCS#10 certificate request. ASN.1 object is not a PKCS#10 CertificationRequest.");
throw c.errors = o, c
}
if ("string" != typeof a.csrSignature) {
for (var p = "\x00", f = 0; f < a.csrSignature.length; ++f)
p += s.toDer(a.csrSignature[f]).getBytes();
a.csrSignature = p
}
var d = s.derToOid(a.publicKeyOid);
if (d !== u.oids.rsaEncryption)
throw new Error("Cannot read public key. OID is not RSA.");
var h = u.createCertificationRequest();
h.version = a.csrVersion ? a.csrVersion.charCodeAt(0) : 0, h.signatureOid = e.asn1.derToOid(a.csrSignatureOid), h.signatureParameters = m(h.signatureOid, a.csrSignatureParams, !0), h.siginfo.algorithmOid = e.asn1.derToOid(a.csrSignatureOid), h.siginfo.parameters = m(h.siginfo.algorithmOid, a.csrSignatureParams, !1);
var y = e.util.createBuffer(a.csrSignature);
if (++y.read, h.signature = y.getBytes(), h.certificationRequestInfo = a.certificationRequestInfo, n) {
if (h.md = null, h.signatureOid in l) {
var d = l[h.signatureOid];
switch (d) {
case "sha1WithRSAEncryption":
h.md = e.md.sha1.create();
break;
case "md5WithRSAEncryption":
h.md = e.md.md5.create();
break;
case "sha256WithRSAEncryption":
h.md = e.md.sha256.create();
break;
case "RSASSA-PSS":
h.md = e.md.sha256.create()
}
}
if (null === h.md) {
var c = new Error("Could not compute certification request digest. Unknown signature OID.");
throw c.signatureOid = h.signatureOid, c
}
var v = s.toDer(h.certificationRequestInfo);
h.md.update(v.getBytes())
}
var b = e.md.sha1.create();
return h.subject.getField = function(e) {
return t(h.subject, e)
}, h.subject.addField = function(e) {
i([e]), h.subject.attributes.push(e)
}, h.subject.attributes = u.RDNAttributesAsArray(a.certificationRequestInfoSubject, b), h.subject.hash = b.digest().toHex(), h.publicKey = u.publicKeyFromAsn1(a.subjectPublicKeyInfo), h.getAttribute = function(e) {
return t(h.attributes, e)
}, h.addAttribute = function(e) {
i([e]), h.attributes.push(e)
}, h.attributes = u.CRIAttributesAsArray(a.certificationRequestInfoAttributes || []), h
}, u.createCertificationRequest = function() {
var r = {};
return r.version = 0, r.signatureOid = null, r.signature = null, r.siginfo = {}, r.siginfo.algorithmOid = null, r.subject = {}, r.subject.getField = function(e) {
return t(r.subject, e)
}, r.subject.addField = function(e) {
i([e]), r.subject.attributes.push(e)
}, r.subject.attributes = [], r.subject.hash = null, r.publicKey = null, r.attributes = [], r.getAttribute = function(e) {
return t(r.attributes, e)
}, r.addAttribute = function(e) {
i([e]), r.attributes.push(e)
}, r.md = null, r.setSubject = function(e) {
i(e), r.subject.attributes = e, r.subject.hash = null
}, r.setAttributes = function(e) {
i(e), r.attributes = e
}, r.sign = function(t, n) {
r.md = n || e.md.sha1.create();
var i = l[r.md.algorithm + "WithRSAEncryption"];
if (!i) {
var a = new Error("Could not compute certification request digest. Unknown message digest algorithm OID.");
throw a.algorithm = r.md.algorithm, a
}
r.signatureOid = r.siginfo.algorithmOid = i, r.certificationRequestInfo = u.getCertificationRequestInfo(r);
var o = s.toDer(r.certificationRequestInfo);
r.md.update(o.getBytes()), r.signature = t.sign(r.md)
}, r.verify = function() {
var t = !1, n = r.md;
if (null === n) {
if (r.signatureOid in l) {
var i = l[r.signatureOid];
switch (i) {
case "sha1WithRSAEncryption":
n = e.md.sha1.create();
break;
case "md5WithRSAEncryption":
n = e.md.md5.create();
break;
case "sha256WithRSAEncryption":
n = e.md.sha256.create();
break;
case "RSASSA-PSS":
n = e.md.sha256.create()
}
}
if (null === n) {
var a = new Error("Could not compute certification request digest. Unknown signature OID.");
throw a.signatureOid = r.signatureOid, a
}
var o = r.certificationRequestInfo || u.getCertificationRequestInfo(r), c = s.toDer(o);
n.update(c.getBytes())
}
if (null !== n) {
var p;
switch (r.signatureOid) {
case l.sha1WithRSAEncryption:
break;
case l["RSASSA-PSS"]:
var f, d;
if (f = l[r.signatureParameters.mgf.hash.algorithmOid], void 0 === f || void 0 === e.md[f]) {
var a = new Error("Unsupported MGF hash function.");
throw a.oid = r.signatureParameters.mgf.hash.algorithmOid, a.name = f, a
}
if (d = l[r.signatureParameters.mgf.algorithmOid], void 0 === d || void 0 === e.mgf[d]) {
var a = new Error("Unsupported MGF function.");
throw a.oid = r.signatureParameters.mgf.algorithmOid, a.name = d, a
}
if (d = e.mgf[d].create(e.md[f].create()), f = l[r.signatureParameters.hash.algorithmOid], void 0 === f || void 0 === e.md[f]) {
var a = new Error("Unsupported RSASSA-PSS hash function.");
throw a.oid = r.signatureParameters.hash.algorithmOid, a.name = f, a
}
p = e.pss.create(e.md[f].create(), d, r.signatureParameters.saltLength)
}
t = r.publicKey.verify(n.digest().getBytes(), r.signature, p)
}
return t
}, r
}, u.getTBSCertificate = function(t) {
var i = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(t.version).getBytes())]), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, e.util.hexToBytes(t.serialNumber)), s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(t.siginfo.algorithmOid).getBytes()), a(t.siginfo.algorithmOid, t.siginfo.parameters)]), r(t.issuer), s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.UTCTIME, !1, s.dateToUtcTime(t.validity.notBefore)), s.create(s.Class.UNIVERSAL, s.Type.UTCTIME, !1, s.dateToUtcTime(t.validity.notAfter))]), r(t.subject), u.publicKeyToAsn1(t.publicKey)]);
return t.issuer.uniqueId && i.value.push(s.create(s.Class.CONTEXT_SPECIFIC, 1, !0, [s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, String.fromCharCode(0) + t.issuer.uniqueId)])), t.subject.uniqueId && i.value.push(s.create(s.Class.CONTEXT_SPECIFIC, 2, !0, [s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, String.fromCharCode(0) + t.subject.uniqueId)])), t.extensions.length > 0 && i.value.push(n(t.extensions)), i
}, u.getCertificationRequestInfo = function(e) {
var t = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(e.version).getBytes()), r(e.subject), u.publicKeyToAsn1(e.publicKey), o(e)]);
return t
}, u.distinguishedNameToAsn1 = function(e) {
return r(e)
}, u.certificateToAsn1 = function(e) {
var t = e.tbsCertificate || u.getTBSCertificate(e);
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [t, s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(e.signatureOid).getBytes()), a(e.signatureOid, e.signatureParameters)]), s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, String.fromCharCode(0) + e.signature)])
}, u.certificationRequestToAsn1 = function(e) {
var t = e.certificationRequestInfo || u.getCertificationRequestInfo(e);
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [t, s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(e.signatureOid).getBytes()), a(e.signatureOid, e.signatureParameters)]), s.create(s.Class.UNIVERSAL, s.Type.BITSTRING, !1, String.fromCharCode(0) + e.signature)])
}, u.createCaStore = function(t) {
var n = {certs: {}};
if (n.getIssuer = function(t) {
var i = null;
if (!t.issuer.hash) {
var a = e.md.sha1.create();
t.issuer.attributes = u.RDNAttributesAsArray(r(t.issuer), a), t.issuer.hash = a.digest().toHex()
}
if (t.issuer.hash in n.certs && (i = n.certs[t.issuer.hash], e.util.isArray(i)))
throw new Error("Resolving multiple issuer matches not implemented yet.");
return i
}, n.addCertificate = function(t) {
if ("string" == typeof t && (t = e.pki.certificateFromPem(t)), !t.subject.hash) {
var i = e.md.sha1.create();
t.subject.attributes = u.RDNAttributesAsArray(r(t.subject), i), t.subject.hash = i.digest().toHex()
}
if (t.subject.hash in n.certs) {
var a = n.certs[t.subject.hash];
e.util.isArray(a) || (a = [a]), a.push(t)
} else
n.certs[t.subject.hash] = t
}, t)
for (var i = 0; i < t.length; ++i) {
var a = t[i];
n.addCertificate(a)
}
return n
}, u.certificateError = {bad_certificate: "forge.pki.BadCertificate",unsupported_certificate: "forge.pki.UnsupportedCertificate",certificate_revoked: "forge.pki.CertificateRevoked",certificate_expired: "forge.pki.CertificateExpired",certificate_unknown: "forge.pki.CertificateUnknown",unknown_ca: "forge.pki.UnknownCertificateAuthority"}, u.verifyCertificateChain = function(t, r, n) {
r = r.slice(0);
var i = r.slice(0), a = new Date, o = !0, s = null, l = 0, c = null;
do {
var p = r.shift();
if (a < p.validity.notBefore || a > p.validity.notAfter)
s = {message: "Certificate is not valid yet or has expired.",error: u.certificateError.certificate_expired,notBefore: p.validity.notBefore,notAfter: p.validity.notAfter,now: a};
else {
var f = !1;
if (r.length > 0) {
c = r[0];
try {
f = c.verify(p)
} catch (d) {
}
} else {
var h = t.getIssuer(p);
if (null === h)
s = {message: "Certificate is not trusted.",error: u.certificateError.unknown_ca};
else
for (e.util.isArray(h) || (h = [h]); !f && h.length > 0; ) {
c = h.shift();
try {
f = c.verify(p)
} catch (d) {
}
}
}
null !== s || f || (s = {message: "Certificate signature is invalid.",error: u.certificateError.bad_certificate})
}
if (null !== s || p.isIssuer(c) || (s = {message: "Certificate issuer is invalid.",error: u.certificateError.bad_certificate}), null === s)
for (var g = {keyUsage: !0,basicConstraints: !0}, y = 0; null === s && y < p.extensions.length; ++y) {
var m = p.extensions[y];
!m.critical || m.name in g || (s = {message: "Certificate has an unsupported critical extension.",error: u.certificateError.unsupported_certificate})
}
if (!o || 0 === r.length && !c) {
var v = p.getExtension("basicConstraints"), b = p.getExtension("keyUsage");
if (null !== b && (b.keyCertSign && null !== v || (s = {message: "Certificate keyUsage or basicConstraints conflict or indicate that the certificate is not a CA. If the certificate is the only one in the chain or isn't the first then the certificate must be a valid CA.",error: u.certificateError.bad_certificate})), null !== s || null === v || v.cA || (s = {message: "Certificate basicConstraints indicates the certificate is not a CA.",error: u.certificateError.bad_certificate}), null === s && null !== b && "pathLenConstraint" in v) {
for (var _ = 0, y = 1; y < r.length - 1; ++y)
r[y].isIssuer(r[y]) && ++_;
var E = v.pathLenConstraint + 1;
r.length - _ > E && (s = {message: "Certificate basicConstraints pathLenConstraint violated.",error: u.certificateError.bad_certificate})
}
}
var C = null === s ? !0 : s.error, S = n ? n(C, l, i) : C;
if (S !== !0)
throw C === !0 && (s = {message: "The application rejected the certificate.",error: u.certificateError.bad_certificate}), (S || 0 === S) && ("object" != typeof S || e.util.isArray(S) ? "string" == typeof S && (s.error = S) : (S.message && (s.message = S.message), S.error && (s.error = S.error))), s;
s = null, o = !1, ++l
} while (r.length > 0);
return !0
}
}
var t = "x509";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n.pki
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/x509", ["require", "module", "./aes", "./asn1", "./des", "./md", "./mgf", "./oids", "./pem", "./pss", "./rsa", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(e, t, r, n) {
for (var i = [], a = 0; a < e.length; a++)
for (var o = 0; o < e[a].safeBags.length; o++) {
var s = e[a].safeBags[o];
(void 0 === n || s.type === n) && (null !== t ? void 0 !== s.attributes[t] && s.attributes[t].indexOf(r) >= 0 && i.push(s) : i.push(s))
}
return i
}
function r(t) {
if (t.composed || t.constructed) {
for (var r = e.util.createBuffer(), n = 0; n < t.value.length; ++n)
r.putBytes(t.value[n].value);
t.composed = t.constructed = !1, t.value = r.getBytes()
}
return t
}
function n(e, t, n, o) {
if (t = s.fromDer(t, n), t.tagClass !== s.Class.UNIVERSAL || t.type !== s.Type.SEQUENCE || t.constructed !== !0)
throw new Error("PKCS#12 AuthenticatedSafe expected to be a SEQUENCE OF ContentInfo");
for (var l = 0; l < t.value.length; l++) {
var p = t.value[l], f = {}, d = [];
if (!s.validate(p, c, f, d)) {
var h = new Error("Cannot read ContentInfo.");
throw h.errors = d, h
}
var g = {encrypted: !1}, y = null, m = f.content.value[0];
switch (s.derToOid(f.contentType)) {
case u.oids.data:
if (m.tagClass !== s.Class.UNIVERSAL || m.type !== s.Type.OCTETSTRING)
throw new Error("PKCS#12 SafeContents Data is not an OCTET STRING.");
y = r(m).value;
break;
case u.oids.encryptedData:
y = i(m, o), g.encrypted = !0;
break;
default:
var h = new Error("Unsupported PKCS#12 contentType.");
throw h.contentType = s.derToOid(f.contentType), h
}
g.safeBags = a(y, n, o), e.safeContents.push(g)
}
}
function i(t, n) {
var i = {}, a = [];
if (!s.validate(t, e.pkcs7.asn1.encryptedDataValidator, i, a)) {
var o = new Error("Cannot read EncryptedContentInfo.");
throw o.errors = a, o
}
var l = s.derToOid(i.contentType);
if (l !== u.oids.data) {
var o = new Error("PKCS#12 EncryptedContentInfo ContentType is not Data.");
throw o.oid = l, o
}
l = s.derToOid(i.encAlgorithm);
var c = u.pbe.getCipher(l, i.encParameter, n), p = r(i.encryptedContentAsn1), f = e.util.createBuffer(p.value);
if (c.update(f), !c.finish())
throw new Error("Failed to decrypt PKCS#12 SafeContents.");
return c.output.getBytes()
}
function a(e, t, r) {
if (!t && 0 === e.length)
return [];
if (e = s.fromDer(e, t), e.tagClass !== s.Class.UNIVERSAL || e.type !== s.Type.SEQUENCE || e.constructed !== !0)
throw new Error("PKCS#12 SafeContents expected to be a SEQUENCE OF SafeBag.");
for (var n = [], i = 0; i < e.value.length; i++) {
var a = e.value[i], l = {}, c = [];
if (!s.validate(a, f, l, c)) {
var p = new Error("Cannot read SafeBag.");
throw p.errors = c, p
}
var d = {type: s.derToOid(l.bagId),attributes: o(l.bagAttributes)};
n.push(d);
var g, y, m = l.bagValue.value[0];
switch (d.type) {
case u.oids.pkcs8ShroudedKeyBag:
if (m = u.decryptPrivateKeyInfo(m, r), null === m)
throw new Error("Unable to decrypt PKCS#8 ShroudedKeyBag, wrong password?");
case u.oids.keyBag:
d.key = u.privateKeyFromAsn1(m);
continue;
case u.oids.certBag:
g = h, y = function() {
if (s.derToOid(l.certId) !== u.oids.x509Certificate) {
var e = new Error("Unsupported certificate type, only X.509 supported.");
throw e.oid = s.derToOid(l.certId), e
}
d.cert = u.certificateFromAsn1(s.fromDer(l.cert, t), !0)
};
break;
default:
var p = new Error("Unsupported PKCS#12 SafeBag type.");
throw p.oid = d.type, p
}
if (void 0 !== g && !s.validate(m, g, l, c)) {
var p = new Error("Cannot read PKCS#12 " + g.name);
throw p.errors = c, p
}
y()
}
return n
}
function o(e) {
var t = {};
if (void 0 !== e)
for (var r = 0; r < e.length; ++r) {
var n = {}, i = [];
if (!s.validate(e[r], d, n, i)) {
var a = new Error("Cannot read PKCS#12 BagAttribute.");
throw a.errors = i, a
}
var o = s.derToOid(n.oid);
if (void 0 !== u.oids[o]) {
t[u.oids[o]] = [];
for (var l = 0; l < n.values.length; ++l)
t[u.oids[o]].push(n.values[l].value)
}
}
return t
}
var s = e.asn1, u = e.pki, l = e.pkcs12 = e.pkcs12 || {}, c = {name: "ContentInfo",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "ContentInfo.contentType",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "contentType"}, {name: "ContentInfo.content",tagClass: s.Class.CONTEXT_SPECIFIC,constructed: !0,captureAsn1: "content"}]}, p = {name: "PFX",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "PFX.version",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,capture: "version"}, c, {name: "PFX.macData",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,optional: !0,captureAsn1: "mac",value: [{name: "PFX.macData.mac",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "PFX.macData.mac.digestAlgorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "PFX.macData.mac.digestAlgorithm.algorithm",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "macAlgorithm"}, {name: "PFX.macData.mac.digestAlgorithm.parameters",tagClass: s.Class.UNIVERSAL,captureAsn1: "macAlgorithmParameters"}]}, {name: "PFX.macData.mac.digest",tagClass: s.Class.UNIVERSAL,type: s.Type.OCTETSTRING,constructed: !1,capture: "macDigest"}]}, {name: "PFX.macData.macSalt",tagClass: s.Class.UNIVERSAL,type: s.Type.OCTETSTRING,constructed: !1,capture: "macSalt"}, {name: "PFX.macData.iterations",tagClass: s.Class.UNIVERSAL,type: s.Type.INTEGER,constructed: !1,optional: !0,capture: "macIterations"}]}]}, f = {name: "SafeBag",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "SafeBag.bagId",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "bagId"}, {name: "SafeBag.bagValue",tagClass: s.Class.CONTEXT_SPECIFIC,constructed: !0,captureAsn1: "bagValue"}, {name: "SafeBag.bagAttributes",tagClass: s.Class.UNIVERSAL,type: s.Type.SET,constructed: !0,optional: !0,capture: "bagAttributes"}]}, d = {name: "Attribute",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "Attribute.attrId",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "oid"}, {name: "Attribute.attrValues",tagClass: s.Class.UNIVERSAL,type: s.Type.SET,constructed: !0,capture: "values"}]}, h = {name: "CertBag",tagClass: s.Class.UNIVERSAL,type: s.Type.SEQUENCE,constructed: !0,value: [{name: "CertBag.certId",tagClass: s.Class.UNIVERSAL,type: s.Type.OID,constructed: !1,capture: "certId"}, {name: "CertBag.certValue",tagClass: s.Class.CONTEXT_SPECIFIC,constructed: !0,value: [{name: "CertBag.certValue[0]",tagClass: s.Class.UNIVERSAL,type: s.Class.OCTETSTRING,constructed: !1,capture: "cert"}]}]};
l.pkcs12FromAsn1 = function(i, a, o) {
"string" == typeof a ? (o = a, a = !0) : void 0 === a && (a = !0);
var c = {}, f = [];
if (!s.validate(i, p, c, f)) {
var d = new Error("Cannot read PKCS#12 PFX. ASN.1 object is not an PKCS#12 PFX.");
throw d.errors = d, d
}
var h = {version: c.version.charCodeAt(0),safeContents: [],getBags: function(r) {
var n, i = {};
return "localKeyId" in r ? n = r.localKeyId : "localKeyIdHex" in r && (n = e.util.hexToBytes(r.localKeyIdHex)), void 0 === n && !("friendlyName" in r) && "bagType" in r && (i[r.bagType] = t(h.safeContents, null, null, r.bagType)), void 0 !== n && (i.localKeyId = t(h.safeContents, "localKeyId", n, r.bagType)), "friendlyName" in r && (i.friendlyName = t(h.safeContents, "friendlyName", r.friendlyName, r.bagType)), i
},getBagsByFriendlyName: function(e, r) {
return t(h.safeContents, "friendlyName", e, r)
},getBagsByLocalKeyId: function(e, r) {
return t(h.safeContents, "localKeyId", e, r)
}};
if (3 !== c.version.charCodeAt(0)) {
var d = new Error("PKCS#12 PFX of version other than 3 not supported.");
throw d.version = c.version.charCodeAt(0), d
}
if (s.derToOid(c.contentType) !== u.oids.data) {
var d = new Error("Only PKCS#12 PFX in password integrity mode supported.");
throw d.oid = s.derToOid(c.contentType), d
}
var g = c.content.value[0];
if (g.tagClass !== s.Class.UNIVERSAL || g.type !== s.Type.OCTETSTRING)
throw new Error("PKCS#12 authSafe content data is not an OCTET STRING.");
if (g = r(g), c.mac) {
var y = null, m = 0, v = s.derToOid(c.macAlgorithm);
switch (v) {
case u.oids.sha1:
y = e.md.sha1.create(), m = 20;
break;
case u.oids.sha256:
y = e.md.sha256.create(), m = 32;
break;
case u.oids.sha384:
y = e.md.sha384.create(), m = 48;
break;
case u.oids.sha512:
y = e.md.sha512.create(), m = 64;
break;
case u.oids.md5:
y = e.md.md5.create(), m = 16
}
if (null === y)
throw new Error("PKCS#12 uses unsupported MAC algorithm: " + v);
var b = new e.util.ByteBuffer(c.macSalt), _ = "macIterations" in c ? parseInt(e.util.bytesToHex(c.macIterations), 16) : 1, E = l.generateKey(o, b, 3, _, m, y), C = e.hmac.create();
C.start(y, E), C.update(g.value);
var S = C.getMac();
if (S.getBytes() !== c.macDigest)
throw new Error("PKCS#12 MAC could not be verified. Invalid password?")
}
return n(h, g.value, a, o), h
}, l.toPkcs12Asn1 = function(t, r, n, i) {
i = i || {}, i.saltSize = i.saltSize || 8, i.count = i.count || 2048, i.algorithm = i.algorithm || i.encAlgorithm || "aes128", "useMac" in i || (i.useMac = !0), "localKeyId" in i || (i.localKeyId = null), "generateLocalKeyId" in i || (i.generateLocalKeyId = !0);
var a, o = i.localKeyId;
if (null !== o)
o = e.util.hexToBytes(o);
else if (i.generateLocalKeyId)
if (r) {
var c = e.util.isArray(r) ? r[0] : r;
"string" == typeof c && (c = u.certificateFromPem(c));
var p = e.md.sha1.create();
p.update(s.toDer(u.certificateToAsn1(c)).getBytes()), o = p.digest().getBytes()
} else
o = e.random.getBytes(20);
var f = [];
null !== o && f.push(s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.localKeyId).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.SET, !0, [s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, o)])])), "friendlyName" in i && f.push(s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.friendlyName).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.SET, !0, [s.create(s.Class.UNIVERSAL, s.Type.BMPSTRING, !1, i.friendlyName)])])), f.length > 0 && (a = s.create(s.Class.UNIVERSAL, s.Type.SET, !0, f));
var d = [], h = [];
null !== r && (h = e.util.isArray(r) ? r : [r]);
for (var g = [], y = 0; y < h.length; ++y) {
r = h[y], "string" == typeof r && (r = u.certificateFromPem(r));
var m = 0 === y ? a : void 0, v = u.certificateToAsn1(r), b = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.certBag).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.x509Certificate).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, s.toDer(v).getBytes())])])]), m]);
g.push(b)
}
if (g.length > 0) {
var _ = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, g), E = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.data).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, s.toDer(_).getBytes())])]);
d.push(E)
}
var C = null;
if (null !== t) {
var S = u.wrapRsaPrivateKey(u.privateKeyToAsn1(t));
C = null === n ? s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.keyBag).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [S]), a]) : s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.pkcs8ShroudedKeyBag).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [u.encryptPrivateKeyInfo(S, n, i)]), a]);
var A = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [C]), T = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.data).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, s.toDer(A).getBytes())])]);
d.push(T)
}
var w, k = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, d);
if (i.useMac) {
var p = e.md.sha1.create(), I = new e.util.ByteBuffer(e.random.getBytes(i.saltSize)), x = i.count, t = l.generateKey(n, I, 3, x, 20), D = e.hmac.create();
D.start(p, t), D.update(s.toDer(k).getBytes());
var N = D.getMac();
w = s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.sha1).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.NULL, !1, "")]), s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, N.getBytes())]), s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, I.getBytes()), s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(x).getBytes())])
}
return s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.INTEGER, !1, s.integerToDer(3).getBytes()), s.create(s.Class.UNIVERSAL, s.Type.SEQUENCE, !0, [s.create(s.Class.UNIVERSAL, s.Type.OID, !1, s.oidToDer(u.oids.data).getBytes()), s.create(s.Class.CONTEXT_SPECIFIC, 0, !0, [s.create(s.Class.UNIVERSAL, s.Type.OCTETSTRING, !1, s.toDer(k).getBytes())])]), w])
}, l.generateKey = e.pbe.generatePkcs12Key
}
var t = "pkcs12";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pkcs12", ["require", "module", "./asn1", "./hmac", "./oids", "./pkcs7asn1", "./pbe", "./random", "./rsa", "./sha1", "./util", "./x509"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = e.asn1, r = e.pki = e.pki || {};
r.pemToDer = function(t) {
var r = e.pem.decode(t)[0];
if (r.procType && "ENCRYPTED" === r.procType.type)
throw new Error("Could not convert PEM to DER; PEM is encrypted.");
return e.util.createBuffer(r.body)
}, r.privateKeyFromPem = function(n) {
var i = e.pem.decode(n)[0];
if ("PRIVATE KEY" !== i.type && "RSA PRIVATE KEY" !== i.type) {
var a = new Error('Could not convert private key from PEM; PEM header type is not "PRIVATE KEY" or "RSA PRIVATE KEY".');
throw a.headerType = i.type, a
}
if (i.procType && "ENCRYPTED" === i.procType.type)
throw new Error("Could not convert private key from PEM; PEM is encrypted.");
var o = t.fromDer(i.body);
return r.privateKeyFromAsn1(o)
}, r.privateKeyToPem = function(n, i) {
var a = {type: "RSA PRIVATE KEY",body: t.toDer(r.privateKeyToAsn1(n)).getBytes()};
return e.pem.encode(a, {maxline: i})
}, r.privateKeyInfoToPem = function(r, n) {
var i = {type: "PRIVATE KEY",body: t.toDer(r).getBytes()};
return e.pem.encode(i, {maxline: n})
}
}
var t = "pki";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/pki", ["require", "module", "./asn1", "./oids", "./pbe", "./pem", "./pbkdf2", "./pkcs12", "./pss", "./rsa", "./util", "./x509"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
var t = function(t, r, n, i) {
var a = e.util.createBuffer(), o = t.length >> 1, s = o + (1 & t.length), u = t.substr(0, s), l = t.substr(o, s), c = e.util.createBuffer(), p = e.hmac.create();
n = r + n;
var f = Math.ceil(i / 16), d = Math.ceil(i / 20);
p.start("MD5", u);
var h = e.util.createBuffer();
c.putBytes(n);
for (var g = 0; f > g; ++g)
p.start(null, null), p.update(c.getBytes()), c.putBuffer(p.digest()), p.start(null, null), p.update(c.bytes() + n), h.putBuffer(p.digest());
p.start("SHA1", l);
var y = e.util.createBuffer();
c.clear(), c.putBytes(n);
for (var g = 0; d > g; ++g)
p.start(null, null), p.update(c.getBytes()), c.putBuffer(p.digest()), p.start(null, null), p.update(c.bytes() + n), y.putBuffer(p.digest());
return a.putBytes(e.util.xorBytes(h.getBytes(), y.getBytes(), i)), a
}, r = function(t, r, n) {
var i = e.hmac.create();
i.start("SHA1", t);
var a = e.util.createBuffer();
return a.putInt32(r[0]), a.putInt32(r[1]), a.putByte(n.type), a.putByte(n.version.major), a.putByte(n.version.minor), a.putInt16(n.length), a.putBytes(n.fragment.bytes()), i.update(a.getBytes()), i.digest().getBytes()
}, n = function(t, r) {
var n = !1;
try {
var i = t.deflate(r.fragment.getBytes());
r.fragment = e.util.createBuffer(i), r.length = i.length, n = !0
} catch (a) {
}
return n
}, i = function(t, r) {
var n = !1;
try {
var i = t.inflate(r.fragment.getBytes());
r.fragment = e.util.createBuffer(i), r.length = i.length, n = !0
} catch (a) {
}
return n
}, a = function(t, r) {
var n = 0;
switch (r) {
case 1:
n = t.getByte();
break;
case 2:
n = t.getInt16();
break;
case 3:
n = t.getInt24();
break;
case 4:
n = t.getInt32()
}
return e.util.createBuffer(t.getBytes(n))
}, o = function(e, t, r) {
e.putInt(r.length(), t << 3), e.putBuffer(r)
}, s = {};
s.Versions = {TLS_1_0: {major: 3,minor: 1},TLS_1_1: {major: 3,minor: 2},TLS_1_2: {major: 3,minor: 3}}, s.SupportedVersions = [s.Versions.TLS_1_1, s.Versions.TLS_1_0], s.Version = s.SupportedVersions[0], s.MaxFragment = 15360, s.ConnectionEnd = {server: 0,client: 1}, s.PRFAlgorithm = {tls_prf_sha256: 0}, s.BulkCipherAlgorithm = {none: null,rc4: 0,des3: 1,aes: 2}, s.CipherType = {stream: 0,block: 1,aead: 2}, s.MACAlgorithm = {none: null,hmac_md5: 0,hmac_sha1: 1,hmac_sha256: 2,hmac_sha384: 3,hmac_sha512: 4}, s.CompressionMethod = {none: 0,deflate: 1}, s.ContentType = {change_cipher_spec: 20,alert: 21,handshake: 22,application_data: 23,heartbeat: 24}, s.HandshakeType = {hello_request: 0,client_hello: 1,server_hello: 2,certificate: 11,server_key_exchange: 12,certificate_request: 13,server_hello_done: 14,certificate_verify: 15,client_key_exchange: 16,finished: 20}, s.Alert = {}, s.Alert.Level = {warning: 1,fatal: 2}, s.Alert.Description = {close_notify: 0,unexpected_message: 10,bad_record_mac: 20,decryption_failed: 21,record_overflow: 22,decompression_failure: 30,handshake_failure: 40,bad_certificate: 42,unsupported_certificate: 43,certificate_revoked: 44,certificate_expired: 45,certificate_unknown: 46,illegal_parameter: 47,unknown_ca: 48,access_denied: 49,decode_error: 50,decrypt_error: 51,export_restriction: 60,protocol_version: 70,insufficient_security: 71,internal_error: 80,user_canceled: 90,no_renegotiation: 100}, s.HeartbeatMessageType = {heartbeat_request: 1,heartbeat_response: 2}, s.CipherSuites = {}, s.getCipherSuite = function(e) {
var t = null;
for (var r in s.CipherSuites) {
var n = s.CipherSuites[r];
if (n.id[0] === e.charCodeAt(0) && n.id[1] === e.charCodeAt(1)) {
t = n;
break
}
}
return t
}, s.handleUnexpected = function(e) {
var t = !e.open && e.entity === s.ConnectionEnd.client;
t || e.error(e, {message: "Unexpected message. Received TLS record out of order.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.unexpected_message}})
}, s.handleHelloRequest = function(e) {
!e.handshaking && e.handshakes > 0 && (s.queue(e, s.createAlert(e, {level: s.Alert.Level.warning,description: s.Alert.Description.no_renegotiation})), s.flush(e)), e.process()
}, s.parseHelloMessage = function(t, r, n) {
var i = null, o = t.entity === s.ConnectionEnd.client;
if (38 > n)
t.error(t, {message: o ? "Invalid ServerHello message. Message too short." : "Invalid ClientHello message. Message too short.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.illegal_parameter}});
else {
var u = r.fragment, l = u.length();
if (i = {version: {major: u.getByte(),minor: u.getByte()},random: e.util.createBuffer(u.getBytes(32)),session_id: a(u, 1),extensions: []}, o ? (i.cipher_suite = u.getBytes(2), i.compression_method = u.getByte()) : (i.cipher_suites = a(u, 2), i.compression_methods = a(u, 1)), l = n - (l - u.length()), l > 0) {
for (var c = a(u, 2); c.length() > 0; )
i.extensions.push({type: [c.getByte(), c.getByte()],data: a(c, 2)});
if (!o)
for (var p = 0; p < i.extensions.length; ++p) {
var f = i.extensions[p];
if (0 === f.type[0] && 0 === f.type[1])
for (var d = a(f.data, 2); d.length() > 0; ) {
var h = d.getByte();
if (0 !== h)
break;
t.session.extensions.server_name.serverNameList.push(a(d, 2).getBytes())
}
}
}
if (t.session.version && (i.version.major !== t.session.version.major || i.version.minor !== t.session.version.minor))
return t.error(t, {message: "TLS version change is disallowed during renegotiation.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.protocol_version}});
if (o)
t.session.cipherSuite = s.getCipherSuite(i.cipher_suite);
else
for (var g = e.util.createBuffer(i.cipher_suites.bytes()); g.length() > 0 && (t.session.cipherSuite = s.getCipherSuite(g.getBytes(2)), null === t.session.cipherSuite); )
;
if (null === t.session.cipherSuite)
return t.error(t, {message: "No cipher suites in common.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.handshake_failure},cipherSuite: e.util.bytesToHex(i.cipher_suite)});
t.session.compressionMethod = o ? i.compression_method : s.CompressionMethod.none
}
return i
}, s.createSecurityParameters = function(e, t) {
var r = e.entity === s.ConnectionEnd.client, n = t.random.bytes(), i = r ? e.session.sp.client_random : n, a = r ? n : s.createRandom().getBytes();
e.session.sp = {entity: e.entity,prf_algorithm: s.PRFAlgorithm.tls_prf_sha256,bulk_cipher_algorithm: null,cipher_type: null,enc_key_length: null,block_length: null,fixed_iv_length: null,record_iv_length: null,mac_algorithm: null,mac_length: null,mac_key_length: null,compression_algorithm: e.session.compressionMethod,pre_master_secret: null,master_secret: null,client_random: i,server_random: a}
}, s.handleServerHello = function(e, t, r) {
var n = s.parseHelloMessage(e, t, r);
if (!e.fail) {
if (!(n.version.minor <= e.version.minor))
return e.error(e, {message: "Incompatible TLS version.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.protocol_version}});
e.version.minor = n.version.minor, e.session.version = e.version;
var i = n.session_id.bytes();
i.length > 0 && i === e.session.id ? (e.expect = d, e.session.resuming = !0, e.session.sp.server_random = n.random.bytes()) : (e.expect = l, e.session.resuming = !1, s.createSecurityParameters(e, n)), e.session.id = i, e.process()
}
}, s.handleClientHello = function(t, r, n) {
var i = s.parseHelloMessage(t, r, n);
if (!t.fail) {
var a = i.session_id.bytes(), o = null;
if (t.sessionCache && (o = t.sessionCache.getSession(a), null === o ? a = "" : (o.version.major !== i.version.major || o.version.minor > i.version.minor) && (o = null, a = "")), 0 === a.length && (a = e.random.getBytes(32)), t.session.id = a, t.session.clientHelloVersion = i.version, t.session.sp = {}, o)
t.version = t.session.version = o.version, t.session.sp = o.sp;
else {
for (var u, l = 1; l < s.SupportedVersions.length && (u = s.SupportedVersions[l], !(u.minor <= i.version.minor)); ++l)
;
t.version = {major: u.major,minor: u.minor}, t.session.version = t.version
}
null !== o ? (t.expect = E, t.session.resuming = !0, t.session.sp.client_random = i.random.bytes()) : (t.expect = t.verifyClient !== !1 ? v : b, t.session.resuming = !1, s.createSecurityParameters(t, i)), t.open = !0, s.queue(t, s.createRecord(t, {type: s.ContentType.handshake,data: s.createServerHello(t)})), t.session.resuming ? (s.queue(t, s.createRecord(t, {type: s.ContentType.change_cipher_spec,data: s.createChangeCipherSpec()})), t.state.pending = s.createConnectionState(t), t.state.current.write = t.state.pending.write, s.queue(t, s.createRecord(t, {type: s.ContentType.handshake,data: s.createFinished(t)}))) : (s.queue(t, s.createRecord(t, {type: s.ContentType.handshake,data: s.createCertificate(t)})), t.fail || (s.queue(t, s.createRecord(t, {type: s.ContentType.handshake,data: s.createServerKeyExchange(t)})), t.verifyClient !== !1 && s.queue(t, s.createRecord(t, {type: s.ContentType.handshake,data: s.createCertificateRequest(t)})), s.queue(t, s.createRecord(t, {type: s.ContentType.handshake,data: s.createServerHelloDone(t)})))), s.flush(t), t.process()
}
}, s.handleCertificate = function(t, r, n) {
if (3 > n)
return t.error(t, {message: "Invalid Certificate message. Message too short.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.illegal_parameter}});
var i, o, u = r.fragment, l = {certificate_list: a(u, 3)}, p = [];
try {
for (; l.certificate_list.length() > 0; )
i = a(l.certificate_list, 3), o = e.asn1.fromDer(i), i = e.pki.certificateFromAsn1(o, !0), p.push(i)
} catch (f) {
return t.error(t, {message: "Could not parse certificate list.",cause: f,send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.bad_certificate}})
}
var d = t.entity === s.ConnectionEnd.client;
!d && t.verifyClient !== !0 || 0 !== p.length ? 0 === p.length ? t.expect = d ? c : b : (d ? t.session.serverCertificate = p[0] : t.session.clientCertificate = p[0], s.verifyCertificateChain(t, p) && (t.expect = d ? c : b)) : t.error(t, {message: d ? "No server certificate provided." : "No client certificate provided.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.illegal_parameter}}), t.process()
}, s.handleServerKeyExchange = function(e, t, r) {
return r > 0 ? e.error(e, {message: "Invalid key parameters. Only RSA is supported.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.unsupported_certificate}}) : (e.expect = p, void e.process())
}, s.handleClientKeyExchange = function(t, r, n) {
if (48 > n)
return t.error(t, {message: "Invalid key parameters. Only RSA is supported.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.unsupported_certificate}});
var i = r.fragment, o = {enc_pre_master_secret: a(i, 2).getBytes()}, u = null;
if (t.getPrivateKey)
try {
u = t.getPrivateKey(t, t.session.serverCertificate), u = e.pki.privateKeyFromPem(u)
} catch (l) {
t.error(t, {message: "Could not get private key.",cause: l,send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.internal_error}})
}
if (null === u)
return t.error(t, {message: "No private key set.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.internal_error}});
try {
var c = t.session.sp;
c.pre_master_secret = u.decrypt(o.enc_pre_master_secret);
var p = t.session.clientHelloVersion;
if (p.major !== c.pre_master_secret.charCodeAt(0) || p.minor !== c.pre_master_secret.charCodeAt(1))
throw new Error("TLS version rollback attack detected.")
} catch (l) {
c.pre_master_secret = e.random.getBytes(48)
}
t.expect = E, null !== t.session.clientCertificate && (t.expect = _), t.process()
}, s.handleCertificateRequest = function(e, t, r) {
if (3 > r)
return e.error(e, {message: "Invalid CertificateRequest. Message too short.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.illegal_parameter}});
var n = t.fragment, i = {certificate_types: a(n, 1),certificate_authorities: a(n, 2)};
e.session.certificateRequest = i, e.expect = f, e.process()
}, s.handleCertificateVerify = function(t, r, n) {
if (2 > n)
return t.error(t, {message: "Invalid CertificateVerify. Message too short.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.illegal_parameter}});
var i = r.fragment;
i.read -= 4;
var o = i.bytes();
i.read += 4;
var u = {signature: a(i, 2).getBytes()}, l = e.util.createBuffer();
l.putBuffer(t.session.md5.digest()), l.putBuffer(t.session.sha1.digest()), l = l.getBytes();
try {
var c = t.session.clientCertificate;
if (!c.publicKey.verify(l, u.signature, "NONE"))
throw new Error("CertificateVerify signature does not match.");
t.session.md5.update(o), t.session.sha1.update(o)
} catch (p) {
return t.error(t, {message: "Bad signature in CertificateVerify.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.handshake_failure}})
}
t.expect = E, t.process()
}, s.handleServerHelloDone = function(t, r, n) {
if (n > 0)
return t.error(t, {message: "Invalid ServerHelloDone message. Invalid length.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.record_overflow}});
if (null === t.serverCertificate) {
var i = {message: "No server certificate provided. Not enough security.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.insufficient_security}}, a = 0, o = t.verify(t, i.alert.description, a, []);
if (o !== !0)
return (o || 0 === o) && ("object" != typeof o || e.util.isArray(o) ? "number" == typeof o && (i.alert.description = o) : (o.message && (i.message = o.message), o.alert && (i.alert.description = o.alert))), t.error(t, i)
}
null !== t.session.certificateRequest && (r = s.createRecord(t, {type: s.ContentType.handshake,data: s.createCertificate(t)}), s.queue(t, r)), r = s.createRecord(t, {type: s.ContentType.handshake,data: s.createClientKeyExchange(t)}), s.queue(t, r), t.expect = y;
var u = function(e, t) {
null !== e.session.certificateRequest && null !== e.session.clientCertificate && s.queue(e, s.createRecord(e, {type: s.ContentType.handshake,data: s.createCertificateVerify(e, t)})), s.queue(e, s.createRecord(e, {type: s.ContentType.change_cipher_spec,data: s.createChangeCipherSpec()})), e.state.pending = s.createConnectionState(e), e.state.current.write = e.state.pending.write, s.queue(e, s.createRecord(e, {type: s.ContentType.handshake,data: s.createFinished(e)})), e.expect = d, s.flush(e), e.process()
};
return null === t.session.certificateRequest || null === t.session.clientCertificate ? u(t, null) : void s.getClientSignature(t, u)
}, s.handleChangeCipherSpec = function(e, t) {
if (1 !== t.fragment.getByte())
return e.error(e, {message: "Invalid ChangeCipherSpec message received.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.illegal_parameter}});
var r = e.entity === s.ConnectionEnd.client;
(e.session.resuming && r || !e.session.resuming && !r) && (e.state.pending = s.createConnectionState(e)), e.state.current.read = e.state.pending.read, (!e.session.resuming && r || e.session.resuming && !r) && (e.state.pending = null), e.expect = r ? h : C, e.process()
}, s.handleFinished = function(r, n) {
var i = n.fragment;
i.read -= 4;
var a = i.bytes();
i.read += 4;
var o = n.fragment.getBytes();
i = e.util.createBuffer(), i.putBuffer(r.session.md5.digest()), i.putBuffer(r.session.sha1.digest());
var u = r.entity === s.ConnectionEnd.client, l = u ? "server finished" : "client finished", c = r.session.sp, p = 12, f = t;
return i = f(c.master_secret, l, i.getBytes(), p), i.getBytes() !== o ? r.error(r, {message: "Invalid verify_data in Finished message.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.decrypt_error}}) : (r.session.md5.update(a), r.session.sha1.update(a), (r.session.resuming && u || !r.session.resuming && !u) && (s.queue(r, s.createRecord(r, {type: s.ContentType.change_cipher_spec,data: s.createChangeCipherSpec()})), r.state.current.write = r.state.pending.write, r.state.pending = null, s.queue(r, s.createRecord(r, {type: s.ContentType.handshake,data: s.createFinished(r)}))), r.expect = u ? g : S, r.handshaking = !1, ++r.handshakes, r.peerCertificate = u ? r.session.serverCertificate : r.session.clientCertificate, s.flush(r), r.isConnected = !0, r.connected(r), void r.process())
}, s.handleAlert = function(e, t) {
var r, n = t.fragment, i = {level: n.getByte(),description: n.getByte()};
switch (i.description) {
case s.Alert.Description.close_notify:
r = "Connection closed.";
break;
case s.Alert.Description.unexpected_message:
r = "Unexpected message.";
break;
case s.Alert.Description.bad_record_mac:
r = "Bad record MAC.";
break;
case s.Alert.Description.decryption_failed:
r = "Decryption failed.";
break;
case s.Alert.Description.record_overflow:
r = "Record overflow.";
break;
case s.Alert.Description.decompression_failure:
r = "Decompression failed.";
break;
case s.Alert.Description.handshake_failure:
r = "Handshake failure.";
break;
case s.Alert.Description.bad_certificate:
r = "Bad certificate.";
break;
case s.Alert.Description.unsupported_certificate:
r = "Unsupported certificate.";
break;
case s.Alert.Description.certificate_revoked:
r = "Certificate revoked.";
break;
case s.Alert.Description.certificate_expired:
r = "Certificate expired.";
break;
case s.Alert.Description.certificate_unknown:
r = "Certificate unknown.";
break;
case s.Alert.Description.illegal_parameter:
r = "Illegal parameter.";
break;
case s.Alert.Description.unknown_ca:
r = "Unknown certificate authority.";
break;
case s.Alert.Description.access_denied:
r = "Access denied.";
break;
case s.Alert.Description.decode_error:
r = "Decode error.";
break;
case s.Alert.Description.decrypt_error:
r = "Decrypt error.";
break;
case s.Alert.Description.export_restriction:
r = "Export restriction.";
break;
case s.Alert.Description.protocol_version:
r = "Unsupported protocol version.";
break;
case s.Alert.Description.insufficient_security:
r = "Insufficient security.";
break;
case s.Alert.Description.internal_error:
r = "Internal error.";
break;
case s.Alert.Description.user_canceled:
r = "User canceled.";
break;
case s.Alert.Description.no_renegotiation:
r = "Renegotiation not supported.";
break;
default:
r = "Unknown error."
}
return i.description === s.Alert.Description.close_notify ? e.close() : (e.error(e, {message: r,send: !1,origin: e.entity === s.ConnectionEnd.client ? "server" : "client",alert: i}), void e.process())
}, s.handleHandshake = function(t, r) {
var n = r.fragment, i = n.getByte(), a = n.getInt24();
if (a > n.length())
return t.fragmented = r, r.fragment = e.util.createBuffer(), n.read -= 4, t.process();
t.fragmented = null, n.read -= 4;
var o = n.bytes(a + 4);
n.read += 4, i in M[t.entity][t.expect] ? (t.entity !== s.ConnectionEnd.server || t.open || t.fail || (t.handshaking = !0, t.session = {version: null,extensions: {server_name: {serverNameList: []}},cipherSuite: null,compressionMethod: null,serverCertificate: null,clientCertificate: null,md5: e.md.md5.create(),sha1: e.md.sha1.create()}), i !== s.HandshakeType.hello_request && i !== s.HandshakeType.certificate_verify && i !== s.HandshakeType.finished && (t.session.md5.update(o), t.session.sha1.update(o)), M[t.entity][t.expect][i](t, r, a)) : s.handleUnexpected(t, r)
}, s.handleApplicationData = function(e, t) {
e.data.putBuffer(t.fragment), e.dataReady(e), e.process()
}, s.handleHeartbeat = function(t, r) {
var n = r.fragment, i = n.getByte(), a = n.getInt16(), o = n.getBytes(a);
if (i === s.HeartbeatMessageType.heartbeat_request) {
if (t.handshaking || a > o.length)
return t.process();
s.queue(t, s.createRecord(t, {type: s.ContentType.heartbeat,data: s.createHeartbeat(s.HeartbeatMessageType.heartbeat_response, o)})), s.flush(t)
} else if (i === s.HeartbeatMessageType.heartbeat_response) {
if (o !== t.expectedHeartbeatPayload)
return t.process();
t.heartbeatReceived && t.heartbeatReceived(t, e.util.createBuffer(o))
}
t.process()
};
var u = 0, l = 1, c = 2, p = 3, f = 4, d = 5, h = 6, g = 7, y = 8, m = 0, v = 1, b = 2, _ = 3, E = 4, C = 5, S = 6, A = s.handleUnexpected, T = s.handleChangeCipherSpec, w = s.handleAlert, k = s.handleHandshake, I = s.handleApplicationData, x = s.handleHeartbeat, D = [];
D[s.ConnectionEnd.client] = [[A, w, k, A, x], [A, w, k, A, x], [A, w, k, A, x], [A, w, k, A, x], [A, w, k, A, x], [T, w, A, A, x], [A, w, k, A, x], [A, w, k, I, x], [A, w, k, A, x]], D[s.ConnectionEnd.server] = [[A, w, k, A, x], [A, w, k, A, x], [A, w, k, A, x], [A, w, k, A, x], [T, w, A, A, x], [A, w, k, A, x], [A, w, k, I, x], [A, w, k, A, x]];
var N = s.handleHelloRequest, B = s.handleServerHello, L = s.handleCertificate, R = s.handleServerKeyExchange, P = s.handleCertificateRequest, O = s.handleServerHelloDone, U = s.handleFinished, M = [];
M[s.ConnectionEnd.client] = [[A, A, B, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, L, R, P, O, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, A, R, P, O, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, A, A, P, O, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, A, A, A, O, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, U], [N, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [N, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A]];
var F = s.handleClientHello, j = s.handleClientKeyExchange, V = s.handleCertificateVerify;
M[s.ConnectionEnd.server] = [[A, F, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, L, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, j, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, V, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, U], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A], [A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A, A]], s.generateKeys = function(e, r) {
var n = t, i = r.client_random + r.server_random;
e.session.resuming || (r.master_secret = n(r.pre_master_secret, "master secret", i, 48).bytes(), r.pre_master_secret = null), i = r.server_random + r.client_random;
var a = 2 * r.mac_key_length + 2 * r.enc_key_length, o = e.version.major === s.Versions.TLS_1_0.major && e.version.minor === s.Versions.TLS_1_0.minor;
o && (a += 2 * r.fixed_iv_length);
var u = n(r.master_secret, "key expansion", i, a), l = {client_write_MAC_key: u.getBytes(r.mac_key_length),server_write_MAC_key: u.getBytes(r.mac_key_length),client_write_key: u.getBytes(r.enc_key_length),server_write_key: u.getBytes(r.enc_key_length)};
return o && (l.client_write_IV = u.getBytes(r.fixed_iv_length), l.server_write_IV = u.getBytes(r.fixed_iv_length)), l
}, s.createConnectionState = function(e) {
var t = e.entity === s.ConnectionEnd.client, r = function() {
var e = {sequenceNumber: [0, 0],macKey: null,macLength: 0,macFunction: null,cipherState: null,cipherFunction: function() {
return !0
},compressionState: null,compressFunction: function() {
return !0
},updateSequenceNumber: function() {
4294967295 === e.sequenceNumber[1] ? (e.sequenceNumber[1] = 0, ++e.sequenceNumber[0]) : ++e.sequenceNumber[1]
}};
return e
}, a = {read: r(),write: r()};
if (a.read.update = function(e, t) {
return a.read.cipherFunction(t, a.read) ? a.read.compressFunction(e, t, a.read) || e.error(e, {message: "Could not decompress record.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.decompression_failure}}) : e.error(e, {message: "Could not decrypt record or bad MAC.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.bad_record_mac}}), !e.fail
}, a.write.update = function(e, t) {
return a.write.compressFunction(e, t, a.write) ? a.write.cipherFunction(t, a.write) || e.error(e, {message: "Could not encrypt record.",send: !1,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.internal_error}}) : e.error(e, {message: "Could not compress record.",send: !1,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.internal_error}}), !e.fail
}, e.session) {
var o = e.session.sp;
switch (e.session.cipherSuite.initSecurityParameters(o), o.keys = s.generateKeys(e, o), a.read.macKey = t ? o.keys.server_write_MAC_key : o.keys.client_write_MAC_key, a.write.macKey = t ? o.keys.client_write_MAC_key : o.keys.server_write_MAC_key, e.session.cipherSuite.initConnectionState(a, e, o), o.compression_algorithm) {
case s.CompressionMethod.none:
break;
case s.CompressionMethod.deflate:
a.read.compressFunction = i, a.write.compressFunction = n;
break;
default:
throw new Error("Unsupported compression algorithm.")
}
}
return a
}, s.createRandom = function() {
var t = new Date, r = +t + 6e4 * t.getTimezoneOffset(), n = e.util.createBuffer();
return n.putInt32(r), n.putBytes(e.random.getBytes(28)), n
}, s.createRecord = function(e, t) {
if (!t.data)
return null;
var r = {type: t.type,version: {major: e.version.major,minor: e.version.minor},length: t.data.length(),fragment: t.data};
return r
}, s.createAlert = function(t, r) {
var n = e.util.createBuffer();
return n.putByte(r.level), n.putByte(r.description), s.createRecord(t, {type: s.ContentType.alert,data: n})
}, s.createClientHello = function(t) {
t.session.clientHelloVersion = {major: t.version.major,minor: t.version.minor};
for (var r = e.util.createBuffer(), n = 0; n < t.cipherSuites.length; ++n) {
var i = t.cipherSuites[n];
r.putByte(i.id[0]), r.putByte(i.id[1])
}
var a = r.length(), u = e.util.createBuffer();
u.putByte(s.CompressionMethod.none);
var l = u.length(), c = e.util.createBuffer();
if (t.virtualHost) {
var p = e.util.createBuffer();
p.putByte(0), p.putByte(0);
var f = e.util.createBuffer();
f.putByte(0), o(f, 2, e.util.createBuffer(t.virtualHost));
var d = e.util.createBuffer();
o(d, 2, f), o(p, 2, d), c.putBuffer(p)
}
var h = c.length();
h > 0 && (h += 2);
var g = t.session.id, y = g.length + 1 + 2 + 4 + 28 + 2 + a + 1 + l + h, m = e.util.createBuffer();
return m.putByte(s.HandshakeType.client_hello), m.putInt24(y), m.putByte(t.version.major), m.putByte(t.version.minor), m.putBytes(t.session.sp.client_random), o(m, 1, e.util.createBuffer(g)), o(m, 2, r), o(m, 1, u), h > 0 && o(m, 2, c), m
}, s.createServerHello = function(t) {
var r = t.session.id, n = r.length + 1 + 2 + 4 + 28 + 2 + 1, i = e.util.createBuffer();
return i.putByte(s.HandshakeType.server_hello), i.putInt24(n), i.putByte(t.version.major), i.putByte(t.version.minor), i.putBytes(t.session.sp.server_random), o(i, 1, e.util.createBuffer(r)), i.putByte(t.session.cipherSuite.id[0]), i.putByte(t.session.cipherSuite.id[1]), i.putByte(t.session.compressionMethod), i
}, s.createCertificate = function(t) {
var r = t.entity === s.ConnectionEnd.client, n = null;
if (t.getCertificate) {
var i;
i = r ? t.session.certificateRequest : t.session.extensions.server_name.serverNameList, n = t.getCertificate(t, i)
}
var a = e.util.createBuffer();
if (null !== n)
try {
e.util.isArray(n) || (n = [n]);
for (var u = null, l = 0; l < n.length; ++l) {
var c = e.pem.decode(n[l])[0];
if ("CERTIFICATE" !== c.type && "X509 CERTIFICATE" !== c.type && "TRUSTED CERTIFICATE" !== c.type) {
var p = new Error('Could not convert certificate from PEM; PEM header type is not "CERTIFICATE", "X509 CERTIFICATE", or "TRUSTED CERTIFICATE".');
throw p.headerType = c.type, p
}
if (c.procType && "ENCRYPTED" === c.procType.type)
throw new Error("Could not convert certificate from PEM; PEM is encrypted.");
var f = e.util.createBuffer(c.body);
null === u && (u = e.asn1.fromDer(f.bytes(), !1));
var d = e.util.createBuffer();
o(d, 3, f), a.putBuffer(d)
}
n = e.pki.certificateFromAsn1(u), r ? t.session.clientCertificate = n : t.session.serverCertificate = n
} catch (h) {
return t.error(t, {message: "Could not send certificate list.",cause: h,send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.bad_certificate}})
}
var g = 3 + a.length(), y = e.util.createBuffer();
return y.putByte(s.HandshakeType.certificate), y.putInt24(g), o(y, 3, a), y
}, s.createClientKeyExchange = function(t) {
var r = e.util.createBuffer();
r.putByte(t.session.clientHelloVersion.major), r.putByte(t.session.clientHelloVersion.minor), r.putBytes(e.random.getBytes(46));
var n = t.session.sp;
n.pre_master_secret = r.getBytes();
var i = t.session.serverCertificate.publicKey;
r = i.encrypt(n.pre_master_secret);
var a = r.length + 2, o = e.util.createBuffer();
return o.putByte(s.HandshakeType.client_key_exchange), o.putInt24(a), o.putInt16(r.length), o.putBytes(r), o
}, s.createServerKeyExchange = function() {
var t = 0, r = e.util.createBuffer();
return t > 0 && (r.putByte(s.HandshakeType.server_key_exchange), r.putInt24(t)), r
}, s.getClientSignature = function(t, r) {
var n = e.util.createBuffer();
n.putBuffer(t.session.md5.digest()), n.putBuffer(t.session.sha1.digest()), n = n.getBytes(), t.getSignature = t.getSignature || function(t, r, n) {
var i = null;
if (t.getPrivateKey)
try {
i = t.getPrivateKey(t, t.session.clientCertificate), i = e.pki.privateKeyFromPem(i)
} catch (a) {
t.error(t, {message: "Could not get private key.",cause: a,send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.internal_error}})
}
null === i ? t.error(t, {message: "No private key set.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.internal_error}}) : r = i.sign(r, null), n(t, r)
}, t.getSignature(t, n, r)
}, s.createCertificateVerify = function(t, r) {
var n = r.length + 2, i = e.util.createBuffer();
return i.putByte(s.HandshakeType.certificate_verify), i.putInt24(n), i.putInt16(r.length), i.putBytes(r), i
}, s.createCertificateRequest = function(t) {
var r = e.util.createBuffer();
r.putByte(1);
var n = e.util.createBuffer();
for (var i in t.caStore.certs) {
var a = t.caStore.certs[i], u = e.pki.distinguishedNameToAsn1(a.subject);
n.putBuffer(e.asn1.toDer(u))
}
var l = 1 + r.length() + 2 + n.length(), c = e.util.createBuffer();
return c.putByte(s.HandshakeType.certificate_request), c.putInt24(l), o(c, 1, r), o(c, 2, n), c
}, s.createServerHelloDone = function() {
var t = e.util.createBuffer();
return t.putByte(s.HandshakeType.server_hello_done), t.putInt24(0), t
}, s.createChangeCipherSpec = function() {
var t = e.util.createBuffer();
return t.putByte(1), t
}, s.createFinished = function(r) {
var n = e.util.createBuffer();
n.putBuffer(r.session.md5.digest()), n.putBuffer(r.session.sha1.digest());
var i = r.entity === s.ConnectionEnd.client, a = r.session.sp, o = 12, u = t, l = i ? "client finished" : "server finished";
n = u(a.master_secret, l, n.getBytes(), o);
var c = e.util.createBuffer();
return c.putByte(s.HandshakeType.finished), c.putInt24(n.length()), c.putBuffer(n), c
}, s.createHeartbeat = function(t, r, n) {
"undefined" == typeof n && (n = r.length);
var i = e.util.createBuffer();
i.putByte(t), i.putInt16(n), i.putBytes(r);
var a = i.length(), o = Math.max(16, a - n - 3);
return i.putBytes(e.random.getBytes(o)), i
}, s.queue = function(t, r) {
if (r) {
if (r.type === s.ContentType.handshake) {
var n = r.fragment.bytes();
t.session.md5.update(n), t.session.sha1.update(n), n = null
}
var i;
if (r.fragment.length() <= s.MaxFragment)
i = [r];
else {
i = [];
for (var a = r.fragment.bytes(); a.length > s.MaxFragment; )
i.push(s.createRecord(t, {type: r.type,data: e.util.createBuffer(a.slice(0, s.MaxFragment))})), a = a.slice(s.MaxFragment);
a.length > 0 && i.push(s.createRecord(t, {type: r.type,data: e.util.createBuffer(a)}))
}
for (var o = 0; o < i.length && !t.fail; ++o) {
var u = i[o], l = t.state.current.write;
l.update(t, u) && t.records.push(u)
}
}
}, s.flush = function(e) {
for (var t = 0; t < e.records.length; ++t) {
var r = e.records[t];
e.tlsData.putByte(r.type), e.tlsData.putByte(r.version.major), e.tlsData.putByte(r.version.minor), e.tlsData.putInt16(r.fragment.length()), e.tlsData.putBuffer(e.records[t].fragment)
}
return e.records = [], e.tlsDataReady(e)
};
var H = function(t) {
switch (t) {
case !0:
return !0;
case e.pki.certificateError.bad_certificate:
return s.Alert.Description.bad_certificate;
case e.pki.certificateError.unsupported_certificate:
return s.Alert.Description.unsupported_certificate;
case e.pki.certificateError.certificate_revoked:
return s.Alert.Description.certificate_revoked;
case e.pki.certificateError.certificate_expired:
return s.Alert.Description.certificate_expired;
case e.pki.certificateError.certificate_unknown:
return s.Alert.Description.certificate_unknown;
case e.pki.certificateError.unknown_ca:
return s.Alert.Description.unknown_ca;
default:
return s.Alert.Description.bad_certificate
}
}, q = function(t) {
switch (t) {
case !0:
return !0;
case s.Alert.Description.bad_certificate:
return e.pki.certificateError.bad_certificate;
case s.Alert.Description.unsupported_certificate:
return e.pki.certificateError.unsupported_certificate;
case s.Alert.Description.certificate_revoked:
return e.pki.certificateError.certificate_revoked;
case s.Alert.Description.certificate_expired:
return e.pki.certificateError.certificate_expired;
case s.Alert.Description.certificate_unknown:
return e.pki.certificateError.certificate_unknown;
case s.Alert.Description.unknown_ca:
return e.pki.certificateError.unknown_ca;
default:
return e.pki.certificateError.bad_certificate
}
};
s.verifyCertificateChain = function(t, r) {
try {
e.pki.verifyCertificateChain(t.caStore, r, function(r, n, i) {
var a = (H(r), t.verify(t, r, n, i));
if (a !== !0) {
if ("object" == typeof a && !e.util.isArray(a)) {
var o = new Error("The application rejected the certificate.");
throw o.send = !0, o.alert = {level: s.Alert.Level.fatal,description: s.Alert.Description.bad_certificate}, a.message && (o.message = a.message), a.alert && (o.alert.description = a.alert), o
}
a !== r && (a = q(a))
}
return a
})
} catch (n) {
var i = n;
("object" != typeof i || e.util.isArray(i)) && (i = {send: !0,alert: {level: s.Alert.Level.fatal,description: H(n)}}), "send" in i || (i.send = !0), "alert" in i || (i.alert = {level: s.Alert.Level.fatal,description: H(i.error)}), t.error(t, i)
}
return !t.fail
}, s.createSessionCache = function(t, r) {
var n = null;
if (t && t.getSession && t.setSession && t.order)
n = t;
else {
n = {}, n.cache = t || {}, n.capacity = Math.max(r || 100, 1), n.order = [];
for (var i in t)
n.order.length <= r ? n.order.push(i) : delete t[i];
n.getSession = function(t) {
var r = null, i = null;
if (t ? i = e.util.bytesToHex(t) : n.order.length > 0 && (i = n.order[0]), null !== i && i in n.cache) {
r = n.cache[i], delete n.cache[i];
for (var a in n.order)
if (n.order[a] === i) {
n.order.splice(a, 1);
break
}
}
return r
}, n.setSession = function(t, r) {
if (n.order.length === n.capacity) {
var i = n.order.shift();
delete n.cache[i]
}
var i = e.util.bytesToHex(t);
n.order.push(i), n.cache[i] = r
}
}
return n
}, s.createConnection = function(t) {
var r = null;
r = t.caStore ? e.util.isArray(t.caStore) ? e.pki.createCaStore(t.caStore) : t.caStore : e.pki.createCaStore();
var n = t.cipherSuites || null;
if (null === n) {
n = [];
for (var i in s.CipherSuites)
n.push(s.CipherSuites[i])
}
var a = t.server ? s.ConnectionEnd.server : s.ConnectionEnd.client, o = t.sessionCache ? s.createSessionCache(t.sessionCache) : null, l = {version: {major: s.Version.major,minor: s.Version.minor},entity: a,sessionId: t.sessionId,caStore: r,sessionCache: o,cipherSuites: n,connected: t.connected,virtualHost: t.virtualHost || null,verifyClient: t.verifyClient || !1,verify: t.verify || function(e, t) {
return t
},getCertificate: t.getCertificate || null,getPrivateKey: t.getPrivateKey || null,getSignature: t.getSignature || null,input: e.util.createBuffer(),tlsData: e.util.createBuffer(),data: e.util.createBuffer(),tlsDataReady: t.tlsDataReady,dataReady: t.dataReady,heartbeatReceived: t.heartbeatReceived,closed: t.closed,error: function(e, r) {
r.origin = r.origin || (e.entity === s.ConnectionEnd.client ? "client" : "server"), r.send && (s.queue(e, s.createAlert(e, r.alert)), s.flush(e));
var n = r.fatal !== !1;
n && (e.fail = !0), t.error(e, r), n && e.close(!1)
},deflate: t.deflate || null,inflate: t.inflate || null};
l.reset = function(e) {
l.version = {major: s.Version.major,minor: s.Version.minor}, l.record = null, l.session = null, l.peerCertificate = null, l.state = {pending: null,current: null}, l.expect = l.entity === s.ConnectionEnd.client ? u : m, l.fragmented = null, l.records = [], l.open = !1, l.handshakes = 0, l.handshaking = !1, l.isConnected = !1, l.fail = !(e || "undefined" == typeof e), l.input.clear(), l.tlsData.clear(), l.data.clear(), l.state.current = s.createConnectionState(l)
}, l.reset();
var c = function(e, t) {
var r = t.type - s.ContentType.change_cipher_spec, n = D[e.entity][e.expect];
r in n ? n[r](e, t) : s.handleUnexpected(e, t)
}, p = function(t) {
var r = 0, n = t.input, i = n.length();
if (5 > i)
r = 5 - i;
else {
t.record = {type: n.getByte(),version: {major: n.getByte(),minor: n.getByte()},length: n.getInt16(),fragment: e.util.createBuffer(),ready: !1};
var a = t.record.version.major === t.version.major;
a && t.session && t.session.version && (a = t.record.version.minor === t.version.minor), a || t.error(t, {message: "Incompatible TLS version.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.protocol_version}})
}
return r
}, f = function(e) {
var t = 0, r = e.input, n = r.length();
if (n < e.record.length)
t = e.record.length - n;
else {
e.record.fragment.putBytes(r.getBytes(e.record.length)), r.compact();
var i = e.state.current.read;
i.update(e, e.record) && (null !== e.fragmented && (e.fragmented.type === e.record.type ? (e.fragmented.fragment.putBuffer(e.record.fragment), e.record = e.fragmented) : e.error(e, {message: "Invalid fragmented record.",send: !0,alert: {level: s.Alert.Level.fatal,description: s.Alert.Description.unexpected_message}})), e.record.ready = !0)
}
return t
};
return l.handshake = function(t) {
if (l.entity !== s.ConnectionEnd.client)
l.error(l, {message: "Cannot initiate handshake as a server.",fatal: !1});
else if (l.handshaking)
l.error(l, {message: "Handshake already in progress.",fatal: !1});
else {
l.fail && !l.open && 0 === l.handshakes && (l.fail = !1), l.handshaking = !0, t = t || "";
var r = null;
t.length > 0 && (l.sessionCache && (r = l.sessionCache.getSession(t)), null === r && (t = "")), 0 === t.length && l.sessionCache && (r = l.sessionCache.getSession(), null !== r && (t = r.id)), l.session = {id: t,version: null,cipherSuite: null,compressionMethod: null,serverCertificate: null,certificateRequest: null,clientCertificate: null,sp: {},md5: e.md.md5.create(),sha1: e.md.sha1.create()}, r && (l.version = r.version, l.session.sp = r.sp), l.session.sp.client_random = s.createRandom().getBytes(), l.open = !0, s.queue(l, s.createRecord(l, {type: s.ContentType.handshake,data: s.createClientHello(l)})), s.flush(l)
}
}, l.process = function(e) {
var t = 0;
return e && l.input.putBytes(e), l.fail || (null !== l.record && l.record.ready && l.record.fragment.isEmpty() && (l.record = null), null === l.record && (t = p(l)), l.fail || null === l.record || l.record.ready || (t = f(l)), !l.fail && null !== l.record && l.record.ready && c(l, l.record)), t
}, l.prepare = function(t) {
return s.queue(l, s.createRecord(l, {type: s.ContentType.application_data,data: e.util.createBuffer(t)})), s.flush(l)
}, l.prepareHeartbeatRequest = function(t, r) {
return t instanceof e.util.ByteBuffer && (t = t.bytes()), "undefined" == typeof r && (r = t.length), l.expectedHeartbeatPayload = t, s.queue(l, s.createRecord(l, {type: s.ContentType.heartbeat,data: s.createHeartbeat(s.HeartbeatMessageType.heartbeat_request, t, r)})), s.flush(l)
}, l.close = function(e) {
if (!l.fail && l.sessionCache && l.session) {
var t = {id: l.session.id,version: l.session.version,sp: l.session.sp};
t.sp.keys = null, l.sessionCache.setSession(t.id, t)
}
l.open && (l.open = !1, l.input.clear(), (l.isConnected || l.handshaking) && (l.isConnected = l.handshaking = !1, s.queue(l, s.createAlert(l, {level: s.Alert.Level.warning,description: s.Alert.Description.close_notify})), s.flush(l)), l.closed(l)), l.reset(e)
}, l
}, e.tls = e.tls || {};
for (var K in s)
"function" != typeof s[K] && (e.tls[K] = s[K]);
e.tls.prf_tls1 = t, e.tls.hmac_sha1 = r, e.tls.createSessionCache = s.createSessionCache, e.tls.createConnection = s.createConnection
}
var t = "tls";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
var o, s = function(r, n) {
n.exports = function(n) {
var i = o.map(function(e) {
return r(e)
}).concat(e);
if (n = n || {}, n.defined = n.defined || {}, n.defined[t])
return n[t];
n.defined[t] = !0;
for (var a = 0; a < i.length; ++a)
i[a](n);
return n[t]
}
}, u = a;
(a = function(e, t) {
return o = "string" == typeof e ? t.slice(2) : e.slice(2), r ? (delete a, u.apply(null, Array.prototype.slice.call(arguments, 0))) : (a = u, a.apply(null, Array.prototype.slice.call(arguments, 0)))
})("js/tls", ["require", "module", "./asn1", "./hmac", "./md", "./pem", "./pki", "./random", "./util"], function() {
s.apply(null, Array.prototype.slice.call(arguments, 0))
})
}(), function() {
function e(e) {
function t(t, n, i) {
var s = n.entity === e.tls.ConnectionEnd.client;
t.read.cipherState = {init: !1,cipher: e.cipher.createDecipher("AES-CBC", s ? i.keys.server_write_key : i.keys.client_write_key),iv: s ? i.keys.server_write_IV : i.keys.client_write_IV}, t.write.cipherState = {init: !1,cipher: e.cipher.createCipher("AES-CBC", s ? i.keys.client_write_key : i.keys.server_write_key),iv: s ? i.keys.client_write_IV : i.keys.server_write_IV}, t.read.cipherFunction = a, t.write.cipherFunction = r, t.read.macLength = t.write.macLength = i.mac_length, t.read.macFunction = t.write.macFunction = o.hmac_sha1
}
function r(t, r) {
var i = !1, a = r.macFunction(r.macKey, r.sequenceNumber, t);
t.fragment.putBytes(a), r.updateSequenceNumber();
var s;
s = t.version.minor === o.Versions.TLS_1_0.minor ? r.cipherState.init ? null : r.cipherState.iv : e.random.getBytesSync(16), r.cipherState.init = !0;
var u = r.cipherState.cipher;
return u.start({iv: s}), t.version.minor >= o.Versions.TLS_1_1.minor && u.output.putBytes(s), u.update(t.fragment), u.finish(n) && (t.fragment = u.output, t.length = t.fragment.length(), i = !0), i
}
function n(e, t, r) {
if (!r) {
var n = e - t.length() % e;
t.fillWithByte(n - 1, n)
}
return !0
}
function i(e, t, r) {
var n = !0;
if (r) {
for (var i = t.length(), a = t.last(), o = i - 1 - a; i - 1 > o; ++o)
n = n && t.at(o) == a;
n && t.truncate(a + 1)
}
return n
}
function a(t, r) {
var n = !1;
++s;
var a;
a = t.version.minor === o.Versions.TLS_1_0.minor ? r.cipherState.init ? null : r.cipherState.iv : t.fragment.getBytes(16), r.cipherState.init = !0;
var u = r.cipherState.cipher;
u.start({iv: a}), u.update(t.fragment), n = u.finish(i);
for (var l = r.macLength, c = "", p = 0; l > p; ++p)
c += String.fromCharCode(0);
var f = u.output.length();
f >= l ? (t.fragment = u.output.getBytes(f - l), c = u.output.getBytes(l)) : t.fragment = u.output.getBytes(), t.fragment = e.util.createBuffer(t.fragment), t.length = t.fragment.length();
var d = r.macFunction(r.macKey, r.sequenceNumber, t);
return r.updateSequenceNumber(), n = d === c && n
}
var o = e.tls;
o.CipherSuites.TLS_RSA_WITH_AES_128_CBC_SHA = {id: [0, 47],name: "TLS_RSA_WITH_AES_128_CBC_SHA",initSecurityParameters: function(e) {
e.bulk_cipher_algorithm = o.BulkCipherAlgorithm.aes, e.cipher_type = o.CipherType.block, e.enc_key_length = 16, e.block_length = 16, e.fixed_iv_length = 16, e.record_iv_length = 16, e.mac_algorithm = o.MACAlgorithm.hmac_sha1, e.mac_length = 20, e.mac_key_length = 20
},initConnectionState: t}, o.CipherSuites.TLS_RSA_WITH_AES_256_CBC_SHA = {id: [0, 53],name: "TLS_RSA_WITH_AES_256_CBC_SHA",initSecurityParameters: function(e) {
e.bulk_cipher_algorithm = o.BulkCipherAlgorithm.aes, e.cipher_type = o.CipherType.block, e.enc_key_length = 32, e.block_length = 16, e.fixed_iv_length = 16, e.record_iv_length = 16, e.mac_algorithm = o.MACAlgorithm.hmac_sha1, e.mac_length = 20, e.mac_key_length = 20
},initConnectionState: t};
var s = 0
}
var t = "aesCipherSuites";
if ("function" != typeof a) {
if ("object" != typeof n || !n.exports)
return "undefined" == typeof forge && (forge = {}), e(forge);
var r = !0;
a = function(e, t) {
t(i, n)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment