" !== t[1] || mb.test(d) ? 0 : m : m.firstChild) && d.childNodes.length; g--;)e.nodeName(k = d.childNodes[g], "tbody") && !k.childNodes.length && d.removeChild(k); e.merge(v, m.childNodes); for (m.textContent = ""; m.firstChild;)m.removeChild(m.firstChild);
m = q.lastChild
} else v.push(b.createTextNode(d)); m && q.removeChild(m); e.support.appendChecked || e.grep(u(v, "input"), E); for (B = 0; d = v[B++];)if ((!h || -1 === e.inArray(d, h)) && (f = e.contains(d.ownerDocument, d), m = u(q.appendChild(d), "script"), f && C(m), c)) for (g = 0; d = m[g++];)nb.test(d.type || "") && c.push(d); return q
}, cleanData: function (a, b) {
for (var c, g, h, d, f = 0, m = e.expando, l = e.cache, k = e.support.deleteExpando, t = e.event.special; null != (c = a[f]); f++)if ((b || e.acceptData(c)) && (h = c[m], d = h && l[h])) {
if (d.events) for (g in d.events) t[g] ?
e.event.remove(c, g) : e.removeEvent(c, g, d.handle); l[h] && (delete l[h], k ? delete c[m] : typeof c.removeAttribute !== P ? c.removeAttribute(m) : c[m] = null, qa.push(h))
}
}
}); var ra, fa, la, Ra = /alpha\([^)]*\)/i, dc = /opacity\s*=\s*([^)]*)/, ec = /^(top|right|bottom|left)$/, fc = /^(none|table(?!-c[ea]).+)/, ob = /^margin/, Bb = RegExp("^(" + Da + ")(.*)$", "i"), Ba = RegExp("^(" + Da + ")(?!px)[a-z%]+$", "i"), gc = RegExp("^([+-])=(" + Da + ")", "i"), Za = { BODY: "block" }, hc = { position: "absolute", visibility: "hidden", display: "block" }, pb = { letterSpacing: 0, fontWeight: 400 },
ea = ["Top", "Right", "Bottom", "Left"], Ya = ["Webkit", "O", "Moz", "ms"]; e.fn.extend({ css: function (a, c) { return e.access(this, function (a, c, g) { var h = {}, d = 0; if (e.isArray(c)) { var f = fa(a); for (g = c.length; g > d; d++)h[c[d]] = e.css(a, c[d], !1, f); return h } return g !== b ? e.style(a, c, g) : e.css(a, c) }, a, c, 1 < arguments.length) }, show: function () { return x(this, !0) }, hide: function () { return x(this) }, toggle: function (a) { var b = "boolean" == typeof a; return this.each(function () { (b ? a : k(this)) ? e(this).show() : e(this).hide() }) } }); e.extend({
cssHooks: {
opacity: {
get: function (a,
b) { if (b) return a = la(a, "opacity"), "" === a ? "1" : a }
}
}, cssNumber: { columnCount: !0, fillOpacity: !0, fontWeight: !0, lineHeight: !0, opacity: !0, orphans: !0, widows: !0, zIndex: !0, zoom: !0 }, cssProps: { "float": e.support.cssFloat ? "cssFloat" : "styleFloat" }, style: function (a, c, h, d) {
if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
var g, f, m, l = e.camelCase(c), k = a.style; if (c = e.cssProps[l] || (e.cssProps[l] = G(k, l)), m = e.cssHooks[c] || e.cssHooks[l], h === b) return m && "get" in m && (g = m.get(a, !1, d)) !== b ? g : k[c]; if (f = typeof h, "string" === f && (g = gc.exec(h)) &&
(h = (g[1] + 1) * g[2] + parseFloat(e.css(a, c)), f = "number"), !(null == h || "number" === f && isNaN(h) || ("number" !== f || e.cssNumber[l] || (h += "px"), e.support.clearCloneStyle || "" !== h || 0 !== c.indexOf("background") || (k[c] = "inherit"), m && "set" in m && (h = m.set(a, h, d)) === b))) try { k[c] = h } catch (wc) { }
}
}, css: function (a, c, h, d) {
var g, f, m, l = e.camelCase(c); return c = e.cssProps[l] || (e.cssProps[l] = G(a.style, l)), m = e.cssHooks[c] || e.cssHooks[l], m && "get" in m && (f = m.get(a, !0, h)), f === b && (f = la(a, c, d)), "normal" === f && c in pb && (f = pb[c]), "" === h || h ? (g =
parseFloat(f), !0 === h || e.isNumeric(g) ? g || 0 : f) : f
}, swap: function (a, b, c, e) { var g, h = {}; for (g in b) h[g] = a.style[g], a.style[g] = b[g]; c = c.apply(a, e || []); for (g in b) a.style[g] = h[g]; return c }
}); a.getComputedStyle ? (fa = function (b) { return a.getComputedStyle(b, null) }, la = function (a, c, h) {
var g, d, f, m = (h = h || fa(a)) ? h.getPropertyValue(c) || h[c] : b, l = a.style; return h && ("" !== m || e.contains(a.ownerDocument, a) || (m = e.style(a, c)), Ba.test(m) && ob.test(c) && (g = l.width, d = l.minWidth, f = l.maxWidth, l.minWidth = l.maxWidth = l.width = m, m = h.width,
l.width = g, l.minWidth = d, l.maxWidth = f)), m
}) : z.documentElement.currentStyle && (fa = function (a) { return a.currentStyle }, la = function (a, c, h) { var g, e, d; h = (h = h || fa(a)) ? h[c] : b; var f = a.style; return null == h && f && f[c] && (h = f[c]), Ba.test(h) && !ec.test(c) && (g = f.left, e = a.runtimeStyle, d = e && e.left, d && (e.left = a.currentStyle.left), f.left = "fontSize" === c ? "1em" : h, h = f.pixelLeft + "px", f.left = g, d && (e.left = d)), "" === h ? "auto" : h }); e.each(["height", "width"], function (a, c) {
e.cssHooks[c] = {
get: function (a, g, h) {
return g ? 0 === a.offsetWidth &&
fc.test(e.css(a, "display")) ? e.swap(a, hc, function () { return K(a, c, h) }) : K(a, c, h) : b
}, set: function (a, b, g) { var h = g && fa(a); return Q(a, b, g ? y(a, c, g, e.support.boxSizing && "border-box" === e.css(a, "boxSizing", !1, h), h) : 0) }
}
}); e.support.opacity || (e.cssHooks.opacity = {
get: function (a, b) { return dc.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : "" }, set: function (a, b) {
var c = a.style; a = a.currentStyle; var g = e.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "", h = a && a.filter || c.filter ||
""; c.zoom = 1; (1 <= b || "" === b) && "" === e.trim(h.replace(Ra, "")) && c.removeAttribute && (c.removeAttribute("filter"), "" === b || a && !a.filter) || (c.filter = Ra.test(h) ? h.replace(Ra, g) : h + " " + g)
}
}); e(function () {
e.support.reliableMarginRight || (e.cssHooks.marginRight = { get: function (a, c) { return c ? e.swap(a, { display: "inline-block" }, la, [a, "marginRight"]) : b } }); !e.support.pixelPosition && e.fn.position && e.each(["top", "left"], function (a, c) {
e.cssHooks[c] = {
get: function (a, g) {
return g ? (g = la(a, c), Ba.test(g) ? e(a).position()[c] + "px" :
g) : b
}
}
})
}); e.expr && e.expr.filters && (e.expr.filters.hidden = function (a) { return 0 >= a.offsetWidth && 0 >= a.offsetHeight || !e.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || e.css(a, "display")) }, e.expr.filters.visible = function (a) { return !e.expr.filters.hidden(a) }); e.each({ margin: "", padding: "", border: "Width" }, function (a, b) {
e.cssHooks[a + b] = { expand: function (c) { var g = 0, h = {}; for (c = "string" == typeof c ? c.split(" ") : [c]; 4 > g; g++)h[a + ea[g] + b] = c[g] || c[g - 2] || c[0]; return h } }; ob.test(a) || (e.cssHooks[a +
b].set = Q)
}); var ic = /%20/g, Cb = /\[\]$/, qb = /\r?\n/g, jc = /^(?:submit|button|image|reset|file)$/i, kc = /^(?:input|select|textarea|keygen)/i; e.fn.extend({
serialize: function () { return e.param(this.serializeArray()) }, serializeArray: function () {
return this.map(function () { var a = e.prop(this, "elements"); return a ? e.makeArray(a) : this }).filter(function () { var a = this.type; return this.name && !e(this).is(":disabled") && kc.test(this.nodeName) && !jc.test(a) && (this.checked || !Ga.test(a)) }).map(function (a, b) {
a = e(this).val(); return null ==
a ? null : e.isArray(a) ? e.map(a, function (a) { return { name: b.name, value: a.replace(qb, "\r\n") } }) : { name: b.name, value: a.replace(qb, "\r\n") }
}).get()
}
}); e.param = function (a, c) { var g, h = [], d = function (a, b) { b = e.isFunction(b) ? b() : null == b ? "" : b; h[h.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b) }; if (c === b && (c = e.ajaxSettings && e.ajaxSettings.traditional), e.isArray(a) || a.jquery && !e.isPlainObject(a)) e.each(a, function () { d(this.name, this.value) }); else for (g in a) ia(g, a[g], c, d); return h.join("&").replace(ic, "+") }; e.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 (a, b) { e.fn[b] = function (a, c) { return 0 < arguments.length ? this.on(b, null, a, c) : this.trigger(b) } }); e.fn.hover = function (a, b) { return this.mouseenter(a).mouseleave(b || a) }; var Sa = e.now(), Ta = /\?/, lc = /#.*$/, rb = /([?&])_=[^&]*/, mc = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm, nc = /^(?:GET|HEAD)$/, oc = /^\/\//, sb = /^([\w.+-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/, tb = e.fn.load, ub = {}, Ha = {}, vb = "*/".concat("*"); try { var pa = wa.href } catch (g) { pa = z.createElement("a"), pa.href = "", pa = pa.href } var ca = sb.exec(pa.toLowerCase()) || []; e.fn.load =
function (a, c, h) { if ("string" != typeof a && tb) return tb.apply(this, arguments); var g, d, f, m = this, l = a.indexOf(" "); return 0 <= l && (g = a.slice(l, a.length), a = a.slice(0, l)), e.isFunction(c) ? (h = c, c = b) : c && "object" == typeof c && (f = "POST"), 0 < m.length && e.ajax({ url: a, type: f, dataType: "html", data: c }).done(function (a) { d = arguments; m.html(g ? e("").append(e.parseHTML(a)).find(g) : a) }).complete(h && function (a, b) { m.each(h, d || [a.responseText, b, a]) }), this }; e.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),
function (a, b) { e.fn[b] = function (a) { return this.on(b, a) } }); e.each(["get", "post"], function (a, c) { e[c] = function (a, g, h, d) { return e.isFunction(g) && (d = d || h, h = g, g = b), e.ajax({ url: a, type: c, dataType: d, data: g, success: h }) } }); e.extend({
active: 0, lastModified: {}, etag: {}, ajaxSettings: {
url: pa, type: "GET", isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(ca[1]), global: !0, processData: !0, async: !0, contentType: "application/x-www-form-urlencoded; charset=UTF-8", accepts: {
"*": vb, text: "text/plain", html: "text/html",
xml: "application/xml, text/xml", json: "application/json, text/javascript"
}, contents: { xml: /xml/, html: /html/, json: /json/ }, responseFields: { xml: "responseXML", text: "responseText" }, converters: { "* text": a.String, "text html": !0, "text json": e.parseJSON, "text xml": e.parseXML }, flatOptions: { url: !0, context: !0 }
}, ajaxSetup: function (a, b) { return b ? Y(Y(a, e.ajaxSettings), b) : Y(e.ajaxSettings, a) }, ajaxPrefilter: T(ub), ajaxTransport: T(Ha), ajax: function (a, c) {
function g(a, c, g, h) {
var d, t, v = c; if (2 !== G) {
G = 2; m && clearTimeout(m);
k = b; f = h || ""; p.readyState = 0 < a ? 4 : 0; if (g) { var w = r; h = p; var Q, U, O, y = w.contents, z = w.dataTypes, P = w.responseFields; for (O in P) O in g && (h[P[O]] = g[O]); for (; "*" === z[0];)z.shift(), U === b && (U = w.mimeType || h.getResponseHeader("Content-Type")); if (U) for (O in y) if (y[O] && y[O].test(U)) { z.unshift(O); break } if (z[0] in g) var R = z[0]; else { for (O in g) { if (!z[0] || w.converters[O + " " + z[0]]) { R = O; break } Q || (Q = O) } R = R || Q } w = R ? (R !== z[0] && z.unshift(R), g[R]) : b } if (200 <= a && 300 > a || 304 === a) if (r.ifModified && (t = p.getResponseHeader("Last-Modified"),
t && (e.lastModified[E] = t), t = p.getResponseHeader("etag"), t && (e.etag[E] = t)), 204 === a) { var u = !0; v = "nocontent" } else if (304 === a) u = !0, v = "notmodified"; else {
a: {
g = r; u = w; var K, C; var F = {}; t = 0; v = g.dataTypes.slice(); Q = v[0]; if (g.dataFilter && (u = g.dataFilter(u, g.dataType)), v[1]) for (K in g.converters) F[K.toLowerCase()] = g.converters[K]; for (; d = v[++t];)if ("*" !== d) {
if ("*" !== Q && Q !== d) {
if (K = F[Q + " " + d] || F["* " + d], !K) for (J in F) if (C = J.split(" "), C[1] === d && (K = F[Q + " " + C[0]] || F["* " + C[0]])) {
!0 === K ? K = F[J] : !0 !== F[J] && (d = C[0], v.splice(t--,
0, d)); break
} if (!0 !== K) if (K && g["throws"]) u = K(u); else try { u = K(u) } catch (Vb) { var J = { state: "parsererror", error: K ? Vb : "No conversion from " + Q + " to " + d }; break a }
} Q = d
} J = { state: "success", data: u }
} u = J; v = u.state; d = u.data; F = u.error; u = !F
} else F = v, (a || !v) && (v = "error", 0 > a && (a = 0)); p.status = a; p.statusText = (c || v) + ""; u ? x.resolveWith(q, [d, v, p]) : x.rejectWith(q, [p, v, F]); p.statusCode(n); n = b; l && B.trigger(u ? "ajaxSuccess" : "ajaxError", [p, r, u ? d : F]); X.fireWith(q, [p, v]); l && (B.trigger("ajaxComplete", [p, r]), --e.active || e.event.trigger("ajaxStop"))
}
}
"object" == typeof a && (c = a, a = b); c = c || {}; var h, d, f, m, l, k, t, r = e.ajaxSetup({}, c), q = r.context || r, B = r.context && (q.nodeType || q.jquery) ? e(q) : e.event, x = e.Deferred(), X = e.Callbacks("once memory"), n = r.statusCode || {}, Q = {}, U = {}, G = 0, O = "canceled", p = {
readyState: 0, getResponseHeader: function (a) { var b; if (2 === G) { if (!t) for (t = {}; b = mc.exec(f);)t[b[1].toLowerCase()] = b[2]; b = t[a.toLowerCase()] } return null == b ? null : b }, getAllResponseHeaders: function () { return 2 === G ? f : null }, setRequestHeader: function (a, b) {
var c = a.toLowerCase(); return G ||
(a = U[c] = U[c] || a, Q[a] = b), this
}, overrideMimeType: function (a) { return G || (r.mimeType = a), this }, statusCode: function (a) { var b; if (a) if (2 > G) for (b in a) n[b] = [n[b], a[b]]; else p.always(a[p.status]); return this }, abort: function (a) { a = a || O; return k && k.abort(a), g(0, a), this }
}; if (x.promise(p).complete = X.add, p.success = p.done, p.error = p.fail, r.url = ((a || r.url || pa) + "").replace(lc, "").replace(oc, ca[1] + "//"), r.type = c.method || c.type || r.method || r.type, r.dataTypes = e.trim(r.dataType || "*").toLowerCase().match(da) || [""], null == r.crossDomain &&
(h = sb.exec(r.url.toLowerCase()), r.crossDomain = !(!h || h[1] === ca[1] && h[2] === ca[2] && (h[3] || ("http:" === h[1] ? 80 : 443)) == (ca[3] || ("http:" === ca[1] ? 80 : 443)))), r.data && r.processData && "string" != typeof r.data && (r.data = e.param(r.data, r.traditional)), ja(ub, r, c, p), 2 === G) return p; (l = r.global) && 0 === e.active++ && e.event.trigger("ajaxStart"); r.type = r.type.toUpperCase(); r.hasContent = !nc.test(r.type); var E = r.url; r.hasContent || (r.data && (E = r.url += (Ta.test(E) ? "&" : "?") + r.data, delete r.data), !1 === r.cache && (r.url = rb.test(E) ?
E.replace(rb, "$1_=" + Sa++) : E + (Ta.test(E) ? "&" : "?") + "_=" + Sa++)); r.ifModified && (e.lastModified[E] && p.setRequestHeader("If-Modified-Since", e.lastModified[E]), e.etag[E] && p.setRequestHeader("If-None-Match", e.etag[E])); (r.data && r.hasContent && !1 !== r.contentType || c.contentType) && p.setRequestHeader("Content-Type", r.contentType); p.setRequestHeader("Accept", r.dataTypes[0] && r.accepts[r.dataTypes[0]] ? r.accepts[r.dataTypes[0]] + ("*" !== r.dataTypes[0] ? ", " + vb + "; q=0.01" : "") : r.accepts["*"]); for (d in r.headers) p.setRequestHeader(d,
r.headers[d]); if (r.beforeSend && (!1 === r.beforeSend.call(q, p, r) || 2 === G)) return p.abort(); O = "abort"; for (d in { success: 1, error: 1, complete: 1 }) p[d](r[d]); if (k = ja(Ha, r, c, p)) { p.readyState = 1; l && B.trigger("ajaxSend", [p, r]); r.async && 0 < r.timeout && (m = setTimeout(function () { p.abort("timeout") }, r.timeout)); try { G = 1, k.send(Q, g) } catch (hb) { if (!(2 > G)) throw hb; g(-1, hb) } } else g(-1, "No Transport"); return p
}, getScript: function (a, c) { return e.get(a, b, c, "script") }, getJSON: function (a, b, c) { return e.get(a, b, c, "json") }
}); e.ajaxSetup({
accepts: { script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript" },
contents: { script: /(?:java|ecma)script/ }, converters: { "text script": function (a) { return e.globalEval(a), a } }
}); e.ajaxPrefilter("script", function (a) { a.cache === b && (a.cache = !1); a.crossDomain && (a.type = "GET", a.global = !1) }); e.ajaxTransport("script", function (a) {
if (a.crossDomain) {
var c, g = z.head || e("head")[0] || z.documentElement; return {
send: function (b, h) {
c = z.createElement("script"); c.async = !0; a.scriptCharset && (c.charset = a.scriptCharset); c.src = a.url; c.onload = c.onreadystatechange = function (a, b) {
(b || !c.readyState ||
/loaded|complete/.test(c.readyState)) && (c.onload = c.onreadystatechange = null, c.parentNode && c.parentNode.removeChild(c), c = null, b || h(200, "success"))
}; g.insertBefore(c, g.firstChild)
}, abort: function () { c && c.onload(b, !0) }
}
}
}); var wb = [], Ua = /(=)\?(?=&|$)|\?\?/; e.ajaxSetup({ jsonp: "callback", jsonpCallback: function () { var a = wb.pop() || e.expando + "_" + Sa++; return this[a] = !0, a } }); e.ajaxPrefilter("json jsonp", function (c, h, d) {
var g, f, m, k = !1 !== c.jsonp && (Ua.test(c.url) ? "url" : "string" == typeof c.data && !(c.contentType || "").indexOf("application/x-www-form-urlencoded") &&
Ua.test(c.data) && "data"); return k || "jsonp" === c.dataTypes[0] ? (g = c.jsonpCallback = e.isFunction(c.jsonpCallback) ? c.jsonpCallback() : c.jsonpCallback, k ? c[k] = c[k].replace(Ua, "$1" + g) : !1 !== c.jsonp && (c.url += (Ta.test(c.url) ? "&" : "?") + c.jsonp + "=" + g), c.converters["script json"] = function () { return m || e.error(g + " was not called"), m[0] }, c.dataTypes[0] = "json", f = a[g], a[g] = function () { m = arguments }, d.always(function () { a[g] = f; c[g] && (c.jsonpCallback = h.jsonpCallback, wb.push(g)); m && e.isFunction(f) && f(m[0]); m = f = b }), "script") :
b
}); var ka, pc = 0, Va = a.ActiveXObject && function () { for (var a in ka) ka[a](b, !0) }; e.ajaxSettings.xhr = a.ActiveXObject ? function () { var b; if (!(b = !this.isLocal && m())) a: { try { b = new a.ActiveXObject("Microsoft.XMLHTTP"); break a } catch (l) { } b = void 0 } return b } : m; var Ea = e.ajaxSettings.xhr(); e.support.cors = !!Ea && "withCredentials" in Ea; (Ea = e.support.ajax = !!Ea) && e.ajaxTransport(function (c) {
if (!c.crossDomain || e.support.cors) {
var h; return {
send: function (g, d) {
var f, m, k = c.xhr(); if (c.username ? k.open(c.type, c.url, c.async, c.username,
c.password) : k.open(c.type, c.url, c.async), c.xhrFields) for (m in c.xhrFields) k[m] = c.xhrFields[m]; c.mimeType && k.overrideMimeType && k.overrideMimeType(c.mimeType); c.crossDomain || g["X-Requested-With"] || (g["X-Requested-With"] = "XMLHttpRequest"); try { for (m in g) k.setRequestHeader(m, g[m]) } catch (uc) { } k.send(c.hasContent && c.data || null); h = function (a, g) {
try {
if (h && (g || 4 === k.readyState)) if (h = b, f && (k.onreadystatechange = e.noop, Va && delete ka[f]), g) 4 !== k.readyState && k.abort(); else {
var m = {}; var l = k.status; var t = k.getAllResponseHeaders();
"string" == typeof k.responseText && (m.text = k.responseText); try { var r = k.statusText } catch (db) { r = "" } l || !c.isLocal || c.crossDomain ? 1223 === l && (l = 204) : l = m.text ? 200 : 404
}
} catch (db) { g || d(-1, db) } m && d(l, r, m, t)
}; c.async ? 4 === k.readyState ? setTimeout(h) : (f = ++pc, Va && (ka || (ka = {}, e(a).unload(Va)), ka[f] = h), k.onreadystatechange = h) : h()
}, abort: function () { h && h(b, !0) }
}
}
}); var sa, Fa, qc = /^(?:toggle|show|hide)$/, rc = RegExp("^(?:([+-])=|)(" + Da + ")([a-z%]*)$", "i"), sc = /queueHooks$/, Ca = [function (a, b, c) {
var h, g, d, f, m, l = this, t = a.style,
r = {}, q = [], B = a.nodeType && k(a); c.queue || (f = e._queueHooks(a, "fx"), null == f.unqueued && (f.unqueued = 0, m = f.empty.fire, f.empty.fire = function () { f.unqueued || m() }), f.unqueued++, l.always(function () { l.always(function () { f.unqueued--; e.queue(a, "fx").length || f.empty.fire() }) })); 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [t.overflow, t.overflowX, t.overflowY], "inline" === e.css(a, "display") && "none" === e.css(a, "float") && (e.support.inlineBlockNeedsLayout && "inline" !== W(a.nodeName) ? t.zoom = 1 : t.display = "inline-block"));
c.overflow && (t.overflow = "hidden", e.support.shrinkWrapBlocks || l.always(function () { t.overflow = c.overflow[0]; t.overflowX = c.overflow[1]; t.overflowY = c.overflow[2] })); for (g in b) (d = b[g], qc.exec(d)) && (delete b[g], h = h || "toggle" === d, d !== (B ? "hide" : "show")) && q.push(g); if (b = q.length) for (d = e._data(a, "fxshow") || e._data(a, "fxshow", {}), ("hidden" in d) && (B = d.hidden), h && (d.hidden = !B), B ? e(a).show() : l.done(function () { e(a).hide() }), l.done(function () { var b; e._removeData(a, "fxshow"); for (b in r) e.style(a, b, r[b]) }), g = 0; b >
g; g++) { h = q[g]; var x = l.createTween(h, B ? d[h] : 0); r[h] = d[h] || e.style(a, h); h in d || (d[h] = x.start, B && (x.end = x.start, x.start = "width" === h || "height" === h ? 1 : 0)) }
}], ya = { "*": [function (a, b) { var c, h = this.createTween(a, b), g = rc.exec(b), d = h.cur(), f = +d || 0, m = 1, k = 20; if (g) { if (b = +g[2], c = g[3] || (e.cssNumber[a] ? "" : "px"), "px" !== c && f) { f = e.css(h.elem, a, !0) || b || 1; do m = m || ".5", f /= m, e.style(h.elem, a, f + c); while (m !== (m = h.cur() / d) && 1 !== m && --k) } h.unit = c; h.start = f; h.end = g[1] ? f + (g[1] + 1) * b : b } return h }] }; e.Animation = e.extend(O, {
tweener: function (a,
b) { e.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" "); for (var c, h = 0, g = a.length; g > h; h++)c = a[h], ya[c] = ya[c] || [], ya[c].unshift(b) }, prefilter: function (a, b) { b ? Ca.unshift(a) : Ca.push(a) }
}); e.Tween = t; t.prototype = {
constructor: t, init: function (a, b, c, h, d, f) { this.elem = a; this.prop = c; this.easing = d || "swing"; this.options = b; this.start = this.now = this.cur(); this.end = h; this.unit = f || (e.cssNumber[c] ? "" : "px") }, cur: function () { var a = t.propHooks[this.prop]; return a && a.get ? a.get(this) : t.propHooks._default.get(this) }, run: function (a) {
var b,
c = t.propHooks[this.prop]; return this.pos = b = this.options.duration ? e.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : t.propHooks._default.set(this), this
}
}; t.prototype.init.prototype = t.prototype; t.propHooks = {
_default: {
get: function (a) {
var b; return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = e.css(a.elem, a.prop, ""), b && "auto" !==
b ? b : 0) : a.elem[a.prop]
}, set: function (a) { e.fx.step[a.prop] ? e.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[e.cssProps[a.prop]] || e.cssHooks[a.prop]) ? e.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now }
}
}; t.propHooks.scrollTop = t.propHooks.scrollLeft = { set: function (a) { a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now) } }; e.each(["toggle", "show", "hide"], function (a, b) {
var c = e.fn[b]; e.fn[b] = function (a, h, e) {
return null == a || "boolean" == typeof a ? c.apply(this, arguments) : this.animate(B(b, !0),
a, h, e)
}
}); e.fn.extend({
fadeTo: function (a, b, c, h) { return this.filter(k).css("opacity", 0).show().end().animate({ opacity: b }, a, c, h) }, animate: function (a, b, c, h) { var g = e.isEmptyObject(a), d = e.speed(b, c, h), f = function () { var b = O(this, e.extend({}, a), d); f.finish = function () { b.stop(!0) }; (g || e._data(this, "finish")) && b.stop(!0) }; return f.finish = f, g || !1 === d.queue ? this.each(f) : this.queue(d.queue, f) }, stop: function (a, c, h) {
var d = function (a) { var b = a.stop; delete a.stop; b(h) }; return "string" != typeof a && (h = c, c = a, a = b), c && !1 !==
a && this.queue(a || "fx", []), this.each(function () { var b = !0, c = null != a && a + "queueHooks", g = e.timers, f = e._data(this); if (c) f[c] && f[c].stop && d(f[c]); else for (c in f) f[c] && f[c].stop && sc.test(c) && d(f[c]); for (c = g.length; c--;)g[c].elem !== this || null != a && g[c].queue !== a || (g[c].anim.stop(h), b = !1, g.splice(c, 1)); !b && h || e.dequeue(this, a) })
}, finish: function (a) {
return !1 !== a && (a = a || "fx"), this.each(function () {
var b = e._data(this), c = b[a + "queue"]; var h = b[a + "queueHooks"]; var d = e.timers, g = c ? c.length : 0; b.finish = !0; e.queue(this,
a, []); h && h.cur && h.cur.finish && h.cur.finish.call(this); for (h = d.length; h--;)d[h].elem === this && d[h].queue === a && (d[h].anim.stop(!0), d.splice(h, 1)); for (h = 0; g > h; h++)c[h] && c[h].finish && c[h].finish.call(this); delete b.finish
})
}
}); e.each({ slideDown: B("show"), slideUp: B("hide"), slideToggle: B("toggle"), fadeIn: { opacity: "show" }, fadeOut: { opacity: "hide" }, fadeToggle: { opacity: "toggle" } }, function (a, b) { e.fn[a] = function (a, c, h) { return this.animate(b, a, c, h) } }); e.speed = function (a, b, c) {
var h = a && "object" == typeof a ? e.extend({},
a) : { complete: c || !c && b || e.isFunction(a) && a, duration: a, easing: c && b || b && !e.isFunction(b) && b }; return h.duration = e.fx.off ? 0 : "number" == typeof h.duration ? h.duration : h.duration in e.fx.speeds ? e.fx.speeds[h.duration] : e.fx.speeds._default, (null == h.queue || !0 === h.queue) && (h.queue = "fx"), h.old = h.complete, h.complete = function () { e.isFunction(h.old) && h.old.call(this); h.queue && e.dequeue(this, h.queue) }, h
}; e.easing = { linear: function (a) { return a }, swing: function (a) { return .5 - Math.cos(a * Math.PI) / 2 } }; e.timers = []; e.fx = t.prototype.init;
e.fx.tick = function () { var a = e.timers, c = 0; for (sa = e.now(); a.length > c; c++) { var h = a[c]; h() || a[c] !== h || a.splice(c--, 1) } a.length || e.fx.stop(); sa = b }; e.fx.timer = function (a) { a() && e.timers.push(a) && e.fx.start() }; e.fx.interval = 13; e.fx.start = function () { Fa || (Fa = setInterval(e.fx.tick, e.fx.interval)) }; e.fx.stop = function () { clearInterval(Fa); Fa = null }; e.fx.speeds = { slow: 600, fast: 200, _default: 400 }; e.fx.step = {}; e.expr && e.expr.filters && (e.expr.filters.animated = function (a) { return e.grep(e.timers, function (b) { return a === b.elem }).length });
e.fn.offset = function (a) { if (arguments.length) return a === b ? this : this.each(function (b) { e.offset.setOffset(this, a, b) }); var c, h, d = { top: 0, left: 0 }, g = this[0], f = g && g.ownerDocument; if (f) return c = f.documentElement, e.contains(c, g) ? (typeof g.getBoundingClientRect !== P && (d = g.getBoundingClientRect()), h = U(f), { top: d.top + (h.pageYOffset || c.scrollTop) - (c.clientTop || 0), left: d.left + (h.pageXOffset || c.scrollLeft) - (c.clientLeft || 0) }) : d }; e.offset = {
setOffset: function (a, b, c) {
var h = e.css(a, "position"); "static" === h && (a.style.position =
"relative"); var d = e(a), g = d.offset(), f = e.css(a, "top"), m = e.css(a, "left"), k = {}, t = {}, r, l; ("absolute" === h || "fixed" === h) && -1 < e.inArray("auto", [f, m]) ? (t = d.position(), r = t.top, l = t.left) : (r = parseFloat(f) || 0, l = parseFloat(m) || 0); e.isFunction(b) && (b = b.call(a, c, g)); null != b.top && (k.top = b.top - g.top + r); null != b.left && (k.left = b.left - g.left + l); "using" in b ? b.using.call(a, k) : d.css(k)
}
}; e.fn.extend({
position: function () {
if (this[0]) {
var a, b, c = { top: 0, left: 0 }, h = this[0]; return "fixed" === e.css(h, "position") ? b = h.getBoundingClientRect() :
(a = this.offsetParent(), b = this.offset(), e.nodeName(a[0], "html") || (c = a.offset()), c.top += e.css(a[0], "borderTopWidth", !0), c.left += e.css(a[0], "borderLeftWidth", !0)), { top: b.top - c.top - e.css(h, "marginTop", !0), left: b.left - c.left - e.css(h, "marginLeft", !0) }
}
}, offsetParent: function () { return this.map(function () { for (var a = this.offsetParent || z.documentElement; a && !e.nodeName(a, "html") && "static" === e.css(a, "position");)a = a.offsetParent; return a || z.documentElement }) }
}); e.each({ scrollLeft: "pageXOffset", scrollTop: "pageYOffset" },
function (a, c) { var h = /Y/.test(c); e.fn[a] = function (d) { return e.access(this, function (a, d, g) { var f = U(a); return g === b ? f ? c in f ? f[c] : f.document.documentElement[d] : a[d] : (f ? f.scrollTo(h ? e(f).scrollLeft() : g, h ? g : e(f).scrollTop()) : a[d] = g, b) }, a, d, arguments.length, null) } }); e.each({ Height: "height", Width: "width" }, function (a, c) {
e.each({ padding: "inner" + a, content: c, "": "outer" + a }, function (h, d) {
e.fn[d] = function (d, g) {
var f = arguments.length && (h || "boolean" != typeof d), m = h || (!0 === d || !0 === g ? "margin" : "border"); return e.access(this,
function (c, h, d) { var g; return e.isWindow(c) ? c.document.documentElement["client" + a] : 9 === c.nodeType ? (g = c.documentElement, Math.max(c.body["scroll" + a], g["scroll" + a], c.body["offset" + a], g["offset" + a], g["client" + a])) : d === b ? e.css(c, h, m) : e.style(c, h, d, m) }, c, f ? d : b, f, null)
}
})
}); a.jQuery = a.$ = e; "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function () { return e })
})(window);/*
jQuery Templates Plugin 1.0.0pre
http://github.com/jquery/jquery-tmpl
Requires jQuery 1.4.2
Copyright 2011, Software Freedom Conservancy, Inc.
Licensed under the MIT license.
http://jquery.org/license
*/
(function (a) {
function b(b, c, d, f) { f = { data: f || 0 === f || !1 === f ? f : c ? c.data : {}, _wrap: c ? c._wrap : null, tmpl: null, parent: c || null, nodes: [], calls: A, nest: H, wrap: D, html: S, update: N }; b && a.extend(f, b, { nodes: [], parent: c }); d && (f.tmpl = d, f._ctnt = f._ctnt || f.tmpl(a, f), f.key = ++E, (k.length ? C : J)[E] = f); return f } function c(b, f, k) {
var q; k = k ? a.map(k, function (a) { return "string" === typeof a ? b.key ? a.replace(/(<\w+)(?=[\s>])(?![^>]*_tmplitem)([^>]*)/g, '$1 _tmplitem="' + b.key + '" $2') : a : c(a, b, a._ctnt) }) : b; if (f) return k; k = k.join(""); k.replace(/^\s*([^<\s][^<]*)?(<[\w\W]+>)([^>]*[^>\s])?\s*$/,
function (b, c, f, k) { q = a(f).get(); n(q); c && (q = d(c).concat(q)); k && (q = q.concat(d(k))) }); return q ? q : d(k)
} function d(b) { var c = document.createElement("div"); c.innerHTML = b; return a.makeArray(c.childNodes) } function f(b) {
return new Function("jQuery", "$item", "var $=jQuery,call,__=[],$data=$item.data;with($data){__.push('" + a.trim(b).replace(/([\\'])/g, "\\$1").replace(/[\r\t\n]/g, " ").replace(/\$\{([^\}]*)\}/g, "{{= $1}}").replace(/\{\{(\/?)(\w+|.)(?:\(((?:[^\}]|\}(?!\}))*?)?\))?(?:\s+(.*?)?)?(\(((?:[^\}]|\}(?!\}))*?)\))?\s*\}\}/g,
function (b, c, d, f, k, q, x) { b = a.tmpl.tag[d]; if (!b) throw "Unknown template tag: " + d; d = b._default || []; q && !/\w$/.test(k) && (k += q, q = ""); k ? (k = p(k), x = x ? "," + p(x) + ")" : q ? ")" : "", x = q ? -1 < k.indexOf(".") ? k + p(q) : "(" + k + ").call($item" + x : k, q = q ? x : "(typeof(" + k + ")==='function'?(" + k + ").call($item):(" + k + "))") : q = x = d.$1 || "null"; f = p(f); return "');" + b[c ? "close" : "open"].split("$notnull_1").join(k ? "typeof(" + k + ")!=='undefined' && (" + k + ")!=null" : "true").split("$1a").join(q).split("$1").join(x).split("$2").join(f || d.$2 || "") + "__.push('" }) +
"');}return __;")
} function q(b, d) { b._wrap = c(b, !0, a.isArray(d) ? d : [F.test(d) ? d : a(d).html()]).join("") } function p(a) { return a ? a.replace(/\\'/g, "'").replace(/\\\\/g, "\\") : null } function n(c) {
function d(c) {
function d(a) { a += f; n = q[a] = q[a] || b(n, J[n.parent.key + f] || n.parent) } var k, x = c, n, h; if (h = c.getAttribute("_tmplitem")) {
for (; x.parentNode && 1 === (x = x.parentNode).nodeType && !(k = x.getAttribute("_tmplitem"));); k !== h && (x = x.parentNode ? 11 === x.nodeType ? 0 : x.getAttribute("_tmplitem") || 0 : 0, (n = J[h]) || (n = C[h], n = b(n, J[x] ||
C[x]), n.key = ++E, J[E] = n), G && d(h)); c.removeAttribute("_tmplitem")
} else G && (n = a.data(c, "tmplItem")) && (d(n.key), J[n.key] = n, x = (x = a.data(c.parentNode, "tmplItem")) ? x.key : 0); if (n) { for (k = n; k && k.key != x;)k.nodes.push(c), k = k.parent; delete n._ctnt; delete n._wrap; a.data(c, "tmplItem", n) }
} var f = "_" + G, k, q = {}, x, n; var p = 0; for (x = c.length; p < x; p++)if (1 === (k = c[p]).nodeType) { var u = k.getElementsByTagName("*"); for (n = u.length - 1; 0 <= n; n--)d(u[n]); d(k) }
} function A(a, b, c, d) {
if (!a) return k.pop(); k.push({
_: a, tmpl: b, item: this, data: c,
options: d
})
} function H(b, c, d) { return a.tmpl(a.template(b), c, d, this) } function D(b, c) { var d = b.options || {}; d.wrapped = c; return a.tmpl(a.template(b.tmpl), b.data, d, b.item) } function S(b, c) { var d = this._wrap; return a.map(a(a.isArray(d) ? d.join("") : d).filter(b || "*"), function (a) { if (c) a = a.innerText || a.textContent; else { var b; (b = a.outerHTML) || (b = document.createElement("div"), b.appendChild(a.cloneNode(!0)), b = b.innerHTML); a = b } return a }) } function N() {
var b = this.nodes; a.tmpl(null, null, null, this).insertBefore(b[0]);
a(b).remove()
} var M = a.fn.domManip, F = /^[^<]*(<[\w\W]+>)[^>]*$|\{\{! /, J = {}, C = {}, I, u = { key: 0, data: {} }, E = 0, G = 0, k = []; a.each({ appendTo: "append", prependTo: "prepend", insertBefore: "before", insertAfter: "after", replaceAll: "replaceWith" }, function (b, c) {
a.fn[b] = function (d) {
var f = []; d = a(d); var k; var q = 1 === this.length && this[0].parentNode; I = J || {}; if (q && 11 === q.nodeType && 1 === q.childNodes.length && 1 === d.length) d[c](this[0]), f = this; else {
var x = 0; for (k = d.length; x < k; x++)G = x, q = (0 < x ? this.clone(!0) : this).get(), a(d[x])[c](q),
f = f.concat(q); G = 0; f = this.pushStack(f, b, d.selector)
} d = I; I = null; a.tmpl.complete(d); return f
}
}); a.fn.extend({
tmpl: function (b, c, d) { return a.tmpl(this[0], b, c, d) }, tmplItem: function () { return a.tmplItem(this[0]) }, template: function (b) { return a.template(b, this[0]) }, domManip: function (b, c, d) {
if (b[0] && a.isArray(b[0])) { for (var f = a.makeArray(arguments), k = b[0], q = k.length, x = 0, n; x < q && !(n = a.data(k[x++], "tmplItem"));); n && G && (f[2] = function (b) { a.tmpl.afterManip(this, b, d) }); M.apply(this, f) } else M.apply(this, arguments);
G = 0; !I && a.tmpl.complete(J); return this
}
}); a.extend({
tmpl: function (d, f, k, n) { var x = !n; if (x) n = u, d = a.template[d] || a.template(null, d), C = {}; else if (!d) return d = n.tmpl, J[n.key] = n, n.nodes = [], n.wrapped && q(n, n.wrapped), a(c(n, null, n.tmpl(a, n))); if (!d) return []; "function" === typeof f && (f = f.call(n || {})); k && k.wrapped && q(k, k.wrapped); f = a.isArray(f) ? a.map(f, function (a) { return a ? b(k, n, d, a) : null }) : [b(k, n, d, f)]; return x ? a(c(n, null, f)) : f }, tmplItem: function (b) {
var c; for (b instanceof a && (b = b[0]); b && 1 === b.nodeType && !(c = a.data(b,
"tmplItem")) && (b = b.parentNode);); return c || u
}, template: function (b, c) { return c ? ("string" === typeof c ? c = f(c) : c instanceof a && (c = c[0] || {}), c.nodeType && (c = a.data(c, "tmpl") || a.data(c, "tmpl", f(c.innerHTML))), "string" === typeof b ? a.template[b] = c : c) : b ? "string" !== typeof b ? a.template(null, b) : a.template[b] || a.template(null, F.test(b) ? b : a(b)) : null }, encode: function (a) { return ("" + a).split("<").join("<").split(">").join(">").split('"').join(""").split("'").join("'") }
}); a.extend(a.tmpl, {
tag: {
tmpl: {
_default: { $2: "null" },
open: "if($notnull_1){__=__.concat($item.nest($1,$2));}"
}, wrap: { _default: { $2: "null" }, open: "$item.calls(__,$1,$2);__=[];", close: "call=$item.calls();__=call._.concat($item.wrap(call,__));" }, each: { _default: { $2: "$index, $value" }, open: "if($notnull_1){$.each($1a,function($2){with(this){", close: "}});}" }, "if": { open: "if(($notnull_1) && $1a){", close: "}" }, "else": { _default: { $1: "true" }, open: "}else if(($notnull_1) && $1a){" }, html: { open: "if($notnull_1){__.push($1a);}" }, "=": { _default: { $1: "$data" }, open: "if($notnull_1){__.push($.encode($1a));}" },
"!": { open: "" }
}, complete: function () { J = {} }, afterManip: function (b, c, d) { var f = 11 === c.nodeType ? a.makeArray(c.childNodes) : 1 === c.nodeType ? [c] : []; d.call(b, c); n(f); G++ }
})
})(jQuery); (function (a, b) {
function c(a, b) {
a = decodeURI(a); b = n[b ? "strict" : "loose"].exec(a); var c = { attr: {}, param: {}, seg: {} }; for (a = 14; a--;)c.attr[q[a]] = b[a] || ""; c.param.query = {}; c.param.fragment = {}; c.attr.query.replace(A, function (a, b, d) { b && (c.param.query[b] = d) }); c.attr.fragment.replace(H, function (a, b, d) { b && (c.param.fragment[b] = d) }); c.seg.path = c.attr.path.replace(/^\/+|\/+$/g, "").split("/"); c.seg.fragment = c.attr.fragment.replace(/^\/+|\/+$/g, "").split("/"); c.attr.base = c.attr.host ? c.attr.protocol + "://" + c.attr.host +
(c.attr.port ? ":" + c.attr.port : "") : ""; return c
} function d(a) { a = a.tagName; return a !== b ? f[a.toLowerCase()] : a } var f = { a: "href", img: "src", form: "action", base: "href", script: "src", iframe: "src", link: "href" }, q = "source protocol authority userInfo user password host port relative path directory file query fragment".split(" "), p = { anchor: "fragment" }, n = { strict: /^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/, loose: /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/ },
A = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g, H = /(?:^|&|;)([^&=;]*)=?([^&;]*)/g; a.fn.url = function (b) { var c = ""; this.length && (c = a(this).attr(d(this[0])) || ""); return a.url({ url: c, strict: b }) }; a.url = function (a) {
var d = "", f = !1; "string" === typeof a ? d = a : (a = a || {}, f = a.strict || f, d = a.url === b ? window.location.toString() : a.url); return {
data: c(d, f), attr: function (a) { a = p[a] || a; return a !== b ? this.data.attr[a] : this.data.attr }, param: function (a) { return a !== b ? this.data.param.query[a] : this.data.param.query }, fparam: function (a) {
return a !==
b ? this.data.param.fragment[a] : this.data.param.fragment
}, segment: function (a) { if (a === b) return this.data.seg.path; a = 0 > a ? this.data.seg.path.length + a : a - 1; return this.data.seg.path[a] }, fsegment: function (a) { if (a === b) return this.data.seg.fragment; a = 0 > a ? this.data.seg.fragment.length + a : a - 1; return this.data.seg.fragment[a] }
}
}
})(jQuery); !function () {
var a = this, b = a._, c = {}, d = Array.prototype, f = Object.prototype, q = d.push, p = d.slice, n = d.concat, A = f.toString, H = f.hasOwnProperty, D = d.forEach, S = d.map, N = d.reduce, M = d.reduceRight, F = d.filter, J = d.every, C = d.some, I = d.indexOf, u = d.lastIndexOf; f = Array.isArray; var E = Object.keys, G = Function.prototype.bind, k = function (a) { return a instanceof k ? a : this instanceof k ? (this._wrapped = a, void 0) : new k(a) }; "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = k), exports._ = k) :
a._ = k; k.VERSION = "1.5.1"; var x = k.each = k.forEach = function (a, b, d) { if (null != a) if (D && a.forEach === D) a.forEach(b, d); else if (a.length === +a.length) for (var h = 0, f = a.length; f > h && b.call(d, a[h], h, a) !== c; h++); else for (h in a) if (k.has(a, h) && b.call(d, a[h], h, a) === c) break }; k.map = k.collect = function (a, b, c) { var h = []; return null == a ? h : S && a.map === S ? a.map(b, c) : (x(a, function (a, d, f) { h.push(b.call(c, a, d, f)) }), h) }; k.reduce = k.foldl = k.inject = function (a, b, c, d) {
var h = 2 < arguments.length; if (null == a && (a = []), N && a.reduce === N) return d &&
(b = k.bind(b, d)), h ? a.reduce(b, c) : a.reduce(b); if (x(a, function (a, f, m) { h ? c = b.call(d, c, a, f, m) : (c = a, h = !0) }), !h) throw new TypeError("Reduce of empty array with no initial value"); return c
}; k.reduceRight = k.foldr = function (a, b, c, d) {
var h = 2 < arguments.length; if (null == a && (a = []), M && a.reduceRight === M) return d && (b = k.bind(b, d)), h ? a.reduceRight(b, c) : a.reduceRight(b); var f = a.length; if (f !== +f) { var m = k.keys(a); f = m.length } if (x(a, function (k, t, r) { t = m ? m[--f] : --f; h ? c = b.call(d, c, a[t], t, r) : (c = a[t], h = !0) }), !h) throw new TypeError("Reduce of empty array with no initial value");
return c
}; k.find = k.detect = function (a, b, c) { var h; return Q(a, function (a, d, f) { return b.call(c, a, d, f) ? (h = a, !0) : void 0 }), h }; k.filter = k.select = function (a, b, c) { var h = []; return null == a ? h : F && a.filter === F ? a.filter(b, c) : (x(a, function (a, d, f) { b.call(c, a, d, f) && h.push(a) }), h) }; k.reject = function (a, b, c) { return k.filter(a, function (a, h, d) { return !b.call(c, a, h, d) }, c) }; k.every = k.all = function (a, b, d) {
b || (b = k.identity); var h = !0; return null == a ? h : J && a.every === J ? a.every(b, d) : (x(a, function (a, f, m) {
return (h = h && b.call(d, a, f, m)) ?
void 0 : c
}), !!h)
}; var Q = k.some = k.any = function (a, b, d) { b || (b = k.identity); var h = !1; return null == a ? h : C && a.some === C ? a.some(b, d) : (x(a, function (a, f, m) { return h || (h = b.call(d, a, f, m)) ? c : void 0 }), !!h) }; k.contains = k.include = function (a, b) { return null == a ? !1 : I && a.indexOf === I ? -1 != a.indexOf(b) : Q(a, function (a) { return a === b }) }; k.invoke = function (a, b) { var c = p.call(arguments, 2), h = k.isFunction(b); return k.map(a, function (a) { return (h ? b : a[b]).apply(a, c) }) }; k.pluck = function (a, b) { return k.map(a, function (a) { return a[b] }) }; k.where =
function (a, b, c) { return k.isEmpty(b) ? c ? void 0 : [] : k[c ? "find" : "filter"](a, function (a) { for (var c in b) if (b[c] !== a[c]) return !1; return !0 }) }; k.findWhere = function (a, b) { return k.where(a, b, !0) }; k.max = function (a, b, c) { if (!b && k.isArray(a) && a[0] === +a[0] && 65535 > a.length) return Math.max.apply(Math, a); if (!b && k.isEmpty(a)) return -1 / 0; var h = { computed: -1 / 0, value: -1 / 0 }; return x(a, function (a, d, f) { d = b ? b.call(c, a, d, f) : a; d > h.computed && (h = { value: a, computed: d }) }), h.value }; k.min = function (a, b, c) {
if (!b && k.isArray(a) && a[0] === +a[0] &&
65535 > a.length) return Math.min.apply(Math, a); if (!b && k.isEmpty(a)) return 1 / 0; var h = { computed: 1 / 0, value: 1 / 0 }; return x(a, function (a, d, f) { d = b ? b.call(c, a, d, f) : a; d < h.computed && (h = { value: a, computed: d }) }), h.value
}; k.shuffle = function (a) { var b, c = 0, h = []; return x(a, function (a) { b = k.random(c++); h[c - 1] = h[b]; h[b] = a }), h }; var y = function (a) { return k.isFunction(a) ? a : function (b) { return b[a] } }; k.sortBy = function (a, b, c) {
var h = y(b); return k.pluck(k.map(a, function (a, b, d) { return { value: a, index: b, criteria: h.call(c, a, b, d) } }).sort(function (a,
b) { var c = a.criteria, h = b.criteria; if (c !== h) { if (c > h || void 0 === c) return 1; if (h > c || void 0 === h) return -1 } return a.index < b.index ? -1 : 1 }), "value")
}; var K = function (a, b, c, d) { var h = {}, f = y(null == b ? k.identity : b); return x(a, function (b, m) { m = f.call(c, b, m, a); d(h, m, b) }), h }; k.groupBy = function (a, b, c) { return K(a, b, c, function (a, b, c) { (k.has(a, b) ? a[b] : a[b] = []).push(c) }) }; k.countBy = function (a, b, c) { return K(a, b, c, function (a, b) { k.has(a, b) || (a[b] = 0); a[b]++ }) }; k.sortedIndex = function (a, b, c, d) {
c = null == c ? k.identity : y(c); b = c.call(d,
b); for (var h = 0, f = a.length; f > h;) { var m = h + f >>> 1; c.call(d, a[m]) < b ? h = m + 1 : f = m } return h
}; k.toArray = function (a) { return a ? k.isArray(a) ? p.call(a) : a.length === +a.length ? k.map(a, k.identity) : k.values(a) : [] }; k.size = function (a) { return null == a ? 0 : a.length === +a.length ? a.length : k.keys(a).length }; k.first = k.head = k.take = function (a, b, c) { return null == a ? void 0 : null == b || c ? a[0] : p.call(a, 0, b) }; k.initial = function (a, b, c) { return p.call(a, 0, a.length - (null == b || c ? 1 : b)) }; k.last = function (a, b, c) {
return null == a ? void 0 : null == b || c ? a[a.length -
1] : p.call(a, Math.max(a.length - b, 0))
}; k.rest = k.tail = k.drop = function (a, b, c) { return p.call(a, null == b || c ? 1 : b) }; k.compact = function (a) { return k.filter(a, k.identity) }; var W = function (a, b, c) { return b && k.every(a, k.isArray) ? n.apply(c, a) : (x(a, function (a) { k.isArray(a) || k.isArguments(a) ? b ? q.apply(c, a) : W(a, b, c) : c.push(a) }), c) }; k.flatten = function (a, b) { return W(a, b, []) }; k.without = function (a) { return k.difference(a, p.call(arguments, 1)) }; k.uniq = k.unique = function (a, b, c, d) {
k.isFunction(b) && (d = c, c = b, b = !1); c = c ? k.map(a, c,
d) : a; var h = [], f = []; return x(c, function (c, d) { (b ? d && f[f.length - 1] === c : k.contains(f, c)) || (f.push(c), h.push(a[d])) }), h
}; k.union = function () { return k.uniq(k.flatten(arguments, !0)) }; k.intersection = function (a) { var b = p.call(arguments, 1); return k.filter(k.uniq(a), function (a) { return k.every(b, function (b) { return 0 <= k.indexOf(b, a) }) }) }; k.difference = function (a) { var b = n.apply(d, p.call(arguments, 1)); return k.filter(a, function (a) { return !k.contains(b, a) }) }; k.zip = function () {
for (var a = k.max(k.pluck(arguments, "length").concat(0)),
b = Array(a), c = 0; a > c; c++)b[c] = k.pluck(arguments, "" + c); return b
}; k.object = function (a, b) { if (null == a) return {}; for (var c = {}, d = 0, h = a.length; h > d; d++)b ? c[a[d]] = b[d] : c[a[d][0]] = a[d][1]; return c }; k.indexOf = function (a, b, c) { if (null == a) return -1; var d = 0, h = a.length; if (c) { if ("number" != typeof c) return d = k.sortedIndex(a, b), a[d] === b ? d : -1; d = 0 > c ? Math.max(0, h + c) : c } if (I && a.indexOf === I) return a.indexOf(b, c); for (; h > d; d++)if (a[d] === b) return d; return -1 }; k.lastIndexOf = function (a, b, c) {
if (null == a) return -1; var d = null != c; if (u && a.lastIndexOf ===
u) return d ? a.lastIndexOf(b, c) : a.lastIndexOf(b); for (c = d ? c : a.length; c--;)if (a[c] === b) return c; return -1
}; k.range = function (a, b, c) { 1 >= arguments.length && (b = a || 0, a = 0); c = arguments[2] || 1; for (var d = Math.max(Math.ceil((b - a) / c), 0), h = 0, f = Array(d); d > h;)f[h++] = a, a += c; return f }; var ha = function () { }; k.bind = function (a, b) {
var c, d; if (G && a.bind === G) return G.apply(a, p.call(arguments, 1)); if (!k.isFunction(a)) throw new TypeError; return c = p.call(arguments, 2), d = function () {
if (!(this instanceof d)) return a.apply(b, c.concat(p.call(arguments)));
ha.prototype = a.prototype; var h = new ha; ha.prototype = null; var f = a.apply(h, c.concat(p.call(arguments))); return Object(f) === f ? f : h
}
}; k.partial = function (a) { var b = p.call(arguments, 1); return function () { return a.apply(this, b.concat(p.call(arguments))) } }; k.bindAll = function (a) { var b = p.call(arguments, 1); if (0 === b.length) throw Error("bindAll must be passed function names"); return x(b, function (b) { a[b] = k.bind(a[b], a) }), a }; k.memoize = function (a, b) {
var c = {}; return b || (b = k.identity), function () {
var d = b.apply(this, arguments);
return k.has(c, d) ? c[d] : c[d] = a.apply(this, arguments)
}
}; k.delay = function (a, b) { var c = p.call(arguments, 2); return setTimeout(function () { return a.apply(null, c) }, b) }; k.defer = function (a) { return k.delay.apply(k, [a, 1].concat(p.call(arguments, 1))) }; k.throttle = function (a, b, c) {
var d, h, f, m = null, k = 0; c || (c = {}); var r = function () { k = !1 === c.leading ? 0 : new Date; m = null; f = a.apply(d, h) }; return function () {
var q = new Date; k || !1 !== c.leading || (k = q); var t = b - (q - k); return d = this, h = arguments, 0 >= t ? (clearTimeout(m), m = null, k = q, f = a.apply(d,
h)) : m || !1 === c.trailing || (m = setTimeout(r, t)), f
}
}; k.debounce = function (a, b, c) { var d, h = null; return function () { var f = this, m = arguments, k = c && !h; return clearTimeout(h), h = setTimeout(function () { h = null; c || (d = a.apply(f, m)) }, b), k && (d = a.apply(f, m)), d } }; k.once = function (a) { var b, c = !1; return function () { return c ? b : (c = !0, b = a.apply(this, arguments), a = null, b) } }; k.wrap = function (a, b) { return function () { var c = [a]; return q.apply(c, arguments), b.apply(this, c) } }; k.compose = function () {
var a = arguments; return function () {
for (var b =
arguments, c = a.length - 1; 0 <= c; c--)b = [a[c].apply(this, b)]; return b[0]
}
}; k.after = function (a, b) { return function () { return 1 > --a ? b.apply(this, arguments) : void 0 } }; k.keys = E || function (a) { if (a !== Object(a)) throw new TypeError("Invalid object"); var b = [], c; for (c in a) k.has(a, c) && b.push(c); return b }; k.values = function (a) { var b = [], c; for (c in a) k.has(a, c) && b.push(a[c]); return b }; k.pairs = function (a) { var b = [], c; for (c in a) k.has(a, c) && b.push([c, a[c]]); return b }; k.invert = function (a) {
var b = {}, c; for (c in a) k.has(a, c) && (b[a[c]] =
c); return b
}; k.functions = k.methods = function (a) { var b = [], c; for (c in a) k.isFunction(a[c]) && b.push(c); return b.sort() }; k.extend = function (a) { return x(p.call(arguments, 1), function (b) { if (b) for (var c in b) a[c] = b[c] }), a }; k.pick = function (a) { var b = {}, c = n.apply(d, p.call(arguments, 1)); return x(c, function (c) { c in a && (b[c] = a[c]) }), b }; k.omit = function (a) { var b = {}, c = n.apply(d, p.call(arguments, 1)), h; for (h in a) k.contains(c, h) || (b[h] = a[h]); return b }; k.defaults = function (a) {
return x(p.call(arguments, 1), function (b) {
if (b) for (var c in b) void 0 ===
a[c] && (a[c] = b[c])
}), a
}; k.clone = function (a) { return k.isObject(a) ? k.isArray(a) ? a.slice() : k.extend({}, a) : a }; k.tap = function (a, b) { return b(a), a }; var ia = function (a, b, c, d) {
if (a === b) return 0 !== a || 1 / a == 1 / b; if (null == a || null == b) return a === b; a instanceof k && (a = a._wrapped); b instanceof k && (b = b._wrapped); var h = A.call(a); if (h != A.call(b)) return !1; switch (h) {
case "[object String]": return a == String(b); case "[object Number]": return a != +a ? b != +b : 0 == a ? 1 / a == 1 / b : a == +b; case "[object Date]": case "[object Boolean]": return +a ==
+b; case "[object RegExp]": return a.source == b.source && a.global == b.global && a.multiline == b.multiline && a.ignoreCase == b.ignoreCase
}if ("object" != typeof a || "object" != typeof b) return !1; for (var f = c.length; f--;)if (c[f] == a) return d[f] == b; f = a.constructor; var m = b.constructor; if (f !== m && !(k.isFunction(f) && f instanceof f && k.isFunction(m) && m instanceof m)) return !1; c.push(a); d.push(b); f = 0; m = !0; if ("[object Array]" == h) { if (f = a.length, m = f == b.length) for (; f-- && (m = ia(a[f], b[f], c, d));); } else {
for (var r in a) if (k.has(a, r) &&
(f++, !(m = k.has(b, r) && ia(a[r], b[r], c, d)))) break; if (m) { for (r in b) if (k.has(b, r) && !f--) break; m = !f }
} return c.pop(), d.pop(), m
}; k.isEqual = function (a, b) { return ia(a, b, [], []) }; k.isEmpty = function (a) { if (null == a) return !0; if (k.isArray(a) || k.isString(a)) return 0 === a.length; for (var b in a) if (k.has(a, b)) return !1; return !0 }; k.isElement = function (a) { return !(!a || 1 !== a.nodeType) }; k.isArray = f || function (a) { return "[object Array]" == A.call(a) }; k.isObject = function (a) { return a === Object(a) }; x("Arguments Function String Number Date RegExp".split(" "),
function (a) { k["is" + a] = function (b) { return A.call(b) == "[object " + a + "]" } }); k.isArguments(arguments) || (k.isArguments = function (a) { return !(!a || !k.has(a, "callee")) }); "function" != typeof /./ && (k.isFunction = function (a) { return "function" == typeof a }); k.isFinite = function (a) { return isFinite(a) && !isNaN(parseFloat(a)) }; k.isNaN = function (a) { return k.isNumber(a) && a != +a }; k.isBoolean = function (a) { return !0 === a || !1 === a || "[object Boolean]" == A.call(a) }; k.isNull = function (a) { return null === a }; k.isUndefined = function (a) {
return void 0 ===
a
}; k.has = function (a, b) { return H.call(a, b) }; k.noConflict = function () { return a._ = b, this }; k.identity = function (a) { return a }; k.times = function (a, b, c) { for (var d = Array(Math.max(0, a)), f = 0; a > f; f++)d[f] = b.call(c, f); return d }; k.random = function (a, b) { return null == b && (b = a, a = 0), a + Math.floor(Math.random() * (b - a + 1)) }; var T = { escape: { "&": "&", "<": "<", ">": ">", '"': """, "'": "'", "/": "/" } }; T.unescape = k.invert(T.escape); var ja = {
escape: new RegExp("[" + k.keys(T.escape).join("") + "]", "g"), unescape: new RegExp("(" +
k.keys(T.unescape).join("|") + ")", "g")
}; k.each(["escape", "unescape"], function (a) { k[a] = function (b) { return null == b ? "" : ("" + b).replace(ja[a], function (b) { return T[a][b] }) } }); k.result = function (a, b) { if (null != a) return b = a[b], k.isFunction(b) ? b.call(a) : b }; k.mixin = function (a) { x(k.functions(a), function (b) { var c = k[b] = a[b]; k.prototype[b] = function () { var a = [this._wrapped]; return q.apply(a, arguments), O.call(this, c.apply(k, a)) } }) }; var Y = 0; k.uniqueId = function (a) { var b = ++Y + ""; return a ? a + b : b }; k.templateSettings = {
evaluate: /<%([\s\S]+?)%>/g,
interpolate: /<%=([\s\S]+?)%>/g, escape: /<%-([\s\S]+?)%>/g
}; var m = /(.)^/, r = { "'": "'", "\\": "\\", "\r": "r", "\n": "n", "\t": "t", "\u2028": "u2028", "\u2029": "u2029" }, X = /\\|'|\r|\n|\t|\u2028|\u2029/g; k.template = function (a, b, c) {
c = k.defaults({}, c, k.templateSettings); var d = new RegExp([(c.escape || m).source, (c.interpolate || m).source, (c.evaluate || m).source].join("|") + "|$", "g"), f = 0, h = "__p+='"; a.replace(d, function (b, c, d, m, k) {
return h += a.slice(f, k).replace(X, function (a) { return "\\" + r[a] }), c && (h += "'+\n((__t=(" + c + "))==null?'':_.escape(__t))+\n'"),
d && (h += "'+\n((__t=(" + d + "))==null?'':__t)+\n'"), m && (h += "';\n" + m + "\n__p+='"), f = k + b.length, b
}); h += "';\n"; c.variable || (h = "with(obj||{}){\n" + h + "}\n"); h = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + h + "return __p;\n"; try { var q = new Function(c.variable || "obj", "_", h) } catch (wa) { throw wa.source = h, wa; } if (b) return q(b, k); b = function (a) { return q.call(this, a, k) }; return b.source = "function(" + (c.variable || "obj") + "){\n" + h + "}", b
}; k.chain = function (a) { return k(a).chain() }; var O =
function (a) { return this._chain ? k(a).chain() : a }; k.mixin(k); x("pop push reverse shift sort splice unshift".split(" "), function (a) { var b = d[a]; k.prototype[a] = function () { var c = this._wrapped; return b.apply(c, arguments), "shift" != a && "splice" != a || 0 !== c.length || delete c[0], O.call(this, c) } }); x(["concat", "join", "slice"], function (a) { var b = d[a]; k.prototype[a] = function () { return O.call(this, b.apply(this._wrapped, arguments)) } }); k.extend(k.prototype, { chain: function () { return this._chain = !0, this }, value: function () { return this._wrapped } })
}.call(this); (function () {
var a = this, b = a.Backbone, c = [], d = c.push, f = c.slice, q = c.splice; var p = "undefined" !== typeof exports ? exports : a.Backbone = {}; p.VERSION = "1.0.0"; var n = a._; n || "undefined" === typeof require || (n = require("underscore")); p.$ = a.jQuery || a.Zepto || a.ender || a.$; p.noConflict = function () { a.Backbone = b; return this }; p.emulateHTTP = !1; p.emulateJSON = !1; var A = p.Events = {
on: function (a, b, c) {
if (!D(this, "on", a, [b, c]) || !b) return this; this._events || (this._events = {}); (this._events[a] || (this._events[a] = [])).push({
callback: b, context: c,
ctx: c || this
}); return this
}, once: function (a, b, c) { if (!D(this, "once", a, [b, c]) || !b) return this; var d = this, f = n.once(function () { d.off(a, f); b.apply(this, arguments) }); f._callback = b; return this.on(a, f, c) }, off: function (a, b, c) {
var d, f, m, k; if (!this._events || !D(this, "off", a, [b, c])) return this; if (!a && !b && !c) return this._events = {}, this; var r = a ? [a] : n.keys(this._events); var q = 0; for (m = r.length; q < m; q++)if (a = r[q], f = this._events[a]) {
this._events[a] = d = []; if (b || c) {
var x = 0; for (k = f.length; x < k; x++) {
var p = f[x]; (b && b !== p.callback &&
b !== p.callback._callback || c && c !== p.context) && d.push(p)
}
} d.length || delete this._events[a]
} return this
}, trigger: function (a) { if (!this._events) return this; var b = f.call(arguments, 1); if (!D(this, "trigger", a, b)) return this; var c = this._events[a], d = this._events.all; c && S(c, b); d && S(d, arguments); return this }, stopListening: function (a, b, c) {
var d = this._listeners; if (!d) return this; var f = !b && !c; "object" === typeof b && (c = this); a && ((d = {})[a._listenerId] = a); for (var m in d) d[m].off(b, c, this), f && delete this._listeners[m];
return this
}
}, H = /\s+/, D = function (a, b, c, d) { if (!c) return !0; if ("object" === typeof c) { for (var f in c) a[b].apply(a, [f, c[f]].concat(d)); return !1 } if (H.test(c)) { c = c.split(H); f = 0; for (var m = c.length; f < m; f++)a[b].apply(a, [c[f]].concat(d)); return !1 } return !0 }, S = function (a, b) {
var c, d = -1, f = a.length, m = b[0], k = b[1], r = b[2]; switch (b.length) {
case 0: for (; ++d < f;)(c = a[d]).callback.call(c.ctx); break; case 1: for (; ++d < f;)(c = a[d]).callback.call(c.ctx, m); break; case 2: for (; ++d < f;)(c = a[d]).callback.call(c.ctx, m, k); break; case 3: for (; ++d <
f;)(c = a[d]).callback.call(c.ctx, m, k, r); break; default: for (; ++d < f;)(c = a[d]).callback.apply(c.ctx, b)
}
}; n.each({ listenTo: "on", listenToOnce: "once" }, function (a, b) { A[b] = function (b, c, d) { var f = this._listeners || (this._listeners = {}), h = b._listenerId || (b._listenerId = n.uniqueId("l")); f[h] = b; "object" === typeof c && (d = this); b[a](c, d, this); return this } }); A.bind = A.on; A.unbind = A.off; n.extend(p, A); var N = p.Model = function (a, b) {
var c, d = a || {}; b || (b = {}); this.cid = n.uniqueId("c"); this.attributes = {}; n.extend(this, n.pick(b, M));
b.parse && (d = this.parse(d, b) || {}); if (c = n.result(this, "defaults")) d = n.defaults({}, d, c); this.set(d, b); this.changed = {}; this.initialize.apply(this, arguments)
}, M = ["url", "urlRoot", "collection"]; n.extend(N.prototype, A, {
changed: null, validationError: null, idAttribute: "id", initialize: function () { }, toJSON: function (a) { return n.clone(this.attributes) }, sync: function () { return p.sync.apply(this, arguments) }, get: function (a) { return this.attributes[a] }, escape: function (a) { return n.escape(this.get(a)) }, has: function (a) {
return null !=
this.get(a)
}, set: function (a, b, c) {
var d; if (null == a) return this; if ("object" === typeof a) { var f = a; c = b } else (f = {})[a] = b; c || (c = {}); if (!this._validate(f, c)) return !1; var m = c.unset; var k = c.silent; a = []; var q = this._changing; this._changing = !0; q || (this._previousAttributes = n.clone(this.attributes), this.changed = {}); var r = this.attributes; var x = this._previousAttributes; this.idAttribute in f && (this.id = f[this.idAttribute]); for (d in f) b = f[d], n.isEqual(r[d], b) || a.push(d), n.isEqual(x[d], b) ? delete this.changed[d] : this.changed[d] =
b, m ? delete r[d] : r[d] = b; if (!k) for (a.length && (this._pending = !0), b = 0, d = a.length; b < d; b++)this.trigger("change:" + a[b], this, r[a[b]], c); if (q) return this; if (!k) for (; this._pending;)this._pending = !1, this.trigger("change", this, c); this._changing = this._pending = !1; return this
}, unset: function (a, b) { return this.set(a, void 0, n.extend({}, b, { unset: !0 })) }, clear: function (a) { var b = {}, c; for (c in this.attributes) b[c] = void 0; return this.set(b, n.extend({}, a, { unset: !0 })) }, hasChanged: function (a) {
return null == a ? !n.isEmpty(this.changed) :
n.has(this.changed, a)
}, changedAttributes: function (a) { if (!a) return this.hasChanged() ? n.clone(this.changed) : !1; var b, c = !1, d = this._changing ? this._previousAttributes : this.attributes, f; for (f in a) n.isEqual(d[f], b = a[f]) || ((c || (c = {}))[f] = b); return c }, previous: function (a) { return null != a && this._previousAttributes ? this._previousAttributes[a] : null }, previousAttributes: function () { return n.clone(this._previousAttributes) }, fetch: function (a) {
a = a ? n.clone(a) : {}; void 0 === a.parse && (a.parse = !0); var b = this, c = a.success;
a.success = function (d) { if (!b.set(b.parse(d, a), a)) return !1; c && c(b, d, a); b.trigger("sync", b, d, a) }; Y(this, a); return this.sync("read", this, a)
}, save: function (a, b, c) {
var d = this.attributes; if (null == a || "object" === typeof a) { var f = a; c = b } else (f = {})[a] = b; if (!(!f || c && c.wait || this.set(f, c))) return !1; c = n.extend({ validate: !0 }, c); if (!this._validate(f, c)) return !1; f && c.wait && (this.attributes = n.extend({}, d, f)); void 0 === c.parse && (c.parse = !0); var m = this, k = c.success; c.success = function (a) {
m.attributes = d; var b = m.parse(a, c);
c.wait && (b = n.extend(f || {}, b)); if (n.isObject(b) && !m.set(b, c)) return !1; k && k(m, a, c); m.trigger("sync", m, a, c)
}; Y(this, c); a = this.isNew() ? "create" : c.patch ? "patch" : "update"; "patch" === a && (c.attrs = f); a = this.sync(a, this, c); f && c.wait && (this.attributes = d); return a
}, destroy: function (a) {
a = a ? n.clone(a) : {}; var b = this, c = a.success, d = function () { b.trigger("destroy", b, b.collection, a) }; a.success = function (f) { (a.wait || b.isNew()) && d(); c && c(b, f, a); b.isNew() || b.trigger("sync", b, f, a) }; if (this.isNew()) return a.success(), !1; Y(this,
a); var f = this.sync("delete", this, a); a.wait || d(); return f
}, url: function () { var a = n.result(this, "urlRoot") || n.result(this.collection, "url") || ja(); return this.isNew() ? a : a + ("/" === a.charAt(a.length - 1) ? "" : "/") + encodeURIComponent(this.id) }, parse: function (a, b) { return a }, clone: function () { return new this.constructor(this.attributes) }, isNew: function () { return null == this.id }, isValid: function (a) { return this._validate({}, n.extend(a || {}, { validate: !0 })) }, _validate: function (a, b) {
if (!b.validate || !this.validate) return !0;
a = n.extend({}, this.attributes, a); a = this.validationError = this.validate(a, b) || null; if (!a) return !0; this.trigger("invalid", this, a, n.extend(b || {}, { validationError: a })); return !1
}
}); n.each("keys values pairs invert pick omit".split(" "), function (a) { N.prototype[a] = function () { var b = f.call(arguments); b.unshift(this.attributes); return n[a].apply(n, b) } }); var F = p.Collection = function (a, b) {
b || (b = {}); b.url && (this.url = b.url); b.model && (this.model = b.model); void 0 !== b.comparator && (this.comparator = b.comparator); this._reset();
this.initialize.apply(this, arguments); a && this.reset(a, n.extend({ silent: !0 }, b))
}, J = { add: !0, remove: !0, merge: !0 }, C = { add: !0, merge: !1, remove: !1 }; n.extend(F.prototype, A, {
model: N, initialize: function () { }, toJSON: function (a) { return this.map(function (b) { return b.toJSON(a) }) }, sync: function () { return p.sync.apply(this, arguments) }, add: function (a, b) { return this.set(a, n.defaults(b || {}, C)) }, remove: function (a, b) {
a = n.isArray(a) ? a.slice() : [a]; b || (b = {}); var c, d; var f = 0; for (c = a.length; f < c; f++)if (d = this.get(a[f])) {
delete this._byId[d.id];
delete this._byId[d.cid]; var k = this.indexOf(d); this.models.splice(k, 1); this.length--; b.silent || (b.index = k, d.trigger("remove", d, this, b)); this._removeReference(d)
} return this
}, set: function (a, b) {
b = n.defaults(b || {}, J); b.parse && (a = this.parse(a, b)); n.isArray(a) || (a = a ? [a] : []); var c, f, h, k, m = b.at, r = this.comparator && null == m && !1 !== b.sort, x = n.isString(this.comparator) ? this.comparator : null, p = [], G = [], E = {}; var u = 0; for (c = a.length; u < c; u++)if (f = this._prepareModel(a[u], b)) (h = this.get(f)) ? (b.remove && (E[h.cid] = !0), b.merge &&
(h.set(f.attributes, b), r && !k && h.hasChanged(x) && (k = !0))) : b.add && (p.push(f), f.on("all", this._onModelEvent, this), this._byId[f.cid] = f, null != f.id && (this._byId[f.id] = f)); if (b.remove) { u = 0; for (c = this.length; u < c; ++u)E[(f = this.models[u]).cid] || G.push(f); G.length && this.remove(G, b) } p.length && (r && (k = !0), this.length += p.length, null != m ? q.apply(this.models, [m, 0].concat(p)) : d.apply(this.models, p)); k && this.sort({ silent: !0 }); if (b.silent) return this; u = 0; for (c = p.length; u < c; u++)(f = p[u]).trigger("add", f, this, b); k && this.trigger("sort",
this, b); return this
}, reset: function (a, b) { b || (b = {}); for (var c = 0, d = this.models.length; c < d; c++)this._removeReference(this.models[c]); b.previousModels = this.models; this._reset(); this.add(a, n.extend({ silent: !0 }, b)); b.silent || this.trigger("reset", this, b); return this }, push: function (a, b) { a = this._prepareModel(a, b); this.add(a, n.extend({ at: this.length }, b)); return a }, pop: function (a) { var b = this.at(this.length - 1); this.remove(b, a); return b }, unshift: function (a, b) {
a = this._prepareModel(a, b); this.add(a, n.extend({ at: 0 },
b)); return a
}, shift: function (a) { var b = this.at(0); this.remove(b, a); return b }, slice: function (a, b) { return this.models.slice(a, b) }, get: function (a) { if (null != a) return this._byId[null != a.id ? a.id : a.cid || a] }, at: function (a) { return this.models[a] }, where: function (a, b) { return n.isEmpty(a) ? b ? void 0 : [] : this[b ? "find" : "filter"](function (b) { for (var c in a) if (a[c] !== b.get(c)) return !1; return !0 }) }, findWhere: function (a) { return this.where(a, !0) }, sort: function (a) {
if (!this.comparator) throw Error("Cannot sort a set without a comparator");
a || (a = {}); n.isString(this.comparator) || 1 === this.comparator.length ? this.models = this.sortBy(this.comparator, this) : this.models.sort(n.bind(this.comparator, this)); a.silent || this.trigger("sort", this, a); return this
}, sortedIndex: function (a, b, c) { b || (b = this.comparator); var d = n.isFunction(b) ? b : function (a) { return a.get(b) }; return n.sortedIndex(this.models, a, d, c) }, pluck: function (a) { return n.invoke(this.models, "get", a) }, fetch: function (a) {
a = a ? n.clone(a) : {}; void 0 === a.parse && (a.parse = !0); var b = a.success, c = this;
a.success = function (d) { c[a.reset ? "reset" : "set"](d, a); b && b(c, d, a); c.trigger("sync", c, d, a) }; Y(this, a); return this.sync("read", this, a)
}, create: function (a, b) { b = b ? n.clone(b) : {}; if (!(a = this._prepareModel(a, b))) return !1; b.wait || this.add(a, b); var c = this, d = b.success; b.success = function (f) { b.wait && c.add(a, b); d && d(a, f, b) }; a.save(null, b); return a }, parse: function (a, b) { return a }, clone: function () { return new this.constructor(this.models) }, _reset: function () { this.length = 0; this.models = []; this._byId = {} }, _prepareModel: function (a,
b) { if (a instanceof N) return a.collection || (a.collection = this), a; b || (b = {}); b.collection = this; var c = new this.model(a, b); return c._validate(a, b) ? c : (this.trigger("invalid", this, a, b), !1) }, _removeReference: function (a) { this === a.collection && delete a.collection; a.off("all", this._onModelEvent, this) }, _onModelEvent: function (a, b, c, d) {
if ("add" !== a && "remove" !== a || c === this) "destroy" === a && this.remove(b, d), b && a === "change:" + b.idAttribute && (delete this._byId[b.previous(b.idAttribute)], null != b.id && (this._byId[b.id] = b)),
this.trigger.apply(this, arguments)
}
}); n.each("forEach each map collect reduce foldl inject reduceRight foldr find detect filter select reject every all some any include contains invoke max min toArray size first head take initial rest tail drop last without indexOf shuffle lastIndexOf isEmpty chain".split(" "), function (a) { F.prototype[a] = function () { var b = f.call(arguments); b.unshift(this.models); return n[a].apply(n, b) } }); n.each(["groupBy", "countBy", "sortBy"], function (a) {
F.prototype[a] = function (b, c) {
var d =
n.isFunction(b) ? b : function (a) { return a.get(b) }; return n[a](this.models, d, c)
}
}); c = p.View = function (a) { this.cid = n.uniqueId("view"); this._configure(a || {}); this._ensureElement(); this.initialize.apply(this, arguments); this.delegateEvents() }; var I = /^(\S+)\s*(.*)$/, u = "model collection el id attributes className tagName events".split(" "); n.extend(c.prototype, A, {
tagName: "div", $: function (a) { return this.$el.find(a) }, initialize: function () { }, render: function () { return this }, remove: function () {
this.$el.remove(); this.stopListening();
return this
}, setElement: function (a, b) { this.$el && this.undelegateEvents(); this.$el = a instanceof p.$ ? a : p.$(a); this.el = this.$el[0]; !1 !== b && this.delegateEvents(); return this }, delegateEvents: function (a) { if (!a && !(a = n.result(this, "events"))) return this; this.undelegateEvents(); for (var b in a) { var c = a[b]; n.isFunction(c) || (c = this[a[b]]); if (c) { var d = b.match(I), f = d[1]; d = d[2]; c = n.bind(c, this); f += ".delegateEvents" + this.cid; if ("" === d) this.$el.on(f, c); else this.$el.on(f, d, c) } } return this }, undelegateEvents: function () {
this.$el.off(".delegateEvents" +
this.cid); return this
}, _configure: function (a) { this.options && (a = n.extend({}, n.result(this, "options"), a)); n.extend(this, n.pick(a, u)); this.options = a }, _ensureElement: function () { if (this.el) this.setElement(n.result(this, "el"), !1); else { var a = n.extend({}, n.result(this, "attributes")); this.id && (a.id = n.result(this, "id")); this.className && (a["class"] = n.result(this, "className")); a = p.$("<" + n.result(this, "tagName") + ">").attr(a); this.setElement(a, !1) } }
}); p.sync = function (a, b, c) {
var d = E[a]; n.defaults(c || (c = {}), {
emulateHTTP: p.emulateHTTP,
emulateJSON: p.emulateJSON
}); var f = { type: d, dataType: "json" }; c.url || (f.url = n.result(b, "url") || ja()); null != c.data || !b || "create" !== a && "update" !== a && "patch" !== a || (f.contentType = "application/json", f.data = JSON.stringify(c.attrs || b.toJSON(c))); c.emulateJSON && (f.contentType = "application/x-www-form-urlencoded", f.data = f.data ? { model: f.data } : {}); if (c.emulateHTTP && ("PUT" === d || "DELETE" === d || "PATCH" === d)) {
f.type = "POST"; c.emulateJSON && (f.data._method = d); var k = c.beforeSend; c.beforeSend = function (a) {
a.setRequestHeader("X-HTTP-Method-Override",
d); if (k) return k.apply(this, arguments)
}
} "GET" === f.type || c.emulateJSON || (f.processData = !1); "PATCH" !== f.type || !window.ActiveXObject || window.external && window.external.msActiveXFilteringEnabled || (f.xhr = function () { return new ActiveXObject("Microsoft.XMLHTTP") }); a = c.xhr = p.ajax(n.extend(f, c)); b.trigger("request", b, a, c); return a
}; var E = { create: "POST", update: "PUT", patch: "PATCH", "delete": "DELETE", read: "GET" }; p.ajax = function () { return p.$.ajax.apply(p.$, arguments) }; var G = p.Router = function (a) {
a || (a = {}); a.routes &&
(this.routes = a.routes); this._bindRoutes(); this.initialize.apply(this, arguments)
}, k = /\((.*?)\)/g, x = /(\(\?)?:\w+/g, Q = /\*\w+/g, y = /[\-{}\[\]+?.,\\\^$|#\s]/g; n.extend(G.prototype, A, {
initialize: function () { }, route: function (a, b, c) { n.isRegExp(a) || (a = this._routeToRegExp(a)); n.isFunction(b) && (c = b, b = ""); c || (c = this[b]); var d = this; p.history.route(a, function (f) { f = d._extractParameters(a, f); c && c.apply(d, f); d.trigger.apply(d, ["route:" + b].concat(f)); d.trigger("route", b, f); p.history.trigger("route", d, b, f) }); return this },
navigate: function (a, b) { p.history.navigate(a, b); return this }, _bindRoutes: function () { if (this.routes) { this.routes = n.result(this, "routes"); for (var a, b = n.keys(this.routes); null != (a = b.pop());)this.route(a, this.routes[a]) } }, _routeToRegExp: function (a) { a = a.replace(y, "\\$&").replace(k, "(?:$1)?").replace(x, function (a, b) { return b ? a : "([^/]+)" }).replace(Q, "(.*?)"); return new RegExp("^" + a + "$") }, _extractParameters: function (a, b) { a = a.exec(b).slice(1); return n.map(a, function (a) { return a ? decodeURIComponent(a) : null }) }
});
var K = p.History = function () { this.handlers = []; n.bindAll(this, "checkUrl"); "undefined" !== typeof window && (this.location = window.location, this.history = window.history) }, W = /^[#\/]|\s+$/g, ha = /^\/+|\/+$/g, ia = /msie [\w.]+/, T = /\/$/; K.started = !1; n.extend(K.prototype, A, {
interval: 50, getHash: function (a) { return (a = (a || this).location.href.match(/#(.*)$/)) ? a[1] : "" }, getFragment: function (a, b) {
null == a && (this._hasPushState || !this._wantsHashChange || b ? (a = this.location.pathname, b = this.root.replace(T, ""), a.indexOf(b) || (a = a.substr(b.length))) :
a = this.getHash()); return a.replace(W, "")
}, start: function (a) {
if (K.started) throw Error("Backbone.history has already been started"); K.started = !0; this.options = n.extend({}, { root: "/" }, this.options, a); this.root = this.options.root; this._wantsHashChange = !1 !== this.options.hashChange; this._wantsPushState = !!this.options.pushState; this._hasPushState = !!(this.options.pushState && this.history && this.history.pushState); a = this.getFragment(); var b = document.documentMode; b = ia.exec(navigator.userAgent.toLowerCase()) && (!b ||
7 >= b); this.root = ("/" + this.root + "/").replace(ha, "/"); b && this._wantsHashChange && (this.iframe = p.$('').hide().appendTo("body")[0].contentWindow, this.navigate(a)); if (this._hasPushState) p.$(window).on("popstate", this.checkUrl); else if (this._wantsHashChange && "onhashchange" in window && !b) p.$(window).on("hashchange", this.checkUrl); else this._wantsHashChange && (this._checkUrlInterval = setInterval(this.checkUrl, this.interval)); this.fragment = a; a = this.location; b = a.pathname.replace(/[^\/]$/,
"$&/") === this.root; if (this._wantsHashChange && this._wantsPushState && !this._hasPushState && !b) return this.fragment = this.getFragment(null, !0), this.location.replace(this.root + this.location.search + "#" + this.fragment), !0; this._wantsPushState && this._hasPushState && b && a.hash && (this.fragment = this.getHash().replace(W, ""), this.history.replaceState({}, document.title, this.root + this.fragment + a.search)); if (!this.options.silent) return this.loadUrl()
}, stop: function () {
p.$(window).off("popstate", this.checkUrl).off("hashchange",
this.checkUrl); clearInterval(this._checkUrlInterval); K.started = !1
}, route: function (a, b) { this.handlers.unshift({ route: a, callback: b }) }, checkUrl: function (a) { a = this.getFragment(); a === this.fragment && this.iframe && (a = this.getFragment(this.getHash(this.iframe))); if (a === this.fragment) return !1; this.iframe && this.navigate(a); this.loadUrl() || this.loadUrl(this.getHash()) }, loadUrl: function (a) { var b = this.fragment = this.getFragment(a); return n.any(this.handlers, function (a) { if (a.route.test(b)) return a.callback(b), !0 }) },
navigate: function (a, b) {
if (!K.started) return !1; b && !0 !== b || (b = { trigger: b }); a = this.getFragment(a || ""); if (this.fragment !== a) {
this.fragment = a; var c = this.root + a; if (this._hasPushState) this.history[b.replace ? "replaceState" : "pushState"]({}, document.title, c); else if (this._wantsHashChange) this._updateHash(this.location, a, b.replace), this.iframe && a !== this.getFragment(this.getHash(this.iframe)) && (b.replace || this.iframe.document.open().close(), this._updateHash(this.iframe.location, a, b.replace)); else return this.location.assign(c);
b.trigger && this.loadUrl(a)
}
}, _updateHash: function (a, b, c) { c ? (c = a.href.replace(/(javascript:|#).*$/, ""), a.replace(c + "#" + b)) : a.hash = "#" + b }
}); p.history = new K; N.extend = F.extend = G.extend = c.extend = K.extend = function (a, b) { var c = this; var d = a && n.has(a, "constructor") ? a.constructor : function () { return c.apply(this, arguments) }; n.extend(d, c, b); b = function () { this.constructor = d }; b.prototype = c.prototype; d.prototype = new b; a && n.extend(d.prototype, a); d.__super__ = c.prototype; return d }; var ja = function () {
throw Error('A "url" property or function must be specified');
}, Y = function (a, b) { var c = b.error; b.error = function (d) { c && c(a, d, b); a.trigger("error", a, d, b) } }
}).call(this); (function () {
var a = function (a, b) { for (var c = b.exec(a), d = [], p; null != c;)p = c.index, 0 != p && (a.substring(0, p), d.push(a.substring(0, p)), a = a.slice(p)), d.push(c[0]), a = a.slice(c[0].length), c = b.exec(a); "" == !a && d.push(a); return d }, b = function (a, b) { for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c]) }; EJS = function (a) {
a = "string" == typeof a ? { view: a } : a; this.set_options(a); if (a.precompiled) this.template = {}, this.template.process = a.precompiled, EJS.update(this.name, this); else {
if (a.element) {
if ("string" == typeof a.element) {
var b =
a.element; a.element = document.getElementById(a.element); if (null == a.element) throw b + "does not exist!";
} this.text = a.element.value ? a.element.value : a.element.innerHTML; this.name = a.element.id; this.type = "["
} else if (a.url) {
a.url = EJS.endExt(a.url, this.extMatch); this.name = this.name ? this.name : a.url; b = a.url; var c = EJS.get(this.name, this.cache); if (c) return c; if (c == EJS.INVALID_PATH) return null; try { this.text = EJS.request(b + (this.cache ? "" : "?" + Math.random())) } catch (q) { } if (null == this.text) throw {
type: "EJS", message: "There is no template at " +
b
};
} c = new EJS.Compiler(this.text, this.type); c.compile(a, this.name); EJS.update(this.name, this); this.template = c
}
}; EJS.prototype = {
render: function (a, b) { a = a || {}; this._extra_helpers = b; b = new EJS.Helpers(a, b || {}); return this.template.process.call(a, a, b) }, update: function (a, b) {
"string" == typeof a && (a = document.getElementById(a)); if (null == b) return _template = this, function (b) { EJS.prototype.update.call(_template, a, b) }; "string" == typeof b ? (params = {}, params.url = b, _template = this, params.onComplete = function (b) {
b = eval(b.responseText);
EJS.prototype.update.call(_template, a, b)
}, EJS.ajax_request(params)) : a.innerHTML = this.render(b)
}, out: function () { return this.template.out }, set_options: function (a) { this.type = a.type || EJS.type; this.cache = null != a.cache ? a.cache : EJS.cache; this.text = a.text || null; this.name = a.name || null; this.ext = a.ext || EJS.ext; this.extMatch = new RegExp(this.ext.replace(/\./, ".")) }
}; EJS.endExt = function (a, b) { if (!a) return null; b.lastIndex = 0; return a + (b.test(a) ? "" : this.ext) }; EJS.Scanner = function (a, d, f) {
b(this, {
left_delimiter: d + "%",
right_delimiter: "%" + f, double_left: d + "%%", double_right: "%%" + f, left_equal: d + "%=", left_comment: d + "%#"
}); this.SplitRegexp = "[" == d ? /(\[%%)|(%%\])|(\[%=)|(\[%#)|(\[%)|(%\]\n)|(%\])|(\n)/ : new RegExp("(" + this.double_left + ")|(%%" + this.double_right + ")|(" + this.left_equal + ")|(" + this.left_comment + ")|(" + this.left_delimiter + ")|(" + this.right_delimiter + "\n)|(" + this.right_delimiter + ")|(\n)"); this.source = a; this.stag = null; this.lines = 0
}; EJS.Scanner.to_text = function (a) {
return null == a || void 0 === a ? "" : a instanceof Date ? a.toDateString() :
a.toString ? a.toString() : ""
}; EJS.Scanner.prototype = { scan: function (b) { scanline = this.scanline; regex = this.SplitRegexp; if ("" == !this.source) for (var c = a(this.source, /\n/), f = 0; f < c.length; f++)this.scanline(c[f], regex, b) }, scanline: function (b, d, f) { this.lines++; b = a(b, d); for (d = 0; d < b.length; d++) { var c = b[d]; if (null != c) try { f(c, this) } catch (p) { throw { type: "EJS.Scanner", line: this.lines }; } } } }; EJS.Buffer = function (a, b) { this.line = []; this.script = ""; this.pre_cmd = a; this.post_cmd = b; for (b = 0; b < this.pre_cmd.length; b++)this.push(a[b]) };
EJS.Buffer.prototype = { push: function (a) { this.line.push(a) }, cr: function () { this.script += this.line.join("; "); this.line = []; this.script += "\n" }, close: function () { if (0 < this.line.length) { for (var a = 0; a < this.post_cmd.length; a++)this.push(pre_cmd[a]); this.script += this.line.join("; "); line = null } } }; EJS.Compiler = function (a, b) {
this.pre_cmd = ["var ___ViewO = [];"]; this.post_cmd = []; this.source = " "; null != a && ("string" == typeof a ? (a = a.replace(/\r\n/g, "\n"), this.source = a = a.replace(/\r/g, "\n")) : a.innerHTML && (this.source =
a.innerHTML), "string" != typeof this.source && (this.source = "")); b = b || "<"; a = ">"; switch (b) { case "[": a = "]"; break; case "<": break; default: throw b + " is not a supported deliminator"; }this.scanner = new EJS.Scanner(this.source, b, a); this.out = ""
}; EJS.Compiler.prototype = {
compile: function (a, b) {
a = a || {}; this.out = ""; var c = new EJS.Buffer(this.pre_cmd, this.post_cmd), d = "", p = function (a) { a = a.replace(/\\/g, "\\\\"); a = a.replace(/\n/g, "\\n"); return a = a.replace(/"/g, '\\"') }; this.scanner.scan(function (a, b) {
if (null == b.stag) switch (a) {
case "\n": d +=
"\n"; c.push('___ViewO.push("' + p(d) + '");'); c.cr(); d = ""; break; case b.left_delimiter: case b.left_equal: case b.left_comment: b.stag = a; 0 < d.length && c.push('___ViewO.push("' + p(d) + '")'); d = ""; break; case b.double_left: d += b.left_delimiter; break; default: d += a
} else switch (a) {
case b.right_delimiter: switch (b.stag) { case b.left_delimiter: "\n" == d[d.length - 1] ? (d = d.substr(0, d.length - 1), c.push(d), c.cr()) : c.push(d); break; case b.left_equal: c.push("___ViewO.push((EJS.Scanner.to_text(" + d + ")))") }b.stag = null; d = ""; break; case b.double_right: d +=
b.right_delimiter; break; default: d += a
}
}); 0 < d.length && c.push('___ViewO.push("' + p(d) + '")'); c.close(); this.out = c.script + ";"; b = "/*" + b + "*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {" + this.out + " return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};"; try { eval(b) } catch (A) {
if ("undefined" != typeof JSLINT) {
JSLINT(this.out); for (var n = 0; n < JSLINT.errors.length; n++)if (b = JSLINT.errors[n], "Unnecessary semicolon." != b.reason) throw b.line++, n = Error(), n.lineNumber = b.line,
n.message = b.reason, a.view && (n.fileName = a.view), n;
} else throw A;
}
}
}; EJS.config = function (a) { EJS.cache = null != a.cache ? a.cache : EJS.cache; EJS.type = null != a.type ? a.type : EJS.type; EJS.ext = null != a.ext ? a.ext : EJS.ext; var b = EJS.templates_directory || {}; EJS.templates_directory = b; EJS.get = function (a, c) { return 0 == c ? null : b[a] ? b[a] : null }; EJS.update = function (a, c) { null != a && (b[a] = c) }; EJS.INVALID_PATH = -1 }; EJS.config({ cache: !0, type: "<", ext: ".ejs" }); EJS.Helpers = function (a, d) { this._data = a; this._extras = d; b(this, d) }; EJS.Helpers.prototype =
{ view: function (a, b, f) { f || (f = this._extras); b || (b = this._data); return (new EJS(a)).render(b, f) }, to_text: function (a, b) { return null == a || void 0 === a ? b || "" : a instanceof Date ? a.toDateString() : a.toString ? a.toString().replace(/\n/g, "
").replace(/''/g, "'") : "" } }; EJS.newRequest = function () { for (var a = [function () { return new ActiveXObject("Msxml2.XMLHTTP") }, function () { return new XMLHttpRequest }, function () { return new ActiveXObject("Microsoft.XMLHTTP") }], b = 0; b < a.length; b++)try { var f = a[b](); if (null != f) return f } catch (q) { } };
EJS.request = function (a) { var b = new EJS.newRequest; b.open("GET", a, !1); try { b.send(null) } catch (f) { return null } return 404 == b.status || 2 == b.status || 0 == b.status && "" == b.responseText ? null : b.responseText }; EJS.ajax_request = function (a) { a.method = a.method ? a.method : "GET"; var b = new EJS.newRequest; b.onreadystatechange = function () { if (4 == b.readyState) a.onComplete(b) }; b.open(a.method, a.url); b.send(null) }
})(); if (!wood) var wood = {};
if (!Wood) {
var Wood = { Model: {}, Modules: { Client: {}, Controller: { Base: {}, Login: {} } }, Controller: {}, Collection: {}, View: { Common: {}, Nfc: {}, Title: {}, Ranking: {}, Aoc: { Check: {}, List: {} } }, UrlPrefix: {}, Debug: {}, Test: {} }, wood_client = {}; Wood.isWiiU = "undefined" !== typeof wiiuSystemSetting; var NINJA_BASE = "https://ninja.wup.shop.nintendo.net/ninja/", SAMURAI_ORIGINBASE = "https://samurai.wup.shop.nintendo.net/samurai/"; Wood.getHostName = function () { return location.hostname }; Wood.setupUrlPrefix = function () {
Wood.UrlPrefix.NINJA = NINJA_BASE;
Wood.UrlPrefix.SAMURAI_ORIGIN = SAMURAI_ORIGINBASE; var a = Wood.getHostName(); 0 <= a.indexOf("geisha") ? Wood.UrlPrefix.SAMURAI = "https://" + a.replace("geisha", "samurai") + "/samurai/" : Wood.UrlPrefix.SAMURAI = SAMURAI_ORIGINBASE; if (!Wood.isWiiU) { if (a = localStorage.getItem("samurai_base")) Wood.UrlPrefix.SAMURAI_ORIGIN = a, Wood.UrlPrefix.SAMURAI = a; if (a = localStorage.getItem("ninja_base")) Wood.UrlPrefix.NINJA = a }
}; Wood.setupUrlPrefix(); Wood.isSWLoaded = function () { return "StopWatch" in window }; Wood.hasSW = function () { if (Wood.isSWLoaded()) return !!wood.stop_watch };
Wood.initializeSW = function (a) { Wood.isSWLoaded() && (wood.stop_watch = new StopWatch(a), wood.stop_watch.start()) }; Wood.lap = function (a) { Wood.isSWLoaded() && (Wood.hasSW() || Wood.initializeSW("unknown"), wood.stop_watch.lap(a)) }; Wood.finalizeSW = function () { if (Wood.isSWLoaded()) { if (!Wood.hasSW()) throw "wood.stop_watch not initialized."; wood.stop_watch.finish(); wood.stop_watch.reportText().split("\n").forEach(function (a, b) { Wood.log(a) }); wood.stop_watch = null } }; Wood.log = function (a) {
if (Wood.isWiiU && "undefined" !== typeof wiiuDebug) for (; a;)wiiuDebug.print(a.substr(0,
200)), a = a.substr(200); else console.log(a)
}
} window.jQuery && jQuery.extend({ print: function (a) { "undefined" !== typeof wiiuDebug ? wiiuDebug.print(a) : "undefined" !== typeof console && console.log(a) } }); (function () {
Wood.Storage = function (a) { this.storage = a }; Wood.Storage.Types = { string: { encode: function (a) { return a ? "" + a : "" }, decode: function (a) { return a ? "" + a : a } }, number: { encode: function (a) { if (!_.isNumber(a)) throw a + " is not number"; return "" + a }, decode: function (a) { return parseInt(a, 10) } }, "boolean": { encode: function (a) { return a ? "true" : "false" }, decode: function (a) { return "true" === a } }, json: { encode: function (a) { return JSON.stringify(a) }, decode: function (a) { return JSON.parse(a) } } }; Wood.Storage.validateAccessorEntry =
function (a) { return _.isString(a.name) && _.isString(a.key) && _.include(_.keys(Wood.Storage.Types), a.type) ? !0 : !1 }; Wood.Storage.injectAccessors = function (a, b) {
_.each(b, function (b) {
if (!Wood.Storage.validateAccessorEntry(b)) throw "invalid accessor entry: " + JSON.stringify(b); var c = Wood.Storage.Types[b.type]; a["set" + b.name] = function (a) { this.storage.setItem(b.key, c.encode(a)) }; a["get" + b.name] = function () { return c.decode(this.storage.getItem(b.key)) }; a["remove" + b.name] = function () { this.storage.removeItem(b.key) };
"boolean" === b.type && (a["is" + b.name] = function () { return !!c.decode(this.storage.getItem(b.key)) }, a["has" + b.name] = function () { return !!this.storage.getItem(b.key) })
})
}; Wood.Storage.create = function (a) { if (!_.isArray(a.accessors)) throw "accessors not specified"; if (!a.storage) throw "storage not specified"; var b = new Wood.Storage(a.storage); _.isFunction(a.writer) && (b.storageWrite = a.writer); Wood.Storage.injectAccessors(b, a.accessors); return b }
})(); (function () { var a = [{ name: "LangSelectable", key: "_lang_selectable_v1", type: "boolean" }, { name: "WishlistLastModified", key: "_wish_modified_v1", type: "number" }, { name: "MovieType", key: "movie_type", type: "string" }]; Wood.LocalStorage = { getRawInstance: function () { return "undefined" !== typeof wiiuSystemSetting ? wiiuLocalStorage : window.localStorage }, build: function (b) { return Wood.Storage.create({ storage: b, accessors: a }) } } })(); (function () { var a = []; Wood.SessionStorage = { getRawInstance: function () { return "undefined" !== typeof wiiuSystemSetting ? wiiuSessionStorage : window.sessionStorage }, build: function (b) { return Wood.Storage.create({ storage: b, accessors: a }) } } })(); (function () {
Wood.Util = {
each: function (a, b) { if (void 0 !== a && null !== a) if ("array" === $.type(a) || "object" === $.type(a)) if ("object" === $.type(a) && isNaN(parseInt(Object.keys(a), 10))) b(0, a); else for (var c in a) a.hasOwnProperty(c) && b(c, a[c]); else b(0, a) }, arrayDiff: function (a, b) { if (!a || !b) return !1; var c = []; a.forEach(function (a) { 0 > $.inArray(a, b) && c.push(a) }); b.forEach(function (b) { 0 > $.inArray(b, a) && c.push(b) }); return c }, isUndefined: function (a) { return void 0 === a || null === a }, isDefined: function (a) {
return void 0 !== a &&
null !== a
}, encodeValues: function (a) { var b = a.split("?"); a = b[0]; b = b[1]; if (!b) return a; var c = []; $.each(b.split("&"), function (a, b) { a = b.split("="); c.push(a[0] + "=" + encodeURIComponent(a[1])) }); return a + "?" + c.join("&") }, convertSecondToFormat: function (a) { var b = []; b[0] = Math.floor(a / 3600); b[1] = Math.floor(a / 60 % 60); 10 > b[1] && (b[1] = "0" + b[1]); b[2] = a % 60; 10 > b[2] && (b[2] = "0" + b[2]); return b.join(":") }, createPromise: function (a) { var b = jQuery.Deferred(); _.defer(function () { a(b) }); return b.promise() }, isWupNsuid: function (a) {
return a ?
"5" === a.toString().charAt(0) ? !1 : !0 : !0
}, createPlaceHolderUrl: function (a) { return "image/placeholder/place_icon_" + (Wood.Util.isWupNsuid(a) ? "wii_u" : "3ds") + ".png" }, createIconClass: function (a) { return "p-icon-" + (Wood.Util.isWupNsuid(a) ? "wup-M" : "ctr-M") }, formatTime: function (a) { var b = []; a = parseInt(a, 10); b[0] = Math.floor(a / 3600); b[1] = Math.floor(a / 60 % 60); 10 > b[1] && (b[1] = "0" + b[1]); b[2] = a % 60; 10 > b[2] && (b[2] = "0" + b[2]); return b.join(":") }
}
})(); (function () {
Wood.DomUtil = {
hookLabelSoundEffectEvent: function (a) { a.find('.se:not([data-sound-assigned="true"])').each(function () { var a = $(this).data("se-label"); $(this).on("click", function () { wood.client.playSound(a); return !0 }).on("touchstart", function () { wood.client.playSound("SE_WAVE_DRC_TOUCH_TRG"); return !0 }).attr("data-sound-assigned", !0) }) }, hookSoundEffectEvent: function (a) {
this.hookLabelSoundEffectEvent(a); $([['input[type="submit"]', "touchstart", ["SE_WAVE_DRC_TOUCH_TRG"]], ['input[type="submit"]',
"click", ["SE_WAVE_OK"]], ['input[type="reset"]', "touchstart", ["SE_WAVE_DRC_TOUCH_TRG"]], ['input[type="reset"]', "click", ["SE_WAVE_RESET"]], ['input[type="checkbox"]', "click", ["SE_WAVE_CHECKBOX_CHECK", "SE_WAVE_CHECKBOX_UNCHECK"]], ['input[type="radio"]', "click", ["SE_WAVE_DRC_TOUCH_TRG", "SE_WAVE_RADIOBUTTON_CHECK"]]]).each(function () {
var b = this[1], c = this[2]; a.find(this[0]).each(function () {
var a = $(this); a.data("sound-assigned") || a.on(b, function () {
if ("checkbox" === a.attr("type")) {
var b = a.prop("checked") ? 0 :
1; wood.client.playSound(c[b])
} else c.forEach(function (a) { wood.client.playSound(a) })
}).attr("data-sound-assigned", !0)
})
})
}, applyLocalizedText: function (a, b) { $("entry", b).each(function () { var b = '[data-message="' + $(this).attr("key") + '"]'; $(b, a).html($(this).text()) }) }, localizeText: function (a) { a = a || this.$el; a.find("[data-message]").each(function () { var a = $(this); a.html(wood.client.getText(a.attr("data-message"))) }) }, showBody: function () { $("body").removeClass("display_cover") }, hideBody: function () { $("body").addClass("display_cover") },
createSizeHTML: function (a, b, c) { var d = null; a = this.getSizeWithUnit(a); a.size = this.replaceRadixPoint(a.size, b, c); switch (a.unit) { case "GB": d = $("#str_gb").html(); break; case "MB": d = $("#str_mb").html(); break; case "KB": d = $("#str_kb").html() }return a.size + " " + d }, getSizeWithUnit: function (a) {
var b = parseInt(a, 10); 10239948 >= b ? (b = Math.floor(b / 10.24), a = "KB", 100 > b && (b = 100)) : 10485707571 >= b ? (b = Math.floor(b / 10485.76), a = "MB") : (b = Math.floor(b / 1.073741824E7), a = "GB"); b += 5; 999999 < b && (b = 999999); b /= 10; b = Math.floor(b / 10) + "." +
Math.floor(b % 10); return { size: b, unit: a }
}, replaceRadixPoint: function (a, b, c) { a = a.toString(); _.contains(["JP_ja", "US_en", "US_es", "EU_en", "EU_pt"], { JPN: "JP_", USA: "US_", EUR: "EU_", AUS: "EU_" }[c] + b) || (a = a.replace(".", ",")); return a }, applyTextOverflow: function (a) { var b = a.html(), c = a.clone(); c.css({ display: "none", position: "absolute", overflow: "visible", width: a.width(), height: "auto" }); for (a.after(c); 0 < b.length && c.height() > a.height();)b = b.substr(0, b.length - 1), c.html(b + "..."); a.html(c.html()); c.remove() }, formatDate: function (a) {
a =
a.split("-"); return 3 === a.length ? $("#str_release_ymd").html().replace("%{yyyy}", a[0]).replace("%{mm}", a[1]).replace("%{dd}", a[2]) : 2 === a.length ? $("#str_release_ym").html().replace("%{yyyy}", a[0]).replace("%{mm}", a[1]) : $("#str_release_y").html().replace("%{yyyy}", a[0])
}, animateToTop: function (a) { a ? $("html,body").animate({ scrollTop: a }, 0) : $("html,body").animate({ scrollTop: $("html,body").offset().top }, 0) }, lazyload: function (a) {
$(a).on("error", function () {
void 0 !== $(this).data("placeholder") && $(this).attr("src",
$(this).data("placeholder"))
}); $(a).each(function () { if (void 0 === $(this).data("loaded") || "placeholder" === $(this).data("loaded")) { var a = this; setTimeout(function () { var b = $(a).attr("src"), d = "placeholder"; void 0 !== $(a).data("original") && "" !== $(a).data("original") && (d = $(a).data("original"), $(a).attr("src", d), $(a).data("placeholder", b)); $(a).data("loaded", d) }, 0) } })
}, getTaxTextWithPriceObject: function (a) { var b = a.getAmount(); return a.isFree() ? b : this.getTaxText(b) }, getTaxText: function (a) {
var b = a, c; if (c = a) a =
(a = (a || "").match(/\d/g)) ? !/[1-9]/.test(a.join("")) : !1, c = !a; c && wood.client.isTaxIncludedMessageRequired() && (b = "AU" === wood.client.country ? b + (" " + $("#str_tax_included_au").html()) : b + (" " + $("#str_tax_included").html())); return b
}
}
})(); (function () { Wood.ErrorCode = { WISHLIST_FULL: 1073190, CLOSE_APPLICATION: 1119E3, RETRIABLE: 1119001, UNDER_MAINTENANCE: 1119002, SERVICE_FINISHED: 1119003, INVALID_TEMPLATE: 1119100, FOR_BROWSER_LOCKED: 1990503 } })(); (function () { Wood.ErrorViewer = { show: function (a, b) { Wood.log("[Wood.ErrorViewer] errorCode:" + a); Wood.log("[Wood.ErrorViewer] errorMessage:" + b); Wood.isWiiU ? (a = "string" === typeof a ? parseInt(a, 10) : a, Wood.Analytics.sendError(a), b ? wiiuErrorViewer.openByCodeAndMessage(a, b) : wiiuErrorViewer.openByCode(a)) : (Wood.Analytics.sendError(a), b ? Wood.ErrorViewer.showAlert(a + "\n\n" + b) : Wood.ErrorViewer.showAlert(a)) }, showAlert: function (a) { window.alert(a) } } })(); (function () {
Wood.SystemConfig = { PREFIX_SAMURAI: 110, PREFIX_NINJA: 107, PREFIX_CCIF: 126, PREFIX_OTHER: 111, ERROR_CODE_CLOSE_APPLICATION: 1119E3, ERROR_CODE_RETRIABLE: 1119001, ERROR_CODE_UNDER_MAINTENANCE: 1119002, ERROR_CODE_SERVICE_FINISHED: 1119003, ERROR_CODE_BROWSWER_LOCKED: 1990503, EXCLUSION_PLATFORM_IDS: "20,21,22,23,24,25,26,43,63,83", SESSION_UPDATE_INTERVAL: 36E5 }; Wood.SystemConfig.getExclusionPlatformIds = function () {
return _.map(Wood.SystemConfig.EXCLUSION_PLATFORM_IDS.split(","), function (a) {
return parseInt(a,
10)
})
}
})(); (function () {
var a = Wood.Error = function (a, b, c, d) { this.type = b; this.displayable = a; this.dialog_type = c; this.handler = d }; a.Type = { GENERIC: 1, SPECIFIC: 2 }; a.DialogType = { CONFIRM: 1, ALERT: 2 }; var b = function () { location.href = "index.html#top"; throw Error("error top_redirector stopper"); }, c = new a(!0, a.Type.GENERIC, a.DialogType.ALERT), d = new a(!0, a.Type.GENERIC, a.DialogType.ALERT, b), f = new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT), q = new a(!1, a.Type.SPECIFIC, a.DialogType.ALERT), p = {
3011: c, 3021: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT,
b), 3025: f, 3026: f, 3027: f, 3028: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3051: d, 3052: d, 3053: d, 3054: d, 3055: d, 3056: d, 3057: d, 3058: d, 3100: f, 3101: f, 3102: f, 3103: f, 3104: f, 3105: f, 3106: f, 3107: f, 3108: f, 3109: f, 3110: f, 3111: f, 3112: f, 3113: f, 3114: f, 3115: f, 3116: f, 3117: f, 3118: f, 3120: f, 3121: q, 3122: q, 3123: new a(!1, a.Type.GENERIC, a.DialogType.ALERT), 3124: new a(!1, a.Type.SPECIFIC, a.DialogType.CONFIRM), 3125: c, 3150: d, 3151: d, 3152: f, 3153: f, 3154: q, 3155: q, 3160: q, 3161: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3162: q,
3170: c, 3171: q, 3180: c, 3190: new a(!1, a.Type.SPECIFIC, a.DialogType.CONFIRM), 3191: d, 3200: new a(!1, a.Type.GENERIC, a.DialogType.ALERT), 3210: f, 3230: f, 3231: f, 3232: f, 3233: f, 3234: f, 3235: q, 3236: q, 3237: f, 3238: f, 3239: f, 3240: f, 3241: q, 3242: f, 3243: f, 3250: f, 3251: f, 3252: f, 3260: f, 3261: f, 3262: f, 3263: f, 3264: f, 3265: f, 3266: f, 3267: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3268: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 3271: f, 3278: f, 3279: f, 3301: new a(!1, a.Type.SPECIFIC, a.DialogType.ALERT, b), 5997: d, 6542: f, 6561: f,
6568: f, 6591: c, 6635: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 6644: new a(!0, a.Type.SPECIFIC, a.DialogType.ALERT, b), 6804: f, 6805: f, 6810: c, 6811: f, 6812: f, 6813: f, 6814: c, 6815: f, 6830: c, 6831: c, 6834: f, 6835: f, 6836: f, 6837: f, 6838: f, 6941: f, 6942: f, 6943: f, 6989: f, 7401: f, 7402: c, 7403: f, 7499: f, 7501: f, 7503: f, 7506: c, 7507: f, 7509: d, 7510: d, 7511: f, 7514: f, 7515: c, 7516: f, 7519: f, 7530: q, 7532: c, 7534: c, 7535: d, 7536: f, 7537: c, 9001: f, 9003: f, 9006: c, 9007: f, 9009: d, 9010: d, 9011: f, 9014: f, 9015: c, 9019: f, 9030: f, 9032: c, 9034: c, 9035: d, 9036: f,
9037: c, 9600: c, 9601: c, 9610: c, 9611: c, 9612: c, 9613: c, 9614: c, 9615: c, 9620: c, 9621: c, 9630: c, 9631: c, 9632: c, 9640: c, 9641: c, 9642: c
}; a.dispatch = function (a) { return p[a] }; a.Result = { ERROR_NOT_PROCESSED: 0, ERROR_MESSAGE_SHOWN: 1 }
})(); (function () { Wood.KeyMap = { BUTTON_A: 13, BUTTON_B: 27, BUTTON_X: 88, BUTTON_Y: 89, BUTTON_L: 76, BUTTON_R: 82, BUTTON_PLUS: 80, BUTTON_MINUS: 77 } })(); (function () { function a(a, c) { return function (b) { if (b.keyCode === a) return c.call(b, b) } } Wood.KeyEvent = { A: function (b) { return a(Wood.KeyMap.BUTTON_A, b) }, B: function (b) { return a(Wood.KeyMap.BUTTON_B, b) }, X: function (b) { return a(Wood.KeyMap.BUTTON_X, b) }, Y: function (b) { return a(Wood.KeyMap.BUTTON_Y, b) }, L: function (b) { return a(Wood.KeyMap.BUTTON_L, b) }, R: function (b) { return a(Wood.KeyMap.BUTTON_R, b) }, PLUS: function (b) { return a(Wood.KeyMap.BUTTON_PLUS, b) }, MINUS: function (b) { return a(Wood.KeyMap.BUTTON_MINUS, b) } } })(); (function () {
Wood.Request = function (a) { this.location = a; this._param = this.parseParam() }; Wood.Request.prototype = {
param: function (a) { return this._param[a] }, params: function () { return this._param }, getPathname: function () { return this.location.pathname }, getHash: function () { return this.location.hash }, getSearch: function () { return this.location.search }, getFilename: function () { return this.location.pathname.replace(/.*\//, "") }, isAppJump: function () { return "appJump" === this.param("seq") }, isFromPurchaseComplete: function () {
return "privJump" ===
this.param("seq")
}, parseParam: function () { var a = {}, b = (this.location || location).href.split("?"); if (1 < b.length) { b = b[b.length - 1].split("&"); for (var c = 0, d = b.length; c < d; c++) { var f = b[c].split("="); a[decodeURIComponent(f[0])] = decodeURIComponent(f[1]) } } else return !1; return a }
}
})(); (function () {
Wood.StarRating = function (a, b) { this.number = a; this.path_prefix = b ? b : "image/shelf01_01/img_relating_" }; Wood.StarRating.prototype = {
getNumber: function () { return this.number }, getImagePath: function () {
var a = this.number; return 4.75 <= a ? this.path_prefix + "05.png" : 4.25 <= a ? this.path_prefix + "04h.png" : 3.75 <= a ? this.path_prefix + "04.png" : 3.25 <= a ? this.path_prefix + "03h.png" : 2.75 <= a ? this.path_prefix + "03.png" : 2.25 <= a ? this.path_prefix + "02h.png" : 1.75 <= a ? this.path_prefix + "02.png" : 1.25 <= a ? this.path_prefix + "01h.png" :
this.path_prefix + "01.png"
}
}; Wood.StarRating.PathPrefix = { DATA01_SMALL: "image/data01_01/img_data01_01_evaluation_small_", DATA01_LARGE: "image/data01_01/img_data01_01_evaluation_large_" }; Wood.StarRating.NO_RATING_IMAGE_PATH = "image/shelf01_01/img_relating_00.png"
})(); (function () {
Wood.URL = function (a, b, c) { this.base_url = a; this.setQueryStrings(b); this.fragment = c }; Wood.URL.create = function (a, b, c) { return (new Wood.URL(a, b, c)).toString() }; Wood.URL.prototype = {
setQueryString: function (a, b) { this.query_strings[a] = b }, setQueryStrings: function (a) { this.query_strings = a || {} }, addQuery: function (a) { $.extend(this.query_strings, a) }, toString: function () {
return this.base_url + ($.isEmptyObject(this.query_strings) ? "" : "?") + $.map(this.query_strings, function (a, b) {
return encodeURIComponent(b) +
"=" + encodeURIComponent(a)
}).join("&") + (this.fragment ? "#" + this.fragment : "")
}
}
})(); (function () {
Wood.UserAgent = function (a) { this.user_agent_string = "string" === typeof a ? a : navigator.userAgent }; Wood.UserAgent.LATEST_VERSION = "1.5"; Wood.UserAgent.parseUserAgentString = function (a) { return new Wood.UserAgent(a) }; Wood.UserAgent.prototype = {
getWoodVersion: function () { var a = this.user_agent_string.match(/wood\/([\d\.]+)\.[^\d]/); return null !== a && 2 === a.length ? a[1] : 0 }, isWood: function () { return /wood\//.test(this.user_agent_string) }, isLatestVersion: function () { return this.getWoodVersion() === Wood.UserAgent.LATEST_VERSION },
isLatestVersionOrLater: function () { var a = parseFloat(this.getWoodVersion()), b = parseFloat(Wood.UserAgent.LATEST_VERSION); return a >= b }, toString: function () { return this.user_agent_string }
}
})(); (function () {
var a = { PARTNER: [0, 4], RESERVED: [4, 2], CATEGORY: [6, 2], PLATFORM: [8, 1], UNIQUE: [9, 5], VARIATION: [14, 2] }; Wood.TitleId = function (a) { this.title_id = a; this.id = this.getStructuredId(a) }; Wood.TitleId.prototype = {
getStructuredId: function (b) { if (!_.isString(b) || 16 !== b.length) throw Error("\u30bf\u30a4\u30c8\u30ebID\u304c\u6b63\u3057\u304f\u3042\u308a\u307e\u305b\u3093: " + b); var c = {}; _.each(a, function (a, f) { c[f.toLowerCase()] = b.substr(a[0], a[1]) }); return c }, getPartnerID: function () { return this.id.partner }, getCategoryID: function () { return this.id.category },
getPlatformID: function () { return this.id.platform }, getUniqueID: function () { return this.id.unique }, getVariation: function () { return this.id.variation }, getUniqueTitleName: function () { var a = this.id; return a.partner + a.reserved + a.category + a.platform + a.unique }, isSameTitleAs: function (a) { a = a instanceof Wood.TitleId ? a : new Wood.TitleId(a); return this.getUniqueTitleName() === a.getUniqueTitleName() }
}
})(); (function () {
Wood.Pagenation = function (a, b, c) { this.total_count = a; this.per_page = b; this.current_page = c }; Wood.Pagenation.prototype = {
getTotalCount: function () { return this.total_count }, setTotalCount: function (a) { this.total_count = a }, getPerPage: function () { return this.per_page }, getCurrentPage: function () { return this.current_page }, getOffset: function () { return (this.current_page - 1) * this.per_page }, setCurrentPage: function (a) { this.current_page = a }, getTotalPage: function () {
var a = this.getTotalCount(), b = this.getPerPage(),
c = parseInt(a / b, 10); 0 < a - b * c && c++; return c
}, getNextPage: function () { return this.getTotalPage() > this.getCurrentPage() ? this.getCurrentPage() + 1 : null }, getPrevPage: function () { return 1 === this.getTotalPage() || 1 === this.getCurrentPage() ? null : this.getCurrentPage() - 1 }, getSlicedIndexes: function () { if (0 === this.getTotalCount()) return []; var a = [], b = (this.getCurrentPage() - 1) * this.getPerPage(), c = b + this.getPerPage() - 1, d = this.getTotalCount() - 1; for (c > d && (c = d); b <= c; b++)a.push(b); return a }, getNaviPages: function () {
var a = this.getTotalPage(),
b = 5 > a ? a : 5, c = Math.floor(b / 2), d = this.getCurrentPage(), f = d - c; c = d + c; 7 === a ? (f = 1, c = 7) : (0 >= f && (f = 1, c = b), c > a && (c = a, f = a - b + 1), 4 > d && 6 <= a && c++, d > a - 3 && 6 <= a && f--); return _.range(f, c + 1)
}
}
})(); (function () {
Wood.Price = function (a, b, c, d, f, q) { this.id = parseInt(a, 10); this.raw_value = parseFloat(b, 10); this.amount = c; this.currency = d; this.discount_type = f; this.description = q; this.raw_value_text = b }; Wood.Price.DiscountType = { NONE: 1, NORMAL: 2, CONDITIONAL: 3, COUPON: 4 }; Wood.Price.prototype = {
getId: function () { return this.id }, getRawValue: function () { return this.raw_value }, getRawValueText: function () { return this.raw_value_text }, getAmount: function () { return this.amount }, getCurrency: function () { return this.currency }, getDiscountType: function () { return this.discount_type },
getDescription: function () { return this.description && "" !== this.description ? this.description : null }, isNotAtDiscount: function () { return this.discount_type === Wood.Price.DiscountType.NONE }, isAtNormalDiscount: function () { return this.discount_type === Wood.Price.DiscountType.NORMAL }, isAtConditionalDiscount: function () { return this.discount_type === Wood.Price.DiscountType.CONDITIONAL }, isAtCouponDiscount: function () { return this.discount_type === Wood.Price.DiscountType.COUPON }, isFree: function () { return 0 === this.raw_value }
};
_.defaults(Wood.Price, {
getDecimalPoint: function (a) { return 0 <= a.indexOf(".") ? a.length - 1 - a.indexOf(".") : 0 }, getPaddingInt: function (a, b) { a = a.replace(".", ""); for (var c = 0; c < b; c++)a += "0"; return parseInt(a, 10) }, addDot: function (a, b) { var c = this.priceAbs(a), d = c; if (0 < b) if (c.length <= b) { d = "0."; for (var f = 0; f < b - c.length; f++)d += "0"; d += c } else b = c.length - b, d = c.substring(0, b) + "." + c.substring(b); this.isNegative(a) && (d = "-" + d); return d }, isPositive: function (a) { return null !== a && null !== a.match(/^[0-9]+[\.]?[0-9]*$/) ? !0 : !1 },
isNegative: function (a) { return null === a || null === a.match(/^-[0-9]+[\.]?[0-9]*$/) || this.isZero(a) ? !1 : !0 }, isZero: function (a) { return null !== a ? null !== a.match(/^[\-]?[0]+[\.]?[0]*$/) : !1 }, priceAbs: function (a) { return this.isZero(a) ? a : this.isPositive(a) ? a : this.isNegative(a) ? a.slice(1) : null }, priceAdd: function (a, b) {
var c = this.priceAbs(a), d = this.priceAbs(b); if (null === c || null === d) return null; a = this.isNegative(a); var f = this.isNegative(b), q = this.getDecimalPoint(c), p = this.getDecimalPoint(d); b = Math.max(q, p); c = this.getPaddingInt(c.replace(".",
""), b - q); d = this.getPaddingInt(d.replace(".", ""), b - p); d = String((a ? -1 : 1) * c + (f ? -1 : 1) * d); return d = this.addDot(d, b)
}, priceSub: function (a, b) { var c; this.isNegative(b) ? c = b.slice(1) : this.isPositive(b) && (c = "-" + b); return void 0 !== c ? this.priceAdd(a, c) : null }
})
})(); (function () {
Wood.Rating = function (a, b) { this.system_id = parseInt(a, 10); this.rating_age = parseInt(b, 10) }; Wood.Rating.ActionType = { DEFAULT: 1, PURCHACE: 2, REDOWNLOAD: 3, REDEEM: 4 }; Wood.Rating.System = { CERO: 201, ESRB: 202, COB: 208, IARC_OFLC_AGCB: 308, OFLC_NZ: 209, IARC_OFLC_NZ: 309 }; Wood.Rating.prototype = {
isDisplayAllowed: function (a, b, c) {
if (Wood.Util.isUndefined(this.rating_age)) return !0; var d = this.system_id === Wood.Rating.System.COB || this.system_id === Wood.Rating.System.IARC_OFLC_AGCB, f = this.system_id === Wood.Rating.System.OFLC_NZ ||
this.system_id === Wood.Rating.System.IARC_OFLC_NZ; if (this.requiresAgeFilter(a, b)) { if (this.system_id === Wood.Rating.System.CERO && 18 === this.rating_age || this.system_id === Wood.Rating.System.ESRB && 17 === this.rating_age || this.system_id === Wood.Rating.System.ESRB && 18 === this.rating_age || d && 18 === this.rating_age) return c >= this.rating_age; if (f && 15 === this.rating_age) return 18 <= c } return !0
}, requiresAgeFilter: function (a, b) {
var c = !1; switch (a) {
case Wood.Rating.ActionType.DEFAULT: c = _.contains(["JPN", "AUS", "USA"], b); break;
case Wood.Rating.ActionType.PURCHACE: c = "USA" !== b && _.contains(["JPN", "AUS"], b); break; case Wood.Rating.ActionType.REDOWNLOAD: case Wood.Rating.ActionType.REDEEM: c = !_.contains(["JPN", "USA"], b) && "AUS" === b
}return c
}
}
})(); (function () {
_.templateSettings = { interpolate: /\{\{=(.+?)\}\}/g, evaluate: /\{\{(.+?)\}\}/g, escape: /\{\{-(.+?)\}\}/g }; Wood.Template = function () {
function a(a) { function b() { if (wood.client && wood.client.showError) { wood.client.showError(Wood.ErrorCode.INVALID_TEMPLATE); if (wood.client.errorShutdown) wood.client.errorShutdown() } else { Wood.log(" fallback without client") } } try { var c = new EJS({ url: "template/" + a + ".html", ext: ".html" }) } catch (p) { Wood.log(" load failed. :" + p.message), b() } if (!c || !c.text || !/