").append(i.parseHTML(n)).find(f) : n)
}).complete(u && function(n, t) {
e.each(u, s || [n.responseText, t, n])
}), this
};
i.each(["ajaxStart", "ajaxStop", "ajaxComplete", "ajaxError", "ajaxSuccess", "ajaxSend"], function(n, t) {
i.fn[t] = function(n) {
return this.on(t, n)
}
});
i.each(["get", "post"], function(n, r) {
i[r] = function(n, u, f, e) {
return i.isFunction(u) && (e = e || f, f = u, u = t), i.ajax({
url: n,
type: r,
dataType: e,
data: u,
success: f
})
}
});
i.extend({
active: 0,
lastModified: {},
etag: {},
ajaxSettings: {
url: c,
type: "GET",
isLocal: /^(?:about|app|app-storage|.+-extension|file|res|widget):$/.test(w[1]),
global: !0,
processData: !0,
async: !0,
contentType: "application/x-www-form-urlencoded; charset=UTF-8",
accepts: {
"*": bu,
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": n.String,
"text html": !0,
"text json": i.parseJSON,
"text xml": i.parseXML
},
flatOptions: {
url: !0,
context: !0
}
},
ajaxSetup: function(n, t) {
return t ? yi(yi(n, i.ajaxSettings), t) : yi(i.ajaxSettings, n)
},
ajaxPrefilter: ku(wu),
ajaxTransport: ku(vi),
ajax: function(n, r) {
function k(n, r, s, c) {
var l, k, w, rt, p, a = r;
2 !== o && (o = 2, g && clearTimeout(g), y = t, d = c || "", f.readyState = n > 0 ? 4 : 0, s && (rt = co(u, f, s)), n >= 200 && 300 > n || 304 === n ? (u.ifModified && (p = f.getResponseHeader("Last-Modified"), p && (i.lastModified[e] = p), p = f.getResponseHeader("etag"), p && (i.etag[e] = p)), 204 === n ? (l = !0, a = "nocontent") : 304 === n ? (l = !0, a = "notmodified") : (l = lo(u, rt), a = l.state, k = l.data, w = l.error, l = !w)) : (w = a, (n || !a) && (a = "error", 0 > n && (n = 0))), f.status = n, f.statusText = (r || a) + "", l ? tt.resolveWith(h, [k, a, f]) : tt.rejectWith(h, [f, a, w]), f.statusCode(b), b = t, v && nt.trigger(l ? "ajaxSuccess" : "ajaxError", [f, u, l ? k : w]), it.fireWith(h, [f, a]), v && (nt.trigger("ajaxComplete", [f, u]), --i.active || i.event.trigger("ajaxStop")))
}
"object" == typeof n && (r = n, n = t);
r = r || {};
var l, a, e, d, g, v, y, p, u = i.ajaxSetup({}, r),
h = u.context || u,
nt = u.context && (h.nodeType || h.jquery) ? i(h) : i.event,
tt = i.Deferred(),
it = i.Callbacks("once memory"),
b = u.statusCode || {},
rt = {},
ut = {},
o = 0,
ft = "canceled",
f = {
readyState: 0,
getResponseHeader: function(n) {
var t;
if (2 === o) {
if (!p)
for (p = {}; t = oo.exec(d);) p[t[1].toLowerCase()] = t[2];
t = p[n.toLowerCase()]
}
return null == t ? null : t
},
getAllResponseHeaders: function() {
return 2 === o ? d : null
},
setRequestHeader: function(n, t) {
var i = n.toLowerCase();
return o || (n = ut[i] = ut[i] || n, rt[n] = t), this
},
overrideMimeType: function(n) {
return o || (u.mimeType = n), this
},
statusCode: function(n) {
var t;
if (n)
if (2 > o)
for (t in n) b[t] = [b[t], n[t]];
else f.always(n[f.status]);
return this
},
abort: function(n) {
var t = n || ft;
return y && y.abort(t), k(0, t), this
}
};
if (tt.promise(f).complete = it.add, f.success = f.done, f.error = f.fail, u.url = ((n || u.url || c) + "").replace(eo, "").replace(ho, w[1] + "//"), u.type = r.method || r.type || u.method || u.type, u.dataTypes = i.trim(u.dataType || "*").toLowerCase().match(s) || [""], null == u.crossDomain && (l = yu.exec(u.url.toLowerCase()), u.crossDomain = !(!l || l[1] === w[1] && l[2] === w[2] && (l[3] || ("http:" === l[1] ? 80 : 443)) == (w[3] || ("http:" === w[1] ? 80 : 443)))), u.data && u.processData && "string" != typeof u.data && (u.data = i.param(u.data, u.traditional)), du(wu, u, r, f), 2 === o) return f;
v = u.global;
v && 0 == i.active++ && i.event.trigger("ajaxStart");
u.type = u.type.toUpperCase();
u.hasContent = !so.test(u.type);
e = u.url;
u.hasContent || (u.data && (e = u.url += (ai.test(e) ? "&" : "?") + u.data, delete u.data), u.cache === !1 && (u.url = vu.test(e) ? e.replace(vu, "$1_=" + li++) : e + (ai.test(e) ? "&" : "?") + "_=" + li++));
u.ifModified && (i.lastModified[e] && f.setRequestHeader("If-Modified-Since", i.lastModified[e]), i.etag[e] && f.setRequestHeader("If-None-Match", i.etag[e]));
(u.data && u.hasContent && u.contentType !== !1 || r.contentType) && f.setRequestHeader("Content-Type", u.contentType);
f.setRequestHeader("Accept", u.dataTypes[0] && u.accepts[u.dataTypes[0]] ? u.accepts[u.dataTypes[0]] + ("*" !== u.dataTypes[0] ? ", " + bu + "; q=0.01" : "") : u.accepts["*"]);
for (a in u.headers) f.setRequestHeader(a, u.headers[a]);
if (u.beforeSend && (u.beforeSend.call(h, f, u) === !1 || 2 === o)) return f.abort();
ft = "abort";
for (a in {
success: 1,
error: 1,
complete: 1
}) f[a](u[a]);
if (y = du(vi, u, r, f)) {
f.readyState = 1;
v && nt.trigger("ajaxSend", [f, u]);
u.async && u.timeout > 0 && (g = setTimeout(function() {
f.abort("timeout")
}, u.timeout));
try {
o = 1;
y.send(rt, k)
} catch (et) {
if (!(2 > o)) throw et;
k(-1, et)
}
} else k(-1, "No Transport");
return f
},
getScript: function(n, r) {
return i.get(n, t, r, "script")
},
getJSON: function(n, t, r) {
return i.get(n, t, r, "json")
}
});
i.ajaxSetup({
accepts: {
script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
},
contents: {
script: /(?:java|ecma)script/
},
converters: {
"text script": function(n) {
return i.globalEval(n), n
}
}
});
i.ajaxPrefilter("script", function(n) {
n.cache === t && (n.cache = !1);
n.crossDomain && (n.type = "GET", n.global = !1)
});
i.ajaxTransport("script", function(n) {
if (n.crossDomain) {
var u, f = r.head || i("head")[0] || r.documentElement;
return {
send: function(t, i) {
u = r.createElement("script");
u.async = !0;
n.scriptCharset && (u.charset = n.scriptCharset);
u.src = n.url;
u.onload = u.onreadystatechange = function(n, t) {
(t || !u.readyState || /loaded|complete/.test(u.readyState)) && (u.onload = u.onreadystatechange = null, u.parentNode && u.parentNode.removeChild(u), u = null, t || i(200, "success"))
};
f.insertBefore(u, f.firstChild)
},
abort: function() {
u && u.onload(t, !0)
}
}
}
});
pi = [];
lt = /(=)\?(?=&|$)|\?\?/;
i.ajaxSetup({
jsonp: "callback",
jsonpCallback: function() {
var n = pi.pop() || i.expando + "_" + li++;
return this[n] = !0, n
}
});
i.ajaxPrefilter("json jsonp", function(r, u, f) {
var e, s, o, h = r.jsonp !== !1 && (lt.test(r.url) ? "url" : "string" == typeof r.data && !(r.contentType || "").indexOf("application/x-www-form-urlencoded") && lt.test(r.data) && "data");
return h || "jsonp" === r.dataTypes[0] ? (e = r.jsonpCallback = i.isFunction(r.jsonpCallback) ? r.jsonpCallback() : r.jsonpCallback, h ? r[h] = r[h].replace(lt, "$1" + e) : r.jsonp !== !1 && (r.url += (ai.test(r.url) ? "&" : "?") + r.jsonp + "=" + e), r.converters["script json"] = function() {
return o || i.error(e + " was not called"), o[0]
}, r.dataTypes[0] = "json", s = n[e], n[e] = function() {
o = arguments
}, f.always(function() {
n[e] = s;
r[e] && (r.jsonpCallback = u.jsonpCallback, pi.push(e));
o && i.isFunction(s) && s(o[0]);
o = s = t
}), "script") : t
});
gu = 0;
at = n.ActiveXObject && function() {
for (var n in g) g[n](t, !0)
};
i.ajaxSettings.xhr = n.ActiveXObject ? function() {
return !this.isLocal && nf() || ao()
} : nf;
nt = i.ajaxSettings.xhr();
i.support.cors = !!nt && "withCredentials" in nt;
nt = i.support.ajax = !!nt;
nt && i.ajaxTransport(function(r) {
if (!r.crossDomain || i.support.cors) {
var u;
return {
send: function(f, e) {
var h, s, o = r.xhr();
if (r.username ? o.open(r.type, r.url, r.async, r.username, r.password) : o.open(r.type, r.url, r.async), r.xhrFields)
for (s in r.xhrFields) o[s] = r.xhrFields[s];
r.mimeType && o.overrideMimeType && o.overrideMimeType(r.mimeType);
r.crossDomain || f["X-Requested-With"] || (f["X-Requested-With"] = "XMLHttpRequest");
try {
for (s in f) o.setRequestHeader(s, f[s])
} catch (c) {}
o.send(r.hasContent && r.data || null);
u = function(n, f) {
var s, a, l, c;
try {
if (u && (f || 4 === o.readyState))
if (u = t, h && (o.onreadystatechange = i.noop, at && delete g[h]), f) 4 !== o.readyState && o.abort();
else {
c = {};
s = o.status;
a = o.getAllResponseHeaders();
"string" == typeof o.responseText && (c.text = o.responseText);
try {
l = o.statusText
} catch (y) {
l = ""
}
s || !r.isLocal || r.crossDomain ? 1223 === s && (s = 204) : s = c.text ? 200 : 404
}
} catch (v) {
f || e(-1, v)
}
c && e(s, l, c, a)
};
r.async ? 4 === o.readyState ? setTimeout(u) : (h = ++gu, at && (g || (g = {}, i(n).unload(at)), g[h] = u), o.onreadystatechange = u) : u()
},
abort: function() {
u && u(t, !0)
}
}
}
});
var tt, vt, vo = /^(?:toggle|show|hide)$/,
yo = RegExp("^(?:([+-])=|)(" + st + ")([a-z%]*)$", "i"),
po = /queueHooks$/,
yt = [ko],
ft = {
"*": [function(n, t) {
var o, s, r = this.createTween(n, t),
e = yo.exec(t),
h = r.cur(),
u = +h || 0,
f = 1,
c = 20;
if (e) {
if (o = +e[2], s = e[3] || (i.cssNumber[n] ? "" : "px"), "px" !== s && u) {
u = i.css(r.elem, n, !0) || o || 1;
do f = f || ".5", u /= f, i.style(r.elem, n, u + s); while (f !== (f = r.cur() / h) && 1 !== f && --c)
}
r.unit = s;
r.start = u;
r.end = e[1] ? u + (e[1] + 1) * o : o
}
return r
}]
};
i.Animation = i.extend(rf, {
tweener: function(n, t) {
i.isFunction(n) ? (t = n, n = ["*"]) : n = n.split(" ");
for (var r, u = 0, f = n.length; f > u; u++) r = n[u], ft[r] = ft[r] || [], ft[r].unshift(t)
},
prefilter: function(n, t) {
t ? yt.unshift(n) : yt.push(n)
}
});
i.Tween = f;
f.prototype = {
constructor: f,
init: function(n, t, r, u, f, e) {
this.elem = n;
this.prop = r;
this.easing = f || "swing";
this.options = t;
this.start = this.now = this.cur();
this.end = u;
this.unit = e || (i.cssNumber[r] ? "" : "px")
},
cur: function() {
var n = f.propHooks[this.prop];
return n && n.get ? n.get(this) : f.propHooks._default.get(this)
},
run: function(n) {
var r, t = f.propHooks[this.prop];
return this.pos = r = this.options.duration ? i.easing[this.easing](n, this.options.duration * n, 0, 1, this.options.duration) : n, this.now = (this.end - this.start) * r + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), t && t.set ? t.set(this) : f.propHooks._default.set(this), this
}
};
f.prototype.init.prototype = f.prototype;
f.propHooks = {
_default: {
get: function(n) {
var t;
return null == n.elem[n.prop] || n.elem.style && null != n.elem.style[n.prop] ? (t = i.css(n.elem, n.prop, ""), t && "auto" !== t ? t : 0) : n.elem[n.prop]
},
set: function(n) {
i.fx.step[n.prop] ? i.fx.step[n.prop](n) : n.elem.style && (null != n.elem.style[i.cssProps[n.prop]] || i.cssHooks[n.prop]) ? i.style(n.elem, n.prop, n.now + n.unit) : n.elem[n.prop] = n.now
}
}
};
f.propHooks.scrollTop = f.propHooks.scrollLeft = {
set: function(n) {
n.elem.nodeType && n.elem.parentNode && (n.elem[n.prop] = n.now)
}
};
i.each(["toggle", "show", "hide"], function(n, t) {
var r = i.fn[t];
i.fn[t] = function(n, i, u) {
return null == n || "boolean" == typeof n ? r.apply(this, arguments) : this.animate(pt(t, !0), n, i, u)
}
});
i.fn.extend({
fadeTo: function(n, t, i, r) {
return this.filter(ut).css("opacity", 0).show().end().animate({
opacity: t
}, n, i, r)
},
animate: function(n, t, r, u) {
var o = i.isEmptyObject(n),
e = i.speed(t, r, u),
f = function() {
var t = rf(this, i.extend({}, n), e);
f.finish = function() {
t.stop(!0)
};
(o || i._data(this, "finish")) && t.stop(!0)
};
return f.finish = f, o || e.queue === !1 ? this.each(f) : this.queue(e.queue, f)
},
stop: function(n, r, u) {
var f = function(n) {
var t = n.stop;
delete n.stop;
t(u)
};
return "string" != typeof n && (u = r, r = n, n = t), r && n !== !1 && this.queue(n || "fx", []), this.each(function() {
var o = !0,
t = null != n && n + "queueHooks",
e = i.timers,
r = i._data(this);
if (t) r[t] && r[t].stop && f(r[t]);
else
for (t in r) r[t] && r[t].stop && po.test(t) && f(r[t]);
for (t = e.length; t--;) e[t].elem !== this || null != n && e[t].queue !== n || (e[t].anim.stop(u), o = !1, e.splice(t, 1));
(o || !u) && i.dequeue(this, n)
})
},
finish: function(n) {
return n !== !1 && (n = n || "fx"), this.each(function() {
var t, f = i._data(this),
r = f[n + "queue"],
e = f[n + "queueHooks"],
u = i.timers,
o = r ? r.length : 0;
for (f.finish = !0, i.queue(this, n, []), e && e.cur && e.cur.finish && e.cur.finish.call(this), t = u.length; t--;) u[t].elem === this && u[t].queue === n && (u[t].anim.stop(!0), u.splice(t, 1));
for (t = 0; o > t; t++) r[t] && r[t].finish && r[t].finish.call(this);
delete f.finish
})
}
});
i.each({
slideDown: pt("show"),
slideUp: pt("hide"),
slideToggle: pt("toggle"),
fadeIn: {
opacity: "show"
},
fadeOut: {
opacity: "hide"
},
fadeToggle: {
opacity: "toggle"
}
}, function(n, t) {
i.fn[n] = function(n, i, r) {
return this.animate(t, n, i, r)
}
});
i.speed = function(n, t, r) {
var u = n && "object" == typeof n ? i.extend({}, n) : {
complete: r || !r && t || i.isFunction(n) && n,
duration: n,
easing: r && t || t && !i.isFunction(t) && t
};
return u.duration = i.fx.off ? 0 : "number" == typeof u.duration ? u.duration : u.duration in i.fx.speeds ? i.fx.speeds[u.duration] : i.fx.speeds._default, (null == u.queue || u.queue === !0) && (u.queue = "fx"), u.old = u.complete, u.complete = function() {
i.isFunction(u.old) && u.old.call(this);
u.queue && i.dequeue(this, u.queue)
}, u
};
i.easing = {
linear: function(n) {
return n
},
swing: function(n) {
return .5 - Math.cos(n * Math.PI) / 2
}
};
i.timers = [];
i.fx = f.prototype.init;
i.fx.tick = function() {
var u, n = i.timers,
r = 0;
for (tt = i.now(); n.length > r; r++) u = n[r], u() || n[r] !== u || n.splice(r--, 1);
n.length || i.fx.stop();
tt = t
};
i.fx.timer = function(n) {
n() && i.timers.push(n) && i.fx.start()
};
i.fx.interval = 13;
i.fx.start = function() {
vt || (vt = setInterval(i.fx.tick, i.fx.interval))
};
i.fx.stop = function() {
clearInterval(vt);
vt = null
};
i.fx.speeds = {
slow: 600,
fast: 200,
_default: 400
};
i.fx.step = {};
i.expr && i.expr.filters && (i.expr.filters.animated = function(n) {
return i.grep(i.timers, function(t) {
return n === t.elem
}).length
});
i.fn.offset = function(n) {
if (arguments.length) return n === t ? this : this.each(function(t) {
i.offset.setOffset(this, n, t)
});
var r, e, f = {
top: 0,
left: 0
},
u = this[0],
s = u && u.ownerDocument;
if (s) return r = s.documentElement, i.contains(r, u) ? (typeof u.getBoundingClientRect !== o && (f = u.getBoundingClientRect()), e = uf(s), {
top: f.top + (e.pageYOffset || r.scrollTop) - (r.clientTop || 0),
left: f.left + (e.pageXOffset || r.scrollLeft) - (r.clientLeft || 0)
}) : f
};
i.offset = {
setOffset: function(n, t, r) {
var f = i.css(n, "position");
"static" === f && (n.style.position = "relative");
var e = i(n),
o = e.offset(),
l = i.css(n, "top"),
a = i.css(n, "left"),
v = ("absolute" === f || "fixed" === f) && i.inArray("auto", [l, a]) > -1,
u = {},
s = {},
h, c;
v ? (s = e.position(), h = s.top, c = s.left) : (h = parseFloat(l) || 0, c = parseFloat(a) || 0);
i.isFunction(t) && (t = t.call(n, r, o));
null != t.top && (u.top = t.top - o.top + h);
null != t.left && (u.left = t.left - o.left + c);
"using" in t ? t.using.call(n, u) : e.css(u)
}
};
i.fn.extend({
position: function() {
if (this[0]) {
var n, r, t = {
top: 0,
left: 0
},
u = this[0];
return "fixed" === i.css(u, "position") ? r = u.getBoundingClientRect() : (n = this.offsetParent(), r = this.offset(), i.nodeName(n[0], "html") || (t = n.offset()), t.top += i.css(n[0], "borderTopWidth", !0), t.left += i.css(n[0], "borderLeftWidth", !0)), {
top: r.top - t.top - i.css(u, "marginTop", !0),
left: r.left - t.left - i.css(u, "marginLeft", !0)
}
}
},
offsetParent: function() {
return this.map(function() {
for (var n = this.offsetParent || r.documentElement; n && !i.nodeName(n, "html") && "static" === i.css(n, "position");) n = n.offsetParent;
return n || r.documentElement
})
}
});
i.each({
scrollLeft: "pageXOffset",
scrollTop: "pageYOffset"
}, function(n, r) {
var u = /Y/.test(r);
i.fn[n] = function(f) {
return i.access(this, function(n, f, e) {
var o = uf(n);
return e === t ? o ? r in o ? o[r] : o.document.documentElement[f] : n[f] : (o ? o.scrollTo(u ? i(o).scrollLeft() : e, u ? e : i(o).scrollTop()) : n[f] = e, t)
}, n, f, arguments.length, null)
}
});
i.each({
Height: "height",
Width: "width"
}, function(n, r) {
i.each({
padding: "inner" + n,
content: r,
"": "outer" + n
}, function(u, f) {
i.fn[f] = function(f, e) {
var o = arguments.length && (u || "boolean" != typeof f),
s = u || (f === !0 || e === !0 ? "margin" : "border");
return i.access(this, function(r, u, f) {
var e;
return i.isWindow(r) ? r.document.documentElement["client" + n] : 9 === r.nodeType ? (e = r.documentElement, Math.max(r.body["scroll" + n], e["scroll" + n], r.body["offset" + n], e["offset" + n], e["client" + n])) : f === t ? i.css(r, u, s) : i.style(r, u, f, s)
}, r, o ? f : t, o, null)
}
})
});
n.jQuery = n.$ = i;
"function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function() {
return i
})
})(window),
function(n) {
function i(n, t) {
for (var i = window, r = (n || "").split("."); i && r.length;) i = i[r.shift()];
return typeof i == "function" ? i : (t.push(n), Function.constructor.apply(null, t))
}
function r(n) {
return n === "GET" || n === "POST"
}
function e(n, t) {
r(t) || n.setRequestHeader("X-HTTP-Method-Override", t)
}
function o(t, i, r) {
var u;
r.indexOf("application/x-javascript") === -1 && (u = (t.getAttribute("data-ajax-mode") || "").toUpperCase(), n(t.getAttribute("data-ajax-update")).each(function(t, r) {
var f;
switch (u) {
case "BEFORE":
f = r.firstChild;
n("
").html(i).contents().each(function() {
r.insertBefore(this, f)
});
break;
case "AFTER":
n("
").html(i).contents().each(function() {
r.appendChild(this)
});
break;
default:
n(r).html(i)
}
}))
}
function u(t, u) {
var s, h, f, c;
(s = t.getAttribute("data-ajax-confirm"), !s || window.confirm(s)) && (h = n(t.getAttribute("data-ajax-loading")), c = t.getAttribute("data-ajax-loading-duration") || 0, n.extend(u, {
type: t.getAttribute("data-ajax-method") || undefined,
url: t.getAttribute("data-ajax-url") || undefined,
beforeSend: function(n) {
var r;
return e(n, f), r = i(t.getAttribute("data-ajax-begin"), ["xhr"]).apply(this, arguments), r !== !1 && h.show(c), r
},
complete: function() {
h.hide(c);
i(t.getAttribute("data-ajax-complete"), ["xhr", "status"]).apply(this, arguments)
},
success: function(n, r, u) {
o(t, n, u.getResponseHeader("Content-Type") || "text/html");
i(t.getAttribute("data-ajax-success"), ["data", "status", "xhr"]).apply(this, arguments)
},
error: i(t.getAttribute("data-ajax-failure"), ["xhr", "status", "error"])
}), u.data.push({
name: "X-Requested-With",
value: "XMLHttpRequest"
}), f = u.type.toUpperCase(), r(f) || (u.type = "POST", u.data.push({
name: "X-HTTP-Method-Override",
value: f
})), n.ajax(u))
}
function s(t) {
var i = n(t).data(f);
return !i || !i.validate || i.validate()
}
var t = "unobtrusiveAjaxClick",
f = "unobtrusiveValidation";
n(document).on("click", "a[data-ajax=true]", function(n) {
n.preventDefault();
u(this, {
url: this.href,
type: "GET",
data: []
})
});
n(document).on("click", "form[data-ajax=true] input[type=image]", function(i) {
var r = i.target.name,
u = n(i.target),
f = u.parents("form")[0],
e = u.offset();
n(f).data(t, [{
name: r + ".x",
value: Math.round(i.pageX - e.left)
}, {
name: r + ".y",
value: Math.round(i.pageY - e.top)
}]);
setTimeout(function() {
n(f).removeData(t)
}, 0)
});
n(document).on("click", "form[data-ajax=true] :submit", function(i) {
var r = i.target.name,
u = n(i.target).parents("form")[0];
n(u).data(t, r ? [{
name: r,
value: i.target.value
}] : []);
setTimeout(function() {
n(u).removeData(t)
}, 0)
});
n(document).on("submit", "form[data-ajax=true]", function(i) {
var r = n(this).data(t) || [];
(i.preventDefault(), s(this)) && u(this, {
url: this.action,
type: this.method || "GET",
data: r.concat(n(this).serializeArray())
})
})
}(jQuery),
function(n) {
n.extend(n.fn, {
validate: function(t) {
if (!this.length) return t && t.debug && window.console && console.warn("Nothing selected, can't validate, returning nothing."), void 0;
var i = n.data(this[0], "validator");
return i ? i : (this.attr("novalidate", "novalidate"), i = new n.validator(t, this[0]), n.data(this[0], "validator", i), i.settings.onsubmit && (this.validateDelegate(":submit", "click", function(t) {
i.settings.submitHandler && (i.submitButton = t.target);
n(t.target).hasClass("cancel") && (i.cancelSubmit = !0);
void 0 !== n(t.target).attr("formnovalidate") && (i.cancelSubmit = !0)
}), this.submit(function(t) {
function r() {
var r;
return i.settings.submitHandler ? (i.submitButton && (r = n("
").attr("name", i.submitButton.name).val(n(i.submitButton).val()).appendTo(i.currentForm)), i.settings.submitHandler.call(i, i.currentForm, t), i.submitButton && r.remove(), !1) : !0
}
return i.settings.debug && t.preventDefault(), i.cancelSubmit ? (i.cancelSubmit = !1, r()) : i.form() ? i.pendingRequest ? (i.formSubmitted = !0, !1) : r() : (i.focusInvalid(), !1)
})), i)
},
valid: function() {
if (n(this[0]).is("form")) return this.validate().form();
var t = !0,
i = n(this[0].form).validate();
return this.each(function() {
t = t && i.element(this)
}), t
},
removeAttrs: function(t) {
var i = {},
r = this;
return n.each(t.split(/\s/), function(n, t) {
i[t] = r.attr(t);
r.removeAttr(t)
}), i
},
rules: function(t, i) {
var r = this[0],
o, u, h;
if (t) {
var e = n.data(r.form, "validator").settings,
s = e.rules,
f = n.validator.staticRules(r);
switch (t) {
case "add":
n.extend(f, n.validator.normalizeRule(i));
delete f.messages;
s[r.name] = f;
i.messages && (e.messages[r.name] = n.extend(e.messages[r.name], i.messages));
break;
case "remove":
return i ? (o = {}, n.each(i.split(/\s/), function(n, t) {
o[t] = f[t];
delete f[t]
}), o) : (delete s[r.name], f)
}
}
return u = n.validator.normalizeRules(n.extend({}, n.validator.classRules(r), n.validator.attributeRules(r), n.validator.dataRules(r), n.validator.staticRules(r)), r), u.required && (h = u.required, delete u.required, u = n.extend({
required: h
}, u)), u
}
});
n.extend(n.expr[":"], {
blank: function(t) {
return !n.trim("" + n(t).val())
},
filled: function(t) {
return !!n.trim("" + n(t).val())
},
unchecked: function(t) {
return !n(t).prop("checked")
}
});
n.validator = function(t, i) {
this.settings = n.extend(!0, {}, n.validator.defaults, t);
this.currentForm = i;
this.init()
};
n.validator.format = function(t, i) {
return 1 === arguments.length ? function() {
var i = n.makeArray(arguments);
return i.unshift(t), n.validator.format.apply(this, i)
} : (arguments.length > 2 && i.constructor !== Array && (i = n.makeArray(arguments).slice(1)), i.constructor !== Array && (i = [i]), n.each(i, function(n, i) {
t = t.replace(RegExp("\\{" + n + "\\}", "g"), function() {
return i
})
}), t)
};
n.extend(n.validator, {
defaults: {
messages: {},
groups: {},
rules: {},
errorClass: "error",
validClass: "valid",
errorElement: "label",
focusInvalid: !0,
errorContainer: n([]),
errorLabelContainer: n([]),
onsubmit: !0,
ignore: ":hidden",
ignoreTitle: !1,
onfocusin: function(n) {
this.lastActive = n;
this.settings.focusCleanup && !this.blockFocusCleanup && (this.settings.unhighlight && this.settings.unhighlight.call(this, n, this.settings.errorClass, this.settings.validClass), this.addWrapper(this.errorsFor(n)).hide())
},
onfocusout: function(n) {
!this.checkable(n) && (n.name in this.submitted || !this.optional(n)) && this.element(n)
},
onkeyup: function(n, t) {
(9 !== t.which || "" !== this.elementValue(n)) && (n.name in this.submitted || n === this.lastElement) && this.element(n)
},
onclick: function(n) {
n.name in this.submitted ? this.element(n) : n.parentNode.name in this.submitted && this.element(n.parentNode)
},
highlight: function(t, i, r) {
"radio" === t.type ? this.findByName(t.name).addClass(i).removeClass(r) : n(t).addClass(i).removeClass(r)
},
unhighlight: function(t, i, r) {
"radio" === t.type ? this.findByName(t.name).removeClass(i).addClass(r) : n(t).removeClass(i).addClass(r)
}
},
setDefaults: function(t) {
n.extend(n.validator.defaults, t)
},
messages: {
required: "This field is required.",
remote: "Please fix this field.",
email: "Please enter a valid email address.",
url: "Please enter a valid URL.",
date: "Please enter a valid date.",
dateISO: "Please enter a valid date (ISO).",
number: "Please enter a valid number.",
digits: "Please enter only digits.",
creditcard: "Please enter a valid credit card number.",
equalTo: "Please enter the same value again.",
maxlength: n.validator.format("Please enter no more than {0} characters."),
minlength: n.validator.format("Please enter at least {0} characters."),
rangelength: n.validator.format("Please enter a value between {0} and {1} characters long."),
range: n.validator.format("Please enter a value between {0} and {1}."),
max: n.validator.format("Please enter a value less than or equal to {0}."),
min: n.validator.format("Please enter a value greater than or equal to {0}.")
},
autoCreateRanges: !1,
prototype: {
init: function() {
function i(t) {
var i = n.data(this[0].form, "validator"),
r = "on" + t.type.replace(/^validate/, "");
i.settings[r] && i.settings[r].call(i, this[0], t)
}
var r, t;
this.labelContainer = n(this.settings.errorLabelContainer);
this.errorContext = this.labelContainer.length && this.labelContainer || n(this.currentForm);
this.containers = n(this.settings.errorContainer).add(this.settings.errorLabelContainer);
this.submitted = {};
this.valueCache = {};
this.pendingRequest = 0;
this.pending = {};
this.invalid = {};
this.reset();
r = this.groups = {};
n.each(this.settings.groups, function(t, i) {
"string" == typeof i && (i = i.split(/\s/));
n.each(i, function(n, i) {
r[i] = t
})
});
t = this.settings.rules;
n.each(t, function(i, r) {
t[i] = n.validator.normalizeRule(r)
});
n(this.currentForm).validateDelegate(":text, [type='password'], [type='file'], select, textarea, [type='number'], [type='search'] ,[type='tel'], [type='url'], [type='email'], [type='datetime'], [type='date'], [type='month'], [type='week'], [type='time'], [type='datetime-local'], [type='range'], [type='color'] ", "focusin focusout keyup", i).validateDelegate("[type='radio'], [type='checkbox'], select, option", "click", i);
this.settings.invalidHandler && n(this.currentForm).bind("invalid-form.validate", this.settings.invalidHandler)
},
form: function() {
return this.checkForm(), n.extend(this.submitted, this.errorMap), this.invalid = n.extend({}, this.errorMap), this.valid() || n(this.currentForm).triggerHandler("invalid-form", [this]), this.showErrors(), this.valid()
},
checkForm: function() {
this.prepareForm();
for (var n = 0, t = this.currentElements = this.elements(); t[n]; n++) this.check(t[n]);
return this.valid()
},
element: function(t) {
t = this.validationTargetFor(this.clean(t));
this.lastElement = t;
this.prepareElement(t);
this.currentElements = n(t);
var i = this.check(t) !== !1;
return i ? delete this.invalid[t.name] : this.invalid[t.name] = !0, this.numberOfInvalids() || (this.toHide = this.toHide.add(this.containers)), this.showErrors(), i
},
showErrors: function(t) {
if (t) {
n.extend(this.errorMap, t);
this.errorList = [];
for (var i in t) this.errorList.push({
message: t[i],
element: this.findByName(i)[0]
});
this.successList = n.grep(this.successList, function(n) {
return !(n.name in t)
})
}
this.settings.showErrors ? this.settings.showErrors.call(this, this.errorMap, this.errorList) : this.defaultShowErrors()
},
resetForm: function() {
n.fn.resetForm && n(this.currentForm).resetForm();
this.submitted = {};
this.lastElement = null;
this.prepareForm();
this.hideErrors();
this.elements().removeClass(this.settings.errorClass).removeData("previousValue")
},
numberOfInvalids: function() {
return this.objectLength(this.invalid)
},
objectLength: function(n) {
var t = 0;
for (var i in n) t++;
return t
},
hideErrors: function() {
this.addWrapper(this.toHide).hide()
},
valid: function() {
return 0 === this.size()
},
size: function() {
return this.errorList.length
},
focusInvalid: function() {
if (this.settings.focusInvalid) try {
n(this.findLastActive() || this.errorList.length && this.errorList[0].element || []).filter(":visible").focus().trigger("focusin")
} catch (t) {}
},
findLastActive: function() {
var t = this.lastActive;
return t && 1 === n.grep(this.errorList, function(n) {
return n.element.name === t.name
}).length && t
},
elements: function() {
var t = this,
i = {};
return n(this.currentForm).find("input, select, textarea").not(":submit, :reset, :image, [disabled]").not(this.settings.ignore).filter(function() {
return !this.name && t.settings.debug && window.console && console.error("%o has no name assigned", this), this.name in i || !t.objectLength(n(this).rules()) ? !1 : (i[this.name] = !0, !0)
})
},
clean: function(t) {
return n(t)[0]
},
errors: function() {
var t = this.settings.errorClass.replace(" ", ".");
return n(this.settings.errorElement + "." + t, this.errorContext)
},
reset: function() {
this.successList = [];
this.errorList = [];
this.errorMap = {};
this.toShow = n([]);
this.toHide = n([]);
this.currentElements = n([])
},
prepareForm: function() {
this.reset();
this.toHide = this.errors().add(this.containers)
},
prepareElement: function(n) {
this.reset();
this.toHide = this.errorsFor(n)
},
elementValue: function(t) {
var r = n(t).attr("type"),
i = n(t).val();
return "radio" === r || "checkbox" === r ? n("input[name='" + n(t).attr("name") + "']:checked").val() : "string" == typeof i ? i.replace(/\r/g, "") : i
},
check: function(t) {
var r, u;
t = this.validationTargetFor(this.clean(t));
var i, f = n(t).rules(),
e = !1,
s = this.elementValue(t);
for (r in f) {
u = {
method: r,
parameters: f[r]
};
try {
if (i = n.validator.methods[r].call(this, s, t, u.parameters), "dependency-mismatch" === i) {
e = !0;
continue
}
if (e = !1, "pending" === i) return this.toHide = this.toHide.not(this.errorsFor(t)), void 0;
if (!i) return this.formatAndAdd(t, u), !1
} catch (o) {
throw this.settings.debug && window.console && console.log("Exception occurred when checking element " + t.id + ", check the '" + u.method + "' method.", o), o;
}
}
if (!e) return (this.objectLength(f) && this.successList.push(t), !0)
},
customDataMessage: function(t, i) {
return n(t).data("msg-" + i.toLowerCase()) || t.attributes && n(t).attr("data-msg-" + i.toLowerCase())
},
customMessage: function(n, t) {
var i = this.settings.messages[n];
return i && (i.constructor === String ? i : i[t])
},
findDefined: function() {
for (var n = 0; arguments.length > n; n++)
if (void 0 !== arguments[n]) return arguments[n];
return void 0
},
defaultMessage: function(t, i) {
return this.findDefined(this.customMessage(t.name, i), this.customDataMessage(t, i), !this.settings.ignoreTitle && t.title || void 0, n.validator.messages[i], "
Warning: No message defined for " + t.name + "<\/strong>")
},
formatAndAdd: function(t, i) {
var r = this.defaultMessage(t, i.method),
u = /\$?\{(\d+)\}/g;
"function" == typeof r ? r = r.call(this, i.parameters, t) : u.test(r) && (r = n.validator.format(r.replace(u, "{$1}"), i.parameters));
this.errorList.push({
message: r,
element: t
});
this.errorMap[t.name] = r;
this.submitted[t.name] = r
},
addWrapper: function(n) {
return this.settings.wrapper && (n = n.add(n.parent(this.settings.wrapper))), n
},
defaultShowErrors: function() {
for (var i, t, n = 0; this.errorList[n]; n++) t = this.errorList[n], this.settings.highlight && this.settings.highlight.call(this, t.element, this.settings.errorClass, this.settings.validClass), this.showLabel(t.element, t.message);
if (this.errorList.length && (this.toShow = this.toShow.add(this.containers)), this.settings.success)
for (n = 0; this.successList[n]; n++) this.showLabel(this.successList[n]);
if (this.settings.unhighlight)
for (n = 0, i = this.validElements(); i[n]; n++) this.settings.unhighlight.call(this, i[n], this.settings.errorClass, this.settings.validClass);
this.toHide = this.toHide.not(this.toShow);
this.hideErrors();
this.addWrapper(this.toShow).show()
},
validElements: function() {
return this.currentElements.not(this.invalidElements())
},
invalidElements: function() {
return n(this.errorList).map(function() {
return this.element
})
},
showLabel: function(t, i) {
var r = this.errorsFor(t);
r.length ? (r.removeClass(this.settings.validClass).addClass(this.settings.errorClass), r.html(i)) : (r = n("<" + this.settings.errorElement + ">").attr("for", this.idOrName(t)).addClass(this.settings.errorClass).html(i || ""), this.settings.wrapper && (r = r.hide().show().wrap("<" + this.settings.wrapper + "/>").parent()), this.labelContainer.append(r).length || (this.settings.errorPlacement ? this.settings.errorPlacement(r, n(t)) : r.insertAfter(t)));
!i && this.settings.success && (r.text(""), "string" == typeof this.settings.success ? r.addClass(this.settings.success) : this.settings.success(r, t));
this.toShow = this.toShow.add(r)
},
errorsFor: function(t) {
var i = this.idOrName(t);
return this.errors().filter(function() {
return n(this).attr("for") === i
})
},
idOrName: function(n) {
return this.groups[n.name] || (this.checkable(n) ? n.name : n.id || n.name)
},
validationTargetFor: function(n) {
return this.checkable(n) && (n = this.findByName(n.name).not(this.settings.ignore)[0]), n
},
checkable: function(n) {
return /radio|checkbox/i.test(n.type)
},
findByName: function(t) {
return n(this.currentForm).find("[name='" + t + "']")
},
getLength: function(t, i) {
switch (i.nodeName.toLowerCase()) {
case "select":
return n("option:selected", i).length;
case "input":
if (this.checkable(i)) return this.findByName(i.name).filter(":checked").length
}
return t.length
},
depend: function(n, t) {
return this.dependTypes[typeof n] ? this.dependTypes[typeof n](n, t) : !0
},
dependTypes: {
boolean: function(n) {
return n
},
string: function(t, i) {
return !!n(t, i.form).length
},
"function": function(n, t) {
return n(t)
}
},
optional: function(t) {
var i = this.elementValue(t);
return !n.validator.methods.required.call(this, i, t) && "dependency-mismatch"
},
startRequest: function(n) {
this.pending[n.name] || (this.pendingRequest++, this.pending[n.name] = !0)
},
stopRequest: function(t, i) {
this.pendingRequest--;
0 > this.pendingRequest && (this.pendingRequest = 0);
delete this.pending[t.name];
i && 0 === this.pendingRequest && this.formSubmitted && this.form() ? (n(this.currentForm).submit(), this.formSubmitted = !1) : !i && 0 === this.pendingRequest && this.formSubmitted && (n(this.currentForm).triggerHandler("invalid-form", [this]), this.formSubmitted = !1)
},
previousValue: function(t) {
return n.data(t, "previousValue") || n.data(t, "previousValue", {
old: null,
valid: !0,
message: this.defaultMessage(t, "remote")
})
}
},
classRuleSettings: {
required: {
required: !0
},
email: {
email: !0
},
url: {
url: !0
},
date: {
date: !0
},
dateISO: {
dateISO: !0
},
number: {
number: !0
},
digits: {
digits: !0
},
creditcard: {
creditcard: !0
}
},
addClassRules: function(t, i) {
t.constructor === String ? this.classRuleSettings[t] = i : n.extend(this.classRuleSettings, t)
},
classRules: function(t) {
var i = {},
r = n(t).attr("class");
return r && n.each(r.split(" "), function() {
this in n.validator.classRuleSettings && n.extend(i, n.validator.classRuleSettings[this])
}), i
},
attributeRules: function(t) {
var u = {},
e = n(t),
f = e[0].getAttribute("type"),
r, i;
for (r in n.validator.methods) "required" === r ? (i = e.get(0).getAttribute(r), "" === i && (i = !0), i = !!i) : i = e.attr(r), /min|max/.test(r) && (null === f || /number|range|text/.test(f)) && (i = Number(i)), i ? u[r] = i : f === r && "range" !== f && (u[r] = !0);
return u.maxlength && /-1|2147483647|524288/.test(u.maxlength) && delete u.maxlength, u
},
dataRules: function(t) {
var i, r, u = {},
f = n(t);
for (i in n.validator.methods) r = f.data("rule-" + i.toLowerCase()), void 0 !== r && (u[i] = r);
return u
},
staticRules: function(t) {
var i = {},
r = n.data(t.form, "validator");
return r.settings.rules && (i = n.validator.normalizeRule(r.settings.rules[t.name]) || {}), i
},
normalizeRules: function(t, i) {
return n.each(t, function(r, u) {
if (u === !1) return delete t[r], void 0;
if (u.param || u.depends) {
var f = !0;
switch (typeof u.depends) {
case "string":
f = !!n(u.depends, i.form).length;
break;
case "function":
f = u.depends.call(i, i)
}
f ? t[r] = void 0 !== u.param ? u.param : !0 : delete t[r]
}
}), n.each(t, function(r, u) {
t[r] = n.isFunction(u) ? u(i) : u
}), n.each(["minlength", "maxlength"], function() {
t[this] && (t[this] = Number(t[this]))
}), n.each(["rangelength", "range"], function() {
var i;
t[this] && (n.isArray(t[this]) ? t[this] = [Number(t[this][0]), Number(t[this][1])] : "string" == typeof t[this] && (i = t[this].split(/[\s,]+/), t[this] = [Number(i[0]), Number(i[1])]))
}), n.validator.autoCreateRanges && (t.min && t.max && (t.range = [t.min, t.max], delete t.min, delete t.max), t.minlength && t.maxlength && (t.rangelength = [t.minlength, t.maxlength], delete t.minlength, delete t.maxlength)), t
},
normalizeRule: function(t) {
if ("string" == typeof t) {
var i = {};
n.each(t.split(/\s/), function() {
i[this] = !0
});
t = i
}
return t
},
addMethod: function(t, i, r) {
n.validator.methods[t] = i;
n.validator.messages[t] = void 0 !== r ? r : n.validator.messages[t];
3 > i.length && n.validator.addClassRules(t, n.validator.normalizeRule(t))
},
methods: {
required: function(t, i, r) {
if (!this.depend(r, i)) return "dependency-mismatch";
if ("select" === i.nodeName.toLowerCase()) {
var u = n(i).val();
return u && u.length > 0
}
return this.checkable(i) ? this.getLength(t, i) > 0 : n.trim(t).length > 0
},
email: function(n, t) {
return this.optional(t) || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))$/i.test(n)
},
url: function(n, t) {
return this.optional(t) || /^(https?|s?ftp):\/\/(((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:)*@)?(((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5]))|((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.?)(:\d*)?)(\/((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)+(\/(([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)*)*)?)?(\?((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|[\uE000-\uF8FF]|\/|\?)*)?(#((([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(%[\da-f]{2})|[!\$&'\(\)\*\+,;=]|:|@)|\/|\?)*)?$/i.test(n)
},
date: function(n, t) {
return this.optional(t) || !/Invalid|NaN/.test("" + new Date(n))
},
dateISO: function(n, t) {
return this.optional(t) || /^\d{4}[\/\-]\d{1,2}[\/\-]\d{1,2}$/.test(n)
},
number: function(n, t) {
return this.optional(t) || /^-?(?:\d+|\d{1,3}(?:,\d{3})+)?(?:\.\d+)?$/.test(n)
},
digits: function(n, t) {
return this.optional(t) || /^\d+$/.test(n)
},
creditcard: function(n, t) {
var r, e;
if (this.optional(t)) return "dependency-mismatch";
if (/[^0-9 \-]+/.test(n)) return !1;
var f = 0,
i = 0,
u = !1;
for (n = n.replace(/\D/g, ""), r = n.length - 1; r >= 0; r--) e = n.charAt(r), i = parseInt(e, 10), u && (i *= 2) > 9 && (i -= 9), f += i, u = !u;
return 0 == f % 10
},
minlength: function(t, i, r) {
var u = n.isArray(t) ? t.length : this.getLength(n.trim(t), i);
return this.optional(i) || u >= r
},
maxlength: function(t, i, r) {
var u = n.isArray(t) ? t.length : this.getLength(n.trim(t), i);
return this.optional(i) || r >= u
},
rangelength: function(t, i, r) {
var u = n.isArray(t) ? t.length : this.getLength(n.trim(t), i);
return this.optional(i) || u >= r[0] && r[1] >= u
},
min: function(n, t, i) {
return this.optional(t) || n >= i
},
max: function(n, t, i) {
return this.optional(t) || i >= n
},
range: function(n, t, i) {
return this.optional(t) || n >= i[0] && i[1] >= n
},
equalTo: function(t, i, r) {
var u = n(r);
return this.settings.onfocusout && u.unbind(".validate-equalTo").bind("blur.validate-equalTo", function() {
n(i).valid()
}), t === u.val()
},
remote: function(t, i, r) {
var f, u, e;
return this.optional(i) ? "dependency-mismatch" : (f = this.previousValue(i), this.settings.messages[i.name] || (this.settings.messages[i.name] = {}), f.originalMessage = this.settings.messages[i.name].remote, this.settings.messages[i.name].remote = f.message, r = "string" == typeof r && {
url: r
} || r, f.old === t) ? f.valid : (f.old = t, u = this, this.startRequest(i), e = {}, e[i.name] = t, n.ajax(n.extend(!0, {
url: r,
mode: "abort",
port: "validate" + i.name,
dataType: "json",
data: e,
success: function(r) {
var e, h, s, o;
u.settings.messages[i.name].remote = f.originalMessage;
e = r === !0 || "true" === r;
e ? (h = u.formSubmitted, u.prepareElement(i), u.formSubmitted = h, u.successList.push(i), delete u.invalid[i.name], u.showErrors()) : (s = {}, o = r || u.defaultMessage(i, "remote"), s[i.name] = f.message = n.isFunction(o) ? o(t) : o, u.invalid[i.name] = !0, u.showErrors(s));
f.valid = e;
u.stopRequest(i, e)
}
}, r)), "pending")
}
}
});
n.format = n.validator.format
}(jQuery),
function(n) {
var t = {},
i;
n.ajaxPrefilter ? n.ajaxPrefilter(function(n, i, r) {
var u = n.port;
"abort" === n.mode && (t[u] && t[u].abort(), t[u] = r)
}) : (i = n.ajax, n.ajax = function(r) {
var f = ("mode" in r ? r : n.ajaxSettings).mode,
u = ("port" in r ? r : n.ajaxSettings).port;
return "abort" === f ? (t[u] && t[u].abort(), t[u] = i.apply(this, arguments), t[u]) : i.apply(this, arguments)
})
}(jQuery),
function(n) {
n.extend(n.fn, {
validateDelegate: function(t, i, r) {
return this.bind(i, function(i) {
var u = n(i.target);
if (u.is(t)) return r.apply(u, arguments)
})
}
})
}(jQuery),
function(n) {
function i(n, t, i) {
n.rules[t] = i;
n.message && (n.messages[t] = n.message)
}
function h(n) {
return n.replace(/^\s+|\s+$/g, "").split(/\s*,\s*/g)
}
function f(n) {
return n.replace(/([!"#$%&'()*+,./:;<=>?@\[\\\]^`{|}~])/g, "\\$1")
}
function e(n) {
return n.substr(0, n.lastIndexOf(".") + 1)
}
function o(n, t) {
return n.indexOf("*.") === 0 && (n = n.replace("*.", t)), n
}
function c(t, i) {
var r = n(this).find("[data-valmsg-for='" + f(i[0].name) + "']"),
u = r.attr("data-valmsg-replace"),
e = u ? n.parseJSON(u) !== !1 : null;
r.removeClass("field-validation-valid").addClass("field-validation-error");
t.data("unobtrusiveContainer", r);
e ? (r.empty(), t.removeClass("input-validation-error").appendTo(r)) : t.hide()
}
function l(t, i) {
var u = n(this).find("[data-valmsg-summary=true]"),
r = u.find("ul");
r && r.length && i.errorList.length && (r.empty(), u.addClass("validation-summary-errors").removeClass("validation-summary-valid"), n.each(i.errorList, function() {
n(" ").html(this.message).appendTo(r)
}))
}
function a(t) {
var i = t.data("unobtrusiveContainer"),
r = i.attr("data-valmsg-replace"),
u = r ? n.parseJSON(r) : null;
i && (i.addClass("field-validation-valid").removeClass("field-validation-error"), t.removeData("unobtrusiveContainer"), u && i.empty())
}
function v() {
var t = n(this);
t.data("validator").resetForm();
t.find(".validation-summary-errors").addClass("validation-summary-valid").removeClass("validation-summary-errors");
t.find(".field-validation-error").addClass("field-validation-valid").removeClass("field-validation-error").removeData("unobtrusiveContainer").find(">*").removeData("unobtrusiveContainer")
}
function s(t) {
var i = n(t),
r = i.data(u),
f = n.proxy(v, t);
return r || (r = {
options: {
errorClass: "input-validation-error",
errorElement: "span",
errorPlacement: n.proxy(c, t),
invalidHandler: n.proxy(l, t),
messages: {},
rules: {},
success: n.proxy(a, t)
},
attachValidation: function() {
i.unbind("reset." + u, f).bind("reset." + u, f).validate(this.options)
},
validate: function() {
return i.validate(), i.valid()
}
}, i.data(u, r)), r
}
var r = n.validator,
t, u = "unobtrusiveValidation";
r.unobtrusive = {
adapters: [],
parseElement: function(t, i) {
var u = n(t),
f = u.parents("form")[0],
r, e, o;
f && (r = s(f), r.options.rules[t.name] = e = {}, r.options.messages[t.name] = o = {}, n.each(this.adapters, function() {
var i = "data-val-" + this.name,
r = u.attr(i),
s = {};
r !== undefined && (i += "-", n.each(this.params, function() {
s[this] = u.attr(i + this)
}), this.adapt({
element: t,
form: f,
message: r,
params: s,
rules: e,
messages: o
}))
}), n.extend(e, {
__dummy__: !0
}), i || r.attachValidation())
},
parse: function(t) {
var i = n(t).parents("form").andSelf().add(n(t).find("form")).filter("form");
n(t).find(":input[data-val=true]").each(function() {
r.unobtrusive.parseElement(this, !0)
});
i.each(function() {
var n = s(this);
n && n.attachValidation()
})
}
};
t = r.unobtrusive.adapters;
t.add = function(n, t, i) {
return i || (i = t, t = []), this.push({
name: n,
params: t,
adapt: i
}), this
};
t.addBool = function(n, t) {
return this.add(n, function(r) {
i(r, t || n, !0)
})
};
t.addMinMax = function(n, t, r, u, f, e) {
return this.add(n, [f || "min", e || "max"], function(n) {
var f = n.params.min,
e = n.params.max;
f && e ? i(n, u, [f, e]) : f ? i(n, t, f) : e && i(n, r, e)
})
};
t.addSingleVal = function(n, t, r) {
return this.add(n, [t || "val"], function(u) {
i(u, r || n, u.params[t])
})
};
r.addMethod("__dummy__", function() {
return !0
});
r.addMethod("regex", function(n, t, i) {
var r;
return this.optional(t) ? !0 : (r = new RegExp(i).exec(n), r && r.index === 0 && r[0].length === n.length)
});
r.addMethod("nonalphamin", function(n, t, i) {
var r;
return i && (r = n.match(/\W/g), r = r && r.length >= i), r
});
t.addSingleVal("accept", "exts").addSingleVal("regex", "pattern");
t.addBool("creditcard").addBool("date").addBool("digits").addBool("email").addBool("number").addBool("url");
t.addMinMax("length", "minlength", "maxlength", "rangelength").addMinMax("range", "min", "max", "range");
t.add("equalto", ["other"], function(t) {
var r = e(t.element.name),
u = t.params.other,
s = o(u, r),
h = n(t.form).find(":input[name='" + f(s) + "']")[0];
i(t, "equalTo", h)
});
t.add("required", function(n) {
(n.element.tagName.toUpperCase() !== "INPUT" || n.element.type.toUpperCase() !== "CHECKBOX") && i(n, "required", !0)
});
t.add("remote", ["url", "type", "additionalfields"], function(t) {
var r = {
url: t.params.url,
type: t.params.type || "GET",
data: {}
},
u = e(t.element.name);
n.each(h(t.params.additionalfields || t.element.name), function(i, e) {
var s = o(e, u);
r.data[s] = function() {
return n(t.form).find(":input[name='" + f(s) + "']").val()
}
});
i(t, "remote", r)
});
t.add("password", ["min", "nonalphamin", "regex"], function(n) {
n.params.min && i(n, "minlength", n.params.min);
n.params.nonalphamin && i(n, "nonalphamin", n.params.nonalphamin);
n.params.regex && i(n, "regex", n.params.regex)
});
n(function() {
r.unobtrusive.parse(document)
})
}(jQuery);
window.Modernizr = function(n, t, i) {
function a(n) {
c.cssText = n
}
function vt(n, t) {
return a(y.join(n + ";") + (t || ""))
}
function h(n, t) {
return typeof n === t
}
function v(n, t) {
return !!~("" + n).indexOf(t)
}
function lt(n, t) {
var u, r;
for (u in n)
if (r = n[u], !v(r, "-") && c[r] !== i) return t == "pfx" ? r : !0;
return !1
}
function yt(n, t, r) {
var f, u;
for (f in n)
if (u = t[n[f]], u !== i) return r === !1 ? n[f] : h(u, "function") ? u.bind(r || t) : u;
return !1
}
function f(n, t, i) {
var r = n.charAt(0).toUpperCase() + n.slice(1),
u = (n + " " + ot.join(r + " ") + r).split(" ");
return h(t, "string") || h(t, "undefined") ? lt(u, t) : (u = (n + " " + st.join(r + " ") + r).split(" "), yt(u, t, i))
}
function pt() {
u.input = function(i) {
for (var r = 0, u = i.length; r < u; r++) w[i[r]] = !!(i[r] in o);
return w.list && (w.list = !!(t.createElement("datalist") && n.HTMLDataListElement)), w
}("autocomplete autofocus list placeholder max min multiple pattern required step".split(" "));
u.inputtypes = function(n) {
for (var u = 0, r, f, e, h = n.length; u < h; u++) o.setAttribute("type", f = n[u]), r = o.type !== "text", r && (o.value = g, o.style.cssText = "position:absolute;visibility:hidden;", /^range$/.test(f) && o.style.WebkitAppearance !== i ? (s.appendChild(o), e = t.defaultView, r = e.getComputedStyle && e.getComputedStyle(o, null).WebkitAppearance !== "textfield" && o.offsetHeight !== 0, s.removeChild(o)) : /^(search|tel)$/.test(f) || (r = /^(url|email)$/.test(f) ? o.checkValidity && o.checkValidity() === !1 : o.value != g)), ht[n[u]] = !!r;
return ht
}("search tel url email datetime date month week time datetime-local number range color".split(" "))
}
var u = {},
d = !0,
s = t.documentElement,
e = "modernizr",
ut = t.createElement(e),
c = ut.style,
o = t.createElement("input"),
g = ":)",
ft = {}.toString,
y = " -webkit- -moz- -o- -ms- ".split(" "),
et = "Webkit Moz O ms",
ot = et.split(" "),
st = et.toLowerCase().split(" "),
p = {
svg: "http://www.w3.org/2000/svg"
},
r = {},
ht = {},
w = {},
nt = [],
tt = nt.slice,
b, l = function(n, i, r, u) {
var l, a, c, v, f = t.createElement("div"),
h = t.body,
o = h || t.createElement("body");
if (parseInt(r, 10))
while (r--) c = t.createElement("div"), c.id = u ? u[r] : e + (r + 1), f.appendChild(c);
return l = ["", '