Skip to content

Instantly share code, notes, and snippets.

@mykhas
Last active December 20, 2015 19:38
Show Gist options
  • Save mykhas/6184301 to your computer and use it in GitHub Desktop.
Save mykhas/6184301 to your computer and use it in GitHub Desktop.
! function (e, t) {
function n(e) {
var t, n, r = O[e] = {};
for (e = e.split(/\s+/), t = 0, n = e.length; n > t; t++) r[e[t]] = !0;
return r
}
function r(e, n, r) {
if (r === t && 1 === e.nodeType) {
var i = "data-" + n.replace(q, "-$1").toLowerCase();
if (r = e.getAttribute(i), "string" == typeof r) {
try {
r = "true" === r ? !0 : "false" === r ? !1 : "null" === r ? null : H.isNumeric(r) ? +r : P.test(r) ? H.parseJSON(r) : r
} catch (o) {}
H.data(e, n, r)
} else r = t
}
return r
}
function i(e) {
for (var t in e)
if (("data" !== t || !H.isEmptyObject(e[t])) && "toJSON" !== t) return !1;
return !0
}
function o(e, t, n) {
var r = t + "defer",
i = t + "queue",
o = t + "mark",
a = H._data(e, r);
!a || "queue" !== n && H._data(e, i) || "mark" !== n && H._data(e, o) || setTimeout(function () {
H._data(e, i) || H._data(e, o) || (H.removeData(e, r, !0), a.fire())
}, 0)
}
function a() {
return !1
}
function s() {
return !0
}
function l(e) {
return !e || !e.parentNode || 11 === e.parentNode.nodeType
}
function u(e, t, n) {
if (t = t || 0, H.isFunction(t)) return H.grep(e, function (e, r) {
var i = !! t.call(e, r, e);
return i === n
});
if (t.nodeType) return H.grep(e, function (e) {
return e === t === n
});
if ("string" == typeof t) {
var r = H.grep(e, function (e) {
return 1 === e.nodeType
});
if (ct.test(t)) return H.filter(t, r, !n);
t = H.filter(t, r)
}
return H.grep(e, function (e) {
return H.inArray(e, t) >= 0 === n
})
}
function c(e) {
var t = ht.split("|"),
n = e.createDocumentFragment();
if (n.createElement)
for (; t.length;) n.createElement(t.pop());
return n
}
function f(e) {
return H.nodeName(e, "table") ? e.getElementsByTagName("tbody")[0] || e.appendChild(e.ownerDocument.createElement("tbody")) : e
}
function d(e, t) {
if (1 === t.nodeType && H.hasData(e)) {
var n, r, i, o = H._data(e),
a = H._data(t, o),
s = o.events;
if (s) {
delete a.handle, a.events = {};
for (n in s)
for (r = 0, i = s[n].length; i > r; r++) H.event.add(t, n, s[n][r])
}
a.data && (a.data = H.extend({}, a.data))
}
}
function p(e, t) {
var n;
1 === t.nodeType && (t.clearAttributes && t.clearAttributes(), t.mergeAttributes && t.mergeAttributes(e), n = t.nodeName.toLowerCase(), "object" === n ? t.outerHTML = e.outerHTML : "input" !== n || "checkbox" !== e.type && "radio" !== e.type ? "option" === n ? t.selected = e.defaultSelected : "input" === n || "textarea" === n ? t.defaultValue = e.defaultValue : "script" === n && t.text !== e.text && (t.text = e.text) : (e.checked && (t.defaultChecked = t.checked = e.checked), t.value !== e.value && (t.value = e.value)), t.removeAttribute(H.expando), t.removeAttribute("_submit_attached"), t.removeAttribute("_change_attached"))
}
function h(e) {
return "undefined" != typeof e.getElementsByTagName ? e.getElementsByTagName("*") : "undefined" != typeof e.querySelectorAll ? e.querySelectorAll("*") : []
}
function m(e) {
("checkbox" === e.type || "radio" === e.type) && (e.defaultChecked = e.checked)
}
function g(e) {
var t = (e.nodeName || "").toLowerCase();
"input" === t ? m(e) : "script" !== t && "undefined" != typeof e.getElementsByTagName && H.grep(e.getElementsByTagName("input"), m)
}
function y(e) {
var t = F.createElement("div");
return At.appendChild(t), t.innerHTML = e.outerHTML, t.firstChild
}
function v(e, t, n) {
var r = "width" === t ? e.offsetWidth : e.offsetHeight,
i = "width" === t ? 1 : 0,
o = 4;
if (r > 0) {
if ("border" !== n)
for (; o > i; i += 2) n || (r -= parseFloat(H.css(e, "padding" + Wt[i])) || 0), "margin" === n ? r += parseFloat(H.css(e, n + Wt[i])) || 0 : r -= parseFloat(H.css(e, "border" + Wt[i] + "Width")) || 0;
return r + "px"
}
if (r = Lt(e, t), (0 > r || null == r) && (r = e.style[t]), Ot.test(r)) return r;
if (r = parseFloat(r) || 0, n)
for (; o > i; i += 2) r += parseFloat(H.css(e, "padding" + Wt[i])) || 0, "padding" !== n && (r += parseFloat(H.css(e, "border" + Wt[i] + "Width")) || 0), "margin" === n && (r += parseFloat(H.css(e, n + Wt[i])) || 0);
return r + "px"
}
function b(e) {
return function (t, n) {
if ("string" != typeof t && (n = t, t = "*"), H.isFunction(n))
for (var r, i, o, a = t.toLowerCase().split(tn), s = 0, l = a.length; l > s; s++) r = a[s], o = /^\+/.test(r), o && (r = r.substr(1) || "*"), i = e[r] = e[r] || [], i[o ? "unshift" : "push"](n)
}
}
function x(e, n, r, i, o, a) {
o = o || n.dataTypes[0], a = a || {}, a[o] = !0;
for (var s, l = e[o], u = 0, c = l ? l.length : 0, f = e === an; c > u && (f || !s); u++) s = l[u](n, r, i), "string" == typeof s && (!f || a[s] ? s = t : (n.dataTypes.unshift(s), s = x(e, n, r, i, s, a)));
return !f && s || a["*"] || (s = x(e, n, r, i, "*", a)), s
}
function T(e, n) {
var r, i, o = H.ajaxSettings.flatOptions || {};
for (r in n) n[r] !== t && ((o[r] ? e : i || (i = {}))[r] = n[r]);
i && H.extend(!0, e, i)
}
function w(e, t, n, r) {
if (H.isArray(t)) H.each(t, function (t, i) {
n || Xt.test(e) ? r(e, i) : w(e + "[" + ("object" == typeof i ? t : "") + "]", i, n, r)
});
else if (n || "object" !== H.type(t)) r(e, t);
else
for (var i in t) w(e + "[" + i + "]", t[i], n, r)
}
function N(e, n, r) {
var i, o, a, s, l = e.contents,
u = e.dataTypes,
c = e.responseFields;
for (o in c) o in r && (n[c[o]] = r[o]);
for (;
"*" === u[0];) u.shift(), i === t && (i = e.mimeType || n.getResponseHeader("content-type"));
if (i)
for (o in l)
if (l[o] && l[o].test(i)) {
u.unshift(o);
break
}
if (u[0] in r) a = u[0];
else {
for (o in r) {
if (!u[0] || e.converters[o + " " + u[0]]) {
a = o;
break
}
s || (s = o)
}
a = a || s
}
return a ? (a !== u[0] && u.unshift(a), r[a]) : void 0
}
function C(e, n) {
e.dataFilter && (n = e.dataFilter(n, e.dataType));
var r, i, o, a, s, l, u, c, f = e.dataTypes,
d = {}, p = f.length,
h = f[0];
for (r = 1; p > r; r++) {
if (1 === r)
for (i in e.converters) "string" == typeof i && (d[i.toLowerCase()] = e.converters[i]);
if (a = h, h = f[r], "*" === h) h = a;
else if ("*" !== a && a !== h) {
if (s = a + " " + h, l = d[s] || d["* " + h], !l) {
c = t;
for (u in d)
if (o = u.split(" "), (o[0] === a || "*" === o[0]) && (c = d[o[1] + " " + h])) {
u = d[u], u === !0 ? l = c : c === !0 && (l = u);
break
}
}
l || c || H.error("No conversion from " + s.replace(" ", " to ")), l !== !0 && (n = l ? l(n) : c(u(n)))
}
}
return n
}
function E() {
try {
return new e.XMLHttpRequest
} catch (t) {}
}
function k() {
try {
return new e.ActiveXObject("Microsoft.XMLHTTP")
} catch (t) {}
}
function S() {
return setTimeout(A, 0), vn = H.now()
}
function A() {
vn = t
}
function L(e, t) {
var n = {};
return H.each(wn.concat.apply([], wn.slice(0, t)), function () {
n[this] = e
}), n
}
function j(e) {
if (!bn[e]) {
var t = F.body,
n = H("<" + e + ">").appendTo(t),
r = n.css("display");
n.remove(), ("none" === r || "" === r) && (mn || (mn = F.createElement("iframe"), mn.frameBorder = mn.width = mn.height = 0), t.appendChild(mn), gn && mn.createElement || (gn = (mn.contentWindow || mn.contentDocument).document, gn.write((H.support.boxModel ? "<!doctype html>" : "") + "<html><body>"), gn.close()), n = gn.createElement(e), gn.body.appendChild(n), r = H.css(n, "display"), t.removeChild(mn)), bn[e] = r
}
return bn[e]
}
function D(e) {
return H.isWindow(e) ? e : 9 === e.nodeType ? e.defaultView || e.parentWindow : !1
}
var F = e.document,
M = e.navigator,
_ = e.location,
H = function () {
function n() {
if (!s.isReady) {
try {
F.documentElement.doScroll("left")
} catch (e) {
return setTimeout(n, 1), void 0
}
s.ready()
}
}
var r, i, o, a, s = function (e, t) {
return new s.fn.init(e, t, r)
}, l = e.jQuery,
u = e.$,
c = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
f = /\S/,
d = /^\s+/,
p = /\s+$/,
h = /^<(\w+)\s*\/?>(?:<\/\1>)?$/,
m = /^[\],:{}\s]*$/,
g = /\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,
y = /"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,
v = /(?:^|:|,)(?:\s*\[)+/g,
b = /(webkit)[ \/]([\w.]+)/,
x = /(opera)(?:.*version)?[ \/]([\w.]+)/,
T = /(msie) ([\w.]+)/,
w = /(mozilla)(?:.*? rv:([\w.]+))?/,
N = /-([a-z]|[0-9])/gi,
C = /^-ms-/,
E = function (e, t) {
return (t + "").toUpperCase()
}, k = M.userAgent,
S = Object.prototype.toString,
A = Object.prototype.hasOwnProperty,
L = Array.prototype.push,
j = Array.prototype.slice,
D = String.prototype.trim,
_ = Array.prototype.indexOf,
H = {};
return s.fn = s.prototype = {
constructor: s,
init: function (e, n, r) {
var i, o, a, l;
if (!e) return this;
if (e.nodeType) return this.context = this[0] = e, this.length = 1, this;
if ("body" === e && !n && F.body) return this.context = F, this[0] = F.body, this.selector = e, this.length = 1, this;
if ("string" == typeof e) {
if (i = "<" === e.charAt(0) && ">" === e.charAt(e.length - 1) && e.length >= 3 ? [null, e, null] : c.exec(e), !i || !i[1] && n) return !n || n.jquery ? (n || r).find(e) : this.constructor(n).find(e);
if (i[1]) return n = n instanceof s ? n[0] : n, l = n ? n.ownerDocument || n : F, a = h.exec(e), a ? s.isPlainObject(n) ? (e = [F.createElement(a[1])], s.fn.attr.call(e, n, !0)) : e = [l.createElement(a[1])] : (a = s.buildFragment([i[1]], [l]), e = (a.cacheable ? s.clone(a.fragment) : a.fragment).childNodes), s.merge(this, e);
if (o = F.getElementById(i[2]), o && o.parentNode) {
if (o.id !== i[2]) return r.find(e);
this.length = 1, this[0] = o
}
return this.context = F, this.selector = e, this
}
return s.isFunction(e) ? r.ready(e) : (e.selector !== t && (this.selector = e.selector, this.context = e.context), s.makeArray(e, this))
},
selector: "",
jquery: "1.7.2",
length: 0,
size: function () {
return this.length
},
toArray: function () {
return j.call(this, 0)
},
get: function (e) {
return null == e ? this.toArray() : 0 > e ? this[this.length + e] : this[e]
},
pushStack: function (e, t, n) {
var r = this.constructor();
return s.isArray(e) ? L.apply(r, e) : s.merge(r, e), r.prevObject = this, r.context = this.context, "find" === t ? r.selector = this.selector + (this.selector ? " " : "") + n : t && (r.selector = this.selector + "." + t + "(" + n + ")"), r
},
each: function (e, t) {
return s.each(this, e, t)
},
ready: function (e) {
return s.bindReady(), o.add(e), this
},
eq: function (e) {
return e = +e, -1 === e ? this.slice(e) : this.slice(e, e + 1)
},
first: function () {
return this.eq(0)
},
last: function () {
return this.eq(-1)
},
slice: function () {
return this.pushStack(j.apply(this, arguments), "slice", j.call(arguments).join(","))
},
map: function (e) {
return this.pushStack(s.map(this, function (t, n) {
return e.call(t, n, t)
}))
},
end: function () {
return this.prevObject || this.constructor(null)
},
push: L,
sort: [].sort,
splice: [].splice
}, s.fn.init.prototype = s.fn, s.extend = s.fn.extend = function () {
var e, n, r, i, o, a, l = arguments[0] || {}, u = 1,
c = arguments.length,
f = !1;
for ("boolean" == typeof l && (f = l, l = arguments[1] || {}, u = 2), "object" == typeof l || s.isFunction(l) || (l = {}), c === u && (l = this, --u); c > u; u++)
if (null != (e = arguments[u]))
for (n in e) r = l[n], i = e[n], l !== i && (f && i && (s.isPlainObject(i) || (o = s.isArray(i))) ? (o ? (o = !1, a = r && s.isArray(r) ? r : []) : a = r && s.isPlainObject(r) ? r : {}, l[n] = s.extend(f, a, i)) : i !== t && (l[n] = i));
return l
}, s.extend({
noConflict: function (t) {
return e.$ === s && (e.$ = u), t && e.jQuery === s && (e.jQuery = l), s
},
isReady: !1,
readyWait: 1,
holdReady: function (e) {
e ? s.readyWait++ : s.ready(!0)
},
ready: function (e) {
if (e === !0 && !--s.readyWait || e !== !0 && !s.isReady) {
if (!F.body) return setTimeout(s.ready, 1);
if (s.isReady = !0, e !== !0 && --s.readyWait > 0) return;
o.fireWith(F, [s]), s.fn.trigger && s(F).trigger("ready").off("ready")
}
},
bindReady: function () {
if (!o) {
if (o = s.Callbacks("once memory"), "complete" === F.readyState) return setTimeout(s.ready, 1);
if (F.addEventListener) F.addEventListener("DOMContentLoaded", a, !1), e.addEventListener("load", s.ready, !1);
else if (F.attachEvent) {
F.attachEvent("onreadystatechange", a), e.attachEvent("onload", s.ready);
var t = !1;
try {
t = null == e.frameElement
} catch (r) {}
F.documentElement.doScroll && t && n()
}
}
},
isFunction: function (e) {
return "function" === s.type(e)
},
isArray: Array.isArray || function (e) {
return "array" === s.type(e)
},
isWindow: function (e) {
return null != e && e == e.window
},
isNumeric: function (e) {
return !isNaN(parseFloat(e)) && isFinite(e)
},
type: function (e) {
return null == e ? String(e) : H[S.call(e)] || "object"
},
isPlainObject: function (e) {
if (!e || "object" !== s.type(e) || e.nodeType || s.isWindow(e)) return !1;
try {
if (e.constructor && !A.call(e, "constructor") && !A.call(e.constructor.prototype, "isPrototypeOf")) return !1
} catch (n) {
return !1
}
var r;
for (r in e);
return r === t || A.call(e, r)
},
isEmptyObject: function (e) {
for (var t in e) return !1;
return !0
},
error: function (e) {
throw new Error(e)
},
parseJSON: function (t) {
return "string" == typeof t && t ? (t = s.trim(t), e.JSON && e.JSON.parse ? e.JSON.parse(t) : m.test(t.replace(g, "@").replace(y, "]").replace(v, "")) ? new Function("return " + t)() : (s.error("Invalid JSON: " + t), void 0)) : null
},
parseXML: function (n) {
if ("string" != typeof n || !n) return null;
var r, i;
try {
e.DOMParser ? (i = new DOMParser, r = i.parseFromString(n, "text/xml")) : (r = new ActiveXObject("Microsoft.XMLDOM"), r.async = "false", r.loadXML(n))
} catch (o) {
r = t
}
return r && r.documentElement && !r.getElementsByTagName("parsererror").length || s.error("Invalid XML: " + n), r
},
noop: function () {},
globalEval: function (t) {
t && f.test(t) && (e.execScript || function (t) {
e.eval.call(e, t)
})(t)
},
camelCase: function (e) {
return e.replace(C, "ms-").replace(N, E)
},
nodeName: function (e, t) {
return e.nodeName && e.nodeName.toUpperCase() === t.toUpperCase()
},
each: function (e, n, r) {
var i, o = 0,
a = e.length,
l = a === t || s.isFunction(e);
if (r)
if (l) {
for (i in e)
if (n.apply(e[i], r) === !1) break
} else
for (; a > o && n.apply(e[o++], r) !== !1;);
else if (l) {
for (i in e)
if (n.call(e[i], i, e[i]) === !1) break
} else
for (; a > o && n.call(e[o], o, e[o++]) !== !1;);
return e
},
trim: D ? function (e) {
return null == e ? "" : D.call(e)
} : function (e) {
return null == e ? "" : e.toString().replace(d, "").replace(p, "")
},
makeArray: function (e, t) {
var n = t || [];
if (null != e) {
var r = s.type(e);
null == e.length || "string" === r || "function" === r || "regexp" === r || s.isWindow(e) ? L.call(n, e) : s.merge(n, e)
}
return n
},
inArray: function (e, t, n) {
var r;
if (t) {
if (_) return _.call(t, e, n);
for (r = t.length, n = n ? 0 > n ? Math.max(0, r + n) : n : 0; r > n; n++)
if (n in t && t[n] === e) return n
}
return -1
},
merge: function (e, n) {
var r = e.length,
i = 0;
if ("number" == typeof n.length)
for (var o = n.length; o > i; i++) e[r++] = n[i];
else
for (; n[i] !== t;) e[r++] = n[i++];
return e.length = r, e
},
grep: function (e, t, n) {
var r, i = [];
n = !! n;
for (var o = 0, a = e.length; a > o; o++) r = !! t(e[o], o), n !== r && i.push(e[o]);
return i
},
map: function (e, n, r) {
var i, o, a = [],
l = 0,
u = e.length,
c = e instanceof s || u !== t && "number" == typeof u && (u > 0 && e[0] && e[u - 1] || 0 === u || s.isArray(e));
if (c)
for (; u > l; l++) i = n(e[l], l, r), null != i && (a[a.length] = i);
else
for (o in e) i = n(e[o], o, r), null != i && (a[a.length] = i);
return a.concat.apply([], a)
},
guid: 1,
proxy: function (e, n) {
if ("string" == typeof n) {
var r = e[n];
n = e, e = r
}
if (!s.isFunction(e)) return t;
var i = j.call(arguments, 2),
o = function () {
return e.apply(n, i.concat(j.call(arguments)))
};
return o.guid = e.guid = e.guid || o.guid || s.guid++, o
},
access: function (e, n, r, i, o, a, l) {
var u, c = null == r,
f = 0,
d = e.length;
if (r && "object" == typeof r) {
for (f in r) s.access(e, n, f, r[f], 1, a, i);
o = 1
} else if (i !== t) {
if (u = l === t && s.isFunction(i), c && (u ? (u = n, n = function (e, t, n) {
return u.call(s(e), n)
}) : (n.call(e, i), n = null)), n)
for (; d > f; f++) n(e[f], r, u ? i.call(e[f], f, n(e[f], r)) : i, l);
o = 1
}
return o ? e : c ? n.call(e) : d ? n(e[0], r) : a
},
now: function () {
return (new Date).getTime()
},
uaMatch: function (e) {
e = e.toLowerCase();
var t = b.exec(e) || x.exec(e) || T.exec(e) || e.indexOf("compatible") < 0 && w.exec(e) || [];
return {
browser: t[1] || "",
version: t[2] || "0"
}
},
sub: function () {
function e(t, n) {
return new e.fn.init(t, n)
}
s.extend(!0, e, this), e.superclass = this, e.fn = e.prototype = this(), e.fn.constructor = e, e.sub = this.sub, e.fn.init = function (n, r) {
return r && r instanceof s && !(r instanceof e) && (r = e(r)), s.fn.init.call(this, n, r, t)
}, e.fn.init.prototype = e.fn;
var t = e(F);
return e
},
browser: {}
}), s.each("Boolean Number String Function Array Date RegExp Object".split(" "), function (e, t) {
H["[object " + t + "]"] = t.toLowerCase()
}), i = s.uaMatch(k), i.browser && (s.browser[i.browser] = !0, s.browser.version = i.version), s.browser.webkit && (s.browser.safari = !0), f.test(" ") && (d = /^[\s\xA0]+/, p = /[\s\xA0]+$/), r = s(F), F.addEventListener ? a = function () {
F.removeEventListener("DOMContentLoaded", a, !1), s.ready()
} : F.attachEvent && (a = function () {
"complete" === F.readyState && (F.detachEvent("onreadystatechange", a), s.ready())
}), s
}(),
O = {};
H.Callbacks = function (e) {
e = e ? O[e] || n(e) : {};
var r, i, o, a, s, l, u = [],
c = [],
f = function (t) {
var n, r, i, o;
for (n = 0, r = t.length; r > n; n++) i = t[n], o = H.type(i), "array" === o ? f(i) : "function" === o && (e.unique && p.has(i) || u.push(i))
}, d = function (t, n) {
for (n = n || [], r = !e.memory || [t, n], i = !0, o = !0, l = a || 0, a = 0, s = u.length; u && s > l; l++)
if (u[l].apply(t, n) === !1 && e.stopOnFalse) {
r = !0;
break
}
o = !1, u && (e.once ? r === !0 ? p.disable() : u = [] : c && c.length && (r = c.shift(), p.fireWith(r[0], r[1])))
}, p = {
add: function () {
if (u) {
var e = u.length;
f(arguments), o ? s = u.length : r && r !== !0 && (a = e, d(r[0], r[1]))
}
return this
},
remove: function () {
if (u)
for (var t = arguments, n = 0, r = t.length; r > n; n++)
for (var i = 0; i < u.length && (t[n] !== u[i] || (o && s >= i && (s--, l >= i && l--), u.splice(i--, 1), !e.unique)); i++);
return this
},
has: function (e) {
if (u)
for (var t = 0, n = u.length; n > t; t++)
if (e === u[t]) return !0;
return !1
},
empty: function () {
return u = [], this
},
disable: function () {
return u = c = r = t, this
},
disabled: function () {
return !u
},
lock: function () {
return c = t, r && r !== !0 || p.disable(), this
},
locked: function () {
return !c
},
fireWith: function (t, n) {
return c && (o ? e.once || c.push([t, n]) : e.once && r || d(t, n)), this
},
fire: function () {
return p.fireWith(this, arguments), this
},
fired: function () {
return !!i
}
};
return p
};
var B = [].slice;
H.extend({
Deferred: function (e) {
var t, n = H.Callbacks("once memory"),
r = H.Callbacks("once memory"),
i = H.Callbacks("memory"),
o = "pending",
a = {
resolve: n,
reject: r,
notify: i
}, s = {
done: n.add,
fail: r.add,
progress: i.add,
state: function () {
return o
},
isResolved: n.fired,
isRejected: r.fired,
then: function (e, t, n) {
return l.done(e).fail(t).progress(n), this
},
always: function () {
return l.done.apply(l, arguments).fail.apply(l, arguments), this
},
pipe: function (e, t, n) {
return H.Deferred(function (r) {
H.each({
done: [e, "resolve"],
fail: [t, "reject"],
progress: [n, "notify"]
}, function (e, t) {
var n, i = t[0],
o = t[1];
H.isFunction(i) ? l[e](function () {
n = i.apply(this, arguments), n && H.isFunction(n.promise) ? n.promise().then(r.resolve, r.reject, r.notify) : r[o + "With"](this === l ? r : this, [n])
}) : l[e](r[o])
})
}).promise()
},
promise: function (e) {
if (null == e) e = s;
else
for (var t in s) e[t] = s[t];
return e
}
}, l = s.promise({});
for (t in a) l[t] = a[t].fire, l[t + "With"] = a[t].fireWith;
return l.done(function () {
o = "resolved"
}, r.disable, i.lock).fail(function () {
o = "rejected"
}, n.disable, i.lock), e && e.call(l, l), l
},
when: function (e) {
function t(e) {
return function (t) {
r[e] = arguments.length > 1 ? B.call(arguments, 0) : t, --s || l.resolveWith(l, r)
}
}
function n(e) {
return function (t) {
a[e] = arguments.length > 1 ? B.call(arguments, 0) : t, l.notifyWith(u, a)
}
}
var r = B.call(arguments, 0),
i = 0,
o = r.length,
a = new Array(o),
s = o,
l = 1 >= o && e && H.isFunction(e.promise) ? e : H.Deferred(),
u = l.promise();
if (o > 1) {
for (; o > i; i++) r[i] && r[i].promise && H.isFunction(r[i].promise) ? r[i].promise().then(t(i), l.reject, n(i)) : --s;
s || l.resolveWith(l, r)
} else l !== e && l.resolveWith(l, o ? [e] : []);
return u
}
}), H.support = function () {
var t, n, r, i, o, a, s, l, u, c, f, d = F.createElement("div");
if (F.documentElement, d.setAttribute("className", "t"), d.innerHTML = " <link/><table></table><a href='/a' style='top:1px;float:left;opacity:.55;'>a</a><input type='checkbox'/>", n = d.getElementsByTagName("*"), r = d.getElementsByTagName("a")[0], !n || !n.length || !r) return {};
i = F.createElement("select"), o = i.appendChild(F.createElement("option")), a = d.getElementsByTagName("input")[0], t = {
leadingWhitespace: 3 === d.firstChild.nodeType,
tbody: !d.getElementsByTagName("tbody").length,
htmlSerialize: !! d.getElementsByTagName("link").length,
style: /top/.test(r.getAttribute("style")),
hrefNormalized: "/a" === r.getAttribute("href"),
opacity: /^0.55/.test(r.style.opacity),
cssFloat: !! r.style.cssFloat,
checkOn: "on" === a.value,
optSelected: o.selected,
getSetAttribute: "t" !== d.className,
enctype: !! F.createElement("form").enctype,
html5Clone: "<:nav></:nav>" !== F.createElement("nav").cloneNode(!0).outerHTML,
submitBubbles: !0,
changeBubbles: !0,
focusinBubbles: !1,
deleteExpando: !0,
noCloneEvent: !0,
inlineBlockNeedsLayout: !1,
shrinkWrapBlocks: !1,
reliableMarginRight: !0,
pixelMargin: !0
}, H.boxModel = t.boxModel = "CSS1Compat" === F.compatMode, a.checked = !0, t.noCloneChecked = a.cloneNode(!0).checked, i.disabled = !0, t.optDisabled = !o.disabled;
try {
delete d.test
} catch (p) {
t.deleteExpando = !1
}
if (!d.addEventListener && d.attachEvent && d.fireEvent && (d.attachEvent("onclick", function () {
t.noCloneEvent = !1
}), d.cloneNode(!0).fireEvent("onclick")), a = F.createElement("input"), a.value = "t", a.setAttribute("type", "radio"), t.radioValue = "t" === a.value, a.setAttribute("checked", "checked"), a.setAttribute("name", "t"), d.appendChild(a), s = F.createDocumentFragment(), s.appendChild(d.lastChild), t.checkClone = s.cloneNode(!0).cloneNode(!0).lastChild.checked, t.appendChecked = a.checked, s.removeChild(a), s.appendChild(d), d.attachEvent)
for (c in {
submit: 1,
change: 1,
focusin: 1
}) u = "on" + c, f = u in d, f || (d.setAttribute(u, "return;"), f = "function" == typeof d[u]), t[c + "Bubbles"] = f;
return s.removeChild(d), s = i = o = d = a = null, H(function () {
var n, r, i, o, a, s, u, c, p, h, m, g, y = F.getElementsByTagName("body")[0];
y && (u = 1, g = "padding:0;margin:0;border:", h = "position:absolute;top:0;left:0;width:1px;height:1px;", m = g + "0;visibility:hidden;", c = "style='" + h + g + "5px solid #000;", p = "<div " + c + "display:block;'><div style='" + g + "0;display:block;overflow:hidden;'></div></div>" + "<table " + c + "' cellpadding='0' cellspacing='0'>" + "<tr><td></td></tr></table>", n = F.createElement("div"), n.style.cssText = m + "width:0;height:0;position:static;top:0;margin-top:" + u + "px", y.insertBefore(n, y.firstChild), d = F.createElement("div"), n.appendChild(d), d.innerHTML = "<table><tr><td style='" + g + "0;display:none'></td><td>t</td></tr></table>", l = d.getElementsByTagName("td"), f = 0 === l[0].offsetHeight, l[0].style.display = "", l[1].style.display = "none", t.reliableHiddenOffsets = f && 0 === l[0].offsetHeight, e.getComputedStyle && (d.innerHTML = "", s = F.createElement("div"), s.style.width = "0", s.style.marginRight = "0", d.style.width = "2px", d.appendChild(s), t.reliableMarginRight = 0 === (parseInt((e.getComputedStyle(s, null) || {
marginRight: 0
}).marginRight, 10) || 0)), "undefined" != typeof d.style.zoom && (d.innerHTML = "", d.style.width = d.style.padding = "1px", d.style.border = 0, d.style.overflow = "hidden", d.style.display = "inline", d.style.zoom = 1, t.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.style.overflow = "visible", d.innerHTML = "<div style='width:5px;'></div>", t.shrinkWrapBlocks = 3 !== d.offsetWidth), d.style.cssText = h + m, d.innerHTML = p, r = d.firstChild, i = r.firstChild, o = r.nextSibling.firstChild.firstChild, a = {
doesNotAddBorder: 5 !== i.offsetTop,
doesAddBorderForTableAndCells: 5 === o.offsetTop
}, i.style.position = "fixed", i.style.top = "20px", a.fixedPosition = 20 === i.offsetTop || 15 === i.offsetTop, i.style.position = i.style.top = "", r.style.overflow = "hidden", r.style.position = "relative", a.subtractsBorderForOverflowNotVisible = -5 === i.offsetTop, a.doesNotIncludeMarginInBodyOffset = y.offsetTop !== u, e.getComputedStyle && (d.style.marginTop = "1%", t.pixelMargin = "1%" !== (e.getComputedStyle(d, null) || {
marginTop: 0
}).marginTop), "undefined" != typeof n.style.zoom && (n.style.zoom = 1), y.removeChild(n), s = d = n = null, H.extend(t, a))
}), t
}();
var P = /^(?:\{.*\}|\[.*\])$/,
q = /([A-Z])/g;
H.extend({
cache: {},
uuid: 0,
expando: "jQuery" + (H.fn.jquery + Math.random()).replace(/\D/g, ""),
noData: {
embed: !0,
object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
applet: !0
},
hasData: function (e) {
return e = e.nodeType ? H.cache[e[H.expando]] : e[H.expando], !! e && !i(e)
},
data: function (e, n, r, i) {
if (H.acceptData(e)) {
var o, a, s, l = H.expando,
u = "string" == typeof n,
c = e.nodeType,
f = c ? H.cache : e,
d = c ? e[l] : e[l] && l,
p = "events" === n;
if (d && f[d] && (p || i || f[d].data) || !u || r !== t) return d || (c ? e[l] = d = ++H.uuid : d = l), f[d] || (f[d] = {}, c || (f[d].toJSON = H.noop)), ("object" == typeof n || "function" == typeof n) && (i ? f[d] = H.extend(f[d], n) : f[d].data = H.extend(f[d].data, n)), o = a = f[d], i || (a.data || (a.data = {}), a = a.data), r !== t && (a[H.camelCase(n)] = r), p && !a[n] ? o.events : (u ? (s = a[n], null == s && (s = a[H.camelCase(n)])) : s = a, s)
}
},
removeData: function (e, t, n) {
if (H.acceptData(e)) {
var r, o, a, s = H.expando,
l = e.nodeType,
u = l ? H.cache : e,
c = l ? e[s] : s;
if (u[c]) {
if (t && (r = n ? u[c] : u[c].data)) {
H.isArray(t) || (t in r ? t = [t] : (t = H.camelCase(t), t = t in r ? [t] : t.split(" ")));
for (o = 0, a = t.length; a > o; o++) delete r[t[o]];
if (!(n ? i : H.isEmptyObject)(r)) return
}(n || (delete u[c].data, i(u[c]))) && (H.support.deleteExpando || !u.setInterval ? delete u[c] : u[c] = null, l && (H.support.deleteExpando ? delete e[s] : e.removeAttribute ? e.removeAttribute(s) : e[s] = null))
}
}
},
_data: function (e, t, n) {
return H.data(e, t, n, !0)
},
acceptData: function (e) {
if (e.nodeName) {
var t = H.noData[e.nodeName.toLowerCase()];
if (t) return !(t === !0 || e.getAttribute("classid") !== t)
}
return !0
}
}), H.fn.extend({
data: function (e, n) {
var i, o, a, s, l, u = this[0],
c = 0,
f = null;
if (e === t) {
if (this.length && (f = H.data(u), 1 === u.nodeType && !H._data(u, "parsedAttrs"))) {
for (a = u.attributes, l = a.length; l > c; c++) s = a[c].name, 0 === s.indexOf("data-") && (s = H.camelCase(s.substring(5)), r(u, s, f[s]));
H._data(u, "parsedAttrs", !0)
}
return f
}
return "object" == typeof e ? this.each(function () {
H.data(this, e)
}) : (i = e.split(".", 2), i[1] = i[1] ? "." + i[1] : "", o = i[1] + "!", H.access(this, function (n) {
return n === t ? (f = this.triggerHandler("getData" + o, [i[0]]), f === t && u && (f = H.data(u, e), f = r(u, e, f)), f === t && i[1] ? this.data(i[0]) : f) : (i[1] = n, this.each(function () {
var t = H(this);
t.triggerHandler("setData" + o, i), H.data(this, e, n), t.triggerHandler("changeData" + o, i)
}), void 0)
}, null, n, arguments.length > 1, null, !1))
},
removeData: function (e) {
return this.each(function () {
H.removeData(this, e)
})
}
}), H.extend({
_mark: function (e, t) {
e && (t = (t || "fx") + "mark", H._data(e, t, (H._data(e, t) || 0) + 1))
},
_unmark: function (e, t, n) {
if (e !== !0 && (n = t, t = e, e = !1), t) {
n = n || "fx";
var r = n + "mark",
i = e ? 0 : (H._data(t, r) || 1) - 1;
i ? H._data(t, r, i) : (H.removeData(t, r, !0), o(t, n, "mark"))
}
},
queue: function (e, t, n) {
var r;
return e ? (t = (t || "fx") + "queue", r = H._data(e, t), n && (!r || H.isArray(n) ? r = H._data(e, t, H.makeArray(n)) : r.push(n)), r || []) : void 0
},
dequeue: function (e, t) {
t = t || "fx";
var n = H.queue(e, t),
r = n.shift(),
i = {};
"inprogress" === r && (r = n.shift()), r && ("fx" === t && n.unshift("inprogress"), H._data(e, t + ".run", i), r.call(e, function () {
H.dequeue(e, t)
}, i)), n.length || (H.removeData(e, t + "queue " + t + ".run", !0), o(e, t, "queue"))
}
}), H.fn.extend({
queue: function (e, n) {
var r = 2;
return "string" != typeof e && (n = e, e = "fx", r--), arguments.length < r ? H.queue(this[0], e) : n === t ? this : this.each(function () {
var t = H.queue(this, e, n);
"fx" === e && "inprogress" !== t[0] && H.dequeue(this, e)
})
},
dequeue: function (e) {
return this.each(function () {
H.dequeue(this, e)
})
},
delay: function (e, t) {
return e = H.fx ? H.fx.speeds[e] || e : e, t = t || "fx", this.queue(t, function (t, n) {
var r = setTimeout(t, e);
n.stop = function () {
clearTimeout(r)
}
})
},
clearQueue: function (e) {
return this.queue(e || "fx", [])
},
promise: function (e, n) {
function r() {
--l || o.resolveWith(a, [a])
}
"string" != typeof e && (n = e, e = t), e = e || "fx";
for (var i, o = H.Deferred(), a = this, s = a.length, l = 1, u = e + "defer", c = e + "queue", f = e + "mark"; s--;)(i = H.data(a[s], u, t, !0) || (H.data(a[s], c, t, !0) || H.data(a[s], f, t, !0)) && H.data(a[s], u, H.Callbacks("once memory"), !0)) && (l++, i.add(r));
return r(), o.promise(n)
}
});
var W, I, $, R = /[\n\t\r]/g,
X = /\s+/,
z = /\r/g,
V = /^(?:button|input)$/i,
U = /^(?:button|input|object|select|textarea)$/i,
G = /^a(?:rea)?$/i,
Y = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
J = H.support.getSetAttribute;
H.fn.extend({
attr: function (e, t) {
return H.access(this, H.attr, e, t, arguments.length > 1)
},
removeAttr: function (e) {
return this.each(function () {
H.removeAttr(this, e)
})
},
prop: function (e, t) {
return H.access(this, H.prop, e, t, arguments.length > 1)
},
removeProp: function (e) {
return e = H.propFix[e] || e, this.each(function () {
try {
this[e] = t, delete this[e]
} catch (n) {}
})
},
addClass: function (e) {
var t, n, r, i, o, a, s;
if (H.isFunction(e)) return this.each(function (t) {
H(this).addClass(e.call(this, t, this.className))
});
if (e && "string" == typeof e)
for (t = e.split(X), n = 0, r = this.length; r > n; n++)
if (i = this[n], 1 === i.nodeType)
if (i.className || 1 !== t.length) {
for (o = " " + i.className + " ", a = 0, s = t.length; s > a; a++)~ o.indexOf(" " + t[a] + " ") || (o += t[a] + " ");
i.className = H.trim(o)
} else i.className = e;
return this
},
removeClass: function (e) {
var n, r, i, o, a, s, l;
if (H.isFunction(e)) return this.each(function (t) {
H(this).removeClass(e.call(this, t, this.className))
});
if (e && "string" == typeof e || e === t)
for (n = (e || "").split(X), r = 0, i = this.length; i > r; r++)
if (o = this[r], 1 === o.nodeType && o.className)
if (e) {
for (a = (" " + o.className + " ").replace(R, " "), s = 0, l = n.length; l > s; s++) a = a.replace(" " + n[s] + " ", " ");
o.className = H.trim(a)
} else o.className = "";
return this
},
toggleClass: function (e, t) {
var n = typeof e,
r = "boolean" == typeof t;
return H.isFunction(e) ? this.each(function (n) {
H(this).toggleClass(e.call(this, n, this.className, t), t)
}) : this.each(function () {
if ("string" === n)
for (var i, o = 0, a = H(this), s = t, l = e.split(X); i = l[o++];) s = r ? s : !a.hasClass(i), a[s ? "addClass" : "removeClass"](i);
else("undefined" === n || "boolean" === n) && (this.className && H._data(this, "__className__", this.className), this.className = this.className || e === !1 ? "" : H._data(this, "__className__") || "")
})
},
hasClass: function (e) {
for (var t = " " + e + " ", n = 0, r = this.length; r > n; n++)
if (1 === this[n].nodeType && (" " + this[n].className + " ").replace(R, " ").indexOf(t) > -1) return !0;
return !1
},
val: function (e) {
var n, r, i, o = this[0]; {
if (arguments.length) return i = H.isFunction(e), this.each(function (r) {
var o, a = H(this);
1 === this.nodeType && (o = i ? e.call(this, r, a.val()) : e, null == o ? o = "" : "number" == typeof o ? o += "" : H.isArray(o) && (o = H.map(o, function (e) {
return null == e ? "" : e + ""
})), n = H.valHooks[this.type] || H.valHooks[this.nodeName.toLowerCase()], n && "set" in n && n.set(this, o, "value") !== t || (this.value = o))
});
if (o) return n = H.valHooks[o.type] || H.valHooks[o.nodeName.toLowerCase()], n && "get" in n && (r = n.get(o, "value")) !== t ? r : (r = o.value, "string" == typeof r ? r.replace(z, "") : null == r ? "" : r)
}
}
}), H.extend({
valHooks: {
option: {
get: function (e) {
var t = e.attributes.value;
return !t || t.specified ? e.value : e.text
}
},
select: {
get: function (e) {
var t, n, r, i, o = e.selectedIndex,
a = [],
s = e.options,
l = "select-one" === e.type;
if (0 > o) return null;
for (n = l ? o : 0, r = l ? o + 1 : s.length; r > n; n++)
if (i = s[n], !(!i.selected || (H.support.optDisabled ? i.disabled : null !== i.getAttribute("disabled")) || i.parentNode.disabled && H.nodeName(i.parentNode, "optgroup"))) {
if (t = H(i).val(), l) return t;
a.push(t)
}
return l && !a.length && s.length ? H(s[o]).val() : a
},
set: function (e, t) {
var n = H.makeArray(t);
return H(e).find("option").each(function () {
this.selected = H.inArray(H(this).val(), n) >= 0
}), n.length || (e.selectedIndex = -1), n
}
}
},
attrFn: {
val: !0,
css: !0,
html: !0,
text: !0,
data: !0,
width: !0,
height: !0,
offset: !0
},
attr: function (e, n, r, i) {
var o, a, s, l = e.nodeType;
if (e && 3 !== l && 8 !== l && 2 !== l) return i && n in H.attrFn ? H(e)[n](r) : "undefined" == typeof e.getAttribute ? H.prop(e, n, r) : (s = 1 !== l || !H.isXMLDoc(e), s && (n = n.toLowerCase(), a = H.attrHooks[n] || (Y.test(n) ? I : W)), r !== t ? null === r ? (H.removeAttr(e, n), void 0) : a && "set" in a && s && (o = a.set(e, r, n)) !== t ? o : (e.setAttribute(n, "" + r), r) : a && "get" in a && s && null !== (o = a.get(e, n)) ? o : (o = e.getAttribute(n), null === o ? t : o))
},
removeAttr: function (e, t) {
var n, r, i, o, a, s = 0;
if (t && 1 === e.nodeType)
for (r = t.toLowerCase().split(X), o = r.length; o > s; s++) i = r[s], i && (n = H.propFix[i] || i, a = Y.test(i), a || H.attr(e, i, ""), e.removeAttribute(J ? i : n), a && n in e && (e[n] = !1))
},
attrHooks: {
type: {
set: function (e, t) {
if (V.test(e.nodeName) && e.parentNode) H.error("type property can't be changed");
else if (!H.support.radioValue && "radio" === t && H.nodeName(e, "input")) {
var n = e.value;
return e.setAttribute("type", t), n && (e.value = n), t
}
}
},
value: {
get: function (e, t) {
return W && H.nodeName(e, "button") ? W.get(e, t) : t in e ? e.value : null
},
set: function (e, t, n) {
return W && H.nodeName(e, "button") ? W.set(e, t, n) : (e.value = t, void 0)
}
}
},
propFix: {
tabindex: "tabIndex",
readonly: "readOnly",
"for": "htmlFor",
"class": "className",
maxlength: "maxLength",
cellspacing: "cellSpacing",
cellpadding: "cellPadding",
rowspan: "rowSpan",
colspan: "colSpan",
usemap: "useMap",
frameborder: "frameBorder",
contenteditable: "contentEditable"
},
prop: function (e, n, r) {
var i, o, a, s = e.nodeType;
if (e && 3 !== s && 8 !== s && 2 !== s) return a = 1 !== s || !H.isXMLDoc(e), a && (n = H.propFix[n] || n, o = H.propHooks[n]), r !== t ? o && "set" in o && (i = o.set(e, r, n)) !== t ? i : e[n] = r : o && "get" in o && null !== (i = o.get(e, n)) ? i : e[n]
},
propHooks: {
tabIndex: {
get: function (e) {
var n = e.getAttributeNode("tabindex");
return n && n.specified ? parseInt(n.value, 10) : U.test(e.nodeName) || G.test(e.nodeName) && e.href ? 0 : t
}
}
}
}), H.attrHooks.tabindex = H.propHooks.tabIndex, I = {
get: function (e, n) {
var r, i = H.prop(e, n);
return i === !0 || "boolean" != typeof i && (r = e.getAttributeNode(n)) && r.nodeValue !== !1 ? n.toLowerCase() : t
},
set: function (e, t, n) {
var r;
return t === !1 ? H.removeAttr(e, n) : (r = H.propFix[n] || n, r in e && (e[r] = !0), e.setAttribute(n, n.toLowerCase())), n
}
}, J || ($ = {
name: !0,
id: !0,
coords: !0
}, W = H.valHooks.button = {
get: function (e, n) {
var r;
return r = e.getAttributeNode(n), r && ($[n] ? "" !== r.nodeValue : r.specified) ? r.nodeValue : t
},
set: function (e, t, n) {
var r = e.getAttributeNode(n);
return r || (r = F.createAttribute(n), e.setAttributeNode(r)), r.nodeValue = t + ""
}
}, H.attrHooks.tabindex.set = W.set, H.each(["width", "height"], function (e, t) {
H.attrHooks[t] = H.extend(H.attrHooks[t], {
set: function (e, n) {
return "" === n ? (e.setAttribute(t, "auto"), n) : void 0
}
})
}), H.attrHooks.contenteditable = {
get: W.get,
set: function (e, t, n) {
"" === t && (t = "false"), W.set(e, t, n)
}
}), H.support.hrefNormalized || H.each(["href", "src", "width", "height"], function (e, n) {
H.attrHooks[n] = H.extend(H.attrHooks[n], {
get: function (e) {
var r = e.getAttribute(n, 2);
return null === r ? t : r
}
})
}), H.support.style || (H.attrHooks.style = {
get: function (e) {
return e.style.cssText.toLowerCase() || t
},
set: function (e, t) {
return e.style.cssText = "" + t
}
}), H.support.optSelected || (H.propHooks.selected = H.extend(H.propHooks.selected, {
get: function (e) {
var t = e.parentNode;
return t && (t.selectedIndex, t.parentNode && t.parentNode.selectedIndex), null
}
})), H.support.enctype || (H.propFix.enctype = "encoding"), H.support.checkOn || H.each(["radio", "checkbox"], function () {
H.valHooks[this] = {
get: function (e) {
return null === e.getAttribute("value") ? "on" : e.value
}
}
}), H.each(["radio", "checkbox"], function () {
H.valHooks[this] = H.extend(H.valHooks[this], {
set: function (e, t) {
return H.isArray(t) ? e.checked = H.inArray(H(e).val(), t) >= 0 : void 0
}
})
});
var Q = /^(?:textarea|input|select)$/i,
K = /^([^\.]*)?(?:\.(.+))?$/,
Z = /(?:^|\s)hover(\.\S+)?\b/,
et = /^key/,
tt = /^(?:mouse|contextmenu)|click/,
nt = /^(?:focusinfocus|focusoutblur)$/,
rt = /^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,
it = function (e) {
var t = rt.exec(e);
return t && (t[1] = (t[1] || "").toLowerCase(), t[3] = t[3] && new RegExp("(?:^|\\s)" + t[3] + "(?:\\s|$)")), t
}, ot = function (e, t) {
var n = e.attributes || {};
return !(t[1] && e.nodeName.toLowerCase() !== t[1] || t[2] && (n.id || {}).value !== t[2] || t[3] && !t[3].test((n["class"] || {}).value))
}, at = function (e) {
return H.event.special.hover ? e : e.replace(Z, "mouseenter$1 mouseleave$1")
};
H.event = {
add: function (e, n, r, i, o) {
var a, s, l, u, c, f, d, p, h, m, g;
if (3 !== e.nodeType && 8 !== e.nodeType && n && r && (a = H._data(e))) {
for (r.handler && (h = r, r = h.handler, o = h.selector), r.guid || (r.guid = H.guid++), l = a.events, l || (a.events = l = {}), s = a.handle, s || (a.handle = s = function (e) {
return "undefined" == typeof H || e && H.event.triggered === e.type ? t : H.event.dispatch.apply(s.elem, arguments)
}, s.elem = e), n = H.trim(at(n)).split(" "), u = 0; u < n.length; u++) c = K.exec(n[u]) || [], f = c[1], d = (c[2] || "").split(".").sort(), g = H.event.special[f] || {}, f = (o ? g.delegateType : g.bindType) || f, g = H.event.special[f] || {}, p = H.extend({
type: f,
origType: c[1],
data: i,
handler: r,
guid: r.guid,
selector: o,
quick: o && it(o),
namespace: d.join(".")
}, h), m = l[f], m || (m = l[f] = [], m.delegateCount = 0, g.setup && g.setup.call(e, i, d, s) !== !1 || (e.addEventListener ? e.addEventListener(f, s, !1) : e.attachEvent && e.attachEvent("on" + f, s))), g.add && (g.add.call(e, p), p.handler.guid || (p.handler.guid = r.guid)), o ? m.splice(m.delegateCount++, 0, p) : m.push(p), H.event.global[f] = !0;
e = null
}
},
global: {},
remove: function (e, t, n, r, i) {
var o, a, s, l, u, c, f, d, p, h, m, g, y = H.hasData(e) && H._data(e);
if (y && (d = y.events)) {
for (t = H.trim(at(t || "")).split(" "), o = 0; o < t.length; o++)
if (a = K.exec(t[o]) || [], s = l = a[1], u = a[2], s) {
for (p = H.event.special[s] || {}, s = (r ? p.delegateType : p.bindType) || s, m = d[s] || [], c = m.length, u = u ? new RegExp("(^|\\.)" + u.split(".").sort().join("\\.(?:.*\\.)?") + "(\\.|$)") : null, f = 0; f < m.length; f++) g = m[f], !i && l !== g.origType || n && n.guid !== g.guid || u && !u.test(g.namespace) || r && r !== g.selector && ("**" !== r || !g.selector) || (m.splice(f--, 1), g.selector && m.delegateCount--, p.remove && p.remove.call(e, g));
0 === m.length && c !== m.length && (p.teardown && p.teardown.call(e, u) !== !1 || H.removeEvent(e, s, y.handle), delete d[s])
} else
for (s in d) H.event.remove(e, s + t[o], n, r, !0);
H.isEmptyObject(d) && (h = y.handle, h && (h.elem = null), H.removeData(e, ["events", "handle"], !0))
}
},
customEvent: {
getData: !0,
setData: !0,
changeData: !0
},
trigger: function (n, r, i, o) {
if (!i || 3 !== i.nodeType && 8 !== i.nodeType) {
var a, s, l, u, c, f, d, p, h, m, g = n.type || n,
y = [];
if (!nt.test(g + H.event.triggered) && (g.indexOf("!") >= 0 && (g = g.slice(0, -1), s = !0), g.indexOf(".") >= 0 && (y = g.split("."), g = y.shift(), y.sort()), i && !H.event.customEvent[g] || H.event.global[g]))
if (n = "object" == typeof n ? n[H.expando] ? n : new H.Event(g, n) : new H.Event(g), n.type = g, n.isTrigger = !0, n.exclusive = s, n.namespace = y.join("."), n.namespace_re = n.namespace ? new RegExp("(^|\\.)" + y.join("\\.(?:.*\\.)?") + "(\\.|$)") : null, f = g.indexOf(":") < 0 ? "on" + g : "", i) {
if (n.result = t, n.target || (n.target = i), r = null != r ? H.makeArray(r) : [], r.unshift(n), d = H.event.special[g] || {}, !d.trigger || d.trigger.apply(i, r) !== !1) {
if (h = [
[i, d.bindType || g]
], !o && !d.noBubble && !H.isWindow(i)) {
for (m = d.delegateType || g, u = nt.test(m + g) ? i : i.parentNode, c = null; u; u = u.parentNode) h.push([u, m]), c = u;
c && c === i.ownerDocument && h.push([c.defaultView || c.parentWindow || e, m])
}
for (l = 0; l < h.length && !n.isPropagationStopped(); l++) u = h[l][0], n.type = h[l][1], p = (H._data(u, "events") || {})[n.type] && H._data(u, "handle"), p && p.apply(u, r), p = f && u[f], p && H.acceptData(u) && p.apply(u, r) === !1 && n.preventDefault();
return n.type = g, o || n.isDefaultPrevented() || d._default && d._default.apply(i.ownerDocument, r) !== !1 || "click" === g && H.nodeName(i, "a") || !H.acceptData(i) || f && i[g] && ("focus" !== g && "blur" !== g || 0 !== n.target.offsetWidth) && !H.isWindow(i) && (c = i[f], c && (i[f] = null), H.event.triggered = g, i[g](), H.event.triggered = t, c && (i[f] = c)), n.result
}
} else {
a = H.cache;
for (l in a) a[l].events && a[l].events[g] && H.event.trigger(n, r, a[l].handle.elem, !0)
}
}
},
dispatch: function (n) {
n = H.event.fix(n || e.event);
var r, i, o, a, s, l, u, c, f, d, p = (H._data(this, "events") || {})[n.type] || [],
h = p.delegateCount,
m = [].slice.call(arguments, 0),
g = !n.exclusive && !n.namespace,
y = H.event.special[n.type] || {}, v = [];
if (m[0] = n, n.delegateTarget = this, !y.preDispatch || y.preDispatch.call(this, n) !== !1) {
if (h && (!n.button || "click" !== n.type))
for (a = H(this), a.context = this.ownerDocument || this, o = n.target; o != this; o = o.parentNode || this)
if (o.disabled !== !0) {
for (l = {}, c = [], a[0] = o, r = 0; h > r; r++) f = p[r], d = f.selector, l[d] === t && (l[d] = f.quick ? ot(o, f.quick) : a.is(d)), l[d] && c.push(f);
c.length && v.push({
elem: o,
matches: c
})
}
for (p.length > h && v.push({
elem: this,
matches: p.slice(h)
}), r = 0; r < v.length && !n.isPropagationStopped(); r++)
for (u = v[r], n.currentTarget = u.elem, i = 0; i < u.matches.length && !n.isImmediatePropagationStopped(); i++) f = u.matches[i], (g || !n.namespace && !f.namespace || n.namespace_re && n.namespace_re.test(f.namespace)) && (n.data = f.data, n.handleObj = f, s = ((H.event.special[f.origType] || {}).handle || f.handler).apply(u.elem, m), s !== t && (n.result = s, s === !1 && (n.preventDefault(), n.stopPropagation())));
return y.postDispatch && y.postDispatch.call(this, n), n.result
}
},
props: "attrChange attrName relatedNode srcElement 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 fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
filter: function (e, n) {
var r, i, o, a = n.button,
s = n.fromElement;
return null == e.pageX && null != n.clientX && (r = e.target.ownerDocument || F, i = r.documentElement, o = r.body, e.pageX = n.clientX + (i && i.scrollLeft || o && o.scrollLeft || 0) - (i && i.clientLeft || o && o.clientLeft || 0), e.pageY = n.clientY + (i && i.scrollTop || o && o.scrollTop || 0) - (i && i.clientTop || o && o.clientTop || 0)), !e.relatedTarget && s && (e.relatedTarget = s === e.target ? n.toElement : s), e.which || a === t || (e.which = 1 & a ? 1 : 2 & a ? 3 : 4 & a ? 2 : 0), e
}
},
fix: function (e) {
if (e[H.expando]) return e;
var n, r, i = e,
o = H.event.fixHooks[e.type] || {}, a = o.props ? this.props.concat(o.props) : this.props;
for (e = H.Event(i), n = a.length; n;) r = a[--n], e[r] = i[r];
return e.target || (e.target = i.srcElement || F), 3 === e.target.nodeType && (e.target = e.target.parentNode), e.metaKey === t && (e.metaKey = e.ctrlKey), o.filter ? o.filter(e, i) : e
},
special: {
ready: {
setup: H.bindReady
},
load: {
noBubble: !0
},
focus: {
delegateType: "focusin"
},
blur: {
delegateType: "focusout"
},
beforeunload: {
setup: function (e, t, n) {
H.isWindow(this) && (this.onbeforeunload = n)
},
teardown: function (e, t) {
this.onbeforeunload === t && (this.onbeforeunload = null)
}
}
},
simulate: function (e, t, n, r) {
var i = H.extend(new H.Event, n, {
type: e,
isSimulated: !0,
originalEvent: {}
});
r ? H.event.trigger(i, null, t) : H.event.dispatch.call(t, i), i.isDefaultPrevented() && n.preventDefault()
}
}, H.event.handle = H.event.dispatch, H.removeEvent = F.removeEventListener ? function (e, t, n) {
e.removeEventListener && e.removeEventListener(t, n, !1)
} : function (e, t, n) {
e.detachEvent && e.detachEvent("on" + t, n)
}, H.Event = function (e, t) {
return this instanceof H.Event ? (e && e.type ? (this.originalEvent = e, this.type = e.type, this.isDefaultPrevented = e.defaultPrevented || e.returnValue === !1 || e.getPreventDefault && e.getPreventDefault() ? s : a) : this.type = e, t && H.extend(this, t), this.timeStamp = e && e.timeStamp || H.now(), this[H.expando] = !0, void 0) : new H.Event(e, t)
}, H.Event.prototype = {
preventDefault: function () {
this.isDefaultPrevented = s;
var e = this.originalEvent;
e && (e.preventDefault ? e.preventDefault() : e.returnValue = !1)
},
stopPropagation: function () {
this.isPropagationStopped = s;
var e = this.originalEvent;
e && (e.stopPropagation && e.stopPropagation(), e.cancelBubble = !0)
},
stopImmediatePropagation: function () {
this.isImmediatePropagationStopped = s, this.stopPropagation()
},
isDefaultPrevented: a,
isPropagationStopped: a,
isImmediatePropagationStopped: a
}, H.each({
mouseenter: "mouseover",
mouseleave: "mouseout"
}, function (e, t) {
H.event.special[e] = {
delegateType: t,
bindType: t,
handle: function (e) {
var n, r = this,
i = e.relatedTarget,
o = e.handleObj;
return o.selector, (!i || i !== r && !H.contains(r, i)) && (e.type = o.origType, n = o.handler.apply(this, arguments), e.type = t), n
}
}
}), H.support.submitBubbles || (H.event.special.submit = {
setup: function () {
return H.nodeName(this, "form") ? !1 : (H.event.add(this, "click._submit keypress._submit", function (e) {
var n = e.target,
r = H.nodeName(n, "input") || H.nodeName(n, "button") ? n.form : t;
r && !r._submit_attached && (H.event.add(r, "submit._submit", function (e) {
e._submit_bubble = !0
}), r._submit_attached = !0)
}), void 0)
},
postDispatch: function (e) {
e._submit_bubble && (delete e._submit_bubble, this.parentNode && !e.isTrigger && H.event.simulate("submit", this.parentNode, e, !0))
},
teardown: function () {
return H.nodeName(this, "form") ? !1 : (H.event.remove(this, "._submit"), void 0)
}
}), H.support.changeBubbles || (H.event.special.change = {
setup: function () {
return Q.test(this.nodeName) ? (("checkbox" === this.type || "radio" === this.type) && (H.event.add(this, "propertychange._change", function (e) {
"checked" === e.originalEvent.propertyName && (this._just_changed = !0)
}), H.event.add(this, "click._change", function (e) {
this._just_changed && !e.isTrigger && (this._just_changed = !1, H.event.simulate("change", this, e, !0))
})), !1) : (H.event.add(this, "beforeactivate._change", function (e) {
var t = e.target;
Q.test(t.nodeName) && !t._change_attached && (H.event.add(t, "change._change", function (e) {
!this.parentNode || e.isSimulated || e.isTrigger || H.event.simulate("change", this.parentNode, e, !0)
}), t._change_attached = !0)
}), void 0)
},
handle: function (e) {
var t = e.target;
return this !== t || e.isSimulated || e.isTrigger || "radio" !== t.type && "checkbox" !== t.type ? e.handleObj.handler.apply(this, arguments) : void 0
},
teardown: function () {
return H.event.remove(this, "._change"), Q.test(this.nodeName)
}
}), H.support.focusinBubbles || H.each({
focus: "focusin",
blur: "focusout"
}, function (e, t) {
var n = 0,
r = function (e) {
H.event.simulate(t, e.target, H.event.fix(e), !0)
};
H.event.special[t] = {
setup: function () {
0 === n++ && F.addEventListener(e, r, !0)
},
teardown: function () {
0 === --n && F.removeEventListener(e, r, !0)
}
}
}), H.fn.extend({
on: function (e, n, r, i, o) {
var s, l;
if ("object" == typeof e) {
"string" != typeof n && (r = r || n, n = t);
for (l in e) this.on(l, n, r, e[l], o);
return this
}
if (null == r && null == i ? (i = n, r = n = t) : null == i && ("string" == typeof n ? (i = r, r = t) : (i = r, r = n, n = t)), i === !1) i = a;
else if (!i) return this;
return 1 === o && (s = i, i = function (e) {
return H().off(e), s.apply(this, arguments)
}, i.guid = s.guid || (s.guid = H.guid++)), this.each(function () {
H.event.add(this, e, i, r, n)
})
},
one: function (e, t, n, r) {
return this.on(e, t, n, r, 1)
},
off: function (e, n, r) {
if (e && e.preventDefault && e.handleObj) {
var i = e.handleObj;
return H(e.delegateTarget).off(i.namespace ? i.origType + "." + i.namespace : i.origType, i.selector, i.handler), this
}
if ("object" == typeof e) {
for (var o in e) this.off(o, n, e[o]);
return this
}
return (n === !1 || "function" == typeof n) && (r = n, n = t), r === !1 && (r = a), this.each(function () {
H.event.remove(this, e, r, n)
})
},
bind: function (e, t, n) {
return this.on(e, null, t, n)
},
unbind: function (e, t) {
return this.off(e, null, t)
},
live: function (e, t, n) {
return H(this.context).on(e, this.selector, t, n), this
},
die: function (e, t) {
return H(this.context).off(e, this.selector || "**", t), this
},
delegate: function (e, t, n, r) {
return this.on(t, e, n, r)
},
undelegate: function (e, t, n) {
return 1 == arguments.length ? this.off(e, "**") : this.off(t, e, n)
},
trigger: function (e, t) {
return this.each(function () {
H.event.trigger(e, t, this)
})
},
triggerHandler: function (e, t) {
return this[0] ? H.event.trigger(e, t, this[0], !0) : void 0
},
toggle: function (e) {
var t = arguments,
n = e.guid || H.guid++,
r = 0,
i = function (n) {
var i = (H._data(this, "lastToggle" + e.guid) || 0) % r;
return H._data(this, "lastToggle" + e.guid, i + 1), n.preventDefault(), t[i].apply(this, arguments) || !1
};
for (i.guid = n; r < t.length;) t[r++].guid = n;
return this.click(i)
},
hover: function (e, t) {
return this.mouseenter(e).mouseleave(t || e)
}
}), H.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) {
H.fn[t] = function (e, n) {
return null == n && (n = e, e = null), arguments.length > 0 ? this.on(t, null, e, n) : this.trigger(t)
}, H.attrFn && (H.attrFn[t] = !0), et.test(t) && (H.event.fixHooks[t] = H.event.keyHooks), tt.test(t) && (H.event.fixHooks[t] = H.event.mouseHooks)
}),
function () {
function e(e, t, n, r, o, a) {
for (var s = 0, l = r.length; l > s; s++) {
var u = r[s];
if (u) {
var c = !1;
for (u = u[e]; u;) {
if (u[i] === n) {
c = r[u.sizset];
break
}
if (1 !== u.nodeType || a || (u[i] = n, u.sizset = s), u.nodeName.toLowerCase() === t) {
c = u;
break
}
u = u[e]
}
r[s] = c
}
}
}
function n(e, t, n, r, o, a) {
for (var s = 0, l = r.length; l > s; s++) {
var u = r[s];
if (u) {
var c = !1;
for (u = u[e]; u;) {
if (u[i] === n) {
c = r[u.sizset];
break
}
if (1 === u.nodeType)
if (a || (u[i] = n, u.sizset = s), "string" != typeof t) {
if (u === t) {
c = !0;
break
}
} else if (d.filter(t, [u]).length > 0) {
c = u;
break
}
u = u[e]
}
r[s] = c
}
}
}
var r = /((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,
i = "sizcache" + (Math.random() + "").replace(".", ""),
o = 0,
a = Object.prototype.toString,
s = !1,
l = !0,
u = /\\/g,
c = /\r\n/g,
f = /\W/;
[0, 0].sort(function () {
return l = !1, 0
});
var d = function (e, t, n, i) {
n = n || [], t = t || F;
var o = t;
if (1 !== t.nodeType && 9 !== t.nodeType) return [];
if (!e || "string" != typeof e) return n;
var s, l, u, c, f, p, g, y, b = !0,
x = d.isXML(t),
T = [],
N = e;
do
if (r.exec(""), s = r.exec(N), s && (N = s[3], T.push(s[1]), s[2])) {
c = s[3];
break
} while (s);
if (T.length > 1 && m.exec(e))
if (2 === T.length && h.relative[T[0]]) l = w(T[0] + T[1], t, i);
else
for (l = h.relative[T[0]] ? [t] : d(T.shift(), t); T.length;) e = T.shift(), h.relative[e] && (e += T.shift()), l = w(e, l, i);
else if (!i && T.length > 1 && 9 === t.nodeType && !x && h.match.ID.test(T[0]) && !h.match.ID.test(T[T.length - 1]) && (f = d.find(T.shift(), t, x), t = f.expr ? d.filter(f.expr, f.set)[0] : f.set[0]), t)
for (f = i ? {
expr: T.pop(),
set: v(i)
} : d.find(T.pop(), 1 !== T.length || "~" !== T[0] && "+" !== T[0] || !t.parentNode ? t : t.parentNode, x), l = f.expr ? d.filter(f.expr, f.set) : f.set, T.length > 0 ? u = v(l) : b = !1; T.length;) p = T.pop(), g = p, h.relative[p] ? g = T.pop() : p = "", null == g && (g = t), h.relative[p](u, g, x);
else u = T = []; if (u || (u = l), u || d.error(p || e), "[object Array]" === a.call(u))
if (b)
if (t && 1 === t.nodeType)
for (y = 0; null != u[y]; y++) u[y] && (u[y] === !0 || 1 === u[y].nodeType && d.contains(t, u[y])) && n.push(l[y]);
else
for (y = 0; null != u[y]; y++) u[y] && 1 === u[y].nodeType && n.push(l[y]);
else n.push.apply(n, u);
else v(u, n);
return c && (d(c, o, n, i), d.uniqueSort(n)), n
};
d.uniqueSort = function (e) {
if (x && (s = l, e.sort(x), s))
for (var t = 1; t < e.length; t++) e[t] === e[t - 1] && e.splice(t--, 1);
return e
}, d.matches = function (e, t) {
return d(e, null, null, t)
}, d.matchesSelector = function (e, t) {
return d(t, null, null, [e]).length > 0
}, d.find = function (e, t, n) {
var r, i, o, a, s, l;
if (!e) return [];
for (i = 0, o = h.order.length; o > i; i++)
if (s = h.order[i], (a = h.leftMatch[s].exec(e)) && (l = a[1], a.splice(1, 1), "\\" !== l.substr(l.length - 1) && (a[1] = (a[1] || "").replace(u, ""), r = h.find[s](a, t, n), null != r))) {
e = e.replace(h.match[s], "");
break
}
return r || (r = "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName("*") : []), {
set: r,
expr: e
}
}, d.filter = function (e, n, r, i) {
for (var o, a, s, l, u, c, f, p, m, g = e, y = [], v = n, b = n && n[0] && d.isXML(n[0]); e && n.length;) {
for (s in h.filter)
if (null != (o = h.leftMatch[s].exec(e)) && o[2]) {
if (c = h.filter[s], f = o[1], a = !1, o.splice(1, 1), "\\" === f.substr(f.length - 1)) continue;
if (v === y && (y = []), h.preFilter[s])
if (o = h.preFilter[s](o, v, r, y, i, b)) {
if (o === !0) continue
} else a = l = !0;
if (o)
for (p = 0; null != (u = v[p]); p++) u && (l = c(u, o, p, v), m = i ^ l, r && null != l ? m ? a = !0 : v[p] = !1 : m && (y.push(u), a = !0));
if (l !== t) {
if (r || (v = y), e = e.replace(h.match[s], ""), !a) return [];
break
}
}
if (e === g) {
if (null != a) break;
d.error(e)
}
g = e
}
return v
}, d.error = function (e) {
throw new Error("Syntax error, unrecognized expression: " + e)
};
var p = d.getText = function (e) {
var t, n, r = e.nodeType,
i = "";
if (r) {
if (1 === r || 9 === r || 11 === r) {
if ("string" == typeof e.textContent) return e.textContent;
if ("string" == typeof e.innerText) return e.innerText.replace(c, "");
for (e = e.firstChild; e; e = e.nextSibling) i += p(e)
} else if (3 === r || 4 === r) return e.nodeValue
} else
for (t = 0; n = e[t]; t++) 8 !== n.nodeType && (i += p(n));
return i
}, h = d.selectors = {
order: ["ID", "NAME", "TAG"],
match: {
ID: /#((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
CLASS: /\.((?:[\w\u00c0-\uFFFF\-]|\\.)+)/,
NAME: /\[name=['"]*((?:[\w\u00c0-\uFFFF\-]|\\.)+)['"]*\]/,
ATTR: /\[\s*((?:[\w\u00c0-\uFFFF\-]|\\.)+)\s*(?:(\S?=)\s*(?:(['"])(.*?)\3|(#?(?:[\w\u00c0-\uFFFF\-]|\\.)*)|)|)\s*\]/,
TAG: /^((?:[\w\u00c0-\uFFFF\*\-]|\\.)+)/,
CHILD: /:(only|nth|last|first)-child(?:\(\s*(even|odd|(?:[+\-]?\d+|(?:[+\-]?\d*)?n\s*(?:[+\-]\s*\d+)?))\s*\))?/,
POS: /:(nth|eq|gt|lt|first|last|even|odd)(?:\((\d*)\))?(?=[^\-]|$)/,
PSEUDO: /:((?:[\w\u00c0-\uFFFF\-]|\\.)+)(?:\((['"]?)((?:\([^\)]+\)|[^\(\)]*)+)\2\))?/
},
leftMatch: {},
attrMap: {
"class": "className",
"for": "htmlFor"
},
attrHandle: {
href: function (e) {
return e.getAttribute("href")
},
type: function (e) {
return e.getAttribute("type")
}
},
relative: {
"+": function (e, t) {
var n = "string" == typeof t,
r = n && !f.test(t),
i = n && !r;
r && (t = t.toLowerCase());
for (var o, a = 0, s = e.length; s > a; a++)
if (o = e[a]) {
for (;
(o = o.previousSibling) && 1 !== o.nodeType;);
e[a] = i || o && o.nodeName.toLowerCase() === t ? o || !1 : o === t
}
i && d.filter(t, e, !0)
},
">": function (e, t) {
var n, r = "string" == typeof t,
i = 0,
o = e.length;
if (r && !f.test(t)) {
for (t = t.toLowerCase(); o > i; i++)
if (n = e[i]) {
var a = n.parentNode;
e[i] = a.nodeName.toLowerCase() === t ? a : !1
}
} else {
for (; o > i; i++) n = e[i], n && (e[i] = r ? n.parentNode : n.parentNode === t);
r && d.filter(t, e, !0)
}
},
"": function (t, r, i) {
var a, s = o++,
l = n;
"string" != typeof r || f.test(r) || (r = r.toLowerCase(), a = r, l = e), l("parentNode", r, s, t, a, i)
},
"~": function (t, r, i) {
var a, s = o++,
l = n;
"string" != typeof r || f.test(r) || (r = r.toLowerCase(), a = r, l = e), l("previousSibling", r, s, t, a, i)
}
},
find: {
ID: function (e, t, n) {
if ("undefined" != typeof t.getElementById && !n) {
var r = t.getElementById(e[1]);
return r && r.parentNode ? [r] : []
}
},
NAME: function (e, t) {
if ("undefined" != typeof t.getElementsByName) {
for (var n = [], r = t.getElementsByName(e[1]), i = 0, o = r.length; o > i; i++) r[i].getAttribute("name") === e[1] && n.push(r[i]);
return 0 === n.length ? null : n
}
},
TAG: function (e, t) {
return "undefined" != typeof t.getElementsByTagName ? t.getElementsByTagName(e[1]) : void 0
}
},
preFilter: {
CLASS: function (e, t, n, r, i, o) {
if (e = " " + e[1].replace(u, "") + " ", o) return e;
for (var a, s = 0; null != (a = t[s]); s++) a && (i ^ (a.className && (" " + a.className + " ").replace(/[\t\n\r]/g, " ").indexOf(e) >= 0) ? n || r.push(a) : n && (t[s] = !1));
return !1
},
ID: function (e) {
return e[1].replace(u, "")
},
TAG: function (e) {
return e[1].replace(u, "").toLowerCase()
},
CHILD: function (e) {
if ("nth" === e[1]) {
e[2] || d.error(e[0]), e[2] = e[2].replace(/^\+|\s*/g, "");
var t = /(-?)(\d*)(?:n([+\-]?\d*))?/.exec("even" === e[2] && "2n" || "odd" === e[2] && "2n+1" || !/\D/.test(e[2]) && "0n+" + e[2] || e[2]);
e[2] = t[1] + (t[2] || 1) - 0, e[3] = t[3] - 0
} else e[2] && d.error(e[0]);
return e[0] = o++, e
},
ATTR: function (e, t, n, r, i, o) {
var a = e[1] = e[1].replace(u, "");
return !o && h.attrMap[a] && (e[1] = h.attrMap[a]), e[4] = (e[4] || e[5] || "").replace(u, ""), "~=" === e[2] && (e[4] = " " + e[4] + " "), e
},
PSEUDO: function (e, t, n, i, o) {
if ("not" === e[1]) {
if (!((r.exec(e[3]) || "").length > 1 || /^\w/.test(e[3]))) {
var a = d.filter(e[3], t, n, !0 ^ o);
return n || i.push.apply(i, a), !1
}
e[3] = d(e[3], null, null, t)
} else if (h.match.POS.test(e[0]) || h.match.CHILD.test(e[0])) return !0;
return e
},
POS: function (e) {
return e.unshift(!0), e
}
},
filters: {
enabled: function (e) {
return e.disabled === !1 && "hidden" !== e.type
},
disabled: function (e) {
return e.disabled === !0
},
checked: function (e) {
return e.checked === !0
},
selected: function (e) {
return e.parentNode && e.parentNode.selectedIndex, e.selected === !0
},
parent: function (e) {
return !!e.firstChild
},
empty: function (e) {
return !e.firstChild
},
has: function (e, t, n) {
return !!d(n[3], e).length
},
header: function (e) {
return /h\d/i.test(e.nodeName)
},
text: function (e) {
var t = e.getAttribute("type"),
n = e.type;
return "input" === e.nodeName.toLowerCase() && "text" === n && (t === n || null === t)
},
radio: function (e) {
return "input" === e.nodeName.toLowerCase() && "radio" === e.type
},
checkbox: function (e) {
return "input" === e.nodeName.toLowerCase() && "checkbox" === e.type
},
file: function (e) {
return "input" === e.nodeName.toLowerCase() && "file" === e.type
},
password: function (e) {
return "input" === e.nodeName.toLowerCase() && "password" === e.type
},
submit: function (e) {
var t = e.nodeName.toLowerCase();
return ("input" === t || "button" === t) && "submit" === e.type
},
image: function (e) {
return "input" === e.nodeName.toLowerCase() && "image" === e.type
},
reset: function (e) {
var t = e.nodeName.toLowerCase();
return ("input" === t || "button" === t) && "reset" === e.type
},
button: function (e) {
var t = e.nodeName.toLowerCase();
return "input" === t && "button" === e.type || "button" === t
},
input: function (e) {
return /input|select|textarea|button/i.test(e.nodeName)
},
focus: function (e) {
return e === e.ownerDocument.activeElement
}
},
setFilters: {
first: function (e, t) {
return 0 === t
},
last: function (e, t, n, r) {
return t === r.length - 1
},
even: function (e, t) {
return 0 === t % 2
},
odd: function (e, t) {
return 1 === t % 2
},
lt: function (e, t, n) {
return t < n[3] - 0
},
gt: function (e, t, n) {
return t > n[3] - 0
},
nth: function (e, t, n) {
return n[3] - 0 === t
},
eq: function (e, t, n) {
return n[3] - 0 === t
}
},
filter: {
PSEUDO: function (e, t, n, r) {
var i = t[1],
o = h.filters[i];
if (o) return o(e, n, t, r);
if ("contains" === i) return (e.textContent || e.innerText || p([e]) || "").indexOf(t[3]) >= 0;
if ("not" === i) {
for (var a = t[3], s = 0, l = a.length; l > s; s++)
if (a[s] === e) return !1;
return !0
}
d.error(i)
},
CHILD: function (e, t) {
var n, r, o, a, s, l, u = t[1],
c = e;
switch (u) {
case "only":
case "first":
for (; c = c.previousSibling;)
if (1 === c.nodeType) return !1;
if ("first" === u) return !0;
c = e;
case "last":
for (; c = c.nextSibling;)
if (1 === c.nodeType) return !1;
return !0;
case "nth":
if (n = t[2], r = t[3], 1 === n && 0 === r) return !0;
if (o = t[0], a = e.parentNode, a && (a[i] !== o || !e.nodeIndex)) {
for (s = 0, c = a.firstChild; c; c = c.nextSibling) 1 === c.nodeType && (c.nodeIndex = ++s);
a[i] = o
}
return l = e.nodeIndex - r, 0 === n ? 0 === l : 0 === l % n && l / n >= 0
}
},
ID: function (e, t) {
return 1 === e.nodeType && e.getAttribute("id") === t
},
TAG: function (e, t) {
return "*" === t && 1 === e.nodeType || !! e.nodeName && e.nodeName.toLowerCase() === t
},
CLASS: function (e, t) {
return (" " + (e.className || e.getAttribute("class")) + " ").indexOf(t) > -1
},
ATTR: function (e, t) {
var n = t[1],
r = d.attr ? d.attr(e, n) : h.attrHandle[n] ? h.attrHandle[n](e) : null != e[n] ? e[n] : e.getAttribute(n),
i = r + "",
o = t[2],
a = t[4];
return null == r ? "!=" === o : !o && d.attr ? null != r : "=" === o ? i === a : "*=" === o ? i.indexOf(a) >= 0 : "~=" === o ? (" " + i + " ").indexOf(a) >= 0 : a ? "!=" === o ? i !== a : "^=" === o ? 0 === i.indexOf(a) : "$=" === o ? i.substr(i.length - a.length) === a : "|=" === o ? i === a || i.substr(0, a.length + 1) === a + "-" : !1 : i && r !== !1
},
POS: function (e, t, n, r) {
var i = t[2],
o = h.setFilters[i];
return o ? o(e, n, t, r) : void 0
}
}
}, m = h.match.POS,
g = function (e, t) {
return "\\" + (t - 0 + 1)
};
for (var y in h.match) h.match[y] = new RegExp(h.match[y].source + /(?![^\[]*\])(?![^\(]*\))/.source), h.leftMatch[y] = new RegExp(/(^(?:.|\r|\n)*?)/.source + h.match[y].source.replace(/\\(\d+)/g, g));
h.match.globalPOS = m;
var v = function (e, t) {
return e = Array.prototype.slice.call(e, 0), t ? (t.push.apply(t, e), t) : e
};
try {
Array.prototype.slice.call(F.documentElement.childNodes, 0)[0].nodeType
} catch (b) {
v = function (e, t) {
var n = 0,
r = t || [];
if ("[object Array]" === a.call(e)) Array.prototype.push.apply(r, e);
else if ("number" == typeof e.length)
for (var i = e.length; i > n; n++) r.push(e[n]);
else
for (; e[n]; n++) r.push(e[n]);
return r
}
}
var x, T;
F.documentElement.compareDocumentPosition ? x = function (e, t) {
return e === t ? (s = !0, 0) : e.compareDocumentPosition && t.compareDocumentPosition ? 4 & e.compareDocumentPosition(t) ? -1 : 1 : e.compareDocumentPosition ? -1 : 1
} : (x = function (e, t) {
if (e === t) return s = !0, 0;
if (e.sourceIndex && t.sourceIndex) return e.sourceIndex - t.sourceIndex;
var n, r, i = [],
o = [],
a = e.parentNode,
l = t.parentNode,
u = a;
if (a === l) return T(e, t);
if (!a) return -1;
if (!l) return 1;
for (; u;) i.unshift(u), u = u.parentNode;
for (u = l; u;) o.unshift(u), u = u.parentNode;
n = i.length, r = o.length;
for (var c = 0; n > c && r > c; c++)
if (i[c] !== o[c]) return T(i[c], o[c]);
return c === n ? T(e, o[c], -1) : T(i[c], t, 1)
}, T = function (e, t, n) {
if (e === t) return n;
for (var r = e.nextSibling; r;) {
if (r === t) return -1;
r = r.nextSibling
}
return 1
}),
function () {
var e = F.createElement("div"),
n = "script" + (new Date).getTime(),
r = F.documentElement;
e.innerHTML = "<a name='" + n + "'/>", r.insertBefore(e, r.firstChild), F.getElementById(n) && (h.find.ID = function (e, n, r) {
if ("undefined" != typeof n.getElementById && !r) {
var i = n.getElementById(e[1]);
return i ? i.id === e[1] || "undefined" != typeof i.getAttributeNode && i.getAttributeNode("id").nodeValue === e[1] ? [i] : t : []
}
}, h.filter.ID = function (e, t) {
var n = "undefined" != typeof e.getAttributeNode && e.getAttributeNode("id");
return 1 === e.nodeType && n && n.nodeValue === t
}), r.removeChild(e), r = e = null
}(),
function () {
var e = F.createElement("div");
e.appendChild(F.createComment("")), e.getElementsByTagName("*").length > 0 && (h.find.TAG = function (e, t) {
var n = t.getElementsByTagName(e[1]);
if ("*" === e[1]) {
for (var r = [], i = 0; n[i]; i++) 1 === n[i].nodeType && r.push(n[i]);
n = r
}
return n
}), e.innerHTML = "<a href='#'></a>", e.firstChild && "undefined" != typeof e.firstChild.getAttribute && "#" !== e.firstChild.getAttribute("href") && (h.attrHandle.href = function (e) {
return e.getAttribute("href", 2)
}), e = null
}(), F.querySelectorAll && function () {
var e = d,
t = F.createElement("div"),
n = "__sizzle__";
if (t.innerHTML = "<p class='TEST'></p>", !t.querySelectorAll || 0 !== t.querySelectorAll(".TEST").length) {
d = function (t, r, i, o) {
if (r = r || F, !o && !d.isXML(r)) {
var a = /^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(t);
if (a && (1 === r.nodeType || 9 === r.nodeType)) {
if (a[1]) return v(r.getElementsByTagName(t), i);
if (a[2] && h.find.CLASS && r.getElementsByClassName) return v(r.getElementsByClassName(a[2]), i)
}
if (9 === r.nodeType) {
if ("body" === t && r.body) return v([r.body], i);
if (a && a[3]) {
var s = r.getElementById(a[3]);
if (!s || !s.parentNode) return v([], i);
if (s.id === a[3]) return v([s], i)
}
try {
return v(r.querySelectorAll(t), i)
} catch (l) {}
} else if (1 === r.nodeType && "object" !== r.nodeName.toLowerCase()) {
var u = r,
c = r.getAttribute("id"),
f = c || n,
p = r.parentNode,
m = /^\s*[+~]/.test(t);
c ? f = f.replace(/'/g, "\\$&") : r.setAttribute("id", f), m && p && (r = r.parentNode);
try {
if (!m || p) return v(r.querySelectorAll("[id='" + f + "'] " + t), i)
} catch (g) {} finally {
c || u.removeAttribute("id")
}
}
}
return e(t, r, i, o)
};
for (var r in e) d[r] = e[r];
t = null
}
}(),
function () {
var e = F.documentElement,
t = e.matchesSelector || e.mozMatchesSelector || e.webkitMatchesSelector || e.msMatchesSelector;
if (t) {
var n = !t.call(F.createElement("div"), "div"),
r = !1;
try {
t.call(F.documentElement, "[test!='']:sizzle")
} catch (i) {
r = !0
}
d.matchesSelector = function (e, i) {
if (i = i.replace(/\=\s*([^'"\]]*)\s*\]/g, "='$1']"), !d.isXML(e)) try {
if (r || !h.match.PSEUDO.test(i) && !/!=/.test(i)) {
var o = t.call(e, i);
if (o || !n || e.document && 11 !== e.document.nodeType) return o
}
} catch (a) {}
return d(i, null, null, [e]).length > 0
}
}
}(),
function () {
var e = F.createElement("div");
e.innerHTML = "<div class='test e'></div><div class='test'></div>", e.getElementsByClassName && 0 !== e.getElementsByClassName("e").length && (e.lastChild.className = "e", 1 !== e.getElementsByClassName("e").length && (h.order.splice(1, 0, "CLASS"), h.find.CLASS = function (e, t, n) {
return "undefined" == typeof t.getElementsByClassName || n ? void 0 : t.getElementsByClassName(e[1])
}, e = null))
}(), d.contains = F.documentElement.contains ? function (e, t) {
return e !== t && (e.contains ? e.contains(t) : !0)
} : F.documentElement.compareDocumentPosition ? function (e, t) {
return !!(16 & e.compareDocumentPosition(t))
} : function () {
return !1
}, d.isXML = function (e) {
var t = (e ? e.ownerDocument || e : 0).documentElement;
return t ? "HTML" !== t.nodeName : !1
};
var w = function (e, t, n) {
for (var r, i = [], o = "", a = t.nodeType ? [t] : t; r = h.match.PSEUDO.exec(e);) o += r[0], e = e.replace(h.match.PSEUDO, "");
e = h.relative[e] ? e + "*" : e;
for (var s = 0, l = a.length; l > s; s++) d(e, a[s], i, n);
return d.filter(o, i)
};
d.attr = H.attr, d.selectors.attrMap = {}, H.find = d, H.expr = d.selectors, H.expr[":"] = H.expr.filters, H.unique = d.uniqueSort, H.text = d.getText, H.isXMLDoc = d.isXML, H.contains = d.contains
}();
var st = /Until$/,
lt = /^(?:parents|prevUntil|prevAll)/,
ut = /,/,
ct = /^.[^:#\[\.,]*$/,
ft = Array.prototype.slice,
dt = H.expr.match.globalPOS,
pt = {
children: !0,
contents: !0,
next: !0,
prev: !0
};
H.fn.extend({
find: function (e) {
var t, n, r = this;
if ("string" != typeof e) return H(e).filter(function () {
for (t = 0, n = r.length; n > t; t++)
if (H.contains(r[t], this)) return !0
});
var i, o, a, s = this.pushStack("", "find", e);
for (t = 0, n = this.length; n > t; t++)
if (i = s.length, H.find(e, this[t], s), t > 0)
for (o = i; o < s.length; o++)
for (a = 0; i > a; a++)
if (s[a] === s[o]) {
s.splice(o--, 1);
break
}
return s
},
has: function (e) {
var t = H(e);
return this.filter(function () {
for (var e = 0, n = t.length; n > e; e++)
if (H.contains(this, t[e])) return !0
})
},
not: function (e) {
return this.pushStack(u(this, e, !1), "not", e)
},
filter: function (e) {
return this.pushStack(u(this, e, !0), "filter", e)
},
is: function (e) {
return !!e && ("string" == typeof e ? dt.test(e) ? H(e, this.context).index(this[0]) >= 0 : H.filter(e, this).length > 0 : this.filter(e).length > 0)
},
closest: function (e, t) {
var n, r, i = [],
o = this[0];
if (H.isArray(e)) {
for (var a = 1; o && o.ownerDocument && o !== t;) {
for (n = 0; n < e.length; n++) H(o).is(e[n]) && i.push({
selector: e[n],
elem: o,
level: a
});
o = o.parentNode, a++
}
return i
}
var s = dt.test(e) || "string" != typeof e ? H(e, t || this.context) : 0;
for (n = 0, r = this.length; r > n; n++)
for (o = this[n]; o;) {
if (s ? s.index(o) > -1 : H.find.matchesSelector(o, e)) {
i.push(o);
break
}
if (o = o.parentNode, !o || !o.ownerDocument || o === t || 11 === o.nodeType) break
}
return i = i.length > 1 ? H.unique(i) : i, this.pushStack(i, "closest", e)
},
index: function (e) {
return e ? "string" == typeof e ? H.inArray(this[0], H(e)) : H.inArray(e.jquery ? e[0] : e, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
},
add: function (e, t) {
var n = "string" == typeof e ? H(e, t) : H.makeArray(e && e.nodeType ? [e] : e),
r = H.merge(this.get(), n);
return this.pushStack(l(n[0]) || l(r[0]) ? r : H.unique(r))
},
andSelf: function () {
return this.add(this.prevObject)
}
}), H.each({
parent: function (e) {
var t = e.parentNode;
return t && 11 !== t.nodeType ? t : null
},
parents: function (e) {
return H.dir(e, "parentNode")
},
parentsUntil: function (e, t, n) {
return H.dir(e, "parentNode", n)
},
next: function (e) {
return H.nth(e, 2, "nextSibling")
},
prev: function (e) {
return H.nth(e, 2, "previousSibling")
},
nextAll: function (e) {
return H.dir(e, "nextSibling")
},
prevAll: function (e) {
return H.dir(e, "previousSibling")
},
nextUntil: function (e, t, n) {
return H.dir(e, "nextSibling", n)
},
prevUntil: function (e, t, n) {
return H.dir(e, "previousSibling", n)
},
siblings: function (e) {
return H.sibling((e.parentNode || {}).firstChild, e)
},
children: function (e) {
return H.sibling(e.firstChild)
},
contents: function (e) {
return H.nodeName(e, "iframe") ? e.contentDocument || e.contentWindow.document : H.makeArray(e.childNodes)
}
}, function (e, t) {
H.fn[e] = function (n, r) {
var i = H.map(this, t, n);
return st.test(e) || (r = n), r && "string" == typeof r && (i = H.filter(r, i)), i = this.length > 1 && !pt[e] ? H.unique(i) : i, (this.length > 1 || ut.test(r)) && lt.test(e) && (i = i.reverse()), this.pushStack(i, e, ft.call(arguments).join(","))
}
}), H.extend({
filter: function (e, t, n) {
return n && (e = ":not(" + e + ")"), 1 === t.length ? H.find.matchesSelector(t[0], e) ? [t[0]] : [] : H.find.matches(e, t)
},
dir: function (e, n, r) {
for (var i = [], o = e[n]; o && 9 !== o.nodeType && (r === t || 1 !== o.nodeType || !H(o).is(r));) 1 === o.nodeType && i.push(o), o = o[n];
return i
},
nth: function (e, t, n) {
t = t || 1;
for (var r = 0; e && (1 !== e.nodeType || ++r !== t); e = e[n]);
return e
},
sibling: function (e, t) {
for (var n = []; e; e = e.nextSibling) 1 === e.nodeType && e !== t && n.push(e);
return n
}
});
var ht = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
mt = / jQuery\d+="(?:\d+|null)"/g,
gt = /^\s+/,
yt = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
vt = /<([\w:]+)/,
bt = /<tbody/i,
xt = /<|&#?\w+;/,
Tt = /<(?:script|style)/i,
wt = /<(?:script|object|embed|option|style)/i,
Nt = new RegExp("<(?:" + ht + ")[\\s/>]", "i"),
Ct = /checked\s*(?:[^=]|=\s*.checked.)/i,
Et = /\/(java|ecma)script/i,
kt = /^\s*<!(?:\[CDATA\[|\-\-)/,
St = {
option: [1, "<select multiple='multiple'>", "</select>"],
legend: [1, "<fieldset>", "</fieldset>"],
thead: [1, "<table>", "</table>"],
tr: [2, "<table><tbody>", "</tbody></table>"],
td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
area: [1, "<map>", "</map>"],
_default: [0, "", ""]
}, At = c(F);
St.optgroup = St.option, St.tbody = St.tfoot = St.colgroup = St.caption = St.thead, St.th = St.td, H.support.htmlSerialize || (St._default = [1, "div<div>", "</div>"]), H.fn.extend({
text: function (e) {
return H.access(this, function (e) {
return e === t ? H.text(this) : this.empty().append((this[0] && this[0].ownerDocument || F).createTextNode(e))
}, null, e, arguments.length)
},
wrapAll: function (e) {
if (H.isFunction(e)) return this.each(function (t) {
H(this).wrapAll(e.call(this, t))
});
if (this[0]) {
var t = H(e, this[0].ownerDocument).eq(0).clone(!0);
this[0].parentNode && t.insertBefore(this[0]), t.map(function () {
for (var e = this; e.firstChild && 1 === e.firstChild.nodeType;) e = e.firstChild;
return e
}).append(this)
}
return this
},
wrapInner: function (e) {
return H.isFunction(e) ? this.each(function (t) {
H(this).wrapInner(e.call(this, t))
}) : this.each(function () {
var t = H(this),
n = t.contents();
n.length ? n.wrapAll(e) : t.append(e)
})
},
wrap: function (e) {
var t = H.isFunction(e);
return this.each(function (n) {
H(this).wrapAll(t ? e.call(this, n) : e)
})
},
unwrap: function () {
return this.parent().each(function () {
H.nodeName(this, "body") || H(this).replaceWith(this.childNodes)
}).end()
},
append: function () {
return this.domManip(arguments, !0, function (e) {
1 === this.nodeType && this.appendChild(e)
})
},
prepend: function () {
return this.domManip(arguments, !0, function (e) {
1 === this.nodeType && this.insertBefore(e, this.firstChild)
})
},
before: function () {
if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (e) {
this.parentNode.insertBefore(e, this)
});
if (arguments.length) {
var e = H.clean(arguments);
return e.push.apply(e, this.toArray()), this.pushStack(e, "before", arguments)
}
},
after: function () {
if (this[0] && this[0].parentNode) return this.domManip(arguments, !1, function (e) {
this.parentNode.insertBefore(e, this.nextSibling)
});
if (arguments.length) {
var e = this.pushStack(this, "after", arguments);
return e.push.apply(e, H.clean(arguments)), e
}
},
remove: function (e, t) {
for (var n, r = 0; null != (n = this[r]); r++)(!e || H.filter(e, [n]).length) && (t || 1 !== n.nodeType || (H.cleanData(n.getElementsByTagName("*")), H.cleanData([n])), n.parentNode && n.parentNode.removeChild(n));
return this
},
empty: function () {
for (var e, t = 0; null != (e = this[t]); t++)
for (1 === e.nodeType && H.cleanData(e.getElementsByTagName("*")); e.firstChild;) e.removeChild(e.firstChild);
return this
},
clone: function (e, t) {
return e = null == e ? !1 : e, t = null == t ? e : t, this.map(function () {
return H.clone(this, e, t)
})
},
html: function (e) {
return H.access(this, function (e) {
var n = this[0] || {}, r = 0,
i = this.length;
if (e === t) return 1 === n.nodeType ? n.innerHTML.replace(mt, "") : null;
if (!("string" != typeof e || Tt.test(e) || !H.support.leadingWhitespace && gt.test(e) || St[(vt.exec(e) || ["", ""])[1].toLowerCase()])) {
e = e.replace(yt, "<$1></$2>");
try {
for (; i > r; r++) n = this[r] || {}, 1 === n.nodeType && (H.cleanData(n.getElementsByTagName("*")), n.innerHTML = e);
n = 0
} catch (o) {}
}
n && this.empty().append(e)
}, null, e, arguments.length)
},
replaceWith: function (e) {
return this[0] && this[0].parentNode ? H.isFunction(e) ? this.each(function (t) {
var n = H(this),
r = n.html();
n.replaceWith(e.call(this, t, r))
}) : ("string" != typeof e && (e = H(e).detach()), this.each(function () {
var t = this.nextSibling,
n = this.parentNode;
H(this).remove(), t ? H(t).before(e) : H(n).append(e)
})) : this.length ? this.pushStack(H(H.isFunction(e) ? e() : e), "replaceWith", e) : this
},
detach: function (e) {
return this.remove(e, !0)
},
domManip: function (e, n, r) {
var i, o, a, s, l = e[0],
u = [];
if (!H.support.checkClone && 3 === arguments.length && "string" == typeof l && Ct.test(l)) return this.each(function () {
H(this).domManip(e, n, r, !0)
});
if (H.isFunction(l)) return this.each(function (i) {
var o = H(this);
e[0] = l.call(this, i, n ? o.html() : t), o.domManip(e, n, r)
});
if (this[0]) {
if (s = l && l.parentNode, i = H.support.parentNode && s && 11 === s.nodeType && s.childNodes.length === this.length ? {
fragment: s
} : H.buildFragment(e, this, u), a = i.fragment, o = 1 === a.childNodes.length ? a = a.firstChild : a.firstChild) {
n = n && H.nodeName(o, "tr");
for (var c = 0, d = this.length, p = d - 1; d > c; c++) r.call(n ? f(this[c], o) : this[c], i.cacheable || d > 1 && p > c ? H.clone(a, !0, !0) : a)
}
u.length && H.each(u, function (e, t) {
t.src ? H.ajax({
type: "GET",
global: !1,
url: t.src,
async: !1,
dataType: "script"
}) : H.globalEval((t.text || t.textContent || t.innerHTML || "").replace(kt, "/*$0*/")), t.parentNode && t.parentNode.removeChild(t)
})
}
return this
}
}), H.buildFragment = function (e, t, n) {
var r, i, o, a, s = e[0];
return t && t[0] && (a = t[0].ownerDocument || t[0]), a.createDocumentFragment || (a = F), !(1 === e.length && "string" == typeof s && s.length < 512 && a === F && "<" === s.charAt(0)) || wt.test(s) || !H.support.checkClone && Ct.test(s) || !H.support.html5Clone && Nt.test(s) || (i = !0, o = H.fragments[s], o && 1 !== o && (r = o)), r || (r = a.createDocumentFragment(), H.clean(e, a, r, n)), i && (H.fragments[s] = o ? r : 1), {
fragment: r,
cacheable: i
}
}, H.fragments = {}, H.each({
appendTo: "append",
prependTo: "prepend",
insertBefore: "before",
insertAfter: "after",
replaceAll: "replaceWith"
}, function (e, t) {
H.fn[e] = function (n) {
var r = [],
i = H(n),
o = 1 === this.length && this[0].parentNode;
if (o && 11 === o.nodeType && 1 === o.childNodes.length && 1 === i.length) return i[t](this[0]), this;
for (var a = 0, s = i.length; s > a; a++) {
var l = (a > 0 ? this.clone(!0) : this).get();
H(i[a])[t](l), r = r.concat(l)
}
return this.pushStack(r, e, i.selector)
}
}), H.extend({
clone: function (e, t, n) {
var r, i, o, a = H.support.html5Clone || H.isXMLDoc(e) || !Nt.test("<" + e.nodeName + ">") ? e.cloneNode(!0) : y(e);
if (!(H.support.noCloneEvent && H.support.noCloneChecked || 1 !== e.nodeType && 11 !== e.nodeType || H.isXMLDoc(e)))
for (p(e, a), r = h(e), i = h(a), o = 0; r[o]; ++o) i[o] && p(r[o], i[o]);
if (t && (d(e, a), n))
for (r = h(e), i = h(a), o = 0; r[o]; ++o) d(r[o], i[o]);
return r = i = null, a
},
clean: function (e, t, n, r) {
var i, o, a, s = [];
t = t || F, "undefined" == typeof t.createElement && (t = t.ownerDocument || t[0] && t[0].ownerDocument || F);
for (var l, u = 0; null != (l = e[u]); u++)
if ("number" == typeof l && (l += ""), l) {
if ("string" == typeof l)
if (xt.test(l)) {
l = l.replace(yt, "<$1></$2>");
var f, d = (vt.exec(l) || ["", ""])[1].toLowerCase(),
p = St[d] || St._default,
h = p[0],
m = t.createElement("div"),
y = At.childNodes;
for (t === F ? At.appendChild(m) : c(t).appendChild(m), m.innerHTML = p[1] + l + p[2]; h--;) m = m.lastChild;
if (!H.support.tbody) {
var v = bt.test(l),
b = "table" !== d || v ? "<table>" !== p[1] || v ? [] : m.childNodes : m.firstChild && m.firstChild.childNodes;
for (a = b.length - 1; a >= 0; --a) H.nodeName(b[a], "tbody") && !b[a].childNodes.length && b[a].parentNode.removeChild(b[a])
}!H.support.leadingWhitespace && gt.test(l) && m.insertBefore(t.createTextNode(gt.exec(l)[0]), m.firstChild), l = m.childNodes, m && (m.parentNode.removeChild(m), y.length > 0 && (f = y[y.length - 1], f && f.parentNode && f.parentNode.removeChild(f)))
} else l = t.createTextNode(l);
var x;
if (!H.support.appendChecked)
if (l[0] && "number" == typeof (x = l.length))
for (a = 0; x > a; a++) g(l[a]);
else g(l);
l.nodeType ? s.push(l) : s = H.merge(s, l)
}
if (n)
for (i = function (e) {
return !e.type || Et.test(e.type)
}, u = 0; s[u]; u++)
if (o = s[u], r && H.nodeName(o, "script") && (!o.type || Et.test(o.type))) r.push(o.parentNode ? o.parentNode.removeChild(o) : o);
else {
if (1 === o.nodeType) {
var T = H.grep(o.getElementsByTagName("script"), i);
s.splice.apply(s, [u + 1, 0].concat(T))
}
n.appendChild(o)
}
return s
},
cleanData: function (e) {
for (var t, n, r, i = H.cache, o = H.event.special, a = H.support.deleteExpando, s = 0; null != (r = e[s]); s++)
if ((!r.nodeName || !H.noData[r.nodeName.toLowerCase()]) && (n = r[H.expando])) {
if (t = i[n], t && t.events) {
for (var l in t.events) o[l] ? H.event.remove(r, l) : H.removeEvent(r, l, t.handle);
t.handle && (t.handle.elem = null)
}
a ? delete r[H.expando] : r.removeAttribute && r.removeAttribute(H.expando), delete i[n]
}
}
});
var Lt, jt, Dt, Ft = /alpha\([^)]*\)/i,
Mt = /opacity=([^)]*)/,
_t = /([A-Z]|^ms)/g,
Ht = /^[\-+]?(?:\d*\.)?\d+$/i,
Ot = /^-?(?:\d*\.)?\d+(?!px)[^\d\s]+$/i,
Bt = /^([\-+])=([\-+.\de]+)/,
Pt = /^margin/,
qt = {
position: "absolute",
visibility: "hidden",
display: "block"
}, Wt = ["Top", "Right", "Bottom", "Left"];
H.fn.css = function (e, n) {
return H.access(this, function (e, n, r) {
return r !== t ? H.style(e, n, r) : H.css(e, n)
}, e, n, arguments.length > 1)
}, H.extend({
cssHooks: {
opacity: {
get: function (e, t) {
if (t) {
var n = Lt(e, "opacity");
return "" === n ? "1" : n
}
return e.style.opacity
}
}
},
cssNumber: {
fillOpacity: !0,
fontWeight: !0,
lineHeight: !0,
opacity: !0,
orphans: !0,
widows: !0,
zIndex: !0,
zoom: !0
},
cssProps: {
"float": H.support.cssFloat ? "cssFloat" : "styleFloat"
},
style: function (e, n, r, i) {
if (e && 3 !== e.nodeType && 8 !== e.nodeType && e.style) {
var o, a, s = H.camelCase(n),
l = e.style,
u = H.cssHooks[s];
if (n = H.cssProps[s] || s, r === t) return u && "get" in u && (o = u.get(e, !1, i)) !== t ? o : l[n];
if (a = typeof r, "string" === a && (o = Bt.exec(r)) && (r = +(o[1] + 1) * +o[2] + parseFloat(H.css(e, n)), a = "number"), !(null == r || "number" === a && isNaN(r) || ("number" !== a || H.cssNumber[s] || (r += "px"), u && "set" in u && (r = u.set(e, r)) === t))) try {
l[n] = r
} catch (c) {}
}
},
css: function (e, n, r) {
var i, o;
return n = H.camelCase(n), o = H.cssHooks[n], n = H.cssProps[n] || n, "cssFloat" === n && (n = "float"), o && "get" in o && (i = o.get(e, !0, r)) !== t ? i : Lt ? Lt(e, n) : void 0
},
swap: function (e, t, n) {
var r, i, o = {};
for (i in t) o[i] = e.style[i], e.style[i] = t[i];
r = n.call(e);
for (i in t) e.style[i] = o[i];
return r
}
}), H.curCSS = H.css, F.defaultView && F.defaultView.getComputedStyle && (jt = function (e, t) {
var n, r, i, o, a = e.style;
return t = t.replace(_t, "-$1").toLowerCase(), (r = e.ownerDocument.defaultView) && (i = r.getComputedStyle(e, null)) && (n = i.getPropertyValue(t), "" !== n || H.contains(e.ownerDocument.documentElement, e) || (n = H.style(e, t))), !H.support.pixelMargin && i && Pt.test(t) && Ot.test(n) && (o = a.width, a.width = n, n = i.width, a.width = o), n
}), F.documentElement.currentStyle && (Dt = function (e, t) {
var n, r, i, o = e.currentStyle && e.currentStyle[t],
a = e.style;
return null == o && a && (i = a[t]) && (o = i), Ot.test(o) && (n = a.left, r = e.runtimeStyle && e.runtimeStyle.left, r && (e.runtimeStyle.left = e.currentStyle.left), a.left = "fontSize" === t ? "1em" : o, o = a.pixelLeft + "px", a.left = n, r && (e.runtimeStyle.left = r)), "" === o ? "auto" : o
}), Lt = jt || Dt, H.each(["height", "width"], function (e, t) {
H.cssHooks[t] = {
get: function (e, n, r) {
return n ? 0 !== e.offsetWidth ? v(e, t, r) : H.swap(e, qt, function () {
return v(e, t, r)
}) : void 0
},
set: function (e, t) {
return Ht.test(t) ? t + "px" : t
}
}
}), H.support.opacity || (H.cssHooks.opacity = {
get: function (e, t) {
return Mt.test((t && e.currentStyle ? e.currentStyle.filter : e.style.filter) || "") ? parseFloat(RegExp.$1) / 100 + "" : t ? "1" : ""
},
set: function (e, t) {
var n = e.style,
r = e.currentStyle,
i = H.isNumeric(t) ? "alpha(opacity=" + 100 * t + ")" : "",
o = r && r.filter || n.filter || "";
n.zoom = 1, t >= 1 && "" === H.trim(o.replace(Ft, "")) && (n.removeAttribute("filter"), r && !r.filter) || (n.filter = Ft.test(o) ? o.replace(Ft, i) : o + " " + i)
}
}), H(function () {
H.support.reliableMarginRight || (H.cssHooks.marginRight = {
get: function (e, t) {
return H.swap(e, {
display: "inline-block"
}, function () {
return t ? Lt(e, "margin-right") : e.style.marginRight
})
}
})
}), H.expr && H.expr.filters && (H.expr.filters.hidden = function (e) {
var t = e.offsetWidth,
n = e.offsetHeight;
return 0 === t && 0 === n || !H.support.reliableHiddenOffsets && "none" === (e.style && e.style.display || H.css(e, "display"))
}, H.expr.filters.visible = function (e) {
return !H.expr.filters.hidden(e)
}), H.each({
margin: "",
padding: "",
border: "Width"
}, function (e, t) {
H.cssHooks[e + t] = {
expand: function (n) {
var r, i = "string" == typeof n ? n.split(" ") : [n],
o = {};
for (r = 0; 4 > r; r++) o[e + Wt[r] + t] = i[r] || i[r - 2] || i[0];
return o
}
}
});
var It, $t, Rt = /%20/g,
Xt = /\[\]$/,
zt = /\r?\n/g,
Vt = /#.*$/,
Ut = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
Gt = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
Yt = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
Jt = /^(?:GET|HEAD)$/,
Qt = /^\/\//,
Kt = /\?/,
Zt = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
en = /^(?:select|textarea)/i,
tn = /\s+/,
nn = /([?&])_=[^&]*/,
rn = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,
on = H.fn.load,
an = {}, sn = {}, ln = ["*/"] + ["*"];
try {
It = _.href
} catch (un) {
It = F.createElement("a"), It.href = "", It = It.href
}
$t = rn.exec(It.toLowerCase()) || [], H.fn.extend({
load: function (e, n, r) {
if ("string" != typeof e && on) return on.apply(this, arguments);
if (!this.length) return this;
var i = e.indexOf(" ");
if (i >= 0) {
var o = e.slice(i, e.length);
e = e.slice(0, i)
}
var a = "GET";
n && (H.isFunction(n) ? (r = n, n = t) : "object" == typeof n && (n = H.param(n, H.ajaxSettings.traditional), a = "POST"));
var s = this;
return H.ajax({
url: e,
type: a,
dataType: "html",
data: n,
complete: function (e, t, n) {
n = e.responseText, e.isResolved() && (e.done(function (e) {
n = e
}), s.html(o ? H("<div>").append(n.replace(Zt, "")).find(o) : n)), r && s.each(r, [n, t, e])
}
}), this
},
serialize: function () {
return H.param(this.serializeArray())
},
serializeArray: function () {
return this.map(function () {
return this.elements ? H.makeArray(this.elements) : this
}).filter(function () {
return this.name && !this.disabled && (this.checked || en.test(this.nodeName) || Gt.test(this.type))
}).map(function (e, t) {
var n = H(this).val();
return null == n ? null : H.isArray(n) ? H.map(n, function (e) {
return {
name: t.name,
value: e.replace(zt, "\r\n")
}
}) : {
name: t.name,
value: n.replace(zt, "\r\n")
}
}).get()
}
}), H.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function (e, t) {
H.fn[t] = function (e) {
return this.on(t, e)
}
}), H.each(["get", "post"], function (e, n) {
H[n] = function (e, r, i, o) {
return H.isFunction(r) && (o = o || i, i = r, r = t), H.ajax({
type: n,
url: e,
data: r,
success: i,
dataType: o
})
}
}), H.extend({
getScript: function (e, n) {
return H.get(e, t, n, "script")
},
getJSON: function (e, t, n) {
return H.get(e, t, n, "json")
},
ajaxSetup: function (e, t) {
return t ? T(e, H.ajaxSettings) : (t = e, e = H.ajaxSettings), T(e, t), e
},
ajaxSettings: {
url: It,
isLocal: Yt.test($t[1]),
global: !0,
type: "GET",
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
processData: !0,
async: !0,
accepts: {
xml: "application/xml, text/xml",
html: "text/html",
text: "text/plain",
json: "application/json, text/javascript",
"*": ln
},
contents: {
xml: /xml/,
html: /html/,
json: /json/
},
responseFields: {
xml: "responseXML",
text: "responseText"
},
converters: {
"* text": e.String,
"text html": !0,
"text json": H.parseJSON,
"text xml": H.parseXML
},
flatOptions: {
context: !0,
url: !0
}
},
ajaxPrefilter: b(an),
ajaxTransport: b(sn),
ajax: function (e, n) {
function r(e, n, r, a) {
if (2 !== T) {
T = 2, l && clearTimeout(l), s = t, o = a || "", w.readyState = e > 0 ? 4 : 0;
var u, f, v, b, x, E = n,
k = r ? N(d, w, r) : t;
if (e >= 200 && 300 > e || 304 === e)
if (d.ifModified && ((b = w.getResponseHeader("Last-Modified")) && (H.lastModified[i] = b), (x = w.getResponseHeader("Etag")) && (H.etag[i] = x)), 304 === e) E = "notmodified", u = !0;
else try {
f = C(d, k), E = "success", u = !0
} catch (S) {
E = "parsererror", v = S
} else v = E, (!E || e) && (E = "error", 0 > e && (e = 0));
w.status = e, w.statusText = "" + (n || E), u ? m.resolveWith(p, [f, E, w]) : m.rejectWith(p, [w, E, v]), w.statusCode(y), y = t, c && h.trigger("ajax" + (u ? "Success" : "Error"), [w, d, u ? f : v]), g.fireWith(p, [w, E]), c && (h.trigger("ajaxComplete", [w, d]), --H.active || H.event.trigger("ajaxStop"))
}
}
"object" == typeof e && (n = e, e = t), n = n || {};
var i, o, a, s, l, u, c, f, d = H.ajaxSetup({}, n),
p = d.context || d,
h = p !== d && (p.nodeType || p instanceof H) ? H(p) : H.event,
m = H.Deferred(),
g = H.Callbacks("once memory"),
y = d.statusCode || {}, v = {}, b = {}, T = 0,
w = {
readyState: 0,
setRequestHeader: function (e, t) {
if (!T) {
var n = e.toLowerCase();
e = b[n] = b[n] || e, v[e] = t
}
return this
},
getAllResponseHeaders: function () {
return 2 === T ? o : null
},
getResponseHeader: function (e) {
var n;
if (2 === T) {
if (!a)
for (a = {}; n = Ut.exec(o);) a[n[1].toLowerCase()] = n[2];
n = a[e.toLowerCase()]
}
return n === t ? null : n
},
overrideMimeType: function (e) {
return T || (d.mimeType = e), this
},
abort: function (e) {
return e = e || "abort", s && s.abort(e), r(0, e), this
}
};
if (m.promise(w), w.success = w.done, w.error = w.fail, w.complete = g.add, w.statusCode = function (e) {
if (e) {
var t;
if (2 > T)
for (t in e) y[t] = [y[t], e[t]];
else t = e[w.status], w.then(t, t)
}
return this
}, d.url = ((e || d.url) + "").replace(Vt, "").replace(Qt, $t[1] + "//"), d.dataTypes = H.trim(d.dataType || "*").toLowerCase().split(tn), null == d.crossDomain && (u = rn.exec(d.url.toLowerCase()), d.crossDomain = !(!u || u[1] == $t[1] && u[2] == $t[2] && (u[3] || ("http:" === u[1] ? 80 : 443)) == ($t[3] || ("http:" === $t[1] ? 80 : 443)))), d.data && d.processData && "string" != typeof d.data && (d.data = H.param(d.data, d.traditional)), x(an, d, n, w), 2 === T) return !1;
if (c = d.global, d.type = d.type.toUpperCase(), d.hasContent = !Jt.test(d.type), c && 0 === H.active++ && H.event.trigger("ajaxStart"), !d.hasContent && (d.data && (d.url += (Kt.test(d.url) ? "&" : "?") + d.data, delete d.data), i = d.url, d.cache === !1)) {
var E = H.now(),
k = d.url.replace(nn, "$1_=" + E);
d.url = k + (k === d.url ? (Kt.test(d.url) ? "&" : "?") + "_=" + E : "")
}(d.data && d.hasContent && d.contentType !== !1 || n.contentType) && w.setRequestHeader("Content-Type", d.contentType), d.ifModified && (i = i || d.url, H.lastModified[i] && w.setRequestHeader("If-Modified-Since", H.lastModified[i]), H.etag[i] && w.setRequestHeader("If-None-Match", H.etag[i])), w.setRequestHeader("Accept", d.dataTypes[0] && d.accepts[d.dataTypes[0]] ? d.accepts[d.dataTypes[0]] + ("*" !== d.dataTypes[0] ? ", " + ln + "; q=0.01" : "") : d.accepts["*"]);
for (f in d.headers) w.setRequestHeader(f, d.headers[f]);
if (d.beforeSend && (d.beforeSend.call(p, w, d) === !1 || 2 === T)) return w.abort(), !1;
for (f in {
success: 1,
error: 1,
complete: 1
}) w[f](d[f]);
if (s = x(sn, d, n, w)) {
w.readyState = 1, c && h.trigger("ajaxSend", [w, d]), d.async && d.timeout > 0 && (l = setTimeout(function () {
w.abort("timeout")
}, d.timeout));
try {
T = 1, s.send(v, r)
} catch (S) {
if (!(2 > T)) throw S;
r(-1, S)
}
} else r(-1, "No Transport");
return w
},
param: function (e, n) {
var r = [],
i = function (e, t) {
t = H.isFunction(t) ? t() : t, r[r.length] = encodeURIComponent(e) + "=" + encodeURIComponent(t)
};
if (n === t && (n = H.ajaxSettings.traditional), H.isArray(e) || e.jquery && !H.isPlainObject(e)) H.each(e, function () {
i(this.name, this.value)
});
else
for (var o in e) w(o, e[o], n, i);
return r.join("&").replace(Rt, "+")
}
}), H.extend({
active: 0,
lastModified: {},
etag: {}
});
var cn = H.now(),
fn = /(\=)\?(&|$)|\?\?/i;
H.ajaxSetup({
jsonp: "callback",
jsonpCallback: function () {
return H.expando + "_" + cn++
}
}), H.ajaxPrefilter("json jsonp", function (t, n, r) {
var i = "string" == typeof t.data && /^application\/x\-www\-form\-urlencoded/.test(t.contentType);
if ("jsonp" === t.dataTypes[0] || t.jsonp !== !1 && (fn.test(t.url) || i && fn.test(t.data))) {
var o, a = t.jsonpCallback = H.isFunction(t.jsonpCallback) ? t.jsonpCallback() : t.jsonpCallback,
s = e[a],
l = t.url,
u = t.data,
c = "$1" + a + "$2";
return t.jsonp !== !1 && (l = l.replace(fn, c), t.url === l && (i && (u = u.replace(fn, c)), t.data === u && (l += (/\?/.test(l) ? "&" : "?") + t.jsonp + "=" + a))), t.url = l, t.data = u, e[a] = function (e) {
o = [e]
}, r.always(function () {
e[a] = s, o && H.isFunction(s) && e[a](o[0])
}), t.converters["script json"] = function () {
return o || H.error(a + " was not called"), o[0]
}, t.dataTypes[0] = "json", "script"
}
}), H.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /javascript|ecmascript/
},
converters: {
"text script": function (e) {
return H.globalEval(e), e
}
}
}), H.ajaxPrefilter("script", function (e) {
e.cache === t && (e.cache = !1), e.crossDomain && (e.type = "GET", e.global = !1)
}), H.ajaxTransport("script", function (e) {
if (e.crossDomain) {
var n, r = F.head || F.getElementsByTagName("head")[0] || F.documentElement;
return {
send: function (i, o) {
n = F.createElement("script"), n.async = "async", e.scriptCharset && (n.charset = e.scriptCharset), n.src = e.url, n.onload = n.onreadystatechange = function (e, i) {
(i || !n.readyState || /loaded|complete/.test(n.readyState)) && (n.onload = n.onreadystatechange = null, r && n.parentNode && r.removeChild(n), n = t, i || o(200, "success"))
}, r.insertBefore(n, r.firstChild)
},
abort: function () {
n && n.onload(0, 1)
}
}
}
});
var dn, pn = e.ActiveXObject ? function () {
for (var e in dn) dn[e](0, 1)
} : !1,
hn = 0;
H.ajaxSettings.xhr = e.ActiveXObject ? function () {
return !this.isLocal && E() || k()
} : E,
function (e) {
H.extend(H.support, {
ajax: !! e,
cors: !! e && "withCredentials" in e
})
}(H.ajaxSettings.xhr()), H.support.ajax && H.ajaxTransport(function (n) {
if (!n.crossDomain || H.support.cors) {
var r;
return {
send: function (i, o) {
var a, s, l = n.xhr();
if (n.username ? l.open(n.type, n.url, n.async, n.username, n.password) : l.open(n.type, n.url, n.async), n.xhrFields)
for (s in n.xhrFields) l[s] = n.xhrFields[s];
n.mimeType && l.overrideMimeType && l.overrideMimeType(n.mimeType), n.crossDomain || i["X-Requested-With"] || (i["X-Requested-With"] = "XMLHttpRequest");
try {
for (s in i) l.setRequestHeader(s, i[s])
} catch (u) {}
l.send(n.hasContent && n.data || null), r = function (e, i) {
var s, u, c, f, d;
try {
if (r && (i || 4 === l.readyState))
if (r = t, a && (l.onreadystatechange = H.noop, pn && delete dn[a]), i) 4 !== l.readyState && l.abort();
else {
s = l.status, c = l.getAllResponseHeaders(), f = {}, d = l.responseXML, d && d.documentElement && (f.xml = d);
try {
f.text = l.responseText
} catch (e) {}
try {
u = l.statusText
} catch (p) {
u = ""
}
s || !n.isLocal || n.crossDomain ? 1223 === s && (s = 204) : s = f.text ? 200 : 404
}
} catch (h) {
i || o(-1, h)
}
f && o(s, u, f, c)
}, n.async && 4 !== l.readyState ? (a = ++hn, pn && (dn || (dn = {}, H(e).unload(pn)), dn[a] = r), l.onreadystatechange = r) : r()
},
abort: function () {
r && r(0, 1)
}
}
}
});
var mn, gn, yn, vn, bn = {}, xn = /^(?:toggle|show|hide)$/,
Tn = /^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,
wn = [
["height", "marginTop", "marginBottom", "paddingTop", "paddingBottom"],
["width", "marginLeft", "marginRight", "paddingLeft", "paddingRight"],
["opacity"]
];
H.fn.extend({
show: function (e, t, n) {
var r, i;
if (e || 0 === e) return this.animate(L("show", 3), e, t, n);
for (var o = 0, a = this.length; a > o; o++) r = this[o], r.style && (i = r.style.display, H._data(r, "olddisplay") || "none" !== i || (i = r.style.display = ""), ("" === i && "none" === H.css(r, "display") || !H.contains(r.ownerDocument.documentElement, r)) && H._data(r, "olddisplay", j(r.nodeName)));
for (o = 0; a > o; o++) r = this[o], r.style && (i = r.style.display, ("" === i || "none" === i) && (r.style.display = H._data(r, "olddisplay") || ""));
return this
},
hide: function (e, t, n) {
if (e || 0 === e) return this.animate(L("hide", 3), e, t, n);
for (var r, i, o = 0, a = this.length; a > o; o++) r = this[o], r.style && (i = H.css(r, "display"), "none" === i || H._data(r, "olddisplay") || H._data(r, "olddisplay", i));
for (o = 0; a > o; o++) this[o].style && (this[o].style.display = "none");
return this
},
_toggle: H.fn.toggle,
toggle: function (e, t, n) {
var r = "boolean" == typeof e;
return H.isFunction(e) && H.isFunction(t) ? this._toggle.apply(this, arguments) : null == e || r ? this.each(function () {
var t = r ? e : H(this).is(":hidden");
H(this)[t ? "show" : "hide"]()
}) : this.animate(L("toggle", 3), e, t, n), this
},
fadeTo: function (e, t, n, r) {
return this.filter(":hidden").css("opacity", 0).show().end().animate({
opacity: t
}, e, n, r)
},
animate: function (e, t, n, r) {
function i() {
o.queue === !1 && H._mark(this);
var t, n, r, i, a, s, l, u, c, f, d, p = H.extend({}, o),
h = 1 === this.nodeType,
m = h && H(this).is(":hidden");
p.animatedProperties = {};
for (r in e)
if (t = H.camelCase(r), r !== t && (e[t] = e[r], delete e[r]), (a = H.cssHooks[t]) && "expand" in a) {
s = a.expand(e[t]), delete e[t];
for (r in s) r in e || (e[r] = s[r])
}
for (t in e) {
if (n = e[t], H.isArray(n) ? (p.animatedProperties[t] = n[1], n = e[t] = n[0]) : p.animatedProperties[t] = p.specialEasing && p.specialEasing[t] || p.easing || "swing", "hide" === n && m || "show" === n && !m) return p.complete.call(this);
!h || "height" !== t && "width" !== t || (p.overflow = [this.style.overflow, this.style.overflowX, this.style.overflowY], "inline" === H.css(this, "display") && "none" === H.css(this, "float") && (H.support.inlineBlockNeedsLayout && "inline" !== j(this.nodeName) ? this.style.zoom = 1 : this.style.display = "inline-block"))
}
null != p.overflow && (this.style.overflow = "hidden");
for (r in e) i = new H.fx(this, p, r), n = e[r], xn.test(n) ? (d = H._data(this, "toggle" + r) || ("toggle" === n ? m ? "show" : "hide" : 0), d ? (H._data(this, "toggle" + r, "show" === d ? "hide" : "show"), i[d]()) : i[n]()) : (l = Tn.exec(n), u = i.cur(), l ? (c = parseFloat(l[2]), f = l[3] || (H.cssNumber[r] ? "" : "px"), "px" !== f && (H.style(this, r, (c || 1) + f), u = (c || 1) / i.cur() * u, H.style(this, r, u + f)), l[1] && (c = ("-=" === l[1] ? -1 : 1) * c + u), i.custom(u, c, f)) : i.custom(u, n, ""));
return !0
}
var o = H.speed(t, n, r);
return H.isEmptyObject(e) ? this.each(o.complete, [!1]) : (e = H.extend({}, e), o.queue === !1 ? this.each(i) : this.queue(o.queue, i))
},
stop: function (e, n, r) {
return "string" != typeof e && (r = n, n = e, e = t), n && e !== !1 && this.queue(e || "fx", []), this.each(function () {
function t(e, t, n) {
var i = t[n];
H.removeData(e, n, !0), i.stop(r)
}
var n, i = !1,
o = H.timers,
a = H._data(this);
if (r || H._unmark(!0, this), null == e)
for (n in a) a[n] && a[n].stop && n.indexOf(".run") === n.length - 4 && t(this, a, n);
else a[n = e + ".run"] && a[n].stop && t(this, a, n);
for (n = o.length; n--;) o[n].elem !== this || null != e && o[n].queue !== e || (r ? o[n](!0) : o[n].saveState(), i = !0, o.splice(n, 1));
r && i || H.dequeue(this, e)
})
}
}), H.each({
slideDown: L("show", 1),
slideUp: L("hide", 1),
slideToggle: L("toggle", 1),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function (e, t) {
H.fn[e] = function (e, n, r) {
return this.animate(t, e, n, r)
}
}), H.extend({
speed: function (e, t, n) {
var r = e && "object" == typeof e ? H.extend({}, e) : {
complete: n || !n && t || H.isFunction(e) && e,
duration: e,
easing: n && t || t && !H.isFunction(t) && t
};
return r.duration = H.fx.off ? 0 : "number" == typeof r.duration ? r.duration : r.duration in H.fx.speeds ? H.fx.speeds[r.duration] : H.fx.speeds._default, (null == r.queue || r.queue === !0) && (r.queue = "fx"), r.old = r.complete, r.complete = function (e) {
H.isFunction(r.old) && r.old.call(this), r.queue ? H.dequeue(this, r.queue) : e !== !1 && H._unmark(this)
}, r
},
easing: {
linear: function (e) {
return e
},
swing: function (e) {
return -Math.cos(e * Math.PI) / 2 + .5
}
},
timers: [],
fx: function (e, t, n) {
this.options = t, this.elem = e, this.prop = n, t.orig = t.orig || {}
}
}), H.fx.prototype = {
update: function () {
this.options.step && this.options.step.call(this.elem, this.now, this), (H.fx.step[this.prop] || H.fx.step._default)(this)
},
cur: function () {
if (null != this.elem[this.prop] && (!this.elem.style || null == this.elem.style[this.prop])) return this.elem[this.prop];
var e, t = H.css(this.elem, this.prop);
return isNaN(e = parseFloat(t)) ? t && "auto" !== t ? t : 0 : e
},
custom: function (e, n, r) {
function i(e) {
return o.step(e)
}
var o = this,
a = H.fx;
this.startTime = vn || S(), this.end = n, this.now = this.start = e, this.pos = this.state = 0, this.unit = r || this.unit || (H.cssNumber[this.prop] ? "" : "px"), i.queue = this.options.queue, i.elem = this.elem, i.saveState = function () {
H._data(o.elem, "fxshow" + o.prop) === t && (o.options.hide ? H._data(o.elem, "fxshow" + o.prop, o.start) : o.options.show && H._data(o.elem, "fxshow" + o.prop, o.end))
}, i() && H.timers.push(i) && !yn && (yn = setInterval(a.tick, a.interval))
},
show: function () {
var e = H._data(this.elem, "fxshow" + this.prop);
this.options.orig[this.prop] = e || H.style(this.elem, this.prop), this.options.show = !0, e !== t ? this.custom(this.cur(), e) : this.custom("width" === this.prop || "height" === this.prop ? 1 : 0, this.cur()), H(this.elem).show()
},
hide: function () {
this.options.orig[this.prop] = H._data(this.elem, "fxshow" + this.prop) || H.style(this.elem, this.prop), this.options.hide = !0, this.custom(this.cur(), 0)
},
step: function (e) {
var t, n, r, i = vn || S(),
o = !0,
a = this.elem,
s = this.options;
if (e || i >= s.duration + this.startTime) {
this.now = this.end, this.pos = this.state = 1, this.update(), s.animatedProperties[this.prop] = !0;
for (t in s.animatedProperties) s.animatedProperties[t] !== !0 && (o = !1);
if (o) {
if (null == s.overflow || H.support.shrinkWrapBlocks || H.each(["", "X", "Y"], function (e, t) {
a.style["overflow" + t] = s.overflow[e]
}), s.hide && H(a).hide(), s.hide || s.show)
for (t in s.animatedProperties) H.style(a, t, s.orig[t]), H.removeData(a, "fxshow" + t, !0), H.removeData(a, "toggle" + t, !0);
r = s.complete, r && (s.complete = !1, r.call(a))
}
return !1
}
return 1 / 0 == s.duration ? this.now = i : (n = i - this.startTime, this.state = n / s.duration, this.pos = H.easing[s.animatedProperties[this.prop]](this.state, n, 0, 1, s.duration), this.now = this.start + (this.end - this.start) * this.pos), this.update(), !0
}
}, H.extend(H.fx, {
tick: function () {
for (var e, t = H.timers, n = 0; n < t.length; n++) e = t[n], e() || t[n] !== e || t.splice(n--, 1);
t.length || H.fx.stop()
},
interval: 13,
stop: function () {
clearInterval(yn), yn = null
},
speeds: {
slow: 600,
fast: 200,
_default: 400
},
step: {
opacity: function (e) {
H.style(e.elem, "opacity", e.now)
},
_default: function (e) {
e.elem.style && null != e.elem.style[e.prop] ? e.elem.style[e.prop] = e.now + e.unit : e.elem[e.prop] = e.now
}
}
}), H.each(wn.concat.apply([], wn), function (e, t) {
t.indexOf("margin") && (H.fx.step[t] = function (e) {
H.style(e.elem, t, Math.max(0, e.now) + e.unit)
})
}), H.expr && H.expr.filters && (H.expr.filters.animated = function (e) {
return H.grep(H.timers, function (t) {
return e === t.elem
}).length
});
var Nn, Cn = /^t(?:able|d|h)$/i,
En = /^(?:body|html)$/i;
Nn = "getBoundingClientRect" in F.documentElement ? function (e, t, n, r) {
try {
r = e.getBoundingClientRect()
} catch (i) {}
if (!r || !H.contains(n, e)) return r ? {
top: r.top,
left: r.left
} : {
top: 0,
left: 0
};
var o = t.body,
a = D(t),
s = n.clientTop || o.clientTop || 0,
l = n.clientLeft || o.clientLeft || 0,
u = a.pageYOffset || H.support.boxModel && n.scrollTop || o.scrollTop,
c = a.pageXOffset || H.support.boxModel && n.scrollLeft || o.scrollLeft,
f = r.top + u - s,
d = r.left + c - l;
return {
top: f,
left: d
}
} : function (e, t, n) {
for (var r, i = e.offsetParent, o = e, a = t.body, s = t.defaultView, l = s ? s.getComputedStyle(e, null) : e.currentStyle, u = e.offsetTop, c = e.offsetLeft;
(e = e.parentNode) && e !== a && e !== n && (!H.support.fixedPosition || "fixed" !== l.position);) r = s ? s.getComputedStyle(e, null) : e.currentStyle, u -= e.scrollTop, c -= e.scrollLeft, e === i && (u += e.offsetTop, c += e.offsetLeft, !H.support.doesNotAddBorder || H.support.doesAddBorderForTableAndCells && Cn.test(e.nodeName) || (u += parseFloat(r.borderTopWidth) || 0, c += parseFloat(r.borderLeftWidth) || 0), o = i, i = e.offsetParent), H.support.subtractsBorderForOverflowNotVisible && "visible" !== r.overflow && (u += parseFloat(r.borderTopWidth) || 0, c += parseFloat(r.borderLeftWidth) || 0), l = r;
return ("relative" === l.position || "static" === l.position) && (u += a.offsetTop, c += a.offsetLeft), H.support.fixedPosition && "fixed" === l.position && (u += Math.max(n.scrollTop, a.scrollTop), c += Math.max(n.scrollLeft, a.scrollLeft)), {
top: u,
left: c
}
}, H.fn.offset = function (e) {
if (arguments.length) return e === t ? this : this.each(function (t) {
H.offset.setOffset(this, e, t)
});
var n = this[0],
r = n && n.ownerDocument;
return r ? n === r.body ? H.offset.bodyOffset(n) : Nn(n, r, r.documentElement) : null
}, H.offset = {
bodyOffset: function (e) {
var t = e.offsetTop,
n = e.offsetLeft;
return H.support.doesNotIncludeMarginInBodyOffset && (t += parseFloat(H.css(e, "marginTop")) || 0, n += parseFloat(H.css(e, "marginLeft")) || 0), {
top: t,
left: n
}
},
setOffset: function (e, t, n) {
var r = H.css(e, "position");
"static" === r && (e.style.position = "relative");
var i, o, a = H(e),
s = a.offset(),
l = H.css(e, "top"),
u = H.css(e, "left"),
c = ("absolute" === r || "fixed" === r) && H.inArray("auto", [l, u]) > -1,
f = {}, d = {};
c ? (d = a.position(), i = d.top, o = d.left) : (i = parseFloat(l) || 0, o = parseFloat(u) || 0), H.isFunction(t) && (t = t.call(e, n, s)), null != t.top && (f.top = t.top - s.top + i), null != t.left && (f.left = t.left - s.left + o), "using" in t ? t.using.call(e, f) : a.css(f)
}
}, H.fn.extend({
position: function () {
if (!this[0]) return null;
var e = this[0],
t = this.offsetParent(),
n = this.offset(),
r = En.test(t[0].nodeName) ? {
top: 0,
left: 0
} : t.offset();
return n.top -= parseFloat(H.css(e, "marginTop")) || 0, n.left -= parseFloat(H.css(e, "marginLeft")) || 0, r.top += parseFloat(H.css(t[0], "borderTopWidth")) || 0, r.left += parseFloat(H.css(t[0], "borderLeftWidth")) || 0, {
top: n.top - r.top,
left: n.left - r.left
}
},
offsetParent: function () {
return this.map(function () {
for (var e = this.offsetParent || F.body; e && !En.test(e.nodeName) && "static" === H.css(e, "position");) e = e.offsetParent;
return e
})
}
}), H.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function (e, n) {
var r = /Y/.test(n);
H.fn[e] = function (i) {
return H.access(this, function (e, i, o) {
var a = D(e);
return o === t ? a ? n in a ? a[n] : H.support.boxModel && a.document.documentElement[i] || a.document.body[i] : e[i] : (a ? a.scrollTo(r ? H(a).scrollLeft() : o, r ? o : H(a).scrollTop()) : e[i] = o, void 0)
}, e, i, arguments.length, null)
}
}), H.each({
Height: "height",
Width: "width"
}, function (e, n) {
var r = "client" + e,
i = "scroll" + e,
o = "offset" + e;
H.fn["inner" + e] = function () {
var e = this[0];
return e ? e.style ? parseFloat(H.css(e, n, "padding")) : this[n]() : null
}, H.fn["outer" + e] = function (e) {
var t = this[0];
return t ? t.style ? parseFloat(H.css(t, n, e ? "margin" : "border")) : this[n]() : null
}, H.fn[n] = function (e) {
return H.access(this, function (e, n, a) {
var s, l, u, c;
return H.isWindow(e) ? (s = e.document, l = s.documentElement[r], H.support.boxModel && l || s.body && s.body[r] || l) : 9 === e.nodeType ? (s = e.documentElement, s[r] >= s[i] ? s[r] : Math.max(e.body[i], s[i], e.body[o], s[o])) : a === t ? (u = H.css(e, n), c = parseFloat(u), H.isNumeric(c) ? c : u) : (H(e).css(n, a), void 0)
}, n, e, arguments.length, null)
}
}), e.jQuery = e.$ = H, "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function () {
return H
})
}(window), window.jHC = jQuery.noConflict(!0);
! function () {
function e(t, n, r) {
if (t === n) return 0 !== t || 1 / t == 1 / n;
if (null == t || null == n) return t === n;
if (t._chain && (t = t._wrapped), n._chain && (n = n._wrapped), t.isEqual && N.isFunction(t.isEqual)) return t.isEqual(n);
if (n.isEqual && N.isFunction(n.isEqual)) return n.isEqual(t);
var i = l.call(t);
if (i != l.call(n)) return !1;
switch (i) {
case "[object String]":
return t == String(n);
case "[object Number]":
return t != +t ? n != +n : 0 == t ? 1 / t == 1 / n : t == +n;
case "[object Date]":
case "[object Boolean]":
return +t == +n;
case "[object RegExp]":
return t.source == n.source && t.global == n.global && t.multiline == n.multiline && t.ignoreCase == n.ignoreCase
}
if ("object" != typeof t || "object" != typeof n) return !1;
for (var o = r.length; o--;)
if (r[o] == t) return !0;
r.push(t);
var a = 0,
s = !0;
if ("[object Array]" == i) {
if (a = t.length, s = a == n.length)
for (; a-- && (s = a in t == a in n && e(t[a], n[a], r)););
} else {
if ("constructor" in t != "constructor" in n || t.constructor != n.constructor) return !1;
for (var u in t)
if (N.has(t, u) && (a++, !(s = N.has(n, u) && e(t[u], n[u], r)))) break;
if (s) {
for (u in n)
if (N.has(n, u) && !a--) break;
s = !a
}
}
return r.pop(), s
}
var t = this,
n = t._,
r = {}, i = Array.prototype,
o = Object.prototype,
a = Function.prototype,
s = i.slice,
u = i.unshift,
l = o.toString,
c = o.hasOwnProperty,
f = i.forEach,
p = i.map,
d = i.reduce,
h = i.reduceRight,
m = i.filter,
g = i.every,
y = i.some,
v = i.indexOf,
b = i.lastIndexOf,
x = Array.isArray,
w = Object.keys,
T = a.bind,
N = function (e) {
return new F(e)
};
"undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = N), exports._ = N) : t._ = N, N.VERSION = "1.3.1";
var C = N.each = N.forEach = function (e, t, n) {
if (null != e)
if (f && e.forEach === f) e.forEach(t, n);
else if (e.length === +e.length) {
for (var i = 0, o = e.length; o > i; i++)
if (i in e && t.call(n, e[i], i, e) === r) return
} else
for (var a in e)
if (N.has(e, a) && t.call(n, e[a], a, e) === r) return
};
N.map = N.collect = function (e, t, n) {
var r = [];
return null == e ? r : p && e.map === p ? e.map(t, n) : (C(e, function (e, i, o) {
r[r.length] = t.call(n, e, i, o)
}), e.length === +e.length && (r.length = e.length), r)
}, N.reduce = N.foldl = N.inject = function (e, t, n, r) {
var i = arguments.length > 2;
if (null == e && (e = []), d && e.reduce === d) return r && (t = N.bind(t, r)), i ? e.reduce(t, n) : e.reduce(t);
if (C(e, function (e, o, a) {
i ? n = t.call(r, n, e, o, a) : (n = e, i = !0)
}), !i) throw new TypeError("Reduce of empty array with no initial value");
return n
}, N.reduceRight = N.foldr = function (e, t, n, r) {
var i = arguments.length > 2;
if (null == e && (e = []), h && e.reduceRight === h) return r && (t = N.bind(t, r)), i ? e.reduceRight(t, n) : e.reduceRight(t);
var o = N.toArray(e).reverse();
return r && !i && (t = N.bind(t, r)), i ? N.reduce(o, t, n, r) : N.reduce(o, t)
}, N.find = N.detect = function (e, t, n) {
var r;
return E(e, function (e, i, o) {
return t.call(n, e, i, o) ? (r = e, !0) : void 0
}), r
}, N.filter = N.select = function (e, t, n) {
var r = [];
return null == e ? r : m && e.filter === m ? e.filter(t, n) : (C(e, function (e, i, o) {
t.call(n, e, i, o) && (r[r.length] = e)
}), r)
}, N.reject = function (e, t, n) {
var r = [];
return null == e ? r : (C(e, function (e, i, o) {
t.call(n, e, i, o) || (r[r.length] = e)
}), r)
}, N.every = N.all = function (e, t, n) {
var i = !0;
return null == e ? i : g && e.every === g ? e.every(t, n) : (C(e, function (e, o, a) {
return (i = i && t.call(n, e, o, a)) ? void 0 : r
}), i)
};
var E = N.some = N.any = function (e, t, n) {
t || (t = N.identity);
var i = !1;
return null == e ? i : y && e.some === y ? e.some(t, n) : (C(e, function (e, o, a) {
return i || (i = t.call(n, e, o, a)) ? r : void 0
}), !! i)
};
N.include = N.contains = function (e, t) {
var n = !1;
return null == e ? n : v && e.indexOf === v ? -1 != e.indexOf(t) : n = E(e, function (e) {
return e === t
})
}, N.invoke = function (e, t) {
var n = s.call(arguments, 2);
return N.map(e, function (e) {
return (N.isFunction(t) ? t || e : e[t]).apply(e, n)
})
}, N.pluck = function (e, t) {
return N.map(e, function (e) {
return e[t]
})
}, N.max = function (e, t, n) {
if (!t && N.isArray(e)) return Math.max.apply(Math, e);
if (!t && N.isEmpty(e)) return -1 / 0;
var r = {
computed: -1 / 0
};
return C(e, function (e, i, o) {
var a = t ? t.call(n, e, i, o) : e;
a >= r.computed && (r = {
value: e,
computed: a
})
}), r.value
}, N.min = function (e, t, n) {
if (!t && N.isArray(e)) return Math.min.apply(Math, e);
if (!t && N.isEmpty(e)) return 1 / 0;
var r = {
computed: 1 / 0
};
return C(e, function (e, i, o) {
var a = t ? t.call(n, e, i, o) : e;
a < r.computed && (r = {
value: e,
computed: a
})
}), r.value
}, N.shuffle = function (e) {
var t, n = [];
return C(e, function (e, r) {
0 == r ? n[0] = e : (t = Math.floor(Math.random() * (r + 1)), n[r] = n[t], n[t] = e)
}), n
}, N.sortBy = function (e, t, n) {
return N.pluck(N.map(e, function (e, r, i) {
return {
value: e,
criteria: t.call(n, e, r, i)
}
}).sort(function (e, t) {
var n = e.criteria,
r = t.criteria;
return r > n ? -1 : n > r ? 1 : 0
}), "value")
}, N.groupBy = function (e, t) {
var n = {}, r = N.isFunction(t) ? t : function (e) {
return e[t]
};
return C(e, function (e, t) {
var i = r(e, t);
(n[i] || (n[i] = [])).push(e)
}), n
}, N.sortedIndex = function (e, t, n) {
n || (n = N.identity);
for (var r = 0, i = e.length; i > r;) {
var o = r + i >> 1;
n(e[o]) < n(t) ? r = o + 1 : i = o
}
return r
}, N.toArray = function (e) {
return e ? e.toArray ? e.toArray() : N.isArray(e) ? s.call(e) : N.isArguments(e) ? s.call(e) : N.values(e) : []
}, N.size = function (e) {
return N.toArray(e).length
}, N.first = N.head = function (e, t, n) {
return null == t || n ? e[0] : s.call(e, 0, t)
}, N.initial = function (e, t, n) {
return s.call(e, 0, e.length - (null == t || n ? 1 : t))
}, N.last = function (e, t, n) {
return null == t || n ? e[e.length - 1] : s.call(e, Math.max(e.length - t, 0))
}, N.rest = N.tail = function (e, t, n) {
return s.call(e, null == t || n ? 1 : t)
}, N.compact = function (e) {
return N.filter(e, function (e) {
return !!e
})
}, N.flatten = function (e, t) {
return N.reduce(e, function (e, n) {
return N.isArray(n) ? e.concat(t ? n : N.flatten(n)) : (e[e.length] = n, e)
}, [])
}, N.without = function (e) {
return N.difference(e, s.call(arguments, 1))
}, N.uniq = N.unique = function (e, t, n) {
var r = n ? N.map(e, n) : e,
i = [];
return N.reduce(r, function (n, r, o) {
return 0 != o && (t === !0 ? N.last(n) == r : N.include(n, r)) || (n[n.length] = r, i[i.length] = e[o]), n
}, []), i
}, N.union = function () {
return N.uniq(N.flatten(arguments, !0))
}, N.intersection = N.intersect = function (e) {
var t = s.call(arguments, 1);
return N.filter(N.uniq(e), function (e) {
return N.every(t, function (t) {
return N.indexOf(t, e) >= 0
})
})
}, N.difference = function (e) {
var t = N.flatten(s.call(arguments, 1));
return N.filter(e, function (e) {
return !N.include(t, e)
})
}, N.zip = function () {
for (var e = s.call(arguments), t = N.max(N.pluck(e, "length")), n = new Array(t), r = 0; t > r; r++) n[r] = N.pluck(e, "" + r);
return n
}, N.indexOf = function (e, t, n) {
if (null == e) return -1;
var r, i;
if (n) return r = N.sortedIndex(e, t), e[r] === t ? r : -1;
if (v && e.indexOf === v) return e.indexOf(t);
for (r = 0, i = e.length; i > r; r++)
if (r in e && e[r] === t) return r;
return -1
}, N.lastIndexOf = function (e, t) {
if (null == e) return -1;
if (b && e.lastIndexOf === b) return e.lastIndexOf(t);
for (var n = e.length; n--;)
if (n in e && e[n] === t) return n;
return -1
}, N.range = function (e, t, n) {
arguments.length <= 1 && (t = e || 0, e = 0), n = arguments[2] || 1;
for (var r = Math.max(Math.ceil((t - e) / n), 0), i = 0, o = new Array(r); r > i;) o[i++] = e, e += n;
return o
};
var k = function () {};
N.bind = function (e, t) {
var n, r;
if (e.bind === T && T) return T.apply(e, s.call(arguments, 1));
if (!N.isFunction(e)) throw new TypeError;
return r = s.call(arguments, 2), n = function () {
if (!(this instanceof n)) return e.apply(t, r.concat(s.call(arguments)));
k.prototype = e.prototype;
var i = new k,
o = e.apply(i, r.concat(s.call(arguments)));
return Object(o) === o ? o : i
}
}, N.bindAll = function (e) {
var t = s.call(arguments, 1);
return 0 == t.length && (t = N.functions(e)), C(t, function (t) {
e[t] = N.bind(e[t], e)
}), e
}, N.memoize = function (e, t) {
var n = {};
return t || (t = N.identity),
function () {
var r = t.apply(this, arguments);
return N.has(n, r) ? n[r] : n[r] = e.apply(this, arguments)
}
}, N.delay = function (e, t) {
var n = s.call(arguments, 2);
return setTimeout(function () {
return e.apply(e, n)
}, t)
}, N.defer = function (e) {
return N.delay.apply(N, [e, 1].concat(s.call(arguments, 1)))
}, N.throttle = function (e, t) {
var n, r, i, o, a, s = N.debounce(function () {
a = o = !1
}, t);
return function () {
n = this, r = arguments;
var u = function () {
i = null, a && e.apply(n, r), s()
};
i || (i = setTimeout(u, t)), o ? a = !0 : e.apply(n, r), s(), o = !0
}
}, N.debounce = function (e, t) {
var n;
return function () {
var r = this,
i = arguments,
o = function () {
n = null, e.apply(r, i)
};
clearTimeout(n), n = setTimeout(o, t)
}
}, N.once = function (e) {
var t, n = !1;
return function () {
return n ? t : (n = !0, t = e.apply(this, arguments))
}
}, N.wrap = function (e, t) {
return function () {
var n = [e].concat(s.call(arguments, 0));
return t.apply(this, n)
}
}, N.compose = function () {
var e = arguments;
return function () {
for (var t = arguments, n = e.length - 1; n >= 0; n--) t = [e[n].apply(this, t)];
return t[0]
}
}, N.after = function (e, t) {
return 0 >= e ? t() : function () {
return --e < 1 ? t.apply(this, arguments) : void 0
}
}, N.keys = w || function (e) {
if (e !== Object(e)) throw new TypeError("Invalid object");
var t = [];
for (var n in e) N.has(e, n) && (t[t.length] = n);
return t
}, N.values = function (e) {
return N.map(e, N.identity)
}, N.functions = N.methods = function (e) {
var t = [];
for (var n in e) N.isFunction(e[n]) && t.push(n);
return t.sort()
}, N.extend = function (e) {
return C(s.call(arguments, 1), function (t) {
for (var n in t) e[n] = t[n]
}), e
}, N.defaults = function (e) {
return C(s.call(arguments, 1), function (t) {
for (var n in t) null == e[n] && (e[n] = t[n])
}), e
}, N.clone = function (e) {
return N.isObject(e) ? N.isArray(e) ? e.slice() : N.extend({}, e) : e
}, N.tap = function (e, t) {
return t(e), e
}, N.isEqual = function (t, n) {
return e(t, n, [])
}, N.isEmpty = function (e) {
if (N.isArray(e) || N.isString(e)) return 0 === e.length;
for (var t in e)
if (N.has(e, t)) return !1;
return !0
}, N.isElement = function (e) {
return !(!e || 1 != e.nodeType)
}, N.isArray = x || function (e) {
return "[object Array]" == l.call(e)
}, N.isObject = function (e) {
return e === Object(e)
}, N.isArguments = function (e) {
return "[object Arguments]" == l.call(e)
}, N.isArguments(arguments) || (N.isArguments = function (e) {
return !(!e || !N.has(e, "callee"))
}), N.isFunction = function (e) {
return "[object Function]" == l.call(e)
}, N.isString = function (e) {
return "[object String]" == l.call(e)
}, N.isNumber = function (e) {
return "[object Number]" == l.call(e)
}, N.isNaN = function (e) {
return e !== e
}, N.isBoolean = function (e) {
return e === !0 || e === !1 || "[object Boolean]" == l.call(e)
}, N.isDate = function (e) {
return "[object Date]" == l.call(e)
}, N.isRegExp = function (e) {
return "[object RegExp]" == l.call(e)
}, N.isNull = function (e) {
return null === e
}, N.isUndefined = function (e) {
return void 0 === e
}, N.has = function (e, t) {
return c.call(e, t)
}, N.noConflict = function () {
return t._ = n, this
}, N.identity = function (e) {
return e
}, N.times = function (e, t, n) {
for (var r = 0; e > r; r++) t.call(n, r)
}, N.escape = function (e) {
return ("" + e).replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;").replace(/'/g, "&#x27;").replace(/\//g, "&#x2F;")
}, N.mixin = function (e) {
C(N.functions(e), function (t) {
D(t, N[t] = e[t])
})
};
var S = 0;
N.uniqueId = function (e) {
var t = S++;
return e ? e + t : t
}, N.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g,
escape: /<%-([\s\S]+?)%>/g
};
var A = /.^/,
j = function (e) {
return e.replace(/\\\\/g, "\\").replace(/\\'/g, "'")
};
N.template = function (e, t) {
var n = N.templateSettings,
r = "var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('" + e.replace(/\\/g, "\\\\").replace(/'/g, "\\'").replace(n.escape || A, function (e, t) {
return "',_.escape(" + j(t) + "),'"
}).replace(n.interpolate || A, function (e, t) {
return "'," + j(t) + ",'"
}).replace(n.evaluate || A, function (e, t) {
return "');" + j(t).replace(/[\r\n\t]/g, " ") + ";__p.push('"
}).replace(/\r/g, "\\r").replace(/\n/g, "\\n").replace(/\t/g, "\\t") + "');}return __p.join('');",
i = new Function("obj", "_", r);
return t ? i(t, N) : function (e) {
return i.call(this, e, N)
}
}, N.chain = function (e) {
return N(e).chain()
};
var F = function (e) {
this._wrapped = e
};
N.prototype = F.prototype;
var L = function (e, t) {
return t ? N(e).chain() : e
}, D = function (e, t) {
F.prototype[e] = function () {
var e = s.call(arguments);
return u.call(e, this._wrapped), L(t.apply(N, e), this._chain)
}
};
N.mixin(N), C(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function (e) {
var t = i[e];
F.prototype[e] = function () {
var n = this._wrapped;
t.apply(n, arguments);
var r = n.length;
return "shift" != e && "splice" != e || 0 !== r || delete n[0], L(n, this._chain)
}
}), C(["concat", "join", "slice"], function (e) {
var t = i[e];
F.prototype[e] = function () {
return L(t.apply(this._wrapped, arguments), this._chain)
}
}), F.prototype.chain = function () {
return this._chain = !0, this
}, F.prototype.value = function () {
return this._wrapped
}
}.call(this);
! function () {
var e, t = this,
n = t.Backbone,
r = Array.prototype.slice,
i = Array.prototype.splice;
e = "undefined" != typeof exports ? exports : t.Backbone = {}, e.VERSION = "0.9.2";
var o = t._;
o || "undefined" == typeof require || (o = require("underscore"));
var a = t.jQuery || t.Zepto || t.ender;
e.setDomLibrary = function (e) {
a = e
}, e.noConflict = function () {
return t.Backbone = n, this
}, e.emulateHTTP = !1, e.emulateJSON = !1;
var s = /\s+/,
u = e.Events = {
on: function (e, t, n) {
var r, i, o, a, u;
if (!t) return this;
for (e = e.split(s), r = this._callbacks || (this._callbacks = {}); i = e.shift();) u = r[i], o = u ? u.tail : {}, o.next = a = {}, o.context = n, o.callback = t, r[i] = {
tail: a,
next: u ? u.next : o
};
return this
},
off: function (e, t, n) {
var r, i, a, u, l, c;
if (i = this._callbacks) {
if (!(e || t || n)) return delete this._callbacks, this;
for (e = e ? e.split(s) : o.keys(i); r = e.shift();)
if (a = i[r], delete i[r], a && (t || n))
for (u = a.tail;
(a = a.next) !== u;) l = a.callback, c = a.context, (t && l !== t || n && c !== n) && this.on(r, l, c);
return this
}
},
trigger: function (e) {
var t, n, i, o, a, u, l;
if (!(i = this._callbacks)) return this;
for (u = i.all, e = e.split(s), l = r.call(arguments, 1); t = e.shift();) {
if (n = i[t])
for (o = n.tail;
(n = n.next) !== o;) n.callback.apply(n.context || this, l);
if (n = u)
for (o = n.tail, a = [t].concat(l);
(n = n.next) !== o;) n.callback.apply(n.context || this, a)
}
return this
}
};
u.bind = u.on, u.unbind = u.off;
var l = e.Model = function (e, t) {
var n;
e || (e = {}), t && t.parse && (e = this.parse(e)), (n = _(this, "defaults")) && (e = o.extend({}, n, e)), t && t.collection && (this.collection = t.collection), this.attributes = {}, this._escapedAttributes = {}, this.cid = o.uniqueId("c"), this.changed = {}, this._silent = {}, this._pending = {}, this.set(e, {
silent: !0
}), this.changed = {}, this._silent = {}, this._pending = {}, this._previousAttributes = o.clone(this.attributes), this.initialize.apply(this, arguments)
};
o.extend(l.prototype, u, {
changed: null,
_silent: null,
_pending: null,
idAttribute: "id",
initialize: function () {},
toJSON: function () {
return o.clone(this.attributes)
},
get: function (e) {
return this.attributes[e]
},
escape: function (e) {
var t;
if (t = this._escapedAttributes[e]) return t;
var n = this.get(e);
return this._escapedAttributes[e] = o.escape(null == n ? "" : "" + n)
},
has: function (e) {
return null != this.get(e)
},
set: function (e, t, n) {
var r, i, a;
if (o.isObject(e) || null == e ? (r = e, n = t) : (r = {}, r[e] = t), n || (n = {}), !r) return this;
if (r instanceof l && (r = r.attributes), n.unset)
for (i in r) r[i] = void 0;
if (!this._validate(r, n)) return !1;
this.idAttribute in r && (this.id = r[this.idAttribute]);
var s = n.changes = {}, u = this.attributes,
c = this._escapedAttributes,
f = this._previousAttributes || {};
for (i in r) a = r[i], (!o.isEqual(u[i], a) || n.unset && o.has(u, i)) && (delete c[i], (n.silent ? this._silent : s)[i] = !0), n.unset ? delete u[i] : u[i] = a, o.isEqual(f[i], a) && o.has(u, i) == o.has(f, i) ? (delete this.changed[i], delete this._pending[i]) : (this.changed[i] = a, n.silent || (this._pending[i] = !0));
return n.silent || this.change(n), this
},
unset: function (e, t) {
return (t || (t = {})).unset = !0, this.set(e, null, t)
},
clear: function (e) {
return (e || (e = {})).unset = !0, this.set(o.clone(this.attributes), e)
},
fetch: function (t) {
t = t ? o.clone(t) : {};
var n = this,
r = t.success;
return t.success = function (e, i, o) {
return n.set(n.parse(e, o), t) ? (r && r(n, e), void 0) : !1
}, t.error = e.wrapError(t.error, n, t), (this.sync || e.sync).call(this, "read", this, t)
},
save: function (t, n, r) {
var i, a;
if (o.isObject(t) || null == t ? (i = t, r = n) : (i = {}, i[t] = n), r = r ? o.clone(r) : {}, r.wait) {
if (!this._validate(i, r)) return !1;
a = o.clone(this.attributes)
}
var s = o.extend({}, r, {
silent: !0
});
if (i && !this.set(i, r.wait ? s : r)) return !1;
var u = this,
l = r.success;
r.success = function (e, t, n) {
var a = u.parse(e, n);
return r.wait && (delete r.wait, a = o.extend(i || {}, a)), u.set(a, r) ? (l ? l(u, e) : u.trigger("sync", u, e, r), void 0) : !1
}, r.error = e.wrapError(r.error, u, r);
var c = this.isNew() ? "create" : "update",
f = (this.sync || e.sync).call(this, c, this, r);
return r.wait && this.set(a, s), f
},
destroy: function (t) {
t = t ? o.clone(t) : {};
var n = this,
r = t.success,
i = function () {
n.trigger("destroy", n, n.collection, t)
};
if (this.isNew()) return i(), !1;
t.success = function (e) {
t.wait && i(), r ? r(n, e) : n.trigger("sync", n, e, t)
}, t.error = e.wrapError(t.error, n, t);
var a = (this.sync || e.sync).call(this, "delete", this, t);
return t.wait || i(), a
},
url: function () {
var e = _(this, "urlRoot") || _(this.collection, "url") || k();
return this.isNew() ? e : e + ("/" == e.charAt(e.length - 1) ? "" : "/") + encodeURIComponent(this.id)
},
parse: function (e) {
return e
},
clone: function () {
return new this.constructor(this.attributes)
},
isNew: function () {
return null == this.id
},
change: function (e) {
e || (e = {});
var t = this._changing;
this._changing = !0;
for (var n in this._silent) this._pending[n] = !0;
var r = o.extend({}, e.changes, this._silent);
this._silent = {};
for (var n in r) this.trigger("change:" + n, this, this.get(n), e);
if (t) return this;
for (; !o.isEmpty(this._pending);) {
this._pending = {}, this.trigger("change", this, e);
for (var n in this.changed) this._pending[n] || this._silent[n] || delete this.changed[n];
this._previousAttributes = o.clone(this.attributes)
}
return this._changing = !1, this
},
hasChanged: function (e) {
return arguments.length ? o.has(this.changed, e) : !o.isEmpty(this.changed)
},
changedAttributes: function (e) {
if (!e) return this.hasChanged() ? o.clone(this.changed) : !1;
var t, n = !1,
r = this._previousAttributes;
for (var i in e) o.isEqual(r[i], t = e[i]) || ((n || (n = {}))[i] = t);
return n
},
previous: function (e) {
return arguments.length && this._previousAttributes ? this._previousAttributes[e] : null
},
previousAttributes: function () {
return o.clone(this._previousAttributes)
},
isValid: function () {
return !this.validate(this.attributes)
},
_validate: function (e, t) {
if (t.silent || !this.validate) return !0;
e = o.extend({}, this.attributes, e);
var n = this.validate(e, t);
return n ? (t && t.error ? t.error(this, n, t) : this.trigger("error", this, n, t), !1) : !0
}
});
var c = e.Collection = function (e, t) {
t || (t = {}), t.model && (this.model = t.model), t.comparator && (this.comparator = t.comparator), this._reset(), this.initialize.apply(this, arguments), e && this.reset(e, {
silent: !0,
parse: t.parse
})
};
o.extend(c.prototype, u, {
model: l,
initialize: function () {},
toJSON: function (e) {
return this.map(function (t) {
return t.toJSON(e)
})
},
add: function (e, t) {
var n, r, a, s, u, l, c = {}, f = {}, d = [];
for (t || (t = {}), e = o.isArray(e) ? e.slice() : [e], n = 0, a = e.length; a > n; n++) {
if (!(s = e[n] = this._prepareModel(e[n], t))) throw new Error("Can't add an invalid model to a collection");
u = s.cid, l = s.id, c[u] || this._byCid[u] || null != l && (f[l] || this._byId[l]) ? d.push(n) : c[u] = f[l] = s
}
for (n = d.length; n--;) e.splice(d[n], 1);
for (n = 0, a = e.length; a > n; n++)(s = e[n]).on("all", this._onModelEvent, this), this._byCid[s.cid] = s, null != s.id && (this._byId[s.id] = s);
if (this.length += a, r = null != t.at ? t.at : this.models.length, i.apply(this.models, [r, 0].concat(e)), this.comparator && null == t.at && this.sort({
silent: !0
}), t.silent) return this;
for (n = 0, a = this.models.length; a > n; n++) c[(s = this.models[n]).cid] && (t.index = n, s.trigger("add", s, this, t));
return this
},
remove: function (e, t) {
var n, r, i, a;
for (t || (t = {}), e = o.isArray(e) ? e.slice() : [e], n = 0, r = e.length; r > n; n++) a = this.getByCid(e[n]) || this.get(e[n]), a && (delete this._byId[a.id], delete this._byCid[a.cid], i = this.indexOf(a), this.models.splice(i, 1), this.length--, t.silent || (t.index = i, a.trigger("remove", a, this, t)), this._removeReference(a));
return this
},
push: function (e, t) {
return e = this._prepareModel(e, t), this.add(e, t), e
},
pop: function (e) {
var t = this.at(this.length - 1);
return this.remove(t, e), t
},
unshift: function (e, t) {
return e = this._prepareModel(e, t), this.add(e, o.extend({
at: 0
}, t)), e
},
shift: function (e) {
var t = this.at(0);
return this.remove(t, e), t
},
get: function (e) {
return null == e ? void 0 : this._byId[null != e.id ? e.id : e]
},
getByCid: function (e) {
return e && this._byCid[e.cid || e]
},
at: function (e) {
return this.models[e]
},
where: function (e) {
return o.isEmpty(e) ? [] : this.filter(function (t) {
for (var n in e)
if (e[n] !== t.get(n)) return !1;
return !0
})
},
sort: function (e) {
if (e || (e = {}), !this.comparator) throw new Error("Cannot sort a set without a comparator");
var t = o.bind(this.comparator, this);
return 1 == this.comparator.length ? this.models = this.sortBy(t) : this.models.sort(t), e.silent || this.trigger("reset", this, e), this
},
pluck: function (e) {
return o.map(this.models, function (t) {
return t.get(e)
})
},
reset: function (e, t) {
e || (e = []), t || (t = {});
for (var n = 0, r = this.models.length; r > n; n++) this._removeReference(this.models[n]);
return this._reset(), this.add(e, o.extend({
silent: !0
}, t)), t.silent || this.trigger("reset", this, t), this
},
fetch: function (t) {
t = t ? o.clone(t) : {}, void 0 === t.parse && (t.parse = !0);
var n = this,
r = t.success;
return t.success = function (e, i, o) {
n[t.add ? "add" : "reset"](n.parse(e, o), t), r && r(n, e)
}, t.error = e.wrapError(t.error, n, t), (this.sync || e.sync).call(this, "read", this, t)
},
create: function (e, t) {
var n = this;
if (t = t ? o.clone(t) : {}, e = this._prepareModel(e, t), !e) return !1;
t.wait || n.add(e, t);
var r = t.success;
return t.success = function (i, o) {
t.wait && n.add(i, t), r ? r(i, o) : i.trigger("sync", e, o, t)
}, e.save(null, t), e
},
parse: function (e) {
return e
},
chain: function () {
return o(this.models).chain()
},
_reset: function () {
this.length = 0, this.models = [], this._byId = {}, this._byCid = {}
},
_prepareModel: function (e, t) {
if (t || (t = {}), e instanceof l) e.collection || (e.collection = this);
else {
var n = e;
t.collection = this, e = new this.model(n, t), e._validate(e.attributes, t) || (e = !1)
}
return e
},
_removeReference: function (e) {
this == e.collection && delete e.collection, e.off("all", this._onModelEvent, this)
},
_onModelEvent: function (e, t, n, r) {
("add" != e && "remove" != e || n == this) && ("destroy" == e && this.remove(t, r), t && e === "change:" + t.idAttribute && (delete this._byId[t.previous(t.idAttribute)], this._byId[t.id] = t), this.trigger.apply(this, arguments))
}
});
var f = ["forEach", "each", "map", "reduce", "reduceRight", "find", "detect", "filter", "select", "reject", "every", "all", "some", "any", "include", "contains", "invoke", "max", "min", "sortBy", "sortedIndex", "toArray", "size", "first", "initial", "rest", "last", "without", "indexOf", "shuffle", "lastIndexOf", "isEmpty", "groupBy"];
o.each(f, function (e) {
c.prototype[e] = function () {
return o[e].apply(o, [this.models].concat(o.toArray(arguments)))
}
});
var d = e.Router = function (e) {
e || (e = {}), e.routes && (this.routes = e.routes), this._bindRoutes(), this.initialize.apply(this, arguments)
}, h = /:\w+/g,
p = /\*\w+/g,
g = /[-[\]{}()+?.,\\^$|#\s]/g;
o.extend(d.prototype, u, {
initialize: function () {},
route: function (t, n, r) {
return e.history || (e.history = new m), o.isRegExp(t) || (t = this._routeToRegExp(t)), r || (r = this[n]), e.history.route(t, o.bind(function (i) {
var o = this._extractParameters(t, i);
r && r.apply(this, o), this.trigger.apply(this, ["route:" + n].concat(o)), e.history.trigger("route", this, n, o)
}, this)), this
},
navigate: function (t, n) {
e.history.navigate(t, n)
},
_bindRoutes: function () {
if (this.routes) {
var e = [];
for (var t in this.routes) e.unshift([t, this.routes[t]]);
for (var n = 0, r = e.length; r > n; n++) this.route(e[n][0], e[n][1], this[e[n][1]])
}
},
_routeToRegExp: function (e) {
return e = e.replace(g, "\\$&").replace(h, "([^/]+)").replace(p, "(.*?)"), new RegExp("^" + e + "$")
},
_extractParameters: function (e, t) {
return e.exec(t).slice(1)
}
});
var m = e.History = function () {
this.handlers = [], o.bindAll(this, "checkUrl")
}, y = /^[#\/]/,
v = /msie [\w.]+/;
m.started = !1, o.extend(m.prototype, u, {
interval: 50,
getHash: function (e) {
var t = e ? e.location : window.location,
n = t.href.match(/#(.*)$/);
return n ? n[1] : ""
},
getFragment: function (e, t) {
if (null == e)
if (this._hasPushState || t) {
e = window.location.pathname;
var n = window.location.search;
n && (e += n)
} else e = this.getHash();
return e.indexOf(this.options.root) || (e = e.substr(this.options.root.length)), e.replace(y, "")
},
start: function (e) {
if (m.started) throw new Error("Backbone.history has already been started");
m.started = !0, this.options = o.extend({}, {
root: "/"
}, this.options, e), this._wantsHashChange = this.options.hashChange !== !1, this._wantsPushState = !! this.options.pushState, this._hasPushState = !! (this.options.pushState && window.history && window.history.pushState);
var t = this.getFragment(),
n = document.documentMode,
r = v.exec(navigator.userAgent.toLowerCase()) && (!n || 7 >= n);
r && (this.iframe = a('<iframe src="javascript:0" tabindex="-1" />').hide().appendTo("body")[0].contentWindow, this.navigate(t)), this._hasPushState ? a(window).bind("popstate", this.checkUrl) : this._wantsHashChange && "onhashchange" in window && !r ? a(window).bind("hashchange", this.checkUrl) : this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)), this.fragment = t;
var i = window.location,
s = i.pathname == this.options.root;
return this._wantsHashChange && this._wantsPushState && !this._hasPushState && !s ? (this.fragment = this.getFragment(null, !0), window.location.replace(this.options.root + "#" + this.fragment), !0) : (this._wantsPushState && this._hasPushState && s && i.hash && (this.fragment = this.getHash().replace(y, ""), window.history.replaceState({}, document.title, i.protocol + "//" + i.host + this.options.root + this.fragment)), this.options.silent ? void 0 : this.loadUrl())
},
stop: function () {
a(window).unbind("popstate", this.checkUrl).unbind("hashchange", this.checkUrl), clearInterval(this._checkUrlInterval), m.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), this.loadUrl() || this.loadUrl(this.getHash()), void 0)
},
loadUrl: function (e) {
var t = this.fragment = this.getFragment(e),
n = o.any(this.handlers, function (e) {
return e.route.test(t) ? (e.callback(t), !0) : void 0
});
return n
},
navigate: function (e, t) {
if (!m.started) return !1;
t && t !== !0 || (t = {
trigger: t
});
var n = (e || "").replace(y, "");
this.fragment != n && (this._hasPushState ? (0 != n.indexOf(this.options.root) && (n = this.options.root + n), this.fragment = n, window.history[t.replace ? "replaceState" : "pushState"]({}, document.title, n)) : this._wantsHashChange ? (this.fragment = n, this._updateHash(window.location, n, t.replace), this.iframe && n != this.getFragment(this.getHash(this.iframe)) && (t.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, n, t.replace))) : window.location.assign(this.options.root + e), t.trigger && this.loadUrl(e))
},
_updateHash: function (e, t, n) {
n ? e.replace(e.toString().replace(/(javascript:|#).*$/, "") + "#" + t) : e.hash = t
}
});
var b = e.View = function (e) {
this.cid = o.uniqueId("view"), this._configure(e || {}), this._ensureElement(), this.initialize.apply(this, arguments), this.delegateEvents()
}, x = /^(\S+)\s*(.*)$/,
w = ["model", "collection", "el", "id", "attributes", "className", "tagName"];
o.extend(b.prototype, u, {
tagName: "div",
$: function (e) {
return this.$el.find(e)
},
initialize: function () {},
render: function () {
return this
},
remove: function () {
return this.$el.remove(), this
},
make: function (e, t, n) {
var r = document.createElement(e);
return t && a(r).attr(t), null != n && a(r).html(n), r
},
setElement: function (e, t) {
return this.$el && this.undelegateEvents(), this.$el = e instanceof a ? e : a(e), this.el = this.$el[0], t !== !1 && this.delegateEvents(), this
},
delegateEvents: function (e) {
if (e || (e = _(this, "events"))) {
this.undelegateEvents();
for (var t in e) {
var n = e[t];
if (o.isFunction(n) || (n = this[e[t]]), !n) throw new Error('Method "' + e[t] + '" does not exist');
var r = t.match(x),
i = r[1],
a = r[2];
n = o.bind(n, this), i += ".delegateEvents" + this.cid, "" === a ? this.$el.bind(i, n) : this.$el.delegate(a, i, n)
}
}
},
undelegateEvents: function () {
this.$el.unbind(".delegateEvents" + this.cid)
},
_configure: function (e) {
this.options && (e = o.extend({}, this.options, e));
for (var t = 0, n = w.length; n > t; t++) {
var r = w[t];
e[r] && (this[r] = e[r])
}
this.options = e
},
_ensureElement: function () {
if (this.el) this.setElement(this.el, !1);
else {
var e = o.extend({}, _(this, "attributes"));
this.id && (e.id = this.id), this.className && (e["class"] = this.className), this.setElement(this.make(this.tagName, e), !1)
}
}
});
var T = function (e, t) {
var n = C(this, e, t);
return n.extend = this.extend, n
};
l.extend = c.extend = d.extend = b.extend = T;
var N = {
create: "POST",
update: "PUT",
"delete": "DELETE",
read: "GET"
};
e.sync = function (t, n, r) {
var i = N[t];
r || (r = {});
var s = {
type: i,
dataType: "json"
};
return r.url || (s.url = _(n, "url") || k()), r.data || !n || "create" != t && "update" != t || (s.contentType = "application/json", s.data = JSON.stringify(n)), e.emulateJSON && (s.contentType = "application/x-www-form-urlencoded", s.data = s.data ? {
model: s.data
} : {}), e.emulateHTTP && ("PUT" === i || "DELETE" === i) && (e.emulateJSON && (s.data._method = i), s.type = "POST", s.beforeSend = function (e) {
e.setRequestHeader("X-HTTP-Method-Override", i)
}), "GET" === s.type || e.emulateJSON || (s.processData = !1), a.ajax(o.extend(s, r))
}, e.wrapError = function (e, t, n) {
return function (r, i) {
i = r === t ? i : r, e ? e(t, i, n) : t.trigger("error", t, i, n)
}
};
var E = function () {}, C = function (e, t, n) {
var r;
return r = t && t.hasOwnProperty("constructor") ? t.constructor : function () {
e.apply(this, arguments)
}, o.extend(r, e), E.prototype = e.prototype, r.prototype = new E, t && o.extend(r.prototype, t), n && o.extend(r, n), r.prototype.constructor = r, r.__super__ = e.prototype, r
}, _ = function (e, t) {
return e && e[t] ? o.isFunction(e[t]) ? e[t]() : e[t] : null
}, k = function () {
throw new Error('A "url" property or function must be specified')
}
}.call(this), window.BackboneHC = this.Backbone.noConflict(), window.BackboneHC.setDomLibrary(this.jHC);
! function () {
"use strict";
function e() {
var e = {
"&": "&#38;",
"<": "&#60;",
">": "&#62;",
'"': "&#34;",
"'": "&#39;",
"/": "&#47;"
}, t = /&(?!#?\w+;)|<|>|"|'|\//g;
return function () {
return this ? this.replace(t, function (t) {
return e[t] || t
}) : this
}
}
function t(e, n, r) {
return ("string" == typeof n ? n : n.toString()).replace(e.define || o, function (t, n, i, o) {
return 0 === n.indexOf("def.") && (n = n.substring(4)), n in r || (":" === i ? (e.defineParams && o.replace(e.defineParams, function (e, t, i) {
r[n] = {
arg: t,
text: i
}
}), n in r || (r[n] = o)) : new Function("def", "def['" + n + "']=" + o)(r)), ""
}).replace(e.use || o, function (n, i) {
e.useParams && (i = i.replace(e.useParams, function (e, t, n, i) {
if (r[n] && r[n].arg && i) {
var o = (n + ":" + i).replace(/'|\\/g, "_");
return r.__exp = r.__exp || {}, r.__exp[o] = r[n].text.replace(new RegExp("(^|[^\\w$])" + r[n].arg + "([^\\w$])", "g"), "$1" + i + "$2"), t + "def.__exp['" + o + "']"
}
}));
var o = new Function("def", "return " + i)(r);
return o ? t(e, o, r) : o
})
}
function n(e) {
return e.replace(/\\('|\\)/g, "$1").replace(/[\r\t\n]/g, " ")
}
var r = {
version: "1.0.0",
templates: {},
templateSettings: {
include: /\{\{include ([\s\S]+?\}?)\}\}/g,
locale: /\{\{t ([\s\S]+?\}?)\}\}/g,
evaluate: /\{\{([\s\S]+?\}?)\}\}/g,
interpolate: /\{\{=([\s\S]+?)\}\}/g,
encode: /\{\{!([\s\S]+?)\}\}/g,
use: /\{\{#([\s\S]+?)\}\}/g,
useParams: /(^|[^\w$])def(?:\.|\[[\'\"])([\w$\.]+)(?:[\'\"]\])?\s*\:\s*([\w$\.]+|\"[^\"]+\"|\'[^\']+\'|\{[^\}]+\})/g,
define: /\{\{##\s*([\w\.$]+)\s*(\:|=)([\s\S]+?)#\}\}/g,
defineParams: /^\s*([\w$]+):([\s\S]+)/,
conditional: /\{\{\?(\?)?\s*([\s\S]*?)\s*\}\}/g,
iterate: /\{\{~\s*(?:\}\}|([\s\S]+?)\s*\:\s*([\w$]+)\s*(?:\:\s*([\w$]+))?\s*\}\})/g,
varname: "it",
strip: !0,
append: !0,
selfcontained: !1
},
template: void 0,
compile: void 0
};
window.HCdoT = r, String.prototype.encodeHTML = e();
var i = {
append: {
start: "'+(",
end: ")+'",
endencode: "||'').toString().encodeHTML()+'"
},
split: {
start: "';out+=(",
end: ");out+='",
endencode: "||'').toString().encodeHTML();out+='"
}
}, o = /$^/;
r.tmpl = function (e, t, n, i) {
var o = r.template(t, n, i);
return r.templates[e] = o, o
}, r.template = function (a, s, u) {
s = s || r.templateSettings;
var l, c, f = s.append ? i.append : i.split,
d = 0,
p = s.use || s.define ? t(s, a, u || {}) : a;
p = ("var out='" + (s.strip ? p.replace(/(^|\r|\n)\t* +| +\t*(\r|\n|$)/g, " ").replace(/\r|\n|\t|\/\*[\s\S]*?\*\//g, "") : p).replace(/'|\\/g, "\\$&").replace(s.include || o, function (e, t) {
return f.start + "HCdoT.templates[" + t + "](it)" + f.end
}).replace(s.locale || o, function (e, t) {
return f.start + "HC._(" + t + ") || " + t + f.end
}).replace(s.interpolate || o, function (e, t) {
return f.start + n(t) + f.end
}).replace(s.encode || o, function (e, t) {
return l = !0, f.start + n(t) + f.endencode
}).replace(s.conditional || o, function (e, t, r) {
return t ? r ? "';}else if(" + n(r) + "){out+='" : "';}else{out+='" : r ? "';if(" + n(r) + "){out+='" : "';}out+='"
}).replace(s.iterate || o, function (e, t, r, i) {
return t ? (d += 1, c = i || "i" + d, t = n(t), "';var arr" + d + "=" + t + ";if(arr" + d + "){var " + r + "," + c + "=-1,l" + d + "=arr" + d + ".length-1;while(" + c + "<l" + d + "){" + r + "=arr" + d + "[" + c + "+=1];out+='") : "';} } out+='"
}).replace(s.evaluate || o, function (e, t) {
return "';" + n(t) + "out+='"
}) + "';return out;").replace(/\n/g, "\\n").replace(/\t/g, "\\t").replace(/\r/g, "\\r").replace(/(\s|;|\}|^|\{)out\+='';/g, "$1").replace(/\+''/g, "").replace(/(\s|;|\}|^|\{)out\+=''\+/g, "$1out+="), l && s.selfcontained && (p = "String.prototype.encodeHTML=(" + e.toString() + "());" + p);
try {
return new Function(s.varname, p)
} catch (h) {
throw "undefined" != typeof console && console.log("Could not create a template function: " + p), h
}
}, r.compile = function (e, t) {
return r.template(e, null, t)
}
}();
! function (e, t, n) {
e.HC = function (e) {
var r = this;
r.Backbone = t, r.$ = n, r.token = "", r.config = n.extend({}, HC.default_config, e), n.ajaxSetup({
cache: !0
}), HC.FRONT_SERVERS = HC.CLUSTERS[HC.WS.cluster || HC.DEFCLUSTER], r.on = function (e, t) {
"function" == typeof t && (e in r.events || (r.events[e] = []), r.events[e].push(t))
}, r.call = function () {
arguments = Array.prototype.slice.call(arguments);
var e = arguments.shift();
if (e in r.events)
for (var t = 0; t < r.events[e].length; t++) r.events[e][t].apply({}, arguments)
}, "ar" == HC.LANGUAGE && n.cssRule(".hc .hc_message_text", {
direction: "rtl !important"
}), r.events = {}, r.models = {}, r.views = {}, r.collections = {}, r.collections.comments = {}, r.view = {}, r.model = {}, r.collection = {}, new HC.Utils(r, HC, t, n), new HC.Models(r, HC, t, n), new HC.ViewsBasic(r, HC, t, n), new HC.ViewsLikes(r, HC, t, n), new HC.ViewsComment(r, HC, t, n), new HC.ViewsTopic(r, HC, t, n), new HC.ViewsAuthor(r, HC, t, n), new HC.ViewsPopup(r, HC, t, n), new HC.ViewsIdent(r, HC, t, n), new HC.ViewsHC(r, HC, t, n), new HC.ViewsMixStream(r, HC, t, n)
}
}(this, this.BackboneHC, this.jHC);
! function (e) {
e.prototype.Stream = function (e, t) {
var n = this;
delete n.config.plan, n.config = t.extend({
append: "#hypercomments_widget"
}, n.config), n.reader = new e.Reader(n, n.$), n.writer = new e.Writer(n), e.WS.cmd = "setWidgetSettings", n.reader.receive(e.WS);
var r = {
stream: "streamstart",
widget_id: n.config.widget_id,
type: n.config.type,
href: n.config.href,
xid: n.config.xid,
title: n.config.title,
stream_id: n.config.stream_id,
limit: n.models.WidgetSettings.get("limit"),
filter: n.models.WidgetSettings.get("default_filter"),
reverse: n.models.WidgetSettings.get("reverse"),
hypertext: n.models.WidgetSettings.get("hc"),
parent_id: n.config.parent_id,
auth: n.config.auth,
token: n.config.token
};
n.socket = new e.Socket({
xid: n.config.xid || n.config.href
}, n), n.socket.api("/comments", r, function (e) {
n.reader.receive(e), n.socket.settings.stream_id = n.models.StreamInfo.get("stream_id"), n.socket.settings.widget_id = n.config.widget_id, n.socket.settings.auth = n.config.auth || void 0, n.socket.connect()
}), n.on("css.ready", function () {
n.models.WidgetSettings && n.models.WidgetSettings.set("CSS_READY", 1)
}), e.default_config.CSS_READY && n.call("css.ready"), n.socket.onopen = function () {
e.SOCKET_OPEN = !0
}, n.socket.onmessage = function (e) {
e.cmd && n.reader.receive(e)
}, e.analytics()
}
}(this.HC);
! function (e) {
e.prototype.Bloggerstream = function (e, t) {
var n = this,
r = n.config,
i = function (n) {
var i = t(r.selector);
i.map(function () {
var i = this,
o = 0;
if (n.data.length > 0)
for (var a = 0; a < n.data.length; a++) {
var s = n.data[a],
l = t(i).data("xid");
if (l || (l = t(i).attr("href")), -1 != l.indexOf(s.xid)) var o = s.cm2 - s.hc
}
if (r.label) {
var u = r.label.replace("{%COUNT%}", o);
t(i).html(u)
} else t(i).html(e._("tab_comments") + " (" + o + ")");
t(i).hide().show()
})
}, o = function () {
var o = [],
a = [];
t(r.selector).map(function () {
var e = t(this).attr("href"),
n = t(this).data("xid");
n ? a.push(n) : e && (e = e.replace("https://", "").replace("http://", "").replace("www.", ""), o.push(e))
}), n.socket = new e.Socket({
xid: r.xid || r.href
}, n), o.length || a.length ? n.socket.api("/get_count", {
widget_id: r.widget_id,
href: o,
xids: a
}, i) : i({
data: []
})
}, a = function () {
t(r.selector_widget).map(function () {
var n = "hc-container-" + e.autoId++;
t(this).show().attr("id", n);
var i = {};
i.widget_id = r.widget_id, i.append = "#" + n, i.xid = t(this).data("xid"), i.limit = r.limit || 3, i.hc_disable = 1, i.hc_disable_rt = 1, e.widget("Stream", i)
})
};
r.selector && t(r.selector).size() > 0 && o(), r.selector_widget && t(r.selector_widget).size() > 0 && a()
}
}(this.HC);
! function (e) {
e.prototype.Mixstream = function (e) {
function t() {
e.default_config.CSS_READY && 1 == e.default_config.CSS_READY && (e.addCSS(n.config.css, function () {}), clearInterval(o))
}
var n = this,
r = n.$;
n.Backbone, n.config = r.extend({
limit: 5,
filter: "all",
append: "#hypercomments_mix"
}, n.config);
var i = n.config;
if (n.config.css) var o = setInterval(t, 50);
n.socket = new e.Socket({
xid: i.xid || i.href
}, n), n.views.mixroot = new n.view.MixView({}), n.views.mixroot.init()
}
}(this.HC);
! function (e, t, n, r) {
n.VERSION = "1", n.LANGUAGE = "en", n.SVERSION, n.PROTOCOL = "https:" == t.location.protocol ? "https:" : "http:", n.HOST = n.PROTOCOL + "//hypercomments.com", n.CDN_HOST = n.PROTOCOL + "//static.hypercomments.com", "http:" == n.PROTOCOL && (n.CDN_HOST = n.PROTOCOL + "//static.hypercomments.com"), n.templates = [], n.WS = {}, n.instances = [], n.DEBUG = e.HC_DEBUG || !1, n.TEST = e.HC_TEST || !1, n.DEV = e.HC_DEV || !1, n.autoId = 1, n._GET = {}, n.DEFCLUSTER = "c1", n.CLUSTERS = {
c0: ["c0n1.hypercomments.com", "c0n2.hypercomments.com"],
c1: ["c1n1.hypercomments.com", "c1n2.hypercomments.com", "c1n3.hypercomments.com"],
c2: ["c2n1.hypercomments.com", "c2n2.hypercomments.com"],
c3: ["c3n1.hypercomments.com", "c3n2.hypercomments.com", "c3n3.hypercomments.com"],
c4: ["c4n1.hypercomments.com", "c4n2.hypercomments.com", "c4n3.hypercomments.com"]
}, n.setTest = function () {
n.DEFCLUSTER = "c0"
}, n.setDev = function () {
n.CDN_HOST = n.PROTOCOL + "//stat.hypercomments.com", n.DIR = n.CDN_HOST + "/apps/faststreamdev/", n.HOST = n.PROTOCOL + "//dev.hypercomments.com"
}, n.log = function (t, r) {
if (n.DEBUG && "console" in e && "log" in console) {
"object" == typeof t && (t = JSON.stringify(t));
var i = new Date,
o = i.getHours() + ":" + i.getMinutes() + ":" + i.getSeconds() + ":" + i.getMilliseconds();
r ? "object" == typeof r && (r = JSON.stringify(r)) : r = "", console.log("[" + o + "] " + t + " " + r)
}
}, n.paramUrl = function (e) {
var t, n = [];
for (t in e) n.push(encodeURIComponent(t) + "=" + encodeURIComponent(e[t]));
return n.join("&")
}, n.popup = function (t, n, r, i, o) {
var a = (640 - t) / 2,
s = (480 - n) / 2;
screen && (s = (screen.availHeight - n) / 2, a = (screen.availWidth - t) / 2);
var l = e.open(i, r, "menubar=0,location=0,toolbar=0,directories=0,scrollbars=0,status=0,resizable=0,width=" + t + ",height=" + n + ",screenX=" + a + ",screenY=" + s + ",top=" + s + ",left=" + a);
if (l.focus(), o) var u = setInterval(function () {
(!l || l.closed) && (clearInterval(u), o())
}, 500)
}, n.Gravatar = function (e, t) {
if (e) return n.CDN_HOST + "/data/avatars/" + e + "/avatar";
if (t) {
var r = "https:" == n.PROTOCOL ? "https://secure.gravatar.com" : "http://www.gravatar.com";
return r + "/avatar/" + t + "?d=" + n.CDN_HOST + "/data/avatars/0/avatar.jpg"
}
return n.CDN_HOST + "/data/avatars/0/avatar"
}, n.notify = function (e) {
var t = n.tmpl("hc_notify_box", {
text: e
});
r(t).appendTo(".hc_root").delay(1e4).animate({
bottom: -400
}, 1e3, function () {
r(this).remove()
})
}, n.setCursorPosition = function (e, t) {
if (e.setSelectionRange) e.setSelectionRange(t, t);
else if (e.createTextRange) {
var n = jnode.createTextRange();
n.collapse(!0), n.moveEnd("character", t), n.moveStart("character", t), n.select()
}
}, n.addCSS = function (e, r) {
var i = t.createElement("link");
i.rel = "stylesheet", i.type = "text/css", i.media = "screen", i.href = e;
var o = !1,
a = function () {
o || this.readyState && "loaded" !== this.readyState && "complete" !== this.readyState || (o = !0, r && r(), i.onload = i.onreadystatechange = null)
};
i.onload = i.onreadystatechange = a;
var s = setInterval(function () {
o && clearInterval(s);
for (var e = t.styleSheets, n = e.length; n--;) {
var r = e[n];
i.href === r.href && (clearInterval(s), a())
}
}, 500);
return n.addFile(i), i
}, n.addFile = function (e) {
var n = t.getElementsByTagName("head")[0] || t.getElementsByTagName("body")[0];
n.appendChild(e)
}, n.analytics = function () {
var e = n.DIR + "html/analytics.html",
t = '<iframe src="' + e + '" style="position: absolute; height: 1px; width: 1px; top:-1000px; background-color: transparent;" scrolling="no" frameborder="0"></iframe>';
r("body").append(t)
}, n.validateEmail = function (e) {
var t = /([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,6})/gim;
return t.test(e)
}, n.toStorage = function (t, n) {
"localStorage" in e && e.localStorage.setItem(t, n)
}, n.fromStorage = function (t) {
return "localStorage" in e ? e.localStorage.getItem(t) : void 0
}, n.delStorage = function (t) {
return "localStorage" in e ? e.localStorage.removeItem(t) : void 0
}, n.tmpl_parse = function (e, t) {
"object" == typeof e && (e = e.data);
var r, i = new RegExp('<t name="([a-zA-Z_-]*)"[^>]*>(.*?)</t>', "gi");
e = e.replace(/[\r\t\n]/g, "").replace(/\s{2,}/g, " ").replace(/>\s</g, "><");
try {
for (; null !== (r = i.exec(e));) HCdoT.tmpl(r[1], r[2])
} catch (o) {
n.log("ERROR parse template")
}
"function" == typeof t && t()
}, n.tmpl = function (e, t) {
return t = t || {}, e in HCdoT.templates ? HCdoT.templates[e](t) : e
}, n.default_config = {
href: t.location.href,
title: (t.title || "").slice(0, 300) || void 0,
host: t.location.host,
userAgent: navigator.userAgent,
uid: 0,
filter: "new",
CSS_READY: 0,
comments_level: 4,
realtime: !0
}, n.runProd = function (e) {
var t = ["index", "blue", "green", "orange", "pink", "red", "dark"],
i = n.WS.template; - 1 == r.inArray(i, t) && (i = "index");
var o = n.DIR + "css/" + i + ".css";
if (n.tmpl_parse(n.templates[0], e), n.addCSS(o, function () {
r(n.instances).map(function () {
this.call("css.ready"), n.default_config.CSS_READY = 1
})
}), "ar" == n.LANGUAGE) {
var a = n.DIR + "css/arabic.css";
n.addCSS(a, function () {})
}
}, n.runTest = function (e) {
n.default_config.CSS_READY = 1, n.setTest(), r.get("http://stat.hypercomments.com/apps/faststreamdev/tmpl/index.html?_=" + (new Date).getTime(), function (t) {
n.tmpl_parse(t, e)
})
}, n.prepare = function (e) {
n.templates.length ? n.runProd(e) : n.runTest(e)
}, n.HCReadycallback, n.ready = function (e) {
n.HCReadycallback = e
}, n.appInit = function () {
if (!n.opera_mobile_view()) {
n.DIR = n.CDN_HOST + "/widget/hc/" + n.VERSION + "/", n.TEST && n.setTest(), n.DEV && n.setDev();
var t = [];
"_hcwp" in e && (t = _hcwp.slice(), _hcwp = []), "_hcp" in e && _hcp && (t.push(_hcp), _hcp = null), n.prepare(function () {
for (var e = 0; e < t.length; e++) {
var i = t[e];
n.widget(i.widget, i)
}
r.isFunction(n.HCReadycallback) && n.HCReadycallback()
})
}
}, n.opera_mobile_view = function () {
if (-1 != e.navigator.userAgent.indexOf("Opera Mini")) {
r("body").append(r('<div id="hc_style_box"></div>')), r("#hc_style_box").html("<style>@media handheld {#hc_opera_mediainspector {z-index: 4}}</style>"), r("body").append(r('<div id="hc_opera_mediainspector"></div>'));
var n = t.getElementById("hc_opera_mediainspector");
if (n.currentStyle ? zIndex = n.currentStyle.zIndex : e.getComputedStyle && (zIndex = e.getComputedStyle(n, "").getPropertyValue("z-index")), r("#hc_opera_mediainspector").remove(), r("#hc_style_box").remove(), 4 == parseInt(zIndex, 10)) return !0
}
return !1
}, n.widget = function (e, t) {
if (!t.widget_id) return n.log("[HC WARNING] widget_id undefined"), void 0;
t.widget_id = parseInt(t.widget_id, 10);
var i = new n(t);
i[e](n, jHC), n.instances.push(i), r.isFunction(t.callback) && t.callback(i, t)
}, n.queryParams = function (e, t) {
for (var n = {}, i = e.substring("?"), i = i.replace("?", ""), i = i.split("&"), o = 0; o < i.length; o++) {
var a = i[o].split("=");
t && -1 != r.inArray(a[0], t) || (n[a[0]] = a[1])
}
return n
}, e.location.search && (n._GET = n.queryParams(e.location.search)), n._GET.hc_test && (n.TEST = !0), n._GET.hc_dev && (n.DEV = !0), n._GET.hc_debug && (n.DEBUG = !0)
}(this, this.document, this.HC, this.jHC);
! function (e) {
e.Socket = function (t, n) {
var r = this,
i = null,
o = jHC,
a = 0,
s = 0,
c = 0,
l = !1,
u = ["websocket", "cors", "longpolling"];
r.token = null, r.settings = jHC.extend({
driver: "websocket",
xid: "",
autoreconnect: !0,
cache: !1,
path: "/stream/subscribe",
stream_id: "",
widget_id: "",
auth: ""
}, t), this.server = new e.Socket.Server(r.settings.xid, e.FRONT_SERVERS), e._GET.hc_socket && (r.settings.driver = e._GET.hc_socket, r.settings.cache = !1, r.setCache("hc_socket", e._GET.hc_socket));
var f;
this.timeout = function () {
if (1 != a) {
if (f && clearTimeout(f), i.close(), "longpolling" != r.settings.driver) {
c++;
var e = c > 2 ? 0 : c,
t = u[e];
r.setCache("hc_socket", t), r.settings.driver = t
}
r.connect()
}
}, this.connect = function () {
a = 0, f && clearTimeout(f), f = setTimeout(r.timeout, 8e3), i = r.getSocket();
var e = i.connect(function () {
a = 1, clearTimeout(f), r.onopen && r.onopen()
}, m, g, r.token);
e || r.timeout()
}, this.send = function (t) {
1 == a && (e.log("[WRITE] ", t), i.send(t), p())
}, this.api = function (e, t, n, r) {
if ("XMLHttpRequest88" in window) {
var i = new XMLHttpRequest;
"undefined" == typeof i.withCredentials ? this.api_iframe(e, t, n, r) : this.api_cors(e, t, n, r)
} else this.api_iframe(e, t, n, r)
}, this.api_cors = function (t, i, o, a) {
if (a = a || 0, !(a > 3)) {
data_post = {
data: JSON.stringify(i),
host: document.location.protocol + "//" + document.location.host
}, r.token && (data_post.token = r.token);
var s = e.PROTOCOL + "//" + r.server.get() + "/api" + t;
e.log("[API REQUEST] " + s, i), jHC.ajax({
url: s,
type: "POST",
data: data_post,
xhrFields: {
withCredentials: !0
},
async: !0,
cache: !1,
complete: function (s) {
if (200 == s.status || 204 == s.status) e.log("[API RESPONSE CORS] ", s.responseText), packet = JSON.parse(s.responseText), o(packet);
else {
r.server.next();
var c = r.server.sleep();
setTimeout(function () {
n.socket.api(t, i, o, a + 1)
}, c)
}
}
})
}
}, this.api_iframe = function (t, i, a, s) {
if (s = s || 0, !(s > 3)) {
var c = e.PROTOCOL + "//" + r.server.get() + "/api" + t;
e.log("[API REQUEST] " + c, i);
var l = "hc_api_iframe_" + e.autoId++,
u = o('<iframe id="' + l + '" name="' + l + '"></iframe>').css({
position: "absolute",
top: -1e3
}).appendTo("body"),
f = o('<form target="' + l + '" action="' + c + '" method="POST" accept-charset="utf-8"></form>').css({
position: "absolute",
top: -1e3
}).appendTo("body");
i && o('<textarea name="data"></textarea>').val(JSON.stringify(i)).appendTo(f), r.token && o('<input name="token"/>').val(r.token).appendTo(f), o('<input name="response_type"/>').val("postmessage").appendTo(f), o('<input name="uid"/>').val(l).appendTo(f), o('<input name="host"/>').val(document.location.protocol + "//" + document.location.host).appendTo(f);
var d, p = !1;
d = function (t) {
e._GET.hc_postmessage && e.log("[API POSTMESSAGE] ", t.data);
var n = null,
r = null;
try {
r = decodeURIComponent(t.data), n = JSON.parse(r)
} catch (i) {
e._GET.hc_postmessage && e.log("[API PARSE ERROR] ", r);
try {
r = unescape(t.data), n = JSON.parse(r)
} catch (i) {
e._GET.hc_postmessage && e.log("[API PARSE ERROR2] ", r)
}
}
n && n.uid == l && (e._GET.hc_postmessage && e.log("[API DELETE IFRAME] ", {}), p = !0, a(n), f.remove(), u.remove(), window.removeEventListener ? window.removeEventListener("message", d) : window.detachEvent("onmessage", d), e.log("[API RESPONSE] ", r))
}, window.addEventListener ? window.addEventListener("message", d, !1) : window.attachEvent("onmessage", d), u.get(0).onload = function () {
setTimeout(function () {
if (f.remove(), u.remove(), !p) {
r.server.next();
var e = r.server.sleep();
setTimeout(function () {
n.socket.api(t, i, a, s + 1)
}, e)
}
}, 800)
}, f.eq(0).submit()
}
}, this.close = function () {
i.close(), g()
};
var d, p = function () {
d && clearTimeout(d), d = setTimeout(function () {
i && i.ping(), p()
}, 18e4)
}, h = function () {
a = 1, e.log("[INIT] " + r.settings.driver), r.onopen && r.onopen(), l = !0
}, g = function () {
if (4 != a) {
if (r.settings.autoreconnect) {
a = 4, r.server.next();
var t;
if (t = s >= e.FRONT_SERVERS.length ? 5e3 : r.server.sleep(), setTimeout(r.connect, t), e.log("[CLOSED] next reconnect after " + t), s++, !l && s >= e.FRONT_SERVERS.length) {
c++;
var n = c > 2 ? 0 : c,
o = u[n];
r.setCache("hc_socket", o), r.settings.driver = o, s = 0
}
} else a = 3, e.log("[CLOSED] socket "), r.onclose && r.onclose();
i && (i = null)
}
}, m = function (t) {
if ("1" == t) return e.log("[READ PONG] 1"), void 0;
if ("0" == t) return e.log("[READ PING] 0"), i && i.pong(), void 0;
if (e.log("[READ] ", t), "object" != typeof t) try {
t = JSON.parse(t)
} catch (n) {
return
}
1 != a && h(), r.onmessage && r.onmessage(t), s = 0, c = 0, p()
}
}, e.Socket.prototype.getSocket = function (t) {
var n = t || this.settings.driver;
if (!n || !this.getCache("hc_socket")) {
if ("WebSocket" in window || "MozWebSocket" in window) return this.setCache("hc_socket", "websocket"), this.settings.driver = "websocket", new e.Socket.WebSocket(this);
if ("XMLHttpRequest" in window) {
var r = new XMLHttpRequest;
return "undefined" == typeof r.withCredentials ? (this.setCache("hc_socket", "longpolling"), this.settings.driver = "longpolling", new e.Socket.JSONP(this)) : (this.setCache("hc_socket", "cors"), this.settings.driver = "cors", new e.Socket.CORS(this))
}
return this.setCache("hc_socket", "longpolling"), this.settings.driver = "longpolling", new e.Socket.JSONP(this)
}
switch (n) {
case "websocket":
return new e.Socket.WebSocket(this);
case "longpolling":
return new e.Socket.JSONP(this);
case "cors":
return new e.Socket.CORS(this)
}
this.settings.driver = n
}, e.Socket.prototype.setCache = function (e, t) {
"localStorage" in window && window.localStorage.setItem(e, t), this.settings.driver = t
}, e.Socket.prototype.getCache = function (e) {
return "localStorage" in window ? window.localStorage.getItem(e) : null
}, e.Socket.prototype.getRequestUrl = function (t) {
var n = this.settings,
r = this.getRequestHost(t);
return r += n.path + "?", r += "stream_id=" + n.stream_id, r += "&widget_id=" + n.widget_id, n.auth && (r += "&auth=" + encodeURIComponent(n.auth)), this.token && (r += "&token=" + encodeURIComponent(this.token)), r += "&_=" + (new Date).getTime(), e.log("[CONNECT] driver - " + t + ", url - " + r), r
}, e.Socket.prototype.getRequestHost = function (t) {
var n = "";
return n = "websocket" == t ? ("https:" == e.PROTOCOL ? "wss://" : "ws://") + this.server.get() : e.PROTOCOL + "//" + this.server.get()
}, e.Socket.WebSocket = function (t) {
var n, r = "websocket";
this.connect = function (e, i, o, a, s) {
if (!("WebSocket" in window || "MozWebSocket" in window)) return !1;
var c = "WebSocket" in window ? WebSocket : MozWebSocket;
try {
n = new c(t.getRequestUrl(r, a, s)), n.onopen = function () {
e()
}, n.onmessage = function (e) {
i(e.data)
}, n.onclose = function () {
o()
}, n.onerror = function () {
t.setCache("hc_socket", "cors"), t.settings.driver = "cors"
}
} catch (l) {
t.setCache("hc_socket", "cors"), t.settings.driver = "cors"
}
return !0
}, this.ping = function () {
n.send("0"), e.log("[SEND PING] 0")
}, this.pong = function () {
n.send("1"), e.log("[SEND PONG] 1")
}, this.send = function (e) {
n && n.send(e)
}, this.close = function () {
n && n.close(), e.log("[CLOSED] WebSocket client")
}
}, e.Socket.JSONP = function (t) {
var n, r, i, o = "jsonp",
a = this,
s = -1 == t.getRequestUrl(o).indexOf("?") ? t.getRequestUrl(o) + "?callback=?" : t.getRequestUrl(o) + "&callback=?",
c = !1;
r = function (i, a, l) {
var u = "Response_" + e.autoId++;
window[u] = function (e) {
a(e)
};
var f = {
url: s,
cache: !1,
async: !0,
jsonpCallback: u,
dataType: "json",
crossDomain: !0,
complete: function (n) {
s = t.getRequestUrl(o) + "&callback=?", 200 == n.status || 204 == n.status ? (window[u] = null, c || e._GET.hc_disable_rt || setTimeout(function () {
r(i, a, l, t.token)
}, 50)) : (c = !0, l())
}
};
try {
n = jHC.ajax(f)
} catch (d) {
c = !0, l()
}
}, this.connect = function (e, t, n, o) {
return i = t, r(e, t, n, o), !0
}, this.send = function (n) {
var r = "hc_jsonp_iframe_" + e.autoId++,
a = jHC("<form></form>").attr("target", r).attr("action", t.getRequestHost(o) + "/stream/push").attr("method", "POST").attr("accept-charset", "utf-8").css({
position: "absolute",
top: -1e3,
left: -1e3
}).appendTo("body"),
s = jHC("<iframe></iframe>").attr("name", r).css({
position: "absolute",
top: -1e3,
left: -1e3
}).appendTo("body");
jHC("<textarea></textarea>").attr("name", "data").val(n).appendTo(a), jHC("<input/>").attr("name", "token").val(t.token).appendTo(a), e._GET.hc_disable_rt && (jHC("<input/>").attr("name", "response_type").val("postmessage").appendTo(a), jHC("<input/>").attr("name", "uid").val(r).appendTo(a), jHC("<input/>").attr("name", "host").val(document.location.protocol + "//" + document.location.hostname).appendTo(a), onMessage = function (e) {
try {
var t = JSON.parse(e.data);
if (!t) return;
if (t.uid != r) return;
window.removeEventListener ? window.removeEventListener("message", onMessage) : window.detachEvent("onmessage", onMessage), i(t)
} catch (n) {}
}, window.addEventListener ? window.addEventListener("message", onMessage, !1) : window.attachEvent("onmessage", onMessage)), s.eq(0).onload = function () {
a.remove(), s.remove()
}, a.eq(0).submit()
}, this.ping = function () {
c || a.send("0"), e.log("[SEND PING] 0")
}, this.pong = function () {
c || a.send("1"), e.log("[SEND PONG] 1")
}, this.close = function () {
c = !0, n && n.abort(), n = null, e.log("[CLOSED] JSONP client")
}
}, e.Socket.CORS = function (t) {
var n, r, i = "cors",
o = !0,
a = this;
this.connect = function (e, a, s, c, l) {
var u;
return u = function () {
n = jHC.ajax({
url: t.getRequestUrl(i, c, l),
type: "GET",
headers: {
Accept: "text/long-polling"
},
xhrFields: {
withCredentials: !0
},
async: !0,
cache: !1,
complete: function (t) {
200 != t.status && 204 != t.status || r ? (r = !0, s()) : (o && e(i), o = !1, a(t.responseText), r || setTimeout(u, 50))
}
})
}, u(), setTimeout(function () {
o && e(i), o = !1
}, 1e3), !0
}, this.send = function (e) {
jHC.post(t.getRequestHost(i) + "/stream/push", {
token: t.token,
data: e
})
}, this.close = function () {
r = !0, n && n.abort(), e.log("[CLOSED] CORS client")
}, this.ping = function () {
r || a.send("0"), e.log("[SEND PING] 0")
}, this.pong = function () {
r || a.send("1"), e.log("[SEND PONG] 1")
}
}, e.Socket.Server = function (e, t) {
var n, r, i = [],
o = [50],
a = 0,
s = function () {
n = e, r = u(n);
for (var a = []; t.length;) {
var s = c(t, r);
a.push({
host: s,
root: a.length ? !1 : !0,
timers: o,
countConnect: 0,
countConnectAll: 0
});
for (var l = [], f = 0; f < t.length; f++) t[f] != s && l.push(t[f]);
t = l
}
i = a
};
this.get = function () {
return i[a].host
}, this.sleep = function () {
return 0 === a && i[a].countConnectAll > 0 ? 50 : i[a].timers[i[a].countConnect]
}, this.next = function () {
i[a].countConnect == o.length - 1 ? (i[a].countConnect = 0, a++, a >= i.length && (a = 0)) : (i[a].countConnect++, i[a].countConnectAll++)
};
var c = function (e, t) {
var n = 4294967296,
r = {}, i = [],
o = 0,
a = 300,
s = e.length;
o = s * a;
for (var c = Math.round(n / o), u = 0, f = 0; n > f; f += c) e[u] && (r[f] = e[u], i.push(f)), s - 1 > u ? u++ : u = 0;
var d = l(i, t);
return r[d]
}, l = function (e, t) {
var n = e.length,
r = !1,
i = n - 1;
if (e[i] <= t && e[0] >= t ? r = t - e[i] < e[0] - t ? e[i] : e[0] : e[i] <= t ? r = e[i] : e[0] >= t && (r = e[0]), !r) {
i = Math.floor((n - 1) / 2);
for (var o = n - 1 - i;;) {
if (e[i] <= t && t <= e[i + 1]) {
Math.abs(t - e[i]) < Math.abs(e[i + 1] - t) ? r = e[i] : (r = e[i + 1], i += 1);
break
}
o = Math.floor(o / 2), o = o > 0 ? o : 1, t > e[i + 1] ? i += o : i -= o
}
}
var a = r;
return a
}, u = function (e) {
for (var t, n = f(e), r = -1, i = d(), o = 0, a = n.length; a > o; ++o) t = 255 & (r ^ n[o]), r = r >>> 8 ^ i[t];
return (-1 ^ r) >>> 0
}, f = function (e) {
for (var t, n = [], r = 0, i = e.length; i > r; ++r) t = e.charCodeAt(r), 128 > t ? n.push(t) : 2048 > t ? n.push(192 | t >> 6, 128 | 63 & t) : n.push(224 | t >> 12, 128 | 63 & t >> 6, 128 | 63 & t);
return n
}, d = function () {
for (var e, t, n = [], r = 0; 256 > r; ++r) {
for (t = r, e = 8; e--;) 1 == (1 & t) ? t = 3988292384 ^ t >>> 1 : t >>>= 1;
n[r] = t >>> 0
}
return n
};
s()
}
}(this.HC);
! function (e) {
e.ViewsAuthor = function (e, t, n, r) {
e.view.AuthorsTabView = n.View.extend({
template: "hc_content-author",
events: {
"click #hc_comments_more": "more_comments"
},
initialize: function () {
this.$el = r(t.tmpl(this.template, {})), e.collections.comments.unbind("reset"), e.collections.authors.bind("reset", this.add_all_authors, this), e.collections.comments.bind("reset", this.add_all_comments, this), e.collections.comments.bind("add", this.add_one_comment, this), this.active_author = 0
},
render: function () {
return this
},
add_one_author: function (t) {
e.views.AuthorView = new e.view.AuthorView({
model: t,
parent_model: this
}), this.$el.find("#hc_messages").append(e.views.AuthorView.render().$el)
},
add_all_authors: function () {
this.$el.find("#hc_messages").html(""), this.$el.find("#hc_pagin_more").html(""), e.collections.authors.each(this.add_one_author, this)
},
add_one_comment: function (t) {
if (!t.get("is_new")) {
e.views.CommentView = new e.view.CommentView({
model: t
}), t.get("state") && 1 != t.get("state") || t.get("t") || this.$el.find("#hc_messages").append(e.views.CommentView.render().$el);
var n = e.collections.authors.where({
acc_id: this.active_author
});
e.collections.comments.length == n[0].get("children") && this.$el.find("#hc_comments_more").remove()
}
},
add_all_comments: function () {
this.$el.find("#hc_messages").html(""), e.collections.comments.each(this.add_one_comment, this);
var t = e.collections.authors.where({
acc_id: this.active_author
});
t.length > 0 && t[0].get("count") > this.model.get("limit") && this.more_author_comments_render()
},
more_author_comments_render: function () {
this.$el.find("#hc_pagin_more").html(t.tmpl("hc_comments_more", {
count: ""
}))
},
more_comments: function (t) {
t.stopPropagation(), e.models.StreamInfo.set({
page: e.models.StreamInfo.get("page") + 1
}), e.writer.streamGetMessages("author", e.models.StreamInfo.get("page"), void 0, this.active_author)
}
}), e.view.AuthorView = n.View.extend({
template: "hc_author",
events: {
"click .e_hc_author": "show_comments_author"
},
initialize: function () {
this.$el = r(t.tmpl(this.template, this.model.toJSON()))
},
render: function () {
return this
},
show_comments_author: function () {
e.models.StreamInfo.set({
page_author: 0
}), e.writer.streamGetMessages("author", 0, void 0, this.model.get("acc_id")), this.options.parent_model.active_author = this.model.get("acc_id")
}
})
}
}(this.HC);
! function (e) {
e.ViewsBasic = function (e, t, n, i) {
e.view.AppBasicView = n.View.extend({
template: "hc_root",
tmpl_tab_comment: "hc_menu_tab_comments",
tmpl_tab_topics: "hc_menu_tab_topics",
tmpl_tab_authors: "hc_menu_tab_authors",
events: {
"click .e_hc_menu": "select_plugin",
"mouseover .e_hc_menu_options": "show_menu",
"mouseout .e_hc_menu_options": "hide_menu",
"click .e_hc_post_logout": "logout",
"click .e_hc_post_login": "login",
"click .e_hc_menu_hc": "toggle_hc",
"click .e_login_cl": "login",
"click .e_hc_get_filters": "get_filters",
"click .e_hc_filter": "select_filter",
"click .e_user_warning": "close_warning"
},
initialize: function () {
this.model.set({
tab: "comment"
}), e.views.AppBasicView || this.model.bind("change:tab", this.render_tab, this), this.model.bind("change:CSS_READY", this.css_ready, this), this.model.bind("change:readonly", this.readonly, this), this.options.hc ? this.render_hypercomments() : this.render(), this.options.auth_model.bind("change:acc_id", this.change_auth, this)
},
change_auth: function () {
if (this.model.get("hc_auth") || this.model.get("site_auth")) {
var n = this.$el.find(".e_hc_auth");
this.options.auth_model.get("acc_id") ? n.removeClass("e_hc_post_login").addClass("e_hc_post_logout").html(t._("Logout")) : n.removeClass("e_hc_post_logout").addClass("e_hc_post_login").html(t._("Login"))
} else this.$el.find(".e_hc_auth").remove();
this.model.get("guest_comments") || this.model.get("hc_auth") || this.options.auth_model.get("acc_id") || !this.model.get("site_auth") ? (this.$el.find(".e_must_login").important({
display: "none"
}), this.model.set({
readonly: !1
})) : (this.$el.find(".e_must_login").important({
display: "block"
}), e.views.MainForm.destroy_view(), this.model.set({
readonly: !0
}))
},
readonly: function () {
e.views.MainForm = new e.view.FormView({
main: !0
}), this.$el.find("#hc_main_form").html(e.views.MainForm.render().$el)
},
css_ready: function () {
this.$el.find(".hc_root").important({
display: "block"
}), this.model.get("plan") >= 3 && this.model.get("css") && t.addCSS(this.model.get("css"), function () {})
},
render: function () {
this.$el.append(t.tmpl(this.template, {})), this.model.get("CSS_READY") || this.$el.find(".hc_root").important({
display: "none"
}), e.views.FooterView = new e.view.FooterView({
model: this.model
}), this.$el.find(".hc_root").append(e.views.FooterView.render().$el), this.$el.find(".e_hc_menu_box").append(t.tmpl("hc_menu_options", {
widget: this.model.toJSON(),
auth: this.options.auth_model.toJSON()
})), this.$el.find(".e_hc_menu_box").append(t.tmpl(this.tmpl_tab_comment, {})), e.views.tab_comment = new e.view.CommentsTabView({
model: this.model,
auth_model: this.options.auth_model
});
var n = this.model.get("plugins"); - 1 != n.indexOf("topics") && this.$el.find(".e_hc_menu_box").append(t.tmpl(this.tmpl_tab_topics, {})), -1 != n.indexOf("authors") && this.$el.find(".e_hc_menu_box").append(t.tmpl(this.tmpl_tab_authors, {})), -1 != n.indexOf("like") && (e.views.LikesBaseView = new e.view.LikesBaseView, this.$el.find(".e_hc_top_block").append(e.views.LikesBaseView.render().$el)), -1 != n.indexOf("hypercomments") && this.$el.find(".e_hc_menu_hc").important({
display: "block"
}), this.model.get("category") && (this.$el.find(".e_hc_filter").last().addClass("hc_filter_last"), this.$el.find(".e_hc_select_filter").append(this.model.parseCategory("hc_filter_category"))), this.$el.find("#hc_container").html(e.views.tab_comment.render().$el), this.$el.find('.e_hc_filter[data-filter="' + this.model.get("default_filter") + '"] .e_hc_logo_selected').important({
display: "block"
})
},
render_hypercomments: function () {
e.views.tab_hc = new e.view.HCTabView({
model: this.model,
auth_model: this.options.auth_model
}), this.$el.html(e.views.tab_hc.render(this.options.topic_param).$el), this.options.topic_param.parent_id && e.writer.streamGetHcComments("all", 0, this.options.topic_param.parent_id)
},
render_tab: function () {
var t = this,
n = this.model.get("tab");
switch (n) {
case "comment":
e.views.tab_comment = new e.view.CommentsTabView({
model: this.model,
auth_model: this.options.auth_model
}), e.writer.streamGetMessages(this.model.get("default_filter"), 0);
break;
case "topic":
e.views.tab_topic = new e.view.TopicsTabView({
model: this.model,
auth_model: this.options.auth_model
}), 0 === e.collections.topics.length ? e.writer.streamGetTopics(100, 0) : e.views.tab_topic.add_all_topics();
break;
case "author":
e.views.tab_author = new e.view.AuthorsTabView({
model: this.model,
auth_model: this.options.auth_model
}), 0 === e.collections.authors.length ? e.writer.streamGetAuthors(100, 0) : e.views.tab_author.add_all_authors()
}
"context" !== n && (this.$el.find("#hc_container").html(e.views["tab_" + n].render().$el), this.$el.find(".e_hc_menu[data-menu=context]").remove()), setTimeout(function () {
t.$el.find("#hc_container").important({
"min-height": ""
})
}, 200)
},
recount_counter: function (e) {
var t = this.$el.find("#e_hc_counter_mes"),
n = parseInt(t.text().replace("(", "").replace(")", "") || 0, 10),
i = 0 > n + e ? 0 : n + e;
t.text("(" + i + ")")
},
online_render: function (e) {
this.$el.find(".hc_user_online").important({
display: "block"
}), this.$el.find(".e_hc_span_count").text(e.count);
var n = "";
i(e.data).map(function () {
n += t.tmpl("hc_avatar", this)
}), this.$el.find(".hc_top_block")[0].style.height = "27px", this.$el.find(".hc_top_block")[0].style["margin-bottom"] = "18px", this.$el.find(".e_hc_avatar_online").html(n)
},
select_plugin: function (t) {
t.stopPropagation();
var n = this.$el.find("#hc_container"),
r = n.height();
n.important({
"min-height": r + "px"
});
var o = t.target.getAttribute("data-menu"),
a = o ? i(t.target) : i(t.target).parent();
a.hasClass("e_hc_select_filter") || (o = o || "comment", "comment" === o && "comment" === this.model.get("tab") && this.$el.find(".e_hc_get_filters").click(), this.$el.find(".e_hc_menu").removeClass("hc_menu_active"), a.addClass("hc_menu_active"), this.model.set({
tab: o
}), e.models.StreamInfo.set({
page: 0
}))
},
get_filters: function (e) {
e.stopPropagation(), this.$el.find(".e_hc_select_filter").important({
display: "block"
}), this.$el.find(".e_hc_logo_selected").important({
display: "none"
}), "category" != this.model.get("current_filter") ? this.$el.find('.e_hc_filter[data-filter="' + this.model.get("current_filter") + '"] .e_hc_logo_selected').important({
display: "block"
}) : this.$el.find('.e_hc_filter[data-catid="' + this.model.get("current_catid") + '"] .e_hc_logo_selected').important({
display: "block"
});
var t;
t = function (e) {
i(e.target).hasClass("e_hc_get_filters") || (i(".e_hc_select_filter").important({
display: "none"
}), i("body").off("click", t))
}, i("body").bind("click", t)
},
select_filter: function (t) {
if (i(".e_hc_select_filter").important({
display: "none"
}), "comment" == this.model.get("tab")) {
var n = t.target.getAttribute("data-filter"),
r = t.target.getAttribute("data-catid");
e.views.tab_comment.select_filter(n, r)
}
},
show_menu: function (e) {
e.stopPropagation(), this.$el.find(".e_hc_menu_opt").important({
display: "block"
})
},
hide_menu: function (e) {
e.stopPropagation(), this.$el.find(".e_hc_menu_opt").important({
display: "none"
})
},
logout: function () {
e.socket.api("/logout", void 0, function () {})
},
login: function () {
e.views.AuthView = new e.view.AuthView({
model: this.model,
action: "login"
}), e.views.AuthView.render_auth()
},
toggle_hc: function (t) {
if (!i(t.target).hasClass("e_hc_checkbox")) {
var n = this.$el.find(".e_hc_checkbox");
n.click();
var r;
r = "*" == e.models.WidgetSettings.get("hypertext") ? "body" : e.models.WidgetSettings.get("hypertext");
var o = i(r + " .hypertext_counter_span"),
a = i(r + " .event_hypertext");
o.is(":visible") ? (o.important({
display: "none"
}), a.removeClass("hypertext_span_selected"), a.removeAttr("style"), a.parent().addClass("hc_span_hide")) : (o.important({
display: "inline"
}), a.addClass("hypertext_span_selected"), a.attr("style", "background-color:" + e.models.WidgetSettings.get("hypertext_color")), a.parent().removeClass("hc_span_hide"))
}
},
show_user_warning: function (e) {
var n = this;
this.show_background(), this.$el.find(".hc_root").append(t.tmpl("user_warning", e));
var r;
r = function (e) {
i(e.target).parents(".e_user_warning").size() > 0 || (n.$el.find(".e_user_warning").remove(), n.hide_background(), i("body").off("click", r))
}, i("body").bind("click", r)
},
close_warning: function () {
this.hide_background(), this.$el.find(".e_user_warning").remove()
},
show_background: function () {
this.$el.find(".hc_root").append(t.tmpl("background", {}))
},
hide_background: function () {
this.$el.find(".hc_hide_background").remove()
},
render_context: function () {
this.$el.find(".e_hc_menu_box").append(t.tmpl("hc_menu_tab_context", {})), this.$el.find(".e_hc_menu").removeClass("hc_menu_active"), this.$el.find(".e_hc_menu[data-menu=context]").addClass("hc_menu_active"), this.$el.find("#hc_messages").html(""), this.$el.find("#hc_pagin_more").remove(), this.$el.find("#hc_main_form").remove(), this.model.set({
tab: "context"
})
}
}), e.view.FooterView = n.View.extend({
template: "hc_footer",
events: {
"click .e_hc_email_subsc": "show_input",
"keyup .e_hc_subsc_input": "email_subscribe"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, this.model.toJSON()))
},
render: function () {
return this
},
rss: function () {
var n = "http://" + t.FRONT_SERVERS[0] + "/rss/" + this.model.get("widget_id") + "/" + e.models.StreamInfo.get("stream_id");
this.$el.find(".e_hc_wrap_rss").append(t.tmpl("hc_rss", {
link: n
}))
},
render_email: function (e) {
t.fromStorage("hc_email_subscribe_" + e) && this.$el.find(".e_hc_email_subsc").addClass("hc_subsc_ok")
},
show_input: function () {
var n = this.$el.find(".e_hc_email_subsc");
if (!n.hasClass("hc_subsc_ok")) {
var r = this.$el.find(".e_hc_box_subsc");
r.addClass("hc_box_subsc_show"), this.$el.find(".e_hc_subsc_input").select();
var o = function (e) {
i(e.target).parents(".e_hc_box_subsc").size() > 0 || r.removeClass("hc_box_subsc_show")
};
return i("body").bind("click", o), !1
}
n.removeClass("hc_subsc_ok");
var a = e.models.StreamInfo.get("stream_id");
e.writer.streamEmailUnsubscribe(t.fromStorage("hc_email_subscribe_" + a)), t.delStorage("hc_email_subscribe_" + a)
},
email_subscribe: function (n) {
if (13 == n.keyCode) {
var i = this.$el.find(".e_hc_subsc_input"),
r = i.val();
if (!t.validateEmail(r)) return i.addClass("hc_subsc_error"), void 0;
i.removeClass("hc_subsc_error"), this.$el.find(".e_hc_box_subsc").removeClass("hc_box_subsc_show"), this.$el.find(".e_hc_email_subsc").addClass("hc_subsc_ok"), e.writer.streamEmailSubscribe(r, t.LANGUAGE);
var o = e.models.StreamInfo.get("stream_id");
t.toStorage("hc_email_subscribe_" + o, r)
}
}
}), e.view.FormView = n.View.extend({
template: "hc_reply_form",
initialize: function () {
this.$el = i(t.tmpl(this.template, {
me: e.models.UserAuth.toJSON(),
config: e.models.WidgetSettings.toJSON()
})), this.options.main === !0 && this.$el.addClass("hc_main_form"), e.models.UserAuth.bind("change:acc_id", this.change_auth, this), this.files_data = []
},
events: {
"focus textarea": "focusForm",
"keyup textarea": "resizeForm",
"click .e_hc_reply_button": "sendComment",
"click .e_hc_close_reply": "closeForm",
"click .e_hc_attach": "attach",
"click .e_hc_image_smile": "add_smile",
"change .e_media_upload": "upload_file",
"click .e_hc_attach_file_drop": "drop_media",
"click .e_hc_category": "show_category",
"click .e_select_cat": "select_cat",
"webkitspeechchange .e_hc_speech_in": "speach"
},
render: function () {
return e.models.WidgetSettings.get("category") && this.$el.find(".e_hc_select_cat_ul").append(e.models.WidgetSettings.parseCategory("opt_category")), this
},
set_topic_param: function (e) {
this.topic_text = e.text, this.topic_parent_id = e.parent_id, this.topic_param = JSON.stringify(e), this.topic_parent_id || this.$el.find("textarea").focusin()
},
delete_topic_param: function (e) {
this.topic_text = null, this.topic_parent_id = e
},
focusForm: function (t) {
var n = this;
this.$el.hasClass("hc_reply_form_active") || (this.change_auth(), this.$el.addClass("hc_reply_form_active"), i(t.target).addClass("hc_reply_textarea_active"), this.topic_param && e.views.tab_hc.resize("show")), setTimeout(function () {
i("body").bind("click", function (e) {
var t = i(e.target),
r = n.$el;
r.hasClass("hc_main_form") || "" === r.find(".e_hc_attach_files").html() && "" === r.find("textarea").val() && 0 === t.parents(".hc_reply_form").size() && 0 === t.parents(".e_hc_popup_box").size() && (r.parent().removeClass("hc_reply_form_box_active"), r.remove())
})
}, 100)
},
resizeForm: function (e) {
var t = i(e.target),
n = t[0].scrollHeight < 68 ? 68 : t[0].scrollHeight;
520 > n ? t.important({
height: n - 18 + "px",
"overflow-y": "hidden"
}) : t.important({
height: "520px",
"overflow-y": "scroll"
}), t.val().length > 0 ? this.$el.find(".e_hc_close_reply").important({
display: "none"
}) : this.$el.find(".e_hc_close_reply").important({
display: "block"
})
},
closeForm: function () {
if ("" === this.$el.find("textarea").val()) {
if (this.$el.removeClass("hc_reply_form_active"), this.$el.hasClass("hc_main_form")) this.$el.find("textarea").removeClass("hc_reply_textarea_active");
else {
var t = this.$el;
t.animate({
height: 1,
opacity: 0
}, 500, function () {
t.remove()
})
}
this.$el.find("textarea").removeAttr("style"), this.$el.find(".e_hc_close_reply").removeAttr("style"), this.topic_param && e.views.tab_hc.resize("hide")
}
},
attach: function (n) {
n.stopPropagation();
var r = n.target.getAttribute("data-type");
r || (r = i(n.target).parent().attr("data-type")), "smile" === r ? this.$el.find(".e_hc_box_smile").append(t.tmpl("hc_attach_smile", {})) : "clip" === r ? this.$el.find(".e_hc_box_attach").append(t.tmpl("hc_attach_clip", e.models.WidgetSettings.toJSON())) : "image" == r || ("video" == r ? (e.views.VideoView = new e.view.VideoView({
form_model: this
}), e.views.VideoView.render_popup()) : "presentation" == r && (e.views.PresentationView = new e.view.PresentationView({
form_model: this
}), e.views.PresentationView.render_popup()));
var o;
o = function (e) {
i(e.target).hasClass("e_hc_attach") || (i(".e_hc_attach_smile_box").remove(), i(".e_hc_attach_clip_box").remove(), i("body").off("click", o))
}, i("body").bind("click", o)
},
form_embed: function (n) {
var i, r, o, a = [];
if ("youtube" == n.type) i = t.tmpl("hc_attach_file", {
preview: n.preview
}), a.push(i), this.files_data.push({
type: "video",
service: n.type,
href: n.videocode
});
else if ("presentation" == n.type) i = t.tmpl("hc_attach_file", {
preview: n.preview
}), a.push(i), this.files_data.push({
type: "presentation",
service: "google",
href: n.code
});
else
for (r = 0; r < n.length; r++) i = t.tmpl("hc_attach_file", {
preview: n[r].preview
}), a.push(i), this.files_data.push({
type: "images",
service: "internet",
href: n[r].preview
});
for (o = 0; o < a.length; o++) this.$el.find(".e_hc_attach_files").append(a[o]);
this.$el.find(".e_hc_attach_files").important({
display: "block"
}), this.$el.addClass("hc_reply_form_active"), this.$el.find("textarea").addClass("hc_reply_textarea_active"), this.topic_param && e.views.tab_hc.resize("attach")
},
add_smile: function (e) {
e.stopPropagation();
var n = this.$el.find("textarea"),
i = e.target.getAttribute("data-text"),
r = n.val() + i;
n.val(r).focus(), t.setCursorPosition(n[0], r.length)
},
sendComment: function () {
var n, r, o, a, s, c = this,
l = this.$el.find("textarea"),
u = l.val();
if (this.options.comment ? (n = this.options.comment.get("root_id") || this.options.comment.get("parent_id") || this.options.comment.get("id"), r = this.options.comment.get("id")) : this.topic_parent_id && (n = r = this.topic_parent_id), this.files_data && this.files_data.length && (s = JSON.stringify(this.files_data)), 0 === i.trim(u).length && 0 === this.files_data.length) {
var d = l.attr("placeholder");
return l.attr("placeholder", t._("Enter your message before sending")), setTimeout(function () {
l.attr("placeholder", d)
}, 3e3), void 0
}
if (e.models.WidgetSettings.get("comment_length") && i.trim(u).length > e.models.WidgetSettings.get("comment_length")) return t.notify(t._("comment_length")), void 0;
if (!e.models.UserAuth.get("acc_id")) {
if (!e.models.UserAuth.get("guestNick") || !e.models.WidgetSettings.get("guest_comments")) {
e.views.AuthView = new e.view.AuthView({
model: e.models.WidgetSettings,
action: "send_comment"
});
var h = function () {
c.$el.find(".e_hc_reply_button").click(), e.views.AppBasicView.hide_background()
};
return e.views.AuthView.set_auth_callback(h), e.views.AuthView.render_auth(), void 0
}
o = e.models.UserAuth.get("guestNick"), e.models.UserAuth.get("guestEmail") && t.validateEmail(e.models.UserAuth.get("guestEmail")) && (a = e.models.UserAuth.get("guestEmail"))
}
var f;
e.models.WidgetSettings.get("category") && this.select_category && (f = parseInt(this.select_category, 10));
var p = e.models.UserAuth.get("acc_id") && this.$el.find(".e_hc_crossposting [rel=button]").is(":checked") ? !0 : void 0,
m = this.getSocial(p, e.models.UserAuth.get("account_type")),
g = e.collections.hypercomments.where({
id: n
});
hc_comment = g.length > 0 ? !0 : void 0, this.topic_param && this.topic_text ? e.writer.streamAddTopic(u, this.topic_text, this.topic_param, s, o, a, hc_comment, p, m, f) : e.writer.streamAddMessage(n, r, u, s, o, a, hc_comment, p, m, f), l.val(""), this.$el.find(".e_hc_attach_files").html("").important({
display: "none"
}), this.files_data = [], this.$el.find(".e_hc_close_reply").click(), l.removeAttr("style"), this.$el.hasClass("hc_main_form") || this.$el.fadeOut(function () {
c.$el.remove()
})
},
onMessage: function (e, t) {
var n = JSON.parse(e.data);
if ("error" != n.result) {
var i = [];
i.push({
type: "images",
preview: n.href
}), t.form_embed(i)
} else alert("ERROR upload")
},
upload_file: function () {
var t = this,
n = /(\.png|\.gif|\.jpg|\.jpeg|\.GIF|\.JPG|\.PNG|\.JPEG)$/;
if (n.test(this.$el.find(".e_media_upload").val())) {
var i = (new Date).getTime(),
r = '<iframe style="display:none" name="upload_' + i + '"></iframe>';
e.views.AppBasicView.$el.append(r), this.$el.find(".e_hc_target").attr("target", "upload_" + i), this.$el.find("#hc_form_send").attr("target", "upload_" + i).submit();
var o = function (e) {
t.onMessage(e, t), window.removeEventListener ? window.removeEventListener("message", o) : window.detachEvent("onmessage", o)
};
window.addEventListener ? window.addEventListener("message", o, !1) : window.attachEvent("onmessage", o)
}
},
drop_media: function (e) {
e.stopPropagation();
var t = i(e.target).parents(".e_hc_attach_file"),
n = this.$el.find(".e_hc_attach_files"),
r = this.$el.find(".e_hc_attach_file"),
o = r.index(t);
t.fadeOut("slow", function () {
t.remove(), n.children().size() || n.important({
display: "none"
})
}), this.files_data.splice(o, 1)
},
getSocial: function (e, t) {
if (!e) return void 0;
switch (t) {
case 1:
return "google";
case 2:
return "facebook";
case 3:
return "twitter";
case 4:
return "vkontakte";
case 4:
return "odnoklassniki";
case 6:
return "mailru"
}
},
change_auth: function () {
var t = [];
t[1] = "g", t[2] = "fb", t[3] = "tw", t[4] = "vk", t[5] = "odnoklassniki", t[6] = "mailru", t[8] = "openid";
var n = e.models.UserAuth.get("account_type");
if (this.$el.find(".e_hc_avatar").attr("src", e.models.UserAuth.get("avatar_src")), !e.models.UserAuth.get("acc_id") || !n) return this.$el.find(".e_hc_crossposting").important({
display: "none"
}), this.$el.find(".e_hc_acc_type").important({
display: "none"
}), void 0;
for (var i = 1; i < t.length; i++) this.$el.find(".e_hc_acc_type").removeClass("hc_acc_" + t[i] + "_icon");
this.$el.find(".e_hc_acc_type").addClass("hc_acc_" + t[n] + "_icon").fadeIn();
var r = this.$el.find(".e_hc_crossposting");
e.models.WidgetSettings.get("crossposting") ? r.find("input").attr("checked", !0) : r.find("input").attr("checked", !1), 2 == n && r.important({
display: "block"
}).find("[rel=service]").html("Facebook"), 3 == n && r.important({
display: "block"
}).find("[rel=service]").html("Twitter"), 4 == n && r.important({
display: "block"
}).find("[rel=service]").html("Vkontakte"), 6 == n && r.important({
display: "block"
}).find("[rel=service]").html("MailRu")
},
show_category: function (e) {
e.stopPropagation();
var t = this;
this.$el.find(".e_hc_select_cat_ul").important({
display: "block"
});
var n;
n = function (e) {
i(e.target).hasClass("e_hc_category") || (t.$el.find(".e_hc_select_cat_ul").important({
display: "none"
}), i("body").off("click", n))
}, i("body").bind("click", n)
},
select_cat: function (e) {
e.stopPropagation();
var t = i(e.target).attr("data-id");
this.$el.find(".e_name_cat").text(i(e.target).text()), this.$el.find(".e_hc_select_cat_ul").important({
display: "none"
}), this.select_category = t
},
speach: function (e) {
this.$el.find("textarea").val(i(e.target).val())
},
destroy_view: function () {
this.remove(), this.unbind()
}
})
}
}(this.HC);
! function (e) {
e.ViewsComment = function (e, t, n, i) {
e.view.CommentsTabView = n.View.extend({
template: "hc_content-comment",
events: {
"click .e_hc_filter": "select_filter",
"click #hc_comments_more": "more_comments",
"click .e_hc_page": "load_page_comment",
"click .e_hc_realtime_top": "show_rt"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, {})), this.model.set({
current_filter: this.model.get("default_filter")
}), e.collections.comments.unbind(), e.collections.comments.bind("reset", this.add_all_comments, this), e.collections.comments.bind("add", this.addOneNewComment, this), e.collections.comments.hc.bind("add", this.addOneNewComment, this)
},
render: function () {
return e.views.MainForm = new e.view.FormView({
main: !0
}), this.$el.find("#hc_main_form").html(e.views.MainForm.render().$el), e.models.StreamInfo && this.render_more_or_pagin(), this
},
render_access_denied: function () {
var e = i(t.tmpl("hc_access_denied", {}));
e.important({
display: "none"
}), this.$el.find("#hc_messages").prepend(e), e.slideDown("slow")
},
addOneNewComment: function (n) {
if (!n.get("is_new")) return this.addOneComment(n), void 0;
if ("context" != e.models.WidgetSettings.get("tab")) {
var r = n.get("parent_id"),
o = this.model.get("comments_level"),
s = this.$el.find("#hc_message_" + r),
a = e.collections.comments.where({
id: r
});
if (a.length > 0) {
var c = a[0].get("nick");
n.setParentNick(c)
}
var l = this.model.get("current_filter");
if (e.views.CommentView = new e.view.CommentView({
model: n
}), "all" == l ? r && this.$el.find("#hc_message_" + r).size() > 0 ? s.parents(".hc_message").size() < o ? this.$el.find("#hc_message_" + r).append(e.views.CommentView.render().$el) : s.parent().append(e.views.CommentView.render().$el) : this.$el.find("#hc_messages").prepend(e.views.CommentView.render().$el) : n.get("is_resp") && r ? s.parents(".hc_message").size() < o ? this.$el.find("#hc_message_" + r).append(e.views.CommentView.render().$el) : s.parent().append(e.views.CommentView.render().$el) : this.$el.find("#hc_messages").prepend(e.views.CommentView.render().$el), !this.model.get("realtime") && !n.get("is_resp")) {
var u;
e.views.CommentView.render().$el.important({
display: "none"
});
var d = this.$el.find("#hc_message_" + n.get("root_id"));
r && d.is(":visible") && "all" == l ? r && this.get_visible_parent(r, n.get("id")) : 0 === this.$el.find(".e_hc_realtime_top").size() ? this.$el.find("#hc_rt_box").html(t.tmpl("hc_realtime_top", {
count: 1
})) : (u = this.$el.find(".e_hc_rt_counter"), u.html(parseInt(u.html(), 10) + 1))
}
if ("new" != l && !n.get("is_resp")) {
var h = this.$el.find(".e_hc_filter[data-filter=new] span"),
p = h.html();
p = "" === p ? 0 : parseInt(p, 10), h.html("+" + (p + 1))
}
if (n.get("hc_comment")) {
var f = i("#hc_post_" + n.get("root_id") + " .hypertext_counter_span");
if (!f.size()) return;
var m = f.text(),
g = parseInt(m, 10),
_ = g + 1;
f.text(_)
}
e.views.AppBasicView.recount_counter(1)
}
},
get_visible_parent: function (n, i) {
if (n) {
var r = this.$el.find("#hc_message_" + n);
if (r.is(":visible")) {
var o = r.find("#hc_rt_box_" + n);
if (0 === r.find("#hc_rt_" + n).size()) o.html(t.tmpl("hc_realtime_reply", {
count: 1,
id: n
})), o.data("ids", i), r.find("#hc_rt_line_" + n).addClass("hc_rt_line_active");
else {
cb = r.find("#hc_rt_counter_" + n), cb.html(parseInt(cb.html(), 10) + 1);
var s = o.data("ids");
o.data("ids", s + "," + i)
}
} else {
var a = e.collections.comments.where({
id: n
});
a.length > 0 && this.get_visible_parent(a[0].get("parent_id"), i)
}
}
},
addOneComment: function (t) {
t.set({
is_new: !1
});
var n = t.get("parent_id"),
i = this.model.get("comments_level"),
r = this.$el.find("#hc_message_" + n),
o = e.collections.comments.where({
id: n
});
if (o.length > 0) {
var s = o[0].get("nick");
t.setParentNick(s)
}
e.views.CommentView = new e.view.CommentView({
model: t
});
var a = this.model.get("current_filter");
this.model.get("tab"), "all" == a ? t.get("state") && 1 != t.get("state") ? (t.get("children") && t.get("children") > 0 || t.get("reason_del")) && (n ? r.parents(".hc_message").size() < i ? this.$el.find("#hc_message_" + n).append(e.views.CommentView.render().$el) : r.parent().append(e.views.CommentView.render().$el) : this.$el.find("#hc_messages").append(e.views.CommentView.render().$el)) : n && this.$el.find("#hc_message_" + n).size() > 0 ? r.parents(".hc_message").size() < i ? this.$el.find("#hc_message_" + n).append(e.views.CommentView.render().$el) : r.parent().append(e.views.CommentView.render().$el) : this.$el.find("#hc_messages").append(e.views.CommentView.render().$el) : t.get("state") && 1 != t.get("state") || t.get("t") || this.$el.find("#hc_messages").append(e.views.CommentView.render().$el)
},
add_all_comments: function () {
var t = this;
e.collections.comments.each(this.addOneComment, this), setTimeout(function () {
t.$el.find("#hc_messages").important({
"min-height": ""
})
}, 50)
},
select_filter: function (t, n) {
this.model.set({
current_filter: t
}), this.model.set({
current_catid: n
});
var i = this.$el.find("#hc_messages"),
r = i.height();
i.important({
"min-height": r + "px"
}), i.html(""), e.models.StreamInfo.set({
page: 0
}), "category" == t ? (e.writer.streamGetMessages(t, 0, void 0, void 0, parseInt(n, 10)), this.more_render(), this.$el.find("#hc_more_count").html("")) : (e.writer.streamGetMessages(t, 0), this.render_more_or_pagin()), this.$el.find(".e_hc_realtime_top").remove()
},
recount_more_button: function () {
var t = this.model.get("current_filter"),
n = "all" == t ? e.collections.comments.where({
state: 1
}) : e.collections.comments,
i = e.models.StreamInfo.get("cm2") - e.models.StreamInfo.get("hc") - n.length;
i > 0 ? this.$el.find("#hc_more_count").text(i) : this.$el.find("#hc_comments_more").remove()
},
render_more_or_pagin: function () {
this.model.get("pagination") ? this.pagination_render() : this.more_render()
},
more_render: function () {
e.models.StreamInfo.get("cm2") < this.model.get("limit") || (this.$el.find("#hc_pagin_more").html(t.tmpl("hc_comments_more", {
count: ""
})), this.recount_more_button())
},
pagination_render: function () {
var n = e.models.StreamInfo.get("cm2") - e.models.StreamInfo.get("hc"),
i = this.model.get("current_filter"),
r = e.models.StreamInfo.get("page") || 0;
this.$el.find("#hc_pagin_more").html(t.tmpl("hc_pagination", {}));
var o, s = this.$el.find("#hc_pagination");
if ("category" !== i) {
if (o = "all" === i ? Math.ceil(e.models.StreamInfo.get("cm") / this.model.get("limit")) : Math.ceil(n / this.model.get("limit")), this.model.set({
total_page: o
}), o > 1) {
s.html("");
var a = t.tmpl("hc_pagination_list", {
page: 1,
text: "&laquo; " + t._("First"),
class_type: "e_both hc_first_page"
});
s.append(a), r > 0 ? this.$el.find(".hc_first_page").removeClass("hc_hide") : this.$el.find(".hc_first_page").addClass("hc_hide");
for (var c = r > 3 ? r - 3 : 0, l = o > 7 ? c + 7 : o, u = c; l > u; u++) {
var d;
d = u === e.models.StreamInfo.get("page") ? t.tmpl("hc_pagination_list", {
page: u + 1,
text: u + 1,
class_type: "hc_page_active"
}) : t.tmpl("hc_pagination_list", {
page: u + 1,
text: u + 1,
class_type: ""
}), s.append(d)
}
var h = t.tmpl("hc_pagination_list", {
page: o,
text: t._("Last") + " &raquo;",
class_type: "e_both hc_last_page"
});
s.append(h), r == o ? this.$el.find(".hc_last_page").addClass("hc_hide") : this.$el.find(".hc_last_page").removeClass("hc_hide"), "ar" == t.LANGUAGE && this.$el.find(".hc_first_page").after(this.$el.find(".e_hc_page").not(".e_both").get().reverse())
}
} else this.$el.find("#hc_pagin_more").html(t.tmpl("hc_comments_more", {}))
},
more_comments: function () {
var t = this.model.get("current_filter"),
n = e.models.StreamInfo.get("page") + 1;
e.writer.streamGetMessages(t, n), e.models.StreamInfo.set({
page: n
})
},
load_page_comment: function (n) {
n.stopPropagation();
var r = this.$el.find("#hc_messages");
this.$el.find(".e_hc_page").removeClass("hc_page_active").important({
display: "inline"
});
var o = n.target.getAttribute("data-page"),
s = this.model.get("current_filter"),
a = this.$el.find(".hc_first_page"),
c = this.$el.find(".hc_last_page");
o > 1 ? a.important({
display: "inline"
}) : a.important({
display: "none"
}), o == e.models.WidgetSettings.get("total_page") ? c.important({
display: "none"
}) : c.important({
display: "inline"
});
var l = 4 >= o ? 1 : o - 3;
this.$el.find(".e_hc_page").not(".e_both").map(function () {
l == o && i(this).addClass("hc_page_active"), i(this).attr("data-page", l), i(this).text(l), l++, l > e.models.WidgetSettings.get("total_page") + 1 && i(this).important({
display: "none"
})
}), e.models.StreamInfo.set({
page: parseInt(o, 10) - 1
});
var u, d = this.$el.offset().top;
return i("body, html").animate({
scrollTop: d
}, function () {
if (!u) {
u = !0;
var t = r.height();
r.important({
"min-height": t + "px"
}), r.html("");
var n = o - 1;
e.writer.streamGetMessages(s, n)
}
}), "ar" == t.LANGUAGE && this.$el.find(".hc_first_page").after(this.$el.find(".e_hc_page").not(".e_both").get().reverse()), !1
},
show_rt: function () {
var e = this.$el.find(".e_hc_rt_counter").text();
this.$el.find(".hc_message:lt(" + parseInt(e, 10) + ")").important({
display: "block"
}), this.$el.find(".hc_message:lt(" + parseInt(e, 10) + ") .hc_lf_indicator").addClass("hc_lf_indicator_active"), this.$el.find(".e_hc_realtime_top").remove()
}
}), e.view.CommentView = n.View.extend({
template: "hc_message",
tmpl_delete: "message_delete",
events: {
"click .e_hc_reply_link": "reply",
"click .e_hc_vote": "vote",
"mouseover .e_comments_message": "show_options",
"mouseout .e_comments_message": "hide_options",
"click .e_moderate_box": "moderate_box_show",
"click .e_hc_delete": "delete_comment",
"click .e_hc_spam": "spam_comment",
"click .e_hc_user_spam": "user_spam",
"click .e_hc_blacklist": "to_blacklist",
"click .e_hc_edit": "edit_comment",
"click .e_hc_edit_cancel": "cancel_edit",
"click .e_hc_edit_save": "save_edit",
"keyup .e_hc_edit_textarea": "keyup_edit_form",
"click .e_hc_get_mes_link": "get_link",
"click .event_watch": "watch_video",
"click .event_show_presentation": "show_present",
"click .e_hc_quote_ht": "to_hc",
"click .e_hc_complain": "complain",
"click .e_hc_send_complain": "complain_send",
"click .e_hc_show_quote": "show_quote",
"click .e_hc_parent_nick": "scroll_to_mes",
"click .e_hc_rt_reply": "show_reply",
"click .e_hc_context": "get_context"
},
initialize: function () {
this.model.bind("change:vote", this.vote_render, this), this.model.bind("change:state", this.del_render, this), this.model.bind("change:text", this.text_render, this), this.model.bind("change:date", this.date_render, this), this.model.bind("change:readonly", this.readonly_render, this);
var n, r = this;
n = this.model.get("state") && 1 != this.model.get("state") && 2 != this.model.get("state") ? i(t.tmpl(this.tmpl_delete, this.model.toJSON())) : i(t.tmpl(this.template, this.model.toJSON())), this.$el = n, setInterval(function () {
r.model.set({
date: t.timeAgo(r.model.get("time"))
})
}, 6e4), e.models.WidgetSettings.get("realtime") || setInterval(function () {
r.$el.find(".hc_lf_indicator_active").removeClass("hc_lf_indicator_active")
}, 15e3), e.models.WidgetSettings.bind("change:readonly", function () {
r.model.set({
readonly: e.models.WidgetSettings.get("readonly")
})
}, this)
},
render: function () {
return this
},
vote_render: function () {
var e = this.$el.find(".e_hc_voting").eq(0);
this.model.get("vote") > 0 ? e.removeClass("hc_voting_minus").addClass("hc_voting_plus") : e.removeClass("hc_voting_plus").addClass("hc_voting_minus"), e.html(this.model.get("vote"))
},
del_render: function () {
var e = t.tmpl("message_remove", this.model.toJSON());
this.$el.find(".e_comments_message").first().fadeOut("fast", function () {
i(this).html(e).fadeIn("slow")
}), this.$el.find(".e_hc_avatar").first().attr("src", t.CDN_HOST + "/data/avatars/0/avatar")
},
text_render: function () {
this.$el.find(".e_hc_text").first().html(this.model.get("text"))
},
date_render: function () {
this.$el.find(".e_comments_time").html(this.model.get("date"))
},
readonly_render: function () {
this.$el.find(".hc_com_manager").html(t.tmpl("hc_com_manager", this.model.toJSON()))
},
reply: function (t) {
t.stopPropagation(), e.views.ReplyForm = new e.view.FormView({
comment: this.model
});
var n = this.$el.find(".e_hc_reply_form").eq(0);
n.addClass("hc_reply_form_box_active").html(e.views.ReplyForm.render().$el), this.$el.find("textarea").focus()
},
show_options: function (t) {
t.stopPropagation(), this.model.get("t") || (this.model.get("acc_id") && this.model.get("acc_id") == e.models.UserAuth.get("acc_id") || this.$el.find(".e_hc_vote:lt(2)").important({
display: "block"
}), this.$el.find(".e_moderate_box").eq(0).important({
display: "block"
}), this.$el.find(".e_hc_get_mes_link:lt(1)").important({
display: "block"
}))
},
hide_options: function (e) {
e.stopPropagation(), this.$el.find(".e_hc_vote:lt(2)").important({
display: "none"
}), this.$el.find(".e_moderate_box").eq(0).important({
display: "none"
}), this.$el.find(".e_hc_get_mes_link:lt(1)").important({
display: "none"
})
},
vote: function (t) {
t.stopPropagation();
var n = t.target.getAttribute("data-vote");
if (!e.models.UserAuth.get("acc_id")) {
e.views.AuthView = new e.view.AuthView({
model: e.models.WidgetSettings,
action: "login"
});
var r = function () {
i(t.target).click()
};
return e.views.AuthView.set_auth_callback(r), e.views.AuthView.render_auth(), void 0
}
e.writer.streamVoteMessage(this.model.get("id"), n, this.model.get("acc_id"))
},
moderate_box_show: function (n) {
var r = this;
n.stopPropagation(), this.$el.find(".dropdawn_menu").remove();
var o = e.models.WidgetSettings.get("widget_id"),
s = e.models.StreamInfo.get("stream_id"),
a = t.HOST + "/comments#search/" + o + "_" + s + "_" + this.model.get("id");
e.models.UserAuth.get("moderator") ? this.$el.find(".e_moderate_box").append(t.tmpl("hc_moderate_box", {
url: a
})) : this.$el.find(".e_moderate_box").append(t.tmpl("hc_user_moderate_box", {}));
var c;
c = function (e) {
"moderate_box e_moderate_box" != i(e.target).attr("class") && (r.$el.find(".e_hc_dropdawn_menu").remove(), i("body").off("click", c))
}, i("body").bind("click", c)
},
delete_comment: function (t) {
t.stopPropagation(), e.writer.streamDeleteMessage(this.model.get("id"))
},
spam_comment: function (t) {
t.stopPropagation(t), e.writer.streamSpamMessage(this.model.get("id"))
},
user_spam: function (n) {
n.stopPropagation(n);
var i = this;
if (!e.models.UserAuth.get("acc_id")) {
e.views.AuthView = new e.view.AuthView({
model: e.models.WidgetSettings,
action: "login"
});
var r = function () {
i.$el.find(".e_hc_user_spam").click()
};
return e.views.AuthView.set_auth_callback(r), e.views.AuthView.render_auth(), void 0
}
e.writer.streamUserSpamMessage(this.model.get("id")), t.notify(t._("complain_send"))
},
complain: function (n) {
n.stopPropagation();
var r = this;
e.views.AppBasicView.show_background(), this.$el.append(t.tmpl("hc_complain", {
comment: this.model.toJSON(),
auth: e.models.UserAuth.toJSON()
}));
var o;
o = function (t) {
i(t.target).parents(".e_hc_complain_box").size() > 0 && !i(t.target).hasClass("e_hc_complain_close") || (r.$el.find(".e_hc_complain_box").remove(), e.views.AppBasicView.hide_background(), i("body").off("click", o))
}, i("body").bind("click", o)
},
complain_send: function (n) {
n.stopPropagation();
var i = this.$el.find(".e_hc_complain_textarea"),
r = i.val();
if (0 === r.length) return i.attr("placeholder", t._("Enter your message before sending")), void 0;
var o = this.$el.find(".e_hc_complain_box");
if (!e.models.UserAuth.get("acc_id")) {
o.important({
display: "none"
}), e.views.AuthView = new e.view.AuthView({
model: e.models.WidgetSettings,
action: "login"
});
var s = function () {
o.find(".e_hc_send_complain").click()
};
return e.views.AuthView.set_auth_callback(s), e.views.AuthView.render_auth(), void 0
}
e.writer.streamAddComplain(this.model.get("id"), r), o.remove(), e.views.AppBasicView.hide_background(), t.notify(t._("complain_send"))
},
to_blacklist: function (t) {
t.stopPropagation(t), e.writer.streamChangeAccess(this.model.get("id"), 1)
},
edit_comment: function (e) {
e.stopPropagation(e), this.$el.find(".e_hc_text").first().html(t.tmpl("hc_edit_message", {
text: this.model.get("edit_text")
}));
var n = this.$el.find(".e_hc_edit_textarea"),
i = n[0].scrollHeight < 68 ? 68 : n[0].scrollHeight;
n.important({
height: i - 18 + "px"
})
},
cancel_edit: function (e) {
e.stopPropagation(e), this.$el.find(".e_hc_text").html(this.model.get("text"))
},
keyup_edit_form: function (e) {
e.stopPropagation(e);
var t = i(e.target),
n = t[0].scrollHeight < 68 ? 68 : t[0].scrollHeight;
t.important({
height: n - 18 + "px"
})
},
save_edit: function (t) {
t.stopPropagation(t);
var n = this.$el.find(".e_hc_edit_textarea").val();
n.length > 0 && e.writer.streamEditMessage(this.model.get("id"), n)
},
get_link: function (n) {
n.stopPropagation(n);
var r, o = this.$el,
s = e.models.WidgetSettings.get("href").indexOf("#"),
a = o.find(".e_hc_text_hyper"),
c = a.size() > 0 ? "hcp" : "hcm";
if (-1 != s) {
var l, u = e.models.WidgetSettings.get("href").indexOf("hcp="); - 1 != u && (l = e.models.WidgetSettings.get("href").slice(0, u));
var d = e.models.WidgetSettings.get("href").indexOf("hcm="); - 1 != d && (l = e.models.WidgetSettings.get("href").slice(0, d)), -1 == u && -1 == d && (l = e.models.WidgetSettings.get("href")), r = l + "&" + c + "=" + this.model.get("id")
} else r = e.models.WidgetSettings.get("href") + "#" + c + "=" + this.model.get("id");
var h = t.tmpl("hc_get_link", {
link: r
});
o.find(".e_hc_reply_form:eq(0)").addClass("hc_reply_form_box_active").html(h), o.find(".e_hc_get_link_textarea").focus().select(), onUnClickLink = function (e) {
"hc_get_link_textarea e_hc_get_link_textarea" != i(e.target).attr("class") && (o.find(".e_hc_get_link_textarea").remove(), i("body").off("click", onUnClickLink))
}, i("body").bind("click", onUnClickLink)
},
watch_video: function (e) {
var t, n = i(e.target).attr("data-href");
n ? t = i(e.target) : (t = i(e.target).parent(), n = t.attr("data-href"));
var r = '<iframe type="text/html" style="width:100%!important;height:385px!important" src="//www.youtube.com/embed/' + n + '?version=3&amp;autohide=1&amp;autoplay=1" frameborder="0"></iframe>';
t.parent().html("").append(r)
},
show_present: function (e) {
var t, n = i(e.target).attr("data-href");
n ? t = i(e.target) : (t = i(e.target).parent(), n = t.attr("data-href"));
var r = '<iframe type="text/html" style="width:100%!important;height:385px!important" src="' + n + '" frameborder="0"></iframe>';
t.parent().html("").append(r)
},
to_hc: function () {
var e = this.model.get("parent_id") || this.model.get("id"),
t = i("#hc_post_" + e);
if (0 !== t.size()) {
var n = t.position().top - 20;
0 >= n && (n = t.parents(".hc_image_wrap").position().top + n - 20), i("body").animate({
scrollTop: n
}, function () {
var e = t.find(".hypertext_span_selected");
setTimeout(function () {
e.css({
backgroundColor: "#fff2bc"
})
}, 50), setTimeout(function () {
e.css({
backgroundColor: ""
})
}, 250), setTimeout(function () {
e.css({
backgroundColor: "#fff2bc"
})
}, 450), setTimeout(function () {
e.css({
backgroundColor: ""
})
}, 750)
})
}
},
show_quote: function (e) {
e.stopPropagation(e);
var n = i(e.target),
r = n.parent().find(".e_hc_hidden_quote");
r.is(":visible") ? (r.important({
display: "none"
}), n.html(t._("more") + "...")) : (r.important({
display: "block"
}), n.html(t._("hide") + "..."))
},
scroll_to_mes: function (e) {
e.stopPropagation(e), t.highlight(this.model.get("parent_id"))
},
show_reply: function (n) {
n.stopPropagation(n);
var i, r = this.$el.find("#hc_rt_box_" + this.model.get("id")),
o = r.data("ids").split(",");
for (i = 0; i < o.length; i++) e.views.tab_comment.$el.find("#hc_message_" + o[i]).important({
display: "block"
}), e.views.tab_comment.$el.find("#hc_message_" + o[i] + " .hc_lf_indicator").addClass("hc_lf_indicator_active");
this.$el.find("#hc_rt_" + this.model.get("id")).remove(), setTimeout(function () {
t.scroll(o[0])
}, 10)
},
get_context: function (t) {
t.stopPropagation(t), e.writer.streamGetContext(this.model.get("id"))
}
})
}
}(this.HC);
! function (e) {
e.ViewsLikes = function (e, t, n, i) {
e.view.LikesBaseView = n.View.extend({
template: "hc_like",
events: {
"click .e_hc_like": "like",
"click .e_hc_unlike": "unlike",
"click .e_hc_share_close": "share_close",
"click .e_hc_share": "share"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, {}))
},
render: function () {
return this
},
counter_show: function () {
var t = e.models.StreamInfo.get("likes"),
n = e.models.StreamInfo.get("unlikes");
t > 0 && this.$el.find(".e_hc_count_likes").text(t), n > 0 && this.$el.find(".e_hc_count_unlikes").text(n)
},
recount: function (e) {
if (e) {
var t = this.$el.find(".e_hc_count_likes");
"" === t.text() ? t.text(1) : t.text(parseInt(t.text(), 10) + 1)
} else {
var n = this.$el.find(".e_hc_count_unlikes");
"" === n.text() ? n.text(1) : n.text(parseInt(n.text(), 10) + 1)
}
},
like: function () {
var t = this;
if (!e.models.UserAuth.get("acc_id")) {
e.views.AuthView = new e.view.AuthView({
model: e.models.WidgetSettings,
action: "login"
});
var n = function () {
t.$el.find(".e_hc_like").click()
};
return e.views.AuthView.set_auth_callback(n), e.views.AuthView.render_auth(), void 0
}
e.writer.streamLike(!0), this.$el.find(".e_hc_share_like").attr("style", "display:block !important;")
},
unlike: function (t) {
t.stopPropagation();
var n = this;
if (!e.models.UserAuth.get("acc_id")) {
e.views.AuthView = new e.view.AuthView({
model: e.models.WidgetSettings,
action: "login"
});
var i = function () {
n.$el.find(".e_hc_unlike").click()
};
return e.views.AuthView.set_auth_callback(i), e.views.AuthView.render_auth(), void 0
}
e.writer.streamLike(!1), this.$el.find(".e_hc_share_close").click()
},
share_close: function (e) {
e.stopPropagation(), this.$el.find(".e_hc_share_like").important({
display: "none"
})
},
share: function (n) {
n.stopPropagation();
var i, r = n.target.getAttribute("data-service"),
o = e.models.WidgetSettings.get("like_href") ? e.models.WidgetSettings.get("like_href") : encodeURIComponent(e.models.WidgetSettings.get("href")),
s = e.models.WidgetSettings.get("like_title") ? e.models.WidgetSettings.get("like_title") : encodeURIComponent(e.models.WidgetSettings.get("title"));
if ("twitter" == r) i = "http://twitter.com//intent/tweet?text=" + s + "&url=" + o;
else if ("facebook" == r) i = "http://www.facebook.com/sharer/sharer.php?t=" + s + "&u=" + o;
else if ("google" == r) i = "https://plus.google.com/share?url=" + o;
else {
if ("vk" != r) return;
i = "http://vk.com/share.php?title=" + s + "&url=" + o
}
t.popup(580, 480, "ShareHyperComments", i)
}
})
}
}(this.HC);
! function (e) {
e.ViewsPopup = function (e, t, n, i) {
e.view.AuthView = n.View.extend({
template: "hc_auth_box",
events: {
"click .event_auth_type_bt": "redirect_auth",
"click .event_publish_guest": "set_guest",
"click .event_site_auth": "redirect_site_auth",
"click .e_hc_schlisen": "close"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, {
model: this.model.toJSON(),
action: this.options.action
}));
var e = this.model.get("social");
if (e) {
var n = ["vk", "facebook", "twitter", "google", "mailru", "odnoklassniki", "openid", "yandex"],
r = this.$el.find(".e_hc_authorization_logos");
r.find(".event_auth_type_bt").remove();
var o = this.model.get("social").split(",");
i(o).map(function () {
var e = i.trim(this); - 1 != i.inArray(e, n) && ("vk" == e && (e = "vkontakte"), r.append(i(t.tmpl("auth_item", {
service: e
}))))
})
}
},
render: function () {
return this
},
render_auth: function () {
var t = this;
if (this.model.get("hc_auth")) {
e.views.AppBasicView.show_background(), e.views.AppBasicView.$el.find(".hc_root").append(this.render().$el);
var n;
n = function (e) {
i(e.target).parents(".hc_authorization_box").size() > 0 || i(e.target).hasClass("e_hc_post_login") || i(e.target).hasClass("e_hc_reply_button") || i(e.target).hasClass("e_hc_like") || i(e.target).hasClass("e_hc_unlike") || i(e.target).hasClass("hc_authorization_box") || (t.close(), i("body").off("click", n))
}, i("body").bind("click", n)
} else !this.model.get("hc_auth") && this.model.get("site_auth") && (this.model.get("auth_url") ? document.location.href = -1 == this.model.get("auth_url").indexOf("?") ? this.model.get("auth_url") + "?return_to=" + this.model.get("href") : this.model.get("auth_url") + "&return_to=" + this.model.get("href") : e.call("siteAuth"))
},
redirect_auth: function (e) {
var n = this,
r = e.target.getAttribute("data-service");
r || (r = i(e.target).parent().attr("data-service"));
var o = t.HOST + "/auth?service=" + r,
s = function () {
n.authorization(n)
};
return t.popup(665, 450, "HyperComments", o, s), this.close(), !1
},
redirect_site_auth: function () {
return document.location.href = -1 == this.model.get("auth_url").indexOf("?") ? this.model.get("auth_url") + "?return_to=" + this.model.get("href") : this.model.get("auth_url") + "&return_to=" + this.model.get("href"), !1
},
authorization: function (t) {
e.socket.api("/login", void 0, function (e) {
"success" == e.result && e.acc_id ? "function" == typeof t.callback && setTimeout(function () {
t.callback()
}, 300) : "function" == typeof t.callback && t.model.get("guestNick") && setTimeout(function () {
t.callback()
}, 300)
})
},
set_guest: function () {
var n = i.trim(this.$el.find("#event_nick_guest").val());
if (n.length > 125) return alert(t._("Your user name is too big")), !1;
if (0 === n.length) return !1;
var r = this.$el.find("#event_email_guest").val();
return t.validateEmail(r) ? (e.models.UserAuth.set({
guestNick: n,
guestEmail: r
}), e.models.UserAuth.set_guest_info(n, r), this.$el.remove(), "function" == typeof this.callback && e.models.UserAuth.get("guestNick") && this.callback(), void 0) : (alert(t._("Email not valid")), !1)
},
set_auth_callback: function (e) {
this.callback = e
},
close: function () {
this.$el.remove(), e.views.AppBasicView.hide_background()
}
}), e.view.VideoView = n.View.extend({
template: "hc_video_box",
events: {
"click .event_button_close": "cancel",
"click .event_button_add": "attach"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, {}))
},
render_popup: function () {
e.views.AppBasicView.$el.find(".hc_root").append(this.render().$el), e.views.AppBasicView.show_background();
var t;
t = function (n) {
i(n.target).parents(".e_hc_popup_box").size() > 0 || i(n.target).hasClass("e_hc_attach") || (e.views.AppBasicView.$el.find(".e_hc_popup_box").remove(), e.views.AppBasicView.hide_background(), i("body").off("click", t))
}, i("body").bind("click", t)
},
cancel: function (t) {
t.stopPropagation(), e.views.AppBasicView.$el.find(".e_hc_popup_box").remove(), e.views.AppBasicView.hide_background()
},
attach: function (n) {
n.stopPropagation(), this.$el.find(".hc_mess_error").important({
display: "none"
});
var i = this.$el.find("#hc_video_code").val();
if ("" === i) return this.$el.find(".e_hc_mes").text("").append(t.tmpl("hc_error", {
text: t._("Enter the address of the page with the video")
})), this.$el.find(".hc_mess_error").important({
display: "block"
}), void 0;
if (!new RegExp("(http|https)://(?:www.)?youtube.*?watch\\?v=([a-zA-Z0-9-_]+).*", "gi").test(i) && !new RegExp("(http|https)://(?:www.)?youtu.be/([a-zA-Z0-9-_]+).*", "gi").test(i)) return this.$el.find(".e_hc_mes").text("").append(t.tmpl("hc_error", {
text: t._("The video must be from the server youtube")
})), this.$el.find(".hc_mess_error").important({
display: "block"
}), void 0;
var r = new RegExp("(http|https)://(?:www.)?youtube.*?watch\\?v=([a-zA-Z0-9-_]+).*", "gi").exec(i);
r || (r = new RegExp("(http|https)://(?:www.)?youtu.be/([a-zA-Z0-9-_]+).*", "gi").exec(i));
var o = r[2],
s = '<iframe type="text/html" style="width:90%" height="385" src="http://www.youtube.com/embed/' + o + '" frameborder="0"></iframe>',
a = {
type: "youtube",
source: s,
id: o,
preview: "http://img.youtube.com/vi/" + o + "/1.jpg",
videocode: i
};
this.options.form_model.form_embed(a), this.$el.remove(), e.views.AppBasicView.hide_background()
}
}), e.view.PresentationView = n.View.extend({
template: "hc_present_box",
events: {
"click .event_button_close": "cancel",
"click .event_button_add": "attach"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, {}))
},
render_popup: function () {
e.views.AppBasicView.$el.find(".hc_root").append(this.render().$el), e.views.AppBasicView.show_background();
var t;
t = function (n) {
i(n.target).parents(".hc_image_box").size() > 0 || i(n.target).hasClass("e_hc_attach") || (e.views.AppBasicView.$el.find(".hc_image_box").remove(), e.views.AppBasicView.hide_background(), i("body").off("click", t))
}, i("body").bind("click", t)
},
cancel: function (t) {
t.stopPropagation(), e.views.AppBasicView.$el.find(".hc_image_box").remove(), e.views.AppBasicView.hide_background()
},
attach: function (n) {
n.stopPropagation(), this.$el.find(".hc_mess_error").important({
display: "none"
});
var i = this.$el.find("#hc_presentation_code").val();
if ("" === i) return this.$el.find(".e_hc_mes").text("").append(t.tmpl("hc_error", {
text: t._("Enter the code to embed the presentation")
})), this.$el.find(".hc_mess_error").important({
display: "block"
}), void 0;
var r, o, s, a = /(http|https):\/\/docs.google.com\/present\/(embed|view)\?id=[a-zA-Z0-9_]+/,
c = /(http|https):\/\/docs.google.com\/presentation\/d\/[a-zA-Z0-9_]+/,
l = /(http|https):\/\/docs.google.com\/presentation\/pub\?[a-zA-Z0-9_]+/,
u = /(http|https):\/\/docs.google.com\/presentation\/(embed|view)\?[a-zA-Z0-9_]+/;
if (a.exec(i)) s = i;
else if (c.exec(i)) r = i.split("/"), o = r[5], s = "https://docs.google.com/presentation/embed?id=" + o;
else if (l.exec(i)) r = i.split("="), o = r[1].split("&")[0], s = "https://docs.google.com/presentation/embed?id=" + o;
else {
if (!u.exec(i)) return this.$el.find(".e_hc_mes").text("").append(t.tmpl("hc_error", {
text: t._("Invalid format")
})), this.$el.find(".hc_mess_error").important({
display: "block"
}), void 0;
s = i
}
var h = {
type: "presentation",
source: "презентация",
preview: t.DIR + "img/presentations.png",
code: s
};
this.options.form_model.form_embed(h), this.$el.remove(), e.views.AppBasicView.hide_background()
}
})
}
}(this.HC);
! function (e) {
e.ViewsTopic = function (e, t, n, i) {
e.view.TopicsTabView = n.View.extend({
template: "hc_content-topics",
events: {
"click #hc_comments_more": "more_comments"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, {})), e.collections.comments.unbind("reset"), e.collections.topics.bind("reset", this.add_all_topics, this), e.collections.comments.bind("reset", this.add_all_comments, this), e.collections.comments.bind("add", this.add_new_comment, this), this.active_topic = 0
},
render: function () {
return this
},
add_one_topic: function (t) {
e.views.TopicView = new e.view.TopicView({
model: t,
parent_model: this
}), this.$el.find("#hc_topics").append(e.views.TopicView.render().$el)
},
add_all_topics: function () {
this.$el.find("#hc_messages").html(""), this.$el.find("#hc_topics").html(""), e.collections.topics.each(this.add_one_topic, this)
},
add_new_comment: function (t) {
if (!t.get("is_new")) return this.add_one_comment(t), void 0;
e.views.CommentView = new e.view.CommentView({
model: t
});
var n = t.get("parent_id"),
i = t.get("root_id");
i == this.active_topic && (t.get("is_resp") && n && this.$el.find("#hc_message_" + n).size() > 0 ? this.$el.find("#hc_message_" + n).append(e.views.CommentView.render().$el) : this.$el.find("#hc_messages").prepend(e.views.CommentView.render().$el), e.views.CommentView.render().$el.important({
display: "none"
}).slideDown("slow"))
},
add_one_comment: function (t) {
t.set({
is_new: !1
}), e.views.CommentView = new e.view.CommentView({
model: t
}), t.get("state") && 1 != t.get("state") || t.get("t") || this.$el.find("#hc_messages").append(e.views.CommentView.render().$el);
var n = e.collections.topics.where({
id: this.active_topic
});
e.collections.comments.length == n[0].get("children") && this.$el.find("#hc_comments_more").remove()
},
add_all_comments: function () {
this.$el.find("#hc_messages").html(""), e.collections.comments.each(this.add_one_comment, this);
var t = e.collections.topics.where({
id: this.active_topic
});
t.length > 0 && t[0].get("children") > this.model.get("limit") && this.more_topic_comments_render()
},
more_topic_comments_render: function () {
this.$el.find("#hc_pagin_more").html(t.tmpl("hc_comments_more", {
count: ""
}))
},
more_comments: function (t) {
t.stopPropagation(), e.models.StreamInfo.set({
page: e.models.StreamInfo.get("page") + 1
}), e.writer.streamGetMessages("topic", e.models.StreamInfo.get("page"), this.active_topic)
}
}), e.view.TopicView = n.View.extend({
template: "hc_topic",
events: {
"click .e_hc_topic_title": "show_topic",
"click .e_hc_topic_nav_up": "up",
"click .e_hc_topic_nav_next": "next",
"click .e_hc_topic_nav_back": "back"
},
initialize: function () {
this.$el = i(t.tmpl(this.template, this.model.toJSON()))
},
render: function () {
return this
},
show_topic: function () {
this.options.parent_model.$el.find(".e_hc_topic").addClass("hc_topic_unactive"), e.models.WidgetSettings.set({
current_filter: "topic"
}), e.views.TopicReplyForm = new e.view.FormView({
comment: this.model,
main: !0
}), this.$el.find(".e_hc_topic_form").html(e.views.TopicReplyForm.render().$el).important({
display: "none"
}).fadeIn("slow"), this.$el.removeClass("hc_topic_unactive"), this.$el.find(".e_hc_topic_title").addClass("hc_topic_active"), e.models.StreamInfo.set({
page: 0
}), this.options.parent_model.active_topic = this.model.get("id"), e.writer.streamGetMessages("topic", 0, this.model.get("id")), this.$el.find(".e_hc_topic_counter_comment").important({
display: "none"
})
},
up: function (t) {
t.stopPropagation(), this.options.parent_model.$el.find(".e_hc_topic").removeClass("hc_topic_unactive"), this.$el.find(".e_hc_topic_title").removeClass("hc_topic_active"), this.$el.find(".e_hc_topic_form").html(""), this.options.parent_model.$el.find("#hc_messages").html(""), this.options.parent_model.$el.find("#hc_comments_more").remove(), e.models.StreamInfo.set({
page_topic: 0
}), this.$el.find(".e_hc_topic_counter_comment").important({
display: "block"
})
},
next: function (t) {
t.stopPropagation(), this.$el.find(".e_hc_topic_nav_up").click(), this.$el.next().find(".e_hc_topic_title").click(), e.models.StreamInfo.set({
page_topic: 0
})
},
back: function (t) {
t.stopPropagation(), this.$el.find(".e_hc_topic_nav_up").click(), this.$el.prev().find(".e_hc_topic_title").click(), e.models.StreamInfo.set({
page_topic: 0
})
}
})
}
}(this.HC);
! function (e) {
e.ViewsHC = function (e, t, n, i) {
e.view.HCTabView = n.View.extend({
template: "hc_content-hc",
initialize: function () {
this.$el = i(t.tmpl(this.template, {})), e.collections.comments.hc.unbind(), e.collections.comments.bind("add", this.add_new, this), e.collections.comments.hc.bind("reset", this.add_all, this), e.collections.hypercomments.bind("add", this.add_hc, this)
},
render: function (t) {
return e.views.MainForm = new e.view.FormView({
main: !0
}), t && e.views.MainForm.set_topic_param(t), this.$el.find(".hc_comment").html(e.views.MainForm.render().$el), this
},
add_hc: function (t) {
this.$el.find(".hc_comment_box").important({
display: "block"
}), this.$el.parents(".hc_widget_mini").removeClass("hc_widget_mini").addClass("hc_widget"), e.views.MainForm.delete_topic_param(t.get("id"))
},
add_new: function (t) {
e.views.CommentView = new e.view.CommentView({
model: t
});
var n = t.get("parent_id"),
i = t.get("hc_comment");
i && (n && this.$el.find("#hc_message_" + n).size() > 0 ? this.$el.find("#hc_message_" + n).append(e.views.CommentView.render().$el) : this.$el.find(".hc_comment_box").append(e.views.CommentView.render().$el), t.get("parent_id") == t.get("root_id") && this.$el.find(".hc_comment_box").scrollTop(9999))
},
add_one: function (t) {
var n = t.get("parent_id");
t.set({
hc_comment: !0
}), e.views.CommentView = new e.view.CommentView({
model: t
}), t.get("state") && 1 != t.get("state") ? t.get("children") && t.get("children") > 0 && (t.get("parent_id") ? this.$el.find("#hc_message_" + n).append(e.views.CommentView.render().$el) : this.$el.find(".hc_comment_box").append(e.views.CommentView.render().$el)) : t.get("parent_id") && this.$el.find("#hc_message_" + n).size() > 0 ? this.$el.find("#hc_message_" + n).append(e.views.CommentView.render().$el) : this.$el.find(".hc_comment_box").append(e.views.CommentView.render().$el)
},
add_all: function () {
e.collections.comments.hc.each(this.add_one, this)
},
resize: function (e) {
"show" == e ? (this.$el.find(".hc_comment").important({
height: "145px"
}), this.$el.parents(".hc_widget").css({
height: 485
})) : "attach" == e ? (this.$el.find(".hc_comment").important({
height: "240px"
}), this.$el.parents(".hc_widget").css({
height: 580
}), this.$el.parents(".hc_widget_mini").css({
height: 435
})) : "hide" == e && (this.$el.find(".hc_comment").important({
height: "60px"
}), this.$el.parents(".hc_widget").css({
height: 400
}))
}
})
}
}(this.HC);
! function (e) {
e.ViewsMixStream = function (e, t, n, i) {
var r;
e.view.MixView = n.View.extend({
events: {
"click .e_hc_menu": "select_filter"
},
initialize: function () {
r = e.config, this.$el = i(t.tmpl("hc_mix_root", {})), this.render()
},
render: function () {
"last" == r.filter && this.$el.find("[data-menu=popular]").remove(), "popular" == r.filter && this.$el.find("[data-menu=last]").remove(), this.$el.appendTo(r.append)
},
init: function () {
var e = r.default_filter || r.filter;
this.$el.find("[data-menu=" + e + "]").trigger("click")
},
select_filter: function (t) {
var n = this.$el,
o = i(t.target).data("menu");
n.find("[data-menu]").removeClass("hc_mix_menu_active").end().find("[data-menu=" + o + "]").addClass("hc_mix_menu_active");
var s = {
widget_id: r.widget_id,
limit: r.limit,
filter: o
};
e.socket.api("/mixstream", s, function (t) {
n.find("#hc_mix_container").empty(), i(t.data).map(function () {
"last" == o ? new e.view.MixLastMessage({
model: new e.model.MixComment(this)
}).render() : new e.view.MixPopularMessage({
model: new e.model.MixPopularPages(this)
}).render()
})
})
}
}), e.view.MixLastMessage = n.View.extend({
events: {
"click .e_hc_show_quote": "show_quote"
},
initialize: function () {
var e = this.model.toJSON();
e.link = e.link.replace(/#hcm=[0-9]{16}/gi, "").replace(/&hcm=[0-9]{16}/gi, ""), e.title || (e.title = e.link), this.$el = i(t.tmpl("hc_mix_last", e))
},
render: function () {
e.views.mixroot.$el.find("#hc_mix_container").append(this.$el)
},
show_quote: function (e) {
e.stopPropagation(e);
var n = i(e.target),
r = n.parent().find(".e_hc_hidden_quote");
r.is(":visible") ? (r.important({
display: "none"
}), n.html(t._("more") + "...")) : (r.important({
display: "block"
}), n.html(t._("hide") + "..."))
}
}), e.view.MixPopularMessage = n.View.extend({
initialize: function () {
this.$el = i(t.tmpl("hc_mix_popular", this.model.toJSON()))
},
render: function () {
e.views.mixroot.$el.find("#hc_mix_container").append(this.$el)
}
})
}
}(this.HC);
! function (e) {
e.ViewsIdent = function (e, t, n, i) {
e.view.IdentView = n.View.extend({
template: "hc_identifier",
events: {
"click .hc_ident_destroy": "close_popup",
"click .e_hc_ident": "click_popup"
},
initialize: function () {
var t = this;
e.collections.IdentCollection = new e.collection.IdentCollection, e.collections.comments.bind("add", this.new_comment, this), e.collections.comments.hc.bind("add", this.new_comment, this), this.navigator_ident = null, i(document).bind("scroll", function () {
t.scrollWindow()
})
},
render: function () {
return this.$el = i(t.tmpl(this.template, {
counter: 1
})), this.$el.appendTo(e.views.AppBasicView.$el.find(".hc_root")), this.delegateEvents(), this
},
new_comment: function (t) {
if (t.get("is_new")) {
var n = e.views.AppBasicView.$el.find("#hc_message_" + t.get("id")).offset().top;
if (n < i(window).scrollTop() || n > i(window).scrollTop() + screen.height) {
var r = e.views.AppBasicView.$el.find("#hc_identifier_box");
0 === r.size() ? (this.render(), this.navigateArrow(n, !0)) : (this.navigateArrow(n, !1), this.recount(1)), e.collections.IdentCollection.add(t)
}
}
},
navigateArrow: function (e, t) {
i(window).scrollTop() >= e ? (this.$el.find(".hc_notify_down").important({
display: "none"
}), this.$el.find(".hc_notify_up").important({
display: "block"
}), t && (this.navigator_ident = "up")) : (this.$el.find(".hc_notify_up").important({
display: "none"
}), this.$el.find(".hc_notify_down").important({
display: "block"
}), t && (this.navigator_ident = "down"))
},
recount: function (e) {
var t = this.$el.find(".hc_counter_num"),
n = parseInt(t.text().replace("(", "").replace(")", "") || 0, 10);
t.text("(" + (n + e) + ")")
},
click_popup: function () {
if ("down" == this.navigator_ident) {
var n = e.collections.IdentCollection.at(0),
i = e.collections.IdentCollection.at(1);
i && this.navigateArrow(i.get("top"), !1), t.highlight(n.get("id")), e.collections.IdentCollection.shift()
} else {
var r = e.collections.IdentCollection.at(e.collections.IdentCollection.length - 1),
o = e.collections.IdentCollection.at(e.collections.IdentCollection.length - 2);
o && this.navigateArrow(o.get("top"), !1), t.highlight(r.get("id")), e.collections.IdentCollection.pop()
}
this.recount(-1), 0 === e.collections.IdentCollection.length && this.close_popup()
},
scrollWindow: function () {
var n = this;
if (e.views.AppBasicView.$el.find("#hc_identifier_box").size() > 0 && e.collections.IdentCollection.length > 0) {
var r = 0;
e.collections.IdentCollection.each(function (o) {
var s = o.get("top");
s >= i(window).scrollTop() && s <= i(window).scrollTop() + screen.height - 200 && (n.recount(-1), e.collections.IdentCollection.at(r + 1) ? n.navigateArrow(e.collections.IdentCollection.at(r + 1).get("top"), !1) : e.collections.IdentCollection.at(0) && n.navigateArrow(e.collections.IdentCollection.at(0).get("top"), !1), t.highlight_no_scroll(o.get("id")), e.collections.IdentCollection.remove(o), r++)
}), 0 === e.collections.IdentCollection.length && this.close_popup()
}
},
close_popup: function (t) {
t && (t.stopPropagation(), t.preventDefault()), this.remove(), e.collections.IdentCollection.reset()
}
})
}
}(this.HC);
! function (e) {
e.Models = function (e, t, n, i) {
e.model.UserAuth = n.Model.extend({
initialize: function () {
this.get("avatar_src") || (this.get("acc_id") ? this.set({
avatar_src: t.CDN_HOST + "/data/avatars/" + this.get("acc_id") + "/avatar"
}) : this.set({
avatar_src: t.CDN_HOST + "/data/avatars/0/avatar"
})), e.models.WidgetSettings.get("guest_comments") && this.get_guest_info()
},
set_guest_info: function (e, n) {
var i = [e, n];
t.toStorage("hc_guest_user", JSON.stringify(i))
},
get_guest_info: function () {
var e = JSON.parse(t.fromStorage("hc_guest_user"));
e && e.length > 0 && this.set({
guestNick: e[0],
guestEmail: e[1]
})
}
}), e.model.WidgetSettings = n.Model.extend({
initialize: function () {
var e = this.get("href").replace("http://", "").replace("https://", "");
this.set({
href_referral: e
}), this.set({
orign: document.location.protocol + "//" + this.get("host")
}), this.get("default_filter") || this.set({
default_filter: "new"
}), this.get("filters") || this.set({
filters: "new,popular,all"
}), this.get("plugins") && -1 != this.get("plugins").indexOf("hypercomments") ? this.set({
hc: !0
}) : this.set({
hc: !1
});
var t = [3, 4, 6]; - 1 != i.inArray(this.get("plan"), t) ? this.set({
white_label: !0
}) : this.set({
white_label: !1
})
},
getCategory: function (e) {
var n = this.get("category"),
i = t.LANGUAGE;
if (n) {
var r, o, s, a, c;
for (a = 0; a < n.length; a++)
if (n[a].id == e) {
var l = n[a].title.split(";");
for (c = 0; c < l.length; c++) {
var u = l[c].split(":");
if ("en" == u[0] && (o = u[1]), 0 === c && (s = u[1]), i == u[0]) {
r = u[1];
break
}
}
}
if (!(r || o || s)) return !1;
if (!r && !o) return s.toUpperCase();
if (!r && o) return o.toUpperCase();
if (r) return r.toUpperCase()
}
},
getCategoryColor: function (e) {
var t, n, i = this.get("category");
if (i)
for (n = 0; n < i.length; n++) i[n].id == e && i[n].color && (t = 'style="color:' + i[n].color + ' !important;"');
return t
},
parseCategory: function (e) {
var n, i = this.get("category"),
r = t.LANGUAGE;
if (i) {
var o = "";
for (n = 0; n < i.length; n++) {
for (var s, a, c, l, u = i[n].title.split(";"), h = 0; h < u.length; h++) {
var d = u[h].split(":");
if ("en" == d[0] && (a = d[1]), 0 === h && (c = d[1]), r == d[0]) {
s = d[1];
break
}
}
l = s || a ? !s && a ? a : s : c, o += t.tmpl(e, {
id: i[n].id,
title: l
})
}
return o
}
}
}), e.model.StreamInfo = n.Model.extend({}), e.model.StreamInfo = n.Model.extend({}), e.model.MixPopularPages = n.Model.extend({}), e.model.Comment = n.Model.extend({
initialize: function () {
this.set({
vote_up: this.get("vote_up") || 0
}), this.set({
vote_dn: this.get("vote_dn") || 0
});
var n = this.get("vote_up") - this.get("vote_dn");
n = 0 !== n ? n : "", this.set({
vote: n
}), this.get("date") ? this.set({
date: new Date(1e3 * this.get("date"))
}) : this.set({
date: t.timeAgo(this.get("time"))
});
var i = t.parseImageStr(this.get("text"));
if ("hcimage" == i.text_type) {
var r = t.tmpl("hc_comment_image", i);
this.set({
text: r
})
} else {
var o = e.models.WidgetSettings.get("image");
this.set({
text: t.toMessage(this.get("text"), o)
})
} if (this.set({
edit_text: t.toEditMessage(this.get("text"))
}), this.set({
files: t.toFileString(this.get("files"))
}), this.set({
category_color: e.models.WidgetSettings.getCategoryColor(this.get("category"))
}), this.set({
category: e.models.WidgetSettings.getCategory(this.get("category"))
}), this.get("parent")) {
var s = JSON.parse(this.get("parent"));
s.text = t.toParentMessage(s.text), this.set({
parent: s
})
}
var a = e.models.UserAuth.get("acc_id");
a && a == this.get("acc_id") && !this.get("t") && this.set({
can_delete: !0
}), a && a == this.get("acc_id") && new Date - new Date(this.get("time")) <= 18e4 && this.set({
can_edit: !0
}), e.models.UserAuth.get("moderator") && !this.get("t") && this.set({
is_moderate: !0
}), this.set({
current_filter: e.models.WidgetSettings.get("current_filter")
}), this.set({
readonly: e.models.WidgetSettings.get("readonly")
})
},
setVote: function (e, t) {
"up" == e ? (this.set({
vote_up: this.get("vote_up") + parseInt(t, 10)
}), this.set({
vote: parseInt(this.get("vote") + t, 10)
})) : (this.set({
vote_dn: this.get("vote_dn") + parseInt(t, 10)
}), this.set({
vote: parseInt(this.get("vote") - t, 10)
}))
},
setText: function (n) {
var i = e.models.WidgetSettings.get("image");
this.set({
text: t.toMessage(n, i)
}), this.set({
edit_text: t.toEditMessage(n)
})
},
setParentNick: function (e) {
this.set({
parent_nick: e
})
}
}), e.model.MixComment = n.Model.extend({
initialize: function () {
this.get("date") ? this.set({
date: new Date(1e3 * this.get("date"))
}) : this.set({
date: t.timeAgo(this.get("time"))
}), this.set({
text: t.toParentMessage(this.get("text"))
}), this.set({
files: t.toFileString(this.get("files"))
})
}
}), e.collection.CommentsCollection = n.Collection.extend({
model: e.model.Comment
}), e.model.Topic = n.Model.extend({}), e.collection.TopicCollection = n.Collection.extend({
model: e.model.Topic
}), e.model.Authors = n.Model.extend({}), e.collection.AuthorsCollection = n.Collection.extend({
model: e.model.Authors
}), e.model.HyperTopic = n.Model.extend({}), e.collection.HyperCollection = n.Collection.extend({
model: e.model.Comment,
initialize: function () {
jHC(".hc_select_index").remove(), this.on("reset", this.create, this), this.on("add", this.addTopic, this)
},
create: function () {
var t = [],
n = this;
this.each(function (e) {
e.get("children") && e.get("children") > 0 && n.parseTopic(e) && t.push(n.parseTopic(e))
}), HyperComments.instance = new HyperComments({
app: e,
selectable: e.models.WidgetSettings.get("hypertext"),
data: t,
ignored: e.models.WidgetSettings.get("ignored"),
max_words_select: e.models.WidgetSettings.get("word_limit")
})
},
addTopic: function (t) {
jHC(".hc_select_index").remove();
var n = [this.parseTopic(t, !0)];
HyperComments.instance = new HyperComments({
app: e,
selectable: e.models.WidgetSettings.get("hypertext"),
data: n,
ignored: e.models.WidgetSettings.get("ignored"),
max_words_select: e.models.WidgetSettings.get("word_limit")
})
},
parseTopic: function (e, t) {
var n = JSON.parse(e.get("param"));
return n ? (n.id = e.get("id"), n.messages = t ? 0 : e.get("children"), n.text = e.get("topic") || e.get("text"), n) : !1
}
}), e.collection.IdentCollection = n.Collection.extend({
model: e.model.Comment,
initialize: function () {
this.on("add", this.addModel, this)
},
comparator: function (e) {
return e.get("top")
},
addModel: function () {
this.each(function (t) {
var n = e.views.AppBasicView.$el.find("#hc_message_" + t.get("id")).offset().top;
t.set({
top: n
})
}), this.sort()
}
})
}
}(this.HC);
! function (e) {
e.Writer = function (e) {
var t = e.models,
n = function (t, n) {
n = n || {}, n.cmd = t, e.socket.send(JSON.stringify(n))
};
this.streamGetMessages = function (e, i, r, o, s) {
n("streamGetMessages", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
limit: t.WidgetSettings.get("limit"),
offset: parseInt(i, 10),
parent_id: r,
filter: e,
acc_id: o,
category: s,
reverse: t.WidgetSettings.get("reverse")
})
}, this.streamAddMessage = function (e, i, r, o, s, a, c, l, d, u) {
n("streamAddMessage", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
link: t.WidgetSettings.get("href"),
title: t.WidgetSettings.get("title"),
user_agent: t.WidgetSettings.get("userAgent"),
root_id: e,
text: r,
nick: s,
email: a,
parent_id: i,
files: o,
hc_comment: c,
crosspost: l,
crosspost_service: d,
category: u
})
}, this.streamAddTopic = function (e, i, r, o, s, a, c, l, d, u) {
n("streamAddTopic", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
link: t.WidgetSettings.get("href"),
title: t.WidgetSettings.get("title"),
user_agent: t.WidgetSettings.get("userAgent"),
text: e,
topic: i,
param: r,
files: o,
nick: s,
email: a,
hc_comment: c,
crosspost: l,
crosspost_service: d,
category: u
})
}, this.streamGetHcComments = function (e, i, r, o, s) {
n("streamGetHcComments", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
limit: t.WidgetSettings.get("limit"),
offset: parseInt(i, 10),
parent_id: r,
filter: e,
acc_id: o,
category: s
})
}, this.streamVoteMessage = function (e, i, r) {
n("streamVoteMessage", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e,
vote: i,
user_id: r
})
}, this.streamDeleteMessage = function (e) {
n("streamDeleteMessage", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e
})
}, this.streamSpamMessage = function (e) {
n("streamSpamMessage", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e
})
}, this.streamUserSpamMessage = function (e) {
n("streamUserSpamMessage", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e
})
}, this.streamChangeAccess = function (e, i) {
n("streamChangeAccess", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e,
access: i
})
}, this.streamEditMessage = function (e, i) {
n("streamEditMessage", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e,
text: i
})
}, this.streamLike = function (e) {
n("streamLike", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
like: e
})
}, this.streamGetTopics = function (e, i) {
n("streamGetTopics", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
limit: parseInt(e, 10),
offset: parseInt(i, 10)
})
}, this.streamGetAuthors = function (e, i) {
n("streamGetAuthors", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
limit: parseInt(e, 10),
offset: parseInt(i, 10)
})
}, this.streamAddComplain = function (e, i) {
n("streamAddComplain", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e,
text: i
})
}, this.streamGetContext = function (e) {
n("streamGetContext", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
id: e
})
}, this.streamEmailSubscribe = function (e, i) {
n("streamEmailSubscribe", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
email: e,
lang: i
})
}, this.streamEmailUnsubscribe = function (e) {
n("streamEmailUnsubscribe", {
widget_id: t.WidgetSettings.get("widget_id"),
stream_id: t.StreamInfo.get("stream_id"),
email: e
})
}
}
}(this.HC);
! function (e) {
e.Reader = function (t, n) {
var i, r = this,
o = t.collections;
this.receive = function (n) {
if ("packets" == n.cmd)
for (var i = 0; i < n.data.length; i++) {
var o = n.data[i];
o.length && (o = JSON.parse(o));
try {
r[o.cmd](o), t.call(o.cmd, o)
} catch (s) {
e.log(s)
}
} else try {
r[n.cmd](n), t.call(n.cmd, n)
} catch (s) {
e.log(s)
}
}, this.authInfo = function (n) {
n.avatar_src = n.avatar ? n.avatar : n.acc_id ? e.CDN_HOST + "/data/avatars/" + n.acc_id + "/avatar" : e.CDN_HOST + "/data/avatars/0/avatar", t.models.UserAuth.set(n)
}, this.token = function (e) {
t.socket.token = t.token = e.token, this.authInfo(e), i && clearInterval(i), i = setInterval(function () {
t.socket.api("/update_token", void 0, function (e) {
e.token && (t.socket.token = t.token = e.token)
})
}, 12e5)
}, this.setWidgetSettings = function (e) {
if (!t.models.WidgetSettings) {
e.auth_url = e.wp_url;
var i = n.extend({}, e, t.config);
t.models.WidgetSettings = new t.model.WidgetSettings(i), t.models.UserAuth || (t.models.UserAuth = new t.model.UserAuth({})), o.comments = new t.collection.CommentsCollection, o.comments.hc = new t.collection.CommentsCollection, o.topics = new t.collection.TopicCollection, o.authors = new t.collection.AuthorsCollection, o.hypercomments = new t.collection.HyperCollection, t.views.AppBasicView = new t.view.AppBasicView({
model: t.models.WidgetSettings,
auth_model: t.models.UserAuth,
el: t.models.WidgetSettings.get("append")
}), e.identifier && (t.views.IdentView = new t.view.IdentView), n(".hc-link").remove()
}
}, this.streamInfo = function (i) {
if (!t.models.StreamInfo) {
var r = {
stream_id: i.id,
type: i.type || "public",
cm: i.cm || 0,
cm2: i.cm2 || 0,
hc: i.hc || 0,
likes: i.likes || 0,
unlikes: i.unlikes || 0,
page: 0
};
t.models.WidgetSettings.get("readonly") || t.models.WidgetSettings.set({
readonly: i.readonly
}), i.readonly && t.views.AppBasicView.$el.find(".hc_reply_form_textarea_box").important({
display: "none"
}), r.count_mes = r.cm2 - r.hc, t.models.StreamInfo = new t.model.StreamInfo(r), t.views.AppBasicView.recount_counter(r.count_mes), i.comments && o.comments.reset(i.comments), t.views.tab_comment.render_more_or_pagin(), t.views.LikesBaseView && t.views.LikesBaseView.counter_show(), setTimeout(function () {
function n() {
e.SOCKET_OPEN || o > 30 ? (i && i !== !0 && t.writer.streamGetContext(i), clearInterval(r)) : o++
}
var i = e.scrollToMes(t.models.WidgetSettings.get("href")),
r = setInterval(n, 50),
o = 0
}, 300), -1 != t.models.WidgetSettings.get("plugins").indexOf("rss") && t.views.FooterView.rss(), t.views.FooterView.render_email(r.stream_id), -1 != t.models.WidgetSettings.get("plugins").indexOf("hypercomments") && (t.models.WidgetSettings.get("hc_disable") && 1 == t.models.WidgetSettings.get("hc_disable") || ("createRange" in document ? n.getScript(e.DIR + "js/plugins/plugin.hypertext.js", function () {
i.topics && o.hypercomments.reset(i.topics)
}) : n.getScript(e.DIR + "js/plugins/ierange.js", function () {
n.getScript(e.DIR + "js/plugins/plugin.hypertext.js", function () {
i.topics && o.hypercomments.reset(i.topics)
})
})))
}
}, this.streamGuestsOnline = function (e) {
t.views.AppBasicView.online_render(e)
}, this.streamMessages = function (e) {
var n = t.models.WidgetSettings.get("current_filter"),
i = t.models.WidgetSettings.get("tab");
0 === t.models.StreamInfo.get("page") || t.models.WidgetSettings.get("pagination") ? o.comments.reset(e.comments) : o.comments.add(e.comments), 0 === e.comments.length && t.views["tab_" + i].$el.find("#hc_pagin_more").html(""), "comment" == i && "category" !== n && t.views.tab_comment.recount_more_button()
}, this.streamAuthors = function (e) {
o.authors.reset(e.data)
}, this.streamTopics = function (e) {
o.topics.reset(e.comments)
}, this.streamHcComments = function (e) {
o.comments.hc.reset(e.comments)
}, this.streamMessage = function (e) {
e.is_new = !0, o.comments.add(e)
}, this.streamTopic = function (e) {
o.hypercomments.add(e)
}, this.streamVoteMessage = function (e) {
var t = o.comments.where({
id: e.id
});
t.length > 0 && t[0].setVote(e.vote, e.count)
}, this.streamDeleteMessage = function (e) {
var n = o.comments.where({
id: e.id
});
n.length > 0 && n[0].set({
state: 4,
reason_del: e.reason_del
});
var i = o.comments.hc.where({
id: e.id
});
i.length > 0 && i[0].set({
state: 4,
reason_del: e.reason_del
}), t.views.AppBasicView.recount_counter(-1)
}, this.streamSpamMessage = function (e) {
var n = o.comments.where({
id: e.id
});
n.length > 0 && n[0].set({
state: 3
});
var i = o.comments.hc.where({
id: e.id
});
i.length > 0 && i[0].set({
state: 3
}), t.views.AppBasicView.recount_counter(-1)
}, this.streamChangeAccess = function () {
e.notify(e._("ban_user"))
}, this.streamEditMessage = function (e) {
var t = o.comments.where({
id: e.id
});
t.length > 0 && t[0].setText(e.text)
}, this.streamLike = function (e) {
e.like ? t.models.StreamInfo.set({
likes: t.models.StreamInfo.get("likes") + 1
}) : t.models.StreamInfo.set({
unlikes: t.models.StreamInfo.get("unlikes") + 1
}), t.views.LikesBaseView.recount(e.like)
}, this.userState = function (n) {
n.avatar_src = n.avatar ? n.avatar : n.acc_id ? e.CDN_HOST + "/data/avatars/" + n.acc_id + "/avatar" : e.CDN_HOST + "/data/avatars/0/avatar", t.models.UserAuth.set(n), t.models.UserAuth.set({
guestNick: null,
guestEmail: null
}), e.delStorage("hc_guest_user")
}, this.AccessDenied = function () {
t.views.tab_comment.render_access_denied()
}, this.streamComplain = function () {
e.notify(e._("complain_send"))
}, this.streamUserWarning = function (e) {
t.views.AppBasicView.show_user_warning(e)
}, this.streamFlood = function () {
e.notify(e._("Your message is defined as flood"))
}, this.streamContext = function (n) {
t.models.WidgetSettings.set({
current_filter: "all"
}), t.views.AppBasicView.render_context(), o.comments.reset(n.comments), setTimeout(function () {
e.scrollToMes(t.models.WidgetSettings.get("href"))
}, 100)
}
}
}(this.HC);
! function (e) {
e.fn.important = function (t) {
return this.each(function () {
var n = "";
for (var i in t) n += i + ":" + t[i] + " !important;";
n && e(this).attr("style", n)
}), this
};
var t;
e.cssRule = function (n, i) {
if (!t) {
var r = document.createElement("style");
e("head").append(r), t = r.styleSheet ? r.styleSheet : r.sheet
}
var o = "";
for (propName in i) o += propName + ":" + i[propName] + ";";
"object" == typeof t && ("insertRule" in t ? t.insertRule(n + "{" + o + "}", t.cssRules.length) : "addRule" in t && t.addRule(n, o, t.rules.length))
}
}(this.jHC);
! function (e) {
e.Utils = function (e, t, n, i) {
t.toMessage = function (e, n) {
e = e || "";
var i = t.parseImageStr(e);
if (i.text_type && "hcimage" == i.text_type) {
var r = i.src.replace("http:", "").replace("https:", "");
return r = t.PROTOCOL + r, '<img style="max-width: 150px !important; max-height: 150px !important;" src="' + t.stripHTML(r) + '" alt="' + t.stripHTML(i.title) + '" />'
}
e = e.replace(/^\s*/, "").replace(/\s*$/, "").replace(/\s{4,}/g, "\n\n\n").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/'/g, "&#039;").replace(/"/g, "&quot;").replace(/\n/gi, "<br/>"), width = 75, cut = !0;
var o = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|])/gim;
e = e.replace(o, '<a href="' + t.HOST + '/api/go?url=$1" target="_blank">$1</a>').replace("&#8203;", "");
var s = /(^|[^\/])(www\.[\S]+(\b|$))/gim;
e = e.replace(s, '$1<a href="' + t.HOST + '/api/go?url=$2" target="_blank">$2</a>').replace("&#8203;", "");
var a = /([a-zA-Z0-9_\-\.]+)@([a-zA-Z0-9_\-\.]+)\.([a-zA-Z]{2,6})/gim;
e = e.replace(a, ' <a href="mailto:$1@$2.$3">$1@$2.$3</a> ');
var c = /(\b(https?|ftp):\/\/[-A-Z0-9+&@#\/%?=~_|!:,.;]*[-A-Z0-9+&@#\/%=~_|]\.(?:jpg|png|gif|jpeg|JPG|PNG|GIF))/gim,
l = e.match(c);
if (n && l)
for (var d = l.filter(function (e, n, i) {
var r = e.replace(t.HOST + "/api/go?url=", "");
return n == i.indexOf(r)
}), u = 0; u < d.length; u++) e = e + '<br /><a target="_blank" href="' + d[u] + '"><img onerror="this.parentNode.parentNode.removeChild(this.parentNode)" class="hc_internet_img" src="' + d[u] + '" alt="" /></a>';
return e = e.replace(/\(:boring:\)/g, '<img class="hc_smile" src=' + t.DIR + "img/smile/3.png>").replace(/\(:smile:\)/g, '<img class="hc_smile" src=' + t.DIR + "img/smile/1.png>").replace(/\(:joy:\)/g, '<img class="hc_smile" src="' + t.DIR + 'img/smile/7.png">').replace(/\(:wonder:\)/g, '<img class="hc_smile" src=' + t.DIR + "img/smile/8.png>").replace(/\(:cry:\)/g, '<img class="hc_smile" src=' + t.DIR + "img/smile/11.png>").replace(/\(:sly:\)/g, '<img class="hc_smile" src=' + t.DIR + "img/smile/6.png>")
}, t.toParentMessage = function (e) {
var n = e.match(new RegExp(" ", "ig"));
if (!n || n.length <= 20) return t.toMessage(e);
for (var i, r = 0, o = 0; - 1 != (i = e.indexOf(" ", r)) && (r = i + 1, o++, 20 != o););
var s = e.substr(0, r),
a = e.substr(r, e.length),
c = t.toMessage(s);
return c += "<span class='hc_hidden_quote e_hc_hidden_quote'>", c += t.toMessage(a), c += "</span>", c += "<span class='hc_show_quote e_hc_show_quote'>" + t._("more") + "...</span>"
}, t.parseImageStr = function (e) {
var t = {};
if (e && "" !== e) {
var n = e.substr(0, 7);
if ("hcimage" == n) {
t.text_type = n;
for (var i = e.substr(8), r = i.split("&amp;"), o = r.length, s = 0; o > s; s++) {
var a = r[s].split("=");
t[a[0]] = a[1]
}
}
}
return t
}, t.stripHTML = function (e, t) {
return e ? t ? e.replace(/(<([^>]+)>)/gi, "").replace(/'/g, "&#039;").replace(/"/g, "&quot;") : e.replace(/(<([^>]+)>)/gi, "") : void 0
}, t.toFileString = function (e) {
if (!e || "" === e) return "";
try {
e = JSON.parse(e)
} catch (n) {
return ""
}
for (var i = [], r = 0; r < e.length; r++)
if (e[r]) {
switch (e[r].type) {
case "video":
var o = new RegExp("(http|https)://(?:www.)?youtube.*?watch\\?v=([a-zA-Z0-9-_]+).*", "gi").exec(e[r].href);
o || (o = new RegExp("(http|https)://(?:www.)?youtu.be/([a-zA-Z0-9-_]+).*", "gi").exec(e[r].href)), text = '<div><a class="event_watch" data-href="' + o[2] + '" href="javascript:void(0)">' + '<img class="watch_video" alt="" src="' + t.DIR + 'img/str.png" />' + '<img alt="" src="' + t.PROTOCOL + "//img.youtube.com/vi/" + t.stripHTML(o[2]) + '/1.jpg" />' + "</a></div>";
break;
case "images":
var s;
s = "https:" == document.location.protocol ? e[r].href.replace("http", "https") : e[r].href, text = '<a class="event_hc_show_image" target="_blank" href="' + t.stripHTML(e[r].href) + '"><img style="max-width:200px !important; max-height:200px !important;" alt="" src="' + t.stripHTML(s) + '" /></a><br />';
break;
case "presentation":
text = '<div><a class="event_show_presentation" data-href="' + t.stripHTML(e[r].href) + '" href="javascript:void(0)"><img alt="" src="' + t.DIR + 'img/presentations.png" /></a></div>';
break;
case "geolocation":
text = '<div><a class="hc_show_geolocation" href="' + t.stripHTML(e[r].href) + '" target="_blank" title="Ссылка на карту Google с этим адресом">' + t.stripHTML(e[r].address) + "</a></div>"
}
i.push(text)
}
return i.join("<br/>")
}, t.toEditMessage = function (e) {
var n = new RegExp('<img class="hc_smile" src=' + t.DIR + "img/smile/3.png>", "g"),
i = new RegExp('<img class="hc_smile" src=' + t.DIR + "img/smile/1.png>", "g"),
r = new RegExp('<img class="hc_smile" src="' + t.DIR + 'img/smile/7.png">', "g"),
o = new RegExp('<img class="hc_smile" src=' + t.DIR + "img/smile/8.png>", "g"),
s = new RegExp('<img class="hc_smile" src=' + t.DIR + "img/smile/11.png>", "g"),
a = new RegExp('<img class="hc_smile" src=' + t.DIR + "img/smile/6.png>", "g");
return e.replace(/<br\/>/gi, "\n").replace(/<br>/gi, "\n").replace(n, "(:boring:)").replace(i, "(:smile:)").replace(r, "(:joy:)").replace(o, "(:wonder:)").replace(s, "(:cry:)").replace(a, "(:sly:)")
}, t.timeAgo = function (e) {
function n(e, n, i) {
if ("ar" != t.LANGUAGE) {
var r = 1 == e % 10 && 11 != e % 100 ? 0 : e % 10 >= 2 && 4 >= e % 10 && (10 > e % 100 || e % 100 >= 20) ? 1 : 2;
return e + " " + i[r] + " " + t._("ago")
}
return "seconds" == n ? 0 === e || 1 === e ? t._("ago") + " " + i[0] : e >= 2 && 10 >= e ? t._("ago") + " " + e + " " + i[1] : i[2] + " " + e : 0 === e || 1 === e ? t._("ago") + " " + i[0] : 2 === e ? t._("ago") + " " + i[1] : e >= 3 && 10 >= e ? t._("ago") + " " + e + " " + i[2] : t._("ago") + " " + e + " " + i[3]
}
var i = new Date,
r = e ? new Date(e) : i,
o = new Date(e).getHours() < 10 ? "0" + new Date(e).getHours() : new Date(e).getHours(),
s = new Date(e).getMinutes() < 10 ? "0" + new Date(e).getMinutes() : new Date(e).getMinutes();
new Date(e).getSeconds() < 10 ? "0" + new Date(e).getSeconds() : new Date(e).getSeconds();
var a = new Date(e).getFullYear(),
c = new Date(e).getMonth() + 1;
c = 0 === c ? 1 : c, c = 10 > c ? "0" + c : c;
var l = new Date(e).getDate() < 10 ? "0" + new Date(e).getDate() : new Date(e).getDate();
r > i && (r = i);
var d = i - r,
u = 1e3,
h = 60 * u,
p = 60 * h,
f = 24 * p;
t._get("years"), t._get("months");
var m, g = t._get("days"),
_ = t._get("hours"),
v = t._get("minutes"),
y = t._get("seconds"),
w = 1e3 * 60 * 60 * o;
if (isNaN(d) || 0 > d) return t._("now");
if (2 * u > d) return t._("now");
if (h > d) {
var b = Math.floor(d / u);
return n(b, "seconds", y)
}
if (2 * h > d) return t._("1 minutes ago");
if (p > d) {
var x = Math.floor(d / h);
return n(x, "minutes", v)
}
if (f > d) {
var k = Math.floor(d / p);
return n(k, "hours", _)
}
if (d > f && 2 * f - w > d) return t._("yesterday at", {
time: o + ":" + s
});
if (d > f && 3 * f - w > d) return t._("at the day before yesterday", {
time: o + ":" + s
});
if (7 * f > d) {
var S = Math.floor((d + w) / f);
return m = n(S, "days", g), m + " " + o + ":" + s
}
return i.getFullYear() == a ? l + "." + c + " " + o + ":" + s : a + "." + c + "." + l + " " + o + ":" + s
}, t.scrollToMes = function (e) {
var n, r, o = e.indexOf("#");
if (-1 != o) {
var s = e.indexOf("hcm="),
a = e.indexOf("hcp=");
if (-1 != s) n = e.slice(s + 4), r = i("#hc_message_" + n);
else {
if (-1 == a) return !0;
n = e.slice(a + 4), r = i("#hc_post_" + n)
}
return r.size() > 0 ? (r.offset().top, t.highlight(n), !0) : n
}
}, t.highlight_no_scroll = function (e) {
var t = i("#hc_message_" + e),
n = t.find(".e_comments_message").first();
setTimeout(function () {
n.important({
"background-color": "#fff2bc"
})
}, 50), setTimeout(function () {
n.important({
"background-color": ""
})
}, 250), setTimeout(function () {
n.important({
"background-color": "#fff2bc"
})
}, 450), setTimeout(function () {
n.important({
"background-color": ""
})
}, 2e3)
}, t.highlight = function (e) {
t.scroll(e, function () {
t.highlight_no_scroll(e)
})
}, t.scroll = function (t, n) {
var r = i("#hc_message_" + t),
o = r.offset().top;
i("body, html").animate({
scrollTop: o
}, function () {
n && "function" == typeof n && n()
}), e.call("scrollToMes", {
el: r[0]
})
}
}
}(this.HC);
HC.templates.push("<t name=\"hc_root\"><div class=\"hc hc_root hc_c\"><div class=\"hc_must_login e_must_login\">{{t \"You must be logged in to post a comment\"}}. <a href=\"javascript:void(0)\" class=\"hc_login_cl e_login_cl\">{{t \"Login\"}}</a></div><div class=\"hc_top_block e_hc_top_block\">{{include \"hc_user_online\"}}</div><div class=\"hc_clear\"></div><div class=\"hc_menu_box e_hc_menu_box\"></div><div id=\"hc_container\" class=\"hc_container e_hc_container\"></div></div></t><t name=\"hc_menu_options\"><div class=\"hc_menu_options\"><div rel=\"icon\" class=\"hc_logo_menu_box e_hc_menu_options\"><div class=\"hc_logo_menu_select e_hc_menu_opt\">{{? it.widget.hc}}<a href=\"javascript:void(0);\" class=\"e_hc_menu_hc\"><input type=\"checkbox\" class=\"hc_checkbox e_hc_checkbox\" checked=\"checked\"/>{{t \"Hypercomments\"}}</a>{{?}}{{? !it.widget.white_label}}<a onClick=\"_gaq.push(['_trackEvent', 'Referral', 'Click', '{{=it.href_referral}}']);\" href=\"{{=HC.HOST}}/pricing\" class=\"hc_take_code\" target=\"_blank\">{{t \"Code\"}}</a><a onClick=\"_gaq.push(['_trackEvent', 'Referral', 'Click', '{{=it.href_referral}}']);\" href=\"{{=HC.HOST}}\" class=\"hc_about\" target=\"_blank\">{{t \"About\"}}</a>{{?}}{{? !it.auth.acc_id}}<a href=\"javascript:void(0);\" class=\"e_hc_auth e_hc_post_login\">{{t \"Login\"}}</a>{{??}}<a href=\"javascript:void(0);\" class=\"e_hc_auth e_hc_post_logout\">{{t \"Logout\"}}</a>{{?}}</div><div rel=\"button\" class=\"hc_logo_menu\"></div></div><div class=\"hc_clear\"></div></div></t><t name=\"hc_footer\"><div id=\"hc_footer\" class=\"hc_footer\"><div class=\"hc_footer_rss e_hc_footer_rss\"><div class=\"hc_wrap_rss e_hc_wrap_rss\"></div><div class=\"hc_wrap_subsc\"><div class=\"hc_box_subsc e_hc_box_subsc\"><a class=\"hc_fotter_link hc_share hc_share_sign_up e_hc_email_subsc\" title=\"{{t \"Receive e-mail notifications\"}}\" href=\"javascript:void(0)\"></a><input type=\"text\" class=\"hc_subsc_input e_hc_subsc_input\" placeholder=\"e-mail\" /></div></div></div><div class=\"hc_footer_logo\"> {{? !it.white_label}} <a class=\"hc_fotter_link hc_footer_copy e_hc_footer_copy\" href=\"http://hypercomments.com\" target=\"_blank\"></a> {{?}} </div></div></t><t name=\"hc_rss\"><a class=\"hc_fotter_link hc_share hc_share_rss e_hc_share\" href=\"{{=it.link}}\" target=\"_blank\" data-service=\"rss\" title=\"RSS\"></a></t><t name=\"hc_menu_tab_comments\"><div class=\"hc_menu e_hc_menu hc_menu_active\" data-menu=\"comment\"><div class=\"hc_get_filters e_hc_get_filters\"></div><div id=\"e_hc_counter_mes\" class=\"hc_counter_mes\"></div>{{=HC._(\"tab_comments\")}}<ul class=\"hc_select_filter e_hc_select_filter\"><li class=\"e_hc_filter \" data-filter=\"all\"><div class=\"hc_logo_selected e_hc_logo_selected\"></div>{{t \"tab_all\"}}</li><li class=\"e_hc_filter\" data-filter=\"new\"><div class=\"hc_logo_selected e_hc_logo_selected\"></div>{{t \"tab_new\"}}</li><li class=\"e_hc_filter\" data-filter=\"popular\"><div class=\"hc_logo_selected e_hc_logo_selected\"></div>{{t \"tab_popular\"}}</li></ul></div></t><t name=\"hc_menu_tab_topics\"><div class=\"hc_menu e_hc_menu\" data-menu=\"topic\">{{t \"tab_topics\"}}</div></t><t name=\"hc_menu_tab_authors\"><div class=\"hc_menu e_hc_menu\" data-menu=\"author\">{{t \"tab_authors\"}}</div></t><t name=\"hc_menu_tab_context\"><div class=\"hc_menu e_hc_menu\" data-menu=\"context\">{{t \"tab_context\"}}</div></t><t name=\"hc_filter_all\"><div class=\"hc_filter e_hc_filter {{? it.active_class}}{{=it.active_class}}{{?}}\" data-filter=\"all\">{{t \"tab_all\"}}</div></t><t name=\"hc_filter_new\"><div class=\"hc_filter e_hc_filter {{? it.active_class}}{{=it.active_class}}{{?}}\" data-filter=\"new\">{{t \"tab_new\"}}<span></span></div></t><t name=\"hc_filter_popular\"><div class=\"hc_filter e_hc_filter {{? it.active_class}}{{=it.active_class}}{{?}}\" data-filter=\"popular\">{{t \"tab_popular\"}}</div></t><t name=\"hc_filter_category\"><li class=\"e_hc_filter\" data-filter=\"category\" data-catid=\"{{=it.id}}\"><div class=\"hc_logo_selected e_hc_logo_selected\"></div>{{=it.title}}</li></t><t name=\"hc_like\"><div id=\"hc_like\" class=\"hc_like_box\"><div class=\"hc_like e_hc_like\"><div class=\"hc_ic_like\" title='{{t \"I like\"}}'></div>{{t \"Like\"}} &nbsp;&nbsp;<span class=\"e_hc_count_likes\"></span>{{include \"hc_like_share\"}}</div><div class=\"hc_unlike e_hc_unlike\" title='{{t \"I do not like\"}}'><div class=\"hc_ic_unlike\"></div><span class=\"e_hc_count_unlikes\"></span></div></div></t><t name=\"hc_like_share\"><div class=\"hc_ic_like_soc_box e_hc_share_like\"><div class=\"hc_ic_like_soc_box_title\">{{t \"Share with friends\"}}<div class=\"hc_ic_like_soc_box_close e_hc_share_close\"></div></div><div class=\"hc_ic_like_soc_gplus e_hc_share\" data-service=\"google\"></div><div class=\"hc_ic_like_soc_fb e_hc_share\" data-service=\"facebook\"></div><div class=\"hc_ic_like_soc_tw e_hc_share\" data-service=\"twitter\"></div><div class=\"hc_ic_like_soc_vk e_hc_share\" data-service=\"vk\"></div><div class=\"hc_like_soc_box_a\"><div class=\"hc_like_soc_box_aX\"></div><div class=\"hc_like_soc_box_aa\"></div></div></div></t><t name=\"hc_user_online\"><div id=\"hc_user_online\" class=\"hc_user_online\"><div class=\"hc_online_box\"><div class=\"hc_count_user_online\">{{t \"people listening\"}} <span class=\"hc_span_count e_hc_span_count\"></span></div><div class=\"hc_avatar_online e_hc_avatar_online\"></div></div></div></t><t name=\"hc_avatar\">{{? it.acc_id}}{{? it.avatar}}{{? it.is_moderate}}<a target=\"_blank\" href=\"{{=HC.HOST}}/profile/{{=it.acc_id}}\"><img class=\"hc_avatar e_hc_avatar\" src=\"{{=it.avatar}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" title=\"{{!it.nick}}\"/></a>{{??}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=it.avatar}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" title=\"{{!it.nick}}\"/>{{?}}{{??}}{{? it.is_moderate}}<a target=\"_blank\" href=\"{{=HC.HOST}}/profile/{{=it.acc_id}}\"><img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.CDN_HOST}}/data/avatars/{{=it.acc_id}}/avatar\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" title=\"{{!it.nick}}\" /></a>{{??}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.CDN_HOST}}/data/avatars/{{=it.acc_id}}/avatar\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" title=\"{{!it.nick}}\" />{{?}}{{?}}{{??}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.Gravatar(null, it.md5email)}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" title=\"{{!it.nick}}\" />{{?}}</t><t name=\"hc_quote_avatar\">{{? it.parent.acc_id}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.CDN_HOST}}/data/avatars/{{=it.parent.acc_id}}/avatar\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" />{{??}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.Gravatar(null, it.md5email)}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" />{{?}}</t><t name=\"hc_content-comment\"><div class=\"hc_content\"><div id=\"hc_main_form\"></div><div class=\"hc_clear\"></div><div id=\"hc_rt_box\"></div><div id=\"hc_messages\" class=\"hc_messages\"></div><div class=\"hc_clear\"></div><div id=\"hc_pagin_more\" class=\"hc_pagin_more\"></div></div></t><t name=\"hc_content-topics\"><div class=\"hc_content\"><div id=\"hc_topics\"></div><div id=\"hc_messages\" class=\"hc_messages\"></div><div class=\"hc_clear\"></div><div id=\"hc_pagin_more\" class=\"hc_pagin_more\"></div></div></t><t name=\"hc_content-author\"><div class=\"hc_content\"><div id=\"hc_messages\" class=\"hc_messages\"></div><div class=\"hc_clear\"></div><div id=\"hc_pagin_more\" class=\"hc_pagin_more\"></div></div></t><t name=\"hc_content-hc\"><div class=\"hc_wrap\"><div class=\"hc_comment hc_c hc\"></div><div class=\"hc_comment_box hc_scroll_box hc_c hc\"></div></div></t>><t name=\"hc_comments_more\"><div id=\"hc_comments_more\" class=\"hc_comments_more\"><div class=\"hc_comments_more_text\">{{t \"More\"}} &nbsp;<span id=\"hc_more_count\">{{=it.count}}</span><img class=\"hc_more_preloader\" src=\"{{=HC.DIR}}img/loading.gif\" /></div></div></t><t name=\"hc_pagination\"><div id=\"hc_pagination\" class=\"hc_pagination\"></div><div class=\"hc_clear\"></div></t><t name=\"hc_pagination_list\"><a href=\"#\" data-page=\"{{=it.page}}\" class=\"hc_page e_hc_page {{=it.class_type}}\">{{=it.text}}</a></t><t name=\"hc_message\"><div id=\"hc_message_{{=it.id}}\" class=\"hc_message\"><div class=\"hc_message_menu e_hc_message_menu\"><div class=\"hc_message_menu_image e_hc_message_menu_image\"></div></div><div class=\"hc_lf_indicator\"></div><div class=\"hc_photo\"> {{include \"hc_avatar\"}}</div><div class=\"hc_comments_message e_comments_message\"><div><span class=\"hc_comments_nick e_hc_avatar\">{{!it.nick}}</span> {{? it.parent_nick && it.current_filter == 'all'}}<span class=\"hc_parent_nick e_hc_parent_nick\"> &#187; {{!it.parent_nick}}</span>{{?}} <span class=\"hc_comments_time e_comments_time\">{{=it.date}}</span><span class=\"hc_moderate_box e_moderate_box\"><b class=\"hc_moderate_caret\"></b></span><a href=\"javascript:void(0);\" title=\"{{t \"Comment Link\"}}\" class=\"hc_reply_link_logo e_hc_get_mes_link\"></a></div><div class=\"hc_message_text\">{{? it.parent && (!it.is_new || !it.is_resp) && it.current_filter != 'all'}}{{include \"hc_quotes\"}}{{?}}{{? !it.parent && it.parent_id && !it.hc_comment && it.current_filter != 'all' && it.current_filter != 'topic' }}{{include \"hc_quotes_del\"}}{{?}}{{? it.t}}<div id=\"{{=it.id}}\" data-id=\"{{=it.id}}\" class=\"hc_comments_text_hyper e_hc_quote_ht\"><span>{{=it.text}}</span></div>{{??}}<div class=\"hc_text e_hc_text\" id=\"{{=it.id}}\" data-id=\"{{=it.id}}\">{{=it.text}}</div>{{?}}<div class=\"hc_files_wrap e_hc_files_wrap\">{{=it.files}}</div></div><div class=\"hc_footer_link e_hc_message_foot\">{{? it.state && (it.state == 2 || it.state == 3)}}<span class=\"hc_premoderate_msg\">{{t \"Message Pre-Moderate\"}}</span>{{??}}<div class=\"hc_com_manager\">{{include \"hc_com_manager\"}}</div><span class=\"hc_rt_reply e_hc_rt_reply\" id=\"hc_rt_box_{{=it.id}}\"></span> {{?}} {{include \"vote\"}} </div></div><div class=\"hc_reply_form_box e_hc_reply_form\"></div><div class=\"hc_clear\"></div></div></t><t name=\"hc_com_manager\">{{? !it.readonly}}<a href=\"javascript:void(0);\" class=\"hc_reply_link e_hc_reply_link\" data-id=\"{{=it.id}}\">{{t \"Reply\"}}</a> {{? it.can_delete }} <a href=\"javascript:void(0);\" class=\"hc_reply_link e_hc_delete\">{{t \"Delete\"}}</a> {{?}} {{? it.can_edit }} <a href=\"javascript:void(0);\" class=\"hc_reply_link e_hc_edit\">{{t \"Edit\"}}</a> {{?}} {{?}} {{? it.current_filter != 'all' && it.current_filter != 'topic' && it.parent_id}} <a href=\"javascript:void(0);\" class=\"hc_reply_link e_hc_context\">{{t \"tab_context\"}}</a> {{?}}</t><t name=\"hc_quotes\">{{? !it.parent.t}} <div class=\"hc_quote\"> {{? !it.parent.state || it.parent.state == 1}}{{? it.parent.nick && !it.parent.t }}<div class=\"hc_photo_answer\"> {{include \"hc_quote_avatar\"}}</div><div class=\"hc_name_nick\">{{!it.parent.nick}}</div>{{?}}{{=it.parent.text}}{{??}}{{t \"Message deleted user\"}}{{?}} </div> {{??}} <div class=\"hc_quote_ht e_hc_quote_ht\"> {{=it.parent.text}} </div> {{?}}</t><t name=\"hc_quotes_del\"><div class=\"hc_quote\">{{t \"Message deleted user\"}}</div></t><t name=\"hc_attach_smile\"><div class=\"hc_attach_smile_box e_hc_attach_smile_box\"><img class=\"hc_smile hc_image_smile e_hc_image_smile\" data-text=\"(:smile:)\" alt=\":)\" src=\"{{=HC.DIR}}img/smile/1.png\" /><img class=\"hc_smile hc_image_smile e_hc_image_smile\" data-text=\"(:boring:)\" alt=\":(\" src=\"{{=HC.DIR}}img/smile/3.png\" /><img class=\"hc_smile hc_image_smile e_hc_image_smile\" data-text=\"(:joy:)\" alt=\":D\" src=\"{{=HC.DIR}}img/smile/7.png\" /><img class=\"hc_smile hc_image_smile e_hc_image_smile\" data-text=\"(:wonder:)\" alt=\":0\" src=\"{{=HC.DIR}}img/smile/8.png\" /><img class=\"hc_smile hc_image_smile e_hc_image_smile\" data-text=\"(:cry:)\" alt=\":'(\" src=\"{{=HC.DIR}}img/smile/11.png\" /><img class=\"hc_smile hc_image_smile e_hc_image_smile\" data-text=\"(:sly:)\" alt=\";)\" src=\"{{=HC.DIR}}img/smile/6.png\" /></div></t><t name=\"hc_comment_image\"><img style=\"max-width: 150px !important; max-height: 150px !important\" src=\"{{=it.src}}\" alt=\"{{=it.title}}\" /></t><t name=\"message_delete\"><div id=\"hc_message_{{=it.id}}\" class=\"hc_message\"><div class=\"hc_message_menu e_hc_message_menu\"><div class=\"hc_message_menu_image e_hc_message_menu_image\"></div></div><div class=\"hc_photo\"><img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.CDN_HOST}}/data/avatars/0/avatar\" /></div><div class=\"hc_comments_message\"><div class=\"hc_message_remove\">{{? it.reason_del}}<span class=\"hc_italic\">{{!it.reason_del}}</span>{{??}}{{t \"Message deleted user\"}}.{{?}}</div></div></div></t><t name=\"message_remove\"><div class=\"hc_message_remove\"> {{? it.reason_del}}<span class=\"hc_italic\">{{!it.reason_del}}</span>{{??}}{{t \"Message deleted user\"}}.{{?}} </div></t><t name=\"vote\"><div class=\"hc_voting_for_post\">{{? it.vote < 0}}<div class=\"hc_voting_minus e_hc_voting\">{{=it.vote}}</div>{{??}}<div class=\"hc_voting_plus e_hc_voting\">{{=it.vote}}</div>{{?}} <a href=\"javascript:void(0);\" class=\"hc_bad e_hc_vote\" data-vote=\"dn\" title='{{t \"Bad comment\"}}'><span class=\"hc_vote_text\">{{t \"Not agree\"}}</span>&nbsp;</a><a href=\"javascript:void(0);\" class=\"hc_good e_hc_vote\" data-vote=\"up\" title='{{t \"Good comment\"}}'><span class=\"hc_vote_text\">{{t \"Agree\"}}</span>&nbsp;</a></div></t><t name=\"hc_reply_form\"><div class=\"hc_reply_form e_hc_reply_form\">{{? !it.config.readonly}}<div class=\"hc_reply_form_textarea_box\"><div class=\"hc_reply_form_photo\"><div class=\"hc_avatar_me\"><img class=\"hc_avatar e_hc_avatar\" src=\"{{=it.me.avatar_src}}\" /><div class=\"hc_acc_type e_hc_acc_type\"></div></div></div><div class=\"hc_reply_box\"><textarea class=\"hc_reply_textarea e_hc_reply_textarea\" placeholder='{{t \"Add new comment\"}}...'></textarea><div rel=\"close\" class=\"hc_close_reply e_hc_close_reply\">&nbsp;</div><div class=\"hc_reply_attach_type_box\"> {{? it.config.smile}}<div class=\"hc_attach_type hc_attach_smiles e_hc_attach e_hc_box_smile\" data-type=\"smile\"></div> {{?}} {{? it.config.image || it.config.video || it.config.presentation}} <div class=\"hc_attach_type hc_attach_clip e_hc_attach e_hc_box_attach\" data-type=\"clip\"></div> {{?}}</div><div class=\"hc_speech_block e_hc_speech_block\"><input class=\"hc_speech_in e_hc_speech_in\" type=\"text\" speech=\"speech\" x-webkit-speech=\"x-webkit-speech\" x-webkit-grammar=\"builtin:translate\" tabindex=\"-1\"></div></div><div class=\"hc_clear\"></div><div class=\"hc_reply_footer e_hc_reply_footer\"><div class=\"hc_attach_files e_hc_attach_files\"></div><div class=\"hc_clear\"></div><div class=\"hc_crossposting e_hc_crossposting\"><input type=\"checkbox\" rel=\"button\" class=\"hc_crosspost_input\" />{{t \"crossposting to\"}} <span rel=\"service\"></span></div><div class=\"hc_repry_btns\"><div class=\"hc_reply_button e_hc_reply_button\">{{t \"Add comment\"}}</div>{{? it.config.category}}<div class=\"hc_select_cat\"><div class=\"hc_category e_hc_category\"><span class=\"e_name_cat\">{{t \"Category\"}}</span><img src=\"{{=HC.DIR}}img/localization.png\" class=\"hc_category_in\"><ul class=\"hc_select_cat_ul e_hc_select_cat_ul\"></ul></div></div>{{?}}</div><div class=\"hc_clear\"></div></div></div>{{?}}</div></t><t name=\"hc_attach_clip\"><div class=\"hc_attach_clip_box e_hc_attach_clip_box\"> {{? it.image}} <div class=\"hc_block_attach e_hc_attach\" data-type=\"image\"><div class=\"hc_attach_text\">{{t \"Image\"}}</div><div class=\"hc_attach_type_inbox hc_attach_type hc_attach_photo\"></div></div><form id=\"hc_form_send\" method=\"POST\" enctype=\"multipart/form-data\" action=\"{{=HC.HOST}}/upload/image\"><input type=\"hidden\" name=\"action\" value=\"add_image\" /><input type=\"hidden\" name=\"orign\" value=\"{{=it.orign}}\" /><input type=\"hidden\" name=\"target\" class=\"e_hc_target\" value=\"\" /><input type=\"file\" name=\"file\" class=\"hc_file_input e_media_upload\" accept=\"image/*\"></form> {{?}} {{? it.video}} <div class=\"hc_block_attach e_hc_attach\" data-type=\"video\"><div class=\"hc_attach_text\">{{t \"Video\"}}</div><div class=\"hc_attach_type_inbox hc_attach_type hc_attach_video\"></div></div> {{?}} {{? it.presentation}} <div class=\"hc_block_attach e_hc_attach\" data-type=\"presentation\"><div class=\"hc_attach_text\">{{t \"Presentation\"}}</div><div class=\"hc_attach_type_inbox hc_attach_type hc_attach_presentation\"></div></div> {{?}} </div></t><t name=\"hc_attach_file\"><div class=\"hc_attach_file e_hc_attach_file\"><img alt=\"\" src=\"{{!it.preview}}\" /><a class=\"e_hc_attach_file_drop\" href=\"javascript:void(0)\"><img src=\"{{=HC.DIR}}img/hc_ic_close.png\" /></a></div></t><t name=\"opt_category\"><li class=\"e_select_cat\" data-id=\"{{=it.id}}\">{{=it.title}}</li></t><t name=\"hc_moderate_box\"><ul class=\"hc_dropdawn_menu e_hc_dropdawn_menu\"><li class=\"e_hc_spam\" data-moderate=\"1\">{{t \"Mark as spam\"}}</li><li class=\"e_hc_delete\" data-moderate=\"1\">{{t \"Delete\"}}</li><li class=\"e_hc_blacklist\" data-moderate=\"1\">{{t \"Black list\"}}</li><li data-moderate=\"1\"><a href=\"{{=it.url}}\" target=\"_blank\">{{t \"Moderate\"}}</a></li></ul></t><t name=\"hc_user_moderate_box\"><ul class=\"hc_dropdawn_menu e_hc_dropdawn_menu\"><li class=\"e_hc_user_spam\">{{t \"Mark as spam\"}}</li><li class=\"e_hc_complain\">{{t \"Complain\"}}</li></ul></t><t name=\"hc_complain\"><div class=\"hc_complain e_hc_complain_box\"><img src=\"{{=HC.DIR}}img/close_hc.png\" class=\"hc_complain_close_right e_hc_complain_close\"/><div class=\"hc_complain_title\">{{t \"Complain\"}}</div><div class=\"hc_complain_content\"><div class=\"hc_photo_ava\">{{? it.comment.acc_id}}<a class=\"e_ava\" target=\"_blank\" href=\"{{=HC.HOST}}/profile/{{=it.comment.acc_id}}\"><img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.CDN_HOST}}/data/avatars/{{=it.comment.acc_id}}/avatar\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" /></a>{{??}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.Gravatar(null, it.comment.md5email)}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" />{{?}}</div><div class=\"hc_complain_box\"><div class=\"hc_complain_info\"><span class=\"hc_comments_nick e_hc_avatar\">{{!it.comment.nick}}</span><span class=\"hc_comments_time e_comments_time\">{{=it.comment.date}}</span></div><div class=\"hc_complain_text\"><div class=\"hc_text e_hc_text\">{{=it.comment.text}}</div></div></div></div><div class=\"hc_complain_form\"><div class=\"hc_photo_ava\">{{? it.auth.acc_id}}<a class=\"e_ava\" target=\"_blank\" href=\"{{=HC.HOST}}/profile/{{=it.auth.acc_id}}\"><img class=\"hc_avatar e_hc_avatar\" src=\"{{=it.auth.avatar_src}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" /></a>{{??}}<img class=\"hc_avatar e_hc_avatar\" src=\"{{=HC.Gravatar(null, it.auth.md5email)}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" />{{?}}</div><div class=\"hc_compl\"><textarea class=\"hc_complain_textarea e_hc_complain_textarea\" placeholder='{{t \"Add new comment\"}}...'></textarea><div class=\"hc_reply_button e_hc_send_complain\">{{t \"Send\"}}</div></div></div></div></t><t name=\"user_warning\"><div class=\"hc_complain e_user_warning\"><img src=\"{{=HC.DIR}}img/close_hc.png\" class=\"hc_complain_close_right e_user_warning\"/><div class=\"hc_complain_title_warning\">{{t \"Warning\"}}</div><div class=\"hc_complain_content_warning\">{{!it.text}}</div></div></t><t name=\"hc_notify_box\"><div class=\"hc_notify_mess\">{{=it.text}}</div></t><t name=\"hc_edit_message\"><textarea class=\"hc_get_link_textarea e_hc_edit_textarea\" style=\"height: auto !important; margin-left:0!important\">{{=it.text}}</textarea><div class=\"hc_edit_action\"><a class=\"hc_page e_hc_edit_save\">{{t \"Save\"}}</a><a class=\"hc_page e_hc_edit_cancel\">{{t \"Cancel\"}}</a></div></t><t name=\"hc_get_link\"><textarea class=\"hc_get_link_textarea e_hc_get_link_textarea\">{{=it.link}}</textarea></t><t name=\"hc_topic\"><div class=\"e_hc_topic\"><div class=\"hc_topic e_hc_topic_title\"><div class=\"hc_topic_nav\"><div class=\"hc_topic_nav_up e_hc_topic_nav_up\" title='{{t \"See topic comments\"}}'>{{t \"All topics\"}}</div><div class=\"hc_topic_nav_back e_hc_topic_nav_back\" title='{{t \"Previous\"}}'></div><div class=\"hc_topic_nav_next e_hc_topic_nav_next\" title='{{t \"Next\"}}'></div></div><div class=\"hc_topic_title_text\">{{=it.text}}<div class=\"hc_clear\"></div></div><div class=\"hc_topic_counter_comment e_hc_topic_counter_comment\"><div class=\"hc_ic_comments_topic\"></div><div class=\"hc_topic_counter_text\">{{=it.children}}</div></div><div class=\"hc_clear\"></div></div><div class=\"e_hc_topic_form\"></div><div class=\"hc_clear\"></div></div></t><t name=\"hc_author\"><div class=\"hc_author\"><div class=\"e_hc_author\"><div class=\"hc_social_icons\"></div><div class=\"hc_photo\"> {{include \"hc_avatar\"}}</div><div class=\"hc_author_info\"><div class=\"hc_author_nick\">{{!it.nick}}</div><div class=\"hc_author_info_data\"><div class=\"hc_author_rating\"><a target=\"_blank\" href=\"{{=HC.HOST}}/profile/{{=it.acc_id}}\">{{t \"Profile\"}}</a></div></div></div><div class=\"hc_clear\"></div></div><div class=\"hc__block_like\"><div class=\"hc_block_like_comments\"><div class=\"hc_ic_comments_topic\"></div>{{!it.count}}</div><div class=\"hc_block_like_comments\"><div class=\"hc_ic_like\" title=\"Мне нравится эта страница\"></div>{{!it.vote_up || '0'}}</div><div class=\"hc_block_like_comments\" style=\"border-right: none!important;\"><div class=\"hc_ic_unlike\"></div>{{!it.vote_dn || '0'}}</div></div></div></t><t name=\"hc_auth_box\"><div class=\"hc_authorization_box\"><a href=\"javascript:void(0)\"><img src=\"{{=HC.DIR}}img/icons/schlisen.png\"/ class=\"hc_schlisen e_hc_schlisen\"></a><div class=\"hc_authorization_title\">{{t \"Authorization\"}}</div><div class=\"hc_authorization_logos e_hc_authorization_logos\">{{? it.model.hc_auth}}<a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"google\" href=\"\"><div class=\"hc_av_google hc_av_logo\" style=\"margin-left: 18px;\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"facebook\" href=\"\"><div class=\"hc_av_facebook hc_av_logo\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"twitter\" href=\"\"><div class=\"hc_av_twitter hc_av_logo\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"vkontakte\" href=\"\"><div class=\"hc_av_vkontakte hc_av_logo\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"odnoklassniki\" href=\"\"><div class=\"hc_av_odnoklassniki hc_av_logo\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"mailru\" href=\"\"><div class=\"hc_av_mailru hc_av_logo\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"yandex\" href=\"\"><div class=\"hc_av_yandex hc_av_logo\"></div></a><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"openid\" href=\"\"><div class=\"hc_av_openid hc_av_logo\"></div></a>{{?}}{{? it.model.platform == 'wordpress' && it.model.auth_url && it.model.site_auth}}<a class=\"hc_auth_type_bt event_site_auth\" data-service=\"wordpress\" href=\"\"><div class=\"hc_av_w hc_av_logo\"></div></a>{{?}}{{? it.model.auth_logo && it.model.auth_title && it.model.auth_url}}<a class=\"hc_auth_type_bt event_site_auth\" data-service=\"{{!it.model.auth_title}}\" href=\"{{!it.model.auth_url}}\"><img class=\"hc_av_site hc_av_logo\" title=\"{{!it.model.auth_title}}\" src=\"{{!it.model.auth_logo}}\" /></a>{{?}}</div>{{? it.model.guest_comments && it.action !='login'}}<div class=\"hc_anonymous_box\"><div class=\"hc_anonymous_title\">{{t \"Anonymously\"}}:</div><input id=\"event_nick_guest\" type=\"text\" placeholder=\"{{t \"Enter your nick\"}}\" class=\"hc_input_nik\"><input id=\"event_email_guest\" type=\"text\" placeholder=\"E-mail\" class=\"hc_input_mail\"><div class=\"hc_enter event_publish_guest\">{{t \"Send\"}}</div></div>{{?}}</div></t><t name=\"auth_item\"><a class=\"hc_auth_type_bt event_auth_type_bt\" data-service=\"{{!it.service}}\" href=\"\"><div class=\"hc_av_{{!it.service}} hc_av_logo\"></div></a></t><t name=\"hc_error\"><div class=\"hc_mess_error\">{{=it.text}}</div></t><t name=\"hc_video_box\"><div class=\"hc_image_box e_hc_popup_box\"><a href=\"hc_image_box_close\"></a>{{include \"popup_video\"}}</div></t><t name=\"popup_video\"><div class=\"video_add_box\"><div><div class=\"hc_title\">{{t \"Youtube\"}}</div><div class=\"hc_mes e_hc_mes\"></div><img class=\"hc_popup_icon\" alt=\"\" src=\"{{=HC.DIR}}img/youtube.png\" style=\"float:left;width: 80px;margin: 0 20px;\" /><textarea class=\"hc_video_code\" id=\"hc_video_code\"></textarea><div style=\"clear:both;\"></div></div><div class=\"hc_add_footer\"><div class=\"hc_footer_links\"><a href=\"javascript:void(0);\" class=\"hc_bt_blue event_button_add\" title='{{t \"Attach\"}}'>{{t \"Attach\"}}</a><a href=\"javascript:void(0);\" class=\"hc_bt_gray event_button_close\" title='{{t \"Cancel\"}}' >{{t \"Cancel\"}}</a></div></div></div></t><t name=\"hc_present_box\"><div class=\"hc_image_box e_hc_popup_box\"><a href=\"hc_image_box_close\"></a>{{include \"popup_presentation\"}}</div></t><t name=\"popup_presentation\"><div class=\"hc_video_add_box\"><div style=\"padding-bottom:70px;\"><div class=\"hc_title\"> {{t \"Insert the HTML\"}} <span class=\"hc_mini_title\" style=\"font-size:12px;\">({{t \"only for google\"}})</span></div><div class=\"hc_mes e_hc_mes\"></div><img class=\"hc_popup_icon\" alt=\"\" src=\"{{=HC.DIR}}img/Presentation-64.png\" style=\"float:left;margin: 0 20px;\" /><textarea class=\"hc_presentation_code\" id=\"hc_presentation_code\"></textarea><div style=\"clear:both;\"></div></div><div class=\"hc_add_footer\"><div class=\"hc_footer_links\"><a href=\"javascript:void(0);\" class=\"hc_bt_blue event_button_add\" title='{{t \"Attach\"}}'>{{t \"Attach\"}}</a><a href=\"javascript:void(0);\" class=\"hc_bt_gray event_button_close\" title='{{t \"Cancel\"}}' >{{t \"Cancel\"}}</a></div></div></div></t><t name=\"background\"><div class=\"hc_hide_background\"></div></t><t name=\"hc_access_denied\"><div class=\"hc_access_denied\">{{t \"Message access denied\"}}</div></t><t name=\"hypertext_menu\"><span class=\"hc_hypertext_dialog_menus hc_hypertext_menu_selected\"><span class=\"hc_hypertext_add_text text_selected hc_text_com\">{{t \"Comment\"}}</span></span></t><t name=\"hc_box\"><div class=\"hc_widget\" style=\"top:{{=it.top}};left:{{=it.left}}\"><img src=\"{{=HC.DIR}}img/close_hc.png\" class=\"hc_close_left e_hc_hypertext_close\" style=\"display: none\"/><img src=\"{{=HC.DIR}}img/close_hc.png\" class=\"hc_close_right e_hc_hypertext_close\"/><div class=\"hc_content_ht\"></div><div class=\"hc_triangle_left\"></div><div class=\"hc_triangle_white_left\"></div><div class=\"hc_triangle_right\" style=\"display: none\"></div><div class=\"hc_triangle_white_right\" style=\"display: none\"></div></div></t><t name=\"hc_box_mini\"><div class=\"hc_widget_mini hc_resize_height\" style=\"top:{{=it.top}};left:{{=it.left}}\"><img src=\"{{=HC.DIR}}img/close_hc.png\" class=\"hc_close_left e_hc_hypertext_close\" style=\"display: none\"/><img src=\"{{=HC.DIR}}img/close_hc.png\" class=\"hc_close_right e_hc_hypertext_close\"/><div class=\"hc_content_ht\"></div><div class=\"hc_triangle_left\"></div><div class=\"hc_triangle_white_left\"></div><div class=\"hc_triangle_right\" style=\"display: none\"></div><div class=\"hc_triangle_white_right\" style=\"display: none\"></div></div></t><t name=\"hc_mix_root\"><div class=\"hc hc_c hc_mix_root\"><div class=\"hc_mix_menu\"><div class=\"hc_mix_menu_tab e_hc_menu\" data-menu=\"last\">{{=HC._(\"tab_new\")}}</div><div class=\"hc_mix_menu_tab e_hc_menu\" data-menu=\"popular\">{{=HC._(\"tab_popular\")}}</div></div><div class=\"hc_mix_title e_hc_mix_title\"></div><div id=\"hc_mix_container\" class=\"hc_mix_container e_mix_hc_container\"></div></div></t><t name=\"hc_mix_last\"><div class=\"hc_mix_comments_box\"><div class=\"hc_mix_img\"> {{? it.acc_id}} {{? it.avatar}} <img style=\"width: 36px !important;\" class=\"hc_avatar\" src=\"{{=it.avatar}}\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" /> {{??}} <img style=\"width: 36px !important;\" class=\"hc_avatar\" src=\"{{=HC.CDN_HOST}}/data/avatars/{{=it.acc_id}}/avatar\" onerror=\"if(this.src != '{{=HC.CDN_HOST}}/data/avatars/0/avatar')this.src='{{=HC.CDN_HOST}}/data/avatars/0/avatar';\" /> {{?}} {{??}} <img style=\"width: 36px !important;\" class=\"hc_avatar\" src=\"{{=HC.Gravatar(null, it.md5email)}}\" /> {{?}} </div><div class=\"hc_mix_comment\"><span class=\"hc_mix_author\">{{!it.nick}}</span><span class=\"hc_mix_span_data\">{{=it.date}}</span><div class=\"hc_mix_text\">{{=it.text}}</div><div>{{= it.files}}</div></div><div class=\"hc_clear\"></div><div class=\"hc_mix_info\"><span class=\"hc_mix_link\"><a href=\"{{=it.link}}#hcm={{!it.id}}\">{{!it.title}}</a></span></div></div></t><t name=\"hc_mix_popular\"><div class=\"hc_mix_comments_box\"><div class=\"hc_mix_popular_link\"><a class=\"e_hc_redirect\" href=\"//{{=it.href}}\">{{!it.title}}</a></div><div class=\"hc_mix_popular_info\"><span class=\"hc_mix_link_comment\">{{!HC._(\"Comments\")}} ({{!it.cm2}})</span></div></div></t><t name=\"hc_identifier\"><div id=\"hc_identifier_box\"><div class=\"hc_ident e_hc_ident\"><span class=\"hc_ident_counter\">{{t \"New Comments\"}} <b class=\"hc_counter_num\">({{=it.counter}})</b></span><span class=\"hc_ident_destroy\"></span><span class=\"hc_notify_up\"></span><span class=\"hc_notify_down\"></span></div></div></t><t name=\"hc_realtime_top\"><div class=\"hc_realtime_top e_hc_realtime_top\">{{t \"Show New Comments\"}} (<span class=\"e_hc_rt_counter\">{{=it.count}}</span>)</div></t><t name=\"hc_realtime_reply\"><span class=\"hc_rt_cont\" id=\"hc_rt_{{=it.id}}\"><span id=\"hc_rt_line_{{=it.id}}\" class=\"hc_rt_line\"></span><span class=\"hc_realtime_reply\">{{t \"replies\"}} (<span id=\"hc_rt_counter_{{=it.id}}\">{{=it.count}}</span>)</span></span></t> ");
! function (e) {
var t = {};
t.Send = "Відправити", t.Cancel = "Відмінити", t["Attach more"] = "Підкрипіти ще", t.Attach = "Підкрипити", t.tab_comments = "Коментарі", t.tab_topics = "Теми", t.tab_authors = "Автори", t.tab_all = "Всі", t.tab_new = "Нові", t.tab_popular = "Популярні", t.tab_context = "Контекст", t.Hypercomments = "Коментарі", t.Code = "Узяти віджет собі", t.About = "Про сервіс", t.Login = "Увійти", t.Logout = "Вийти", t["No comments"] = "Поки що нема коментарів до цієї фрази", t["Add comment"] = "Коментувати", t["Add new comment"] = "Введіть текст повідомлення", t["Select a category"] = "Виберіть категорію", t.Image = "Зображення", t.Presentation = "Презентація", t.Video = "Видеозапис", t["crossposting to"] = "опублікувати в", t.Reply = "Відповісти", t.Comments = "Коментарів", t.Rating = "Рейтинг", t.More = "Ще коментарі", t["Bad comment"] = "Поганий коментарій", t["Good comment"] = "Добрий коментарій", t["See topic comments"] = "Подивитись коментарі у топіку", t["Message deleted"] = "Повідомлення було видалено адміністратором", t["Message access denied"] = "Вы не можете опубліковувати повідомлення на цьому сайті", t["Message Pre-Moderate"] = "Повідомлення буде опубліковане після перевірки", t.Link = "Посилання", t["Message deleted user"] = "Повідомлення було видалено", t.Restore = "Відновити", t.Agree = "Згоден", t["Not agree"] = "Не згоден", t["New comment"] = "Новий коментар", t["Mark as read"] = "Відзначити як прочитане", t["You must be logged in to post a comment"] = "Ви повинні авторизуватися щоб залишати коментарі", t["User page"] = "Сторінка користувача", t.First = "Перша", t.Last = "Остання", t["Full profile"] = "Повний профіль", t.Save = "Зберегты", t.Cancel = "Скасувати", t["Mark as spam"] = "Спам", t["Black list"] = "Чорний список", t.Delete = "Видалити", t.Blockade = "Блокувати", t.Spam = "Спам", t["Enter your message before sending"] = "Введіть текст повідомлення перед відправкою", t.years = ["рік", "роки", "років"], t.months = ["місяць", "місяца", "місяців"], t.days = ["день", "дня", "днів"], t.hours = ["година", "години", "годин"], t.minutes = ["хвилина", "хвилини", "хвилин"], t.seconds = ["секунда", "секунди", "секунд"], t.now = "тілько що", t.ago = "назад", t["ago at"] = "назад до", t["1 minutes ago"] = "біля хвилини назад", t["yesterday at"] = "вчора у {time}", t["at the day before yesterday"] = "позавчора в {time}", t["Add images"] = "Прикрипіти зображення", t["with computer"] = "З комп'ютера", t["from the Internet"] = "З Інтернета", t.or = "або", t["Select file"] = "Выбрати файл з комп'ютера", t["Drag the image into this box"] = "Перемістить зображення у це вікно", t.Anonymously = "Анонімно", t["Enter your nick"] = "Введіть Ваш нік", t["Log in under your account"] = "Вхід під аккаунтом", t["Your user name is too big"] = "Ваш ник занадто великий", t["only for google"] = "тільки для Google документів", t["Insert the HTML"] = "Вставте HTML код презентациї", t.Youtube = "Вставте HTML код відео з YouTube", t["Enter the address of the page with the video"] = "Вкажіть адрес сторінки з видео", t["I like"] = "Мені подобається ця сторінка", t["I do not like"] = "Мені не подобається ця сторінка", t["Share with friends"] = "Поділіться з друзями", t["like it"] = "це подобається", t.Like = "Подобається", t["All topics"] = "Всі теми", t.Next = "Наступна", t.Previous = "Попередня", t.Comment = "Коментувати", t["You can highlight and comment on any word or phrase in the text"] = "Можна виділити і прокоментувати будь-яке слово або фразу в тексті", t["Allocated a large block of text that is better to comment under the article"] = "Виділено великий фрагмент тексту, який краще коментувати під статтею", t["New Comments"] = "Нові коментарі", t.Complain = "Поскаржитись", t.ban_user = "Користувач заблокований", t.complain_send = "Скарга відправлена", t.Warning = "Попередження", t.Subscribe = "Підписатися", t["Comment Link"] = "Посилання на коментар", t.comment_length = "На жаль, ваш коментар занадто довгий. Будь ласка, відредагуйте його і спробуйте ще раз.", t.Authorization = "Авторизація", t.Edit = "Редагувати", t.replies = "відповідей", t["Show New Comments"] = "Нові коментарі", t["Your message is defined as flood"] = "Ваше повідомлення визначено як флуд", t["Receive e-mail notifications"] = "Отримувати повідомлення електронною поштою", e._ = function (e, n) {
if (!(e in t)) return e;
var i = t[e];
return n || (n = {}), i.replace(/\{([\w\.]*)\}/g, function (e, t) {
var i = t.split(".");
if (t = i.shift(), t in n) var o = n[t];
else o = "";
for (var r = 0; r < i.length; r++) o = o[i[r]];
return null === o || void 0 === o ? "" : o
})
}, e._get = function (e) {
return e ? t[e] : t
}, e.LANGUAGE = "uk"
}(HC);;
HC.LANGUAGE = "uk";
HC.WS = {
"premoderation": false,
"template": "index",
"hypertext": "*",
"enableParams": false,
"plugins": "rss,login,topics,authors,hypercomments,like",
"limit": 20,
"status": 1,
"plan": 1,
"guest_comments": true,
"hc_auth": true,
"site_auth": false,
"ignored": "img",
"smile": true,
"image": true,
"video": true,
"presentation": true,
"filters": null,
"default_filter": null,
"hypertext_color": null,
"wp_url": null,
"reverse": true,
"identifier": true,
"crossposting": false,
"category": null,
"pagination": false,
"user_online": true,
"readonly": false,
"cluster": "c1"
};
HC.VERSION = '20130808060353';
HC.SVERSION = '20130808060353';
HC.appInit();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment