/*
* Kendo UI Complete v2013.1.514 (http://kendoui.com)
* Copyright 2013 Telerik AD. All rights reserved.
*
* Kendo UI Complete commercial licenses may be obtained at
* https://www.kendoui.com/purchase/license-agreement/kendo-ui-complete-commercial.aspx
* If you do not own a commercial license, this file shall be governed by the trial license terms.
*/
(function (e, t, n) {
function i() {}
function r(e, t) {
if (t) return "'" + e.split("'").join("\\'").split('\\"').join('\\\\\\"').replace(/\n/g, "\\n").replace(/\r/g, "\\r").replace(/\t/g, "\\t") + "'";
var n = e.charAt(0),
i = e.substring(1);
return "=" === n ? "+(" + i + ")+" : ":" === n ? "+e(" + i + ")+" : ";" + e + ";o+="
}
function o(e, t, n) {
return e += "", t = t || 2, n = t - e.length, n ? O[t].substring(0, n) + e : e
}
function a(t) {
var n, i, r, o, a, s, l, d, c, u, p, f, h, g = mt.browser,
m = "rtl" == t.css("direction");
return t.parent().hasClass("k-animation-container") ? (f = t.parent(".k-animation-container"), h = f[0].style, f.is(":hidden") && f.show(), n = vt.test(h.width) || vt.test(h.height), n || f.css({
width: t.outerWidth(),
height: t.outerHeight()
})) : (i = t.css(st.support.transitions.css + "box-shadow") || t.css("box-shadow"), r = i ? i.match(bt) || [0, 0, 0, 0, 0] : [0, 0, 0, 0, 0], o = ht.max(+r[3], +(r[4] || 0)), a = -r[1] + o, s = +r[1] + o, l = +r[2] + o, d = t[0].style.width, c = t[0].style.height, u = vt.test(d), p = vt.test(c), g.opera && (a = s = l = 5), n = u || p, u || (d = t.outerWidth()), p || (c = t.outerHeight()), t.wrap(e("
").addClass("k-animation-container").css({
width: d,
height: c,
marginLeft: a * (m ? 1 : -1),
paddingLeft: a,
paddingRight: s,
paddingBottom: l
})), n && t.css({
width: "100%",
height: "100%",
boxSizing: "border-box",
mozBoxSizing: "border-box",
webkitBoxSizing: "border-box"
})), g.msie && 7 >= ht.floor(g.version) && t.css({
zoom: 1
}), t.parent()
}
function s(e) {
var t = 1,
n = arguments.length;
for (t = 1; n > t; t++) l(e, arguments[t]);
return e
}
function l(e, t) {
var n, i, r, o, a = st.data.ObservableArray;
for (n in t) i = t[n], r = typeof i, r === kt && null !== i && i.constructor !== Array && i.constructor !== a ? i instanceof Date ? e[n] = new Date(i.getTime()) : (o = e[n], e[n] = typeof o === kt ? o || {} : {}, l(e[n], i)) : r !== St && (e[n] = i);
return e
}
function d(e, t, i) {
for (var r in t)
if (t.hasOwnProperty(r) && t[r].test(e)) return r;
return i !== n ? i : e
}
function c(t, n) {
var i, r = {};
return document.defaultView && document.defaultView.getComputedStyle ? (i = document.defaultView.getComputedStyle(t, ""), n && e.each(n, function (e, t) {
r[t] = i.getPropertyValue(t)
})) : (i = t.currentStyle, n && e.each(n, function (e, t) {
r[t] = i[t.replace(/\-(\w)/g, function (e, t) {
return t.toUpperCase()
})]
})), st.size(r) || (r = i), r
}
function u(e) {
var t, n = 0;
for (t in e) e.hasOwnProperty(t) && "toJSON" != t && n++;
return n
}
function p(t) {
return "" === e.trim(e(t).contents().filter(function () {
return 8 != this.nodeType
}).html())
}
function f(e, t, n) {
var i, r, o, a;
return t || (t = "offset"), i = e[t](), r = mt.mobileOS, mt.touch && r.ios && 410 > r.flatVersion && (o = "offset" == t ? i : e.offset(), a = i.left == o.left && i.top == o.top) ? {
top: i.top - window.scrollY,
left: i.left - window.scrollX
} : (st.support.pointers && !n && (i.top -= window.pageYOffset - document.documentElement.scrollTop, i.left -= window.pageXOffset - document.documentElement.scrollLeft), i)
}
function h(e) {
var t = {};
return dt("string" == typeof e ? e.split(" ") : e, function (e) {
t[e] = this
}), t
}
function g(e) {
return new st.effects.Element(e)
}
function m(e, t, n, i) {
return typeof e === wt && (ft(t) && (i = t, t = 400, n = !1), ft(n) && (i = n, n = !1), typeof t === Tt && (n = t, t = 400), e = {
effects: e,
duration: t,
reverse: n,
complete: i
}), lt({
effects: {},
duration: 400,
reverse: !1,
init: pt,
teardown: pt,
hide: !1
}, e, {
completeCallback: e.complete,
complete: pt
})
}
function v(t, n, i, r, o) {
for (var a, s = 0, l = t.length; l > s; s++) a = e(t[s]), a.queue(function () {
N.promise(a, m(n, i, r, o))
});
return t
}
function _(e, t, n, i, r, o) {
return N.transitionPromise(e, t, m(n, i, r, o))
}
function b(e, t, n, i) {
return t && (t = t.split(" "), dt(t, function (t, n) {
e.toggleClass(n, i)
})), e
}
function y(e) {
return ("" + e).replace(B, "&").replace(L, "<").replace(V, ">")
}
function w(e, i) {
var r;
return 0 === i.indexOf("data") && (i = i.substring(4), i = i.charAt(0).toLowerCase() + i.substring(1)), i = i.replace(K, "-$1"), r = e.getAttribute("data-" + st.ns + i), null === r ? r = n : "null" === r ? r = null : "true" === r ? r = !0 : "false" === r ? r = !1 : isNaN(parseFloat(r)) ? Y.test(r) && !Q.test(r) && (r = t("(" + r + ")")) : r = parseFloat(r), r
}
function x(t, i) {
var r, o, a = {};
for (r in i) o = w(t, r), o !== n && ($.test(r) && (o = st.template(e("#" + o).html())), a[r] = o);
return a
}
function k(e, t) {
var n = e.nodeName.toLowerCase();
return (/input|select|textarea|button|object/.test(n) ? !e.disabled : "a" === n ? e.href || t : t) && C(e)
}
function C(t) {
return !e(t).parents().andSelf().filter(function () {
return "hidden" === e.css(this, "visibility") || e.expr.filters.hidden(this)
}).length
}
function T(e, t) {
return new T.fn.init(e, t)
}
var S, A, F, D, I, E, P, z, H, R, O, M, N, B, L, V, U, W, j, q, G, $, Y, Q, K, X, J, Z, et, tt, nt, it, rt, ot, at, st = window.kendo = window.kendo || {}, lt = e.extend,
dt = e.each,
ct = e.proxy,
ut = e.isArray,
pt = e.noop,
ft = e.isFunction,
ht = Math,
gt = window.JSON || {}, mt = {}, vt = /%/,
_t = /\{(\d+)(:[^\}]+)?\}/g,
bt = /(\d+?)px\s*(\d+?)px\s*(\d+?)px\s*(\d+?)?/i,
yt = "function",
wt = "string",
xt = "number",
kt = "object",
Ct = "null",
Tt = "boolean",
St = "undefined",
At = {}, Ft = {}, Dt = [].slice,
It = window.Globalize;
i.extend = function (e) {
var t, n, i = function () {}, r = this,
o = e && e.init ? e.init : function () {
r.apply(this, arguments)
};
i.prototype = r.prototype, n = o.fn = o.prototype = new i;
for (t in e) n[t] = typeof e[t] !== kt || e[t] instanceof Array || null === e[t] ? e[t] : lt(!0, {}, i.prototype[t], e[t]);
return n.constructor = o, o.extend = r.extend, o
}, A = function () {
this._defaultPrevented = !0
}, F = function () {
return this._defaultPrevented === !0
}, D = i.extend({
init: function () {
this._events = {}
},
bind: function (e, t, i) {
var r, o, a, s, l, d = this,
c = typeof e === wt ? [e] : e,
u = typeof t === yt;
if (t === n) {
for (r in e) d.bind(r, e[r]);
return d
}
for (r = 0, o = c.length; o > r; r++) e = c[r], s = u ? t : t[e], s && (i && (a = s, s = function () {
d.unbind(e, s), a.apply(d, arguments)
}), l = d._events[e] = d._events[e] || [], l.push(s));
return d
},
one: function (e, t) {
return this.bind(e, t, !0)
},
first: function (e, t) {
var n, i, r, o, a = this,
s = typeof e === wt ? [e] : e,
l = typeof t === yt;
for (n = 0, i = s.length; i > n; n++) e = s[n], r = l ? t : t[e], r && (o = a._events[e] = a._events[e] || [], o.unshift(r));
return a
},
trigger: function (e, t) {
var n, i, r = this,
o = r._events[e];
if (o) {
for (t = t || {}, t.sender = r, t._defaultPrevented = !1, t.preventDefault = A, t.isDefaultPrevented = F, o = o.slice(), n = 0, i = o.length; i > n; n++) o[n].call(r, t);
return t._defaultPrevented === !0
}
return !1
},
unbind: function (e, t) {
var i, r = this,
o = r._events[e];
if (e === n) r._events = {};
else if (o)
if (t)
for (i = o.length - 1; i >= 0; i--) o[i] === t && o.splice(i, 1);
else r._events[e] = [];
return r
}
}), I = /^\w+/, E = /\$\{([^}]*)\}/g, P = /\\\}/g, z = /__CURLY__/g, H = /\\#/g, R = /__SHARP__/g, O = ["", "0", "00", "000", "0000"], S = {
paramName: "data",
useWithBlock: !0,
render: function (e, t) {
var n, i, r = "";
for (n = 0, i = t.length; i > n; n++) r += e(t[n]);
return r
},
compile: function (t, n) {
var i, o, a = lt({}, this, n),
s = a.paramName,
l = s.match(I)[0],
d = a.useWithBlock,
c = "var o,e=kendo.htmlEncode;";
if (ft(t)) return 2 === t.length ? function (n) {
return t(e, {
data: n
}).join("")
} : t;
for (c += d ? "with(" + s + "){" : "", c += "o=", i = t.replace(P, "__CURLY__").replace(E, "#=e($1)#").replace(z, "}").replace(H, "__SHARP__").split("#"), o = 0; i.length > o; o++) c += r(i[o], 0 === o % 2);
c += d ? ";}" : ";", c += "return o;", c = c.replace(R, "#");
try {
return Function(l, c)
} catch (u) {
throw Error(st.format("Invalid template:'{0}' Generated code:'{1}'", t, c))
}
}
},
function () {
function e(e) {
return a.lastIndex = 0, a.test(e) ? '"' + e.replace(a, function (e) {
var t = s[e];
return typeof t === wt ? t : "\\u" + ("0000" + e.charCodeAt(0).toString(16)).slice(-4)
}) + '"' : '"' + e + '"'
}
function t(o, a) {
var s, d, c, u, p, f, h = n,
g = a[o];
if (g && typeof g === kt && typeof g.toJSON === yt && (g = g.toJSON(o)), typeof r === yt && (g = r.call(a, o, g)), f = typeof g, f === wt) return e(g);
if (f === xt) return isFinite(g) ? g + "" : Ct;
if (f === Tt || f === Ct) return g + "";
if (f === kt) {
if (!g) return Ct;
if (n += i, p = [], "[object Array]" === l.apply(g)) {
for (u = g.length, s = 0; u > s; s++) p[s] = t(s, g) || Ct;
return c = 0 === p.length ? "[]" : n ? "[\n" + n + p.join(",\n" + n) + "\n" + h + "]" : "[" + p.join(",") + "]", n = h, c
}
if (r && typeof r === kt)
for (u = r.length, s = 0; u > s; s++) typeof r[s] === wt && (d = r[s], c = t(d, g), c && p.push(e(d) + (n ? ": " : ":") + c));
else
for (d in g) Object.hasOwnProperty.call(g, d) && (c = t(d, g), c && p.push(e(d) + (n ? ": " : ":") + c));
return c = 0 === p.length ? "{}" : n ? "{\n" + n + p.join(",\n" + n) + "\n" + h + "}" : "{" + p.join(",") + "}", n = h, c
}
}
var n, i, r, a = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
s = {
"\b": "\\b",
" ": "\\t",
"\n": "\\n",
"\f": "\\f",
"\r": "\\r",
'"': '\\"',
"\\": "\\\\"
}, l = {}.toString;
typeof Date.prototype.toJSON !== yt && (Date.prototype.toJSON = function () {
var e = this;
return isFinite(e.valueOf()) ? o(e.getUTCFullYear(), 4) + "-" + o(e.getUTCMonth() + 1) + "-" + o(e.getUTCDate()) + "T" + o(e.getUTCHours()) + ":" + o(e.getUTCMinutes()) + ":" + o(e.getUTCSeconds()) + "Z" : null
}, String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function () {
return this.valueOf()
}), typeof gt.stringify !== yt && (gt.stringify = function (e, o, a) {
var s;
if (n = "", i = "", typeof a === xt)
for (s = 0; a > s; s += 1) i += " ";
else typeof a === wt && (i = a); if (r = o, o && typeof o !== yt && (typeof o !== kt || typeof o.length !== xt)) throw Error("JSON.stringify");
return t("", {
"": e
})
})
}(),
function () {
function e(e) {
if (e) {
if (e.numberFormat) return e;
if (typeof e === wt) {
var t = st.cultures;
return t[e] || t[e.split("-")[0]] || null
}
return null
}
return null
}
function t(t) {
return t && (t = e(t)), t || st.cultures.current
}
function i(e) {
e.groupSizes = e.groupSize, e.percent.groupSizes = e.percent.groupSize, e.currency.groupSizes = e.currency.groupSize
}
function r(e, i, r) {
r = t(r);
var a = r.calendars.standard,
s = a.days,
l = a.months;
return i = a.patterns[i] || i, i.replace(d, function (t) {
var i;
return "d" === t ? i = e.getDate() : "dd" === t ? i = o(e.getDate()) : "ddd" === t ? i = s.namesAbbr[e.getDay()] : "dddd" === t ? i = s.names[e.getDay()] : "M" === t ? i = e.getMonth() + 1 : "MM" === t ? i = o(e.getMonth() + 1) : "MMM" === t ? i = l.namesAbbr[e.getMonth()] : "MMMM" === t ? i = l.names[e.getMonth()] : "yy" === t ? i = o(e.getFullYear() % 100) : "yyyy" === t ? i = o(e.getFullYear(), 4) : "h" === t ? i = e.getHours() % 12 || 12 : "hh" === t ? i = o(e.getHours() % 12 || 12) : "H" === t ? i = e.getHours() : "HH" === t ? i = o(e.getHours()) : "m" === t ? i = e.getMinutes() : "mm" === t ? i = o(e.getMinutes()) : "s" === t ? i = e.getSeconds() : "ss" === t ? i = o(e.getSeconds()) : "f" === t ? i = ht.floor(e.getMilliseconds() / 100) : "ff" === t ? i = ht.floor(e.getMilliseconds() / 10) : "fff" === t ? i = e.getMilliseconds() : "tt" === t && (i = 12 > e.getHours() ? a.AM[0] : a.PM[0]), i !== n ? i : t.slice(1, t.length - 1)
})
}
function a(e, i, r) {
r = t(r);
var o, a, l, d, b, y, w, x, k, C, T, S, A, F, D, I, E, P, z, H, R, O, M, N = r.numberFormat,
B = N.groupSize[0],
L = N[g],
V = N[h],
U = N.decimals,
W = N.pattern[0],
j = [],
q = 0 > e,
G = f,
$ = f,
Y = -1;
if (e === n) return f;
if (!isFinite(e)) return e;
if (!i) return r.name.length ? e.toLocaleString() : "" + e;
if (b = c.exec(i)) {
if (i = b[1].toLowerCase(), a = "c" === i, l = "p" === i, (a || l) && (N = a ? N.currency : N.percent, B = N.groupSize[0], L = N[g], V = N[h], U = N.decimals, o = N.symbol, W = N.pattern[q ? 0 : 1]), d = b[2], d && (U = +d), "e" === i) return d ? e.toExponential(U) : e.toExponential();
if (l && (e *= 100), e = s(e, U), e = e.split(h), y = e[0], w = e[1], q && (y = y.substring(1)), $ = y, x = y.length, x >= B)
for ($ = f, C = 0; x > C; C++) C > 0 && 0 === (x - C) % B && ($ += L), $ += y.charAt(C);
if (w && ($ += V + w), "n" === i && !q) return $;
for (e = f, C = 0, T = W.length; T > C; C++) S = W.charAt(C), e += "n" === S ? $ : "$" === S || "%" === S ? o : S;
return e
}
if (q && (e = -e), i = i.split(";"), q && i[1]) i = i[1], F = !0;
else if (0 === e) {
if (i = i[2] || i[0], -1 == i.indexOf(m) && -1 == i.indexOf(v)) return i
} else i = i[0]; if ((i.indexOf("'") > -1 || i.indexOf('"') > -1) && (i = i.replace(u, function (e) {
return j.push(e), _
})), H = i.indexOf("%"), R = i.indexOf("$"), l = -1 != H, a = -1 != R, l && ("\\" !== i[H - 1] ? e *= 100 : i = i.split("\\").join("")), a && "\\" === i[R - 1] && (i = i.split("\\").join(""), a = !1), (a || l) && (N = a ? N.currency : N.percent, B = N.groupSize[0], L = N[g], V = N[h], U = N.decimals, o = N.symbol), A = i.indexOf(g) > -1, A && (i = i.replace(p, f)), D = i.indexOf(h), T = i.length, -1 != D ? (w = ("" + e).split("e"), w = w[1] ? s(e, Math.abs(w[1])) : w[0], w = w.split(h)[1] || f, E = i.lastIndexOf(v) - D, I = i.lastIndexOf(m) - D, P = E > -1, z = I > -1, C = w.length, P || z || (i = i.substring(0, D) + i.substring(D + 1), T = i.length, D = -1, C = 0), P && E > I ? C = E : I > E && (z && C > I ? C = I : P && E > C && (C = E)), C > -1 && (e = s(e, C))) : e = s(e), I = i.indexOf(m), O = E = i.indexOf(v), Y = -1 == I && -1 != E ? E : -1 != I && -1 == E ? I : I > E ? E : I, I = i.lastIndexOf(m), E = i.lastIndexOf(v), M = -1 == I && -1 != E ? E : -1 != I && -1 == E ? I : I > E ? I : E, Y == T && (M = Y), -1 != Y) {
if ($ = ("" + e).split(h), y = $[0], w = $[1] || f, x = y.length, k = w.length, A)
if (x === B && D - O > x) y = L + y;
else if (x > B) {
for ($ = f, C = 0; x > C; C++) C > 0 && 0 === (x - C) % B && ($ += L), $ += y.charAt(C);
y = $
}
for (e = i.substring(0, Y), q && !F && (e += "-"), C = Y; T > C; C++) {
if (S = i.charAt(C), -1 == D) {
if (x > M - C) {
e += y;
break
}
} else if (-1 != E && C > E && (G = f), x >= D - C && D - C > -1 && (e += y, C = D), D === C) {
e += (w ? V : f) + w, C += M - D + 1;
continue
}
S === v ? (e += S, G = S) : S === m && (e += G)
}
if (M >= Y && (e += i.substring(M + 1)), a || l) {
for ($ = f, C = 0, T = e.length; T > C; C++) S = e.charAt(C), $ += "$" === S || "%" === S ? o : S;
e = $
}
if (j[0])
for (T = j.length, C = 0; T > C; C++) e = e.replace(_, j[C])
}
return e
}
var s, l, d = /dddd|ddd|dd|d|MMMM|MMM|MM|M|yyyy|yy|HH|H|hh|h|mm|m|fff|ff|f|tt|ss|s|"[^"]*"|'[^']*'/g,
c = /^(n|c|p|e)(\d*)$/i,
u = /["'].*?["']/g,
p = /\,/g,
f = "",
h = ".",
g = ",",
m = "#",
v = "0",
_ = "??",
b = "en-US",
y = {}.toString;
st.cultures = {
"en-US": {
name: b,
numberFormat: {
pattern: ["-n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
percent: {
pattern: ["-n %", "n %"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "%"
},
currency: {
pattern: ["($n)", "$n"],
decimals: 2,
",": ",",
".": ".",
groupSize: [3],
symbol: "$"
}
},
calendars: {
standard: {
days: {
names: ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"],
namesAbbr: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
namesShort: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"]
},
months: {
names: ["January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"],
namesAbbr: ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
},
AM: ["AM", "am", "AM"],
PM: ["PM", "pm", "PM"],
patterns: {
d: "M/d/yyyy",
D: "dddd, MMMM dd, yyyy",
F: "dddd, MMMM dd, yyyy h:mm:ss tt",
g: "M/d/yyyy h:mm tt",
G: "M/d/yyyy h:mm:ss tt",
m: "MMMM dd",
M: "MMMM dd",
s: "yyyy'-'MM'-'ddTHH':'mm':'ss",
t: "h:mm tt",
T: "h:mm:ss tt",
u: "yyyy'-'MM'-'dd HH':'mm':'ss'Z'",
y: "MMMM, yyyy",
Y: "MMMM, yyyy"
},
"/": "/",
":": ":",
firstDay: 0,
twoDigitYearMax: 2029
}
}
}
}, st.culture = function (t) {
var r, o = st.cultures;
return t === n ? o.current : (r = e(t) || o[b], r.calendar = r.calendars.standard, o.current = r, It && i(r.numberFormat), n)
}, st.findCulture = e, st.getCulture = t, st.culture(b), s = function (e, t) {
var n = Math.pow(10, t || 0);
return (Math.round(e * n) / n).toFixed(t)
}, l = function (e, t, i) {
if (t) {
if ("[object Date]" === y.call(e)) return r(e, t, i);
if (typeof e === xt) return a(e, t, i)
}
return e !== n ? e : ""
}, It && (l = ct(It.format, It)), st.format = function (e) {
var t = arguments;
return e.replace(_t, function (e, n, i) {
var r = t[parseInt(n, 10) + 1];
return l(r, i ? i.substring(1) : "")
})
}, st._extractFormat = function (e) {
return "{0:" === e.slice(0, 3) && (e = e.slice(3, e.length - 1)), e
}, st._activeElement = function () {
try {
return document.activeElement
} catch (e) {
return document.documentElement.activeElement
}
}, st._round = s, st.toString = l
}(),
function () {
function t(e, t, n) {
return !(e >= t && n >= e)
}
function i(e) {
return e.charAt(0)
}
function r(t) {
return e.map(t, i)
}
function o(e, t) {
t || 23 !== e.getHours() || e.setHours(e.getHours() + 2)
}
function a(e, i, a) {
if (!e) return null;
var s, l, u, p, h, g, m, v, _, b, y, w, x = function (e) {
for (var t = 0; i[H] === e;) t++, H++;
return t > 0 && (H -= 1), t
}, k = function (t) {
var n = f[t] || RegExp("^\\d{1," + t + "}"),
i = e.substr(R, t).match(n);
return i ? (i = i[0], R += i.length, parseInt(i, 10)) : null
}, C = function (t) {
for (var n, i, r = 0, o = t.length; o > r; r++)
if (n = t[r], i = n.length, e.substr(R, i) == n) return R += i, r + 1;
return null
}, T = function () {
var t = !1;
return e.charAt(R) === i[H] && (R++, t = !0), t
}, S = a.calendars.standard,
A = null,
F = null,
D = null,
I = null,
E = null,
P = null,
z = null,
H = 0,
R = 0,
O = !1,
M = new Date,
N = S.twoDigitYearMax || 2029,
B = M.getFullYear();
for (i || (i = "d"), p = S.patterns[i], p && (i = p), i = i.split(""), u = i.length; u > H; H++)
if (s = i[H], O) "'" === s ? O = !1 : T();
else if ("d" === s) {
if (l = x("d"), D = 3 > l ? k(2) : C(S.days[3 == l ? "namesAbbr" : "names"]), null === D || t(D, 1, 31)) return null
} else if ("M" === s) {
if (l = x("M"), F = 3 > l ? k(2) : C(S.months[3 == l ? "namesAbbr" : "names"]), null === F || t(F, 1, 12)) return null;
F -= 1
} else if ("y" === s) {
if (l = x("y"), A = k(l), null === A) return null;
2 == l && ("string" == typeof N && (N = B + parseInt(N, 10)), A = B - B % 100 + A, A > N && (A -= 100))
} else if ("h" === s) {
if (x("h"), I = k(2), 12 == I && (I = 0), null === I || t(I, 0, 11)) return null
} else if ("H" === s) {
if (x("H"), I = k(2), null === I || t(I, 0, 23)) return null
} else if ("m" === s) {
if (x("m"), E = k(2), null === E || t(E, 0, 59)) return null
} else if ("s" === s) {
if (x("s"), P = k(2), null === P || t(P, 0, 59)) return null
} else if ("f" === s) {
if (l = x("f"), z = k(l), null !== z && l > 3 && (z = parseInt(("" + z).substring(0, 3), 10)), null === z || t(z, 0, 999)) return null
} else if ("t" === s) {
if (l = x("t"), _ = S.AM, b = S.PM, 1 === l && (_ = r(_), b = r(b)), h = C(b), !h && !C(_)) return null
} else if ("z" === s) {
if (g = !0, l = x("z"), "Z" === e.substr(R, 1)) {
if (!m) return null;
T();
continue
}
if (v = e.substr(R, 6).match(l > 2 ? c : d), !v) return null;
if (v = v[0], R = v.length, v = v.split(":"), y = parseInt(v[0], 10), t(y, -12, 13)) return null;
if (l > 2 && (w = parseInt(v[1], 10), isNaN(w) || t(w, 0, 59))) return null
} else if ("T" === s) m = T();
else if ("'" === s) O = !0, T();
else if (!T()) return null;
return null === A && (A = B), h && 12 > I && (I += 12), null === D && (D = 1), g ? (y && (I += -y), w && (E += -w), e = new Date(Date.UTC(A, F, D, I, E, P, z))) : (e = new Date(A, F, D, I, E, P, z), o(e, I)), 100 > A && e.setFullYear(A), e.getDate() !== D && g === n ? null : e
}
var s = /\u00A0/g,
l = /[eE][\-+]?[0-9]+/,
d = /[+|\-]\d{1,2}/,
c = /[+|\-]\d{1,2}:\d{2}/,
u = /^\/Date\((.*?)\)\/$/,
p = ["G", "g", "d", "F", "D", "y", "m", "T", "t"],
f = {
2: /^\d{1,2}/,
4: /^\d{4}/
}, h = {}.toString;
st._adjustDate = o, st.parseDate = function (e, t, n) {
if ("[object Date]" === h.call(e)) return e;
var i, r, o = 0,
s = null;
if (e && 0 === e.indexOf("/D") && (s = u.exec(e))) return new Date(parseInt(s[1], 10));
if (n = st.getCulture(n), !t) {
for (t = [], r = n.calendar.patterns, i = p.length; i > o; o++) t[o] = r[p[o]];
t[o] = "ddd MMM dd yyyy HH:mm:ss", t[++o] = "yyyy-MM-ddTHH:mm:ss.fffffffzzz", t[++o] = "yyyy-MM-ddTHH:mm:ss.fffzzz", t[++o] = "yyyy-MM-ddTHH:mm:sszzz", t[++o] = "yyyy-MM-ddTHH:mmzzz", t[++o] = "yyyy-MM-ddTHH:mmzz", t[++o] = "yyyy-MM-ddTHH:mm:ss", t[++o] = "yyyy-MM-ddTHH:mm", t[++o] = "yyyy-MM-dd", o = 0
}
for (t = ut(t) ? t : [t], i = t.length; i > o; o++)
if (s = a(e, t[o], n)) return s;
return s
}, st.parseInt = function (e, t) {
var n = st.parseFloat(e, t);
return n && (n = 0 | n), n
}, st.parseFloat = function (e, t, n) {
if (!e && 0 !== e) return null;
if (typeof e === xt) return e;
e = "" + e, t = st.getCulture(t);
var i, r, o = t.numberFormat,
a = o.percent,
d = o.currency,
c = d.symbol,
u = a.symbol,
p = e.indexOf("-") > -1;
return l.test(e) ? (e = parseFloat(e), isNaN(e) && (e = null), e) : (e.indexOf(c) > -1 || n && n.toLowerCase().indexOf("c") > -1 ? (o = d, i = o.pattern[0].replace("$", c).split("n"), e.indexOf(i[0]) > -1 && e.indexOf(i[1]) > -1 && (e = e.replace(i[0], "").replace(i[1], ""), p = !0)) : e.indexOf(u) > -1 && (r = !0, o = a, c = u), e = e.replace("-", "").replace(c, "").replace(s, " ").split(o[","].replace(s, " ")).join("").replace(o["."], "."), e = parseFloat(e), isNaN(e) ? e = null : p && (e *= -1), e && r && (e /= 100), e)
}, It && (st.parseDate = function (e, t, n) {
return "[object Date]" === h.call(e) ? e : It.parseDate(e, t, n)
}, st.parseFloat = function (e, t) {
return typeof e === xt ? e : e === n || null === e ? null : (e = It.parseFloat(e, t), isNaN(e) ? null : e)
})
}(),
function () {
function t(e) {
var t, n = !1,
i = [],
r = {
webkit: /(chrome)[ \/]([\w.]+)/i,
safari: /(webkit)[ \/]([\w.]+)/i,
opera: /(opera)(?:.*version|)[ \/]([\w.]+)/i,
msie: /(msie) ([\w.]+)/i,
mozilla: /(mozilla)(?:.*? rv:([\w.]+)|)/i
};
for (t in r)
if (r.hasOwnProperty(t) && (i = e.match(r[t]))) {
n = {}, n[t] = !0, n[i[1].toLowerCase()] = !0, n.version = parseInt(document.documentMode || i[2], 10);
break
}
return n
}
var i, r, o, a, s, l;
mt.scrollbar = function () {
var e, t = document.createElement("div");
return t.style.cssText = "overflow:scroll;overflow-x:hidden;zoom:1;clear:both", t.innerHTML = " ", document.body.appendChild(t), e = t.offsetWidth - t.scrollWidth, document.body.removeChild(t), e
}, mt.isRtl = function (t) {
return e(t).closest(".k-rtl").length > 0
}, i = document.createElement("table");
try {
i.innerHTML = "
", mt.tbodyInnerHtml = !0
} catch (c) {
mt.tbodyInnerHtml = !1
}
mt.touch = "ontouchstart" in window, mt.pointers = navigator.msPointerEnabled, r = mt.transitions = !1, o = mt.transforms = !1, a = "HTMLElement" in window ? HTMLElement.prototype : [], mt.hasHW3D = "WebKitCSSMatrix" in window && "m11" in new window.WebKitCSSMatrix || "MozPerspective" in document.documentElement.style || "msPerspective" in document.documentElement.style, dt(["Moz", "webkit", "O", "ms"], function () {
var e, t = "" + this,
a = typeof i.style[t + "Transition"] === wt;
return a || typeof i.style[t + "Transform"] === wt ? (e = t.toLowerCase(), o = {
css: "ms" != e ? "-" + e + "-" : "",
prefix: t,
event: "o" === e || "webkit" === e ? e : ""
}, a && (r = o, r.event = r.event ? r.event + "TransitionEnd" : "transitionend"), !1) : n
}), mt.transforms = o, mt.transitions = r, mt.devicePixelRatio = window.devicePixelRatio === n ? 1 : window.devicePixelRatio, mt.screenWidth = window.outerWidth || window.screen ? window.screen.availWidth : window.innerWidth, mt.screenHeight = window.outerHeight || window.screen ? window.screen.availHeight : window.innerHeight, mt.detectOS = function (e) {
var t, n, i = !1,
r = [],
o = !/mobile safari/i.test(e),
a = {
fire: /(Silk)\/(\d+)\.(\d+(\.\d+)?)/,
android: /(Android|Android.*(?:Opera|Firefox).*?\/)\s*(\d+)\.(\d+(\.\d+)?)/,
iphone: /(iPhone|iPod).*OS\s+(\d+)[\._]([\d\._]+)/,
ipad: /(iPad).*OS\s+(\d+)[\._]([\d_]+)/,
meego: /(MeeGo).+NokiaBrowser\/(\d+)\.([\d\._]+)/,
webos: /(webOS)\/(\d+)\.(\d+(\.\d+)?)/,
blackberry: /(BlackBerry|BB10).*?Version\/(\d+)\.(\d+(\.\d+)?)/,
playbook: /(PlayBook).*?Tablet\s*OS\s*(\d+)\.(\d+(\.\d+)?)/,
wp: /(Windows Phone(?: OS)?)\s(\d+)\.(\d+(\.\d+)?)/,
windows: /(MSIE)\s+(\d+)\.(\d+(\.\d+)?)/,
ffos: /(Mobile).*rv:(\d+)\.(\d+(\.\d+)?).*Firefox/
}, s = {
ios: /^i(phone|pad|pod)$/i,
android: /^android|fire$/i,
blackberry: /^blackberry|playbook/i,
windows: /windows/,
wp: /wp/,
meego: /meego|ffos/
}, l = {
tablet: /playbook|ipad|fire/i
}, c = {
omini: /Opera\sMini/i,
omobile: /Opera\sMobi/i,
firefox: /Firefox|Fennec/i,
mobilesafari: /version\/.*safari/i,
chrome: /chrome/i,
webkit: /webkit/i,
ie: /MSIE|Windows\sPhone/i
};
for (n in a)
if (a.hasOwnProperty(n) && (r = e.match(a[n]))) {
if ("windows" == n && "plugins" in navigator) return !1;
i = {}, i.device = n, i.tablet = d(n, l, !1), i.browser = d(e, c, "default"), i.name = d(n, s), i[i.name] = !0, i.majorVersion = r[2], i.minorVersion = r[3].replace("_", "."), t = i.minorVersion.replace(".", "").substr(0, 2), i.flatVersion = i.majorVersion + t + Array(3 - (3 > t.length ? t.length : 2)).join("0"), i.appMode = window.navigator.standalone || /file|local|wmapp/.test(window.location.protocol) || typeof window.PhoneGap !== St || typeof window.cordova !== St, i.android && (1.5 > mt.devicePixelRatio && 400 > i.flatVersion || o) && (mt.screenWidth > 800 || mt.screenHeight > 800) && (i.tablet = n);
break
}
return i
}, s = mt.mobileOS = mt.detectOS(navigator.userAgent), mt.wpDevicePixelRatio = s.wp ? screen.width / 320 : 0, mt.kineticScrollNeeded = s && (mt.touch || mt.pointers), mt.hasNativeScrolling = !1, (s.ios && s.majorVersion > 4 || s.android && s.majorVersion > 2 || s.wp) && (mt.hasNativeScrolling = s), mt.mouseAndTouchPresent = mt.touch && !(mt.mobileOS.ios || mt.mobileOS.android), mt.browser = t(navigator.userAgent),
function (t) {
var n, i = parseInt(t.version, 10);
t.msie ? n = "ie" : t.mozilla ? n = "ff" : t.safari ? n = "safari" : t.webkit ? n = "webkit" : t.opera && (n = "opera"), n && e(document.documentElement).addClass("k-" + n + " k-" + n + i)
}(mt.browser), mt.zoomLevel = function () {
return mt.touch ? document.documentElement.clientWidth / window.innerWidth : mt.pointers ? window.outerWidth / window.innerWidth : 1
}, mt.eventCapture = document.documentElement.addEventListener, mt.placeholder = "placeholder" in document.createElement("input"), mt.stableSort = function () {
var e = [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12].sort(function () {
return 0
});
return 0 === e[0] && 1 === e[1] && 2 === e[2] && 3 === e[3] && 4 === e[4] && 5 === e[5] && 6 === e[6] && 7 === e[7] && 8 === e[8] && 9 === e[9] && 10 === e[10] && 11 === e[11] && 12 === e[12]
}(), mt.matchesSelector = a.webkitMatchesSelector || a.mozMatchesSelector || a.msMatchesSelector || a.oMatchesSelector || a.matchesSelector || function (t) {
for (var n = document.querySelectorAll ? (this.parentNode || document).querySelectorAll(t) || [] : e(t), i = n.length; i--;)
if (n[i] == this) return !0;
return !1
}, mt.pushState = window.history && window.history.pushState, l = document.documentMode, mt.hashChange = "onhashchange" in window && !(mt.browser.msie && (!l || 8 >= l))
}(), M = {
left: {
reverse: "right"
},
right: {
reverse: "left"
},
down: {
reverse: "up"
},
up: {
reverse: "down"
},
top: {
reverse: "bottom"
},
bottom: {
reverse: "top"
},
"in": {
reverse: "out"
},
out: {
reverse: "in"
}
}, N = {}, e.extend(N, {
Element: function (t) {
this.element = e(t)
},
promise: function (e, t) {
e.is(":visible") || e.css({
display: e.data("olddisplay") || "block"
}).css("display"), t.hide && e.data("olddisplay", e.css("display")).hide(), t.init && t.init(), t.completeCallback && t.completeCallback(e), e.dequeue()
},
transitionPromise: function (e, t, n) {
var i = st.wrap(e);
return i.append(t), e.hide(), t.show(), n.completeCallback && n.completeCallback(e), e
}
}), "kendoAnimate" in e.fn || lt(e.fn, {
kendoStop: function (e, t) {
return this.stop(e, t)
},
kendoAnimate: function (e, t, n, i) {
return v(this, e, t, n, i)
},
kendoAnimateTo: function (e, t, n, i, r) {
return _(this, e, t, n, i, r)
},
kendoAddClass: function (e, t) {
return st.toggleClass(this, e, t, !0)
},
kendoRemoveClass: function (e, t) {
return st.toggleClass(this, e, t, !1)
},
kendoToggleClass: function (e, t, n) {
return st.toggleClass(this, e, t, n)
}
}), B = /&/g, L = //g, U = function (e) {
return e.target
}, mt.touch && (W = "chrome" == mt.mobileOS.browser && !mt.mobileOS.ios, U = function (e) {
var t = "originalEvent" in e ? e.originalEvent.changedTouches : "changedTouches" in e ? e.changedTouches : null,
n = W ? "screen" : "client";
return t ? document.elementFromPoint(t[0][n + "X"], t[0][n + "Y"]) : e.target
}, dt(["swipe", "swipeLeft", "swipeRight", "swipeUp", "swipeDown", "doubleTap", "tap"], function (t, n) {
e.fn[n] = function (e) {
return this.bind(n, e)
}
})), mt.touch ? mt.mobileOS ? (mt.mousedown = "touchstart", mt.mouseup = "touchend", mt.mousemove = "touchmove", mt.mousecancel = "touchcancel", mt.click = "touchend", mt.resize = "orientationchange") : (mt.mousedown = "mousedown touchstart", mt.mouseup = "mouseup touchend", mt.mousemove = "mousemove touchmove", mt.mousecancel = "mouseleave touchcancel", mt.click = "click", mt.resize = "resize") : mt.pointers ? (mt.mousemove = "MSPointerMove", mt.mousedown = "MSPointerDown", mt.mouseup = "MSPointerUp", mt.mousecancel = "MSPointerCancel", mt.click = "MSPointerUp", mt.resize = "orientationchange resize") : (mt.mousemove = "mousemove", mt.mousedown = "mousedown", mt.mouseup = "mouseup", mt.mousecancel = "mouseleave", mt.click = "click", mt.resize = "resize"), j = function (e, t) {
var n, i, r, o, a = t || "d",
s = 1;
for (i = 0, r = e.length; r > i; i++) o = e[i], "" !== o && (n = o.indexOf("["), 0 !== n && (-1 == n ? o = "." + o : (s++, o = "." + o.substring(0, n) + " || {})" + o.substring(n))), s++, a += o + (r - 1 > i ? " || {})" : ")"));
return Array(s).join("(") + a
}, q = /^([a-z]+:)?\/\//i, lt(st, {
ui: st.ui || {},
fx: st.fx || g,
effects: st.effects || N,
mobile: st.mobile || {},
data: st.data || {},
dataviz: st.dataviz || {
ui: {
roles: {}
}
},
keys: {
INSERT: 45,
DELETE: 46,
BACKSPACE: 8,
TAB: 9,
ENTER: 13,
ESC: 27,
LEFT: 37,
UP: 38,
RIGHT: 39,
DOWN: 40,
END: 35,
HOME: 36,
SPACEBAR: 32,
PAGEUP: 33,
PAGEDOWN: 34,
F2: 113,
F10: 121,
F12: 123
},
support: st.support || mt,
animate: st.animate || v,
ns: "",
attr: function (e) {
return "data-" + st.ns + e
},
wrap: a,
deepExtend: s,
getComputedStyles: c,
size: u,
isNodeEmpty: p,
getOffset: st.getOffset || f,
parseEffects: st.parseEffects || h,
toggleClass: st.toggleClass || b,
directions: st.directions || M,
Observable: D,
Class: i,
Template: S,
template: ct(S.compile, S),
render: ct(S.render, S),
stringify: ct(gt.stringify, gt),
eventTarget: U,
htmlEncode: y,
isLocalUrl: function (e) {
return e && !q.test(e)
},
expr: function (e, t, n) {
return e = e || "", typeof t == wt && (n = t, t = !1), n = n || "d", e && "[" !== e.charAt(0) && (e = "." + e), e = t ? j(e.split("."), n) : n + e
},
getter: function (e, t) {
return At[e] = At[e] || Function("d", "return " + st.expr(e, t))
},
setter: function (e) {
return Ft[e] = Ft[e] || Function("d,value", st.expr(e) + "=value")
},
accessor: function (e) {
return {
get: st.getter(e),
set: st.setter(e)
}
},
guid: function () {
var e, t, n = "";
for (e = 0; 32 > e; e++) t = 0 | 16 * ht.random(), (8 == e || 12 == e || 16 == e || 20 == e) && (n += "-"), n += (12 == e ? 4 : 16 == e ? 8 | 3 & t : t).toString(16);
return n
},
roleSelector: function (e) {
return e.replace(/(\S+)/g, "[" + st.attr("role") + "=$1],").slice(0, -1)
},
logToConsole: function (e) {
var t = window.console;
t !== n && t.log && t.log(e)
}
}), G = D.extend({
init: function (e, t) {
var n = this;
n.element = st.jQuery(e).handler(n), D.fn.init.call(n), t = n.options = lt(!0, {}, n.options, t), n.element.attr(st.attr("role")) || n.element.attr(st.attr("role"), (t.name || "").toLowerCase()), n.element.data("kendo" + t.prefix + t.name, n), n.bind(n.events, t)
},
events: [],
options: {
prefix: ""
},
_tabindex: function (e) {
e = e || this.wrapper;
var t = this.element,
n = "tabindex",
i = e.attr(n) || t.attr(n);
t.removeAttr(n), e.attr(n, isNaN(i) ? 0 : i)
},
setOptions: function (t) {
for (var n, i = this, r = 0, o = i.events.length; o > r; r++) n = i.events[r], i.options[n] && t[n] && i.unbind(n, i.options[n]);
e.extend(i.options, t), i.bind(i.events, t)
},
destroy: function () {
var e = this;
e.element.removeData("kendo" + e.options.prefix + e.options.name), e.element.removeData("handler"), e.unbind()
}
}), st.notify = pt, $ = /template$/i, Y = /^\s*(?:\{(?:.|\r\n|\n)*\}|\[(?:.|\r\n|\n)*\])\s*$/, Q = /^\{(\d+)(:[^\}]+)?\}/, K = /([A-Z])/g, st.initWidget = function (t, i, r) {
var o, a, s, l, d, c, u, p;
if (r ? r.roles && (r = r.roles) : r = st.ui.roles, t = t.nodeType ? t : t[0], c = t.getAttribute("data-" + st.ns + "role"), c && (s = -1 === c.indexOf(".") ? r[c] : st.getter(c)(window))) {
for (p = w(t, "dataSource"), i = e.extend({}, x(t, s.fn.options), i), p && (i.dataSource = typeof p === wt ? st.getter(p)(window) : p), l = 0, d = s.fn.events.length; d > l; l++) a = s.fn.events[l], u = w(t, a), u !== n && (i[a] = st.getter(u)(window));
return o = e(t).data("kendo" + s.fn.options.prefix + s.fn.options.name), o ? o.setOptions(i) : o = new s(t, i), o
}
}, st.rolesFromNamespaces = function (e) {
var t, n, i = [];
for (e[0] || (e = [st.ui, st.dataviz.ui]), t = 0, n = e.length; n > t; t++) i[t] = e[t].roles;
return lt.apply(null, [{}].concat(i.reverse()))
}, st.init = function (t) {
var n = st.rolesFromNamespaces(Dt.call(arguments, 1));
e(t).find("[data-" + st.ns + "role]").andSelf().each(function () {
st.initWidget(this, {}, n)
})
}, st.destroy = function (t) {
e(t).find("[data-" + st.ns + "role]").andSelf().each(function () {
var t = e(this),
n = st.widgetInstance(t, st.ui) || st.widgetInstance(t, st.mobile.ui) || st.widgetInstance(t, st.dataviz.ui);
n && n.destroy()
})
}, st.parseOptions = x, lt(st.ui, {
Widget: G,
roles: {},
progress: function (t, n) {
var i, r, o, a, s = t.find(".k-loading-mask"),
l = st.support,
d = l.browser;
n ? s.length || (i = l.isRtl(t), r = i ? "right" : "left", a = t.scrollLeft(), o = d.webkit ? i ? t[0].scrollWidth - t.width() - 2 * a : 0 : 0, s = e("
Loading...
").width("100%").height("100%").css("top", t.scrollTop()).css(r, Math.abs(a) + o).prependTo(t)) : s && s.remove()
},
plugin: function (t, i, r) {
var o, a = t.fn.options.name;
i = i || st.ui, r = r || "", i[a] = t, i.roles[a.toLowerCase()] = t, o = "getKendo" + r + a, a = "kendo" + r + a, e.fn[a] = function (i) {
var r, o = this;
return typeof i === wt ? (r = Dt.call(arguments, 1), this.each(function () {
var t, s, l = e.data(this, a);
if (!l) throw Error(st.format("Cannot call method '{0}' of {1} before it is initialized", i, a));
if (t = l[i], typeof t !== yt) throw Error(st.format("Cannot find method '{0}' of {1}", i, a));
return s = t.apply(l, r), s !== n ? (o = s, !1) : n
})) : this.each(function () {
new t(this, i)
}), o
}, e.fn[o] = function () {
return this.data(a)
}
}
}), X = {
bind: e.noop
}, J = G.extend({
init: function (e, t) {
G.fn.init.call(this, e, t), this.element.autoApplyNS(), this.wrapper = this.element
},
destroy: function () {
G.fn.destroy.call(this), this.element.kendoDestroy()
},
options: {
prefix: "Mobile"
},
events: [],
view: function () {
var e = this.element.closest(st.roleSelector("view splitview modalview"));
return st.widgetInstance(e, st.mobile.ui)
},
container: function () {
var e = this.element.closest(st.roleSelector("view layout modalview"));
return st.widgetInstance(e, st.mobile.ui) || X
}
}), lt(st.mobile, {
init: function (e) {
st.init(e, st.mobile.ui, st.ui, st.dataviz.ui)
},
ui: {
Widget: J,
roles: {},
plugin: function (e) {
st.ui.plugin(e, st.mobile.ui, "Mobile")
}
}
}), st.touchScroller = function (t, n) {
return e(t).map(function (t, i) {
return i = e(i), mt.kineticScrollNeeded && st.mobile.ui.Scroller && !i.data("kendoMobileScroller") ? (i.kendoMobileScroller(n), i.data("kendoMobileScroller")) : !1
})[0]
}, st.preventDefault = function (e) {
e.preventDefault()
}, st.widgetInstance = function (e, t) {
var i = t.roles[e.data(st.ns + "role")];
return i ? e.data("kendo" + i.fn.options.prefix + i.fn.options.name) : n
}, st.onResize = function (t) {
var n = t;
mt.mobileOS.android && (n = function () {
setTimeout(t, 200)
}), e(window).on(mt.resize, n)
}, st.attrValue = function (e, t) {
return e.data(st.ns + t)
}, st.days = {
Sunday: 0,
Monday: 1,
Tuesday: 2,
Wednesday: 3,
Thursday: 4,
Friday: 5,
Saturday: 6
}, e.extend(e.expr[":"], {
focusable: function (t) {
var n = e.attr(t, "tabindex");
return k(t, !isNaN(n) && n > -1)
}
}), Z = ["mousedown", "mousemove", "mouseenter", "mouseleave", "mouseover", "mouseout", "mouseup", "click"], et = "label, input, [data-rel=external]", tt = {
setupMouseMute: function () {
var t, n = 0,
i = Z.length,
r = document.documentElement;
if (!tt.mouseTrap && mt.eventCapture)
for (tt.mouseTrap = !0, tt.bustClick = !1, tt.captureMouse = !1, t = function (t) {
tt.captureMouse && ("click" === t.type ? tt.bustClick && !e(t.target).is(et) && (t.preventDefault(), t.stopPropagation()) : t.stopPropagation())
}; i > n; n++) r.addEventListener(Z[n], t, !0)
},
muteMouse: function (e) {
tt.captureMouse = !0, e.data.bustClick && (tt.bustClick = !0), clearTimeout(tt.mouseTrapTimeoutID)
},
unMuteMouse: function () {
clearTimeout(tt.mouseTrapTimeoutID), tt.mouseTrapTimeoutID = setTimeout(function () {
tt.captureMouse = !1, tt.bustClick = !1
}, 400)
}
}, nt = {
down: "touchstart mousedown",
move: "mousemove touchmove",
up: "mouseup touchend touchcancel",
cancel: "mouseleave touchcancel"
}, mt.touch && (mt.mobileOS.ios || mt.mobileOS.android) && (nt = {
down: "touchstart",
move: "touchmove",
up: "touchend touchcancel",
cancel: "touchcancel"
}), mt.pointers && (nt = {
down: "MSPointerDown",
move: "MSPointerMove",
up: "MSPointerUp",
cancel: "MSPointerCancel MSPointerLeave"
}, e.each({
MSPointerEnter: "MSPointerOver",
MSPointerLeave: "MSPointerOut"
}, function (t, n) {
e.event.special[t] = {
delegateType: n,
bindType: n,
handle: function (t) {
var i, r = this,
o = t.relatedTarget,
a = t.handleObj;
return (!o || o !== r && !e.contains(r, o)) && (t.type = a.origType, i = a.handler.apply(this, arguments), t.type = n), i
}
}
})), it = function (e) {
return nt[e] || e
}, rt = /([^ ]+)/g, st.applyEventMap = function (e, t) {
return e = e.replace(rt, it), t && (e = e.replace(rt, "$1." + t)), e
}, ot = e.fn.on, lt(!0, T, e), T.fn = T.prototype = new e, T.fn.constructor = T, T.fn.init = function (t, n) {
return n && n instanceof e && !(n instanceof T) && (n = T(n)), e.fn.init.call(this, t, n, at)
}, T.fn.init.prototype = T.fn, at = T(document), lt(T.fn, {
handler: function (e) {
return this.data("handler", e), this
},
autoApplyNS: function (e) {
return this.data("kendoNS", e || st.guid()), this
},
on: function () {
var e, t, n, i, r, o, a = this,
s = a.data("kendoNS");
return 1 === arguments.length ? ot.call(a, arguments[0]) : (e = a, t = Dt.call(arguments), typeof t[t.length - 1] === St && t.pop(), n = t[t.length - 1], i = st.applyEventMap(t[0], s), mt.mouseAndTouchPresent && i.search(/mouse|click/) > -1 && this[0] !== document.documentElement && (tt.setupMouseMute(), r = 2 === t.length ? null : t[1], o = i.indexOf("click") > -1 && i.indexOf("touchend") > -1, ot.call(this, {
touchstart: tt.muteMouse,
touchend: tt.unMuteMouse
}, r, {
bustClick: o
})), typeof n === wt && (e = a.data("handler"), n = e[n], t[t.length - 1] = function (t) {
n.call(e, t)
}), t[0] = i, ot.apply(a, t), a)
},
kendoDestroy: function (e) {
return e = e || this.data("kendoNS"), e && this.off("." + e), this
}
}), st.jQuery = T, st.eventMap = nt
})(jQuery, eval), "undefined" == typeof kendo_module && (kendo_module = function () {}),
function (e) {
var t = window.kendo,
n = t.support,
i = window.location,
r = window.history,
o = 50,
a = /^#*/,
s = window.document,
l = t.Observable.extend({
start: function (e) {
var t = this;
if (e = e || {}, t.bind(["change"], e), !t._started) {
if (t._started = !0, t._pushStateRequested = !! e.pushState, t._pushState = n.pushState && t._pushStateRequested, t.root = e.root || "/", t._interval = 0, t._normalizeUrl()) return !0;
t.current = t._currentLocation(), t._listenToLocationChange()
}
},
stop: function () {
e(window).unbind(".kendo"), this.unbind("change"), clearInterval(this._interval), this._started = !1
},
change: function (e) {
this.bind("change", e)
},
navigate: function (e, t) {
var n = this;
return "#:back" === e ? (r.back(), undefined) : (e = e.replace(a, ""), n.current !== e && n.current !== decodeURIComponent(e) && (t || !n.trigger("change", {
url: e
})) && (n._pushState ? (r.pushState({}, s.title, n._makePushStateUrl(e)), n.current = e) : i.hash = n.current = e), undefined)
},
_normalizeUrl: function () {
var e, t = this,
o = t.root == i.pathname,
l = t._pushStateRequested && !n.pushState && !o,
d = t._pushState && o && i.hash;
return l ? (i.replace(t.root + "#" + t._stripRoot(i.pathname)), !0) : d ? (e = t._makePushStateUrl(i.hash.replace(a, "")), r.replaceState({}, s.title, e), !1) : !1
},
_listenToLocationChange: function () {
var t = this,
i = e.proxy(t._checkUrl, t);
this._pushState ? e(window).bind("popstate.kendo", i) : n.hashChange ? e(window).bind("hashchange.kendo", i) : t._interval = setInterval(i, o)
},
_checkUrl: function () {
var e = this,
t = e._currentLocation().replace(a, "");
if (e.current !== t && e.current !== decodeURIComponent(t)) return e.trigger("change", {
url: t
}) ? (r.back(), undefined) : (e.current = t, undefined)
},
_stripRoot: function (e) {
var t = this;
return 0 === e.indexOf(t.root) ? ("/" + e.substr(t.root.length)).replace(/\/\//g, "/") : e
},
_makePushStateUrl: function (e) {
var t = this;
return 0 !== e.indexOf(t.root) && (e = (t.root + e).replace(/\/\//g, "/")), i.protocol + "//" + i.host + e
},
_currentLocation: function () {
var e, t = this;
return t._pushState ? (e = i.pathname, i.search && (e += i.search), t._stripRoot(e)) : i.hash.replace(a, "")
}
});
t.history = new l
}(window.kendo.jQuery),
function () {
function e(e, t) {
return t ? e : "([^/]+)"
}
function t(t) {
return RegExp("^" + t.replace(u, "\\$&").replace(l, "(?:$1)?").replace(d, e).replace(c, "(.*?)") + "$")
}
var n = window.kendo,
i = n.history,
r = n.Observable,
o = "init",
a = "routeMissing",
s = "change",
l = /\((.*?)\)/g,
d = /(\(\?)?:\w+/g,
c = /\*\w+/g,
u = /[\-{}\[\]+?.,\\\^$|#\s]/g,
p = n.Class.extend({
init: function (e, n) {
e instanceof RegExp || (e = t(e)), this.route = e, this._callback = n
},
callback: function (e) {
for (var t = this.route.exec(e).slice(1), n = 0, i = t.length; i > n; n++) t[n] !== void 0 && (t[n] = decodeURIComponent(t[n]));
this._callback.apply(null, t)
},
worksWith: function (e) {
return this.route.test(e) ? (this.callback(e), !0) : !1
}
}),
f = r.extend({
init: function (e) {
r.fn.init.call(this), this.routes = [], this.bind([o, a, s], e)
},
destroy: function () {
i.unbind("change", this._urlChangedProxy), this.unbind()
},
start: function () {
var e, t = this,
n = function (e) {
t._urlChanged(e)
};
i.start({
change: n
}), e = {
url: i.current || "/"
}, t.trigger(o, e) || t._urlChanged(e), this._urlChangedProxy = n
},
route: function (e, t) {
this.routes.push(new p(e, t))
},
navigate: function (e, t) {
n.history.navigate(e, t)
},
_urlChanged: function (e) {
var t, n, i, r, o = e.url;
if (o || (o = "/"), this.trigger(s, {
url: e.url
})) return e.preventDefault(), void 0;
for (n = 0, i = this.routes, r = i.length; r > n; n++)
if (t = i[n], t.worksWith(o)) return;
this.trigger(a, {
url: o
}) && e.preventDefault()
}
});
n.Router = f
}(),
function (e) {
var t = window.kendo,
n = t.Observable,
i = "SCRIPT",
r = "init",
o = "show",
a = "hide",
s = n.extend({
init: function (e, t) {
var i = this;
t = t || {}, n.fn.init.call(i), i.content = e, i.tagName = t.tagName || "div", i.model = t.model, i._wrap = t.wrap !== !1, i.bind([r, o, a], t)
},
render: function (n) {
var i = this,
a = !i.element;
return a && (i.element = i._createElement()), n && e(n).append(i.element), a && (t.bind(i.element, i.model), this.trigger(r)), n && i.trigger(o), i.element
},
hide: function () {
this.element.detach(), this.trigger(a)
},
destroy: function () {
this.element && (t.unbind(this.element), this.element.remove())
},
_createElement: function () {
var t, n, r = this;
return n = e(document.getElementById(r.content) || r.content), t = e("<" + r.tagName + " />").append(n[0].tagName === i ? n.html() : n), r._wrap || (t = t.contents()), t
}
}),
l = s.extend({
init: function (e, t) {
s.fn.init.call(this, e, t), this.regions = {}
},
showIn: function (e, t) {
var n = this.regions[e];
n && n.hide(), t.render(this.render().find(e), n), this.regions[e] = t
}
});
t.Layout = l, t.View = s
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
return parseInt(e, 10)
}
function i(e, t) {
return n(e.css(t))
}
function r(e) {
var t = e.effects;
return "zoom" === t && (t = "zoom:in fade:in"), "fade" === t && (t = "fade:in"), "slide" === t && (t = "tile:left"), /^slide:(.+)$/.test(t) && (t = "tile:" + RegExp.$1), "overlay" === t && (t = "slideIn:left"), /^overlay:(.+)$/.test(t) && (t = "slideIn:" + RegExp.$1), e.effects = C.parseEffects(t), e
}
function o(e) {
var t, n = [];
for (t in e) n.push(t);
return n
}
function a(e) {
for (var t in e) - 1 != U.indexOf(t) && -1 == W.indexOf(t) && delete e[t];
return e
}
function s(e, t) {
var n, i, r, o, a = [],
s = {};
for (i in t) n = i.toLowerCase(), o = E && -1 != U.indexOf(n), !D.hasHW3D && o && -1 == W.indexOf(n) ? delete t[i] : (r = t[i], o ? a.push(i + "(" + r + ")") : s[i] = r);
return a.length && (s[at] = a.join(" ")), s
}
function l(e, t) {
var i, r, o;
return E ? (i = e.css(at), i == Q ? "scale" == t ? 1 : 0 : (r = i.match(RegExp(t + "\\s*\\(([\\d\\w\\.]+)")), o = 0, r ? o = n(r[1]) : (r = i.match(O) || [0, 0, 0, 0, 0], t = t.toLowerCase(), N.test(t) ? o = parseFloat(r[3] / r[2]) : "translatey" == t ? o = parseFloat(r[4] / r[2]) : "scale" == t ? o = parseFloat(r[2]) : "rotate" == t && (o = parseFloat(Math.atan2(r[2], r[1])))), o)) : parseFloat(e.css(t))
}
function d(e) {
return e.charAt(0).toUpperCase() + e.substring(1)
}
function c(e, t) {
var n = g.extend(t),
i = n.prototype.directions;
T[d(e)] = n, T.Element.prototype[e] = function (e, t, i, r) {
return new n(this.element, e, t, i, r)
}, S(i, function (t, i) {
T.Element.prototype[e + d(i)] = function (e, t, r) {
return new n(this.element, i, e, t, r)
}
})
}
function u(e, t, n) {
c(e, {
directions: v,
restore: [t],
startValue: function (e) {
return this._startValue = e, this
},
endValue: function (e) {
return this._endValue = e, this
},
shouldHide: function () {
return "out" === this._direction && this._end() === n ? !this._reverse : this._reverse
},
_end: function () {
return this._endValue || n
},
_start: function () {
return this._startValue || 1
},
prepare: function (e, n) {
var i = this,
r = i.element.data(t),
o = i.shouldHide(),
a = isNaN(r) || "" === r ? i._start() : r;
e[t] = n[t] = i._end(), o ? e[t] = a : n[t] = a
}
})
}
function p(e, t) {
var n = C.directions[t].vertical,
i = e[n ? J : X]() / 2 + "px";
return b[t].replace("$size", i)
}
var f, h, g, m, v, _, b, y, w, x, k, C = window.kendo,
T = C.effects,
S = e.each,
A = e.extend,
F = e.proxy,
D = C.support,
I = D.browser,
E = D.transforms,
P = D.transitions,
z = {
scale: 0,
scalex: 0,
scaley: 0,
scale3d: 0
}, H = {
translate: 0,
translatex: 0,
translatey: 0,
translate3d: 0
}, R = document.documentElement.style.zoom !== t && !E,
O = /matrix3?d?\s*\(.*,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?,\s*([\d\.\-]+)\w*?/i,
M = /^(-?[\d\.\-]+)?[\w\s]*,?\s*(-?[\d\.\-]+)?[\w\s]*/i,
N = /translatex?$/i,
B = /(zoom|fade|expand)(\w+)/,
L = /(zoom|fade|expand)/,
V = /[xy]$/i,
U = ["perspective", "rotate", "rotatex", "rotatey", "rotatez", "rotate3d", "scale", "scalex", "scaley", "scalez", "scale3d", "skew", "skewx", "skewy", "translate", "translatex", "translatey", "translatez", "translate3d", "matrix", "matrix3d"],
W = ["rotate", "scale", "scalex", "scaley", "skew", "skewx", "skewy", "translate", "translatex", "translatey", "matrix"],
j = {
rotate: "deg",
scale: "",
skew: "px",
translate: "px"
}, q = E.css,
G = Math.round,
$ = "",
Y = "px",
Q = "none",
K = "auto",
X = "width",
J = "height",
Z = "hidden",
et = "origin",
tt = "abortId",
nt = "overflow",
it = "translate",
rt = "completeCallback",
ot = q + "transition",
at = q + "transform",
st = q + "backface-visibility",
lt = q + "perspective",
dt = "1500px",
ct = "perspective(" + dt + ")",
ut = {
left: {
reverse: "right",
property: "left",
transition: "translatex",
vertical: !1,
modifier: -1
},
right: {
reverse: "left",
property: "left",
transition: "translatex",
vertical: !1,
modifier: 1
},
down: {
reverse: "up",
property: "top",
transition: "translatey",
vertical: !0,
modifier: 1
},
up: {
reverse: "down",
property: "top",
transition: "translatey",
vertical: !0,
modifier: -1
},
top: {
reverse: "bottom"
},
bottom: {
reverse: "top"
},
"in": {
reverse: "out",
modifier: -1
},
out: {
reverse: "in",
modifier: 1
},
vertical: {
reverse: "vertical"
},
horizontal: {
reverse: "horizontal"
}
};
C.directions = ut, A(e.fn, {
kendoStop: function (e, t) {
return P ? T.stopQueue(this, e || !1, t || !1) : this.stop(e, t)
}
}), E && !P && (S(W, function (n, i) {
e.fn[i] = function (n) {
if (n === t) return l(this, i);
var r = e(this)[0],
o = i + "(" + n + j[i.replace(V, "")] + ")";
return -1 == r.style.cssText.indexOf(at) ? e(this).css(at, o) : r.style.cssText = r.style.cssText.replace(RegExp(i + "\\(.*?\\)", "i"), o), this
}, e.fx.step[i] = function (t) {
e(t.elem)[i](t.now)
}
}), f = e.fx.prototype.cur, e.fx.prototype.cur = function () {
return -1 != W.indexOf(this.prop) ? parseFloat(e(this.elem)[this.prop]()) : f.apply(this, arguments)
}), C.toggleClass = function (e, t, n, i) {
return t && (t = t.split(" "), P && (n = A({
exclusive: "all",
duration: 400,
ease: "ease-out"
}, n), e.css(ot, n.exclusive + " " + n.duration + "ms " + n.ease), setTimeout(function () {
e.css(ot, "").css(J)
}, n.duration)), S(t, function (t, n) {
e.toggleClass(n, i)
})), e
}, C.parseEffects = function (e, t) {
var n = {};
return "string" == typeof e ? S(e.split(" "), function (e, i) {
var r = !L.test(i),
o = i.replace(B, function (e, t, n) {
return t + ":" + n.toLowerCase()
}),
a = o.split(":"),
s = a[1],
l = {};
a.length > 1 && (l.direction = t && r ? ut[s].reverse : s), n[a[0]] = l
}) : S(e, function (e) {
var i = this.direction;
i && t && !L.test(e) && (this.direction = ut[i].reverse), n[e] = this
}), n
}, P && A(T, {
transition: function (t, n, i) {
var r, a, l, d, c = 0,
u = t.data("keys") || [];
i = A({
duration: 200,
ease: "ease-out",
complete: null,
exclusive: "all"
}, i), l = !1, d = function () {
l || (l = !0, a && (clearTimeout(a), a = null), t.removeData(tt).dequeue().css(ot, "").css(ot), i.complete.call(t))
}, i.duration = e.fx ? e.fx.speeds[i.duration] || i.duration : i.duration, r = s(t, n), e.merge(u, o(r)), t.data("keys", e.unique(u)).height(), t.css(ot, i.exclusive + " " + i.duration + "ms " + i.ease).css(ot), t.css(r).css(at), P.event && (t.one(P.event, d), 0 !== i.duration && (c = 500)), a = setTimeout(d, i.duration + c), t.data(tt, a), t.data(rt, d)
},
stopQueue: function (e, t, n) {
var i, r = e.data("keys"),
o = !n && r,
a = e.data(rt);
return o && (i = C.getComputedStyles(e[0], r)), a && a(), o && e.css(i), e.removeData("keys").stop(t)
}
}), h = C.Class.extend({
init: function (e, t) {
var n = this;
n.element = e, n.effects = [], n.options = t, n.restore = []
},
run: function (t) {
var n, i, r, o, l, d, c, u = this,
p = t.length,
f = u.element,
h = u.options,
g = e.Deferred(),
m = {}, v = {};
for (u.effects = t, g.then(e.proxy(u, "complete")), f.data("animating", !0), i = 0; p > i; i++)
for (n = t[i], n.setReverse(h.reverse), n.setOptions(h), u.addRestoreProperties(n.restore), n.prepare(m, v), l = n.children(), r = 0, d = l.length; d > r; r++) l[r].duration(h.duration).run();
for (c in h.effects) A(v, h.effects[c].properties);
for (f.is(":visible") || A(m, {
display: f.data("olddisplay") || "block"
}), E && !h.reset && (o = f.data("targetTransform"), o && (m = A(o, m))), m = s(f, m), E && !P && (m = a(m)), f.css(m).css(at), i = 0; p > i; i++) t[i].setup();
return h.init && h.init(), f.data("targetTransform", v), T.animate(f, v, A({}, h, {
complete: g.resolve
})), g.promise()
},
stop: function () {
e(this.element).kendoStop(!0, !0)
},
addRestoreProperties: function (e) {
for (var t, n = this.element, i = 0, r = e.length; r > i; i++) t = e[i], this.restore.push(t), n.data(t) || n.data(t, n.css(t))
},
restoreCallback: function () {
var e, t, n, i = this.element;
for (e = 0, t = this.restore.length; t > e; e++) n = this.restore[e], i.css(n, i.data(n))
},
complete: function () {
var t = this,
n = 0,
i = t.element,
r = t.options,
o = t.effects,
a = o.length;
for (i.removeData("animating").dequeue(), r.hide && i.data("olddisplay", i.css("display")).hide(), this.restoreCallback(), R && !E && setTimeout(e.proxy(this, "restoreCallback"), 0); a > n; n++) o[n].teardown();
r.completeCallback && r.completeCallback(i)
}
}), T.promise = function (e, t) {
var n, i, r, o = [],
a = new h(e, t),
s = C.parseEffects(t.effects);
t.effects = s;
for (r in s) n = T[d(r)], n && (i = new n(e, s[r].direction), o.push(i));
o[0] ? a.run(o) : (e.is(":visible") || e.css({
display: e.data("olddisplay") || "block"
}).css("display"), t.init && t.init(), e.dequeue(), a.complete())
}, T.transitionPromise = function (e, t, n) {
return T.animateTo(e, t, n), e
}, A(T, {
animate: function (n, r, o) {
var s = o.transition !== !1;
delete o.transition, P && "transition" in T && s ? T.transition(n, r, o) : E ? n.animate(a(r), {
queue: !1,
show: !1,
hide: !1,
duration: o.duration,
complete: o.complete
}) : n.each(function () {
var n = e(this),
a = {};
S(U, function (e, o) {
var s, l, d, c, u, p, f, h = r ? r[o] + " " : null;
h && (l = r, o in z && r[o] !== t ? (s = h.match(M), E && A(l, {
scale: +s[0]
})) : o in H && r[o] !== t && (d = n.css("position"), c = "absolute" == d || "fixed" == d, n.data(it) || (c ? n.data(it, {
top: i(n, "top") || 0,
left: i(n, "left") || 0,
bottom: i(n, "bottom"),
right: i(n, "right")
}) : n.data(it, {
top: i(n, "marginTop") || 0,
left: i(n, "marginLeft") || 0
})), u = n.data(it), s = h.match(M), s && (p = o == it + "y" ? 0 : +s[1], f = o == it + "y" ? +s[1] : +s[2], c ? (isNaN(u.right) ? isNaN(p) || A(l, {
left: u.left + p
}) : isNaN(p) || A(l, {
right: u.right - p
}), isNaN(u.bottom) ? isNaN(f) || A(l, {
top: u.top + f
}) : isNaN(f) || A(l, {
bottom: u.bottom - f
})) : (isNaN(p) || A(l, {
marginLeft: u.left + p
}), isNaN(f) || A(l, {
marginTop: u.top + f
})))), !E && "scale" != o && o in l && delete l[o], l && A(a, l))
}), I.msie && delete a.scale, n.animate(a, {
queue: !1,
show: !1,
hide: !1,
duration: o.duration,
complete: o.complete
})
})
},
animateTo: function (t, n, i) {
function o(e) {
n[0].style.cssText = "", t[0].style.cssText = "", D.mobileOS.android || l.css(nt, s), i.completeCallback && i.completeCallback.call(t, e)
}
var a, s, l = t.parents().filter(n.parents()).first();
i = r(i), D.mobileOS.android || (s = l.css(nt), l.css(nt, "hidden")), e.each(i.effects, function (e, t) {
a = a || t.direction
}), i.complete = I.msie ? function () {
setTimeout(o, 0)
} : o, i.previous = i.reverse ? n : t, i.reset = !0, (i.reverse ? t : n).each(function () {
e(this).kendoAnimate(A(!0, {}, i)), i.complete = null, i.previous = null
})
}
}), g = C.Class.extend({
init: function (e, t) {
var n = this;
n.element = e, n._direction = t, n.options = {}, n._additionalEffects = [], n.restore || (n.restore = [])
},
reverse: function () {
return this._reverse = !0, this.run()
},
play: function () {
return this._reverse = !1, this.run()
},
add: function (e) {
return this._additionalEffects.push(e), this
},
direction: function (e) {
return this._direction = e, this
},
duration: function (e) {
return this._duration = e, this
},
compositeRun: function () {
var e = this,
t = new h(e.element, {
reverse: e._reverse,
duration: e._duration
}),
n = e._additionalEffects.concat([e]);
return t.run(n)
},
run: function () {
if (this._additionalEffects && this._additionalEffects[0]) return this.compositeRun();
var t, n, i = this,
r = i.element,
o = 0,
l = i.restore,
d = l.length,
c = e.Deferred(),
u = {}, p = {}, f = i.children(),
h = f.length;
for (c.then(e.proxy(i, "_complete")), r.data("animating", !0), o = 0; d > o; o++) t = l[o], r.data(t) || r.data(t, r.css(t));
for (o = 0; h > o; o++) f[o].duration(i._duration).run();
return i.prepare(u, p), r.is(":visible") || A(u, {
display: r.data("olddisplay") || "block"
}), E && (n = r.data("targetTransform"), n && (u = A(n, u))), u = s(r, u), E && !P && (u = a(u)), r.css(u).css(at), i.setup(), r.data("targetTransform", p), T.animate(r, p, {
duration: i._duration,
complete: c.resolve
}), c.promise()
},
stop: function () {
var t = 0,
n = this.children(),
i = n.length;
for (t = 0; i > t; t++) n[t].stop();
return e(this.element).kendoStop(!0, !0), this
},
restoreCallback: function () {
var e, t, n, i = this.element;
for (e = 0, t = this.restore.length; t > e; e++) n = this.restore[e], i.css(n, i.data(n))
},
_complete: function () {
var t = this,
n = t.element;
n.removeData("animating").dequeue(), t.restoreCallback(), t.shouldHide() && n.data("olddisplay", n.css("display")).hide(), R && !E && setTimeout(e.proxy(t, "restoreCallback"), 0), t.teardown()
},
setOptions: function (e) {
A(!0, this.options, e)
},
children: function () {
return []
},
shouldHide: e.noop,
setup: e.noop,
prepare: e.noop,
teardown: e.noop,
directions: [],
setReverse: function (e) {
return this._reverse = e, this
}
}), m = ["left", "right", "up", "down"], v = ["in", "out"], c("slideIn", {
directions: m,
prepare: function (e, t) {
var n, i = this,
r = i.element,
o = ut[i._direction],
a = -o.modifier * (o.vertical ? r.outerHeight() : r.outerWidth()),
s = a / (i.options && i.options.divisor || 1) + Y,
l = "0px";
i._reverse && (n = e, e = t, t = n), E ? (e[o.transition] = s, t[o.transition] = l) : (e[o.property] = s, t[o.property] = l)
}
}), c("tile", {
directions: m,
init: function (e, t, n) {
g.prototype.init.call(this, e, t), this.options = {
previous: n
}
},
children: function () {
var e = this,
t = e._reverse,
n = e.options.previous,
i = e._direction,
r = [C.fx(e.element).slideIn(i).setReverse(t)];
return n && r.push(C.fx(n).slideIn(ut[i].reverse).setReverse(!t)), r
}
}), u("fade", "opacity", 0), u("zoom", "scale", .01), c("slideMargin", {
prepare: function (e, t) {
var n, i = this,
r = i.element,
o = i.options,
a = r.data(et),
s = o.offset,
l = i._reverse;
l || null !== a || r.data(et, parseFloat(r.css("margin-" + o.axis))), n = r.data(et) || 0, t["margin-" + o.axis] = l ? n : n + s
}
}), c("slideTo", {
prepare: function (e, t) {
var n = this,
i = n.element,
r = n.options,
o = r.offset.split(","),
a = n._reverse;
E ? (t.translatex = a ? 0 : o[0], t.translatey = a ? 0 : o[1]) : (t.left = a ? 0 : o[0], t.top = a ? 0 : o[1]), i.css("left")
}
}), c("expand", {
directions: ["horizontal", "vertical"],
restore: [nt],
prepare: function (e, n) {
var i = this,
r = i.element,
o = i.options,
a = i._reverse,
s = "vertical" === i._direction ? J : X,
l = r[0].style[s],
d = r.data(s),
c = parseFloat(d || l),
u = G(r.css(s, K)[s]());
e.overflow = Z, c = o && o.reset ? u || c : c || u, n[s] = (a ? 0 : c) + Y, e[s] = (a ? c : 0) + Y, d === t && r.data(s, l)
},
shouldHide: function () {
return this._reverse
},
teardown: function () {
var e = this,
t = e.element,
n = "vertical" === e._direction ? J : X,
i = t.data(n);
(i == K || i === $) && setTimeout(function () {
t.css(n, K).css(n)
}, 0)
}
}), _ = {
position: "absolute",
marginLeft: 0,
marginTop: 0,
scale: 1
}, c("transfer", {
init: function (e, t) {
this.element = e, this.options = {
target: t
}, this.restore = []
},
setup: function () {
this.element.appendTo(document.body)
},
prepare: function (e, t) {
var n, i, r, o, a, s, d, c, u, p, f, h, g, m = this,
v = m.element,
b = m.options,
y = m._reverse,
w = b.target,
x = l(v, "scale"),
k = w.offset(),
C = w.outerHeight() / v.outerHeight();
A(e, _), t.scale = 1, v.css(at, "scale(1)").css(at), n = v.offset(), v.css(at, "scale(" + x + ")"), i = 0, r = 0, o = k.left - n.left, a = k.top - n.top, s = i + v.outerWidth(), d = r, c = o + w.outerWidth(), u = a, p = (a - r) / (o - i), f = (u - d) / (c - s), h = (r - d - p * i + f * s) / (f - p), g = r + p * (h - i), e.top = n.top, e.left = n.left, e.transformOrigin = h + Y + " " + g + Y, y ? e.scale = C : t.scale = C
}
}), b = {
top: "rect(auto auto $size auto)",
bottom: "rect($size auto auto auto)",
left: "rect(auto $size auto auto)",
right: "rect(auto auto auto $size)"
}, y = {
top: {
start: "rotatex(0deg)",
end: "rotatex(180deg)"
},
bottom: {
start: "rotatex(-180deg)",
end: "rotatex(0deg)"
},
left: {
start: "rotatey(0deg)",
end: "rotatey(-180deg)"
},
right: {
start: "rotatey(180deg)",
end: "rotatey(0deg)"
}
}, c("turningPage", {
directions: m,
init: function (e, t, n) {
g.prototype.init.call(this, e, t), this._container = n
},
prepare: function (e, t) {
var n = this,
i = n._reverse,
r = i ? ut[n._direction].reverse : n._direction,
o = y[r];
e.zIndex = 1, n._clipInHalf && (e.clip = p(n._container, C.directions[r].reverse)), e[st] = Z, t[at] = ct + (i ? o.start : o.end), e[at] = ct + (i ? o.end : o.start)
},
setup: function () {
this._container.append(this.element)
},
face: function (e) {
return this._face = e, this
},
shouldHide: function () {
var e = this,
t = e._reverse,
n = e._face;
return t && !n || !t && n
},
clipInHalf: function (e) {
return this._clipInHalf = e, this
},
temporary: function () {
return this.element.addClass("temp-page"), this
}
}), c("staticPage", {
directions: m,
init: function (e, t, n) {
g.prototype.init.call(this, e, t), this._container = n
},
restore: ["clip"],
prepare: function (e, t) {
var n = this,
i = n._reverse ? ut[n._direction].reverse : n._direction;
e.clip = p(n._container, i), e.opacity = .999, t.opacity = 1
},
shouldHide: function () {
var e = this,
t = e._reverse,
n = e._face;
return t && !n || !t && n
},
face: function (e) {
return this._face = e, this
}
}), c("pageturn", {
directions: ["horizontal", "vertical"],
init: function (e, t, n, i) {
g.prototype.init.call(this, e, t), this.options = {}, this.options.face = n, this.options.back = i
},
children: function () {
var e, t = this,
n = t.options,
i = "horizontal" === t._direction ? "left" : "top",
r = C.directions[i].reverse,
o = t._reverse,
a = n.face.clone(!0).removeAttr("id"),
s = n.back.clone(!0).removeAttr("id"),
l = t.element;
return o && (e = i, i = r, r = e), [C.fx(n.face).staticPage(i, l).face(!0).setReverse(o), C.fx(n.back).staticPage(r, l).setReverse(o), C.fx(a).turningPage(i, l).face(!0).clipInHalf(!0).temporary().setReverse(o), C.fx(s).turningPage(r, l).clipInHalf(!0).temporary().setReverse(o)]
},
prepare: function (e, t) {
e[lt] = dt, e.transformStyle = "preserve-3d", e.opacity = .999, t.opacity = 1
},
teardown: function () {
this.element.find(".temp-page").remove()
}
}), c("flip", {
directions: ["horizontal", "vertical"],
init: function (e, t, n, i) {
g.prototype.init.call(this, e, t), this.options = {}, this.options.face = n, this.options.back = i
},
children: function () {
var e, t = this,
n = t.options,
i = "horizontal" === t._direction ? "left" : "top",
r = C.directions[i].reverse,
o = t._reverse,
a = t.element;
return o && (e = i, i = r, r = e), [C.fx(n.face).turningPage(i, a).face(!0).setReverse(o), C.fx(n.back).turningPage(r, a).setReverse(o)]
},
prepare: function (e) {
e[lt] = dt, e.transformStyle = "preserve-3d"
}
}), w = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
setTimeout(e, 1e3 / 60)
}, x = C.Class.extend({
init: function () {
var e = this;
e._tickProxy = F(e._tick, e), e._started = !1
},
tick: e.noop,
done: e.noop,
onEnd: e.noop,
onCancel: e.noop,
start: function () {
this.done() || (this._started = !0, w(this._tickProxy))
},
cancel: function () {
this._started = !1, this.onCancel()
},
_tick: function () {
var e = this;
e._started && (e.tick(), e.done() ? (e._started = !1, e.onEnd()) : w(e._tickProxy))
}
}), k = x.extend({
init: function (e) {
var t = this;
A(t, e), x.fn.init.call(t)
},
done: function () {
return this.timePassed() >= this.duration
},
timePassed: function () {
return Math.min(this.duration, Date.now() - this.startDate)
},
moveTo: function (e) {
var t = this,
n = t.movable;
t.initial = n[t.axis], t.delta = e.location - t.initial, t.duration = e.duration || 300, t.tick = t._easeProxy(e.ease), t.startDate = Date.now(), t.start()
},
_easeProxy: function (e) {
var t = this;
return function () {
t.movable.moveAxis(t.axis, e(t.timePassed(), t.initial, t.delta, t.duration))
}
}
}), A(k, {
easeOutExpo: function (e, t, n, i) {
return e == i ? t + n : n * (-Math.pow(2, -10 * e / i) + 1) + t
},
easeOutBack: function (e, t, n, i, r) {
return r = 1.70158, n * ((e = e / i - 1) * e * ((r + 1) * e + r) + 1) + t
}
}), T.Animation = x, T.Transition = k, T.createEffect = c
}(window.kendo.jQuery),
function (e, t) {
function n(r) {
var a, s, l, d, c, u, p, f, j, h = [],
g = r.logic || "and",
m = r.filters;
for (a = 0, s = m.length; s > a; a++) r = m[a], l = r.field, p = r.value, u = r.operator, j = r.asis || false, r.filters ? r = n(r) : (f = r.ignoreCase, l = l.replace(/\./g, "/"), r = o[u], r && p !== t && (d = e.type(p), "string" === d ? (c = j === true?"{1}": "'{1}'", p = j === true?p : p.replace(/'/g, "''"), f === !0 && (l = "tolower(" + l + ")")) : c = "date" === d ? "datetime'{1:yyyy-MM-ddTHH:mm:ss}'" : "{1}", r.length > 3 ? "substringof" !== r ? c = "{0}({2}," + c + ")" : (c = "{0}(" + c + ",{2})", "doesnotcontain" === u && (c += " eq false")) : c = "{2} {0} " + c, r = i.format(c, r, p, l))), h.push(r);
return r = h.join(" " + g + " "), h.length > 1 && (r = "(" + r + ")"), r
}
var i = window.kendo,
r = e.extend,
o = {
eq: "eq",
neq: "ne",
gt: "gt",
gte: "ge",
lt: "lt",
lte: "le",
contains: "substringof",
doesnotcontain: "substringof",
endswith: "endswith",
startswith: "startswith"
}, a = {
pageSize: e.noop,
page: e.noop,
filter: function (e, t) {
t && (e.$filter = n(t))
},
sort: function (t, n) {
var i = e.map(n, function (e) {
var t = e.field.replace(/\./g, "/");
return "desc" === e.dir && (t += " desc"), t
}).join(",");
i && (t.$orderby = i)
},
skip: function (e, t) {
t && (e.$skip = t)
},
take: function (e, t) {
t && (e.$top = t)
}
}, s = {
read: {
dataType: "jsonp"
}
};
r(!0, i.data, {
schemas: {
odata: {
type: "json",
data: function (e) {
return e.d.results || [e.d]
},
total: "d.__count"
}
},
transports: {
odata: {
read: {
cache: !0,
dataType: "jsonp",
jsonp: "$callback"
},
update: {
cache: !0,
dataType: "json",
contentType: "application/json",
type: "PUT"
},
create: {
cache: !0,
dataType: "json",
contentType: "application/json",
type: "POST"
},
destroy: {
cache: !0,
dataType: "json",
type: "DELETE"
},
parameterMap: function (e, t) {
var n, r, o, l;
if (e = e || {}, t = t || "read", l = (this.options || s)[t], l = l ? l.dataType : "json", "read" === t) {
n = {
$inlinecount: "allpages"
}, "json" != l && (n.$format = "json");
for (o in e) a[o] ? a[o](n, e[o]) : n[o] = e[o]
} else {
if ("json" !== l) throw Error("Only json dataType can be used for " + t + " operation.");
if ("destroy" !== t) {
for (o in e) r = e[o], "number" == typeof r && (e[o] = r + "");
n = i.stringify(e)
}
}
return n
}
}
}
})
}(window.kendo.jQuery),
function (e, t) {
var n = window.kendo,
i = e.isArray,
r = e.isPlainObject,
o = e.map,
a = e.each,
s = e.extend,
l = n.getter,
d = n.Class,
c = d.extend({
init: function (e) {
var t, l, d, c = this,
u = e.total,
p = e.model,
f = e.parse,
h = e.errors,
g = e.data;
p && (r(p) && (p.fields && a(p.fields, function (e, t) {
t = r(t) && t.field ? s(t, {
field: c.getter(t.field)
}) : {
field: c.getter(t)
}, p.fields[e] = t
}), t = p.id, t && (l = {}, l[c.xpathToMember(t, !0)] = {
field: c.getter(t)
}, p.fields = s(l, p.fields), p.id = c.xpathToMember(t)), p = n.data.Model.define(p)), c.model = p), u && ("string" == typeof u ? (u = c.getter(u), c.total = function (e) {
return parseInt(u(e), 10)
}) : "function" == typeof u && (c.total = u)), h && ("string" == typeof h ? (h = c.getter(h), c.errors = function (e) {
return h(e) || null
}) : "function" == typeof h && (c.errors = h)), g && ("string" == typeof g ? (g = c.xpathToMember(g), c.data = function (e) {
var t, n = c.evaluate(e, g);
return n = i(n) ? n : [n], c.model && p.fields ? (t = new c.model, o(n, function (e) {
if (e) {
var n, i = {};
for (n in p.fields) i[n] = t._parse(n, p.fields[n].field(e));
return i
}
})) : n
}) : "function" == typeof g && (c.data = g)), "function" == typeof f && (d = c.parse, c.parse = function (e) {
var t = f.call(c, e);
return d.call(c, t)
})
},
total: function (e) {
return this.data(e).length
},
errors: function (e) {
return e ? e.errors : null
},
parseDOM: function (e) {
var n, r, o, a, s, l, d, c = {}, u = e.attributes,
p = u.length;
for (d = 0; p > d; d++) l = u[d], c["@" + l.nodeName] = l.nodeValue;
for (r = e.firstChild; r; r = r.nextSibling) o = r.nodeType, 3 === o || 4 === o ? c["#text"] = r.nodeValue : 1 === o && (n = this.parseDOM(r), a = r.nodeName, s = c[a], i(s) ? s.push(n) : s = s !== t ? [s, n] : n, c[a] = s);
return c
},
evaluate: function (e, t) {
for (var n, r, o, a, s, l = t.split("."); n = l.shift();)
if (e = e[n], i(e)) {
for (r = [], t = l.join("."), s = 0, o = e.length; o > s; s++) a = this.evaluate(e[s], t), a = i(a) ? a : [a], r.push.apply(r, a);
return r
}
return e
},
parse: function (t) {
var n, i, r = {};
return n = t.documentElement || e.parseXML(t).documentElement, i = this.parseDOM(n), r[n.nodeName] = i, r
},
xpathToMember: function (e, t) {
return e ? (e = e.replace(/^\//, "").replace(/\//g, "."), e.indexOf("@") >= 0 ? e.replace(/\.?(@.*)/, t ? "$1" : '["$1"]') : e.indexOf("text()") >= 0 ? e.replace(/(\.?text\(\))/, t ? "#text" : '["#text"]') : e) : ""
},
getter: function (e) {
return l(this.xpathToMember(e), !0)
}
});
e.extend(!0, n.data, {
XmlDataReader: c,
readers: {
xml: c
}
})
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n, i) {
return function (r) {
var o, a = {};
for (o in r) a[o] = r[o];
a.field = i ? n + "." + r.field : n, e.trigger(t, a)
}
}
function i(t, n) {
if (t === n) return !0;
var r, o = e.type(t),
a = e.type(n);
if (o !== a) return !1;
if ("date" === o) return t.getTime() === n.getTime();
if ("object" !== o && "array" !== o) return !1;
for (r in t)
if (!i(t[r], n[r])) return !1;
return !0
}
function r(e, t) {
var n, i;
for (i in e) {
if (n = e[i], Y(n) && n.field && n.field === t) return n;
if (n === t) return n
}
return null
}
function o(e) {
this.data = e || []
}
function a(e, n) {
if (e) {
var i = typeof e === rt ? {
field: e,
dir: n
} : e,
r = K(i) ? i : i !== t ? [i] : [];
return X(r, function (e) {
return !!e.dir
})
}
}
function s(e) {
var t, n, i, r, o = e.filters;
if (o)
for (t = 0, n = o.length; n > t; t++) i = o[t], r = i.operator, r && typeof r === rt && (i.operator = R[r.toLowerCase()] || r), s(i)
}
function l(e) {
return e && !Q(e) ? ((K(e) || !e.filters) && (e = {
logic: "and",
filters: K(e) ? e : [e]
}), s(e), e) : t
}
function d(e) {
return K(e) ? e : [e]
}
function c(e, n) {
var i = typeof e === rt ? {
field: e,
dir: n
} : e,
r = K(i) ? i : i !== t ? [i] : [];
return E(r, function (e) {
return {
field: e.field,
dir: e.dir || "asc",
aggregates: e.aggregates
}
})
}
function u(e, t) {
return e && e.getTime && t && t.getTime ? e.getTime() === t.getTime() : e === t
}
function p(e, t, n, i, r) {
var o, a, s, l, d;
for (t = t || [], l = t.length, o = 0; l > o; o++) a = t[o], s = a.aggregate, d = a.field, e[d] = e[d] || {}, e[d][s] = O[s.toLowerCase()](e[d][s], n, tt.accessor(d), i, r)
}
function f(e) {
var t, n = e.length,
i = Array(n);
for (t = 0; n > t; t++) i[t] = e[t].toJSON();
return i
}
function h(e, t) {
t = t || {};
var n = new o(e),
i = t.aggregate,
r = t.filter;
return r && (n = n.filter(r)), n.aggregate(i)
}
function g(e, t, n) {
var i, r, o, a;
for (o = 0, a = e.length; a > o; o++) {
i = e[o];
for (r in t) i[r] = n._parse(r, t[r](i))
}
}
function m(e, t, n) {
var i, r, o;
for (r = 0, o = e.length; o > r; r++) i = e[r], i.value = n._parse(i.field, i.value), i.hasSubgroups ? m(i.items, t, n) : g(i.items, t, n)
}
function v(e, t, n, i) {
return function (r) {
return r = e(r), r && !Q(i) && ("[object Array]" === Dt.call(r) || r instanceof Ht || (r = [r]), n(r, i, new t)), r || []
}
}
function _(e, t, n, i) {
for (var r, o, a = 0; t.length && i && (r = t[a], o = r.items, e && e.field === r.field && e.value === r.value ? (e.hasSubgroups && e.items.length ? _(e.items[e.items.length - 1], r.items, n, i) : (o = o.slice(n, i), i -= o.length, e.items = e.items.concat(o)), t.splice(a--, 1)) : (o = o.slice(n, i), i -= o.length, r.items = o, r.items.length || t.splice(a--, 1)), n = 0, !(++a >= t.length)););
}
function b(e) {
var t, n, i = [];
for (t = 0, n = e.length; n > t; t++) i = e[t].hasSubgroups ? i.concat(b(e[t].items)) : i.concat(e[t].items.slice());
return i
}
function y(e, t) {
var n, i, r, o;
if (t)
for (n = 0, i = e.length; i > n; n++) r = e[n], o = r.items, r.hasSubgroups ? y(o, t) : !o.length || o[0] instanceof t || (o.type = t, o.wrapAll(o, o))
}
function w(e, t) {
var n, i;
for (n = 0, i = e.length; i > n; n++)
if (e[n].hasSubgroups) {
if (w(e[n].items, t)) return !0
} else if (t(e[n].items, e[n])) return !0
}
function x(e, t) {
var n, i;
for (n = 0, i = e.length; i > n; n++)
if (e[n].uid == t.uid) return t = e[n], e.splice(n, 1), t
}
function k(e, t) {
var n, i, r, o;
for (r = e.length - 1, o = 0; r >= o; r--) i = e[r], n = {
value: t.get(i.field),
field: i.field,
items: n ? [n] : [t],
hasSubgroups: !! n,
aggregates: {}
};
return n
}
function C(e, t) {
return t ? S(e, function (e) {
return e[t.idField] === t.id
}) : -1
}
function T(e, t) {
return t ? S(e, function (e) {
return e.uid == t.uid
}) : -1
}
function S(e, t) {
var n, i;
for (n = 0, i = e.length; i > n; n++)
if (t(e[n])) return n;
return -1
}
function A(t, n) {
var i, r, o, a, s, l = e(t)[0].children,
d = [],
c = n[0],
u = n[1];
for (i = 0, r = l.length; r > i; i++) o = {}, s = l[i], s.disabled || (o[c.field] = s.text, a = s.attributes.value, a = a && a.specified ? s.value : s.text, o[u.field] = a, d.push(o));
return d
}
function F(t, n) {
var i, r, o, a, s, l, d, c = e(t)[0].tBodies[0],
u = c ? c.rows : [],
p = n.length,
f = [];
for (i = 0, r = u.length; r > i; i++) {
for (s = {}, d = !0, a = u[i].cells, o = 0; p > o; o++) l = a[o], "th" !== l.nodeName.toLowerCase() && (d = !1, s[n[o].field] = l.innerHTML);
d || f.push(s)
}
return f
}
function D(e) {
return function () {
var t = this._data,
n = V.fn[e].apply(this, At.call(arguments));
return this._data != t && this._attachBubbleHandlers(), n
}
}
function I(t, n) {
var i, r, o, a, s, l, d, c, u = e(t).children(),
p = [],
f = n[0].field,
h = n[1] && n[1].field,
g = n[2] && n[2].field,
m = n[3] && n[3].field;
for (i = 0, r = u.length; r > i; i++) o = {
_loaded: !0
}, a = u.eq(i), l = a[0].firstChild, c = a.children(), t = c.filter("ul"), c = c.filter(":not(ul)"), s = a.attr("data-id"), s && (o.id = s), l && (o[f] = 3 == l.nodeType ? l.nodeValue : c.text()), h && (o[h] = c.find("a").attr("href")), m && (o[m] = c.find("img").attr("src")), g && (d = c.find(".k-sprite").prop("className"), o[g] = d && e.trim(d.replace("k-sprite", ""))), t.length && (o.items = I(t.eq(0), n)), "true" == a.attr("data-hasChildren") && (o.hasChildren = !0), p.push(o);
return p
}
var E, P, z, H, R, O, M, N, B, L, V, U, W, j, q = e.extend,
G = e.proxy,
$ = e.isFunction,
Y = e.isPlainObject,
Q = e.isEmptyObject,
K = e.isArray,
X = e.grep,
J = e.ajax,
Z = e.each,
et = e.noop,
tt = window.kendo,
nt = tt.Observable,
it = tt.Class,
rt = "string",
ot = "function",
at = "create",
st = "read",
lt = "update",
dt = "destroy",
ct = "change",
ut = "sync",
pt = "get",
ft = "error",
ht = "requestStart",
gt = "progress",
mt = "requestEnd",
vt = [at, st, lt, dt],
_t = function (e) {
return e
}, bt = tt.getter,
yt = tt.stringify,
wt = Math,
xt = [].push,
kt = [].join,
Ct = [].pop,
Tt = [].splice,
St = [].shift,
At = [].slice,
Ft = [].unshift,
Dt = {}.toString,
It = tt.support.stableSort,
Et = /^\/Date\((.*?)\)\/$/,
Pt = /(\r+|\n+)/g,
zt = /(?=['\\])/g,
Ht = nt.extend({
init: function (e, t) {
var n = this;
n.type = t || Rt, nt.fn.init.call(n), n.length = e.length, n.wrapAll(e, n)
},
toJSON: function () {
var e, t, n = this.length,
i = Array(n);
for (e = 0; n > e; e++) t = this[e], t instanceof Rt && (t = t.toJSON()), i[e] = t;
return i
},
parent: et,
wrapAll: function (e, t) {
var n, i, r = this,
o = function () {
return r
};
for (t = t || [], n = 0, i = e.length; i > n; n++) t[n] = r.wrap(e[n], o);
return t
},
wrap: function (e, t) {
var n, i = this;
return null !== e && "[object Object]" === Dt.call(e) && (n = e instanceof i.type || e instanceof Nt, n || (e = e instanceof Rt ? e.toJSON() : e, e = new i.type(e)), e.parent = t, e.bind(ct, function (e) {
i.trigger(ct, {
field: e.field,
node: e.node,
index: e.index,
items: e.items || [this],
action: e.node ? e.action || "itemchange" : "itemchange"
})
})), e
},
push: function () {
var e, t = this.length,
n = this.wrapAll(arguments);
return e = xt.apply(this, n), this.trigger(ct, {
action: "add",
index: t,
items: n
}), e
},
slice: At,
join: kt,
pop: function () {
var e = this.length,
t = Ct.apply(this);
return e && this.trigger(ct, {
action: "remove",
index: e - 1,
items: [t]
}), t
},
splice: function (e, t, n) {
var i, r, o, a = this.wrapAll(At.call(arguments, 2));
if (i = Tt.apply(this, [e, t].concat(a)), i.length)
for (this.trigger(ct, {
action: "remove",
index: e,
items: i
}), r = 0, o = i.length; o > r; r++) i[r].children && i[r].unbind(ct);
return n && this.trigger(ct, {
action: "add",
index: e,
items: a
}), i
},
shift: function () {
var e = this.length,
t = St.apply(this);
return e && this.trigger(ct, {
action: "remove",
index: 0,
items: [t]
}), t
},
unshift: function () {
var e, t = this.wrapAll(arguments);
return e = Ft.apply(this, t), this.trigger(ct, {
action: "add",
index: 0,
items: t
}), e
},
indexOf: function (e) {
var t, n, i = this;
for (t = 0, n = i.length; n > t; t++)
if (i[t] === e) return t;
return -1
},
forEach: function (e) {
for (var t = 0, n = this.length; n > t; t++) e(this[t], t, this)
},
map: function (e) {
for (var t = 0, n = [], i = this.length; i > t; t++) n[t] = e(this[t], t, this);
return n
},
filter: function (e) {
for (var t, n = 0, i = [], r = this.length; r > n; n++) t = this[n], e(t, n, this) && (i[i.length] = t);
return i
},
find: function (e) {
for (var t, n = 0, i = this.length; i > n; n++)
if (t = this[n], e(t, n, this)) return t
},
every: function (e) {
for (var t, n = 0, i = this.length; i > n; n++)
if (t = this[n], !e(t, n, this)) return !1;
return !0
},
some: function (e) {
for (var t, n = 0, i = this.length; i > n; n++)
if (t = this[n], e(t, n, this)) return !0;
return !1
},
remove: function (e) {
this.splice(this.indexOf(e), 1)
}
}),
Rt = nt.extend({
init: function (e) {
var t, n, i = this,
r = function () {
return i
};
nt.fn.init.call(this);
for (n in e) t = e[n], "_" != n.charAt(0) && (t = i.wrap(t, n, r)), i[n] = t;
i.uid = tt.guid()
},
shouldSerialize: function (e) {
return this.hasOwnProperty(e) && "_events" !== e && typeof this[e] !== ot && "uid" !== e
},
forEach: function (e) {
for (var t in this) this.shouldSerialize(t) && e(this[t], t)
},
toJSON: function () {
var e, t, n = {};
for (t in this) this.shouldSerialize(t) && (e = this[t], (e instanceof Rt || e instanceof Ht) && (e = e.toJSON()), n[t] = e);
return n
},
get: function (e) {
var t, n = this;
return n.trigger(pt, {
field: e
}), t = "this" === e ? n : tt.getter(e, !0)(n)
},
_set: function (e, n) {
var i, r, o, a = this;
if (e.indexOf("."))
for (i = e.split("."), r = ""; i.length > 1;) {
if (r += i.shift(), o = tt.getter(r, !0)(a), o instanceof Rt) return o.set(i.join("."), n), t;
r += "."
}
tt.setter(e)(a, n)
},
set: function (e, t) {
var n = this,
i = tt.getter(e, !0)(n);
i !== t && (n.trigger("set", {
field: e,
value: t
}) || (n._set(e, n.wrap(t, e, function () {
return n
})), n.trigger(ct, {
field: e
})))
},
parent: et,
wrap: function (e, t, i) {
var r, o, a = this,
s = Dt.call(e);
return null == e || "[object Object]" !== s && "[object Array]" !== s || (r = e instanceof Ht, o = e instanceof V, "[object Object]" !== s || o || r ? ("[object Array]" === s || r || o) && (r || o || (e = new Ht(e)), e.parent() != i() && e.bind(ct, n(a, ct, t, !1))) : (e instanceof Rt || (e = new Rt(e)), e.parent() != i() && (e.bind(pt, n(a, pt, t, !0)), e.bind(ct, n(a, ct, t, !0)))), e.parent = i), e
}
}),
Ot = {
number: function (e) {
return tt.parseFloat(e)
},
date: function (e) {
return tt.parseDate(e)
},
"boolean": function (e) {
return typeof e === rt ? "true" === e.toLowerCase() : null != e ? !! e : e
},
string: function (e) {
return null != e ? e + "" : e
},
"default": function (e) {
return e
}
}, Mt = {
string: "",
number: 0,
date: new Date,
"boolean": !1,
"default": ""
}, Nt = Rt.extend({
init: function (n) {
var i = this;
(!n || e.isEmptyObject(n)) && (n = e.extend({}, i.defaults, n)), Rt.fn.init.call(i, n), i.dirty = !1, i.idField && (i.id = i.get(i.idField), i.id === t && (i.id = i._defaultId))
},
shouldSerialize: function (e) {
return Rt.fn.shouldSerialize.call(this, e) && "uid" !== e && !("id" !== this.idField && "id" === e) && "dirty" !== e && "_accessors" !== e
},
_parse: function (e, t) {
var n, i = this,
o = e,
a = i.fields || {};
return e = a[e], e || (e = r(a, o)), e && (n = e.parse, !n && e.type && (n = Ot[e.type.toLowerCase()])), n ? n(t) : t
},
editable: function (e) {
return e = (this.fields || {})[e], e ? e.editable !== !1 : !0
},
set: function (e, t, n) {
var r = this;
r.editable(e) && (t = r._parse(e, t), i(t, r.get(e)) || (r.dirty = !0, Rt.fn.set.call(r, e, t, n)))
},
accept: function (e) {
var t, n = this,
i = function () {
return n
};
for (t in e) n._set(t, n.wrap(e[t], t, i));
n.idField && (n.id = n.get(n.idField)), n.dirty = !1
},
isNew: function () {
return this.id === this._defaultId
}
});
Nt.define = function (e, n) {
n === t && (n = e, e = Nt);
var i, r, o, a, s, l, d, c = q({
defaults: {}
}, n),
u = {}, p = c.id;
if (p && (c.idField = p), c.id && delete c.id, p && (c.defaults[p] = c._defaultId = ""), "[object Array]" === Dt.call(c.fields)) {
for (l = 0, d = c.fields.length; d > l; l++) o = c.fields[l], typeof o === rt ? u[o] = {} : o.field && (u[o.field] = o);
c.fields = u
}
for (r in c.fields) o = c.fields[r], a = o.type || "default", s = null, r = typeof o.field === rt ? o.field : r, o.nullable || (s = c.defaults[r] = o.defaultValue !== t ? o.defaultValue : Mt[a.toLowerCase()]), n.id === r && (c._defaultId = s), c.defaults[r] = s, o.parse = o.parse || Ot[a];
return i = e.extend(c), i.define = function (e) {
return Nt.define(i, e)
}, c.fields && (i.fields = c.fields, i.idField = c.idField), i
}, P = {
selector: function (e) {
return $(e) ? e : bt(e)
},
asc: function (e) {
var t = this.selector(e);
return function (e, n) {
return e = t(e), n = t(n), null == e && null == n ? 0 : null == e ? -1 : null == n ? 1 : e > n ? 1 : n > e ? -1 : 0
}
},
desc: function (e) {
var t = this.selector(e);
return function (e, n) {
return e = t(e), n = t(n), null == e && null == n ? 0 : null == n ? -1 : null == e ? 1 : n > e ? 1 : e > n ? -1 : 0
}
},
create: function (e) {
return this[e.dir.toLowerCase()](e.field)
},
combine: function (e) {
return function (t, n) {
var i, r, o = e[0](t, n);
for (i = 1, r = e.length; r > i; i++) o = o || e[i](t, n);
return o
}
}
}, z = q({}, P, {
asc: function (e) {
var t = this.selector(e);
return function (e, n) {
var i = t(e),
r = t(n);
return i && i.getTime && r && r.getTime && (i = i.getTime(), r = r.getTime()), i === r ? e.__position - n.__position : null == i ? -1 : null == r ? 1 : i > r ? 1 : r > i ? -1 : e.__position - n.__position
}
},
desc: function (e) {
var t = this.selector(e);
return function (e, n) {
var i = t(e),
r = t(n);
return i && i.getTime && r && r.getTime && (i = i.getTime(), r = r.getTime()), i === r ? e.__position - n.__position : null == i ? 1 : null == r ? -1 : r > i ? 1 : i > r ? -1 : e.__position - n.__position
}
}
}), E = function (e, t) {
var n, i = e.length,
r = Array(i);
for (n = 0; i > n; n++) r[n] = t(e[n], n, e);
return r
}, H = function () {
function e(e) {
return e.replace(zt, "\\").replace(Pt, "")
}
function t(t, n, i, r) {
var o;
return null != i && (typeof i === rt && (i = e(i), o = Et.exec(i), o ? i = new Date(+o[1]) : r ? (i = "'" + i.toLowerCase() + "'", n = "(" + n + " || '').toLowerCase()") : i = "'" + i + "'"), i.getTime && (n = "(" + n + "?" + n + ".getTime():" + n + ")", i = i.getTime())), n + " " + t + " " + i
}
return {
eq: function (e, n, i) {
return t("==", e, n, i)
},
neq: function (e, n, i) {
return t("!=", e, n, i)
},
gt: function (e, n, i) {
return t(">", e, n, i)
},
gte: function (e, n, i) {
return t(">=", e, n, i)
},
lt: function (e, n, i) {
return t("<", e, n, i)
},
lte: function (e, n, i) {
return t("<=", e, n, i)
},
startswith: function (t, n, i) {
return i && (t = "(" + t + " || '').toLowerCase()", n && (n = n.toLowerCase())), n && (n = e(n)), t + ".lastIndexOf('" + n + "', 0) == 0"
},
endswith: function (t, n, i) {
return i && (t = "(" + t + " || '').toLowerCase()", n && (n = n.toLowerCase())), n && (n = e(n)), t + ".indexOf('" + n + "', " + t + ".length - " + (n || "").length + ") >= 0"
},
contains: function (t, n, i) {
return i && (t = "(" + t + " || '').toLowerCase()", n && (n = n.toLowerCase())), n && (n = e(n)), t + ".indexOf('" + n + "') >= 0"
},
doesnotcontain: function (t, n, i) {
return i && (t = "(" + t + " || '').toLowerCase()", n && (n = n.toLowerCase())), n && (n = e(n)), t + ".indexOf('" + n + "') == -1"
}
}
}(), o.filterExpr = function (e) {
var n, i, r, a, s, l, d = [],
c = {
and: " && ",
or: " || "
}, u = [],
p = [],
f = e.filters;
for (n = 0, i = f.length; i > n; n++) r = f[n], s = r.field, l = r.operator, r.filters ? (a = o.filterExpr(r), r = a.expression.replace(/__o\[(\d+)\]/g, function (e, t) {
return t = +t, "__o[" + (p.length + t) + "]"
}).replace(/__f\[(\d+)\]/g, function (e, t) {
return t = +t, "__f[" + (u.length + t) + "]"
}), p.push.apply(p, a.operators), u.push.apply(u, a.fields)) : (typeof s === ot ? (a = "__f[" + u.length + "](d)", u.push(s)) : a = tt.expr(s), typeof l === ot ? (r = "__o[" + p.length + "](" + a + ", " + r.value + ")", p.push(l)) : r = H[(l || "eq").toLowerCase()](a, r.value, r.ignoreCase !== t ? r.ignoreCase : !0)), d.push(r);
return {
expression: "(" + d.join(c[e.logic]) + ")",
fields: u,
operators: p
}
}, R = {
"==": "eq",
equals: "eq",
isequalto: "eq",
equalto: "eq",
equal: "eq",
"!=": "neq",
ne: "neq",
notequals: "neq",
isnotequalto: "neq",
notequalto: "neq",
notequal: "neq",
"<": "lt",
islessthan: "lt",
lessthan: "lt",
less: "lt",
"<=": "lte",
le: "lte",
islessthanorequalto: "lte",
lessthanequal: "lte",
">": "gt",
isgreaterthan: "gt",
greaterthan: "gt",
greater: "gt",
">=": "gte",
isgreaterthanorequalto: "gte",
greaterthanequal: "gte",
ge: "gte",
notsubstringof: "doesnotcontain"
}, o.normalizeFilter = l, o.prototype = {
toArray: function () {
return this.data
},
range: function (e, t) {
return new o(this.data.slice(e, e + t))
},
skip: function (e) {
return new o(this.data.slice(e))
},
take: function (e) {
return new o(this.data.slice(0, e))
},
select: function (e) {
return new o(E(this.data, e))
},
orderBy: function (e) {
var t = this.data.slice(0),
n = $(e) || !e ? P.asc(e) : e.compare;
return new o(t.sort(n))
},
orderByDescending: function (e) {
return new o(this.data.slice(0).sort(P.desc(e)))
},
sort: function (e, t, n) {
var i, r, o = a(e, t),
s = [];
if (n = n || P, o.length) {
for (i = 0, r = o.length; r > i; i++) s.push(n.create(o[i]));
return this.orderBy({
compare: n.combine(s)
})
}
return this
},
filter: function (e) {
var t, n, i, r, a, s, d, c, u = this.data,
p = [];
if (e = l(e), !e || 0 === e.filters.length) return this;
for (r = o.filterExpr(e), s = r.fields, d = r.operators, a = c = Function("d, __f, __o", "return " + r.expression), (s.length || d.length) && (c = function (e) {
return a(e, s, d)
}), t = 0, i = u.length; i > t; t++) n = u[t], c(n) && p.push(n);
return new o(p)
},
group: function (e, t) {
e = c(e || []), t = t || this.data;
var n, i = this,
r = new o(i.data);
return e.length > 0 && (n = e[0], r = r.groupBy(n).select(function (i) {
var r = new o(t).filter([{
field: i.field,
operator: "eq",
value: i.value
}]);
return {
field: i.field,
value: i.value,
items: e.length > 1 ? new o(i.items).group(e.slice(1), r.toArray()).toArray() : i.items,
hasSubgroups: e.length > 1,
aggregates: r.aggregate(n.aggregates)
}
})), r
},
groupBy: function (e) {
if (Q(e) || !this.data.length) return new o([]);
var t, n, i, r, a = e.field,
s = this._sortForGrouping(a, e.dir || "asc"),
l = tt.accessor(a),
d = l.get(s[0], a),
c = {
field: a,
value: d,
items: []
}, p = [c];
for (i = 0, r = s.length; r > i; i++) t = s[i], n = l.get(t, a), u(d, n) || (d = n, c = {
field: a,
value: d,
items: []
}, p.push(c)), c.items.push(t);
return new o(p)
},
_sortForGrouping: function (e, t) {
var n, i, r = this.data;
if (!It) {
for (n = 0, i = r.length; i > n; n++) r[n].__position = n;
for (r = new o(r).sort(e, t, z).toArray(), n = 0, i = r.length; i > n; n++) delete r[n].__position;
return r
}
return this.sort(e, t).toArray()
},
aggregate: function (e) {
var t, n, i = {};
if (e && e.length)
for (t = 0, n = this.data.length; n > t; t++) p(i, e, this.data[t], t, n);
return i
}
}, O = {
sum: function (e, t, n) {
return (e || 0) + n.get(t)
},
count: function (e) {
return (e || 0) + 1
},
average: function (e, t, n, i, r) {
return e = (e || 0) + n.get(t), i == r - 1 && (e /= r), e
},
max: function (e, t, n) {
var i = n.get(t);
return e = e || 0, i > e && (e = i), e
},
min: function (e, t, n) {
var i = n.get(t);
return e = e || i, e > i && (e = i), e
}
}, o.process = function (e, n) {
n = n || {};
var i, r = new o(e),
s = n.group,
l = c(s || []).concat(a(n.sort || [])),
d = n.filter,
u = n.skip,
p = n.take;
return d && (r = r.filter(d), i = r.toArray().length), l && (r = r.sort(l), s && (e = r.toArray())), u !== t && p !== t && (r = r.range(u, p)), s && (r = r.group(s, e)), {
total: i,
data: r.toArray()
}
}, M = it.extend({
init: function (e) {
this.data = e.data
},
read: function (e) {
e.success(this.data)
},
update: function (e) {
e.success(e.data)
},
create: function (e) {
e.success(e.data)
},
destroy: function (e) {
e.success(e.data)
}
}), N = it.extend({
init: function (e) {
var t, n = this;
e = n.options = q({}, n.options, e), Z(vt, function (t, n) {
typeof e[n] === rt && (e[n] = {
url: e[n]
})
}), n.cache = e.cache ? B.create(e.cache) : {
find: et,
add: et
}, t = e.parameterMap, n.parameterMap = $(t) ? t : function (e) {
var n = {};
return Z(e, function (e, i) {
e in t && (e = t[e], Y(e) && (i = e.value(i), e = e.key)), n[e] = i
}), n
}
},
options: {
parameterMap: _t
},
create: function (e) {
return J(this.setup(e, at))
},
read: function (n) {
var i, r, o, a = this,
s = a.cache;
n = a.setup(n, st), i = n.success || et, r = n.error || et, o = s.find(n.data), o !== t ? i(o) : (n.success = function (e) {
s.add(n.data, e), i(e)
}, e.ajax(n))
},
update: function (e) {
return J(this.setup(e, lt))
},
destroy: function (e) {
return J(this.setup(e, dt))
},
setup: function (e, t) {
e = e || {};
var n, i = this,
r = i.options[t],
o = $(r.data) ? r.data(e.data) : r.data;
return e = q(!0, {}, r, e), n = q(!0, {}, o, e.data), e.data = i.parameterMap(n, t), $(e.url) && (e.url = e.url(n)), e
}
}), B = it.extend({
init: function () {
this._store = {}
},
add: function (e, n) {
e !== t && (this._store[yt(e)] = n)
},
find: function (e) {
return this._store[yt(e)]
},
clear: function () {
this._store = {}
},
remove: function (e) {
delete this._store[yt(e)]
}
}), B.create = function (e) {
var t = {
inmemory: function () {
return new B
}
};
return Y(e) && $(e.find) ? e : e === !0 ? new B : t[e]()
}, L = it.extend({
init: function (e) {
var t, n, i, r, o, a, s, l = this;
e = e || {};
for (t in e) n = e[t], l[t] = typeof n === rt ? bt(n) : n;
r = e.modelBase || Nt, Y(l.model) && (l.model = i = r.define(l.model)), l.model && (o = G(l.data, l), a = G(l.groups, l), s = {}, i = l.model, i.fields && Z(i.fields, function (e, t) {
Y(t) && t.field ? s[t.field] = bt(t.field) : s[e] = bt(e)
}), l.data = v(o, i, g, s), l.groups = v(a, i, m, s))
},
errors: function (e) {
return e ? e.errors : null
},
parse: _t,
data: _t,
total: function (e) {
return e.length
},
groups: _t,
status: function (e) {
return e.status
},
aggregates: function () {
return {}
}
}), V = nt.extend({
init: function (e) {
var n, i, r = this;
e && (i = e.data), e = r.options = q({}, r.options, e), r._map = {}, r._prefetch = {}, r._data = [], r._ranges = [], r._view = [], r._pristine = [], r._destroyed = [], r._pageSize = e.pageSize, r._page = e.page || (e.pageSize ? 1 : t), r._sort = a(e.sort), r._filter = l(e.filter), r._group = c(e.group), r._aggregate = e.aggregate, r._total = e.total, nt.fn.init.call(r), r.transport = U.create(e, i), r.reader = new tt.data.readers[e.schema.type || "json"](e.schema), n = r.reader.model || {}, r._data = r._observe(r._data), r.bind([ft, ct, ht, ut, mt, gt], e)
},
options: {
data: [],
schema: {
modelBase: Nt
},
serverSorting: !1,
serverPaging: !1,
serverFiltering: !1,
serverGrouping: !1,
serverAggregates: !1,
batch: !1
},
_isServerGrouped: function () {
var e = this.group() || [];
return this.options.serverGrouping && e.length
},
_flatData: function (e) {
return this._isServerGrouped() ? b(e) : e
},
parent: et,
get: function (e) {
var t, n, i = this._flatData(this._data);
for (t = 0, n = i.length; n > t; t++)
if (i[t].id == e) return i[t]
},
getByUid: function (e) {
var t, n, i = this._flatData(this._data);
if (i)
for (t = 0, n = i.length; n > t; t++)
if (i[t].uid == e) return i[t]
},
indexOf: function (e) {
return T(this._data, e)
},
at: function (e) {
return this._data[e]
},
data: function (e) {
var n = this;
return e === t ? n._data : (n._data = this._observe(e), n._ranges = [], n._addRange(n._data), n._total = n._data.length, n._process(n._data), t)
},
view: function () {
return this._view
},
add: function (e) {
return this.insert(this._data.length, e)
},
insert: function (e, t) {
return t || (t = e, e = 0), t instanceof Nt || (t = this.reader.model ? new this.reader.model(t) : new Rt(t)), this._isServerGrouped() ? this._data.splice(e, 0, k(this.group(), t)) : this._data.splice(e, 0, t), t
},
remove: function (e) {
var n, i = this,
r = i._isServerGrouped();
return this._eachItem(i._data, function (o) {
return n = x(o, e), n && r ? (n.isNew && n.isNew() || i._destroyed.push(n), !0) : t
}), e
},
sync: function () {
var t, n, i, r = this,
o = [],
a = [],
s = r._destroyed,
l = r._flatData(r._data);
if (r.reader.model) {
for (t = 0, n = l.length; n > t; t++) l[t].isNew() ? o.push(l[t]) : l[t].dirty && a.push(l[t]);
i = r._send("create", o), i.push.apply(i, r._send("update", a)), i.push.apply(i, r._send("destroy", s)), e.when.apply(null, i).then(function () {
var e, t;
for (e = 0, t = arguments.length; t > e; e++) r._accept(arguments[e]);
r._change({
action: "sync"
}), r.trigger(ut)
})
}
},
cancelChanges: function (e) {
var t = this,
n = t._readData(t._pristine);
e instanceof tt.data.Model ? t._cancelModel(e) : (t._destroyed = [], t._data = t._observe(n), t.options.serverPaging && (t._total = t.reader.total(t._pristine)), t._change())
},
hasChanges: function () {
var e, t, n = this._data;
if (this._destroyed.length) return !0;
for (e = 0, t = n.length; t > e; e++)
if (n[e].isNew() || n[e].dirty) return !0;
return !1
},
_accept: function (t) {
var n, i = this,
r = t.models,
o = t.response,
a = 0,
s = i._isServerGrouped(),
l = i._readData(i._pristine),
d = t.type;
if (i.trigger(mt, {
response: o,
type: d
}), o && !Q(o)) {
if (o = i.reader.parse(o), i._handleCustomErrors(o)) return;
o = i.reader.data(o), e.isArray(o) || (o = [o])
} else o = e.map(r, function (e) {
return e.toJSON()
});
for ("destroy" === d && (i._destroyed = []), a = 0, n = r.length; n > a; a++) "destroy" !== d ? (r[a].accept(o[a]), "create" === d ? l.push(s ? k(i.group(), r[a]) : o[a]) : "update" === d && i._updatePristineForModel(r[a], o[a])) : i._removePristineForModel(r[a])
},
_updatePristineForModel: function (e, t) {
this._executeOnPristineForModel(e, function (e, n) {
tt.deepExtend(n[e], t)
})
},
_executeOnPristineForModel: function (e, n) {
this._eachPristineItem(function (i) {
var r = C(i, e);
return r > -1 ? (n(r, i), !0) : t
})
},
_removePristineForModel: function (e) {
this._executeOnPristineForModel(e, function (e, t) {
t.splice(e, 1)
})
},
_readData: function (e) {
var t = this._isServerGrouped() ? this.reader.groups : this.reader.data;
return t(e)
},
_eachPristineItem: function (e) {
this._eachItem(this._readData(this._pristine), e)
},
_eachItem: function (e, t) {
e && e.length && (this._isServerGrouped() ? w(e, t) : t(e))
},
_pristineForModel: function (e) {
var n, i, r = function (r) {
return i = C(r, e), i > -1 ? (n = r[i], !0) : t
};
return this._eachPristineItem(r), n
},
_cancelModel: function (e) {
var t, n = this._pristineForModel(e);
this._eachItem(this._data, function (i) {
t = T(i, e), -1 != t && (!e.isNew() && n ? i[t].accept(n) : i.splice(t, 1))
})
},
_promise: function (t, n, i) {
var r = this,
o = r.transport;
return e.Deferred(function (e) {
o[i].call(o, q({
success: function (t) {
e.resolve({
response: t,
models: n,
type: i
})
},
error: function (t, n, i) {
e.reject(t), r.error(t, n, i)
}
}, t))
}).promise()
},
_send: function (e, t) {
var n, i, r = this,
o = [];
if (r.options.batch) t.length && o.push(r._promise({
data: {
models: f(t)
}
}, t, e));
else
for (n = 0, i = t.length; i > n; n++) o.push(r._promise({
data: t[n].toJSON()
}, [t[n]], e));
return o
},
read: function (e) {
var t = this,
n = t._params(e);
t._queueRequest(n, function () {
t.trigger(ht) ? t._dequeueRequest() : (t.trigger(gt), t._ranges = [], t.transport.read({
data: n,
success: G(t.success, t),
error: G(t.error, t)
}))
})
},
success: function (n) {
var i = this,
r = i.options;
return i.trigger(mt, {
response: n,
type: "read"
}), n = i.reader.parse(n), i._handleCustomErrors(n) ? (i._dequeueRequest(), t) : (i._pristine = Y(n) ? e.extend(!0, {}, n) : n.slice ? n.slice(0) : n, i._total = i.reader.total(n), i._aggregate && r.serverAggregates && (i._aggregateResult = i.reader.aggregates(n)), n = i._readData(n), i._data = i._observe(n), i._addRange(i._data), i._dequeueRequest(), i._process(i._data), t)
},
_addRange: function (e) {
var t = this,
n = t._skip || 0,
i = n + t._flatData(e).length;
t._ranges.push({
start: n,
end: i,
data: e
}), t._ranges.sort(function (e, t) {
return e.start - t.start
})
},
error: function (e, t, n) {
this._dequeueRequest(), this.trigger(mt, {}), this.trigger(ft, {
xhr: e,
status: t,
errorThrown: n
})
},
_params: function (e) {
var t = this,
n = q({
take: t.take(),
skip: t.skip(),
page: t.page(),
pageSize: t.pageSize(),
sort: t._sort,
filter: t._filter,
group: t._group,
aggregate: t._aggregate
}, e);
return t.options.serverPaging || (delete n.take, delete n.skip, delete n.page, delete n.pageSize), t.options.serverGrouping || delete n.group, t.options.serverFiltering || delete n.filter, t.options.serverSorting || delete n.sort, t.options.serverAggregates || delete n.aggregate, n
},
_queueRequest: function (e, n) {
var i = this;
i._requestInProgress ? i._pending = {
callback: G(n, i),
options: e
} : (i._requestInProgress = !0, i._pending = t, n())
},
_dequeueRequest: function () {
var e = this;
e._requestInProgress = !1, e._pending && e._queueRequest(e._pending.options, e._pending.callback)
},
_handleCustomErrors: function (e) {
if (this.reader.errors) {
var t = this.reader.errors(e);
if (t) return this.trigger(ft, {
xhr: null,
status: "customerror",
errorThrown: "custom error",
errors: t
}), !0
}
return !1
},
_observe: function (e) {
var t = this,
n = t.reader.model,
i = !1;
return n && e.length && (i = !(e[0] instanceof n)), e instanceof Ht ? i && (e.type = t.reader.model, e.wrapAll(e, e)) : (e = new Ht(e, t.reader.model), e.parent = function () {
return t.parent()
}), t._isServerGrouped() && y(e, n), e.bind(ct, G(t._change, t))
},
_change: function (e) {
var t, n, i, r = this,
o = e ? e.action : "";
if ("remove" === o)
for (t = 0, n = e.items.length; n > t; t++) e.items[t].isNew && e.items[t].isNew() || r._destroyed.push(e.items[t]);
!r.options.autoSync || "add" !== o && "remove" !== o && "itemchange" !== o ? (i = r._total || r.reader.total(r._pristine), "add" === o ? i += e.items.length : "remove" === o ? i -= e.items.length : "itemchange" === o || "sync" === o || r.options.serverPaging || (i = r.reader.total(r._pristine)), r._total = i, r._process(r._data, e)) : r.sync()
},
_process: function (e, n) {
var i, r = this,
a = {};
r.options.serverPaging !== !0 && (a.skip = r._skip, a.take = r._take || r._pageSize, a.skip === t && r._page !== t && r._pageSize !== t && (a.skip = (r._page - 1) * r._pageSize)), r.options.serverSorting !== !0 && (a.sort = r._sort), r.options.serverFiltering !== !0 && (a.filter = r._filter), r.options.serverGrouping !== !0 && (a.group = r._group), r.options.serverAggregates !== !0 && (a.aggregate = r._aggregate, r._aggregateResult = h(e, a)), i = o.process(e, a), r._view = i.data, i.total === t || r.options.serverFiltering || (r._total = i.total), n = n || {}, n.items = n.items || r._view, r.trigger(ct, n)
},
_mergeState: function (e) {
var n = this;
return e !== t && (n._pageSize = e.pageSize, n._page = e.page, n._sort = e.sort, n._filter = e.filter, n._group = e.group, n._aggregate = e.aggregate, n._skip = e.skip, n._take = e.take, n._skip === t && (n._skip = n.skip(), e.skip = n.skip()), n._take === t && n._pageSize !== t && (n._take = n._pageSize, e.take = n._take), e.sort && (n._sort = e.sort = a(e.sort)), e.filter && (n._filter = e.filter = l(e.filter)), e.group && (n._group = e.group = c(e.group)), e.aggregate && (n._aggregate = e.aggregate = d(e.aggregate))), e
},
query: function (e) {
var n, i = this,
r = i.options.serverSorting || i.options.serverPaging || i.options.serverFiltering || i.options.serverGrouping || i.options.serverAggregates;
r || (i._data === t || 0 === i._data.length) && !i._destroyed.length ? i.read(i._mergeState(e)) : i.trigger(ht) || (i.trigger(gt), n = o.process(i._data, i._mergeState(e)), i.options.serverFiltering || (i._total = n.total !== t ? n.total : i._data.length), i._view = n.data, i._aggregateResult = h(i._data, e), i.trigger(mt, {}), i.trigger(ct, {
items: n.data
}))
},
fetch: function (e) {
var t = this;
e && $(e) && t.one(ct, e), t._query()
},
_query: function (e) {
var t = this;
t.query(q({}, {
page: t.page(),
pageSize: t.pageSize(),
sort: t.sort(),
filter: t.filter(),
group: t.group(),
aggregate: t.aggregate()
}, e))
},
next: function (e) {
var n = this,
i = n.page(),
r = n.total();
return e = e || {}, !i || r && i + 1 > n.totalPages() ? t : (n._skip = i * n.take(), i += 1, e.page = i, n._query(e), i)
},
prev: function (e) {
var n = this,
i = n.page();
return e = e || {}, i && 1 !== i ? (n._skip = n._skip - n.take(), i -= 1, e.page = i, n._query(e), i) : t
},
page: function (e) {
var n, i = this;
return e !== t ? (e = wt.max(wt.min(wt.max(e, 1), i.totalPages()), 1), i._query({
page: e
}), t) : (n = i.skip(), n !== t ? wt.round((n || 0) / (i.take() || 1)) + 1 : t)
},
pageSize: function (e) {
var n = this;
return e !== t ? (n._query({
pageSize: e,
page: 1
}), t) : n.take()
},
sort: function (e) {
var n = this;
return e !== t ? (n._query({
sort: e
}), t) : n._sort
},
filter: function (e) {
var n = this;
return e === t ? n._filter : (n._query({
filter: e,
page: 1
}), t)
},
group: function (e) {
var n = this;
return e !== t ? (n._query({
group: e
}), t) : n._group
},
total: function () {
return this._total || 0
},
aggregate: function (e) {
var n = this;
return e !== t ? (n._query({
aggregate: e
}), t) : n._aggregate
},
aggregates: function () {
return this._aggregateResult
},
totalPages: function () {
var e = this,
t = e.pageSize() || e.total();
return wt.ceil((e.total() || 0) / t)
},
inRange: function (e, t) {
var n = this,
i = wt.min(e + t, n.total());
return !n.options.serverPaging && n.data.length > 0 ? !0 : n._findRange(e, i).length > 0
},
range: function (e, n) {
var i, r, o, a, s, l, d;
if (e = wt.min(e || 0, this.total()), r = this, o = wt.max(wt.floor(e / n), 0) * n, a = wt.min(o + n, r.total()), i = r._findRange(e, wt.min(e + n, r.total())), i.length) {
r._skip = e > r.skip() ? wt.min(a, (r.totalPages() - 1) * r.take()) : o, r._take = n, s = r.options.serverPaging, l = r.options.serverSorting, d = r.options.serverFiltering;
try {
r.options.serverPaging = !0, r.options.serverSorting = !0, r.options.serverFiltering = !0, s && (r._data = i = r._observe(i)), r._process(i)
} finally {
r.options.serverPaging = s, r.options.serverSorting = l, r.options.serverFiltering = d
}
} else n !== t && (r._rangeExists(o, a) ? e > o && r.prefetch(a, n, function () {
r.range(e, n)
}) : r.prefetch(o, n, function () {
e > o && r.total() > a && !r._rangeExists(a, wt.min(a + n, r.total())) ? r.prefetch(a, n, function () {
r.range(e, n)
}) : r.range(e, n)
}))
},
_findRange: function (e, n) {
var i, r, s, l, d, u, p, f, h, g, m, v, _ = this,
b = _._ranges,
y = [],
w = _.options,
x = w.serverSorting || w.serverPaging || w.serverFiltering || w.serverGrouping || w.serverAggregates;
for (r = 0, m = b.length; m > r; r++)
if (i = b[r], e >= i.start && i.end >= e) {
for (g = 0, s = r; m > s; s++)
if (i = b[s], h = _._flatData(i.data), h.length && e + g >= i.start && (u = i.data, p = i.end, x || (v = c(_.group() || []).concat(a(_.sort() || [])), f = o.process(i.data, {
sort: v,
filter: _.filter()
}), h = u = f.data, f.total !== t && (p = f.total)), l = 0, e + g > i.start && (l = e + g - i.start), d = h.length, p > n && (d -= p - n), g += d - l, y = _._mergeGroups(y, u, l, d), i.end >= n && g == n - e)) return y;
break
}
return []
},
_mergeGroups: function (e, t, n, i) {
if (this._isServerGrouped()) {
var r, o = t.toJSON();
return e.length && (r = e[e.length - 1]), _(r, o, n, i), e.concat(o)
}
return e.concat(t.slice(n, i))
},
skip: function () {
var e = this;
return e._skip === t ? e._page !== t ? (e._page - 1) * (e.take() || 1) : t : e._skip
},
take: function () {
return this._take || this._pageSize
},
_prefetchSuccessHandler: function (e, t, n) {
var i = this;
return function (r) {
var o, a, s = !1,
l = {
start: e,
end: t,
data: []
};
for (i._dequeueRequest(), o = 0, a = i._ranges.length; a > o; o++)
if (i._ranges[o].start === e) {
s = !0, l = i._ranges[o];
break
}
s || i._ranges.push(l), i.trigger(mt, {
response: r,
type: "read"
}), r = i.reader.parse(r), l.data = i._observe(i._readData(r)), l.end = l.start + i._flatData(l.data).length, i._ranges.sort(function (e, t) {
return e.start - t.start
}), i._total = i.reader.total(r), n && n()
}
},
prefetch: function (e, t, n) {
var i = this,
r = wt.min(e + t, i.total()),
o = {
take: t,
skip: e,
page: e / t + 1,
pageSize: t,
sort: i._sort,
filter: i._filter,
group: i._group,
aggregate: i._aggregate
};
i._rangeExists(e, r) ? n && n() : (clearTimeout(i._timeout), i._timeout = setTimeout(function () {
i._queueRequest(o, function () {
i.trigger(ht) ? i._dequeueRequest() : i.transport.read({
data: o,
success: i._prefetchSuccessHandler(e, r, n)
})
})
}, 100))
},
_rangeExists: function (e, t) {
var n, i, r = this,
o = r._ranges;
for (n = 0, i = o.length; i > n; n++)
if (e >= o[n].start && o[n].end >= t) return !0;
return !1
}
}), U = {}, U.create = function (e, t) {
var n, i = e.transport;
return i ? (i.read = typeof i.read === rt ? {
url: i.read
} : i.read, e.type && (tt.data.transports[e.type] && !Y(tt.data.transports[e.type]) ? n = new tt.data.transports[e.type](q(i, {
data: t
})) : i = q(!0, {}, tt.data.transports[e.type], i), e.schema = q(!0, {}, tt.data.schemas[e.type], e.schema)), n || (n = $(i.read) ? i : new N(i))) : n = new M({
data: e.data
}), n
}, V.create = function (e) {
e = e && e.push ? {
data: e
} : e;
var t, n, i, r = e || {}, o = r.data,
a = r.fields,
s = r.table,
l = r.select,
d = {};
if (o || !a || r.transport || (s ? o = F(s, a) : l && (o = A(l, a))), tt.data.Model && a && (!r.schema || !r.schema.model)) {
for (t = 0, n = a.length; n > t; t++) i = a[t], i.type && (d[i.field] = i);
Q(d) || (r.schema = q(!0, r.schema, {
model: {
fields: d
}
}))
}
return r.data = o, r instanceof V ? r : new V(r)
}, W = Nt.define({
init: function (e) {
var t = this,
n = t.hasChildren || e && e.hasChildren,
i = "items",
r = {};
tt.data.Model.fn.init.call(t, e), typeof t.children === rt && (i = t.children), r = {
schema: {
data: i,
model: {
hasChildren: n,
id: t.idField
}
}
}, typeof t.children !== rt && q(r, t.children), r.data = e, n || (n = r.schema.data), typeof n === rt && (n = tt.getter(n)), $(n) && (t.hasChildren = !! n.call(t, t)), t._childrenOptions = r, t.hasChildren && t._initChildren(), t._loaded = !(!e || !e[i] && !e._loaded)
},
_initChildren: function () {
var e = this;
e.children instanceof j || (e.children = new j(e._childrenOptions), e.children.parent = function () {
return e
}, e.children.bind(ct, function (t) {
t.node = t.node || e, e.trigger(ct, t)
}), e.children.bind(ft, function (t) {
var n = e.parent();
n && (t.node = t.node || e, n.trigger(ft, t))
}), e._updateChildrenField())
},
append: function (e) {
this._initChildren(), this.loaded(!0), this.children.add(e)
},
hasChildren: !1,
level: function () {
for (var e = this.parentNode(), t = 0; e && e.parentNode;) t++, e = e.parentNode ? e.parentNode() : null;
return t
},
_updateChildrenField: function () {
var e = this._childrenOptions.schema.data;
this[e || "items"] = this.children.data()
},
load: function () {
var e = this,
n = {};
e.hasChildren && (e._initChildren(), n[e.idField || "id"] = e.id, e._loaded || (e.children._data = t), e.children.one(ct, function () {
e._loaded = !0, e._updateChildrenField()
})._query(n))
},
parentNode: function () {
var e = this.parent();
return e.parent()
},
loaded: function (e) {
return e === t ? this._loaded : (this._loaded = e, t)
},
shouldSerialize: function (e) {
return Nt.fn.shouldSerialize.call(this, e) && "children" !== e && "_loaded" !== e && "hasChildren" !== e && "_childrenOptions" !== e
}
}), j = V.extend({
init: function (e) {
var t = W.define({
children: e
});
V.fn.init.call(this, q(!0, {}, {
schema: {
modelBase: t,
model: t
}
}, e)), this._attachBubbleHandlers()
},
_attachBubbleHandlers: function () {
var e = this;
e._data.bind(ft, function (t) {
e.trigger(ft, t)
})
},
remove: function (e) {
var t, n = e.parentNode(),
i = this;
return n && (i = n.children), t = V.fn.remove.call(i, e), n && !i.data().length && (n.hasChildren = !1), t
},
success: D("success"),
data: D("data"),
insert: function (e, t) {
var n = this.parent();
return n && (n.hasChildren = !0, n._initChildren()), V.fn.insert.call(this, e, t)
},
_find: function (e, t) {
var n, i, r, o, a;
if (r = V.fn[e].call(this, t)) return r;
if (o = this._flatData(this.data()))
for (n = 0, i = o.length; i > n; n++)
if (a = o[n].children, a instanceof j && (r = a[e](t))) return r
},
get: function (e) {
return this._find("get", e)
},
getByUid: function (e) {
return this._find("getByUid", e)
}
}), j.create = function (e) {
e = e && e.push ? {
data: e
} : e;
var t = e || {}, n = t.data,
i = t.fields,
r = t.list;
return n && n._dataSource ? n._dataSource : (n || !i || t.transport || r && (n = I(r, i)), t.data = n, t instanceof j ? t : new j(t))
}, q(!0, tt.data, {
readers: {
json: L
},
Query: o,
DataSource: V,
HierarchicalDataSource: j,
Node: W,
ObservableObject: Rt,
ObservableArray: Ht,
LocalTransport: M,
RemoteTransport: N,
Cache: B,
DataReader: L,
Model: Nt
})
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
var t, i, r = [];
for (t = 0, i = e.length; i > t; t++) r = e[t].hasSubgroups ? r.concat(n(e[t].items)) : r.concat(e[t].items);
return r
}
function i(e, n, i) {
var r = i[e];
return r ? new _(w.initWidget(n, r.options, i)) : t
}
function r(e) {
var t, n, i, o, a, s, l, d = {};
for (l = e.match(b), t = 0, n = l.length; n > t; t++) i = l[t], o = i.indexOf(":"), a = i.substring(0, o), s = i.substring(o + 1), "{" == s.charAt(0) && (s = r(s)), d[a] = s;
return d
}
function o(e, t, n) {
var i, r = {};
for (i in e) r[i] = new n(t, e[i]);
return r
}
function a(e, t, n, s) {
var d, c, u, p = e.getAttribute("data-" + w.ns + "role"),
m = e.getAttribute("data-" + w.ns + "bind"),
_ = e.children,
b = [],
x = !0,
k = {};
if (s = s || [t], (p || m) && l(e), p && (u = i(p, e, n)), m && (m = r(m.replace(y, "")), u || (k = w.parseOptions(e, {
textField: "",
valueField: "",
template: "",
valueUpdate: z
}), k.roles = n, u = new v(e, k)), u.source = t, c = o(m, s, f), k.template && (c.template = new g(s, "", k.template)), c.click && (m.events = m.events || {}, m.events.click = m.click, delete c.click), c.source && (x = !1), m.attr && (c.attr = o(m.attr, s, f)), m.style && (c.style = o(m.style, s, f)), m.events && (c.events = o(m.events, s, h)), u.bind(c)), u && (e.kendoBindingTarget = u), x && _) {
for (d = 0; _.length > d; d++) b[d] = _[d];
for (d = 0; b.length > d; d++) a(b[d], t, n, s)
}
}
function s(t, n) {
var i, r, o, s = w.rolesFromNamespaces([].slice.call(arguments, 2));
for (n = w.observable(n), t = e(t), i = 0, r = t.length; r > i; i++) o = t[i], 1 === o.nodeType && a(o, n, s)
}
function l(t) {
var n = t.kendoBindingTarget;
n && (n.destroy(), e.support.deleteExpando ? delete t.kendoBindingTarget : t.removeAttribute ? t.removeAttribute("kendoBindingTarget") : t.kendoBindingTarget = null)
}
function d(e) {
var t, n, i = e.children;
if (l(e), i)
for (t = 0, n = i.length; n > t; t++) d(i[t])
}
function c(t) {
var n, i;
for (t = e(t), n = 0, i = t.length; i > n; n++) d(t[n])
}
function u(e, t) {
var n = e.element,
i = n[0].kendoBindingTarget;
i && s(n, i.source, t)
}
var p, f, h, g, m, v, _, b, y, w = window.kendo,
x = w.Observable,
k = w.data.ObservableObject,
C = w.data.ObservableArray,
T = {}.toString,
S = {}, A = w.Class,
F = e.proxy,
D = "value",
I = "source",
E = "events",
P = "checked",
z = "change";
(function () {
var e = document.createElement("a");
e.innerText !== t ? p = "innerText" : e.textContent !== t && (p = "textContent")
})(), f = x.extend({
init: function (e, t) {
var n = this;
x.fn.init.call(n), n.source = e[0], n.parents = e, n.path = t, n.dependencies = {}, n.dependencies[t] = !0, n.observable = n.source instanceof x, n._access = function (e) {
n.dependencies[e.field] = !0
}, n.observable && (n._change = function (e) {
n.change(e)
}, n.source.bind(z, n._change))
},
_parents: function () {
var t, n = this.parents,
i = this.get();
return i && (t = i.parent(), 0 > e.inArray(t, n) && (n = [t].concat(n))), n
},
change: function (e) {
var t, n, i = e.field,
r = this;
if ("this" === r.path) r.trigger(z, e);
else
for (t in r.dependencies)
if (0 === t.indexOf(i) && (n = t.charAt(i.length), !n || "." === n || "[" === n)) {
r.trigger(z, e);
break
}
},
start: function (e) {
e.bind("get", this._access)
},
stop: function (e) {
e.unbind("get", this._access)
},
get: function () {
var e = this,
n = e.source,
i = 0,
r = e.path,
o = n;
if (!e.observable) return o;
for (e.start(e.source), o = n.get(r); o === t && n;) n = e.parents[++i], n instanceof k && (o = n.get(r));
if (o === t)
for (n = e.source; o === t && n;) n = n.parent(), n instanceof k && (o = n.get(r));
return "function" == typeof o && (i = r.lastIndexOf("."), i > 0 && (n = n.get(r.substring(0, i))), e.start(n), o = o.call(n, e.source), e.stop(n)), n && n !== e.source && (e.currentSource = n, n.unbind(z, e._change).bind(z, e._change)), e.stop(e.source), o
},
set: function (e) {
var t = this,
n = t.currentSource || t.source;
n.set(t.path, e)
},
destroy: function () {
this.observable && this.source.unbind(z, this._change)
}
}), h = f.extend({
get: function () {
var e, t = this.source,
n = this.path,
i = 0;
for (e = t.get(n); !e && t;) t = this.parents[++i], t instanceof k && (e = t.get(n));
return F(e, t)
}
}), g = f.extend({
init: function (e, t, n) {
var i = this;
f.fn.init.call(i, e, t), i.template = n
},
render: function (e) {
var t;
return this.start(this.source), t = w.render(this.template, e), this.stop(this.source), t
}
}), m = A.extend({
init: function (e, t, n) {
this.element = e, this.bindings = t, this.options = n
},
bind: function (e, t) {
var n = this;
e = t ? e[t] : e, e.bind(z, function (e) {
n.refresh(t || e)
}), n.refresh(t)
},
destroy: function () {}
}), S.attr = m.extend({
refresh: function (e) {
this.element.setAttribute(e, this.bindings.attr[e].get())
}
}), S.style = m.extend({
refresh: function (e) {
this.element.style[e] = this.bindings.style[e].get() || ""
}
}), S.enabled = m.extend({
refresh: function () {
this.bindings.enabled.get() ? this.element.removeAttribute("disabled") : this.element.setAttribute("disabled", "disabled")
}
}), S.readonly = m.extend({
refresh: function () {
this.bindings.readonly.get() ? this.element.setAttribute("readonly", "readonly") : this.element.removeAttribute("readonly")
}
}), S.disabled = m.extend({
refresh: function () {
this.bindings.disabled.get() ? this.element.setAttribute("disabled", "disabled") : this.element.removeAttribute("disabled")
}
}), S.events = m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e, t, n), this.handlers = {}
},
refresh: function (t) {
var n = e(this.element),
i = this.bindings.events[t],
r = this.handlers[t];
r && n.off(t, r), r = this.handlers[t] = i.get(), n.on(t, i.source, r)
},
destroy: function () {
var t, n = e(this.element);
for (t in this.handlers) n.off(t, this.handlers[t])
}
}), S.text = m.extend({
refresh: function () {
var e = this.bindings.text.get();
null == e && (e = ""), this.element[p] = e
}
}), S.visible = m.extend({
refresh: function () {
this.element.style.display = this.bindings.visible.get() ? "" : "none"
}
}), S.invisible = m.extend({
refresh: function () {
this.element.style.display = this.bindings.invisible.get() ? "none" : ""
}
}), S.html = m.extend({
refresh: function () {
this.element.innerHTML = this.bindings.html.get()
}
}), S.value = m.extend({
init: function (t, n, i) {
m.fn.init.call(this, t, n, i), this._change = F(this.change, this), this.eventName = i.valueUpdate || z, e(this.element).on(this.eventName, this._change), this._initChange = !1
},
change: function () {
this._initChange = this.eventName != z, this.bindings[D].set(this.element.value), this._initChange = !1
},
refresh: function () {
if (!this._initChange) {
var e = this.bindings[D].get();
null == e && (e = ""), this.element.value = e
}
this._initChange = !1
},
destroy: function () {
e(this.element).off(this.eventName, this._change)
}
}), S.source = m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e, t, n)
},
refresh: function (e) {
var t = this,
n = t.bindings.source.get();
n instanceof C ? (e = e || {}, "add" == e.action ? t.add(e.index, e.items) : "remove" == e.action ? t.remove(e.index, e.items) : "itemchange" != e.action && t.render()) : t.render()
},
container: function () {
var e = this.element;
return "table" == e.nodeName.toLowerCase() && (e.tBodies[0] || e.appendChild(document.createElement("tbody")), e = e.tBodies[0]), e
},
template: function () {
var e = this.options,
t = e.template,
n = this.container().nodeName.toLowerCase();
return t || (t = "select" == n ? e.valueField || e.textField ? w.format('', e.valueField || e.textField, e.textField || e.valueField) : "" : "tbody" == n ? "
#:data#
" : "ul" == n || "ol" == n ? "
#:data#
" : "#:data#", t = w.template(t)), t
},
destroy: function () {
var e = this.bindings.source.get();
e.unbind(z, this._change)
},
add: function (t, n) {
var i, r, o, s, l = this.container(),
d = l.cloneNode(!1),
c = l.children[t];
if (e(d).html(w.render(this.template(), n)), d.children.length)
for (i = this.bindings.source._parents(), r = 0, o = n.length; o > r; r++) s = d.children[0], l.insertBefore(s, c || null), a(s, n[r], this.options.roles, [n[r]].concat(i))
},
remove: function (e, t) {
var n, i = this.container();
for (n = 0; t.length > n; n++) i.removeChild(i.children[e])
},
render: function () {
var t, n, i, r, o = this.bindings.source.get(),
s = this.container(),
l = this.template();
if (o instanceof C || "[object Array]" === T.call(o) || (o.parent && (r = o.parent), o = new C([o]), o.parent && (o.parent = r)), this.bindings.template) {
if (e(s).html(this.bindings.template.render(o)), s.children.length)
for (t = this.bindings.source._parents(), n = 0, i = o.length; i > n; n++) a(s.children[n], o[n], this.options.roles, [o[n]].concat(t))
} else e(s).html(w.render(l, o))
}
}), S.input = {
checked: m.extend({
init: function (t, n, i) {
m.fn.init.call(this, t, n, i), this._change = F(this.change, this), e(this.element).change(this._change)
},
change: function () {
var e, t, n = this.element,
i = this.value();
"radio" == n.type ? this.bindings[P].set(i) : "checkbox" == n.type && (e = this.bindings[P].get(), e instanceof C ? (i = this.element.value, "on" !== i && "off" !== i && (t = e.indexOf(i), t > -1 ? e.splice(t, 1) : e.push(i))) : this.bindings[P].set(i))
},
refresh: function () {
var e = this.bindings[P].get(),
t = e,
n = this.element;
"checkbox" == n.type ? (t instanceof C && (e = this.element.value, t.indexOf(e) >= 0 && (e = !0)), n.checked = e === !0) : "radio" == n.type && null != e && n.value === "" + e && (n.checked = !0)
},
value: function () {
var e = this.element,
t = e.value;
return "checkbox" == e.type && (t = e.checked), t
},
destroy: function () {
e(this.element).off(z, this._change)
}
})
}, S.select = {
value: m.extend({
init: function (t, n, i) {
m.fn.init.call(this, t, n, i), this._change = F(this.change, this), e(this.element).change(this._change)
},
change: function () {
var e, t, n, i, r, o, a = [],
s = this.element,
l = this.options.valueField || this.options.textField;
for (r = 0, o = s.options.length; o > r; r++) t = s.options[r], t.selected && (i = t.attributes.value, i = i && i.specified ? t.value : t.text, a.push(i));
if (l)
for (e = this.bindings.source.get(), n = 0; a.length > n; n++)
for (r = 0, o = e.length; o > r; r++)
if (e[r].get(l) == a[n]) {
a[n] = e[r];
break
}
i = this.bindings[D].get(), i instanceof C ? i.splice.apply(i, [0, i.length].concat(a)) : i instanceof k || !l ? this.bindings[D].set(a[0]) : this.bindings[D].set(a[0].get(l))
},
refresh: function () {
var e, t, n, i = this.element,
r = i.options,
o = this.bindings[D].get(),
a = o,
s = this.options.valueField || this.options.textField,
l = !1;
for (a instanceof C || (a = new C([o])), i.selectedIndex = -1, n = 0; a.length > n; n++)
for (o = a[n], s && o instanceof k && (o = o.get(s)), e = 0; r.length > e; e++) t = r[e].value, "" === t && "" !== o && (t = r[e].text), t == o && (r[e].selected = !0, l = !0)
},
destroy: function () {
e(this.element).off(z, this._change)
}
})
}, S.widget = {
events: m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e.element[0], t, n), this.widget = e, this.handlers = {}
},
refresh: function (e) {
var t = this.bindings.events[e],
n = this.handlers[e];
n && this.widget.unbind(e, n), n = t.get(), this.handlers[e] = function (e) {
e.data = t.source, n(e), e.data === t.source && delete e.data
}, this.widget.bind(e, this.handlers[e])
},
destroy: function () {
var e;
for (e in this.handlers) this.widget.unbind(e, this.handlers[e])
}
}),
checked: m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e.element[0], t, n), this.widget = e, this._change = F(this.change, this), this.widget.bind(z, this._change)
},
change: function () {
this.bindings[P].set(this.value())
},
refresh: function () {
this.widget.check(this.bindings[P].get() === !0)
},
value: function () {
var e = this.element,
t = e.value;
return ("on" == t || "off" == t) && (t = e.checked), t
},
destroy: function () {
this.widget.unbind(z, this._change)
}
}),
visible: m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e.element[0], t, n), this.widget = e
},
refresh: function () {
var e = this.bindings.visible.get();
this.widget.wrapper[0].style.display = e ? "" : "none"
}
}),
invisible: m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e.element[0], t, n), this.widget = e
},
refresh: function () {
var e = this.bindings.invisible.get();
this.widget.wrapper[0].style.display = e ? "none" : ""
}
}),
enabled: m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e.element[0], t, n), this.widget = e
},
refresh: function () {
this.widget.enable && this.widget.enable(this.bindings.enabled.get())
}
}),
disabled: m.extend({
init: function (e, t, n) {
m.fn.init.call(this, e.element[0], t, n), this.widget = e
},
refresh: function () {
this.widget.enable && this.widget.enable(!this.bindings.disabled.get())
}
}),
source: m.extend({
init: function (e, t, n) {
var i = this;
m.fn.init.call(i, e.element[0], t, n), i.widget = e, i._dataBinding = F(i.dataBinding, i), i._dataBound = F(i.dataBound, i), i._itemChange = F(i.itemChange, i)
},
itemChange: function (e) {
a(e.item[0], e.data, this._ns(e.ns), [e.data].concat(this.bindings.source._parents()))
},
dataBinding: function () {
var e, t, n = this.widget,
i = n.items();
for (e = 0, t = i.length; t > e; e++) d(i[e])
},
_ns: function (t) {
t = t || w.ui;
var n = [w.ui, w.dataviz.ui, w.mobile.ui];
return n.splice(e.inArray(t, n), 1), n.unshift(t), w.rolesFromNamespaces(n)
},
dataBound: function (e) {
var t, i, r, o = this.widget,
s = o.items(),
l = o.dataSource,
d = l.view(),
c = l.group() || [];
if (s.length)
for (c.length && (d = n(d)), r = this.bindings.source._parents(), t = 0, i = d.length; i > t; t++) a(s[t], d[t], this._ns(e.ns), [d[t]].concat(r))
},
refresh: function (e) {
var t, n = this,
i = n.widget;
e = e || {}, e.action || (n.destroy(), i.bind("dataBinding", n._dataBinding), i.bind("dataBound", n._dataBound), i.bind("itemChange", n._itemChange), t = n.bindings.source.get(), i.dataSource instanceof w.data.DataSource && i.dataSource != t && (t instanceof w.data.DataSource ? i.setDataSource(t) : t && t._dataSource ? i.setDataSource(t._dataSource) : i.dataSource.data(t)))
},
destroy: function () {
var e = this.widget;
e.unbind("dataBinding", this._dataBinding), e.unbind("dataBound", this._dataBound), e.unbind("itemChange", this._itemChange)
}
}),
value: m.extend({
init: function (t, n, i) {
m.fn.init.call(this, t.element[0], n, i), this.widget = t, this._change = e.proxy(this.change, this), this.widget.first(z, this._change);
var r = this.bindings.value.get();
this._valueIsObservableObject = null == r || r instanceof k, this._valueIsObservableArray = r instanceof C, this._initChange = !1
},
change: function () {
var e, t, n, i, r, o, a, s = this.widget.value(),
l = this.options.dataValueField || this.options.dataTextField,
d = "[object Array]" === T.call(s),
c = this._valueIsObservableObject,
u = [];
if (this._initChange = !0, l)
if (this.bindings.source && (a = this.bindings.source.get()), "" === s && c) s = null;
else {
for ((!a || a instanceof w.data.DataSource) && (a = this.widget.dataSource.view()), d && (t = s.length, u = s.slice(0)), r = 0, o = a.length; o > r; r++)
if (n = a[r], i = n.get(l), d) {
for (e = 0; t > e; e++)
if (i == u[e]) {
u[e] = n;
break
}
} else if (i == s) {
s = c ? n : i;
break
}
u[0] && (s = this._valueIsObservableArray ? u : c || !l ? u[0] : u[0].get(l))
}
this.bindings.value.set(s), this._initChange = !1
},
refresh: function () {
if (!this._initChange) {
var e, t = this.options.dataValueField || this.options.dataTextField,
n = this.bindings.value.get(),
i = 0,
r = [];
if (t)
if (n instanceof C) {
for (e = n.length; e > i; i++) r[i] = n[i].get(t);
n = r
} else n instanceof k && (n = n.get(t));
this.widget.value(n)
}
this._initChange = !1
},
destroy: function () {
this.widget.unbind(z, this._change)
}
}),
multiselect: {
value: m.extend({
init: function (t, n, i) {
m.fn.init.call(this, t.element[0], n, i), this.widget = t, this._change = e.proxy(this.change, this), this.widget.first(z, this._change), this._initChange = !1
},
change: function () {
this._initChange = !0, this.bindings.value.set(this.widget.dataItems()), this._initChange = !1
},
refresh: function () {
if (!this._initChange) {
var e, t, n = this.options.dataValueField || this.options.dataTextField,
i = this.bindings.value.get(),
r = 0,
o = [];
if (n)
if (i instanceof C) {
for (e = i.length; e > r; r++) t = i[r], o[r] = t.get ? t.get(n) : t;
i = o
} else i instanceof k && (i = i.get(n));
this.widget.value(i)
}
},
destroy: function () {
this.widget.unbind(z, this._change)
}
})
}
}, v = A.extend({
init: function (e, t) {
this.target = e, this.options = t, this.toDestroy = []
},
bind: function (e) {
var t, n, i, r, o = this.target.nodeName.toLowerCase(),
a = S[o] || {};
for (t in e) t == D ? n = !0 : t == I ? i = !0 : t == E ? r = !0 : this.applyBinding(t, e, a);
i && this.applyBinding(I, e, a), n && this.applyBinding(D, e, a), r && this.applyBinding(E, e, a)
},
applyBinding: function (e, t, n) {
var i, r = n[e] || S[e],
o = this.toDestroy,
a = t[e];
if (r)
if (r = new r(this.target, t, this.options), o.push(r), a instanceof f) r.bind(a), o.push(a);
else
for (i in a) r.bind(a, i), o.push(a[i]);
else if ("template" !== e) throw Error("The " + e + " binding is not supported by the " + this.target.nodeName.toLowerCase() + " element")
},
destroy: function () {
var e, t, n = this.toDestroy;
for (e = 0, t = n.length; t > e; e++) n[e].destroy()
}
}), _ = v.extend({
bind: function (e) {
var t, n = this,
i = !1,
r = !1,
o = S.widget[n.target.options.name.toLowerCase()] || {};
for (t in e) t == D ? i = !0 : t == I ? r = !0 : n.applyBinding(t, e);
r && n.applyBinding(I, e), i && n.applyBinding(D, e, o[D])
},
applyBinding: function (e, t, n) {
var i, r = n || S.widget[e],
o = this.toDestroy,
a = t[e];
if (!r) throw Error("The " + e + " binding is not supported by the " + this.target.options.name + " widget");
if (r = new r(this.target, t, this.target.options), o.push(r), a instanceof f) r.bind(a), o.push(a);
else
for (i in a) r.bind(a, i), o.push(a[i])
}
}), b = /[A-Za-z0-9_\-]+:(\{([^}]*)\}|[^,}]+)/g, y = /\s/g, w.unbind = c, w.bind = s, w.data.binders = S, w.data.Binder = m, w.notify = u, w.observable = function (e) {
return e instanceof k || (e = new k(e)), e
}, w.observableHierarchy = function (e) {
function t(e) {
var n, i;
for (n = 0; e.length > n; n++) e[n]._initChildren(), i = e[n].children, i.fetch(), e[n].items = i.data(), t(e[n].items)
}
var n = w.data.HierarchicalDataSource.create(e);
return n.fetch(), t(n.data()), n._data._dataSource = n, n._data
}
}(window.kendo.jQuery),
function (e) {
function t(t) {
var n, i = o.ui.validator.ruleResolvers || {}, r = {};
for (n in i) e.extend(!0, r, i[n].resolve(t));
return r
}
function n(e) {
return e.replace(/&/g, "&").replace(/"/g, '"').replace(/'/g, "'").replace(/</g, "<").replace(/>/g, ">")
}
function i(e) {
return e = (e + "").split("."), e.length > 1 ? e[1].length : 0
}
var r, o = window.kendo,
a = o.ui.Widget,
s = ".kendoValidator",
l = "k-invalid-msg",
d = "k-invalid",
c = /^((([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,
u = /^(https?|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,
p = ":input:not(:button,[type=submit],[type=reset],[disabled],[readonly])",
f = ":checkbox:not([disabled],[readonly])",
h = "[type=number],[type=range]",
g = "blur",
m = "name",
v = "form",
_ = "novalidate",
b = e.proxy,
y = function (e, t) {
return "string" == typeof t && (t = RegExp("^(?:" + t + ")$")), t.test(e)
}, w = function (e, t, n) {
var i = e.val();
return e.filter(t).length && "" !== i ? y(i, n) : !0
}, x = function (e, t) {
return e.length ? null != e[0].attributes[t] : !1
}, k = /("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g;
o.ui.validator || (o.ui.validator = {
rules: {},
messages: {}
}), r = a.extend({
init: function (n, i) {
var r = this,
s = t(n);
i = i || {}, i.rules = e.extend({}, o.ui.validator.rules, s.rules, i.rules), i.messages = e.extend({}, o.ui.validator.messages, s.messages, i.messages), a.fn.init.call(r, n, i), r._errorTemplate = o.template(r.options.errorTemplate), r.element.is(v) && r.element.attr(_, _), r._errors = {}, r._attachEvents()
},
options: {
name: "Validator",
errorTemplate: ' #=message#',
messages: {
required: "{0} is required",
pattern: "{0} is not valid",
min: "{0} should be greater than or equal to {1}",
max: "{0} should be smaller than or equal to {1}",
step: "{0} is not valid",
email: "{0} is not valid email",
url: "{0} is not valid URL",
date: "{0} is not valid date"
},
rules: {
required: function (e) {
var t = e.filter("[type=checkbox]").length && !e.is(":checked"),
n = e.val();
return !(x(e, "required") && ("" === n || !n || t))
},
pattern: function (e) {
return e.filter("[type=text],[type=email],[type=url],[type=tel],[type=search],[type=password]").filter("[pattern]").length && "" !== e.val() ? y(e.val(), e.attr("pattern")) : !0
},
min: function (e) {
if (e.filter(h + ",[" + o.attr("type") + "=number]").filter("[min]").length && "" !== e.val()) {
var t = parseFloat(e.attr("min")) || 0,
n = parseFloat(e.val());
return n >= t
}
return !0
},
max: function (e) {
if (e.filter(h + ",[" + o.attr("type") + "=number]").filter("[max]").length && "" !== e.val()) {
var t = parseFloat(e.attr("max")) || 0,
n = parseFloat(e.val());
return t >= n
}
return !0
},
step: function (e) {
if (e.filter(h + ",[" + o.attr("type") + "=number]").filter("[step]").length && "" !== e.val()) {
var t, n = parseFloat(e.attr("min")) || 0,
r = parseFloat(e.attr("step")) || 1,
a = parseFloat(e.val()),
s = i(r);
return s ? (t = Math.pow(10, s), 0 === (a - n) * t % (r * t) / Math.pow(100, s)) : 0 === (a - n) % r
}
return !0
},
email: function (e) {
return w(e, "[type=email],[" + o.attr("type") + "=email]", c)
},
url: function (e) {
return w(e, "[type=url],[" + o.attr("type") + "=url]", u)
},
date: function (e) {
return e.filter("[type^=date],[" + o.attr("type") + "=date]").length && "" !== e.val() ? null !== o.parseDate(e.val(), e.attr(o.attr("format"))) : !0
}
},
validateOnBlur: !0
},
destroy: function () {
a.fn.destroy.call(this), this.element.off(s)
},
_submit: function (e) {
return this.validate() ? !0 : (e.stopPropagation(), e.stopImmediatePropagation(), e.preventDefault(), !1)
},
_attachEvents: function () {
var t = this;
t.element.is(v) && t.element.on("submit" + s, b(t._submit, t)), t.options.validateOnBlur && (t.element.is(p) ? (t.element.on(g + s, function () {
t.validateInput(t.element)
}), t.element.is(f) && t.element.on("click" + s, function () {
t.validateInput(t.element)
})) : (t.element.on(g + s, p, function () {
t.validateInput(e(this))
}), t.element.on("click" + s, f, function () {
t.validateInput(e(this))
})))
},
validate: function () {
var e, t, n, i = this,
r = !1;
if (i._errors = {}, !i.element.is(p)) {
for (e = i.element.find(p), t = 0, n = e.length; n > t; t++) i.validateInput(e.eq(t)) || (r = !0);
return !r
}
return i.validateInput(i.element)
},
validateInput: function (t) {
var i, r, o, a, s, c, u, p, f;
return t = e(t), r = this, o = r._errorTemplate, a = r._checkValidity(t), s = a.valid, c = "." + l, u = t.attr(m) || "", p = r._findMessageContainer(u).add(t.next(c)).hide(), t.removeAttr("aria-invalid"), s || (i = r._extractMessage(t, a.key), r._errors[u] = i, f = e(o({
message: n(i)
})), r._decorateMessageContainer(f, u), p.replaceWith(f).length || f.insertAfter(t), f.show(), t.attr("aria-invalid", !0)), t.toggleClass(d, !s), s
},
hideMessages: function () {
var e = this,
t = "." + l,
n = e.element;
n.is(p) ? n.next(t).hide() : n.find(t).hide()
},
_findMessageContainer: function (e) {
var t, n = o.ui.validator.messageLocators,
i = this.element.find("." + l + "[" + o.attr("for") + "=" + e.replace(k, "\\$1") + "]");
for (t in n) i = i.add(n[t].locate(this.element, e));
return i
},
_decorateMessageContainer: function (e, t) {
var n, i = o.ui.validator.messageLocators;
e.addClass(l).attr(o.attr("for"), t || "");
for (n in i) i[n].decorate(e, t);
e.attr("role", "alert")
},
_extractMessage: function (t, n) {
var i = this,
r = i.options.messages[n],
a = t.attr(m);
return r = e.isFunction(r) ? r(t) : r, o.format(t.attr(o.attr(n + "-msg")) || t.attr("validationMessage") || t.attr("title") || r || "", a, t.attr(n))
},
_checkValidity: function (e) {
var t, n = this.options.rules;
for (t in n)
if (!n[t](e)) return {
valid: !1,
key: t
};
return {
valid: !0
}
},
errors: function () {
var e, t = [],
n = this._errors;
for (e in n) t.push(n[e]);
return t
}
}), o.ui.plugin(r)
}(window.kendo.jQuery),
function (e) {
function t(e, t) {
var n = e.x.location,
i = e.y.location,
r = t.x.location,
o = t.y.location,
a = n - r,
s = i - o;
return {
center: {
x: (n + r) / 2,
y: (i + o) / 2
},
distance: Math.sqrt(a * a + s * s)
}
}
function n(e) {
var t, n, i, r = [],
o = e.originalEvent,
s = e.currentTarget,
l = 0;
if (e.api) r.push({
id: 2,
event: e,
target: e.target,
currentTarget: e.target,
location: e
});
else if (e.type.match(/touch/))
for (n = o ? o.changedTouches : [], t = n.length; t > l; l++) i = n[l], r.push({
location: i,
event: e,
target: i.target,
currentTarget: s,
id: i.identifier
});
else a.pointers ? r.push({
location: o,
event: e,
target: e.target,
currentTarget: s,
id: o.pointerId
}) : r.push({
id: 1,
event: e,
target: e.target,
currentTarget: s,
location: e
});
return r
}
function i(t) {
t.preventDefault();
var n = e(t.data.root),
i = n.closest(".k-widget").parent();
i[0] || (i = n.parent()), i.trigger(e.Event(t.type, {
target: n[0]
}))
}
function r(e) {
for (var t = o.eventMap.up.split(" "), n = 0, i = t.length; i > n; n++) e(t[n])
}
var o = window.kendo,
a = o.support,
s = window.document,
l = e(s.documentElement),
d = o.Class,
c = o.Observable,
u = e.now,
p = e.extend,
f = a.mobileOS,
h = f && f.android,
g = a.browser.ie ? 5 : 0,
m = "press",
v = "select",
_ = "start",
b = "move",
y = "end",
w = "cancel",
x = "tap",
k = "release",
C = "gesturestart",
T = "gesturechange",
S = "gestureend",
A = "gesturetap",
F = d.extend({
init: function (e, t) {
var n = this;
n.axis = e, n._updateLocationData(t), n.startLocation = n.location, n.velocity = n.delta = 0, n.timeStamp = u()
},
move: function (e) {
var t = this,
n = e["page" + t.axis],
i = u(),
r = i - t.timeStamp || 1;
(n || !h) && (t.delta = n - t.location, t._updateLocationData(e), t.initialDelta = n - t.startLocation, t.velocity = t.delta / r, t.timeStamp = i)
},
_updateLocationData: function (e) {
var t = this,
n = t.axis;
t.location = e["page" + n], t.client = e["client" + n], t.screen = e["screen" + n]
}
}),
D = d.extend({
init: function (e, t, n) {
var i = this;
p(i, {
x: new F("X", n.location),
y: new F("Y", n.location),
userEvents: e,
target: t,
currentTarget: n.currentTarget,
initialTouch: n.target,
id: n.id,
_moved: !1,
_finished: !1
}), i.notifyInit = function () {
i._trigger(m, n)
}
},
move: function (e) {
var t = this;
if (!t._finished) {
if (t.x.move(e.location), t.y.move(e.location), !t._moved) {
if (t._withinIgnoreThreshold()) return;
if (I.current && I.current !== t.userEvents) return t.dispose();
t._start(e)
}
t._finished || t._trigger(b, e)
}
},
end: function (e) {
var t = this;
t.endTime = u(), t._finished || (t._moved ? t._trigger(y, e) : t._trigger(x, e), t._trigger(k, e), t.dispose())
},
dispose: function () {
var t = this,
n = t.userEvents,
i = n.touches;
t._finished = !0, i.splice(e.inArray(t, i), 1)
},
skip: function () {
this.dispose()
},
cancel: function () {
this.dispose()
},
isMoved: function () {
return this._moved
},
_start: function (e) {
this.startTime = u(), this._moved = !0, this._trigger(_, e)
},
_trigger: function (e, t) {
var n = this,
i = t.event,
r = {
touch: n,
x: n.x,
y: n.y,
target: n.target,
event: i
};
n.userEvents.notify(e, r) && i.preventDefault()
},
_withinIgnoreThreshold: function () {
var e = this.x.initialDelta,
t = this.y.initialDelta;
return Math.sqrt(e * e + t * t) <= this.userEvents.threshold
}
}),
I = c.extend({
init: function (t, n) {
var i, s, d = this,
u = o.guid();
n = n || {}, i = d.filter = n.filter, d.threshold = n.threshold || g, d.touches = [], d._maxTouches = n.multiTouch ? 2 : 1, d.allowSelection = n.allowSelection, d.eventNS = u, t = e(t).handler(d), c.fn.init.call(d), p(d, {
element: t,
surface: n.global ? l : e(n.surface || t),
stopPropagation: n.stopPropagation,
pressed: !1
}), d.surface.handler(d).on(o.applyEventMap("move", u), "_move").on(o.applyEventMap("up cancel", u), "_end"), t.on(o.applyEventMap("down", u), i, "_start"), a.pointers && t.css("-ms-touch-action", "pinch-zoom double-tap-zoom"), n.preventDragEvent && t.on(o.applyEventMap("dragstart", u), o.preventDefault), t.on(o.applyEventMap("mousedown selectstart", u), i, {
root: t
}, "_select"), a.eventCapture && (s = d.surface[0], d.preventIfMoving = function (e) {
d._isMoved() && e.preventDefault()
}, r(function (e) {
s.addEventListener(e, d.preventIfMoving, !0)
})), d.bind([m, x, _, b, y, k, w, C, T, S, A, v], n)
},
destroy: function () {
var e, t = this;
a.eventCapture && (e = t.surface[0], r(function (n) {
e.removeEventListener(n, t.preventIfMoving)
})), t.element.kendoDestroy(t.eventNS), t.surface.kendoDestroy(t.eventNS), t.element.removeData("handler"), t.surface.removeData("handler"), t._disposeAll(), t.unbind()
},
capture: function () {
I.current = this
},
cancel: function () {
this._disposeAll(), this.trigger(w)
},
notify: function (e, n) {
var i = this,
r = i.touches;
if (this._isMultiTouch()) {
switch (e) {
case b:
e = T;
break;
case y:
e = S;
break;
case x:
e = A
}
p(n, {
touches: r
}, t(r[0], r[1]))
}
return this.trigger(e, n)
},
press: function (e, t, n) {
this._apiCall("_start", e, t, n)
},
move: function (e, t) {
this._apiCall("_move", e, t)
},
end: function (e, t) {
this._apiCall("_end", e, t)
},
_isMultiTouch: function () {
return this.touches.length > 1
},
_maxTouchesReached: function () {
return this.touches.length >= this._maxTouches
},
_disposeAll: function () {
e.each(this.touches, function () {
this.dispose()
})
},
_isMoved: function () {
return e.grep(this.touches, function (e) {
return e.isMoved()
}).length
},
_select: function (e) {
(!this.allowSelection || this.trigger(v, {
event: e
})) && i(e)
},
_start: function (t) {
var i, r, o = this,
a = 0,
s = o.filter,
l = n(t),
d = l.length;
if (!o._maxTouchesReached())
for (I.current = null, o.currentTarget = t.currentTarget, o.stopPropagation && t.stopPropagation(); d > a && !o._maxTouchesReached(); a++) r = l[a], i = s ? e(r.currentTarget) : o.element, i.length && (r = new D(o, i, r), o.touches.push(r), r.notifyInit(), o._isMultiTouch() && o.notify("gesturestart", {}))
},
_move: function (e) {
this._eachTouch("move", e)
},
_end: function (e) {
this._eachTouch("end", e)
},
_eachTouch: function (e, t) {
var i, r, o, a, s = this,
l = {}, d = n(t),
c = s.touches;
for (i = 0; c.length > i; i++) r = c[i], l[r.id] = r;
for (i = 0; d.length > i; i++) o = d[i], a = l[o.id], a && a[e](o)
},
_apiCall: function (t, n, i, r) {
this[t]({
api: !0,
pageX: n,
pageY: i,
target: r || this.element,
stopPropagation: e.noop,
preventDefault: e.noop
})
}
});
o.getTouches = n, o.touchDelta = t, o.UserEvents = I
}(window.kendo.jQuery),
function (e, t) {
function n(t, n) {
try {
return e.contains(t, n) || t == n
} catch (i) {
return !1
}
}
function i(e) {
return D ? m.elementFromPoint(e.x.screen, e.y.screen) : m.elementFromPoint(e.x.client, e.y.client)
}
function r(e, t) {
return parseInt(e.css(t), 10) || 0
}
function o(e, t) {
return Math.min(Math.max(e, t.min), t.max)
}
function a(e, t) {
var n = k(e),
i = n.left + r(e, "borderLeftWidth") + r(e, "paddingLeft"),
o = n.top + r(e, "borderTopWidth") + r(e, "paddingTop"),
a = i + e.width() - t.outerWidth(!0),
s = o + e.height() - t.outerHeight(!0);
return {
x: {
min: i,
max: a
},
y: {
min: o,
max: s
}
}
}
function s(e, n, i) {
for (var r, o, a = 0, s = n && n.length, l = i && i.length; e && e.parentNode;) {
for (a = 0; s > a; a++)
if (r = n[a], r.element[0] === e) return {
target: r,
targetElement: e
};
for (a = 0; l > a; a++)
if (o = i[a], g.matchesSelector.call(e, o.options.filter)) return {
target: o,
targetElement: e
};
e = e.parentNode
}
return t
}
var l, d, c, u, p, f, h = window.kendo,
g = h.support,
m = window.document,
v = h.Class,
_ = h.ui.Widget,
b = h.Observable,
y = h.UserEvents,
w = e.proxy,
x = e.extend,
k = h.getOffset,
C = {}, T = {}, S = {}, A = g.mobileOS,
F = A && A.android,
D = F && "chrome" == A.browser,
I = "keyup",
E = "change",
P = "dragstart",
z = "drag",
H = "dragend",
R = "dragcancel",
O = "dragenter",
M = "dragleave",
N = "drop",
B = b.extend({
init: function (t, n) {
var i = this,
r = t[0];
i.capture = !1, e.each(h.eventMap.down.split(" "), function () {
r.addEventListener(this, w(i._press, i), !0)
}), e.each(h.eventMap.up.split(" "), function () {
r.addEventListener(this, w(i._release, i), !0)
}), b.fn.init.call(i), i.bind(["press", "release"], n || {})
},
captureNext: function () {
this.capture = !0
},
cancelCapture: function () {
this.capture = !1
},
_press: function (e) {
var t = this;
t.trigger("press"), t.capture && e.preventDefault()
},
_release: function (e) {
var t = this;
t.trigger("release"), t.capture && (e.preventDefault(), t.cancelCapture())
}
}),
L = b.extend({
init: function (t) {
var n = this;
b.fn.init.call(n), n.forcedEnabled = !1, e.extend(n, t), n.scale = 1, n.max = 0, n.horizontal ? (n.measure = "width", n.scrollSize = "scrollWidth", n.axis = "x") : (n.measure = "height", n.scrollSize = "scrollHeight", n.axis = "y")
},
outOfBounds: function (e) {
return e > this.max || this.min > e
},
forceEnabled: function () {
this.forcedEnabled = !0
},
getSize: function () {
return this.container[this.measure]()
},
getTotal: function () {
return this.element[0][this.scrollSize]
},
rescale: function (e) {
this.scale = e
},
update: function (e) {
var t = this,
n = t.getTotal(),
i = n * t.scale,
r = t.getSize();
t.size = r, t.total = i, t.min = Math.min(t.max, t.size - i), t.minScale = t.size / n, t.enabled = t.forcedEnabled || i > r, e || t.trigger(E, t)
}
}),
V = b.extend({
init: function (e) {
var t = this,
n = w(t.refresh, t);
b.fn.init.call(t), t.x = new L(x({
horizontal: !0
}, e)), t.y = new L(x({
horizontal: !1
}, e)), t.forcedMinScale = e.minScale, t.bind(E, e), h.onResize(n)
},
rescale: function (e) {
this.x.rescale(e), this.y.rescale(e), this.refresh()
},
refresh: function () {
var e = this;
e.x.update(), e.y.update(), e.enabled = e.x.enabled || e.y.enabled, e.minScale = e.forcedMinScale || Math.max(e.x.minScale, e.y.minScale), e.trigger(E)
}
}),
U = b.extend({
init: function (e) {
var t = this;
x(t, e), b.fn.init.call(t)
},
dragMove: function (e) {
var t = this,
n = t.dimension,
i = t.axis,
r = t.movable,
o = r[i] + e;
n.enabled && ((n.min > o && 0 > e || o > n.max && e > 0) && (e *= t.resistance), r.translateAxis(i, e), t.trigger(E, t))
}
}),
W = v.extend({
init: function (e) {
var t, n, i, r, o = this;
x(o, {
elastic: !0
}, e), i = o.elastic ? .5 : 0, r = o.movable, o.x = t = new U({
axis: "x",
dimension: o.dimensions.x,
resistance: i,
movable: r
}), o.y = n = new U({
axis: "y",
dimension: o.dimensions.y,
resistance: i,
movable: r
}), o.userEvents.bind(["move", "end", "gesturestart", "gesturechange"], {
gesturestart: function (e) {
o.gesture = e
},
gesturechange: function (e) {
var i, a = o.gesture,
s = a.center,
l = e.center,
d = e.distance / a.distance,
c = o.dimensions.minScale;
c >= r.scale && 1 > d && (d += .8 * (1 - d)), i = {
x: (r.x - s.x) * d + l.x - r.x,
y: (r.y - s.y) * d + l.y - r.y
}, r.scaleWith(d), t.dragMove(i.x), n.dragMove(i.y), o.dimensions.rescale(r.scale), o.gesture = e
},
move: function (e) {
e.event.target.tagName.match(/textarea|input/i) || (t.dimension.enabled || n.dimension.enabled ? (t.dragMove(e.x.delta), n.dragMove(e.y.delta), e.preventDefault()) : e.touch.skip())
},
end: function (e) {
e.preventDefault()
}
})
}
}),
j = g.transitions.prefix + "Transform",
q = Math.round;
d = g.hasHW3D ? function (e, t, n) {
return "translate3d(" + q(e) + "px," + q(t) + "px,0) scale(" + n + ")"
} : function (e, t, n) {
return "translate(" + q(e) + "px," + q(t) + "px) scale(" + n + ")"
}, c = b.extend({
init: function (t) {
var n = this;
b.fn.init.call(n), n.element = e(t), n.element[0].style.webkitTransformOrigin = "left top", n.x = 0, n.y = 0, n.scale = 1, n._saveCoordinates(d(n.x, n.y, n.scale))
},
translateAxis: function (e, t) {
this[e] += t, this.refresh()
},
scaleTo: function (e) {
this.scale = e, this.refresh()
},
scaleWith: function (e) {
this.scale *= e, this.refresh()
},
translate: function (e) {
this.x += e.x, this.y += e.y, this.refresh()
},
moveAxis: function (e, t) {
this[e] = t, this.refresh()
},
moveTo: function (e) {
x(this, e), this.refresh()
},
refresh: function () {
var e = this,
t = d(e.x, e.y, e.scale);
t != e.coordinates && (e.element[0].style[j] = t, e._saveCoordinates(t), e.trigger(E))
},
_saveCoordinates: function (e) {
this.coordinates = e
}
}), u = _.extend({
init: function (e, t) {
var n, i = this;
_.fn.init.call(i, e, t), n = i.options.group, n in T ? T[n].push(i) : T[n] = [i]
},
events: [O, M, N],
options: {
name: "DropTarget",
group: "default"
},
destroy: function () {
var e, t = this.options.group,
n = T[t] || S[t];
if (n.length > 1) {
for (_.fn.destroy.call(this), e = 0; n.length > e; e++)
if (n[e] == this) {
n.splice(e, 1);
break
}
} else u.destroyGroup(t)
},
_trigger: function (e, n) {
var i = this,
r = C[i.options.group];
return r ? i.trigger(e, x({}, n.event, {
draggable: r,
dropTarget: n.dropTarget
})) : t
},
_over: function (e) {
this._trigger(O, e)
},
_out: function (e) {
this._trigger(M, e)
},
_drop: function (e) {
var t = this,
n = C[t.options.group];
n && (n.dropped = !t._trigger(N, e))
}
}), u.destroyGroup = function (e) {
var t, n = T[e] || S[e];
if (n) {
for (t = 0; n.length > t; t++) _.fn.destroy.call(n[t]);
n.length = 0, delete T[e], delete S[e]
}
}, u._cache = T, p = u.extend({
init: function (e, t) {
var n, i = this;
_.fn.init.call(i, e, t), n = i.options.group, n in S ? S[n].push(i) : S[n] = [i]
},
options: {
name: "DropTargetArea",
group: "default",
filter: null
}
}), f = _.extend({
init: function (e, t) {
var n = this;
_.fn.init.call(n, e, t), n.userEvents = new y(n.element, {
global: !0,
stopPropagation: !0,
filter: n.options.filter,
threshold: n.options.distance,
start: w(n._start, n),
move: w(n._drag, n),
end: w(n._end, n),
cancel: w(n._cancel, n)
}), n._afterEndHandler = w(n._afterEnd, n), n.captureEscape = function (e) {
e.keyCode === h.keys.ESC && (n._trigger(R, {
event: e
}), n.userEvents.cancel())
}
},
events: [P, z, H, R],
options: {
name: "Draggable",
distance: 5,
group: "default",
cursorOffset: null,
axis: null,
container: null,
dropped: !1
},
_updateHint: function (t) {
var n, i = this,
r = i.options,
a = i.boundaries,
s = r.axis,
l = i.options.cursorOffset;
l ? n = {
left: t.x.location + l.left,
top: t.y.location + l.top
} : (i.hintOffset.left += t.x.delta, i.hintOffset.top += t.y.delta, n = e.extend({}, i.hintOffset)), a && (n.top = o(n.top, a.y), n.left = o(n.left, a.x)), "x" === s ? delete n.top : "y" === s && delete n.left, i.hint.css(n)
},
_start: function (t) {
var n, i = this,
r = i.options,
o = r.container,
s = r.hint;
i.currentTarget = t.target, i.currentTargetOffset = k(i.currentTarget), s && (i.hint && i.hint.stop(!0, !0).remove(), i.hint = e.isFunction(s) ? e(s.call(i, i.currentTarget)) : s, n = k(i.currentTarget), i.hintOffset = n, i.hint.css({
position: "absolute",
zIndex: 2e4,
left: n.left,
top: n.top
}).appendTo(m.body)), C[r.group] = i, i.dropped = !1, o && (i.boundaries = a(o, i.hint)), i._trigger(P, t) && (i.userEvents.cancel(), i._afterEnd()), e(m).on(I, i.captureEscape)
},
_drag: function (n) {
var i = this;
n.preventDefault(), i._withDropTarget(n, function (i, r) {
if (!i) return l && (l._trigger(M, x(n, {
dropTarget: e(l.targetElement)
})), l = null), t;
if (l) {
if (r === l.targetElement) return;
l._trigger(M, x(n, {
dropTarget: e(l.targetElement)
}))
}
i._trigger(O, x(n, {
dropTarget: e(r)
})), l = x(i, {
targetElement: r
})
}), i._trigger(z, n), i.hint && i._updateHint(n)
},
_end: function (t) {
var n = this;
n._withDropTarget(t, function (n, i) {
n && (n._drop(x({}, t, {
dropTarget: e(i)
})), l = null)
}), n._trigger(H, t), n._cancel(t.event)
},
_cancel: function () {
var e = this;
e.hint && !e.dropped ? setTimeout(function () {
e.hint.stop(!0, !0).animate(e.currentTargetOffset, "fast", e._afterEndHandler)
}, 0) : e._afterEnd()
},
_trigger: function (e, t) {
var n = this;
return n.trigger(e, x({}, t.event, {
x: t.x,
y: t.y,
currentTarget: n.currentTarget,
dropTarget: t.dropTarget
}))
},
_withDropTarget: function (e, t) {
var r, o, a = this,
l = a.options,
d = T[l.group],
c = S[l.group];
(d && d.length || c && c.length) && (r = i(e), a.hint && n(a.hint[0], r) && (a.hint.hide(), r = i(e), r || (r = i(e)), a.hint.show()), o = s(r, d, c), o ? t(o.target, o.targetElement) : t())
},
destroy: function () {
var e = this;
_.fn.destroy.call(e), e._afterEnd(), e.userEvents.destroy()
},
_afterEnd: function () {
var t = this;
t.hint && t.hint.remove(), delete C[t.options.group], t.trigger("destroy"), e(m).off(I, t.captureEscape)
}
}), h.ui.plugin(u), h.ui.plugin(p), h.ui.plugin(f), h.TapCapture = B, h.containerBoundaries = a, x(h.ui, {
Pane: W,
PaneDimensions: V,
Movable: c
})
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.mobile,
i = t.effects,
r = n.ui,
o = e.proxy,
a = e.extend,
s = r.Widget,
l = t.Class,
d = t.ui.Movable,
c = t.ui.Pane,
u = t.ui.PaneDimensions,
p = i.Transition,
f = i.Animation,
h = Math.abs,
g = 500,
m = .7,
v = .93,
_ = .5,
b = "km-scroller-release",
y = "km-scroller-refresh",
w = "pull",
x = "change",
k = "resize",
C = "scroll",
T = f.extend({
init: function (e) {
var t = this;
f.fn.init.call(t), a(t, e), t.userEvents.bind("gestureend", o(t.start, t)), t.tapCapture.bind("press", o(t.cancel, t))
},
done: function () {
return .01 > this.dimensions.minScale - this.movable.scale
},
tick: function () {
var e = this.movable;
e.scaleWith(1.1), this.dimensions.rescale(e.scale)
},
onEnd: function () {
var e = this.movable;
e.scaleTo(this.dimensions.minScale), this.dimensions.rescale(e.scale)
}
}),
S = f.extend({
init: function (e) {
var t = this;
f.fn.init.call(t), a(t, e, {
transition: new p({
axis: e.axis,
movable: e.movable,
onEnd: function () {
t._end()
}
})
}), t.tapCapture.bind("press", function () {
t.cancel()
}), t.userEvents.bind("end", o(t.start, t)), t.userEvents.bind("gestureend", o(t.start, t)), t.userEvents.bind("tap", o(t.onEnd, t))
},
onCancel: function () {
this.transition.cancel()
},
freeze: function (e) {
var t = this;
t.cancel(), t._moveTo(e)
},
onEnd: function () {
var e = this;
e._outOfBounds() ? e._snapBack() : e._end()
},
done: function () {
return 1 > h(this.velocity)
},
start: function (e) {
var t = this;
t.dimension.enabled && (t._outOfBounds() ? t._snapBack() : (t.velocity = 16 * e.touch[t.axis].velocity, t.velocity && (t.tapCapture.captureNext(), f.fn.start.call(t))))
},
tick: function () {
var e = this,
t = e.dimension,
n = e._outOfBounds() ? _ : v,
i = e.velocity *= n,
r = e.movable[e.axis] + i;
!e.elastic && t.outOfBounds(r) && (r = Math.max(Math.min(r, t.max), t.min), e.velocity = 0), e.movable.moveAxis(e.axis, r)
},
_end: function () {
this.tapCapture.cancelCapture(), this.end()
},
_outOfBounds: function () {
return this.dimension.outOfBounds(this.movable[this.axis])
},
_snapBack: function () {
var e = this,
t = e.dimension,
n = e.movable[e.axis] > t.max ? t.max : t.min;
e._moveTo(n)
},
_moveTo: function (e) {
this.transition.moveTo({
location: e,
duration: g,
ease: p.easeOutExpo
})
}
}),
A = l.extend({
init: function (t) {
var n = this,
i = "x" === t.axis,
r = e('');
a(n, t, {
element: r,
elementSize: 0,
movable: new d(r),
scrollMovable: t.movable,
size: i ? "width" : "height"
}), n.scrollMovable.bind(x, o(n._move, n)), n.container.append(r)
},
_move: function () {
var e = this,
t = e.axis,
n = e.dimension,
i = n.size,
r = e.scrollMovable,
o = i / n.total,
a = Math.round(-r[t] * o),
s = Math.round(i * o);
a + s > i ? s = i - a : 0 > a && (s += a, a = 0), e.elementSize != s && (e.element.css(e.size, s + "px"), e.elementSize = s), e.movable.moveAxis(t, a)
},
show: function () {
this.element.css({
opacity: m,
visibility: "visible"
})
},
hide: function () {
this.element.css({
opacity: 0
})
}
}),
F = s.extend({
init: function (n, i) {
var r, o, l, p, f, g, m, v = this;
return s.fn.init.call(v, n, i), n = v.element, v.options.useNative && t.support.hasNativeScrolling ? (n.addClass("km-native-scroller").prepend(''), a(v, {
scrollElement: n,
fixedContainer: n.children().first()
}), undefined) : (n.css("overflow", "hidden").addClass("km-scroll-wrapper").wrapInner('').prepend(''), r = n.children().eq(1), o = new t.TapCapture(n), l = new d(r), p = new u({
element: r,
container: n,
forcedEnabled: v.options.zoom,
change: function () {
v.trigger(k)
}
}), f = new t.UserEvents(n, {
allowSelection: !0,
preventDragEvent: !0,
multiTouch: v.options.zoom,
start: function (e) {
p.refresh();
var t = h(e.x.velocity),
n = h(e.y.velocity);
p.x.enabled && 2 * t >= n || p.y.enabled && 2 * n >= t ? f.capture() : f.cancel()
}
}), g = new c({
movable: l,
dimensions: p,
userEvents: f,
elastic: v.options.elastic
}), m = new T({
movable: l,
dimensions: p,
userEvents: f,
tapCapture: o
}), l.bind(x, function () {
v.scrollTop = -l.y, v.scrollLeft = -l.x, v.trigger(C, {
scrollTop: v.scrollTop,
scrollLeft: v.scrollLeft
})
}), a(v, {
movable: l,
dimensions: p,
zoomSnapBack: m,
userEvents: f,
pane: g,
tapCapture: o,
pulled: !1,
scrollElement: r,
fixedContainer: n.children().first()
}), v._initAxis("x"), v._initAxis("y"), p.refresh(), v.options.pullToRefresh && v._initPullToRefresh(), t.onResize(e.proxy(v.reset, v)), undefined)
},
scrollHeight: function () {
return this.scrollElement[0].scrollHeight
},
scrollWidth: function () {
return this.scrollElement[0].scrollWidth
},
options: {
name: "Scroller",
zoom: !1,
pullOffset: 140,
elastic: !0,
useNative: !1,
pullTemplate: "Pull to refresh",
releaseTemplate: "Release to refresh",
refreshTemplate: "Refreshing"
},
events: [w, C, k],
setOptions: function (e) {
var t = this;
s.fn.setOptions.call(t, e), e.pullToRefresh && t._initPullToRefresh()
},
reset: function () {
this.movable.moveTo({
x: 0,
y: 0
})
},
scrollTo: function (e, t) {
this.movable.moveTo({
x: e,
y: t
})
},
pullHandled: function () {
var e = this;
e.refreshHint.removeClass(y), e.hintContainer.html(e.pullTemplate({})), e.yinertia.onEnd(), e.xinertia.onEnd()
},
destroy: function () {
s.fn.destroy.call(this), this.userEvents.destroy()
},
_initPullToRefresh: function () {
var e = this;
e.dimensions.y.forceEnabled(), e.pullTemplate = t.template(e.options.pullTemplate), e.releaseTemplate = t.template(e.options.releaseTemplate), e.refreshTemplate = t.template(e.options.refreshTemplate), e.scrollElement.prepend('' + e.pullTemplate({}) + ""), e.refreshHint = e.scrollElement.children().first(), e.hintContainer = e.refreshHint.children(".km-template"), e.pane.y.bind("change", o(e._paneChange, e)), e.userEvents.bind("end", o(e._dragEnd, e))
},
_dragEnd: function () {
var e = this;
e.pulled && (e.pulled = !1, e.refreshHint.removeClass(b).addClass(y), e.hintContainer.html(e.refreshTemplate({})), e.yinertia.freeze(e.options.pullOffset / 2), e.trigger("pull"))
},
_paneChange: function () {
var e = this;
e.movable.y / _ > e.options.pullOffset ? e.pulled || (e.pulled = !0, e.refreshHint.removeClass(y).addClass(b), e.hintContainer.html(e.releaseTemplate({}))) : e.pulled && (e.pulled = !1, e.refreshHint.removeClass(b), e.hintContainer.html(e.pullTemplate({})))
},
_initAxis: function (e) {
var t = this,
n = t.movable,
i = t.dimensions[e],
r = t.tapCapture,
o = new A({
axis: e,
movable: n,
dimension: i,
container: t.element
}),
a = new S({
axis: e,
movable: n,
tapCapture: r,
userEvents: t.userEvents,
dimension: i,
elastic: t.options.elastic,
end: function () {
o.hide()
}
});
t[e + "inertia"] = a, t.pane[e].bind(x, function () {
o.show()
})
}
});
r.plugin(F)
}(window.kendo.jQuery),
function (e) {
function t(e) {
return e.position().top + 3
}
var n = window.kendo,
i = n.ui.Widget,
r = e.proxy,
o = ".kendoGroupable",
a = n.template('
', {
useWithBlock: !1
}),
s = function (t) {
return e('').css({
width: t.width(),
paddingLeft: t.css("paddingLeft"),
paddingRight: t.css("paddingRight"),
lineHeight: t.height() + "px",
paddingTop: t.css("paddingTop"),
paddingBottom: t.css("paddingBottom")
}).html(t.attr(n.attr("title")) || t.attr(n.attr("field"))).prepend('')
}, l = e(''),
d = /("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,
c = i.extend({
init: function (a, d) {
var c, u, p = this,
f = n.guid(),
h = r(p._intializePositions, p),
g = p._dropCuePositions = [];
i.fn.init.call(p, a, d), p.draggable = u = p.options.draggable || new n.ui.Draggable(p.element, {
filter: p.options.draggableElements,
hint: s,
group: f
}), c = p.groupContainer = e(p.options.groupContainer, p.element).kendoDropTarget({
group: u.options.group,
dragenter: function (e) {
p._canDrag(e.draggable.currentTarget) && (e.draggable.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add"), l.css({
top: t(c),
left: 0
}).appendTo(c))
},
dragleave: function (e) {
e.draggable.hint.find(".k-drag-status").removeClass("k-add").addClass("k-denied"), l.remove()
},
drop: function (t) {
var i, r = t.draggable.currentTarget,
o = r.attr(n.attr("field")),
a = r.attr(n.attr("title")),
s = p.indicator(o),
d = p._dropCuePositions,
c = d[d.length - 1];
(r.hasClass("k-group-indicator") || p._canDrag(r)) && (c ? (i = p._dropCuePosition(n.getOffset(l).left + parseInt(c.element.css("marginLeft"), 10) + parseInt(c.element.css("marginRight"), 10)), i && p._canDrop(e(s), i.element, i.left) && (i.before ? i.element.before(s || p.buildIndicator(o, a)) : i.element.after(s || p.buildIndicator(o, a)), p._change())) : (p.groupContainer.append(p.buildIndicator(o, a)), p._change()))
}
}).kendoDraggable({
filter: "div.k-group-indicator",
hint: s,
group: u.options.group,
dragcancel: r(p._dragCancel, p),
dragstart: function (e) {
var n = e.currentTarget,
i = parseInt(n.css("marginLeft"), 10),
r = n.position().left - i;
h(), l.css({
top: t(c),
left: r
}).appendTo(c), this.hint.find(".k-drag-status").removeClass("k-denied").addClass("k-add")
},
dragend: function () {
p._dragEnd(this)
},
drag: r(p._drag, p)
}).on("click" + o, ".k-button", function (t) {
t.preventDefault(), p._removeIndicator(e(this).parent())
}).on("click" + o, ".k-link", function (t) {
var i = e(this).parent(),
r = p.buildIndicator(i.attr(n.attr("field")), i.attr(n.attr("title")), "asc" == i.attr(n.attr("dir")) ? "desc" : "asc");
i.before(r).remove(), p._change(), t.preventDefault()
}), u.bind(["dragend", "dragcancel", "dragstart", "drag"], {
dragend: function () {
p._dragEnd(this)
},
dragcancel: r(p._dragCancel, p),
dragstart: function (e) {
var t, n, i;
return p.options.allowDrag || p._canDrag(e.currentTarget) ? (h(), g.length ? (t = g[g.length - 1].element, n = parseInt(t.css("marginRight"), 10), i = t.position().left + t.outerWidth() + n) : i = 0, undefined) : (e.preventDefault(), undefined)
},
drag: r(p._drag, p)
}), p.dataSource = p.options.dataSource, p.dataSource && (p._refreshHandler = r(p.refresh, p), p.dataSource.bind("change", p._refreshHandler))
},
refresh: function () {
var t = this,
i = t.dataSource;
t.groupContainer.empty().append(e.map(i.group() || [], function (e) {
var i = e.field.replace(d, "\\$1"),
r = t.element.find(t.options.filter).filter("[" + n.attr("field") + "=" + i + "]");
return t.buildIndicator(e.field, r.attr(n.attr("title")), e.dir)
}).join("")), t._invalidateGroupContainer()
},
destroy: function () {
var e = this;
i.fn.destroy.call(e), e.groupContainer.off(o).kendoDropTarget("destroy").kendoDraggable("destroy"), e.options.draggable || e.draggable.destroy(), e.dataSource && e._refreshHandler && e.dataSource.unbind("change", e._refreshHandler)
},
options: {
name: "Groupable",
filter: "th",
draggableElements: "th",
messages: {
empty: "Drag a column header and drop it here to group by that column"
}
},
indicator: function (t) {
var i = e(".k-group-indicator", this.groupContainer);
return e.grep(i, function (i) {
return e(i).attr(n.attr("field")) === t
})[0]
},
buildIndicator: function (e, t, i) {
return a({
field: e.replace(/"/g, "'"),
dir: i,
title: t,
ns: n.ns
})
},
descriptors: function () {
var t, i, r, o, a, s = this,
l = e(".k-group-indicator", s.groupContainer);
return t = s.element.find(s.options.filter).map(function () {
var t = e(this),
r = t.attr(n.attr("aggregates")),
s = t.attr(n.attr("field"));
if (r && "" !== r)
for (i = r.split(","), r = [], o = 0, a = i.length; a > o; o++) r.push({
field: s,
aggregate: i[o]
});
return r
}).toArray(), e.map(l, function (i) {
return i = e(i), r = i.attr(n.attr("field")), {
field: r,
dir: i.attr(n.attr("dir")),
aggregates: t || []
}
})
},
_removeIndicator: function (e) {
var t = this;
e.remove(), t._invalidateGroupContainer(), t._change()
},
_change: function () {
var e = this;
e.dataSource && e.dataSource.group(e.descriptors())
},
_dropCuePosition: function (t) {
var n, i, r, o, a = this._dropCuePositions;
if (l.is(":visible") && 0 !== a.length) return t = Math.ceil(t), n = a[a.length - 1], i = n.right, r = parseInt(n.element.css("marginLeft"), 10), o = parseInt(n.element.css("marginRight"), 10), t >= i ? t = {
left: n.element.position().left + n.element.outerWidth() + o,
element: n.element,
before: !1
} : (t = e.grep(a, function (e) {
return t >= e.left && e.right >= t
})[0], t && (t = {
left: t.element.position().left - r,
element: t.element,
before: !0
})), t
},
_drag: function (e) {
var t = this._dropCuePosition(e.x.location);
t && l.css({
left: t.left
})
},
_canDrag: function (e) {
var t = e.attr(n.attr("field"));
return "false" != e.attr(n.attr("groupable")) && t && (e.hasClass("k-group-indicator") || !this.indicator(t))
},
_canDrop: function (e, t, n) {
var i = e.next();
return e[0] !== t[0] && (!i[0] || t[0] !== i[0] || n > i.position().left)
},
_dragEnd: function (t) {
var i = this,
r = t.currentTarget.attr(n.attr("field")),
o = i.indicator(r);
t !== i.options.draggable && !t.dropped && o && i._removeIndicator(e(o)), i._dragCancel()
},
_dragCancel: function () {
l.remove(), this._dropCuePositions = []
},
_intializePositions: function () {
var t, i = this,
r = e(".k-group-indicator", i.groupContainer);
i._dropCuePositions = e.map(r, function (i) {
return i = e(i), t = n.getOffset(i).left, {
left: parseInt(t, 10),
right: parseInt(t + i.outerWidth(), 10),
element: i
}
})
},
_invalidateGroupContainer: function () {
var e = this.groupContainer;
e.is(":empty") && e.html(this.options.messages.empty)
}
});
n.ui.plugin(c)
}(window.kendo.jQuery),
function (e) {
function t(t, n) {
t = e(t), n ? t.find(".k-drag-status").removeClass("k-add").addClass("k-denied") : t.find(".k-drag-status").removeClass("k-denied").addClass("k-add")
}
var n = window.kendo,
i = n.ui.Widget,
r = "change",
o = "k-reorderable",
a = i.extend({
init: function (a, s) {
var l, d = this,
c = n.guid() + "-reorderable";
i.fn.init.call(d, a, s), a = d.element.addClass(o), s = d.options, d.draggable = l = s.draggable || new n.ui.Draggable(a, {
group: c,
filter: s.filter,
hint: s.hint
}), d.reorderDropCue = e('
'), a.find(l.options.filter).kendoDropTarget({
group: l.options.group,
dragenter: function (e) {
if (d._draggable) {
var i, r = this.element,
o = r[0] === d._draggable[0];
t(e.draggable.hint, o), o || (i = n.getOffset(r), d.reorderDropCue.css({
height: r.outerHeight(),
top: i.top,
left: i.left + (r.index() > d._draggable.index() ? r.outerWidth() : 0)
}).appendTo(document.body))
}
},
dragleave: function (e) {
t(e.draggable.hint, !0), d.reorderDropCue.remove()
},
drop: function () {
if (d._draggable) {
var e, t = d._draggable[0],
n = this.element[0];
t !== n && (e = a.find(l.options.filter), d.trigger(r, {
element: d._draggable,
oldIndex: e.index(t),
newIndex: e.index(n)
}))
}
}
}), l.bind(["dragcancel", "dragend", "dragstart"], {
dragcancel: function () {
d.reorderDropCue.remove(), d._draggable = null
},
dragend: function () {
d.reorderDropCue.remove(), d._draggable = null
},
dragstart: function (e) {
d._draggable = e.currentTarget
}
})
},
options: {
name: "Reorderable",
filter: "*"
},
events: [r],
destroy: function () {
var e = this;
i.fn.destroy.call(e), e.draggable && e.draggable.destroy(), n.destroy(e.element)
}
});
n.ui.plugin(a)
}(window.kendo.jQuery),
function (e, t) {
var n = window.kendo,
i = n.ui,
r = i.Widget,
o = e.proxy,
a = e.isFunction,
s = e.extend,
l = "horizontal",
d = "vertical",
c = "start",
u = "resize",
p = "resizeend",
f = r.extend({
init: function (e, t) {
var n = this;
r.fn.init.call(n, e, t), n.orientation = n.options.orientation.toLowerCase() != d ? l : d, n._positionMouse = n.orientation == l ? "x" : "y", n._position = n.orientation == l ? "left" : "top", n._sizingDom = n.orientation == l ? "outerWidth" : "outerHeight", n.draggable = new i.Draggable(e, {
distance: 0,
filter: t.handle,
drag: o(n._resize, n),
dragcancel: o(n._cancel, n),
dragstart: o(n._start, n),
dragend: o(n._stop, n)
}), n.userEvents = n.draggable.userEvents
},
events: [u, p, c],
options: {
name: "Resizable",
orientation: l
},
_max: function (e) {
var n = this,
i = n.hint ? n.hint[n._sizingDom]() : 0,
r = n.options.max;
return a(r) ? r(e) : r !== t ? n._initialElementPosition + r - i : r
},
_min: function (e) {
var n = this,
i = n.options.min;
return a(i) ? i(e) : i !== t ? n._initialElementPosition + i : i
},
_start: function (t) {
var n = this,
i = n.options.hint,
r = e(t.currentTarget);
n._initialElementPosition = r.position()[n._position], n._initialMousePosition = t[n._positionMouse].startLocation, i && (n.hint = a(i) ? e(i(r)) : i, n.hint.css({
position: "absolute"
}).css(n._position, n._initialElementPosition).appendTo(n.element)), n.trigger(c, t), n._maxPosition = n._max(t), n._minPosition = n._min(t), e(document.body).css("cursor", r.css("cursor"))
},
_resize: function (n) {
var i, r = this,
o = (e(n.currentTarget), r._maxPosition),
a = r._minPosition,
l = r._initialElementPosition + (n[r._positionMouse].location - r._initialMousePosition);
i = a !== t ? Math.max(a, l) : l, r.position = i = o !== t ? Math.min(o, i) : i, r.hint && r.hint.toggleClass(r.options.invalidClass || "", i == o || i == a).css(r._position, i), r.resizing = !0, r.trigger(u, s(n, {
position: i
}))
},
_stop: function (t) {
var n = this;
n.hint && n.hint.remove(), n.resizing = !1, n.trigger(p, s(t, {
position: n.position
})), e(document.body).css("cursor", "")
},
_cancel: function (e) {
var n = this;
n.hint && (n.position = t, n.hint.css(n._position, n._initialElementPosition), n._stop(e))
},
destroy: function () {
var e = this;
r.fn.destroy.call(e), e.draggable && e.draggable.destroy()
},
press: function (e) {
if (e) {
var t = e.position(),
n = this;
n.userEvents.press(t.left, t.top, e[0]), n.targetPosition = t, n.target = e
}
},
move: function (e) {
var n = this,
i = n._position,
r = n.targetPosition,
o = n.position;
o === t && (o = r[i]), r[i] = o + e, n.userEvents.move(r.left, r.top)
},
end: function () {
this.userEvents.end(), this.target = this.position = t
}
});
n.ui.plugin(f)
}(window.kendo.jQuery),
function (e, t) {
var n = window.kendo,
i = e.proxy,
r = "dir",
o = "asc",
a = "single",
s = "field",
l = "desc",
d = ".kendoSortable",
c = ".k-link",
u = "aria-sort",
p = n.ui.Widget,
f = p.extend({
init: function (e, t) {
var n, r = this;
p.fn.init.call(r, e, t), r._refreshHandler = i(r.refresh, r), r.dataSource = r.options.dataSource.bind("change", r._refreshHandler), n = r.element.find(c), n[0] || (n = r.element.wrapInner('').find(c)), r.link = n, r.element.on("click" + d, i(r._click, r))
},
options: {
name: "Sortable",
mode: a,
allowUnsort: !0
},
destroy: function () {
var e = this;
p.fn.destroy.call(e), e.element.off(d), e.dataSource.unbind("change", e._refreshHandler)
},
refresh: function () {
var t, i, a, d, c = this,
p = c.dataSource.sort() || [],
f = c.element,
h = f.attr(n.attr(s));
for (f.removeAttr(n.attr(r)), f.removeAttr(u), t = 0, i = p.length; i > t; t++) a = p[t], h == a.field && f.attr(n.attr(r), a.dir);
d = f.attr(n.attr(r)), f.find(".k-i-arrow-n,.k-i-arrow-s").remove(), d === o ? (e('').appendTo(c.link), f.attr(u, "ascending")) : d === l && (e('').appendTo(c.link), f.attr(u, "descending"))
},
_click: function (e) {
var i, d, c = this,
u = c.element,
p = u.attr(n.attr(s)),
f = u.attr(n.attr(r)),
h = c.options,
g = c.dataSource.sort() || [];
if (f = f === o ? l : f === l && h.allowUnsort ? t : o, h.mode === a) g = [{
field: p,
dir: f
}];
else if ("multiple" === h.mode) {
for (i = 0, d = g.length; d > i; i++)
if (g[i].field === p) {
g.splice(i, 1);
break
}
g.push({
field: p,
dir: f
})
}
e.preventDefault(), c.dataSource.sort(g)
}
});
n.ui.plugin(f)
}(window.kendo.jQuery),
function (e) {
function t(e, t) {
var n = r.getOffset(e),
i = t.left + t.width,
o = t.top + t.height;
return n.right = n.left + e.outerWidth(), n.bottom = n.top + e.outerHeight(), !(n.left > i || n.right < t.left || n.top > o || n.bottom < t.top)
}
function n(e, n, i, r) {
var o, a, s;
for (o = 0, a = e.length; a > o; o++) s = e.eq(o), t(s, i) ? s.hasClass(d) ? r && n !== s[0] && s.removeClass(d).addClass(h) : s.hasClass(c) || s.hasClass(h) || s.addClass(c) : s.hasClass(c) ? s.removeClass(c) : r && s.hasClass(h) && s.removeClass(h).addClass(d)
}
var i, r = window.kendo,
o = r.ui.Widget,
a = e.proxy,
s = Math.abs,
l = "aria-selected",
d = "k-state-selected",
c = "k-state-selecting",
u = "k-selectable",
p = "change",
f = ".kendoSelectable",
h = "k-state-unselecting",
g = !1;
(function (e) {
(function () {
e('
').on("click", ">*", function () {
g = !0
}).find("span").click().end().off()
})()
})(e), i = o.extend({
init: function (t, n) {
var i, s = this;
o.fn.init.call(s, t, n), s._marquee = e(""), s._lastActive = null, s.element.addClass(u), i = s.options.multiple, s.userEvents = new r.UserEvents(s.element, {
global: !0,
allowSelection: !0,
filter: (g ? "" : "." + u + " ") + s.options.filter,
tap: a(s._tap, s)
}), i && s.userEvents.bind("start", a(s._start, s)).bind("move", a(s._move, s)).bind("end", a(s._end, s)).bind("select", a(s._select, s))
},
events: [p],
options: {
name: "Selectable",
filter: ">*",
multiple: !1
},
_tap: function (t) {
var n, i = e(t.target),
r = this,
o = t.event.ctrlKey || t.event.metaKey,
a = r.options.multiple,
s = a && t.event.shiftKey,
l = t.event.which,
c = t.event.button;
i.closest("." + u)[0] !== r.element[0] || l && 3 == l || c && 2 == c || (n = i.hasClass(d), a && o || r.clear(), s ? r.selectRange(r._firstSelectee(), i) : (n && o ? (r._unselect(i), r._notify(p)) : r.value(i), r._lastActive = r._downTarget = i))
},
_start: function (t) {
var n = this,
i = e(t.target),
r = i.hasClass(d),
o = t.event.ctrlKey || t.event.metaKey;
return n._downTarget = i, i.closest("." + u)[0] !== n.element[0] ? (n.userEvents.cancel(), n._downTarget = null, undefined) : (n._marquee.appendTo(document.body).css({
left: t.x.client + 1,
top: t.y.client + 1,
width: 0,
height: 0
}), o || n.clear(), r && (n._selectElement(i, !0), o && i.addClass(h)), undefined)
},
_move: function (e) {
var t = this,
i = {
left: e.x.startLocation > e.x.location ? e.x.location : e.x.startLocation,
top: e.y.startLocation > e.y.location ? e.y.location : e.y.startLocation,
width: s(e.x.initialDelta),
height: s(e.y.initialDelta)
}, r = t.element.find(t.options.filter);
t._marquee.css(i), n(r, t._downTarget[0], i, e.event.ctrlKey || e.event.metaKey), e.preventDefault()
},
_end: function () {
var e = this;
e._marquee.remove(), e._unselect(e.element.find(e.options.filter + "." + h)).removeClass(h), e.value(e.element.find(e.options.filter + "." + c)), e._lastActive = e._downTarget
},
value: function (e) {
var t = this,
n = a(t._selectElement, t);
return e ? (e.each(function () {
n(this)
}), t._notify(p), undefined) : t.element.find(t.options.filter + "." + d)
},
_firstSelectee: function () {
var e, t = this;
return null !== t._lastActive ? t._lastActive : (e = t.value(), e.length > 0 ? e[0] : t.element.find(t.options.filter))
},
_selectElement: function (t, n) {
var i = e(t),
r = !n && this._notify("select", {
element: t
});
i.removeClass(c), r || (i.addClass(d), this.options.aria && i.attr(l, !0))
},
_notify: function (e, t) {
return t = t || {}, this.trigger(e, t)
},
_unselect: function (e) {
return e.removeClass(d), this.options.aria && e.attr(l, !1), e
},
_select: function (t) {
e(t.event.target).is("input,a,textarea") ? (this.userEvents.cancel(), this._downTarget = null) : t.preventDefault()
},
clear: function () {
var e = this.element.find(this.options.filter + "." + d);
this._unselect(e)
},
selectRange: function (t, n) {
var i, r, o, s, l = this,
c = !1,
u = l.element.find(l.options.filter),
f = a(l._selectElement, l);
for (t = e(t)[0], n = e(n)[0], i = 0, r = u.length; r > i; i++) s = u[i], c ? (f(s), c = s !== n) : s === t ? (c = t !== n, f(s)) : s === n ? (o = t, t = n, n = o, c = !0, f(s)) : e(s).removeClass(d);
l._notify(p)
},
destroy: function () {
var e = this;
o.fn.destroy.call(e), e.element.off(f), e.userEvents.destroy()
}
}), r.ui.plugin(i)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n, i) {
return e({
idx: t,
text: n,
ns: d.ns,
numeric: i
})
}
function i(e, t) {
return x({
className: e.substring(1),
text: t
})
}
function r(e, t, n, i) {
e.find(t).parent().attr(d.attr("page"), n).attr("tabindex", -1).toggleClass("k-state-disabled", i)
}
function o(e, t) {
r(e, f, 1, 1 >= t)
}
function a(e, t) {
r(e, g, Math.max(1, t - 1), 1 >= t)
}
function s(e, t, n) {
r(e, m, Math.min(n, t + 1), t >= n)
}
function l(e, t, n) {
r(e, h, n, t >= n)
}
var d = window.kendo,
c = d.ui,
u = c.Widget,
p = e.proxy,
f = ".k-i-seek-w",
h = ".k-i-seek-e",
g = ".k-i-arrow-w",
m = ".k-i-arrow-e",
v = "change",
_ = ".kendoPager",
b = "click",
y = "keydown",
w = "disabled",
x = d.template('#=text#'),
k = u.extend({
init: function (t, n) {
var r, c, w = this;
u.fn.init.call(w, t, n), n = w.options, w.dataSource = d.data.DataSource.create(n.dataSource), w.linkTemplate = d.template(w.options.linkTemplate), w.selectTemplate = d.template(w.options.selectTemplate), r = w.page(), c = w.totalPages(), w._refreshHandler = p(w.refresh, w), w.dataSource.bind(v, w._refreshHandler), n.previousNext && (w.element.find(f).length || (w.element.append(i(f, n.messages.first)), o(w.element, r, c)), w.element.find(g).length || (w.element.append(i(g, n.messages.previous)), a(w.element, r, c))), n.numeric && (w.list = w.element.find(".k-pager-numbers"), w.list.length || (w.list = e('
',
buttonCount: 10,
autoBind: !0,
numeric: !0,
info: !0,
input: !1,
previousNext: !0,
pageSizes: !1,
refresh: !1,
messages: {
display: "{0} - {1} of {2} items",
empty: "No items to display",
page: "Page",
of: "of {0}",
itemsPerPage: "items per page",
first: "Go to the first page",
previous: "Go to the previous page",
next: "Go to the next page",
last: "Go to the last page",
refresh: "Refresh"
}
},
setDataSource: function (e) {
var t = this;
t.dataSource.unbind(v, t._refreshHandler), t.dataSource = t.options.dataSource = e, e.bind(v, t._refreshHandler), t.options.autoBind && e.fetch()
},
refresh: function () {
var e, t, i, r = this,
c = 1,
u = "",
p = r.page(),
f = r.options,
h = r.pageSize(),
g = r.dataSource.total(),
m = r.totalPages(),
v = r.linkTemplate,
_ = f.buttonCount;
if (f.numeric) {
for (p > _ && (i = p % _, c = 0 === i ? p - _ + 1 : p - i + 1), t = Math.min(c + _ - 1, m), c > 1 && (u += n(v, c - 1, "...", !1)), e = c; t >= e; e++) u += n(e == p ? r.selectTemplate : v, e, e, !0);
m > t && (u += n(v, e, "...", !1)), "" === u && (u = r.selectTemplate({
text: 0
})), r.list.html(u)
}
f.info && (u = g > 0 ? d.format(f.messages.display, (p - 1) * h + 1, Math.min(p * h, g), g) : f.messages.empty, r.element.find(".k-pager-info").html(u)), f.input && r.element.find(".k-pager-input").html(r.options.messages.page + '' + d.format(f.messages.of, m)).find("input").val(p).attr(w, 1 > g).toggleClass("k-state-disabled", 1 > g), f.previousNext && (o(r.element, p, m), a(r.element, p, m), s(r.element, p, m), l(r.element, p, m)), f.pageSizes && r.element.find(".k-pager-sizes select").val(h).filter("[" + d.attr("role") + "=dropdownlist]").kendoDropDownList("value", h).kendoDropDownList("text", h)
},
_keydown: function (e) {
if (e.keyCode === d.keys.ENTER) {
var t = this.element.find(".k-pager-input").find("input"),
n = parseInt(t.val(), 10);
(isNaN(n) || 1 > n || n > this.totalPages()) && (n = this.page()), t.val(n), this.page(n)
}
},
_refreshClick: function (e) {
e.preventDefault(), this.dataSource.read()
},
_change: function (e) {
var t = parseInt(e.currentTarget.value, 10);
isNaN(t) || this.dataSource.pageSize(t)
},
_click: function (t) {
var n = e(t.currentTarget);
t.preventDefault(), n.is(".k-state-disabled") || this.page(n.attr(d.attr("page")))
},
totalPages: function () {
return Math.ceil((this.dataSource.total() || 0) / this.pageSize())
},
pageSize: function () {
return this.dataSource.pageSize() || this.dataSource.total()
},
page: function (e) {
return e === t ? this.dataSource.total() > 0 ? this.dataSource.page() : 0 : (this.dataSource.page(e), this.trigger(v, {
index: e
}), t)
}
});
c.plugin(k)
}(window.kendo.jQuery),
function (e) {
function t(t, n) {
return t === n || e.contains(t, n)
}
var n = window.kendo,
i = n.ui,
r = i.Widget,
o = n.support,
a = n.getOffset,
s = n._activeElement,
l = "open",
d = "close",
c = "deactivate",
u = "activate",
p = "center",
f = "left",
h = "right",
g = "top",
m = "bottom",
v = "absolute",
_ = "hidden",
b = "body",
y = "location",
w = "position",
x = "visible",
k = "effects",
C = "k-state-active",
T = "k-state-border",
S = /k-state-border-(\w+)/,
A = ".k-picker-wrap, .k-dropdown-wrap, .k-link",
F = "down",
D = e(window),
I = e(document.documentElement),
E = "resize scroll",
P = o.transitions.css,
z = P + "transform",
H = e.extend,
R = ".kendoPopup",
O = ["font-family", "font-size", "font-stretch", "font-style", "font-weight", "line-height"],
M = r.extend({
init: function (t, i) {
var o, a = this;
i = i || {}, i.isRtl && (i.origin = i.origin || m + " " + h, i.position = i.position || g + " " + h), r.fn.init.call(a, t, i), t = a.element, i = a.options, a.collisions = i.collision ? i.collision.split(" ") : [], 1 === a.collisions.length && a.collisions.push(a.collisions[0]), o = e(a.options.anchor).closest(".k-popup,.k-group").filter(":not([class^=km-])"), i.appendTo = e(e(i.appendTo)[0] || o[0] || b), a.element.hide().addClass("k-popup k-group k-reset").toggleClass("k-rtl", !! i.isRtl).css({
position: v
}).appendTo(i.appendTo).on("mouseenter" + R, function () {
a._hovered = !0
}).on("mouseleave" + R, function () {
a._hovered = !1
}), a.wrapper = e(), i.animation === !1 && (i.animation = {
open: {
effects: {}
},
close: {
hide: !0,
effects: {}
}
}), H(i.animation.open, {
complete: function () {
a.wrapper.css({
overflow: x
}), a.trigger(u)
}
}), H(i.animation.close, {
complete: function () {
a.wrapper.hide();
var r, o, s = a.wrapper.data(y),
l = e(i.anchor);
s && a.wrapper.css(s), i.anchor != b && (r = (l[0].className.match(S) || ["", "down"])[1], o = T + "-" + r, l.removeClass(o).children(A).removeClass(C).removeClass(o), t.removeClass(T + "-" + n.directions[r].reverse)), a._closing = !1, a.trigger(c)
}
}), a._mousedownProxy = function (e) {
a._mousedown(e)
}, a._resizeProxy = function (e) {
a._resize(e)
}, i.toggleTarget && e(i.toggleTarget).on(i.toggleEvent + R, e.proxy(a.toggle, a))
},
events: [l, u, d, c],
options: {
name: "Popup",
toggleEvent: "click",
origin: m + " " + f,
position: g + " " + f,
anchor: b,
collision: "flip fit",
viewport: window,
copyAnchorStyles: !0,
animation: {
open: {
effects: "slideIn:down",
transition: !0,
duration: 200
},
close: {
duration: 100,
hide: !0
}
}
},
destroy: function () {
var t, i = this,
o = i.options,
a = i.element.off(R);
r.fn.destroy.call(i), o.toggleTarget && e(o.toggleTarget).off(R), I.unbind(F, i._mousedownProxy), D.unbind(E, i._resizeProxy), o.appendTo[0] === document.body && (t = a.parent(".k-animation-container"), t[0] ? t.remove() : a.remove()), n.destroy(i.element.children())
},
open: function (t, i) {
var r, a, s, d = this,
c = {
isFixed: !isNaN(parseInt(i, 10)),
x: t,
y: i
}, u = d.element,
p = d.options,
f = "down",
h = e(p.anchor);
if (!d.visible()) {
if (p.copyAnchorStyles && u.css(n.getComputedStyles(h[0], O)), u.data("animating") || d.trigger(l)) return;
I.unbind(F, d._mousedownProxy).bind(F, d._mousedownProxy), o.mobileOS.ios || o.mobileOS.android || D.unbind(E, d._resizeProxy).bind(E, d._resizeProxy), d.wrapper = a = n.wrap(u).css({
overflow: _,
display: "block",
position: v
}), o.mobileOS.android && a.add(h).css(z, "translatez(0)"), a.css(w), e(p.appendTo)[0] == document.body && a.css(g, "-10000px"), r = H(!0, {}, p.animation.open), d.flipped = d._position(c), r.effects = n.parseEffects(r.effects, d.flipped), f = r.effects.slideIn ? r.effects.slideIn.direction : f, p.anchor != b && (s = T + "-" + f, u.addClass(T + "-" + n.directions[f].reverse), h.addClass(s).children(A).addClass(C).addClass(s)), u.data(k, r.effects).kendoStop(!0).kendoAnimate(r)
}
},
toggle: function () {
var e = this;
e[e.visible() ? d : l]()
},
visible: function () {
return this.element.is(":" + x)
},
close: function () {
var t, i, r, o, a = this,
s = a.options;
if (a.visible()) {
if (t = a.wrapper[0] ? a.wrapper : n.wrap(a.element).hide(), a._closing || a.trigger(d)) return;
a.element.find(".k-popup").each(function () {
var t = e(this),
n = t.data("kendoPopup");
n && n.close()
}), I.unbind(F, a._mousedownProxy), D.unbind(E, a._resizeProxy), i = H(!0, {}, s.animation.close), r = a.element.data(k), o = i.effects, !o && !n.size(o) && r && n.size(r) && (i.effects = r, i.reverse = !0), a._closing = !0, a.element.kendoStop(!0), t.css({
overflow: _
}), a.element.kendoAnimate(i)
}
},
_resize: function (e) {
var n = this;
"resize" === e.type ? (clearTimeout(n._resizeTimeout), n._resizeTimeout = setTimeout(function () {
n._position(), n._resizeTimeout = null
}, 50)) : n._hovered || t(n.element[0], s()) || n.close()
},
_mousedown: function (i) {
var r = this,
o = r.element[0],
a = r.options,
s = e(a.anchor)[0],
l = a.toggleTarget,
d = n.eventTarget(i),
c = e(d).closest(".k-popup"),
u = c.parent().parent(".km-shim").length;
c = c[0], (u || !c || c === r.element[0]) && (t(o, d) || t(s, d) || l && t(e(l)[0], d) || r.close())
},
_fit: function (e, t, n) {
var i = 0;
return e + t > n && (i = n - (e + t)), 0 > e && (i = -e), i
},
_flip: function (e, t, n, i, r, o, a) {
var s = 0;
return a = a || t, o !== r && o !== p && r !== p && (e + a > i && (s += -(n + t)), 0 > e + s && (s += n + t)), s
},
_position: function (t) {
var n, i, r, s, l, d, c, u, p, f = this,
h = f.element.css(w, ""),
g = f.wrapper,
m = f.options,
_ = e(m.viewport),
b = e(_).offset(),
x = e(m.anchor),
k = m.origin.toLowerCase().split(" "),
C = m.position.toLowerCase().split(" "),
T = f.collisions,
S = o.zoomLevel(),
A = 10002,
F = 0,
D = x.parents().filter(g.siblings());
if (D[0])
if (i = Number(e(D).css("zIndex"))) A = i + 1;
else
for (n = x.parentsUntil(D), r = n.length; r > F; F++) i = Number(e(n[F]).css("zIndex")), i && i > A && (A = i + 1);
return g.css("zIndex", A), t && t.isFixed ? g.css({
left: t.x,
top: t.y
}) : g.css(f._align(k, C)), s = a(g, w, x[0] === g.offsetParent()[0]), l = a(g), d = x.offsetParent().parent(".k-animation-container,.k-popup,.k-group"), d.length && (s = a(g, w, !0), l = a(g)), _[0] === window ? (l.top -= window.pageYOffset || document.documentElement.scrollTop || 0, l.left -= window.pageXOffset || document.documentElement.scrollLeft || 0) : (l.top -= b.top, l.left -= b.left), f.wrapper.data(y) || g.data(y, H({}, s)), c = H({}, l), u = H({}, s), "fit" === T[0] && (u.top += f._fit(c.top, g.outerHeight(), _.height() / S)), "fit" === T[1] && (u.left += f._fit(c.left, g.outerWidth(), _.width() / S)), p = H({}, u), "flip" === T[0] && (u.top += f._flip(c.top, h.outerHeight(), x.outerHeight(), _.height() / S, k[0], C[0], g.outerHeight())), "flip" === T[1] && (u.left += f._flip(c.left, h.outerWidth(), x.outerWidth(), _.width() / S, k[1], C[1], g.outerWidth())), h.css(w, v), g.css(u), u.left != p.left || u.top != p.top
},
_align: function (t, n) {
var i, r = this,
o = r.wrapper,
s = e(r.options.anchor),
l = t[0],
d = t[1],
c = n[0],
u = n[1],
f = a(s),
g = e(r.options.appendTo),
v = o.outerWidth(),
_ = o.outerHeight(),
b = s.outerWidth(),
y = s.outerHeight(),
w = f.top,
x = f.left,
k = Math.round;
return g[0] != document.body && (i = a(g), w -= i.top, x -= i.left), l === m && (w += y), l === p && (w += k(y / 2)), c === m && (w -= _), c === p && (w -= k(_ / 2)), d === h && (x += b), d === p && (x += k(b / 2)), u === h && (x -= v), u === p && (x -= k(v / 2)), {
top: w,
left: x
}
}
});
i.plugin(M)
}(window.kendo.jQuery),
function (e) {
function t(e) {
for (; e.length;) n(e), e = e.parent()
}
function n(e) {
var t = e.data(o.ns + "title");
t && (e.attr("title", t), e.removeData(o.ns + "title"))
}
function i(e) {
var t = e.attr("title");
t && (e.data(o.ns + "title", t), e.attr("title", ""))
}
function r(e) {
for (; e.length && !e.is("body");) i(e), e = e.parent()
}
var o = window.kendo,
a = o.ui.Widget,
s = o.ui.Popup,
l = e.isFunction,
d = e.isPlainObject,
c = e.extend,
u = e.proxy,
p = e(document),
f = o.isLocalUrl,
h = "_tt_active",
g = "aria-describedby",
m = "show",
v = "hide",
_ = "error",
b = "contentLoad",
y = "requestStart",
w = "k-content-frame",
x = '
',
k = o.template(""),
C = ".kendoTooltip",
T = {
bottom: {
origin: "bottom center",
position: "top center"
},
top: {
origin: "top center",
position: "bottom center"
},
left: {
origin: "center left",
position: "center right",
collision: "fit flip"
},
right: {
origin: "center right",
position: "center left",
collision: "fit flip"
},
center: {
position: "center center",
origin: "center center"
}
}, S = {
top: "bottom",
bottom: "top",
left: "right",
right: "left",
center: "center"
}, A = {
bottom: "n",
top: "s",
left: "e",
right: "w",
center: "n"
}, F = {
horizontal: {
offset: "top",
size: "height"
},
vertical: {
offset: "left",
size: "width"
}
}, D = function (e) {
return e.target.data(o.ns + "title")
}, I = a.extend({
init: function (e, t) {
var n, i = this;
a.fn.init.call(i, e, t), n = i.options.position.match(/left|right/) ? "horizontal" : "vertical", i.dimensions = F[n], i._documentKeyDownHandler = u(i._documentKeyDown, i), i.element.on(i.options.showOn + C, i.options.filter, u(i._showOn, i)).on("mouseenter" + C, i.options.filter, u(i._mouseenter, i)), this.options.autoHide && i.element.on("mouseleave" + C, i.options.filter, u(i._mouseleave, i))
},
options: {
name: "Tooltip",
filter: "",
content: D,
showAfter: 100,
callout: !0,
position: "bottom",
showOn: "mouseenter",
autoHide: !0,
animation: {
open: {
effects: "fade:in",
duration: 0
},
close: {
effects: "fade:out",
duration: 40,
hide: !0
}
}
},
events: [m, v, b, _, y],
_mouseenter: function (t) {
r(e(t.currentTarget))
},
_showOn: function (t) {
var n = this;
n.options.showOn && n.options.showOn.match(/click|focus/) ? n._show(e(t.currentTarget)) : (clearTimeout(n.timeout), n.timeout = setTimeout(function () {
n._show(e(t.currentTarget))
}, n.options.showAfter))
},
_appendContent: function (e) {
var t, n = this,
i = n.options.content,
r = n.content,
a = n.options.iframe;
d(i) && i.url ? ("iframe" in n.options || (a = !f(i.url)), n.trigger(y, {
options: i,
target: e
}), a ? (r.hide(), t = r.find("." + w)[0], t ? t.src = i.url || t.src : r.html(k({
content: i
})), r.find("." + w).off("load" + C).on("load" + C, function () {
n.trigger(b), r.show()
})) : (r.empty(), o.ui.progress(r, !0), n._ajaxRequest(i))) : i && l(i) ? (i = i({
target: e
}), n.content.html(i || "")) : n.content.html(i)
},
_ajaxRequest: function (e) {
var t = this;
jQuery.ajax(c({
type: "GET",
dataType: "html",
cache: !1,
error: function (e, n) {
o.ui.progress(t.content, !1), t.trigger(_, {
status: n,
xhr: e
})
},
success: u(function (e) {
o.ui.progress(t.content, !1), t.content.html(e), t.trigger(b)
}, t)
}, e))
},
_documentKeyDown: function (e) {
e.keyCode === o.keys.ESC && this.hide()
},
refresh: function () {
var e = this,
t = e.popup;
t && t.options.anchor && e._appendContent(t.options.anchor)
},
hide: function () {
this.popup && this.popup.close()
},
show: function (e) {
r(e), this._show(e)
},
_show: function (e) {
var n = this,
i = n.target();
n.popup || n._initPopup(), i && i[0] != e[0] && (n.popup.close(), n.popup.element.kendoStop(!0, !0)), i && i[0] == e[0] || (n._appendContent(e), n.popup.options.anchor = e), n.popup.one("deactivate", function () {
t(e), e.removeAttr(g), this.element.removeAttr("id").attr("aria-hidden", !0), p.off("keydown" + C, n._documentKeyDownHandler)
}), n.popup.open()
},
_initPopup: function () {
var t = this,
n = t.options,
i = e(o.template(x)({
callout: n.callout && "center" !== n.position,
dir: A[n.position],
autoHide: n.autoHide
}));
t.popup = new s(i, c({
activate: function () {
var e = this.options.anchor,
i = e[0].id || t.element[0].id;
i && (e.attr(g, i + h), this.element.attr("id", i + h)), n.callout && t._positionCallout(), this.element.removeAttr("aria-hidden"), p.on("keydown" + C, t._documentKeyDownHandler), t.trigger(m)
},
close: function () {
t.trigger(v)
},
copyAnchorStyles: !1,
animation: n.animation
}, T[n.position])), i.css({
width: n.width,
height: n.height
}), t.content = i.find(".k-tooltip-content"), t.arrow = i.find(".k-callout"), n.autoHide ? i.on("mouseleave" + C, u(t._mouseleave, t)) : i.on("click" + C, ".k-tooltip-button", u(t._closeButtonClick, t))
},
_closeButtonClick: function (e) {
e.preventDefault(), this.hide()
},
_mouseleave: function (n) {
if (this.popup) {
var i = e(n.currentTarget),
r = i.offset(),
o = n.pageX,
a = n.pageY;
if (r.right = r.left + i.outerWidth(), r.bottom = r.top + i.outerHeight(), o > r.left && r.right > o && a > r.top && r.bottom > a) return;
this.popup.close()
} else t(e(n.currentTarget));
clearTimeout(this.timeout)
},
_positionCallout: function () {
var t = this,
n = t.options.position,
i = t.dimensions,
r = i.offset,
o = t.popup,
a = o.options.anchor,
s = e(a).offset(),
l = parseInt(t.arrow.css("borderWidth"), 10),
d = e(o.element).offset(),
c = A[o.flipped ? S[n] : n],
u = s[r] - d[r] + e(a)[i.size]() / 2 - l;
t.arrow.removeClass("k-callout-n k-callout-s k-callout-w k-callout-e").addClass("k-callout-" + c).css(r, u)
},
target: function () {
return this.popup ? this.popup.options.anchor : null
},
destroy: function () {
var e = this.popup;
e && (e.element.off(C), e.destroy()), this.element.off(C), p.off("keydown" + C, this._documentKeyDownHandler), a.fn.destroy.call(this)
}
});
o.ui.plugin(I)
}(window.kendo.jQuery),
function (e, t) {
function n(t, i) {
t.filters && (t.filters = e.grep(t.filters, function (e) {
return n(e, i), e.filters ? e.filters.length : e.field != i
}))
}
var i = window.kendo,
r = i.ui,
o = r.Widget,
a = i.keys,
s = i.support,
l = i.htmlEncode,
d = i._activeElement,
c = "id",
u = "li",
p = "change",
f = "character",
h = "k-state-focused",
g = "k-state-hover",
m = "k-loading",
v = "open",
_ = "close",
b = "select",
y = "progress",
w = "requestEnd",
x = "width",
k = e.extend,
C = e.proxy,
T = s.browser,
S = T.msie && 9 > T.version,
A = /"/g,
F = {
ComboBox: "DropDownList",
DropDownList: "ComboBox"
}, D = o.extend({
init: function (t, n) {
var i, r = this,
a = r.ns;
o.fn.init.call(r, t, n), t = r.element, r._isSelect = t.is(b), r._template(), r.ul = e('
').css({
overflow: s.kineticScrollNeeded ? "" : "auto"
}).on("mouseenter" + a, u, function () {
e(this).addClass(g)
}).on("mouseleave" + a, u, function () {
e(this).removeClass(g)
}).on("click" + a, u, C(r._click, r)).attr({
tabIndex: -1,
role: "listbox",
"aria-hidden": !0
}), r.list = e("").append(r.ul).on("mousedown" + a, function (e) {
e.preventDefault()
}), i = t.attr(c), i && (r.list.attr(c, i + "-list"), r.ul.attr(c, i + "_listbox"), r._optionID = i + "_option_selected"), r._accessors(), r._initValue()
},
setOptions: function (e) {
o.fn.setOptions.call(this, e), e && e.enable !== t && (e.enabled = e.enable)
},
focus: function () {
this._focused.focus()
},
readonly: function (e) {
this._editable({
readonly: e === t ? !0 : e,
disable: !1
})
},
enable: function (e) {
this._editable({
readonly: !1,
disable: !(e = e === t ? !0 : e)
})
},
_filterSource: function (e) {
var t = this,
i = t.options,
r = t.dataSource,
o = r.filter() || {};
n(o, i.dataTextField), e && (o = o.filters || [], o.push(e)), r.filter(o)
},
_initValue: function () {
var e = this,
t = e.options.value;
t ? e.element.val(t) : t = e.element.val(), e._old = t
},
_ignoreCase: function () {
var e, t = this,
n = t.dataSource.reader.model;
n && n.fields && (e = n.fields[t.options.dataTextField], e && e.type && "string" !== e.type && (t.options.ignoreCase = !1))
},
items: function () {
return this.ul[0].children
},
current: function (e) {
var n = this,
i = n._optionID;
return e === t ? n._current : (n._current && (n._current.removeClass(h).removeAttr("aria-selected").removeAttr(c), n._focused.removeAttr("aria-activedescendant")), e && (e.addClass(h), n._scroll(e), i && (e.attr("id", i), n._focused.attr("aria-activedescendant", i))), n._current = e, t)
},
destroy: function () {
var e = this,
t = e.ns;
o.fn.destroy.call(e), e._unbindDataSource(), e.ul.off(t), e.list.off(t), e.popup.destroy(), e._form && e._form.off("reset", e._resetHandler)
},
dataItem: function (e) {
var n = this;
return e === t && (e = n.selectedIndex), n._data()[e]
},
_accessors: function () {
var e = this,
t = e.element,
n = e.options,
r = i.getter,
o = t.attr(i.attr("text-field")),
a = t.attr(i.attr("value-field"));
o && (n.dataTextField = o), a && (n.dataValueField = a), e._text = r(n.dataTextField), e._value = r(n.dataValueField)
},
_aria: function (e) {
var n = this,
i = n.options,
r = n._focused;
i.suggest !== t && r.attr("aria-autocomplete", i.suggest ? "both" : "list"), e = e ? e + " " + n.ul[0].id : n.ul[0].id, r.attr("aria-owns", e), n.ul.attr("aria-live", i.filter && "none" !== i.filter ? "polite" : "off")
},
_blur: function () {
var e = this;
e._change(), e.close()
},
_change: function () {
var e, n = this,
i = n.selectedIndex,
r = n.options.value,
o = n.value();
n._isSelect && !n._bound && r && (o = r), o !== n._old ? e = !0 : i !== t && i !== n._oldIndex && (e = !0), e && (n._old = o, n._oldIndex = i, n.trigger(p), n.element.trigger(p))
},
_click: function (t) {
t.isDefaultPrevented() || this._accept(e(t.currentTarget))
},
_data: function () {
return this.dataSource.view()
},
_enable: function () {
var e = this,
n = e.options,
i = e.element.is("[disabled]");
n.enable !== t && (n.enabled = n.enable), !n.enabled || i ? e.enable(!1) : e.readonly(e.element.is("[readonly]"))
},
_focus: function (e) {
var n = this;
return n.popup.visible() && e && n.trigger(b, {
item: e
}) ? (n.close(), t) : (n._select(e), n._triggerCascade(), n._blur(), t)
},
_index: function (e) {
var t, n, i = this,
r = i._data();
for (t = 0, n = r.length; n > t; t++)
if (i._dataValue(r[t]) == e) return t;
return -1
},
_dataValue: function (e) {
var n = this._value(e);
return n === t && (n = this._text(e)), n
},
_height: function (e) {
if (e) {
var t = this,
n = t.list,
i = t.popup.visible(),
r = t.options.height;
n = n.add(n.parent(".k-animation-container")).show().height(t.ul[0].scrollHeight > r ? r : "auto"), i || n.hide()
}
},
_adjustListWidth: function () {
var e, t, n = this.list,
i = n[0].style.width,
r = this.wrapper;
if (n.data(x) || !i) return e = window.getComputedStyle ? window.getComputedStyle(r[0], null) : 0, t = e ? parseFloat(e.width) : r.outerWidth(), e && (T.mozilla || T.msie) && (t += parseFloat(e.paddingLeft) + parseFloat(e.paddingRight) + parseFloat(e.borderLeftWidth) + parseFloat(e.borderRightWidth)), i = t - (n.outerWidth() - n.width()), n.css({
fontFamily: r.css("font-family"),
width: i
}).data(x, i), !0
},
_popup: function () {
var e = this,
t = e.list,
n = e._focused,
o = e.options,
a = e.wrapper;
e.popup = new r.Popup(t, k({}, o.popup, {
anchor: a,
open: function (t) {
e._adjustListWidth(), e.trigger(v) ? t.preventDefault() : (n.attr("aria-expanded", !0), e.ul.attr("aria-hidden", !1))
},
close: function (t) {
e.trigger(_) ? t.preventDefault() : (n.attr("aria-expanded", !1), e.ul.attr("aria-hidden", !0))
},
animation: o.animation,
isRtl: s.isRtl(a)
})), e.popup.one(v, function () {
e._height(e._data().length)
}), e._touchScroller = i.touchScroller(e.popup.element)
},
_makeUnselectable: function () {
S && this.list.find("*").attr("unselectable", "on")
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(g, "mouseenter" === t.type)
},
_toggle: function (e) {
var n = this;
e = e !== t ? e : !n.popup.visible(), s.touch || n._focused[0] === d() || n._focused.focus(), n[e ? v : _]()
},
_scroll: function (e) {
if (e) {
e[0] && (e = e[0]);
var t = this.ul[0],
n = e.offsetTop,
i = e.offsetHeight,
r = t.scrollTop,
o = t.clientHeight,
a = n + i;
t.scrollTop = r > n ? n : a > r + o ? a - o : r
}
},
_template: function () {
var e = this,
t = e.options,
n = t.template,
r = t.dataSource;
e._isSelect && e.element[0].length && (r || (t.dataTextField = t.dataTextField || "text", t.dataValueField = t.dataValueField || "value")), n ? (n = i.template(n), e.template = function (e) {
return '
' + n(e) + "
"
}) : e.template = i.template('
${' + i.expr(t.dataTextField, "data") + "}
", {
useWithBlock: !1
})
},
_triggerCascade: function () {
var e = this,
t = e.value();
(!e._bound && t || e._old !== t) && e.trigger("cascade")
},
_unbindDataSource: function () {
var e = this;
e.dataSource.unbind(p, e._refreshHandler).unbind(y, e._progressHandler).unbind(w, e._requestEndHandler).unbind("error", e._errorHandler)
}
});
k(D, {
caret: function (e) {
var t, n = e.ownerDocument.selection;
return t = n ? Math.abs(n.createRange().moveStart(f, -e.value.length)) : e.selectionStart
},
selectText: function (e, t, n) {
try {
if (e.createTextRange) {
e.focus();
var i = e.createTextRange();
i.collapse(!0), i.moveStart(f, t), i.moveEnd(f, n - t), i.select()
} else e.setSelectionRange(t, n)
} catch (r) {}
},
inArray: function (e, t) {
var n, i, r = t.children;
if (!e || e.parentNode !== t) return -1;
for (n = 0, i = r.length; i > n; n++)
if (e === r[n]) return n;
return -1
}
}), i.ui.List = D, r.Select = D.extend({
init: function (e, t) {
D.fn.init.call(this, e, t), this._initial = this.element.val()
},
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource(), this.options.autoBind && this.dataSource.fetch()
},
close: function () {
this.popup.close()
},
select: function (e) {
var n = this;
return e === t ? n.selectedIndex : (n._select(e), n._triggerCascade(), n._old = n._accessor(), n._oldIndex = n.selectedIndex, t)
},
_accessor: function (e, n) {
var i, r, o = this.element,
a = this._isSelect;
return o = o[0], e === t ? (a ? (r = o.selectedIndex, r > -1 && (i = o.options[r], i && (e = i.value))) : e = o.value, e) : (a ? o.selectedIndex = n : o.value = e, t)
},
_hideBusy: function () {
var e = this;
clearTimeout(e._busy), e._arrow.removeClass(m), e._focused.attr("aria-busy", !1), e._busy = null
},
_showBusy: function () {
var e = this;
e._request = !0, e._busy || (e._busy = setTimeout(function () {
e._focused.attr("aria-busy", !0), e._arrow.addClass(m)
}, 100))
},
_requestEnd: function () {
this._request = !1
},
_dataSource: function () {
var t, n = this,
r = n.element,
o = n.options,
a = o.dataSource || {};
a = e.isArray(a) ? {
data: a
} : a, n._isSelect && (t = r[0].selectedIndex, t > -1 && (o.index = t), a.select = r, a.fields = [{
field: o.dataTextField
}, {
field: o.dataValueField
}]), n.dataSource && n._refreshHandler ? n._unbindDataSource() : (n._refreshHandler = C(n.refresh, n), n._progressHandler = C(n._showBusy, n), n._requestEndHandler = C(n._requestEnd, n), n._errorHandler = C(n._hideBusy, n)), n.dataSource = i.data.DataSource.create(a).bind(p, n._refreshHandler).bind(y, n._progressHandler).bind(w, n._requestEndHandler).bind("error", n._errorHandler)
},
_get: function (t) {
var n, i, r = this,
o = r._data();
if ("function" == typeof t)
for (n = 0, i = o.length; i > n; n++)
if (t(o[n])) {
t = n;
break
}
if ("number" == typeof t) {
if (0 > t) return e();
t = e(r.ul[0].children[t])
}
return t && t.nodeType && (t = e(t)), t
},
_move: function (e) {
var t, n, i = this,
r = e.keyCode,
o = i.ul[0],
s = i.popup.visible() ? "_select" : "_accept",
l = i._current,
d = r === a.DOWN;
if (r === a.UP || d) {
if (e.altKey) i.toggle(d);
else {
if (t = o.firstChild, !t && !i._accessor() && "filter" !== i._state) return i.dataSource.one(p, function () {
i._move(e)
}), i._filterSource(), e.preventDefault(), !0;
d ? (!l || -1 === i.selectedIndex && !i.value() && l[0] === t ? l = t : (l = l[0].nextSibling, l || t !== o.lastChild || (l = t)), i[s](l)) : (l = l ? l[0].previousSibling : o.lastChild, l || t !== o.lastChild || (l = t), i[s](l))
}
e.preventDefault(), n = !0
} else r === a.ENTER || r === a.TAB ? (i.popup.visible() && e.preventDefault(), i._accept(l), n = !0) : r === a.ESC && (i.popup.visible() && e.preventDefault(), i.close(), n = !0);
return n
},
_selectItem: function (e) {
var t = this,
n = t.options,
i = t.selectedIndex;
e = t._selectedValue || n.value || t._accessor(), e ? t.value(e) : (!t._bound || i > -1) && (t._bound || (i = n.index), t.select(i))
},
_fetchItems: function (e) {
var n = this,
i = n.ul[0].firstChild;
return n._request ? !0 : n._fetch || i ? t : n.options.cascadeFrom ? !i : (n.dataSource.one(p, function () {
n.value(e), n._fetch = !1
}), n._fetch = !0, n.dataSource.fetch(), !0)
},
_options: function (e, n) {
var i, r, o, a, s = this,
d = s.element,
c = d[0].selectedIndex,
u = e.length,
p = "",
f = 0;
for (n && (p = n, c += 1, f = 1); u > f; f++) i = "", p += i;
d.html(p), d[0].selectedIndex = -1 === c ? 0 : c
},
_reset: function () {
var e = this,
t = e.element,
n = t.closest("form");
n[0] && (e._resetHandler = function () {
setTimeout(function () {
e.value(e._initial)
})
}, e._form = n.on("reset", e._resetHandler))
},
_cascade: function () {
var t, i, r, o, a, s = this,
l = s.options,
d = l.cascadeFrom;
if (d) {
if (s._selectedValue = l.value || s._accessor(), i = e("#" + d), t = i.data("kendo" + l.name), t || (t = i.data("kendo" + F[l.name])), !t) return;
l.autoBind = !1, o = t.options.dataValueField, a = function () {
var e = s._selectedValue || s.value();
e ? (s.value(e), s.dataSource.view()[0] && -1 !== s.selectedIndex || s._clearSelection(t, !0)) : s.select(l.index), s.enable(), s._triggerCascade()
}, r = function () {
var e, i, r = t.dataItem(),
l = r ? t._value(r) : null;
l ? (e = s.dataSource.filter() || {}, n(e, o), i = e.filters || [], i.push({
field: o,
operator: "eq",
value: l
}), s.dataSource.one(p, a).filter(i)) : (s.enable(!1), s._clearSelection(t), s._triggerCascade())
}, t.bind("cascade", function () {
r()
}), t._bound ? r() : t.value() || s.enable(!1)
}
}
})
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n, i) {
var r, o = e.getFullYear(),
a = t.getFullYear(),
s = n.getFullYear();
return o -= o % i, r = o + (i - 1), a > o && (o = a), r > s && (r = s), o + "-" + r
}
function i(e) {
for (var t, n = 0, i = e.min, r = e.max, o = e.start, a = e.setter, l = e.build, d = e.cells || 12, c = e.perRow || 4, u = e.content || I, p = e.empty || E, f = e.html || '
'; d > n; n++) n > 0 && 0 === n % c && (f += '
'), t = l(o, n), f += s(o, i, r) ? u(t) : p(t), a(o, 1);
return f + "
"
}
function r(e, t, n) {
var i = e.getFullYear(),
r = t.getFullYear(),
o = r,
a = 0;
return n && (r -= r % n, o = r - r % n + n - 1), i > o ? a = 1 : r > i && (a = -1), a
}
function o() {
var e = new ft;
return new ft(e.getFullYear(), e.getMonth(), e.getDate())
}
function a(e, t, n) {
var i = o();
return e && (i = new ft(+e)), t > i ? i = new ft(+t) : i > n && (i = new ft(+n)), i
}
function s(e, t, n) {
return +e >= +t && +n >= +e
}
function l(e, t) {
return e.slice(t).concat(e.slice(0, t))
}
function d(e, t, n) {
t = t instanceof ft ? t.getFullYear() : e.getFullYear() + n * t, e.setFullYear(t)
}
function c(t) {
e(this).toggleClass(G, nt.indexOf(t.type) > -1 || t.type == et)
}
function u(e) {
e.preventDefault()
}
function p(e) {
return A(e).calendars.standard
}
function f(e) {
var n = ht[e.start],
i = ht[e.depth],
r = A(e.culture);
e.format = T(e.format || r.calendars.standard.patterns.d), isNaN(n) && (n = 0, e.start = V), (i === t || i > n) && (e.depth = V), e.dates || (e.dates = [])
}
function h(e) {
z && e.find("*").attr("unselectable", "on")
}
function g(e, t) {
for (var n = 0, i = t.length; i > n; n++)
if (e === +t[n]) return !0;
return !1
}
function m(e, t) {
return e ? e.getFullYear() === t.getFullYear() && e.getMonth() === t.getMonth() && e.getDate() === t.getDate() : !1
}
var v, _ = window.kendo,
b = _.support,
y = _.ui,
w = y.Widget,
x = _.parseDate,
k = _._adjustDate,
C = _.keys,
T = _._extractFormat,
S = _.template,
A = _.getCulture,
F = _.support.transitions,
D = F ? F.css + "transform-origin" : "",
I = S('
', {
useWithBlock: !1
}),
P = _.support.browser,
z = P.msie && 9 > P.version,
H = ".kendoCalendar",
R = "click" + H,
O = "keydown" + H,
M = "id",
N = "min",
B = "left",
L = "slideIn",
V = "month",
U = "century",
W = "change",
j = "navigate",
q = "value",
G = "k-state-hover",
$ = "k-state-disabled",
Y = "k-state-focused",
Q = "k-other-month",
K = ' class="' + Q + '"',
X = "k-nav-today",
J = "td:has(.k-link)",
Z = "blur" + H,
et = "focus",
tt = et + H,
nt = b.touch ? "touchstart" : "mouseenter",
it = b.touch ? "touchstart" + H : "mouseenter" + H,
rt = b.touch ? "touchend" + H + " touchmove" + H : "mouseleave" + H,
ot = 6e4,
at = 864e5,
st = "_prevArrow",
lt = "_nextArrow",
dt = "aria-disabled",
ct = "aria-selected",
ut = e.proxy,
pt = e.extend,
ft = Date,
ht = {
month: 0,
year: 1,
decade: 2,
century: 3
}, gt = w.extend({
init: function (t, n) {
var i, r, o = this;
w.fn.init.call(o, t, n), t = o.wrapper = o.element, n = o.options, n.url = window.unescape(n.url), o._templates(), o._header(), o._footer(o.footer), r = t.addClass("k-widget k-calendar").on(it + " " + rt, J, c).on(O, "table.k-content", ut(o._move, o)).on(R, J, function (t) {
var n = t.currentTarget.firstChild; - 1 != n.href.indexOf("#") && t.preventDefault(), o._click(e(n))
}).on("mouseup" + H, function () {
o._focusView(o.options.focusOnNav !== !1)
}).attr(M), r && (o._cellID = r + "_cell_selected"), i = n.value, f(n), o._index = ht[n.start], o._current = new ft(+a(i, n.min, n.max)), o._addClassProxy = function () {
o._active = !0, o._cell.addClass(Y)
}, o._removeClassProxy = function () {
o._active = !1, o._cell.removeClass(Y)
}, o.value(i), _.notify(o)
},
options: {
name: "Calendar",
value: null,
min: new ft(1900, 0, 1),
max: new ft(2099, 11, 31),
dates: [],
url: "",
culture: "",
footer: "",
format: "",
month: {},
start: V,
depth: V,
animation: {
horizontal: {
effects: L,
reverse: !0,
duration: 500,
divisor: 2
},
vertical: {
effects: "zoomIn",
duration: 400
}
}
},
events: [W, j],
setOptions: function (e) {
f(e), w.fn.setOptions.call(this, e)
},
destroy: function () {
var e = this,
t = e._today;
e.element.off(H), e._title.off(H), e[st].off(H), e[lt].off(H), _.destroy(e._view), t && _.destroy(t.off(H)), w.fn.destroy.call(e)
},
current: function () {
return this._current
},
view: function () {
return this._view
},
focus: function (e) {
e = e || this._table, this._bindTable(e), e.focus()
},
min: function (e) {
return this._option(N, e)
},
max: function (e) {
return this._option("max", e)
},
navigateToPast: function () {
this._navigate(st, -1)
},
navigateToFuture: function () {
this._navigate(lt, 1)
},
navigateUp: function () {
var e = this,
t = e._index;
e._title.hasClass($) || e.navigate(e._current, ++t)
},
navigateDown: function (e) {
var n = this,
i = n._index,
r = n.options.depth;
if (e) return i === ht[r] ? (+n._value != +e && (n.value(e), n.trigger(W)), t) : (n.navigate(e, --i), t)
},
navigate: function (n, i) {
i = isNaN(i) ? ht[i] : i;
var r, o, s, l, d = this,
c = d.options,
u = c.culture,
p = c.min,
f = c.max,
g = d._title,
m = d._table,
_ = d._oldTable,
b = d._value,
y = d._current,
w = n && +n > +y,
x = i !== t && i !== d._index;
n ? d._current = n = new ft(+a(n, p, f)) : n = y, i === t ? i = d._index : d._index = i, d._view = o = v.views[i], s = o.compare, l = i === ht[U], g.toggleClass($, l).attr(dt, l), l = 1 > s(n, p), d[st].toggleClass($, l).attr(dt, l), l = s(n, f) > -1, d[lt].toggleClass($, l).attr(dt, l), m && _ && _.data("animating") && (_.kendoStop(!0, !0), m.kendoStop(!0, !0)), d._oldTable = m, (!m || d._changeView) && (g.html(o.title(n, p, f, u)), d._table = r = e(o.content(pt({
min: p,
max: f,
date: n,
url: c.url,
dates: c.dates,
format: c.format,
culture: u
}, d[o.name]))), h(r), d._animate({
from: m,
to: r,
vertical: x,
future: w
}), d._focus(n), d.trigger(j)), i === ht[c.depth] && b && d._class("k-state-selected", o.toDateString(b)), d._class(Y, o.toDateString(n)), !m && d._cell && d._cell.removeClass(Y), d._changeView = !0
},
value: function (e) {
var n = this,
i = n._view,
r = n.options,
o = n._view,
a = r.min,
l = r.max;
return e === t ? n._value : (e = x(e, r.format, r.culture), null !== e && (e = new ft(+e), s(e, a, l) || (e = null)), n._value = e, o && null === e && n._cell ? n._cell.removeClass("k-state-selected") : (n._changeView = !e || i && 0 !== i.compare(e, n._current), n.navigate(e)), t)
},
_move: function (t) {
var n, i, r, o, s = this,
l = s.options,
d = t.keyCode,
c = s._view,
u = s._index,
p = new ft(+s._current),
f = _.support.isRtl(s.wrapper);
return t.target === s._table[0] && (s._active = !0), t.ctrlKey ? d == C.RIGHT && !f || d == C.LEFT && f ? (s.navigateToFuture(), i = !0) : d == C.LEFT && !f || d == C.RIGHT && f ? (s.navigateToPast(), i = !0) : d == C.UP ? (s.navigateUp(), i = !0) : d == C.DOWN && (s._click(e(s._cell[0].firstChild)), i = !0) : (d == C.RIGHT && !f || d == C.LEFT && f ? (n = 1, i = !0) : d == C.LEFT && !f || d == C.RIGHT && f ? (n = -1, i = !0) : d == C.UP ? (n = 0 === u ? -7 : -4, i = !0) : d == C.DOWN ? (n = 0 === u ? 7 : 4, i = !0) : d == C.ENTER ? (s._click(e(s._cell[0].firstChild)), i = !0) : d == C.HOME || d == C.END ? (r = d == C.HOME ? "first" : "last", o = c[r](p), p = new ft(o.getFullYear(), o.getMonth(), o.getDate(), p.getHours(), p.getMinutes(), p.getSeconds(), p.getMilliseconds()), i = !0) : d == C.PAGEUP ? (i = !0, s.navigateToPast()) : d == C.PAGEDOWN && (i = !0, s.navigateToFuture()), (n || r) && (r || c.setDate(p, n), s._focus(a(p, l.min, l.max)))), i && t.preventDefault(), s._current
},
_animate: function (e) {
var t = this,
n = e.from,
i = e.to,
r = t._active;
n ? n.parent().data("animating") ? (n.parent().kendoStop(!0, !0).remove(), n.remove(), i.insertAfter(t.element[0].firstChild), t._focusView(r)) : n.is(":visible") && t.options.animation !== !1 ? t[e.vertical ? "_vertical" : "_horizontal"](n, i, e.future) : (i.insertAfter(n), n.remove(), t._focusView(r)) : (i.insertAfter(t.element[0].firstChild), t._bindTable(i))
},
_horizontal: function (e, n, i) {
var r = this,
o = r._active,
a = r.options.animation.horizontal,
s = a.effects,
l = e.outerWidth();
s && -1 != s.indexOf(L) && (e.add(n).css({
width: l
}), e.wrap(""), r._focusView(o, e), e.parent().css({
position: "relative",
width: 2 * l,
"float": B,
"margin-left": i ? 0 : -l
}), n[i ? "insertAfter" : "insertBefore"](e), pt(a, {
effects: L + ":" + (i ? "right" : B),
complete: function () {
e.remove(), n.unwrap(), r._focusView(o), r._oldTable = t
}
}), e.parent().kendoStop(!0, !0).kendoAnimate(a))
},
_vertical: function (e, n) {
var i, r, o = this,
a = o.options.animation.vertical,
s = a.effects,
l = o._active;
s && -1 != s.indexOf("zoom") && (n.css({
position: "absolute",
top: e.prev().outerHeight(),
left: 0
}).insertBefore(e), D && (i = o._cellByDate(o._view.toDateString(o._current)), r = i.position(), r = r.left + parseInt(i.width() / 2, 10) + "px" + " " + (r.top + parseInt(i.height() / 2, 10) + "px"), n.css(D, r)), e.kendoStop(!0, !0).kendoAnimate({
effects: "fadeOut",
duration: 600,
complete: function () {
e.remove(), n.css({
position: "static",
top: 0,
left: 0
}), o._focusView(l), o._oldTable = t
}
}), n.kendoStop(!0, !0).kendoAnimate(a))
},
_cellByDate: function (t) {
return this._table.find("td:not(." + Q + ")").filter(function () {
return e(this.firstChild).attr(_.attr(q)) === t
})
},
_class: function (t, n) {
var i = this,
r = i._cellID,
o = i._cell;
o && o.removeAttr(ct).removeAttr(M), o = i._table.find("td:not(." + Q + ")").removeClass(t).filter(function () {
return e(this.firstChild).attr(_.attr(q)) === n
}).attr(ct, !0), t !== Y || i._active || i.options.focusOnNav === !1 || (t = ""), o.addClass(t), o[0] && (i._cell = o), r && (o.attr(M, r), i._table.removeAttr("aria-activedescendant").attr("aria-activedescendant", r))
},
_bindTable: function (e) {
e.on(tt, this._addClassProxy).on(Z, this._removeClassProxy)
},
_click: function (e) {
var t = this,
n = t.options,
i = new Date(+t._current),
r = e.attr(_.attr(q)).split("/");
r = new ft(r[0], r[1], r[2]), k(r), t._view.setDate(i, r), t.navigateDown(a(i, n.min, n.max))
},
_focus: function (e) {
var t = this,
n = t._view;
0 !== n.compare(e, t._current) ? t.navigate(e) : (t._current = e, t._class(Y, n.toDateString(e)))
},
_focusView: function (e, t) {
e && this.focus(t)
},
_footer: function (n) {
var i = this,
r = o(),
a = i.element,
s = a.find(".k-footer");
return n ? (s[0] || (s = e('').appendTo(a)), i._today = s.show().find(".k-link").html(n(r)).attr("title", _.toString(r, "D", i.options.culture)), i._toggle(), t) : (i._toggle(!1), s.hide(), t)
},
_header: function () {
var e, t = this,
n = t.element,
i = t.options.focusOnNav !== !1;
n.find(".k-header")[0] || n.html('
'), e = n.find(".k-link").on(it + " " + rt + " " + tt + " " + Z, c).click(!1), t._title = e.eq(1).on(R, function () {
t._focusView(i), t.navigateUp()
}), t[st] = e.eq(0).on(R, function () {
t._focusView(i), t.navigateToPast()
}), t[lt] = e.eq(2).on(R, function () {
t._focusView(i), t.navigateToFuture()
})
},
_navigate: function (e, t) {
var n = this,
i = n._index + 1,
r = new ft(+n._current);
e = n[e], e.hasClass($) || (i > 3 ? r.setFullYear(r.getFullYear() + 100 * t) : v.views[i].setDate(r, t), n.navigate(r))
},
_option: function (e, n) {
var i, r, o = this,
a = o.options,
s = +o._value,
l = lt;
return n === t ? a[e] : (n = x(n, a.format, a.culture), n && (a[e] = new ft(+n), r = o._view.compare(n, o._current), s ? e === N ? (i = +n > s, r = r > -1, l = st) : (i = s > +n, r = 1 > r) : r = m(o._current, n), i ? o.value(null) : r ? o.navigate() : o[l].toggleClass($, !1).attr(dt, !1), o._toggle()), t)
},
_toggle: function (e) {
var n = this,
i = n.options,
r = n._today;
e === t && (e = s(o(), i.min, i.max)), r && (r.off(R), e ? r.addClass(X).removeClass($).on(R, ut(n._todayClick, n)) : r.removeClass(X).addClass($).on(R, u))
},
_todayClick: function (e) {
var t = this,
n = ht[t.options.depth],
i = o();
e.preventDefault(), 0 === t._view.compare(t._current, i) && t._index == n && (t._changeView = !1), t._value = i, t.navigate(i, n), t.trigger(W)
},
_templates: function () {
var e = this,
t = e.options,
n = t.footer,
i = t.month,
r = i.content,
o = i.empty;
e.month = {
content: S('
", {
useWithBlock: !! o
})
}, n !== !1 && (e.footer = S(n || '#= kendo.toString(data,"D","' + t.culture + '") #', {
useWithBlock: !1
}))
}
});
y.plugin(gt), v = {
firstDayOfMonth: function (e) {
return new ft(e.getFullYear(), e.getMonth(), 1)
},
firstVisibleDay: function (e, t) {
t = t || _.culture().calendar;
for (var n = t.firstDay, i = new ft(e.getFullYear(), e.getMonth(), 0, e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds()); i.getDay() != n;) v.setTime(i, -1 * at);
return i
},
setTime: function (e, t) {
var n = e.getTimezoneOffset(),
i = new ft(e.getTime() + t),
r = i.getTimezoneOffset() - n;
e.setTime(i.getTime() + r * ot)
},
views: [{
name: V,
title: function (e, t, n, i) {
return p(i).months.names[e.getMonth()] + " " + e.getFullYear()
},
content: function (e) {
for (var t = this, n = 0, r = e.min, o = e.max, a = e.date, s = e.dates, d = e.format, c = e.culture, u = e.url, f = u && s[0], h = p(c), m = h.firstDay, b = h.days, y = l(b.names, m), w = l(b.namesShort, m), x = v.firstVisibleDay(a, h), C = t.first(a), T = t.last(a), S = t.toDateString, A = new ft, F = '
'; 7 > n; n++) F += '
' + w[n] + "
";
return A = new ft(A.getFullYear(), A.getMonth(), A.getDate()), k(A), A = +A, i({
cells: 42,
perRow: 7,
html: F += '
',
start: new ft(x.getFullYear(), x.getMonth(), x.getDate()),
min: new ft(r.getFullYear(), r.getMonth(), r.getDate()),
max: new ft(o.getFullYear(), o.getMonth(), o.getDate()),
content: e.content,
empty: e.empty,
setter: t.setDate,
build: function (e) {
var t = [],
n = e.getDay(),
i = "",
r = "#";
return (C > e || e > T) && t.push(Q), +e === A && t.push("k-today"), (0 === n || 6 === n) && t.push("k-weekend"), f && g(+e, s) && (r = u.replace("{0}", _.toString(e, d, c)), i = " k-action-link"), {
date: e,
dates: s,
ns: _.ns,
title: _.toString(e, "D", c),
value: e.getDate(),
dateString: S(e),
cssClass: t[0] ? ' class="' + t.join(" ") + '"' : "",
linkClass: i,
url: r
}
}
})
},
first: function (e) {
return v.firstDayOfMonth(e)
},
last: function (e) {
var t = new ft(e.getFullYear(), e.getMonth() + 1, 0),
n = v.firstDayOfMonth(e),
i = Math.abs(t.getTimezoneOffset() - n.getTimezoneOffset());
return i && t.setHours(n.getHours() + i / 60), t
},
compare: function (e, t) {
var n, i = e.getMonth(),
r = e.getFullYear(),
o = t.getMonth(),
a = t.getFullYear();
return n = r > a ? 1 : a > r ? -1 : i == o ? 0 : i > o ? 1 : -1
},
setDate: function (e, t) {
var n = e.getHours();
t instanceof ft ? e.setFullYear(t.getFullYear(), t.getMonth(), t.getDate()) : v.setTime(e, t * at), k(e, n)
},
toDateString: function (e) {
return e.getFullYear() + "/" + e.getMonth() + "/" + e.getDate()
}
}, {
name: "year",
title: function (e) {
return e.getFullYear()
},
content: function (e) {
var t = p(e.culture).months.namesAbbr,
n = this.toDateString,
r = e.min,
o = e.max;
return i({
min: new ft(r.getFullYear(), r.getMonth(), 1),
max: new ft(o.getFullYear(), o.getMonth(), 1),
start: new ft(e.date.getFullYear(), 0, 1),
setter: this.setDate,
build: function (e) {
return {
value: t[e.getMonth()],
ns: _.ns,
dateString: n(e),
cssClass: ""
}
}
})
},
first: function (e) {
return new ft(e.getFullYear(), 0, e.getDate())
},
last: function (e) {
return new ft(e.getFullYear(), 11, e.getDate())
},
compare: function (e, t) {
return r(e, t)
},
setDate: function (e, t) {
var n, i = e.getHours();
t instanceof ft ? (n = t.getMonth(), e.setFullYear(t.getFullYear(), n, e.getDate()), n !== e.getMonth() && e.setDate(0)) : (n = e.getMonth() + t, e.setMonth(n), n > 11 && (n -= 12), n > 0 && e.getMonth() != n && e.setDate(0)), k(e, i)
},
toDateString: function (e) {
return e.getFullYear() + "/" + e.getMonth() + "/1"
}
}, {
name: "decade",
title: function (e, t, i) {
return n(e, t, i, 10)
},
content: function (e) {
var t = e.date.getFullYear(),
n = this.toDateString;
return i({
start: new ft(t - t % 10 - 1, 0, 1),
min: new ft(e.min.getFullYear(), 0, 1),
max: new ft(e.max.getFullYear(), 0, 1),
setter: this.setDate,
build: function (e, t) {
return {
value: e.getFullYear(),
ns: _.ns,
dateString: n(e),
cssClass: 0 === t || 11 == t ? K : ""
}
}
})
},
first: function (e) {
var t = e.getFullYear();
return new ft(t - t % 10, e.getMonth(), e.getDate())
},
last: function (e) {
var t = e.getFullYear();
return new ft(t - t % 10 + 9, e.getMonth(), e.getDate())
},
compare: function (e, t) {
return r(e, t, 10)
},
setDate: function (e, t) {
d(e, t, 1)
},
toDateString: function (e) {
return e.getFullYear() + "/0/1"
}
}, {
name: U,
title: function (e, t, i) {
return n(e, t, i, 100)
},
content: function (e) {
var t = e.date.getFullYear(),
n = e.min.getFullYear(),
r = e.max.getFullYear(),
o = this.toDateString,
a = n,
s = r;
return a -= a % 10, s -= s % 10, 10 > s - a && (s = a + 9), i({
start: new ft(t - t % 100 - 10, 0, 1),
min: new ft(a, 0, 1),
max: new ft(s, 0, 1),
setter: this.setDate,
build: function (e, t) {
var i = e.getFullYear(),
a = i + 9;
return n > i && (i = n), a > r && (a = r), {
ns: _.ns,
value: i + " - " + a,
dateString: o(e),
cssClass: 0 === t || 11 == t ? K : ""
}
}
})
},
first: function (e) {
var t = e.getFullYear();
return new ft(t - t % 100, e.getMonth(), e.getDate())
},
last: function (e) {
var t = e.getFullYear();
return new ft(t - t % 100 + 99, e.getMonth(), e.getDate())
},
compare: function (e, t) {
return r(e, t, 100)
},
setDate: function (e, t) {
d(e, t, 10)
},
toDateString: function (e) {
var t = e.getFullYear();
return t - t % 10 + "/0/1"
}
}]
}, v.isEqualDatePart = m, v.makeUnselectable = h, v.restrictValue = a, v.isInRange = s, v.normalize = f, v.viewsEnum = ht, _.calendar = v
}(window.kendo.jQuery),
function (e, t) {
function n(t) {
var n = t.parseFormats,
i = t.format;
N.normalize(t), n = e.isArray(n) ? n : [n], -1 === e.inArray(i, n) && n.splice(0, 0, t.format), t.parseFormats = n
}
function i(e) {
e.preventDefault()
}
var r, o = window.kendo,
a = o.ui,
s = a.Widget,
l = o.parseDate,
d = o.keys,
c = o.template,
u = o._activeElement,
p = "",
f = "",
h = ".kendoDatePicker",
g = "click" + h,
m = "open",
v = "close",
_ = "change",
b = "dateView",
y = "disabled",
w = "readonly",
x = "k-state-default",
k = "k-state-focused",
C = "k-state-selected",
T = "k-state-disabled",
S = "k-state-hover",
A = "keydown" + h,
F = "mouseenter" + h + " mouseleave" + h,
D = "mousedown" + h,
I = "id",
E = "min",
P = "max",
z = "month",
H = "aria-disabled",
R = "aria-expanded",
O = "aria-hidden",
M = "aria-readonly",
N = o.calendar,
B = N.isInRange,
L = N.restrictValue,
V = N.isEqualDatePart,
U = e.extend,
W = e.proxy,
j = Date,
q = function (t) {
var n, i = this,
s = document.body,
l = r.sharedCalendar,
d = e(p).attr(O, "true").addClass("k-calendar-container").appendTo(s);
l || (l = r.sharedCalendar = new a.Calendar(e(p).attr(I, o.guid()).hide().appendTo(s), {
focusOnNav: !1
}), N.makeUnselectable(l.element)), i.calendar = l, i.options = t = t || {}, n = t.id, n && (n += "_dateview", d.attr(I, n), i._dateViewID = n), i.popup = new a.Popup(d, U(t.popup, t, {
name: "Popup",
isRtl: o.support.isRtl(t.anchor)
})), i.div = d, i._templates(), i.value(t.value)
};
q.prototype = {
_calendar: function () {
var e = this,
t = e.popup,
n = e.options,
r = e.calendar,
o = r.element;
o.data(b) !== e && (o.appendTo(t.element).data(b, e).off(g + " " + A).on(g, "td:has(.k-link)", W(e._click, e)).on(D, i).show(), r.unbind(_).bind(_, n), r.month = e.month, r.options.dates = n.dates, r.options.depth = n.depth, r.options.culture = n.culture, r._footer(e.footer), r.min(n.min), r.max(n.max), r._value = null, r.navigate(e._value || e._current, n.start), e.value(e._value))
},
destroy: function () {
var n, i = this,
o = i.calendar,
a = o.element,
s = a.data(b);
(s === t || s === i) && (n = e(".k-calendar-container"), n.length > 1 ? a.hide().appendTo(document.body) : (a.off(h), o.destroy(), o.element.remove(), r.sharedCalendar = null)), i.popup.destroy()
},
open: function () {
var e = this;
e._calendar(), e.popup.open()
},
close: function () {
this.popup.close()
},
min: function (e) {
this._option(E, e)
},
max: function (e) {
this._option(P, e)
},
toggle: function () {
var e = this;
e[e.popup.visible() ? v : m]()
},
move: function (e) {
var n = this,
i = e.keyCode,
r = n.calendar,
o = e.ctrlKey && i == d.DOWN || i == d.ENTER;
if (i == d.ESC) return n.close(), t;
if (e.altKey) return i == d.DOWN ? (n.open(), e.preventDefault()) : i == d.UP && (n.close(), e.preventDefault()), t;
if (n.popup.visible()) return o && r._cell.hasClass(C) ? (n.close(), e.preventDefault(), t) : (n._current = r._move(e), t)
},
value: function (e) {
var t = this,
n = t.calendar,
i = t.options;
t._value = e, t._current = new j(+L(e, i.min, i.max)), n.element.data(b) === t && n.value(e)
},
_click: function (e) {
-1 !== e.currentTarget.className.indexOf(C) && this.close()
},
_option: function (e, t) {
var n = this,
i = n.options,
r = n.calendar;
i[e] = t, r.element.data(b) === n && r[e](t)
},
_templates: function () {
var e = this,
t = e.options,
n = t.footer,
i = t.month || {}, r = i.content,
a = i.empty;
e.month = {
content: c('
", {
useWithBlock: !! a
})
}, n !== !1 && (e.footer = c(n || '#= kendo.toString(data,"D","' + t.culture + '") #', {
useWithBlock: !1
}))
}
}, q.normalize = n, o.DateView = q, r = s.extend({
init: function (e, t) {
var i, r, a = this;
s.fn.init.call(a, e, t), e = a.element, t = a.options, n(t), a._wrapper(), a.dateView = new q(U({}, t, {
id: e.attr(I),
anchor: a.wrapper,
change: function () {
a._change(this.value()), a.close()
},
close: function (t) {
a.trigger(v) ? t.preventDefault() : (e.attr(R, !1), r.attr(O, !0))
},
open: function (t) {
var n, i = a.options;
a.trigger(m) ? t.preventDefault() : (a.element.val() !== a._oldText && (n = l(e.val(), i.parseFormats, i.culture), n ? (a.dateView._current = n, a.dateView.calendar._focus(n)) : a.dateView.value(n)), e.attr(R, !0), r.attr(O, !1))
}
})), r = a.dateView.div, a._icon(), e[0].type = "text", e.addClass("k-input").attr({
role: "textbox",
"aria-haspopup": !0,
"aria-expanded": !1,
"aria-owns": a.dateView._dateViewID
}), a._reset(), a._template(), i = e.is("[disabled]"), i ? a.enable(!1) : a.readonly(e.is("[readonly]")), a.value(t.value || a.element.val()), o.notify(a)
},
events: [m, v, _],
options: {
name: "DatePicker",
value: null,
footer: "",
format: "",
culture: "",
parseFormats: [],
min: new Date(1900, 0, 1),
max: new Date(2099, 11, 31),
start: z,
depth: z,
animation: {},
month: {},
dates: [],
ARIATemplate: 'Current focused date is #=kendo.toString(data.current, "D")#'
},
setOptions: function (e) {
var t = this,
i = t.dateView,
r = i.options;
s.fn.setOptions.call(t, e), n(t.options), i.options = U(r, t.options, {
change: r.change,
close: r.close,
open: r.open
})
},
_editable: function (e) {
var t = this,
n = t._dateIcon.off(h),
r = t.element.off(h),
o = t._inputWrapper.off(h),
a = e.readonly,
s = e.disable;
a || s ? (o.addClass(s ? T : x).removeClass(s ? x : T), r.attr(y, s).attr(w, a).attr(H, s).attr(M, a)) : (o.addClass(x).removeClass(T).on(F, t._toggleHover), r.removeAttr(y).removeAttr(w).attr(H, !1).attr(M, !1).on("keydown" + h, W(t._keydown, t)).on("blur" + h, W(t._blur, t)).on("focus" + h, function () {
t._inputWrapper.addClass(k)
}), n.on(g, W(t._click, t)).on(D, i))
},
readonly: function (e) {
this._editable({
readonly: e === t ? !0 : e,
disable: !1
})
},
enable: function (e) {
this._editable({
readonly: !1,
disable: !(e = e === t ? !0 : e)
})
},
destroy: function () {
var e = this;
s.fn.destroy.call(e), e.dateView.destroy(), e.element.off(h), e._dateIcon.off(h), e._inputWrapper.off(h), e._form && e._form.off("reset", e._resetHandler)
},
open: function () {
this.dateView.open()
},
close: function () {
this.dateView.close()
},
min: function (e) {
return this._option(E, e)
},
max: function (e) {
return this._option(P, e)
},
value: function (e) {
var n = this;
return e === t ? n._value : (n._old = n._update(e), null === n._old && n.element.val(""), n._oldText = n.element.val(), t)
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(S, "mouseenter" === t.type)
},
_blur: function () {
var e = this,
t = e.element.val();
e.close(), t !== e._oldText && e._change(t), e._inputWrapper.removeClass(k)
},
_click: function () {
var e = this,
t = e.element;
e.dateView.toggle(), o.support.touch || t[0] === u() || t.focus()
},
_change: function (e) {
var t = this;
e = t._update(e), +t._old != +e && (t._old = e, t._oldText = t.element.val(), t.trigger(_), t.element.trigger(_))
},
_keydown: function (e) {
var t = this,
n = t.dateView,
i = t.element.val();
n.popup.visible() || e.keyCode != d.ENTER || i === t._oldText ? (n.move(e), t._updateARIA(n._current)) : t._change(i)
},
_icon: function () {
var t, n = this,
i = n.element;
t = i.next("span.k-select"), t[0] || (t = e('select').insertAfter(i)), n._dateIcon = t.attr({
role: "button",
"aria-controls": n.dateView._dateViewID
})
},
_option: function (e, n) {
var i = this,
r = i.options;
return n === t ? r[e] : (n = l(n, r.parseFormats, r.culture), n && (r[e] = new j(+n), i.dateView[e](n)), t)
},
_update: function (e) {
var t, n = this,
i = n.options,
r = i.min,
a = i.max,
s = l(e, i.parseFormats, i.culture);
return +s === +n._value ? (t = o.toString(s, i.format, i.culture), t !== e && n.element.val(null === s ? e : t), s) : (null !== s && V(s, r) ? s = L(s, r, a) : B(s, r, a) || (s = null), n._value = s, n.dateView.value(s), n.element.val(s ? o.toString(s, i.format, i.culture) : e), n._updateARIA(s), s)
},
_wrapper: function () {
var t, n = this,
i = n.element;
t = i.parents(".k-datepicker"), t[0] || (t = i.wrap(f).parent().addClass("k-picker-wrap k-state-default"), t = t.wrap(f).parent()), t[0].style.cssText = i[0].style.cssText, i.css({
width: "100%",
height: i[0].style.height
}), n.wrapper = t.addClass("k-widget k-datepicker k-header").addClass(i[0].className), n._inputWrapper = e(t[0].firstChild)
},
_reset: function () {
var e = this,
t = e.element,
n = t.closest("form");
n[0] && (e._resetHandler = function () {
e.value(t[0].defaultValue)
}, e._form = n.on("reset", e._resetHandler))
},
_template: function () {
this._ariaTemplate = c(this.options.ARIATemplate)
},
_updateARIA: function (e) {
this.element.attr("aria-label", this._ariaTemplate({
current: e
}))
}
}), a.plugin(r)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
return n ? t.substring(0, e).split(n).length - 1 : 0
}
function i(e, t, i) {
return t.split(i)[n(e, t, i)]
}
function r(e, t, i, r) {
var o = t.split(r);
return o.splice(n(e, t, r), 1, i), r && "" !== o[o.length - 1] && o.push(""), o.join(r)
}
function o(e) {
var t = e.value.length;
S(e, t, t)
}
var a = window.kendo,
s = a.support,
l = a._activeElement,
d = s.placeholder,
c = a.ui,
u = a.keys,
p = a.data.DataSource,
f = c.List,
h = "aria-disabled",
g = "aria-readonly",
m = "k-state-default",
v = "disabled",
_ = "readonly",
b = "k-state-focused",
y = "k-state-selected",
w = "k-state-disabled",
x = "k-state-hover",
k = ".kendoAutoComplete",
C = "mouseenter" + k + " mouseleave" + k,
T = f.caret,
S = f.selectText,
A = e.proxy,
F = f.extend({
init: function (t, n) {
var i, r = this;
r.ns = k, n = e.isArray(n) ? {
dataSource: n
} : n, f.fn.init.call(r, t, n), t = r.element, n = r.options, n.placeholder = n.placeholder || t.attr("placeholder"), d && t.attr("placeholder", n.placeholder), r._wrapper(), r._loader(), r._dataSource(), r._ignoreCase(), t[0].type = "text", i = r.wrapper, r._popup(), t.addClass("k-input").on("keydown" + k, A(r._keydown, r)).on("paste" + k, A(r._search, r)).on("focus" + k, function () {
r._prev = r._accessor(), r._placeholder(!1), i.addClass(b)
}).on("blur" + k, function () {
r._change(), r._placeholder(), i.removeClass(b)
}).attr({
autocomplete: "off",
role: "textbox",
"aria-haspopup": !0
}), r._enable(), r._old = r._accessor(), t[0].id && t.attr("aria-owns", r.ul[0].id), r._aria(), r._placeholder(), a.notify(r)
},
options: {
name: "AutoComplete",
enabled: !0,
suggest: !1,
template: "",
dataTextField: "",
minLength: 1,
delay: 200,
height: 200,
filter: "startswith",
ignoreCase: !0,
highlightFirst: !1,
separator: null,
placeholder: "",
animation: {}
},
_dataSource: function () {
var e = this;
e.dataSource && e._refreshHandler ? e._unbindDataSource() : (e._refreshHandler = A(e.refresh, e), e._progressHandler = A(e._showBusy, e)), e.dataSource = p.create(e.options.dataSource).bind("change", e._refreshHandler).bind("progress", e._progressHandler)
},
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource()
},
events: ["open", "close", "change", "select", "dataBinding", "dataBound"],
setOptions: function (e) {
f.fn.setOptions.call(this, e), this._template(), this._accessors(), this._aria()
},
_editable: function (e) {
var t = this,
n = t.element,
i = t.wrapper.off(k),
r = e.readonly,
o = e.disable;
r || o ? (i.addClass(o ? w : m).removeClass(o ? m : w), n.attr(v, o).attr(_, r).attr(h, o).attr(g, r)) : (i.addClass(m).removeClass(w).on(C, t._toggleHover), n.removeAttr(v).removeAttr(_).attr(h, !1).attr(g, !1))
},
close: function () {
var e = this,
t = e._current;
t && t.removeClass(y), e.current(null), e.popup.close()
},
destroy: function () {
var e = this;
e.element.off(k), e.wrapper.off(k), f.fn.destroy.call(e)
},
refresh: function () {
var n, i = this,
r = i.ul[0],
o = i.popup,
s = i.options,
d = i._data(),
c = d.length;
i.trigger("dataBinding"), r.innerHTML = a.render(i.template, d), i._height(c), o.visible() && o._position(), c && (s.highlightFirst && i.current(e(r.firstChild)), s.suggest && i.suggest(e(r.firstChild))), i._open && (i._open = !1, n = c ? "open" : "close", i._typing && i.element[0] !== l() && (n = "close"), o[n](), i._typing = t), i._touchScroller && i._touchScroller.reset(), i._makeUnselectable(), i._hideBusy(), i.trigger("dataBound")
},
select: function (e) {
this._select(e)
},
search: function (e) {
var t, n = this,
r = n.options,
o = r.ignoreCase,
a = r.separator;
e = e || n._accessor(), n._current = null, clearTimeout(n._typing), a && (e = i(T(n.element[0]), e, a)), t = e.length, t ? t >= n.options.minLength && (n._open = !0, n._filterSource({
value: o ? e.toLowerCase() : e,
operator: r.filter,
field: r.dataTextField,
ignoreCase: o
})) : n.popup.close()
},
suggest: function (e) {
var i, r = this,
o = r._last,
a = r._accessor(),
s = r.element[0],
l = T(s),
d = r.options.separator,
c = a.split(d),
p = n(l, a, d),
h = l;
return o == u.BACKSPACE || o == u.DELETE ? (r._last = t, t) : (e = e || "", "string" != typeof e && (i = f.inArray(e[0], r.ul[0]), e = i > -1 ? r._text(r._data()[i]) : ""), 0 >= l && (l = a.toLowerCase().indexOf(e.toLowerCase()) + 1), i = a.substring(0, l).lastIndexOf(d), i = i > -1 ? l - (i + d.length) : l, a = c[p].substring(0, i), e && (i = e.toLowerCase().indexOf(a.toLowerCase()), i > -1 && (e = e.substring(i + a.length), h = l + e.length, a += e), d && "" !== c[c.length - 1] && c.push("")), c[p] = a, r._accessor(c.join(d || "")), S(s, l, h), t)
},
value: function (e) {
return e === t ? this._accessor() : (this._accessor(e), this._old = e, t)
},
_accessor: function (e) {
var n = this,
i = n.element[0];
return e === t ? (e = i.value, i.className.indexOf("k-readonly") > -1 ? e === n.options.placeholder ? "" : e : e) : (i.value = null === e ? "" : e, n._placeholder(), t)
},
_accept: function (e) {
var t = this;
t._focus(e), o(t.element[0])
},
_keydown: function (t) {
var n = this,
i = n.ul[0],
r = t.keyCode,
o = n._current,
a = n.popup.visible();
n._last = r, r === u.DOWN ? (a && n._move(o ? o.next() : e(i.firstChild)), t.preventDefault()) : r === u.UP ? (a && n._move(o ? o.prev() : e(i.lastChild)), t.preventDefault()) : r === u.ENTER || r === u.TAB ? (r === u.ENTER && n.popup.visible() && t.preventDefault(), n._accept(o)) : r === u.ESC ? (n.popup.visible() && t.preventDefault(), n.close()) : n._search()
},
_move: function (e) {
var t = this;
e = e[0] ? e : null, t.current(e), t.options.suggest && t.suggest(e)
},
_hideBusy: function () {
var e = this;
clearTimeout(e._busy), e._loading.hide(), e.element.attr("aria-busy", !1), e._busy = null
},
_showBusy: function () {
var e = this;
e._busy || (e._busy = setTimeout(function () {
e.element.attr("aria-busy", !0), e._loading.show()
}, 100))
},
_placeholder: function (e) {
if (!d) {
var n, i = this,
r = i.element,
o = i.options.placeholder;
if (o) {
if (n = r.val(), e === t && (e = !n), e || (o = n !== o ? n : ""), n === i._old && !e) return;
r.toggleClass("k-readonly", e).val(o)
}
}
},
_search: function () {
var e = this;
clearTimeout(e._typing), e._typing = setTimeout(function () {
e._prev !== e._accessor() && (e._prev = e._accessor(), e.search())
}, e.options.delay)
},
_select: function (t) {
var n, i, o = this,
a = o.options.separator,
s = o._data();
t = e(t), t[0] && !t.hasClass(y) && (i = f.inArray(t[0], o.ul[0]), i > -1 && (s = s[i], n = o._text(s), a && (n = r(T(o.element[0]), o._accessor(), n, a)), o._accessor(n), o.current(t.addClass(y))))
},
_loader: function () {
this._loading = e('').insertAfter(this.element)
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(x, "mouseenter" === t.type)
},
_wrapper: function () {
var e, t = this,
n = t.element,
i = n[0];
e = n.parent(), e.is("span.k-widget") || (e = n.wrap("").parent()), e.attr("tabindex", -1), e.attr("role", "presentation"), e[0].style.cssText = i.style.cssText, n.css({
width: "100%",
height: i.style.height
}), t._focused = t.element, t.wrapper = e.addClass("k-widget k-autocomplete k-header").addClass(i.className)
}
});
c.plugin(F)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
for (var i, r = 0, o = t.length - 1; o > r; ++r) i = t[r], i in e || (e[i] = {}), e = e[i];
e[t[o]] = n
}
var i = window.kendo,
r = i.ui,
o = r.Select,
a = i.support.mobileOS,
s = ".kendoDropDownList",
l = "disabled",
d = "readonly",
c = "change",
u = "k-state-focused",
p = "k-state-default",
f = "k-state-disabled",
h = "aria-disabled",
g = "aria-readonly",
m = "k-state-selected",
v = "mouseenter" + s + " mouseleave" + s,
_ = "tabindex",
b = e.proxy,
y = o.extend({
init: function (n, r) {
var a, l, d, c = this,
u = r && r.index;
c.ns = s, r = e.isArray(r) ? {
dataSource: r
} : r, o.fn.init.call(c, n, r), c._focusHandler = function () {
c.wrapper.focus()
}, r = c.options, n = c.element.on("focus" + s, c._focusHandler), c._reset(), c._word = "", c._wrapper(), c._tabindex(), c.wrapper.data(_, c.wrapper.attr(_)), c._aria(), c._span(), c._popup(), c._mobile(), c._dataSource(), c._ignoreCase(), c._enable(), c._cascade(), c._oldIndex = c.selectedIndex = -1, u !== t && (r.index = u), r.autoBind ? c.dataSource.fetch() : (d = r.text || "", d || (a = c._optionLabelText(r.optionLabel), l = a && 0 === r.index, c._isSelect ? d = l ? a : n.children(":selected").text() : !n[0].value && l && (d = a)), c.text(d)), i.notify(c)
},
options: {
name: "DropDownList",
enabled: !0,
autoBind: !0,
index: 0,
text: null,
value: null,
template: "",
delay: 500,
height: 200,
dataTextField: "",
dataValueField: "",
optionLabel: "",
cascadeFrom: "",
ignoreCase: !0,
animation: {}
},
events: ["open", "close", c, "select", "dataBinding", "dataBound", "cascade"],
setOptions: function (e) {
o.fn.setOptions.call(this, e), this._template(), this._accessors(), this._aria()
},
destroy: function () {
var e = this;
e.wrapper.off(s), e.element.off(s), e._inputWrapper.off(s), o.fn.destroy.call(e)
},
open: function () {
var e = this;
e.ul[0].firstChild ? (e.popup.open(), e._scroll(e._current)) : (e._open = !0, e._request || e.dataSource.fetch())
},
toggle: function (e) {
this._toggle(e)
},
refresh: function () {
var e = this,
t = e._data(),
n = t.length,
r = e.options.optionLabel;
e.trigger("dataBinding"), e._current && e.current(null), e.ul[0].innerHTML = i.render(e.template, t), e._height(n), e.popup.visible() && e.popup._position(), e._isSelect && (r && n && (r = e._optionLabelText(r), r = '"), e._options(t, r)), e._open && (e._open = !1, e.toggle( !! n)), e._hideBusy(), e._makeUnselectable(), !e._fetch && n && e._selectItem(), e._bound = !0, e.trigger("dataBound")
},
search: function (e) {
if (e) {
var n = this,
i = n.options.ignoreCase;
i && (e = e.toLowerCase()), n._select(function (r) {
var o = n._text(r);
return o !== t ? (o += "", i && (o = o.toLowerCase()), 0 === o.indexOf(e)) : t
})
}
},
text: function (e) {
var n = this.span;
return e === t ? n.text() : (n.text(e), t)
},
value: function (e) {
var n, i, r = this;
return e === t ? r._accessor() : (null !== e && (e = "" + e), r._selectedValue = e, i = e || r.options.optionLabel && !r.element[0].disabled && "" === e, i && r._fetchItems(e) || (n = r._index(e), r.select(n > -1 ? n : 0)), t)
},
_editable: function (e) {
var t = this,
n = t.element,
i = e.disable,
r = e.readonly,
o = t.wrapper.off(s),
a = t._inputWrapper.off(v),
c = function () {
a.addClass(u), t._blured = !1
}, m = function () {
t._blured || (t._triggerCascade(), t._blur(), a.removeClass(u), t._blured = !0, n.blur())
};
r || i ? (i ? (o.removeAttr(_), a.addClass(f).removeClass(p)) : (a.addClass(p).removeClass(f), o.on("focusin" + s, c).on("focusout" + s, m)), n.attr(l, i).attr(d, r), o.attr(h, i).attr(g, r)) : (n.removeAttr(l).removeAttr(d), a.addClass(p).removeClass(f).on(v, t._toggleHover), o.attr(_, o.data(_)).attr(h, !1).attr(g, !1).on("click" + s, function (e) {
t._blured = !1, e.preventDefault(), t.toggle()
}).on("keydown" + s, b(t._keydown, t)).on("keypress" + s, b(t._keypress, t)).on("focusin" + s, c).on("focusout" + s, m))
},
_accept: function (e) {
this._focus(e)
},
_optionLabelText: function () {
var e = this.options,
t = e.dataTextField,
n = e.optionLabel;
return n && t && "object" == typeof n ? this._text(n) : n
},
_data: function () {
var e = this,
t = e.options,
r = t.optionLabel,
o = t.dataTextField,
a = t.dataValueField,
s = e.dataSource.view(),
l = s.length,
d = r,
c = 0;
if (r && l) {
for ("object" == typeof r ? d = r : o && (d = {}, o = o.split("."), a = a.split("."), n(d, a, ""), n(d, o, r)), d = new i.data.ObservableArray([d]); l > c; c++) d.push(s[c]);
s = d
}
return s
},
_keydown: function (e) {
var t = this,
n = e.keyCode,
r = i.keys,
o = t.ul[0];
n === r.LEFT ? n = r.UP : n === r.RIGHT && (n = r.DOWN), e.keyCode = n, t._move(e), n === r.HOME ? (e.preventDefault(), t._select(o.firstChild)) : n === r.END && (e.preventDefault(), t._select(o.lastChild))
},
_selectNext: function (e, t) {
for (var n, i = this, r = i.options.ignoreCase, o = i._data(), a = o.length; a > t; t++)
if (n = i._text(o[t]), n && (n += "", r && (n = n.toLowerCase()), 0 === n.indexOf(e))) return i._select(t), i._triggerEvents(), !0;
return !1
},
_keypress: function (e) {
var t = this;
setTimeout(function () {
var n = String.fromCharCode(e.keyCode || e.charCode),
i = t.selectedIndex;
if (t.options.ignoreCase && (n = n.toLowerCase()), n === t._last && i > -1) {
if (t._word = n, t._selectNext(n, i + 1)) return
} else t._word += n;
t._last = n, t._search()
})
},
_popup: function () {
o.fn._popup.call(this), this.popup.one("open", function () {
this.wrapper = i.wrap(this.element).addClass("km-popup")
})
},
_search: function () {
var e = this,
n = e.dataSource,
i = e._word;
return clearTimeout(e._typing), e._typing = setTimeout(function () {
e._word = ""
}, e.options.delay), e.ul[0].firstChild ? (e.search(i), e._triggerEvents(), t) : (n.one(c, function () {
n.data()[0] && e.search(i)
}).fetch(), t)
},
_select: function (e) {
var n, i, o, a = this,
s = a._current,
l = a._data();
e = a._get(e), e && e[0] && !e.hasClass(m) && (s && s.removeClass(m), o = r.List.inArray(e[0], a.ul[0]), o > -1 && (l = l[o], i = a._text(l), n = a._value(l), a.selectedIndex = o, a.text(i), a._accessor(n !== t ? n : i, o), a._selectedValue = a._accessor(), a.current(e.addClass(m)), a._optionID && a._current.attr("aria-selected", !0)))
},
_triggerEvents: function () {
this.popup.visible() || (this._triggerCascade(), this._change())
},
_mobile: function () {
var e = this,
t = e.popup,
n = t.element.parents(".km-root").eq(0);
n.length && a && (t.options.animation.open.effects = a.android || a.meego ? "fadeIn" : a.ios || a.wp ? "slideIn:up" : t.options.animation.open.effects)
},
_span: function () {
var t, n = this,
i = n.wrapper,
r = "span.k-input";
t = i.find(r), t[0] || (i.append('select').append(n.element), t = i.find(r)), n.span = t, n._inputWrapper = e(i[0].firstChild), n._arrow = i.find(".k-icon").mousedown(function (e) {
e.preventDefault()
})
},
_wrapper: function () {
var e, t = this,
n = t.element,
i = n[0];
e = n.parent(), e.is("span.k-widget") || (e = n.wrap("").parent(), e[0].style.cssText = i.style.cssText), n.hide(), t._focused = t.wrapper = e.addClass("k-widget k-dropdown k-header").addClass(i.className).css("display", "").attr({
unselectable: "on",
role: "listbox",
"aria-haspopup": !0,
"aria-expanded": !1
})
},
_clearSelection: function () {
var e = this,
n = e.options.optionLabel;
return e.dataSource.view()[0] && n ? (e.select(0), t) : (e.text(n), e.element.val(""), e.selectedIndex = -1, t)
}
});
r.plugin(y)
}(window.kendo.jQuery),
function (e, t) {
var n = window.kendo,
i = n.ui,
r = i.List,
o = i.Select,
a = n.support,
s = a.placeholder,
l = n._activeElement,
d = n.keys,
c = ".kendoComboBox",
u = "click" + c,
p = "mousedown" + c,
f = "disabled",
h = "readonly",
g = "change",
m = "k-state-default",
v = "k-state-focused",
_ = "k-state-disabled",
b = "aria-disabled",
y = "aria-readonly",
w = "k-state-selected",
x = "filter",
k = "accept",
C = "rebind",
T = "mouseenter" + c + " mouseleave" + c,
S = null,
A = e.proxy,
F = o.extend({
init: function (t, i) {
var r, a = this;
a.ns = c, i = e.isArray(i) ? {
dataSource: i
} : i, o.fn.init.call(a, t, i), a._focusHandler = function () {
a.input.focus()
}, i = a.options, t = a.element.on("focus" + c, a._focusHandler), i.placeholder = i.placeholder || t.attr("placeholder"), a._reset(), a._wrapper(), a._input(), a._tabindex(a.input), a._popup(), a._dataSource(), a._ignoreCase(), a._enable(), a._cascade(), a._aria(), a._oldIndex = a.selectedIndex = -1, i.autoBind ? a._filterSource() : (r = i.text, !r && a._isSelect && (r = t.children(":selected").text()), r && a.input.val(r)), r || a._placeholder(), n.notify(a)
},
options: {
name: "ComboBox",
enabled: !0,
index: -1,
text: null,
value: null,
autoBind: !0,
delay: 200,
dataTextField: "",
dataValueField: "",
minLength: 0,
height: 200,
highlightFirst: !0,
template: "",
filter: "none",
placeholder: "",
suggest: !1,
ignoreCase: !0,
animation: {}
},
events: ["open", "close", g, "select", "dataBinding", "dataBound", "cascade"],
setOptions: function (e) {
o.fn.setOptions.call(this, e), this._template(), this._accessors(), this._aria()
},
current: function (e) {
var n = this,
i = n._current;
return e === t ? i : (i && i.removeClass(w), o.fn.current.call(n, e), t)
},
destroy: function () {
var e = this;
e.input.off(c), e.element.off(c), e._inputWrapper.off(c), o.fn.destroy.call(e)
},
_editable: function (e) {
var t = this,
n = e.disable,
i = e.readonly,
r = t._inputWrapper.off(c),
o = t.element.add(t.input.off(c)),
a = t._arrow.parent().off(u + " " + p);
i || n ? (r.addClass(n ? _ : m).removeClass(n ? m : _), o.attr(f, n).attr(h, i).attr(b, n).attr(y, i)) : (r.addClass(m).removeClass(_).on(T, t._toggleHover), o.removeAttr(f).removeAttr(h).attr(b, !1).attr(y, !1), a.on(u, function () {
t.toggle()
}).on(p, function (e) {
e.preventDefault()
}), t.input.on("keydown" + c, A(t._keydown, t)).on("focus" + c, function () {
r.addClass(v), t._placeholder(!1)
}).on("blur" + c, function () {
r.removeClass(v), clearTimeout(t._typing), t.options.text !== t.input.val() && t.text(t.text()), t._placeholder(), t._blur(), t.element.blur()
}))
},
open: function () {
var e = this,
t = e.dataSource.options.serverFiltering;
e.popup.visible() || (!e.ul[0].firstChild || e._state === k && !t ? (e._open = !0, e._state = C, e._filterSource()) : (e.popup.open(), e._scroll(e._current)))
},
refresh: function () {
var i, r, o, a = this,
s = a.ul[0],
d = a.options,
c = a._state,
u = a._data(),
p = u.length;
a.trigger("dataBinding"), s.innerHTML = n.render(a.template, u), a._height(p), a.popup.visible() && a.popup._position(), a._isSelect && (c === C && (a._state = "", i = a.value()), o = a._option, a._option = t, a._options(u), o && o[0].selected && a._custom(o.val())), p && (d.highlightFirst && a.current(e(s.firstChild)), d.suggest && a.input.val() && a._request !== t && a.suggest(e(s.firstChild))), c === x || a._fetch || a._selectItem(), a._open && (a._open = !1, r = !! p, a._typing && a.input[0] !== l() && (r = !1), a.toggle(r), a._typing = t), a._touchScroller && a._touchScroller.reset(), a._makeUnselectable(), a._hideBusy(), a._bound = !0, a.trigger("dataBound")
},
search: function (e) {
e = "string" == typeof e ? e : this.text();
var t = this,
n = e.length,
i = t.options,
r = i.ignoreCase,
o = i.filter,
a = i.dataTextField;
clearTimeout(t._typing), n >= i.minLength && (t._state = x, "none" === o ? t._filter(e) : (t._open = !0, t._filterSource({
value: r ? e.toLowerCase() : e,
field: a,
operator: o,
ignoreCase: r
})))
},
suggest: function (e) {
var n, i = this,
o = i.input[0],
a = i.text(),
s = r.caret(o),
l = i._last;
return l == d.BACKSPACE || l == d.DELETE ? (i._last = t, t) : (e = e || "", "string" != typeof e && (n = r.inArray(e[0], i.ul[0]), e = n > -1 ? i._text(i.dataSource.view()[n]) : ""), 0 >= s && (s = a.toLowerCase().indexOf(e.toLowerCase()) + 1), e ? (n = e.toLowerCase().indexOf(a.toLowerCase()), n > -1 && (a += e.substring(n + a.length))) : a = a.substring(0, s), a.length === s && e || (o.value = a, r.selectText(o, s, a.length)), t)
},
text: function (e) {
e = null === e ? "" : e;
var n, i = this,
r = i._text,
o = i.input[0],
a = i.options.ignoreCase,
s = e;
return e === t ? o.value : (n = i.dataItem(), n && r(n) === e ? (i._triggerCascade(), t) : (a && (s = s.toLowerCase()), i._select(function (e) {
return e = r(e), a && (e = (e + "").toLowerCase()), e === s
}), 0 > i.selectedIndex && (i._custom(e), o.value = e), i._triggerCascade(), t))
},
toggle: function (e) {
var t = this;
t._toggle(e)
},
value: function (e) {
var n, i = this;
return e === t ? i._accessor() : (null !== e && (e = "" + e), i._selectedValue = e, !i._open && e && i._fetchItems(e) || (n = i._index(e), n > -1 ? i.select(n) : (i.current(S), i._custom(e), i.text(e), i._placeholder()), i._prev = i._old = i._accessor(), i._oldIndex = i.selectedIndex), t)
},
_accept: function (e) {
var t = this;
e ? t._focus(e) : (t.text(t.text()), t._change())
},
_custom: function (t) {
var n = this,
i = n.element,
r = n._option;
n._state === x && (n._state = k), n._isSelect ? (r || (r = n._option = e(""), i.append(r)), r.text(t), r[0].selected = !0) : i.val(t), n._selectedValue = t
},
_filter: function (e) {
var n = this,
i = n.options,
r = n.dataSource,
o = i.ignoreCase,
a = function (i) {
var r = n._text(i);
return r !== t ? (r += "", "" !== r && "" === e ? !1 : (o && (r = r.toLowerCase()), 0 === r.indexOf(e))) : t
};
return o && (e = e.toLowerCase()), n.ul[0].firstChild ? (-1 !== n._highlight(a) && (i.suggest && n._current && n.suggest(n._current), n.open()), n._hideBusy(), t) : (r.one(g, function () {
r.data()[0] && n.search(e)
}).fetch(), t)
},
_highlight: function (n) {
var i, o = this;
return n === t || null === n ? -1 : (n = o._get(n), i = r.inArray(n[0], o.ul[0]), -1 == i && (n = o.options.highlightFirst && !o.text() ? e(o.ul[0].firstChild) : S), o.current(n), i)
},
_input: function () {
var t, n = this,
i = n.element.removeClass("k-input")[0],
r = i.accessKey,
o = n.wrapper,
a = "input.k-input",
l = i.name || "";
l && (l = 'name="' + l + '_input" '), t = o.find(a), t[0] || (o.append('select').append(n.element), t = o.find(a)), t[0].style.cssText = i.style.cssText, i.maxLength > -1 && (t[0].maxLength = i.maxLength), t.addClass(i.className).val(i.value).css({
width: "100%",
height: i.style.height
}).attr({
role: "combobox",
"aria-expanded": !1
}).show(), s && t.attr("placeholder", n.options.placeholder), r && (i.accessKey = "", t[0].accessKey = r), n._focused = n.input = t, n._inputWrapper = e(o[0].firstChild), n._arrow = o.find(".k-icon").attr({
role: "button",
tabIndex: -1
}), i.id && n._arrow.attr("aria-controls", n.ul[0].id)
},
_keydown: function (e) {
var t = this,
n = e.keyCode;
t._last = n, clearTimeout(t._typing), n == d.TAB || t._move(e) || t._search()
},
_placeholder: function (e) {
if (!s) {
var n, i = this,
r = i.input,
o = i.options.placeholder;
if (o) {
if (n = i.value(), e === t && (e = !n), r.toggleClass("k-readonly", e), !e) {
if (n) return;
o = ""
}
r.val(o)
}
}
},
_search: function () {
var e = this;
e._typing = setTimeout(function () {
var t = e.text();
e._prev !== t && (e._prev = t, e.search(t))
}, e.options.delay)
},
_select: function (e) {
var n, i, r = this,
o = r._data(),
a = r._highlight(e);
r.selectedIndex = a, -1 !== a && (r._state === x && (r._state = k), r._current.addClass(w), o = o[a], n = r._text(o), i = r._value(o), r._prev = r.input[0].value = n, r._accessor(i !== t ? i : n, a), r._selectedValue = r._accessor(), r._placeholder(), r._optionID && r._current.attr("aria-selected", !0))
},
_wrapper: function () {
var e = this,
t = e.element,
n = t.parent();
n.is("span.k-widget") || (n = t.hide().wrap("").parent(), n[0].style.cssText = t[0].style.cssText), e.wrapper = n.addClass("k-widget k-combobox k-header").addClass(t[0].className).css("display", "")
},
_clearSelection: function (e, t) {
var n = this,
i = e._selectedValue || e.value(),
r = i && -1 === e.selectedIndex;
(t || !i || r) && n.value("")
}
});
i.plugin(F)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t) {
var n;
if (null === e && null !== t || null !== e && null === t) return !1;
if (n = e.length, n !== t.length) return !1;
for (; n--;)
if (e[n] !== t[n]) return !1;
return !0
}
function i(e) {
var t = e.firstChild;
return t && "none" === t.style.display && (t = o(t, x)), t
}
function r(e) {
var t = e.lastChild;
return t && "none" === t.style.display && (t = o(t, k)), t
}
function o(e, t) {
return e = e[t], e && "none" === e.style.display && (e = o(e, t)), e
}
var a = window.kendo,
s = a.ui,
l = s.List,
d = a.keys,
c = a._activeElement,
u = a.data.ObservableArray,
p = e.proxy,
f = "id",
h = "li",
g = "accept",
m = "filter",
v = "open",
_ = "close",
b = "change",
y = "progress",
w = "select",
x = "nextSibling",
k = "previousSibling",
C = ' style="display:none"',
T = "aria-disabled",
S = "aria-readonly",
A = "k-state-focused",
F = "k-loading-hidden",
D = "k-state-hover",
I = "k-state-disabled",
E = "disabled",
P = "readonly",
z = ".kendoMultiSelect",
H = "click" + z,
R = "keydown" + z,
O = "mouseenter" + z,
M = "mouseleave" + z,
N = O + " " + M,
B = /"/g,
L = e.isArray,
V = ["font-family", "font-size", "font-stretch", "font-style", "font-weight", "letter-spacing", "text-transform", "line-height"],
U = l.extend({
init: function (t, n) {
var i, r, o = this;
o.ns = z, l.fn.init.call(o, t, n), o._wrapper(), o._tagList(), o._input(), o._textContainer(), o._loader(), o._tabindex(o.input), t = o.element.attr("multiple", "multiple").hide(), n = o.options, r = n.value, n.placeholder || (n.placeholder = t.data("placeholder")), i = t.attr(f), i && (o._tagID = i + "_tag_active", i += "_taglist", o.tagList.attr(f, i)), o._aria(i), o._dataSource(), o._ignoreCase(), o._popup(), o._values = [], o._dataItems = [], o._reset(), o._enable(), o._placeholder(), n.autoBind ? o.dataSource.fetch() : r && (L(r) || (r = [r]), (e.isPlainObject(r[0]) || !n.dataValueField) && (o.dataSource.data(r), o.value(o._initialValues))), a.notify(o)
},
options: {
name: "MultiSelect",
enabled: !0,
autoBind: !0,
highlightFirst: !0,
dataTextField: "",
dataValueField: "",
filter: "startswith",
ignoreCase: !0,
minLength: 0,
delay: 100,
value: null,
maxSelectedItems: null,
itemTemplate: "",
tagTemplate: "",
placeholder: "",
height: 200,
animation: {}
},
events: [v, _, b, w, "dataBinding", "dataBound"],
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource(), this.options.autoBind && this.dataSource.fetch()
},
setOptions: function (e) {
l.fn.setOptions.call(this, e), this._template(), this._accessors(), this._aria(this.tagList.attr(f))
},
current: function (e) {
return this.currentTag(null), l.fn.current.call(this, e)
},
currentTag: function (e) {
var n = this;
return e === t ? n._currentTag : (n._currentTag && (n._currentTag.removeClass(A).removeAttr(f), n.input.removeAttr("aria-activedescendant")), e && (e.addClass(A).attr(f, n._tagID), n.input.attr("aria-activedescendant", n._tagID)), n._currentTag = e, t)
},
dataItems: function () {
return this._dataItems
},
destroy: function () {
var e = this,
t = e.ns;
e.wrapper.off(t), e.tagList.off(t), e.input.off(t), l.fn.destroy.call(e)
},
_editable: function (t) {
var n = this,
i = t.disable,
r = t.readonly,
o = n.wrapper.off(z),
a = n.tagList.off(z),
s = n.element.add(n.input.off(z));
r || i ? (i ? o.addClass(I) : o.removeClass(I), s.attr(E, i).attr(P, r).attr(T, i).attr(S, r)) : (o.removeClass(I).on(N, n._toggleHover).on("mousedown" + z, function (e) {
e.preventDefault(), n.input[0] !== c() && n.input.focus(), -1 == e.target.className.indexOf("k-delete") && 0 === n.options.minLength && n.open()
}), n.input.on(R, p(n._keydown, n)).on("paste" + z, p(n._search, n)).on("focus" + z, function () {
n._placeholder(!1)
}).on("blur" + z, function () {
clearTimeout(n._typing), n._placeholder(), n.close(), n._state === m && (n._state = g), n.element.blur()
}), s.removeAttr(E).removeAttr(P).attr(T, !1).attr(S, !1), a.on(O, h, function () {
e(this).addClass(D)
}).on(M, h, function () {
e(this).removeClass(D)
}).on(H, ".k-delete", function (t) {
n._unselect(e(t.target).closest(h)), n._change(), n.close()
}))
},
close: function () {
this.popup.close(), this.current(null)
},
open: function () {
var t = this;
t.ul[0].firstChild && t._state !== g ? t._visibleItems && t._allowSelection() && (t.popup.open(), t.current(t.options.highlightFirst ? e(i(t.ul[0])) : null)) : (t._state = "", t._open = !0, t._filterSource())
},
toggle: function (e) {
this[e ? v : _]()
},
refresh: function () {
var t, n = this,
r = null;
n.trigger("dataBinding"), t = n._render(n.dataSource.view()), n._height(t), n._setInitialValues && (n._setInitialValues = !1, n.value(n._initialValues)), n._open && (n._open = !1, n.toggle(t)), n.popup.visible() && (n.popup._position(), n.options.highlightFirst && (r = e(i(n.ul[0])))), n.current(r), n._touchScroller && n._touchScroller.reset(), n._makeUnselectable(), n._hideBusy(), n.trigger("dataBound")
},
search: function (e) {
var t = this,
n = t.options,
i = n.ignoreCase,
r = n.filter,
o = n.dataTextField;
clearTimeout(t._typing), e = "string" == typeof e ? e : t.input.val(), e.length >= n.minLength && (t._state = m, t._open = !0, t._filterSource({
value: i ? e.toLowerCase() : e,
field: o,
operator: r,
ignoreCase: i
}))
},
value: function (n) {
var i, r = this,
o = e(r.tagList[0].children),
a = o.length,
s = 0;
if (n === t) return r._values;
if (!r._fetchItems(n)) {
for (; a > s; s++) r._unselect(o.eq(s));
if (null !== n) {
for (n = L(n) || n instanceof u ? n : [n], s = 0, a = n.length; a > s; s++) i = r._index(n[s]), i > -1 && r._select(i);
r._old = r._values.slice()
}
}
},
_dataSource: function () {
var e = this,
t = e.element,
n = e.options,
i = n.dataSource || {};
i = L(i) ? {
data: i
} : i, i.select = t, i.fields = [{
field: n.dataTextField
}, {
field: n.dataValueField
}], e.dataSource && e._refreshHandler ? e._unbindDataSource() : (e._refreshHandler = p(e.refresh, e), e._progressHandler = p(e._showBusy, e)), e.dataSource = a.data.DataSource.create(i).bind(b, e._refreshHandler).bind(y, e._progressHandler)
},
_fetchItems: function (e) {
var n = this;
return n._fetch || n.ul[0].firstChild ? t : (n.dataSource.one(b, function () {
n.value(e), n._fetch = !1
}), n._fetch = !0, n.dataSource.fetch(), !0)
},
_reset: function () {
var e = this,
t = e.element,
n = t.closest("form");
n[0] && (e._resetHandler = function () {
setTimeout(function () {
e.value(e._initialValues)
})
}, e._form = n.on("reset", e._resetHandler))
},
_initValue: function () {
var e = this,
t = e.options.value || e.element.val();
null === t ? t = [] : (L(t) || (t = [t]), t = e._mapValues(t)), e._old = e._initialValues = t, e._setInitialValues = !! t[0]
},
_mapValues: function (t) {
var n = this;
return t && e.isPlainObject(t[0]) && (t = e.map(t, function (e) {
return n._value(e)
})), t
},
_change: function () {
var e = this,
t = e.value();
n(t, e._old) || (e._old = t.slice(), e.trigger(b), e.element.trigger(b))
},
_click: function (n) {
var i = this,
r = e(n.currentTarget);
if (!n.isDefaultPrevented()) {
if (i.trigger(w, {
item: r
})) return i.close(), t;
i._select(r), i._change(), i.close()
}
},
_item: function (e, t) {
return e = e[t](), e[0] && !e.is(":visible") && (e = this._item(e, t)), e
},
_keydown: function (n) {
var s = this,
l = n.keyCode,
c = s._currentTag,
u = s._current,
p = s.input.val(),
f = a.support.isRtl(s.wrapper),
h = s.popup.visible();
if (l === d.DOWN) {
if (n.preventDefault(), !h) return s.open(), t;
u = u ? o(u[0], x) : s.ul[0].firstChild, u && s.current(e(u))
} else if (l === d.UP) h && (u = u ? o(u[0], k) : s.ul[0].lastChild, s.current(e(u)), s._current[0] || s.close()), n.preventDefault();
else if (l === d.LEFT && !f || l === d.RIGHT && f) p || (c = c ? c.prev() : e(s.tagList[0].lastChild), c[0] && s.currentTag(c));
else if (l === d.RIGHT && !f || l === d.LEFT && f)!p && c && (c = c.next(), s.currentTag(c[0] ? c : null));
else if (l === d.ENTER && h) {
if (u) {
if (s.trigger(w, {
item: u
})) return s.close(), t;
s._select(u)
}
s._change(), s.close(), n.preventDefault()
} else l === d.ESC ? (h ? n.preventDefault() : s.currentTag(null), s.close()) : l === d.HOME ? h ? s.current(e(i(s.ul[0]))) : p || (c = s.tagList[0].firstChild, c && s.currentTag(e(c))) : l === d.END ? h ? s.current(e(r(s.ul[0]))) : p || (c = s.tagList[0].lastChild, c && s.currentTag(e(c))) : l !== d.DELETE && l !== d.BACKSPACE || p ? (clearTimeout(s._typing), s._search()) : (l !== d.BACKSPACE || c || (c = e(s.tagList[0].lastChild)), c && c[0] && (s._unselect(c), s._change(), s.close()))
},
_hideBusy: function () {
var e = this;
clearTimeout(e._busy), e.input.attr("aria-busy", !1), e._loading.addClass(F), e._busy = null
},
_showBusy: function () {
var e = this;
e._busy || (e._busy = setTimeout(function () {
e.input.attr("aria-busy", !0), e._loading.removeClass(F)
}, 100))
},
_placeholder: function (e) {
var n = this,
i = n.input;
e === t ? (e = !1, i[0] !== c() && (e = !n._dataItems[0]), n.wrapper.removeClass(A)) : n.wrapper.addClass(A), n._prev = "", i.toggleClass("k-readonly", e).val(e ? n.options.placeholder : ""), n._scale()
},
_scale: function () {
var e, t = this,
n = t.wrapper,
i = n.width(),
r = t._span.text(t.input.val());
n.is(":visible") ? e = r.width() + 25 : (r.appendTo(document.documentElement), i = e = r.width() + 25, r.appendTo(n)), t.input.width(e > i ? i : e)
},
_option: function (e, n) {
var i = ""
},
_render: function (e) {
for (var t, n, i = this, r = e.length, o = i.itemTemplate, a = i._dataItems.slice(0), s = 0, l = 0, d = "", c = ""; r > l; l++) t = e[l], n = i._selected(a, t), c += o(t, l, n), d += i._option(t, n), n || (s += 1);
if (r = a.length)
for (l = 0; r > l; l++) d += i._option(a[l], !0);
return i.ul[0].innerHTML = c, i.element.html(d), i._visibleItems = s, s
},
_selected: function (e, n) {
var i, r = this,
o = r._text,
a = r._value,
s = a(n),
l = e.length,
d = !1,
c = 0;
for (s === t && (s = o(n)); l > c; c++)
if (n = e[c], i = a(n), i === t && (i = o(n)), i !== t && i === s) {
d = !0;
break
}
return d && e.splice(c, 1), d
},
_search: function () {
var e = this;
e._typing = setTimeout(function () {
var t = e.input.val();
e._prev !== t && (e._scale(), e._prev = t, e.search(t))
}, e.options.delay)
},
_allowSelection: function () {
var e = this.options.maxSelectedItems;
return null === e || e > this._values.length
},
_select: function (e) {
var t, n, i = this,
r = i._values;
i._allowSelection() && (isNaN(e) ? n = e.hide().data("idx") : (n = e, i.ul[0].children[n].style.display = "none"), i.element[0].children[n].selected = !0, t = i.dataSource.view()[n], i.tagList.append(i.tagTemplate(t)), i._dataItems.push(t), r.push(i._dataValue(t)), i._visibleItems -= 1, i.currentTag(null), i._placeholder(), i._height(i._visibleItems), i._state === m && (i._state = g))
},
_unselect: function (t) {
var n, i, r, o, a, s = this,
l = t.index();
if (t.remove(), s.currentTag(null), s._values.splice(l, 1), n = s._dataItems.splice(l, 1)[0], i = s._dataValue(n), l = s._index(i), -1 !== l) e(s.ul[0].children[l]).show(), s.element[0].children[l].selected = !1, s._visibleItems += 1, s._height(s._visibleItems);
else
for (l = s.dataSource.view().length, r = s.element[0].children, a = r.length; a > l; l++)
if (o = r[l], o.value == i) {
o.selected = !1;
break
} s._placeholder()
},
_template: function () {
var e, t = this,
n = t.options,
i = n.itemTemplate,
r = n.tagTemplate,
o = n.dataSource;
t.element[0].length && !o && (n.dataTextField = n.dataTextField || "text", n.dataValueField = n.dataValueField || "value"), e = a.template("#:" + a.expr(n.dataTextField, "data") + "#", {
useWithBlock: !1
}), i = i ? a.template(i) : e, r = r ? a.template(r) : e, t.itemTemplate = function (e, t, n) {
return '
" + i(e) + "
"
}, t.tagTemplate = function (e) {
return '
' + r(e) + 'delete
'
}
},
_input: function () {
var t = this,
n = t.element[0].accessKey,
i = t._innerWrapper.children("input.k-input");
i[0] || (i = e('').appendTo(t._innerWrapper)), t.element.removeAttr("accesskey"), t._focused = t.input = i.attr({
accesskey: n,
role: "listbox",
"aria-expanded": !1
})
},
_tagList: function () {
var t = this,
n = t._innerWrapper.children("ul");
n[0] || (n = e('
').appendTo(t._innerWrapper)), t.tagList = n
},
_loader: function () {
this._loading = e('').insertAfter(this.input)
},
_textContainer: function () {
var t = a.getComputedStyles(this.input[0], V);
t.position = "absolute", t.visibility = "hidden", this._span = e("").css(t).appendTo(this.wrapper)
},
_wrapper: function () {
var t = this,
n = t.element,
i = n.parent("span.k-multiselect");
i[0] || (i = n.wrap('').parent(), i[0].style.cssText = n[0].style.cssText, e('').insertBefore(n)), t.wrapper = i.addClass(n[0].className).css("display", ""), t._innerWrapper = e(i[0].firstChild)
}
});
s.plugin(U)
}(window.kendo.jQuery),
function (e, t, n) {
function i(e, t, n) {
n = a(n), n && !n.equals(e.color()) && ("change" == t && (e._value = n), n = 1 != n.a ? n.toCssRgba() : n.toCss(), e.trigger(t, {
value: n
}))
}
function r(e, t, n) {
for (n || (n = "0"), e = e.toString(16); t > e.length;) e = "0" + e;
return e
}
function o(e) {
return parseFloat((+e).toFixed(3))
}
function a(e, i) {
if (null == e || "transparent" == e) return null;
if (e instanceof F) return e;
var r = /^#?([0-9a-f]{2})([0-9a-f]{2})([0-9a-f]{2})$/i.exec(e);
if (r) return new I(t(r[1], 16), t(r[2], 16), t(r[3], 16), 1);
if (r = /^#?([0-9a-f])([0-9a-f])([0-9a-f])$/i.exec(e)) return new I(t(r[1] + r[1], 16), t(r[2] + r[2], 16), t(r[3] + r[3], 16), 1);
if (r = /^rgb\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*\)/.exec(e)) return new I(t(r[1], 10), t(r[2], 10), t(r[3], 10), 1);
if (r = /^rgba\(\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9]+)\s*,\s*([0-9.]+)\s*\)/.exec(e)) return new I(t(r[1], 10), t(r[2], 10), t(r[3], 10), parseFloat(r[4]));
if (r = /^rgb\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*\)/.exec(e)) return new D(parseFloat(r[1]) / 100, parseFloat(r[2]) / 100, parseFloat(r[3]) / 100, 1);
if (r = /^rgba\(\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9]*\.?[0-9]+)%\s*,\s*([0-9.]+)\s*\)/.exec(e)) return new D(parseFloat(r[1]) / 100, parseFloat(r[2]) / 100, parseFloat(r[3]) / 100, parseFloat(r[4]));
if (!i) throw Error("Cannot parse color: " + e);
return n
}
function s(e, t, n) {
var i, r;
return e = Array.prototype.slice.call(e), i = e.length, r = e.indexOf(t), 0 > r ? 0 > n ? e[i - 1] : e[0] : (r += n, 0 > r ? r += i : r %= i, e[r])
}
function l(e) {
e.preventDefault()
}
function d(e, t) {
return function () {
return e.apply(t, arguments)
}
}
var c = window.kendo,
u = c.Class,
p = c.ui,
f = p.Widget,
h = c.keys,
g = "background-color",
m = "k-state-selected",
v = "000000,7f7f7f,880015,ed1c24,ff7f27,fff200,22b14c,00a2e8,3f48cc,a349a4,ffffff,c3c3c3,b97a57,ffaec9,ffc90e,efe4b0,b5e61d,99d9ea,7092be,c8bfe7",
_ = "FFFFFF,FFCCFF,FF99FF,FF66FF,FF33FF,FF00FF,CCFFFF,CCCCFF,CC99FF,CC66FF,CC33FF,CC00FF,99FFFF,99CCFF,9999FF,9966FF,9933FF,9900FF,FFFFCC,FFCCCC,FF99CC,FF66CC,FF33CC,FF00CC,CCFFCC,CCCCCC,CC99CC,CC66CC,CC33CC,CC00CC,99FFCC,99CCCC,9999CC,9966CC,9933CC,9900CC,FFFF99,FFCC99,FF9999,FF6699,FF3399,FF0099,CCFF99,CCCC99,CC9999,CC6699,CC3399,CC0099,99FF99,99CC99,999999,996699,993399,990099,FFFF66,FFCC66,FF9966,FF6666,FF3366,FF0066,CCFF66,CCCC66,CC9966,CC6666,CC3366,CC0066,99FF66,99CC66,999966,996666,993366,990066,FFFF33,FFCC33,FF9933,FF6633,FF3333,FF0033,CCFF33,CCCC33,CC9933,CC6633,CC3333,CC0033,99FF33,99CC33,999933,996633,993333,990033,FFFF00,FFCC00,FF9900,FF6600,FF3300,FF0000,CCFF00,CCCC00,CC9900,CC6600,CC3300,CC0000,99FF00,99CC00,999900,996600,993300,990000,66FFFF,66CCFF,6699FF,6666FF,6633FF,6600FF,33FFFF,33CCFF,3399FF,3366FF,3333FF,3300FF,00FFFF,00CCFF,0099FF,0066FF,0033FF,0000FF,66FFCC,66CCCC,6699CC,6666CC,6633CC,6600CC,33FFCC,33CCCC,3399CC,3366CC,3333CC,3300CC,00FFCC,00CCCC,0099CC,0066CC,0033CC,0000CC,66FF99,66CC99,669999,666699,663399,660099,33FF99,33CC99,339999,336699,333399,330099,00FF99,00CC99,009999,006699,003399,000099,66FF66,66CC66,669966,666666,663366,660066,33FF66,33CC66,339966,336666,333366,330066,00FF66,00CC66,009966,006666,003366,000066,66FF33,66CC33,669933,666633,663333,660033,33FF33,33CC33,339933,336633,333333,330033,00FF33,00CC33,009933,006633,003333,000033,66FF00,66CC00,669900,666600,663300,660000,33FF00,33CC00,339900,336600,333300,330000,00FF00,00CC00,009900,006600,003300,000000",
b = {
apply: "Apply",
cancel: "Cancel"
}, y = ".kendoColorTools",
w = "click" + y,
x = "keydown" + y,
k = c.support.browser,
C = k.msie && 9 > k.version,
T = f.extend({
init: function (e, t) {
var n, i = this;
f.fn.init.call(i, e, t), e = i.element, t = i.options, i._value = t.value = a(t.value), n = i._ariaId = t.ariaId, n && e.attr("aria-labelledby", n), t._standalone && (i._triggerSelect = i._triggerChange)
},
options: {
value: null,
_standalone: !0
},
events: ["change", "select", "cancel"],
color: function (e) {
return e !== n && this._updateUI(this._value = a(e)), this._value
},
value: function (e) {
return e = this.color(e), e && (e = this.options.opacity ? e.toCssRgba() : e.toCss()), e || null
},
enable: function (t) {
0 === arguments.length && (t = !0), t ? e(".k-disabled-overlay", this.wrapper).remove() : this.wrapper.append(""), this._onEnable(t)
},
_select: function (e, t) {
var n = this._value;
e = this.color(e), t || (e.equals(n) ? this._standalone || this.trigger("cancel") : this.trigger("change", {
value: this.value()
}))
},
_triggerSelect: function (e) {
i(this, "select", e)
},
_triggerChange: function (e) {
i(this, "change", e)
},
destroy: function () {
this.element && this.element.off(y), this.wrapper && this.wrapper.off(y).find("*").off(y), this.wrapper = null, f.fn.destroy.call(this)
},
_updateUI: e.noop,
_selectOnHide: function () {
return null
},
_cancel: function () {
this.trigger("cancel")
}
}),
S = T.extend({
init: function (t, n) {
var i, r, o, s, l = this;
if (T.fn.init.call(l, t, n), t = l.wrapper = l.element, n = l.options, i = n.palette, "websafe" == i ? (i = _, n.columns = 18) : "basic" == i && (i = v), "string" == typeof i && (i = i.split(",")), e.isArray(i) && (i = e.map(i, function (e) {
return a(e)
})), t.addClass("k-widget k-colorpalette").append(e(l._template({
colors: i,
tileSize: n.tileSize,
value: l._value,
id: n.ariaId
}))).on(w, ".k-item", function (t) {
l._select(e(t.currentTarget).css(g))
}).attr("tabIndex", 0).on(x, d(l._keydown, l)), s = n.tileSize) {
if (/number|string/.test(typeof s)) r = o = parseFloat(s);
else {
if ("object" != typeof s) throw Error("Unsupported value for the 'tileSize' argument");
r = parseFloat(s.width), o = parseFloat(s.height)
}
t.find(".k-item").css({
width: r - 2,
height: o - 2
})
}
n.columns && t.css("width", n.columns * (r || 14))
},
focus: function () {
this.wrapper.focus()
},
options: {
name: "ColorPalette",
columns: 10,
tileSize: null,
palette: "basic"
},
_onEnable: function (e) {
e ? this.wrapper.removeAttr("tabIndex") : this.wrapper.attr("tabIndex", 0)
},
_keydown: function (t) {
var n, i, r = this,
o = r.wrapper,
d = o.find(".k-item"),
c = d.filter("." + m).get(0),
u = t.keyCode;
if (u == h.LEFT ? n = s(d, c, -1) : u == h.RIGHT ? n = s(d, c, 1) : u == h.DOWN ? n = s(d, c, r.options.columns) : u == h.UP ? n = s(d, c, -r.options.columns) : u == h.ENTER ? (l(t), c && this._select(e(c).css(g))) : u == h.ESC && this._cancel(), n) {
l(t), n = e(n), e(c).removeClass(m).removeAttr("aria-selected"), n.addClass(m).attr("aria-selected", !0);
try {
i = a(n.css(g)), r._triggerSelect(i)
} catch (p) {}
}
},
_updateUI: function (t) {
var n = this,
i = null;
n.wrapper.find(".k-item." + m).removeClass(m).removeAttr("aria-selected"), n.wrapper.find(".k-item").each(function () {
var n = a(e(this).css(g));
n && n.equals(t) && (i = this)
}), e(i).addClass(m).attr("aria-selected", !0)
},
_template: c.template('
# for (var i = 0; i < colors.length; i++) { #
' + "
" + "# } #" + "
")
}),
A = T.extend({
init: function (t, n) {
var i = this;
T.fn.init.call(i, t, n), n = i.options, t = i.element, i.wrapper = t.addClass("k-widget k-flatcolorpicker").append(i._template(n)), i._hueElements = e(".k-hsv-rectangle, .k-transparency-slider .k-slider-track", t), i._selectedColor = e(".k-selected-color-display", t), i._colorAsText = e("input.k-color-value", t), i._sliders(), i._hsvArea(), i._updateUI(i._value || new D(1, 0, 0, 1)), t.find("input.k-color-value").on(x, function (t) {
var n, r;
if (t.keyCode == h.ENTER) try {
n = a(this.value), r = i.color(), i._select(n, n.equals(r))
} catch (o) {
e(this).addClass("k-state-error")
}
}).end().on(w, ".k-controls button.apply", function () {
i._select(i._getHSV())
}).on(w, ".k-controls button.cancel", function () {
i._updateUI(i.color()), i._cancel()
}), C && i._applyIEFilter()
},
destroy: function () {
this._hueSlider.destroy(), this._opacitySlider && this._opacitySlider.destroy(), this._hueSlider = this._opacitySlider = this._hsvRect = this._hsvHandle = this._hueElements = this._selectedColor = this._colorAsText = null, T.fn.destroy.call(this)
},
options: {
name: "FlatColorPicker",
opacity: !1,
buttons: !1,
input: !0,
preview: !0,
messages: b
},
_applyIEFilter: function () {
var e = this.element.find(".k-hue-slider .k-slider-track")[0],
t = e.currentStyle.backgroundImage;
t = t.replace(/^url\([\'\"]?|[\'\"]?\)$/g, ""), e.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + t + "', sizingMethod='scale')"
},
_sliders: function () {
function e(e) {
n._updateUI(n._getHSV(e.value, null, null, null))
}
function t(e) {
n._updateUI(n._getHSV(null, null, null, e.value / 100))
}
var n = this,
i = n.element;
n._hueSlider = i.find(".k-hue-slider").kendoSlider({
min: 0,
max: 359,
tickPlacement: "none",
showButtons: !1,
slide: e,
change: e
}).data("kendoSlider"), n._opacitySlider = i.find(".k-transparency-slider").kendoSlider({
min: 0,
max: 100,
tickPlacement: "none",
showButtons: !1,
slide: t,
change: t
}).data("kendoSlider")
},
_hsvArea: function () {
function e(e, n) {
var i = this.offset,
r = e - i.left,
o = n - i.top,
a = this.width,
s = this.height;
r = 0 > r ? 0 : r > a ? a : r, o = 0 > o ? 0 : o > s ? s : o, t._svChange(r / a, 1 - o / s)
}
var t = this,
n = t.element,
i = n.find(".k-hsv-rectangle"),
r = i.find(".k-draghandle").attr("tabIndex", 0).on(x, d(t._keydown, t));
t._hsvEvents = new c.UserEvents(i, {
global: !0,
press: function (t) {
this.offset = c.getOffset(i), this.width = i.width(), this.height = i.height(), r.focus(), e.call(this, t.x.location, t.y.location)
},
start: function () {
i.addClass("k-dragging"), r.focus()
},
move: function (t) {
t.preventDefault(), e.call(this, t.x.location, t.y.location)
},
end: function () {
i.removeClass("k-dragging")
}
}), t._hsvRect = i, t._hsvHandle = r
},
_onEnable: function (e) {
this._hueSlider.enable(e), this._opacitySlider && this._opacitySlider.enable(e), this.wrapper.find("input").attr("disabled", !e);
var t = this._hsvRect.find(".k-draghandle");
e ? t.attr("tabIndex", 0) : t.removeAttr("tabIndex")
},
_keydown: function (e) {
function t(t, n) {
var r = i._getHSV();
r[t] += n * (e.shiftKey ? .01 : .05), 0 > r[t] && (r[t] = 0), r[t] > 1 && (r[t] = 1), i._updateUI(r), l(e)
}
function n(t) {
var n = i._getHSV();
n.h += t * (e.shiftKey ? 1 : 5), 0 > n.h && (n.h = 0), n.h > 359 && (n.h = 359), i._updateUI(n), l(e)
}
var i = this;
switch (e.keyCode) {
case h.LEFT:
e.ctrlKey ? n(-1) : t("s", -1);
break;
case h.RIGHT:
e.ctrlKey ? n(1) : t("s", 1);
break;
case h.UP:
t(e.ctrlKey && i._opacitySlider ? "a" : "v", 1);
break;
case h.DOWN:
t(e.ctrlKey && i._opacitySlider ? "a" : "v", -1);
break;
case h.ENTER:
i._select(i._getHSV());
break;
case h.F2:
i.wrapper.find("input.k-color-value").focus().select();
break;
case h.ESC:
i._cancel()
}
},
focus: function () {
this._hsvHandle.focus()
},
_getHSV: function (e, t, n, i) {
var r = this._hsvRect,
o = r.width(),
a = r.height(),
s = this._hsvHandle.position();
return null == e && (e = this._hueSlider.value()), null == t && (t = s.left / o), null == n && (n = 1 - s.top / a), null == i && (i = this._opacitySlider ? this._opacitySlider.value() / 100 : 1), new E(e, t, n, i)
},
_svChange: function (e, t) {
var n = this._getHSV(null, e, t, null);
this._updateUI(n)
},
_updateUI: function (e) {
var t = this,
n = t._hsvRect;
e && (this._colorAsText.removeClass("k-state-error"), t._selectedColor.css(g, e.toDisplay()), t._colorAsText.val(t._opacitySlider ? e.toCssRgba() : e.toCss()), t._triggerSelect(e), e = e.toHSV(), t._hsvHandle.css({
left: e.s * n.width() + "px",
top: (1 - e.v) * n.height() + "px"
}), t._hueElements.css(g, new E(e.h, 1, 1, 1).toCss()), t._hueSlider.value(e.h), t._opacitySlider && t._opacitySlider.value(100 * e.a))
},
_selectOnHide: function () {
return this.options.buttons ? null : this._getHSV()
},
_template: c.template('# if (preview) { #
# } #
# if (opacity) { ## } ## if (buttons) { #
# } #')
}),
F = u.extend({
toHSV: function () {
return this
},
toRGB: function () {
return this
},
toHex: function () {
return this.toBytes().toHex()
},
toBytes: function () {
return this
},
toCss: function () {
return "#" + this.toHex()
},
toCssRgba: function () {
var e = this.toBytes();
return "rgba(" + e.r + ", " + e.g + ", " + e.b + ", " + o(this.a) + ")"
},
toDisplay: function () {
return C ? this.toCss() : this.toCssRgba()
},
equals: function (e) {
return e === this || null !== e && this.toCssRgba() == a(e).toCssRgba()
},
diff: function (e) {
if (null == e) return 0 / 0;
var t = this.toBytes();
return e = e.toBytes(), Math.sqrt(Math.pow(.3 * (t.r - e.r), 2) + Math.pow(.59 * (t.g - e.g), 2) + Math.pow(.11 * (t.b - e.b), 2))
},
clone: function () {
var e = this.toBytes();
return e === this && (e = new I(e.r, e.g, e.b, e.a)), e
}
}),
D = F.extend({
init: function (e, t, n, i) {
this.r = e, this.g = t, this.b = n, this.a = i
},
toHSV: function () {
var e, t, n = this.r,
i = this.g,
r = this.b,
o = Math.min(n, i, r),
a = Math.max(n, i, r),
s = a,
l = a - o;
return 0 === l ? new E(0, 0, s, this.a) : (0 !== a ? (t = l / a, e = n == a ? (i - r) / l : i == a ? 2 + (r - n) / l : 4 + (n - i) / l, e *= 60, 0 > e && (e += 360)) : (t = 0, e = -1), new E(e, t, s, this.a))
},
toBytes: function () {
return new I(255 * this.r, 255 * this.g, 255 * this.b, this.a)
}
}),
I = D.extend({
init: function (e, t, n, i) {
this.r = Math.round(e), this.g = Math.round(t), this.b = Math.round(n), this.a = i
},
toRGB: function () {
return new D(this.r / 255, this.g / 255, this.b / 255, this.a)
},
toHSV: function () {
return this.toRGB().toHSV()
},
toHex: function () {
return r(this.r, 2) + r(this.g, 2) + r(this.b, 2)
},
toBytes: function () {
return this
}
}),
E = F.extend({
init: function (e, t, n, i) {
this.h = e, this.s = t, this.v = n, this.a = i
},
toRGB: function () {
var e, t, n, i, r, o, a, s, l = this.h,
d = this.s,
c = this.v;
if (0 === d) t = n = i = c;
else switch (l /= 60, e = Math.floor(l), r = l - e, o = c * (1 - d), a = c * (1 - d * r), s = c * (1 - d * (1 - r)), e) {
case 0:
t = c, n = s, i = o;
break;
case 1:
t = a, n = c, i = o;
break;
case 2:
t = o, n = c, i = s;
break;
case 3:
t = o, n = a, i = c;
break;
case 4:
t = s, n = o, i = c;
break;
default:
t = c, n = o, i = a
}
return new D(t, n, i, this.a)
},
toBytes: function () {
return this.toRGB().toBytes()
}
}),
P = f.extend({
init: function (t, n) {
var i, r, o, s = this;
f.fn.init.call(s, t, n), n = s.options, t = s.element, i = t.val() ? a(t.val(), !0) : a(n.value, !0), s._value = n.value = i, r = s.wrapper = e(s._template(n)), t.hide().after(r), t.is("input") && t.appendTo(r), s.enable(!t.attr("disabled")), o = t.attr("accesskey"), o && (t.attr("accesskey", null), r.attr("accesskey", o)), s.bind("activate", function (e) {
e.isDefaultPrevented() || s.toggle()
}), s._updateUI(i)
},
destroy: function () {
this.wrapper.add("*").off(y), this._popup && (this._selector.destroy(), this._popup.destroy()), this._selector = this._popup = this.wrapper = null, f.fn.destroy.call(this)
},
enable: function (e) {
var t = this,
n = t.wrapper,
i = n.children(".k-picker-wrap"),
r = i.find(".k-select");
0 === arguments.length && (e = !0), t.element.attr("disabled", !e), n.attr("disabled", !e), r.off(y).on("mousedown" + y, l), e ? n.removeClass("k-state-disabled").attr("tabIndex", 0).on("mouseenter" + y, function () {
i.addClass("k-state-hover")
}).on("mouseleave" + y, function () {
i.removeClass("k-state-hover")
}).on("focus" + y, function () {
i.addClass("k-state-focused")
}).on("blur" + y, function () {
i.removeClass("k-state-focused")
}).on(x, d(t._keydown, t)).on(w, ".k-icon", d(t.toggle, t)).on(w, t.options.toolIcon ? ".k-tool-icon" : ".k-selected-color", function () {
t.trigger("activate")
}) : n.addClass("k-state-disabled").removeAttr("tabIndex").add("*", n).off(y)
},
_template: c.template('# if (toolIcon) { ## } else { ## } #'),
options: {
name: "ColorPicker",
palette: null,
columns: 10,
toolIcon: null,
value: null,
messages: b,
opacity: !1,
buttons: !0,
preview: !0
},
events: ["activate", "change", "select", "open", "close"],
open: function () {
this._getPopup().open()
},
close: function () {
this._getPopup().close()
},
toggle: function () {
this._getPopup().toggle()
},
color: T.fn.color,
value: T.fn.value,
_select: T.fn._select,
_triggerSelect: T.fn._triggerSelect,
_isInputTypeColor: function () {
var e = this.element[0];
return /^input$/i.test(e.tagName) && /^color$/i.test(e.type)
},
_updateUI: function (e) {
e && (this._isInputTypeColor() || 1 == e.a ? this.element.val(e.toCss()) : this.element.val(e.toCssRgba())), this._triggerSelect(e), this.wrapper.find(".k-selected-color").css(g, e ? e.toDisplay() : "transparent")
},
_keydown: function (e) {
var t = e.keyCode;
this._getPopup().visible() ? (t == h.ESC ? this._selector._cancel() : this._selector._keydown(e), l(e)) : (t == h.ENTER || t == h.DOWN) && (this.open(), l(e))
},
_getPopup: function () {
var t, i, r, o = this,
s = o._popup;
return s || (t = this.options, i = t.palette ? S : A, t._standalone = !1, r = this._selector = new i(e("").appendTo(document.body), t), o._popup = s = r.wrapper.kendoPopup({
anchor: o.wrapper
}).data("kendoPopup"), r.bind({
select: function (e) {
o._updateUI(a(e.value))
},
change: function () {
o._select(r.color()), o.close()
},
cancel: function () {
o.close()
}
}), s.bind({
close: function (e) {
if (o.trigger("close")) return e.preventDefault(), n;
var t = r._selectOnHide();
t ? o._select(t) : (o.wrapper.focus(), o._updateUI(o.color()))
},
open: function (e) {
o.trigger("open") && e.preventDefault()
},
activate: function () {
r._select(o.color(), !0), r.focus()
}
})), s
}
});
p.plugin(S), p.plugin(A), p.plugin(P), c.parseColor = a, c.Color = {
fromBytes: function (e, t, n, i) {
return new I(e, t, n, null != i ? i : 1)
},
fromRGB: function (e, t, n, i) {
return new D(e, t, n, null != i ? i : 1)
},
fromHSV: function (e, t, n, i) {
return new E(e, t, n, null != i ? i : 1)
}
}
}(jQuery, parseInt),
function (e, t) {
function n(t) {
return e.trim(t).replace(/ /gi, "")
}
var i = window.kendo,
r = i.ui,
o = e.proxy,
a = e.extend,
s = e.grep,
l = e.map,
d = e.inArray,
c = "k-state-selected",
u = "asc",
p = "desc",
f = "change",
h = "init",
g = "kendoPopup",
m = "kendoFilterMenu",
v = "kendoMenu",
_ = ".kendoColumnMenu",
b = /(\[|\]|\$|\.|\:|\+)/g,
y = r.Widget,
w = y.extend({
init: function (t, n) {
var r, a = this;
y.fn.init.call(a, t, n), t = a.element, n = a.options, a.owner = n.owner, a.dataSource = n.dataSource, a.field = t.attr(i.attr("field")), r = t.find(".k-header-column-menu"), r[0] || (r = t.prepend('').find(".k-header-column-menu")), a.link = r.attr("tabindex", -1).on("click" + _, o(a._click, a)), a.wrapper = e('')
},
_init: function () {
var e = this,
t = e.options;
e.wrapper.html(i.template(x)({
ns: i.ns,
messages: t.messages,
sortable: t.sortable,
filterable: t.filterable,
columns: e._ownerColumns(),
showColumns: t.columns
})), e.popup = e.wrapper[g]({
anchor: e.link,
open: o(e._open, e),
activate: o(e._activate, e),
close: e.options.closeCallback
}).data(g), e._menu(), e._sort(), e._columns(), e._filter(), e.trigger(h, {
field: e.field,
container: e.wrapper
})
},
events: [h],
options: {
name: "ColumnMenu",
messages: {
sortAscending: "Sort Ascending",
sortDescending: "Sort Descending",
filter: "Filter",
columns: "Columns"
},
columns: !0,
sortable: !0,
filterable: !0
},
destroy: function () {
var e = this;
y.fn.destroy.call(e), e.filterMenu && e.filterMenu.destroy(), e._refreshHandler && e.dataSource.unbind(f, e._refreshHandler), e.options.columns && (e.owner.unbind("columnShow", e._updateColumnsMenuHandler), e.owner.unbind("columnHide", e._updateColumnsMenuHandler)), e.menu && (e.menu.element.off(_), e.menu.destroy()), e.wrapper.off(_), e.popup && e.popup.destroy(), e.link.off(_)
},
close: function () {
this.menu.close(), this.popup.close(), this.popup.element.off("keydown" + _)
},
_click: function (e) {
e.preventDefault(), e.stopPropagation(), this.popup || this._init(), this.popup.toggle()
},
_open: function () {
var t = this;
e(".k-column-menu").not(t.wrapper).each(function () {
e(this).data(g).close()
}), t.popup.element.on("keydown" + _, function (e) {
e.keyCode == i.keys.ESC && t.close()
})
},
_activate: function () {
this.menu.element.focus()
},
_ownerColumns: function () {
var e = this.owner.columns,
t = s(e, function (e) {
var t = !0,
i = n(e.title || "");
return (e.menu === !1 || !e.field && !i.length) && (t = !1), t
});
return l(t, function (t) {
return {
originalField: t.field,
field: t.field || t.title,
title: t.title || t.field,
hidden: t.hidden,
index: d(t, e)
}
})
},
_menu: function () {
this.menu = this.wrapper.children()[v]({
orientation: "vertical",
closeOnClick: !1
}).data(v)
},
_sort: function () {
var t = this;
t.options.sortable && (t.refresh(), t._refreshHandler = o(t.refresh, t), t.dataSource.bind(f, t._refreshHandler), t.menu.bind("select", function (n) {
var i, r = e(n.item);
r.hasClass("k-sort-asc") ? i = u : r.hasClass("k-sort-desc") && (i = p), i && (r.parent().find(".k-sort-" + (i == u ? p : u)).removeClass(c), t._sortDataSource(r, i), t.close())
}))
},
_sortDataSource: function (e, n) {
var i, r, o = this,
a = o.options.sortable,
s = o.dataSource,
l = s.sort() || [];
if (e.hasClass(c) && a && a.allowUnsort !== !1 ? (e.removeClass(c), n = t) : e.addClass(c), a === !0 || "single" === a.mode) l = [{
field: o.field,
dir: n
}];
else {
for (i = 0, r = l.length; r > i; i++)
if (l[i].field === o.field) {
l.splice(i, 1);
break
}
l.push({
field: o.field,
dir: n
})
}
s.sort(l)
},
_columns: function () {
var t = this;
t.options.columns && (t._updateColumnsMenu(), t._updateColumnsMenuHandler = o(t._updateColumnsMenu, t), t.owner.bind(["columnHide", "columnShow"], t._updateColumnsMenuHandler), t.menu.bind("select", function (n) {
var r, o, a, l, c = e(n.item),
u = t.owner.columns;
c.parent().closest("li.k-columns-item")[0] && (r = c.find(":checkbox"), r.attr("disabled") || (l = r.attr(i.attr("field")), a = s(u, function (e) {
return e.field == l || e.title == l
})[0], o = d(a, u), a.hidden === !0 ? t.owner.showColumn(o) : t.owner.hideColumn(o)))
}))
},
_updateColumnsMenu: function () {
var e = "[" + i.attr("field") + "=",
t = this._ownerColumns(),
n = l(t, function (t) {
return e + '"' + t.field.replace(b, "\\$1") + '"]'
}).join(","),
r = s(t, function (e) {
return !e.hidden
}),
o = s(r, function (e) {
return e.originalField
}).length,
a = l(r, function (t) {
return e + '"' + t.field.replace(b, "\\$1") + '"]'
}).join(",");
this.wrapper.find(n).prop("checked", !1), this.wrapper.find(a).prop("checked", !0).prop("disabled", 1 == o)
},
_filter: function () {
var e = this,
t = e.options;
t.filterable !== !1 && (e.filterMenu = e.wrapper.find(".k-filterable")[m](a(!0, {}, {
appendToElement: !0,
dataSource: t.dataSource,
values: t.values,
field: e.field
}, t.filterable)).data(m))
},
refresh: function () {
var e, t, n, i = this,
r = i.options.dataSource.sort() || [],
o = i.field;
for (i.wrapper.find(".k-sort-asc, .k-sort-desc").removeClass(c), t = 0, n = r.length; n > t; t++) e = r[t], o == e.field && i.wrapper.find(".k-sort-" + e.dir).addClass(c)
}
}),
x = '
';
r.plugin(w)
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
return Array(e + 1).join('
')
}
function i(e) {
var t, n = " ";
if (e) {
if (typeof e === gt) return e;
for (t in e) n += t + '="' + e[t] + '"'
}
return n
}
function r(t) {
var n = 0;
return e("> .k-grouping-header, > .k-grid-toolbar", t).each(function () {
n += this.offsetHeight
}), n
}
function o(t, n) {
e("th, th .k-grid-filter, th .k-link", t).add(document.body).css("cursor", n)
}
function a(e) {
var t, n, i = {}, r = {};
if (!R(e))
for (E(e) || (e = [e]), t = 0, n = e.length; n > t; t++) i[e[t].aggregate] = 0, r[e[t].field] = i;
return r
}
function s(e, t, n) {
var i = e.eq(t),
r = e.eq(n);
i[t > n ? "insertBefore" : "insertAfter"](r)
}
function l(e, t, n) {
var i, r, o, a;
for (n = E(n) ? n : [n], i = 0, r = n.length; r > i; i++) o = n[i], A(o) && o.click && (a = o.name || o.text, t.on(ut + $, "a.k-grid-" + (a || "").replace(/\s/g, ""), {
commandName: a
}, z(o.click, e)))
}
function d(e) {
return I(e, function (e) {
return !e.hidden
})
}
function c(e) {
e = e || {};
var t = e.style;
return t ? (t = t.replace(/((.*)?display)(.*)?:([^;]*)/i, "$1:none"), t === e.style && (t = t.replace(/(.*)?/i, "display:none;$1"))) : t = "display:none", F({}, e, {
style: t
})
}
function u(e) {
e = e || {};
var t = e.style;
return t && (e.style = t.replace(/(display\s*:\s*none\s*;?)*/gi, "")), e
}
function p(t, n, i, r) {
var o, a = t.find(">colgroup"),
s = D(n, function (e) {
return o = e.width, o && 0 !== parseInt(o, 10) ? b.format('
', typeof o === gt ? o : o + "px") : "
"
});
(i || a.find(".k-hierarchy-col").length) && s.splice(0, 0, '
'), a.length && a.remove(), a = e(Array(r + 1).join('
') + s.join("")), a.is("colgroup") || (a = e("
").append(a)), t.prepend(a), kt.msie && 8 == kt.version && (t.css("display", "inline-table"), window.setTimeout(function () {
t.css("display", "")
}, 1))
}
function f(e) {
var t, n, i, r = {};
for (n = 0, i = e.length; i > n; n++) t = e[n], r[t.value] = t.text;
return r
}
function h(e, t, n) {
var i = n && n.length && A(n[0]) && "value" in n[0],
r = i ? f(n)[e] : e;
return r = null != r ? r : "", t ? b.format(t, r) : r
}
function g(e, t, n) {
for (var i, r = 0, o = e[r]; o;) {
if (i = n ? !0 : "none" !== o.style.display, i && !yt.test(o.className) && 0 > --t) {
o.style.display = n ? "" : "none";
break
}
o = e[++r]
}
}
function m(e, t) {
var n, i, r;
if (typeof e === gt && e === t) return e;
if (A(e) && e.name === t) return e;
if (E(e))
for (n = 0, i = e.length; i > n; n++)
if (r = e[n], typeof r === gt && r === t || r.name === t) return r;
return null
}
function v(t, n) {
var i, r, o, a = kt.msie;
if (n === !0) {
if (t = e(t), o = a && t.parent().is(".k-grid-content,.k-grid-header-wrap"), o && (i = t.parent().scrollTop(), r = t.parent().scrollLeft()), a) try {
t[0].setActive()
} catch (s) {
t[0].focus()
} else t[0].focus();
o && (t.parent().scrollTop(i), t.parent().scrollLeft(r))
} else e(t).one("focusin", function (e) {
e.preventDefault()
}).focus()
}
function _(t) {
var n = e(t.currentTarget),
i = n.is("th"),
r = n.closest("table")[0];
b.support.touch || (r === this.table[0] || r === this.thead.parent()[0]) && (this.current(n), (i || !e(t.target).is(":button,a,:input,a>.k-icon,textarea,span.k-icon,.k-input")) && setTimeout(function () {
v(r, !0)
}), i && t.preventDefault())
}
var b = window.kendo,
y = b.ui,
w = b.data.DataSource,
x = y.Groupable,
k = b.support.tbodyInnerHtml,
C = b._activeElement,
T = y.Widget,
S = b.keys,
A = e.isPlainObject,
F = e.extend,
D = e.map,
I = e.grep,
E = e.isArray,
P = e.inArray,
z = e.proxy,
H = e.isFunction,
R = e.isEmptyObject,
O = Math,
M = "progress",
N = "error",
B = ":not(.k-group-cell):not(.k-hierarchy-cell):visible",
L = "tbody>tr:not(.k-grouping-row):not(.k-detail-row):not(.k-group-footer) > td:not(.k-group-cell):not(.k-hierarchy-cell)",
V = "tr:not(.k-footer-template):visible",
U = ":not(.k-group-cell):not(.k-hierarchy-cell):visible",
W = V + ":first>" + U + ":first",
j = "th.k-header:not(.k-group-cell,.k-hierarchy-cell)",
q = j + ":visible[" + b.attr("field") + "]",
G = j + "[" + b.attr("field") + "]",
$ = ".kendoGrid",
Y = "edit",
Q = "save",
K = "remove",
X = "detailInit",
J = "filterMenuInit",
Z = "columnMenuInit",
et = "change",
tt = "columnHide",
nt = "columnShow",
it = "saveChanges",
rt = "dataBound",
ot = "detailExpand",
at = "detailCollapse",
st = "k-state-focused",
lt = "k-state-selected",
dt = "columnResize",
ct = "columnReorder",
ut = "click",
pt = "height",
ft = "tabIndex",
ht = "function",
gt = "string",
mt = "Are you sure you want to delete this record?",
vt = /(\}|\#)/gi,
_t = /#/gi,
bt = "[\\x20\\t\\r\\n\\f]",
yt = RegExp("(^|" + bt + ")" + "(k-group-cell|k-hierarchy-cell)" + "(" + bt + "|$)"),
wt = '#=text#',
xt = !1,
kt = b.support.browser,
Ct = kt.msie && 7 == kt.version,
Tt = T.extend({
init: function (e, t) {
var n = this;
T.fn.init.call(n, e, t), n._refreshHandler = z(n.refresh, n), n.setDataSource(t.dataSource), n.wrap()
},
setDataSource: function (e) {
var t = this;
t.dataSource && t.dataSource.unbind(et, t._refreshHandler), t.dataSource = e, t.dataSource.bind(et, t._refreshHandler)
},
options: {
name: "VirtualScrollable",
itemHeight: e.noop
},
destroy: function () {
var e = this;
T.fn.destroy.call(e), e.dataSource.unbind(et, e._refreshHandler), e.wrapper.add(e.verticalScrollbar).off($), e.drag && e.drag.destroy()
},
wrap: function () {
var t, n = this,
i = b.support.scrollbar() + 1,
r = n.element;
r.css({
width: "auto",
overflow: "hidden"
}).css(xt ? "padding-left" : "padding-right", i), n.content = r.children().first(), t = n.wrapper = n.content.wrap('').parent().bind("DOMMouseScroll" + $ + " mousewheel" + $, z(n._wheelScroll, n)), b.support.kineticScrollNeeded && (n.drag = new b.UserEvents(n.wrapper, {
global: !0,
move: function (e) {
n.verticalScrollbar.scrollTop(n.verticalScrollbar.scrollTop() - e.y.delta), t.scrollLeft(t.scrollLeft() - e.x.delta), e.preventDefault()
}
})), n.verticalScrollbar = e('').css({
width: i
}).appendTo(r).bind("scroll" + $, z(n._scroll, n))
},
_wheelScroll: function (e) {
var n, i = this,
r = i.verticalScrollbar.scrollTop(),
o = e.originalEvent,
a = o.wheelDeltaY;
o.wheelDelta ? (a === t || a) && (n = o.wheelDelta) : o.detail && o.axis === o.VERTICAL_AXIS && (n = 10 * -o.detail), n && (e.preventDefault(), i.verticalScrollbar.scrollTop(r + -n))
},
_scroll: function (e) {
var t = this,
n = e.currentTarget.scrollTop,
i = t.dataSource,
r = t.itemHeight,
o = i.skip() || 0,
a = t._rangeStart || o,
s = t.element.innerHeight(),
l = !! (t._scrollbarTop && t._scrollbarTop > n),
d = O.max(O.floor(n / r), 0),
c = O.max(d + O.floor(s / r), 0);
t._scrollTop = n - a * r, t._scrollbarTop = n, t._fetch(d, c, l) || (t.wrapper[0].scrollTop = t._scrollTop)
},
_fetch: function (e, t, n) {
var i = this,
r = i.dataSource,
o = i.itemHeight,
a = r.take(),
s = i._rangeStart || r.skip() || 0,
l = O.floor(e / a) * a,
d = !1,
c = .33;
return s > e ? (d = !0, s = O.max(0, t - a), i._scrollTop = (e - s) * o, i._page(s, a)) : t >= s + a && !n ? (d = !0, s = e, i._scrollTop = o, i._page(s, a)) : i._fetching || (l + a - a * c > e && e > a && r.prefetch(l - a, a), t > l + a * c && r.prefetch(l + a, a)), d
},
_page: function (e, t) {
var n = this,
i = n.dataSource;
clearTimeout(n._timeout), n._fetching = !0, n._rangeStart = e, i.inRange(e, t) ? i.range(e, t) : (b.ui.progress(n.wrapper.parent(), !0), n._timeout = setTimeout(function () {
i.range(e, t)
}, 100))
},
refresh: function () {
var e, t, n, i, r = this,
o = "",
a = 25e4,
s = r.dataSource,
l = r._rangeStart,
d = b.support.kineticScrollNeeded ? 0 : b.support.scrollbar(),
c = r.wrapper[0];
for (b.ui.progress(r.wrapper.parent(), !1), clearTimeout(r._timeout), n = r.itemHeight = r.options.itemHeight() || 0, i = c.scrollWidth > c.offsetWidth ? d : 0, e = s.total() * n + i, t = 0; O.floor(e / a) > t; t++) o += '';
e % a && (o += ''), r.verticalScrollbar.html(o), c.scrollTop = r._scrollTop, r.drag && r.drag.cancel(), l && !r._fetching && (r._rangeStart = s.skip()), r._fetching = !1
}
}),
St = {
create: {
text: "Add new record",
imageClass: "k-add",
className: "k-grid-add",
iconClass: "k-icon"
},
cancel: {
text: "Cancel changes",
imageClass: "k-cancel",
className: "k-grid-cancel-changes",
iconClass: "k-icon"
},
save: {
text: "Save changes",
imageClass: "k-update",
className: "k-grid-save-changes",
iconClass: "k-icon"
},
destroy: {
text: "Delete",
imageClass: "k-delete",
className: "k-grid-delete",
iconClass: "k-icon"
},
edit: {
text: "Edit",
imageClass: "k-edit",
className: "k-grid-edit",
iconClass: "k-icon"
},
update: {
text: "Update",
imageClass: "k-update",
className: "k-grid-update",
iconClass: "k-icon"
},
canceledit: {
text: "Cancel",
imageClass: "k-cancel",
className: "k-grid-cancel",
iconClass: "k-icon"
}
}, At = T.extend({
init: function (e, t) {
var n = this;
t = E(t) ? {
dataSource: t
} : t, T.fn.init.call(n, e, t), xt = b.support.isRtl(e), n._element(), n._aria(), n._columns(n.options.columns), n._dataSource(), n._tbody(), n._pageable(), n._thead(), n._groupable(), n._toolbar(), n._setContentHeight(), n._templates(), n._navigatable(), n._selectable(), n._details(), n._editable(), n._attachCustomCommandsEvent(), n.options.autoBind ? n.dataSource.fetch() : n._footer(), b.notify(n)
},
events: [et, "dataBinding", "cancel", rt, ot, at, X, J, Z, Y, Q, K, it, dt, ct, nt, tt],
setDataSource: function (e) {
var t = this;
t.options.dataSource = e, t._dataSource(), t._pageable(), t.options.groupable && t._groupable(), t._thead(), t.virtualScrollable && t.virtualScrollable.setDataSource(t.options.dataSource), t.options.autoBind && e.fetch()
},
options: {
name: "Grid",
columns: [],
toolbar: null,
autoBind: !0,
filterable: !1,
scrollable: !0,
sortable: !1,
selectable: !1,
navigatable: !1,
pageable: !1,
editable: !1,
groupable: !1,
rowTemplate: "",
altRowTemplate: "",
dataSource: {},
height: null,
resizable: !1,
reorderable: !1,
columnMenu: !1,
detailTemplate: null,
columnResizeHandleWidth: 3
},
destroy: function () {
var e, t = this;
T.fn.destroy.call(t), t.pager && t.pager.destroy(), t.groupable && t.groupable.destroy(), t.options.reorderable && t.wrapper.data("kendoReorderable").destroy(), t.resizable && t.resizable.destroy(), t.virtualScrollable && t.virtualScrollable.destroy(), t._destroyColumnAttachments(), t._destroyEditable(), t.dataSource.unbind(et, t._refreshHandler).unbind(M, t._progressHandler).unbind(N, t._errorHandler), e = t.element.add(t.wrapper).add(t.table).add(t.thead).add(t.wrapper.find(">.k-grid-toolbar")), t.content && (e = e.add(t.content).add(t.content.find(">.k-virtual-scrollable-wrap"))), e.off($), b.destroy(t.wrapper)
},
setOptions: function (e) {
var t = this;
T.fn.setOptions.call(this, e), t._templates()
},
items: function () {
return this.tbody.children(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")
},
_destroyColumnAttachments: function () {
var t = this;
t.resizeHandle = null, t.thead.find("th").each(function () {
var t = e(this),
n = t.data("kendoFilterMenu"),
i = t.data("kendoSortable"),
r = t.data("kendoColumnMenu");
n && n.destroy(), i && i.destroy(), r && r.destroy()
})
},
_attachCustomCommandsEvent: function () {
var e, t, n, i = this,
r = i.columns || [];
for (t = 0, n = r.length; n > t; t++) e = r[t].command, e && l(i, i.wrapper, e)
},
_aria: function () {
var e = this.element.attr("id") || "aria";
e && (this._cellId = e + "_active_cell")
},
_element: function () {
var t = this,
n = t.element;
n.is("table") || (n = t.options.scrollable ? t.element.find("> .k-grid-content > table") : t.element.children("table"), n.length || (n = e("
").appendTo(t.element))), Ct && n.attr("cellspacing", 0), t.table = n.attr("role", t._hasDetails() ? "treegrid" : "grid"), t._wrapper()
},
_positionColumnResizeHandle: function (t) {
var n, i = this,
a = i.options.scrollable,
s = i.resizeHandle,
l = i.options.columnResizeHandleWidth;
i.thead.on("mousemove" + $, "th:not(.k-group-cell,.k-hierarchy-cell)", function (d) {
var c, u, p, f, h = e(this),
g = d.clientX,
m = e(window).scrollLeft(),
v = h.offset().left + (xt ? 0 : this.offsetWidth);
g + m > v - l && v + l > g + m ? (s || (s = i.resizeHandle = e(''), t.append(s)), xt ? (c = h.closest(".k-grid-header-wrap"), u = kt.msie ? c.scrollLeft() : 0, p = kt.webkit ? c[0].scrollWidth - c[0].offsetWidth - c.scrollLeft() : 0, f = kt.mozilla ? c[0].scrollWidth - c[0].offsetWidth - (c[0].scrollWidth - c[0].offsetWidth - c.scrollLeft()) : 0, n = h.position().left - p + f - u) : (n = this.offsetWidth, h.prevAll(":visible").each(function () {
n += this.offsetWidth
})), s.css({
top: a ? 0 : r(i.wrapper),
left: n - l,
height: h.outerHeight(),
width: 3 * l
}).data("th", h).show()) : s ? s.hide() : o(i.wrapper, "")
})
},
_resizable: function () {
var t, n, i, r, a, s = this,
l = s.options;
l.resizable && (t = l.scrollable ? s.wrapper.find(".k-grid-header-wrap:first") : s.wrapper, s._positionColumnResizeHandle(t), s.resizable = new y.Resizable(t, {
handle: ".k-resize-handle",
hint: function (t) {
return e('').css({
height: t.data("th").outerHeight() + s.tbody.attr("clientHeight")
})
},
start: function (t) {
var d = e(t.currentTarget).data("th"),
c = e.inArray(d[0], d.parent().children(":visible")),
u = s.tbody.parent(),
p = s.footer || e();
o(s.wrapper, "col-resize"), a = l.scrollable ? s.thead.parent().find("col:eq(" + c + ")").add(u.children("colgroup").find("col:eq(" + c + ")")).add(p.find("colgroup").find("col:eq(" + c + ")")) : u.children("colgroup").find("col:eq(" + c + ")"), n = t.x.location, i = d.outerWidth(), r = s.tbody.outerWidth()
},
resize: function (t) {
var o = xt ? -1 : 1,
d = i + t.x.location * o - n * o,
c = s.footer || e();
d > 10 && (a.css("width", d), l.scrollable && r && (s._footerWidth = r + t.x.location * o - n * o, s.tbody.parent().add(s.thead.parent()).add(c.find("table")).css("width", s._footerWidth)))
},
resizeend: function (t) {
var n, r = e(t.currentTarget).data("th"),
a = r.outerWidth();
o(s.wrapper, ""), i != a && (n = s.columns[r.parent().find("th:not(.k-group-cell,.k-hierarchy-cell)").index(r)], n.width = a, s.trigger(dt, {
column: n,
oldWidth: i,
newWidth: a
})), s.resizeHandle.hide()
}
}))
},
_draggable: function () {
var t = this;
t.options.reorderable && (t._draggableInstance && t._draggableInstance.destroy(), t._draggableInstance = t.wrapper.kendoDraggable({
group: b.guid(),
filter: t.content ? ".k-grid-header:first " + j : "table:first>.k-grid-header " + j,
hint: function (t) {
return e('').css({
width: t.width(),
paddingLeft: t.css("paddingLeft"),
paddingRight: t.css("paddingRight"),
lineHeight: t.height() + "px",
paddingTop: t.css("paddingTop"),
paddingBottom: t.css("paddingBottom")
}).html(t.attr(b.attr("title")) || t.attr(b.attr("field")) || t.text()).prepend('')
}
}).data("kendoDraggable"))
},
_reorderable: function () {
var e = this;
e.options.reorderable && e.wrapper.kendoReorderable({
draggable: e._draggableInstance,
change: function (t) {
var n = P(e.columns[t.newIndex], e.columns),
i = e.columns[t.oldIndex];
e.trigger(ct, {
newIndex: n,
oldIndex: P(i, e.columns),
column: i
}), e.reorderColumn(n, i)
}
})
},
reorderColumn: function (e, t) {
var n, i, r, o = this,
a = P(t, o.columns),
l = P(t, d(o.columns)),
c = P(o.columns[e], d(o.columns)),
u = o.footer || o.wrapper.find(".k-grid-footer");
if (a !== e)
for (o.columns.splice(a, 1), o.columns.splice(e, 0, t), o._templates(), s(o.thead.prev().find("col:not(.k-group-col,.k-hierarchy-col)"), l, c), o.options.scrollable && s(o.tbody.prev().find("col:not(.k-group-col,.k-hierarchy-col)"), l, c), s(o.thead.find(".k-header:not(.k-group-cell,.k-hierarchy-cell)"), a, e), u && u.length && (s(u.find(".k-grid-footer-wrap>table>colgroup>col:not(.k-group-col,.k-hierarchy-col)"), l, c), s(u.find(".k-footer-template>td:not(.k-group-cell,.k-hierarchy-cell)"), a, e)), n = o.tbody.children(":not(.k-grouping-row,.k-detail-row)"), i = 0, r = n.length; r > i; i += 1) s(n.eq(i).find(">td:not(.k-group-cell,.k-hierarchy-cell)"), a, e)
},
cellIndex: function (t) {
return e(t).parent().children("td:not(.k-group-cell,.k-hierarchy-cell)").index(t)
},
_modelForContainer: function (t) {
t = e(t), t.is("tr") || "popup" === this._editMode() || (t = t.closest("tr"));
var n = t.attr(b.attr("uid"));
return this.dataSource.getByUid(n)
},
_editable: function () {
var t, n = this,
i = n.selectable && n.selectable.options.multiple,
r = n.options.editable,
o = function () {
var t = C(),
i = n._editContainer;
!i || e.contains(i[0], t) || i[0] === t || e(t).closest(".k-animation-container").length || n.editable.end() && n.closeCell()
};
r && (t = n._editMode(), "incell" === t ? r.update !== !1 && n.wrapper.on(ut + $, "tr:not(.k-grouping-row) > td", function (t) {
var r = e(this);
r.hasClass("k-hierarchy-cell") || r.hasClass("k-detail-cell") || r.hasClass("k-group-cell") || r.hasClass("k-edit-cell") || r.has("a.k-grid-delete").length || r.has("button.k-grid-delete").length || r.closest("tbody")[0] !== n.tbody[0] || e(t.target).is(":input") || (n.editable ? n.editable.end() && (i && e(C()).blur(), n.closeCell(), n.editCell(r)) : n.editCell(r))
}).on("focusin" + $, function () {
clearTimeout(n.timer), n.timer = null
}).on("focusout" + $, function () {
n.timer = setTimeout(o, 1)
}) : r.update !== !1 && n.wrapper.on(ut + $, "tbody>tr:not(.k-detail-row,.k-grouping-row):visible a.k-grid-edit", function (t) {
t.preventDefault(), n.editRow(e(this).closest("tr"))
}), r.destroy !== !1 ? n.wrapper.on(ut + $, "tbody>tr:not(.k-detail-row,.k-grouping-row):visible .k-grid-delete", function (t) {
t.preventDefault(), t.stopPropagation(), n.removeRow(e(this).closest("tr"))
}) : n.wrapper.on(ut + $, "tbody>tr:not(.k-detail-row,.k-grouping-row):visible button.k-grid-delete", function (e) {
n._confirmation() || e.preventDefault()
}))
},
editCell: function (t) {
t = e(t);
var n = this,
i = n.columns[n.cellIndex(t)],
r = n._modelForContainer(t);
!r || r.editable && !r.editable(i.field) || i.command || !i.field || (n._attachModelChange(r), n._editContainer = t, n.editable = t.addClass("k-edit-cell").kendoEditable({
fields: {
field: i.field,
format: i.format,
editor: i.editor,
values: i.values
},
model: r,
change: function (e) {
n.trigger(Q, {
values: e.values,
container: t,
model: r
}) && e.preventDefault()
}
}).data("kendoEditable"), t.parent().addClass("k-grid-edit-row"), n.trigger(Y, {
container: t,
model: r
}))
},
_destroyEditable: function () {
var e = this,
t = function () {
e.editable && (e._detachModelChange(), e.editable.destroy(), e.editable = null, e._editContainer = null)
};
e.editable && ("popup" === e._editMode() ? e._editContainer.data("kendoWindow").bind("deactivate", t).close() : t())
},
_attachModelChange: function (e) {
var t = this;
t._modelChangeHandler = function (e) {
t._modelChange({
field: e.field,
model: this
})
}, e.bind("change", t._modelChangeHandler)
},
_detachModelChange: function () {
var e = this,
t = e._editContainer,
n = e._modelForContainer(t);
n && n.unbind(et, e._modelChangeHandler)
},
closeCell: function () {
var t, n, i, r, o = this;
o._editContainer && (t = o._editContainer.removeClass("k-edit-cell"), n = t.closest("tr").attr(b.attr("uid")), i = o.columns[o.cellIndex(t)], r = o.dataSource.getByUid(n), t.parent().removeClass("k-grid-edit-row"), o._destroyEditable(), o._displayCell(t, i, r), t.hasClass("k-dirty-cell") && e('').prependTo(t))
},
_displayCell: function (e, t, n) {
var i = this,
r = {
storage: {},
count: 0
}, o = F({}, b.Template, i.options.templateSettings),
a = b.template(i._cellTmpl(t, r), o);
r.count > 0 && (a = z(a, r.storage)), e.empty().html(a(n))
},
removeRow: function (t) {
var n, i, r = this;
r._confirmation() && (t = e(t).hide(), n = r._modelForContainer(t), n && !r.trigger(K, {
row: t,
model: n
}) && (i = r._editMode(), "incell" !== i && r.cancelRow(), r.dataSource.remove(n), ("inline" === i || "popup" === i) && r.dataSource.sync()))
},
_editMode: function () {
var e = "incell",
t = this.options.editable;
return t !== !0 && (e = "string" == typeof t ? t : t.mode || e), e
},
editRow: function (n) {
n = e(n);
var i, r = this,
o = r._modelForContainer(n),
a = r._editMode(),
s = r.options.navigatable;
r.cancelRow(), o && (r._attachModelChange(o), "popup" === a ? r._createPopupEditor(o) : "inline" === a ? r._createInlineEditor(n, o) : "incell" === a && e(n).children(B).each(function () {
var n = e(this),
i = r.columns[n.index()];
return o = r._modelForContainer(n), o && (!o.editable || o.editable(i.field)) && i.field ? (r.editCell(n), !1) : t
}), i = r._editContainer, i.on(ut + $, "a.k-grid-cancel", function (t) {
if (t.preventDefault(), t.stopPropagation(), !r.trigger("cancel", {
container: i,
model: o
})) {
var n = r.items().index(e(r.current()).parent());
r.cancelRow(), s && (r.current(r.items().eq(n).children().filter(U).first()), v(r.table, !0))
}
}), i.on(ut + $, "a.k-grid-update", function (e) {
e.preventDefault(), e.stopPropagation(), r.saveRow()
}))
},
_createPopupEditor: function (n) {
var i, r, o, a, s, l, d, c, u, p, f, h = this,
g = "
',
_ = [],
y = h.options.editable,
w = y.template,
x = A(y) ? y.window : {}, k = F({}, b.Template, h.options.templateSettings);
if (w)
for (typeof w === gt && (w = window.unescape(w)), g += b.template(w, k)(n), o = 0, a = h.columns.length; a > o; o++) i = h.columns[o], i.command && (c = m(i.command, "edit"), c && (r = c));
else
for (o = 0, a = h.columns.length; a > o; o++) i = h.columns[o], i.command ? i.command && (c = m(i.command, "edit"), c && (r = c)) : (g += '", n.editable && !n.editable(i.field) || !i.field ? (p = {
storage: {},
count: 0
}, s = b.template(h._cellTmpl(i, p), k), p.count > 0 && (s = z(s, p.storage)), g += '
' + s(n) + "
") : (_.push({
field: i.field,
format: i.format,
editor: i.editor,
values: i.values
}), g += "'));
r && A(r) && (r.text && A(r.text) && (l = r.text.update, d = r.text.cancel), r.attr && (u = r.attr)), g += h._createButton({
name: "update",
text: l,
attr: u
}) + h._createButton({
name: "canceledit",
text: d,
attr: u
}), g += "
", f = h._editContainer = e(g).appendTo(h.wrapper).eq(0).kendoWindow(F({
modal: !0,
resizable: !1,
draggable: !0,
title: "Edit",
visible: !1,
close: function (i) {
if (i.userTriggered) {
if (h.trigger("cancel", {
container: f,
model: n
})) return i.preventDefault(), t;
var r = h.items().index(e(h.current()).parent());
h.cancelRow(), h.options.navigatable && (h.current(h.items().eq(r).children().filter(U).first()), v(h.table, !0))
}
}
}, x)), h.editable = h._editContainer.kendoEditable({
fields: _,
model: n,
clearContainer: !1
}).data("kendoEditable"), f.data("kendoWindow").center().open(), h.trigger(Y, {
container: f,
model: n
})
},
_createInlineEditor: function (t, n) {
var i, r, o, a = this,
s = [];
t.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function () {
if (r = e(this), i = a.columns[a.cellIndex(r)], i.command || !i.field || n.editable && !n.editable(i.field)) {
if (i.command && (o = m(i.command, "edit"))) {
r.empty();
var t, l, d;
A(o) && (o.text && A(o.text) && (t = o.text.update, l = o.text.cancel), o.attr && (d = o.attr)), e(a._createButton({
name: "update",
text: t,
attr: d
}) + a._createButton({
name: "canceledit",
text: l,
attr: d
})).appendTo(r)
}
} else s.push({
field: i.field,
format: i.format,
editor: i.editor,
values: i.values
}), r.attr(b.attr("container-for"), i.field), r.empty()
}), a._editContainer = t, a.editable = t.addClass("k-grid-edit-row").kendoEditable({
fields: s,
model: n,
clearContainer: !1
}).data("kendoEditable"), a.trigger(Y, {
container: t,
model: n
})
},
cancelRow: function () {
var e, t = this,
n = t._editContainer;
n && (e = t._modelForContainer(n), t.dataSource.cancelChanges(e), "popup" !== t._editMode() ? t._displayRow(n) : t._displayRow(t.items().filter("[" + b.attr("uid") + "=" + e.uid + "]")), t._destroyEditable())
},
saveRow: function () {
var e = this,
t = e._editContainer,
n = e._modelForContainer(t),
i = e.editable;
t && i && i.end() && !e.trigger(Q, {
container: t,
model: n
}) && e.dataSource.sync()
},
_displayRow: function (t) {
var n = this,
i = n._modelForContainer(t);
i && t.replaceWith(e((t.hasClass("k-alt") ? n.altRowTemplate : n.rowTemplate)(i)))
},
_showMessage: function (e) {
return window.confirm(e)
},
_confirmation: function () {
var e = this,
t = e.options.editable,
n = t === !0 || typeof t === gt ? mt : t.confirmation;
return n !== !1 && null != n ? e._showMessage(n) : !0
},
cancelChanges: function () {
this.dataSource.cancelChanges()
},
saveChanges: function () {
var e = this;
(e.editable && e.editable.end() || !e.editable) && !e.trigger(it) && e.dataSource.sync()
},
addRow: function () {
var e, t, n, i, r, o = this,
a = o.dataSource,
s = o._editMode(),
l = o.options.editable.createAt || "",
d = a.pageSize(),
c = a.view() || [];
(o.editable && o.editable.end() || !o.editable) && ("incell" != s && o.cancelRow(), e = a.indexOf(c[0]), "bottom" == l.toLowerCase() && (e += c.length, d && !a.options.serverPaging && c.length >= d && (e -= 1)), 0 > e && (e = a.page() > a.totalPages() ? (a.page() - 1) * d : 0), t = a.insert(e, {}), n = t.uid, i = o.table.find("tr[" + b.attr("uid") + "=" + n + "]"), r = i.children("td:not(.k-group-cell,.k-hierarchy-cell)").eq(o._firstEditableColumnIndex(i)), "inline" !== s && "popup" !== s || !i.length ? r.length && o.editCell(r) : o.editRow(i))
},
_firstEditableColumnIndex: function (e) {
var t, n, i, r = this,
o = r.columns,
a = r._modelForContainer(e);
for (n = 0, i = o.length; i > n; n++)
if (t = o[n], a && (!a.editable || a.editable(t.field)) && !t.command && t.field) return n;
return -1
},
_toolbar: function () {
var t, n = this,
i = n.wrapper,
r = n.options.toolbar,
o = n.options.editable;
r && (t = n.wrapper.find(".k-grid-toolbar"), t.length || (H(r) || (r = typeof r === gt ? r : n._toolbarTmpl(r).replace(_t, "\\#"), r = z(b.template(r), n)), t = e('').html(r({})).prependTo(i)), o && o.create !== !1 && t.on(ut + $, ".k-grid-add", function (e) {
e.preventDefault(), n.addRow()
}).on(ut + $, ".k-grid-cancel-changes", function (e) {
e.preventDefault(), n.cancelChanges()
}).on(ut + $, ".k-grid-save-changes", function (e) {
e.preventDefault(), n.saveChanges()
}))
},
_toolbarTmpl: function (e) {
var t, n, i = this,
r = "";
if (E(e))
for (t = 0, n = e.length; n > t; t++) r += i._createButton(e[t]);
return r
},
_createButton: function (e) {
var t = e.template || wt,
n = typeof e === gt ? e : e.name || e.text,
r = {
className: "k-grid-" + (n || "").replace(/\s/g, ""),
text: n,
imageClass: "",
attr: "",
iconClass: ""
};
if (!(n || A(e) && e.template)) throw Error("Custom commands should have name specified");
return A(e) ? (e.className && (e.className += " " + r.className), "edit" === n && A(e.text) && (e = F(!0, {}, e), e.text = e.text.edit), e.attr && A(e.attr) && (e.attr = i(e.attr)), r = F(!0, r, St[n], e)) : r = F(!0, r, St[n]), b.template(t)(r)
},
_groupable: function () {
var t = this;
t._groupableClickHandler ? t.table.off(ut + $, t._groupableClickHandler) : t._groupableClickHandler = function (n) {
var i = e(this),
r = i.closest("tr");
i.hasClass("k-i-collapse") ? t.collapseGroup(r) : t.expandGroup(r), n.preventDefault(), n.stopPropagation()
}, t.table.on(ut + $, ".k-grouping-row .k-i-collapse, .k-grouping-row .k-i-expand", t._groupableClickHandler), t._attachGroupable()
},
_attachGroupable: function () {
var t = this,
n = t.wrapper,
i = t.options.groupable;
i && (n.has("div.k-grouping-header")[0] || e("
").addClass("k-grouping-header").prependTo(n), t.groupable && t.groupable.destroy(), t.groupable = new x(n, F({}, i, {
draggable: t._draggableInstance,
groupContainer: ">div.k-grouping-header",
dataSource: t.dataSource,
draggableElements: t.content ? ".k-grid-header:first " + q : "table:first>.k-grid-header " + q,
filter: t.content ? ".k-grid-header:first " + G : "table:first>.k-grid-header " + G,
allowDrag: t.options.reorderable
})))
},
_selectable: function () {
var e, n, i = this,
r = i.options.selectable;
r && (e = typeof r === gt && r.toLowerCase().indexOf("multiple") > -1, n = typeof r === gt && r.toLowerCase().indexOf("cell") > -1, i.selectable = new b.ui.Selectable(i.table, {
filter: ">" + (n ? L : "tbody>tr:not(.k-grouping-row,.k-detail-row,.k-group-footer)"),
aria: !0,
multiple: e,
change: function () {
i.trigger(et)
}
}), i.options.navigatable && i.table.on("keydown" + $, function (r) {
var o = i.current();
if (r.keyCode === S.SPACEBAR && r.target == i.table[0] && !o.is(".k-edit-cell,.k-header") && o.parent().is(":not(.k-grouping-row,.k-detail-row,.k-group-footer)")) {
if (r.preventDefault(), r.stopPropagation(), o = n ? o : o.parent(), e)
if (r.ctrlKey) {
if (o.hasClass(lt)) return o.removeClass(lt), i.trigger(et), t
} else i.selectable.clear();
else i.selectable.clear();
i.selectable.value(o)
}
}))
},
clearSelection: function () {
var e = this;
e.selectable.clear(), e.trigger(et)
},
select: function (n) {
var i = this,
r = i.selectable;
return n = e(n), n.length ? (r.options.multiple || (r.clear(), n = n.first()), r.value(n), t) : r.value()
},
current: function (n) {
var i = this,
r = i.options.scrollable,
o = i._current,
a = i.table.add(i.thead.parent());
return n !== t && n.length && (o && o[0] === n[0] || (o && (o.removeClass(st).removeAttr("id"), a.removeAttr("aria-activedescendant")), n.attr("id", i._cellId), i._current = n.addClass(st), a.attr("aria-activedescendant", i._cellId), n.length && r && (e.contains(i.content[0], n[0]) && i._scrollTo(n.parent()[0], i.content[0]), r.virtual ? i._scrollTo(n[0], i.content.find(">.k-virtual-scrollable-wrap")[0]) : i._scrollTo(n[0], i.content[0])))), i._current
},
_removeCurrent: function () {
this._current && (this._current.removeClass(st), this._current = null)
},
_scrollTo: function (e, t) {
var n = e.tagName.toLowerCase(),
i = "td" === n || "th" === n,
r = e[i ? "offsetLeft" : "offsetTop"],
o = e[i ? "offsetWidth" : "offsetHeight"],
a = t[i ? "scrollLeft" : "scrollTop"],
s = t[i ? "clientWidth" : "clientHeight"],
l = r + o,
d = 0;
d = a > r ? r : l > a + s ? s >= o ? l - s : r : a, t[i ? "scrollLeft" : "scrollTop"] = d
},
_navigatable: function () {
var t = this,
n = z(t.current, t),
i = t.table,
r = t.thead.parent(),
o = i,
a = b.support.isRtl(t.element);
t.options.navigatable && (t.options.scrollable && (o = i.add(r), r.attr(ft, -1)), r.on("keydown" + $, function (e) {
e.altKey && e.keyCode == S.DOWN && (n().find(".k-grid-filter, .k-header-column-menu").click(), e.stopImmediatePropagation())
}).find("a.k-link").attr("tabIndex", -1), i.attr(ft, O.max(i.attr(ft) || 0, 0)).on("mousedown" + $ + " keydown" + $, ".k-detail-cell", function (e) {
e.target !== e.currentTarget && e.stopImmediatePropagation()
}), o.on(b.support.touch ? "touchstart" + $ : "mousedown" + $, V + ">" + U, z(_, t)).on("focus" + $, function () {
if (!b.support.touch) {
var t = n();
t && t.is(":visible") ? t.addClass(st) : n(e(this).find(W)), this == i[0] ? (r.attr(ft, -1), i.attr(ft, 0)) : (i.attr(ft, -1), r.attr(ft, 0))
}
}).on("focusout" + $, function () {
var e = n();
e && e.removeClass(st)
}).on("keydown" + $, function (r) {
var o, s, l, d, c, u, p, f = r.keyCode,
h = !1,
g = !r.isDefaultPrevented() && !e(r.target).is(":button,a,:input,a>.k-icon"),
m = t.options.pageable,
_ = t.dataSource,
b = "incell" == t._editMode(),
y = r.shiftKey,
w = n();
w && w.is("th") && (g = !0), g && f == S.UP ? (w ? (l = w.parent().prevAll(V).first(), l[0] || (c = t.thead.parent(), v(c, !0), l = c.find(V).first()), d = w.index(), w = l.children().eq(d), w[0] && w.is(U) || (w = l.children(U).first())) : w = i.find(W), h = !0, n(w)) : g && f == S.DOWN ? (w ? (l = w.parent().nextAll(V).first(), !l[0] && w.is("th") && (v(t.tbody.parent()), l = t.tbody.find(V).first()), d = w.index(), w = l.children().eq(d), w[0] && w.is(U) || (w = l.children(U).first())) : w = i.find(W), h = !0, n(w)) : g && f == (a ? S.RIGHT : S.LEFT) ? (n(w ? w.prevAll(B + ":first") : i.find(W)), h = !0) : g && f == (a ? S.LEFT : S.RIGHT) ? (w ? w.next()[0] && (w = w.nextAll(B + ":first")) : w = i.find(W), h = !0, n(w)) : g && m && S.PAGEDOWN == f ? (_.page(_.page() + 1), h = !0) : g && m && S.PAGEUP == f ? (_.page(_.page() - 1), h = !0) : f == S.ENTER || S.F2 == f ? (w = w ? w : i.find(W), w.is("th") ? (w.find(".k-link").click(), h = !0) : w.parent().is(".k-master-row,.k-grouping-row") ? (w.parent().find(".k-icon:first").click(), h = !0) : (u = w.find(":focusable:first"), !w.hasClass("k-edit-cell") && u[0] && w.hasClass("k-state-focused") ? (u.focus(), h = !0) : t.options.editable && !e(r.target).is(":button,.k-button") && (t._handleEditing(w), h = !0))) : S.ESC == f ? (o = C(), w && e.contains(w[0], o) && !w.hasClass("k-edit-cell") && !w.parent().hasClass("k-grid-edit-row") ? (v(t.table[0], !0), h = !0) : !t._editContainer || w && !t._editContainer.has(w[0]) && w[0] !== t._editContainer[0] || (b ? t.closeCell() : (s = t.items().index(e(w).parent()), o && o.blur(), t.cancelRow(), s >= 0 && t.current(t.items().eq(s).children().filter(U).first())), kt.msie && 9 > kt.version && document.body.focus(), v(i, !0), h = !0)) : S.TAB == f && (w = e(w), t.options.editable && b && (p = e(C()).closest(".k-edit-cell"), p[0] && p[0] !== w[0] && (w = p)), p = y ? w.prevAll(B + ":first") : w.nextAll(":visible:first"), p.length || (p = w.parent()[y ? "prevAll" : "nextAll"]("tr:not(.k-grouping-row):not(.k-detail-row):visible:first").children(B + (y ? ":last" : ":first"))), !w.is("th") && p.length && t.options.editable && b && (t._handleEditing(w, p), h = !0)), h && (r.preventDefault(), r.stopPropagation())
}))
},
_handleEditing: function (n, i) {
var r, o, a = this,
s = e(C()),
l = a._editMode(),
d = kt.msie,
c = d && 9 > kt.version,
u = a._editContainer;
if (o = "incell" == l ? n.hasClass("k-edit-cell") : n.parent().hasClass("k-grid-edit-row"), a.editable) {
if (e.contains(u[0], s[0]) && (kt.opera || c ? s.change().triggerHandler("blur") : (s.blur(), d && s.blur())), !a.editable) return v(a.table), t;
if (!a.editable.end()) return "incell" == l ? a.current(u) : a.current(u.children().filter(B).first()), r = u.find(":focusable:first")[0], r && r.focus(), t;
"incell" == l ? a.closeCell() : (a.saveRow(), o = !0)
}
i && a.current(i), c && document.body.focus(), v(a.table, !0), (!o && !i || i) && ("incell" == l ? a.editCell(a.current()) : a.editRow(a.current().parent()))
},
_wrapper: function () {
var e = this,
t = e.table,
n = e.options.height,
i = e.element;
i.is("div") || (i = i.wrap("").parent()), e.wrapper = i.addClass("k-grid k-widget"), n && (e.wrapper.css(pt, n), t.css(pt, "auto"))
},
_tbody: function () {
var t, n = this,
i = n.table;
t = i.find(">tbody"), t.length || (t = e("
").appendTo(i)), n.tbody = t
},
_scrollable: function () {
var t, n, i, r, o, a = this,
s = a.options,
l = s.scrollable,
d = l !== !0 && l.virtual && !a.virtualScrollable,
c = !b.support.kineticScrollNeeded || d ? b.support.scrollbar() : 0;
l && (t = a.wrapper.children(".k-grid-header"), t[0] || (t = e('').insertBefore(a.table)), t.css(xt ? "padding-left" : "padding-right", l.virtual ? c + 1 : c), n = e('
'), Ct && n.attr("cellspacing", 0), n.append(a.thead), t.empty().append(e('').append(n)), a.content = a.table.parent(), a.content.is(".k-virtual-scrollable-wrap") && (a.content = a.content.parent()), a.content.is(".k-grid-content, .k-virtual-scrollable-wrap") || (a.content = a.table.wrap('').parent()), d && (a.virtualScrollable = new Tt(a.content, {
dataSource: a.dataSource,
itemHeight: z(a._averageRowHeight, a)
})), a.scrollables = t.children(".k-grid-header-wrap"), i = a.wrapper.find(".k-grid-footer"), r = xt && kt.webkit ? c : 0, i.length && (a.scrollables = a.scrollables.add(i.children(".k-grid-footer-wrap"))), l.virtual ? a.content.find(">.k-virtual-scrollable-wrap").bind("scroll" + $, function () {
a.scrollables.scrollLeft(this.scrollLeft + r)
}) : (a.content.bind("scroll" + $, function () {
a.scrollables.scrollLeft(this.scrollLeft + r)
}), o = b.touchScroller(a.content), o && o.movable && o.movable.bind("change", function (e) {
a.scrollables.scrollLeft(-e.sender.x)
})))
},
_setContentHeight: function () {
var e, t = this,
n = t.options,
i = t.wrapper.innerHeight(),
r = t.wrapper.children(".k-grid-header"),
o = b.support.scrollbar();
n.scrollable && (i -= r.outerHeight(), t.pager && (i -= t.pager.element.outerHeight()), n.groupable && (i -= t.wrapper.children(".k-grouping-header").outerHeight()), n.toolbar && (i -= t.wrapper.children(".k-grid-toolbar").outerHeight()), t.footerTemplate && (i -= t.wrapper.children(".k-grid-footer").outerHeight()), e = function (e) {
var t, n;
return e[0].style.height ? !0 : (t = e.height(), e.height("auto"), n = e.height(), t != n ? (e.height(""), !0) : (e.height(""), !1))
}, e(t.wrapper) && (i > 2 * o ? t.content.height(i) : t.content.height(2 * o + 1)))
},
_averageRowHeight: function () {
var e, t = this,
n = t._rowHeight;
return t._rowHeight || (t._rowHeight = n = t.table.outerHeight() / t.items().length, t._sum = n, t._measures = 1), e = t.table.outerHeight() / t.items().length, n !== e && (t._measures++, t._sum += e, t._rowHeight = t._sum / t._measures), n
},
_dataSource: function () {
var e, n = this,
i = n.options,
r = i.dataSource;
r = E(r) ? {
data: r
} : r, A(r) && (F(r, {
table: n.table,
fields: n.columns
}), e = i.pageable, A(e) && e.pageSize !== t && (r.pageSize = e.pageSize)), n.dataSource && n._refreshHandler ? n.dataSource.unbind(et, n._refreshHandler).unbind(M, n._progressHandler).unbind(N, n._errorHandler) : (n._refreshHandler = z(n.refresh, n), n._progressHandler = z(n._requestStart, n), n._errorHandler = z(n._error, n)), n.dataSource = w.create(r).bind(et, n._refreshHandler).bind(M, n._progressHandler).bind(N, n._errorHandler)
},
_error: function () {
this._progress(!1)
},
_requestStart: function () {
this._progress(!0)
},
_modelChange: function (t) {
var n, i, r, o, a = this,
s = t.model,
l = a.tbody.find("tr[" + b.attr("uid") + "=" + s.uid + "]"),
d = l.hasClass("k-alt"),
c = a.items().index(l);
if (l.children(".k-edit-cell").length && !a.options.rowTemplate) l.children(":not(.k-group-cell,.k-hierarchy-cell)").each(function () {
n = e(this), i = a.columns[a.cellIndex(n)], i.field === t.field && (n.hasClass("k-edit-cell") ? n.addClass("k-dirty-cell") : (a._displayCell(n, i, s), e('').prependTo(n)))
});
else if (!l.hasClass("k-grid-edit-row")) {
for (r = (d ? a.altRowTemplate : a.rowTemplate)(s), l.replaceWith(r), r = a.items().eq(c), c = 0, o = a.columns.length; o > c; c++) i = a.columns[c], i.field === t.field && (n = r.children(":not(.k-group-cell,.k-hierarchy-cell)").eq(c), e('').prependTo(n));
a.trigger("itemChange", {
item: r,
data: s,
ns: y
})
}
},
_pageable: function () {
var t, n = this,
i = n.options.pageable;
i && (t = n.wrapper.children("div.k-grid-pager"), t.length || (t = e('').appendTo(n.wrapper)), n.pager && n.pager.destroy(), n.pager = "object" == typeof i && i instanceof b.ui.Pager ? i : new b.ui.Pager(t, F({}, i, {
dataSource: n.dataSource
})))
},
_footer: function () {
var t, n, i = this,
r = i.dataSource.aggregates(),
o = "",
s = i.footerTemplate,
l = i.options,
d = i.footer || i.wrapper.find(".k-grid-footer");
s ? (r = R(r) ? a(i.dataSource.aggregate()) : r, o = e(i._wrapFooter(s(r))), d.length ? (n = o, d.replaceWith(n), d = i.footer = n) : d = i.footer = l.scrollable ? l.pageable ? o.insertBefore(i.wrapper.children("div.k-grid-pager")) : o.appendTo(i.wrapper) : o.insertBefore(i.tbody)) : d && !i.footer && (i.footer = d), d.length && (l.scrollable && (t = d.attr("tabindex", -1).children(".k-grid-footer-wrap"), i.scrollables = i.scrollables.not(".k-grid-footer-wrap").add(t)), i._footerWidth && d.find("table").css("width", i._footerWidth), t && t.scrollLeft(i.content.scrollLeft()))
},
_wrapFooter: function (t) {
var n = this,
i = "",
r = b.support.mobileOS ? 0 : b.support.scrollbar();
return n.options.scrollable ? (i = e('"), n._appendCols(i.find("table")), i.css(xt ? "padding-left" : "padding-right", r), i) : '' + t + ""
},
_columnMenu: function () {
var t, n, i, r, o, a, s = this,
l = s.columns,
d = s.options,
c = d.columnMenu,
u = function () {
v(s.thead.parent(), !0)
}, p = function (e) {
s.trigger(Z, {
field: e.field,
container: e.container
})
};
c && ("boolean" == typeof c && (c = {}), s.thead.find("th:not(.k-hierarchy-cell,.k-group-cell)").each(function (f) {
n = l[f], a = e(this), n.command || !n.field && !a.attr("data-" + b.ns + "field") || (t = a.data("kendoColumnMenu"), t && t.destroy(), r = n.sortable !== !1 && c.sortable !== !1 ? d.sortable : !1, o = d.filterable && n.filterable !== !1 && c.filterable !== !1 ? F({}, n.filterable, d.filterable) : !1, i = {
dataSource: s.dataSource,
values: n.values,
columns: c.columns,
sortable: r,
filterable: o,
messages: c.messages,
owner: s,
closeCallback: u,
init: p
}, a.kendoColumnMenu(i))
}))
},
_filterable: function () {
var t, n, i = this,
r = i.columns,
o = function () {
v(i.thead.parent(), !0)
}, a = i.options.filterable;
a && !i.options.columnMenu && i.thead.find("th:not(.k-hierarchy-cell,.k-group-cell)").each(function (s) {
t = e(this), r[s].filterable === !1 || r[s].command || !r[s].field && !t.attr("data-" + b.ns + "field") || (n = t.data("kendoFilterMenu"), n && n.destroy(), t.kendoFilterMenu(F(!0, {}, a, r[s].filterable, {
dataSource: i.dataSource,
values: r[s].values,
closeCallback: o,
init: function (e) {
i.trigger(J, {
field: e.field,
container: e.container
})
}
})))
})
},
_sortable: function () {
var t, n, i, r = this,
o = r.columns,
a = r.options.sortable;
a && r.thead.find("th:not(.k-hierarchy-cell,.k-group-cell)").each(function (s) {
t = o[s], t.sortable !== !1 && !t.command && t.field && (n = e(this), i = n.data("kendoSortable"), i && i.destroy(), n.attr("data-" + b.ns + "field", t.field).kendoSortable(F({}, a, {
dataSource: r.dataSource,
aria: !0
})))
})
},
_columns: function (t) {
var n, i = this,
r = i.table,
o = r.find("col"),
a = i.options.dataSource;
t = t.length ? t : D(r.find("th"), function (t, n) {
t = e(t);
var i = t.attr(b.attr("sortable")),
r = t.attr(b.attr("filterable")),
a = t.attr(b.attr("type")),
s = t.attr(b.attr("groupable")),
l = t.attr(b.attr("field")),
d = t.attr(b.attr("menu"));
return l || (l = t.text().replace(/\s|[^A-z0-9]/g, "")), {
field: l,
type: a,
sortable: "false" !== i,
filterable: "false" !== r,
groupable: "false" !== s,
menu: d,
template: t.attr(b.attr("template")),
width: o.eq(n).css("width")
}
}), n = !(i.table.find("tbody tr").length > 0 && (!a || !a.transport)), i.columns = D(t, function (e) {
return e = typeof e === gt ? {
field: e
} : e, e.hidden && (e.attributes = c(e.attributes), e.footerAttributes = c(e.footerAttributes), e.headerAttributes = c(e.headerAttributes)), F({
encoded: n
}, e)
})
},
_groups: function () {
var e = this.dataSource.group();
return e ? e.length : 0
},
_tmpl: function (e, t) {
var r, o, a, s, l = this,
d = F({}, b.Template, l.options.templateSettings),
c = l.columns.length,
u = {
storage: {},
count: 0
}, p = l._hasDetails(),
f = [],
h = l._groups();
if (!e) {
for (e = "
", h > 0 && (e += n(h)), p && (e += '
'), r = 0; c > r; r++) a = l.columns[r], o = a.template, s = typeof o, e += "
", e += l._cellTmpl(a, u), e += "
";
e += "
"
}
return e = b.template(e, d), u.count > 0 ? z(e, u.storage) : e
},
_headerCellText: function (e) {
var t = this,
n = F({}, b.Template, t.options.templateSettings),
i = e.headerTemplate,
r = typeof i,
o = e.title || e.field || "";
return r === ht ? o = b.template(i, n)({}) : r === gt && (o = i), o
},
_cellTmpl: function (e, t) {
var n, i, r = this,
o = F({}, b.Template, r.options.templateSettings),
a = e.template,
s = o.paramName,
l = e.field,
d = "",
c = e.format,
u = typeof a,
p = e.values;
if (e.command) {
if (E(e.command)) {
for (n = 0, i = e.command.length; i > n; n++) d += r._createButton(e.command[n]);
return d.replace(_t, "\\#")
}
return r._createButton(e.command).replace(_t, "\\#")
}
return u === ht ? (t.storage["tmpl" + t.count] = a, d += "#=this.tmpl" + t.count + "(" + s + ")#", t.count++) : u === gt ? d += a : p && p.length && A(p[0]) && "value" in p[0] && l ? (d += "#var v =" + b.stringify(f(p)) + "#", d += "#var f = v[", o.useWithBlock || (d += s + "."), d += l + "]#", d += "${f != null ? f : ''}") : (d += e.encoded ? "#:" : "#=", c && (d += 'kendo.format("' + c.replace(vt, "\\$1") + '",'), l ? (l = b.expr(l, s), d += l + "==null?'':" + l) : d += "''", c && (d += ")"), d += "#"), d
},
_templates: function () {
var t = this,
n = t.options,
i = t.dataSource,
r = i.group(),
o = t.footer || t.wrapper.find(".k-grid-footer"),
a = i.aggregate();
t.rowTemplate = t._tmpl(n.rowTemplate), t.altRowTemplate = t._tmpl(n.altRowTemplate || n.rowTemplate, !0), t._hasDetails() && (t.detailTemplate = t._detailTmpl(n.detailTemplate || "")), (t._group && !R(a) || !R(a) && !o.length || I(t.columns, function (e) {
return e.footerTemplate
}).length) && (t.footerTemplate = t._footerTmpl(a, "footerTemplate", "k-footer-template")), r && I(t.columns, function (e) {
return e.groupFooterTemplate
}).length && (a = e.map(r, function (e) {
return e.aggregates
}), t.groupFooterTemplate = t._footerTmpl(a, "groupFooterTemplate", "k-group-footer"))
},
_footerTmpl: function (e, t, r) {
var o, s, l, d, c, u = this,
p = F({}, b.Template, u.options.templateSettings),
f = p.paramName,
h = "",
g = u.columns,
m = {}, v = 0,
_ = {}, y = u._groups(),
w = a(e);
for (h += '
'), o = 0, s = u.columns.length; s > o; o++) c = g[o], l = c[t], d = typeof l, h += "
", l ? (d !== ht && (_ = w[c.field] ? F({}, p, {
paramName: f + "." + c.field
}) : {}, l = b.template(l, _)), m["tmpl" + v] = l, h += "#=this.tmpl" + v + "(" + f + ")#", v++) : h += " ", h += "
";
return h += "
", h = b.template(h, p), v > 0 ? z(h, m) : h
},
_detailTmpl: function (e) {
var t = this,
i = "",
r = F({}, b.Template, t.options.templateSettings),
o = r.paramName,
a = {}, s = 0,
l = t._groups(),
c = d(t.columns).length,
u = typeof e;
return i += '
', l > 0 && (i += n(l)), i += '
", u === ht ? (a["tmpl" + s] = e, i += "#=this.tmpl" + s + "(" + o + ")#", s++) : i += e, i += "
", i = b.template(i, r), s > 0 ? z(i, a) : i
},
_hasDetails: function () {
var e = this;
return null !== e.options.detailTemplate || (e._events[X] || []).length
},
_details: function () {
var t = this;
t.table.on(ut + $, ".k-hierarchy-cell .k-plus, .k-hierarchy-cell .k-minus", function (n) {
var i, r, o = e(this),
a = o.hasClass("k-plus"),
s = o.closest("tr.k-master-row"),
l = t.detailTemplate,
d = t._hasDetails();
return o.toggleClass("k-plus", !a).toggleClass("k-minus", a), d && !s.next().hasClass("k-detail-row") && (r = t.dataItem(s), e(l(r)).addClass(s.hasClass("k-alt") ? "k-alt" : "").insertAfter(s), t.trigger(X, {
masterRow: s,
detailRow: s.next(),
data: r,
detailCell: s.next().find(".k-detail-cell")
})), i = s.next(), t.trigger(a ? ot : at, {
masterRow: s,
detailRow: i
}), i.toggle(a), t._current && t._current.attr("aria-expanded", a), n.preventDefault(), !1
})
},
dataItem: function (t) {
return this._data[this.tbody.find("> tr:not(.k-grouping-row,.k-detail-row,.k-group-footer)").index(e(t))]
},
expandRow: function (t) {
e(t).find("> td .k-plus, > td .k-i-expand").click()
},
collapseRow: function (t) {
e(t).find("> td .k-minus, > td .k-i-collapse").click()
},
_thead: function () {
var n, r, o, a, s, l = this,
d = l.columns,
c = l._hasDetails() && d.length,
u = "",
p = l.table.find(">thead");
if (p.length || (p = e("").insertBefore(l.tbody)), o = l.element.find("tr:has(th):first"), o.length || (o = p.children().first(), o.length || (o = e("
"))), o.children().length) c && !o.find(".k-hierarchy-cell")[0] && o.prepend('
');
else {
for (c && (u += '
'), n = 0, r = d.length; r > n; n++) s = d[n], a = l._headerCellText(s), s.command ? u += "
" + a + "
" : (u += "
" + a + "
");
o.html(u)
}
o.find("th").addClass("k-header"), l.options.scrollable || p.addClass("k-grid-header"), o.find("script").remove().end().appendTo(p), l.thead && l._destroyColumnAttachments(), l.thead = p, l._sortable(), l._filterable(), l._scrollable(), l._updateCols(), l._resizable(), l._draggable(), l._reorderable(), l.groupable && l._attachGroupable(), l._columnMenu()
},
_updateCols: function () {
var e = this;
e._appendCols(e.thead.parent().add(e.table))
},
_appendCols: function (e) {
var t = this;
p(e, d(t.columns), t._hasDetails(), t._groups())
},
_autoColumns: function (e) {
if (e && e.toJSON) {
var t, n = this;
e = e.toJSON();
for (t in e) n.columns.push({
field: t
});
n._thead(), n._templates()
}
},
_rowsHtml: function (e) {
var t, n, i = this,
r = "",
o = i.rowTemplate,
a = i.altRowTemplate;
for (t = 0, n = e.length; n > t; t++) r += t % 2 ? a(e[t]) : o(e[t]), i._data.push(e[t]);
return r
},
_groupRowHtml: function (e, t, i) {
var r, o, a = this,
s = "",
l = e.field,
d = I(a.columns, function (e) {
return e.field == l
})[0] || {}, c = d.groupHeaderTemplate,
u = (d.title || l) + ": " + h(e.value, d.format, d.values),
p = F({}, {
field: e.field,
value: e.value
}, e.aggregates[e.field]),
f = a._groupAggregatesDefaultObject || {}, g = e.items;
if (c && (u = typeof c === ht ? c(p) : b.template(c)(p)), s += '
' + n(i) + '
' + '
' + '' + u + "
", e.hasSubgroups)
for (r = 0, o = g.length; o > r; r++) s += a._groupRowHtml(g[r], t - 1, i + 1);
else s += a._rowsHtml(g);
return a.groupFooterTemplate && (s += a.groupFooterTemplate(F(f, e.aggregates))), s
},
collapseGroup: function (n) {
n = e(n).find(".k-icon").addClass("k-i-expand").removeClass("k-i-collapse").end();
var i, r, o = n.find(".k-group-cell").length,
a = 1;
n.find("td:first").attr("aria-expanded", !1), n.nextAll("tr").each(function () {
return r = e(this), i = r.find(".k-group-cell").length, r.hasClass("k-grouping-row") ? a++ : r.hasClass("k-group-footer") && a--, o >= i || r.hasClass("k-group-footer") && 0 > a ? !1 : (r.hide(), t)
})
},
expandGroup: function (n) {
n = e(n).find(".k-icon").addClass("k-i-collapse").removeClass("k-i-expand").end();
var i, r, o = this,
a = n.find(".k-group-cell").length,
s = 1;
n.find("td:first").attr("aria-expanded", !0), n.nextAll("tr").each(function () {
return i = e(this), r = i.find(".k-group-cell").length, a >= r ? !1 : (r != a + 1 || i.hasClass("k-detail-row") || (i.show(), i.hasClass("k-grouping-row") && i.find(".k-icon").hasClass("k-i-collapse") && o.expandGroup(i), i.hasClass("k-master-row") && i.find(".k-icon").hasClass("k-minus") && i.next().show()), i.hasClass("k-grouping-row") && s++, i.hasClass("k-group-footer") && (1 == s ? i.show() : s--), t)
})
},
_updateHeader: function (t) {
var n = this,
i = n.thead.find("th.k-group-cell"),
r = i.length;
t > r ? e(Array(t - r + 1).join('
')).prependTo(n.thead.find("tr")) : r > t && (r -= t, e(I(i, function (e, t) {
return r > t
})).remove())
},
_firstDataItem: function (e, t) {
return e && t && (e = e.hasSubgroups ? this._firstDataItem(e.items[0], t) : e.items[0]), e
},
hideColumn: function (t) {
var n, i, r, o, a, s, l, u, p, f = this,
h = 0,
m = f.footer || f.wrapper.find(".k-grid-footer"),
v = f.columns;
if (t = "number" == typeof t ? v[t] : I(v, function (e) {
return e.field === t
})[0], t && !t.hidden) {
for (p = P(t, d(v)), t.hidden = !0, t.attributes = c(t.attributes), t.footerAttributes = c(t.footerAttributes), t.headerAttributes = c(t.headerAttributes), f._templates(), f._updateCols(), g(f.thead.find(">tr")[0].cells, p, !1), m[0] && (f._appendCols(m.find("table:first")), g(m.find(".k-footer-template")[0].cells, p, !1)), n = f.tbody.children(), a = 0, u = n.length; u > a; a += 1) i = n.eq(a), i.is(".k-grouping-row,.k-detail-row") ? (r = i.children(":not(.k-group-cell):first,.k-detail-cell").last(), r.attr("colspan", parseInt(r.attr("colspan"), 10) - 1)) : (i.hasClass("k-grid-edit-row") && (r = i.children(".k-edit-container")[0]) && (r = e(r), r.attr("colspan", parseInt(r.attr("colspan"), 10) - 1), r.find("col").eq(p).remove(), i = r.find("tr:first")), g(i[0].cells, p, !1));
for (s = f.thead.prev().find("col"), a = 0, u = s.length; u > a; a += 1) {
if (l = s[a].style.width, !l || -1 != l.indexOf("%")) {
h = 0;
break
}
h += parseInt(l, 10)
}
o = e(">.k-grid-header table:first,>.k-grid-footer table:first", f.wrapper).add(f.table), f._footerWidth = null, h && (o.width(h), f._footerWidth = h), kt.msie && 8 == kt.version && (o.css("display", "inline-table"), setTimeout(function () {
o.css("display", "table")
}, 1)), f.trigger(tt, {
column: t
})
}
},
showColumn: function (t) {
var n, i, r, o, a, s, l, c, f, h, m = this,
v = m.columns,
_ = m.footer || m.wrapper.find(".k-grid-footer");
if (t = "number" == typeof t ? v[t] : I(v, function (e) {
return e.field === t
})[0], t && t.hidden) {
for (h = P(t, v), t.hidden = !1, t.attributes = u(t.attributes), t.footerAttributes = u(t.footerAttributes), t.headerAttributes = u(t.headerAttributes), m._templates(), m._updateCols(), g(m.thead.find(">tr")[0].cells, h, !0), _[0] && (m._appendCols(_.find("table:first")), g(_.find(".k-footer-template")[0].cells, h, !0)), n = m.tbody.children(), i = 0, r = n.length; r > i; i += 1) o = n.eq(i), o.is(".k-grouping-row,.k-detail-row") ? (a = o.children(":not(.k-group-cell):first,.k-detail-cell").last(), a.attr("colspan", parseInt(a.attr("colspan"), 10) + 1)) : (o.hasClass("k-grid-edit-row") && (a = o.children(".k-edit-container")[0]) && (a = e(a), a.attr("colspan", parseInt(a.attr("colspan"), 10) + 1), p(a.find(">form>table"), d(v), !1, 0), o = a.find("tr:first")), g(o[0].cells, h, !0));
if (s = e(">.k-grid-header table:first,>.k-grid-footer table:first", m.wrapper).add(m.table), t.width) {
for (l = 0, f = m.thead.prev().find("col"), i = 0, r = f.length; r > i; i += 1) {
if (c = f[i].style.width, c.indexOf("%") > -1) {
l = 0;
break
}
l += parseInt(c, 10)
}
m._footerWidth = null, l && (s.width(l), m._footerWidth = l)
} else s.width("");
m.trigger(nt, {
column: t
})
}
},
_progress: function (e) {
var t = this,
n = t.element.is("table") ? t.element.parent() : t.content && t.content.length ? t.content : t.element;
b.ui.progress(n, e)
},
refresh: function (t) {
var n, i, r, o, s, l, c = this,
u = "",
p = c.dataSource.view(),
f = c.options.navigatable,
h = e(c.current()),
g = !1,
m = (c.dataSource.group() || []).length,
_ = m + d(c.columns).length;
if (!(t && "itemchange" === t.action && c.editable || (t = t || {}, c.trigger("dataBinding", {
action: t.action || "rebind",
index: t.index,
items: t.items
})))) {
if (l = C(), f && (c.table[0] === l || e.contains(c.table[0], l) || c._editContainer && c._editContainer.data("kendoWindow")) && (g = h.is("th"), s = 0, g && (s = c.thead.find("th:not(.k-group-cell)").index(h))), c._destroyEditable(), c._progress(!1), c._data = [], c.columns.length || (c._autoColumns(c._firstDataItem(p[0], m)), _ = m + c.columns.length), c._group = m > 0 || c._group, c._group && (c._templates(), c._updateCols(), c._updateHeader(m), c._group = m > 0), m > 0)
for (c.detailTemplate && _++, c.groupFooterTemplate && (c._groupAggregatesDefaultObject = a(c.dataSource.aggregate())), i = 0, n = p.length; n > i; i++) u += c._groupRowHtml(p[i], _, 0);
else u += c._rowsHtml(p);
k ? c.tbody[0].innerHTML = u : (o = document.createElement("div"), o.innerHTML = "
" + u + "
", r = o.firstChild.firstChild, c.table[0].replaceChild(r, c.tbody[0]), c.tbody = e(r)), c._footer(), c._setContentHeight(), s >= 0 && (c._removeCurrent(), g ? c.current(c.thead.find("th:not(.k-group-cell)").eq(s)) : c.current(c.items().eq(s).children().filter(B).first()), c._current && v(c._current.closest("table")[0], !0)), c.trigger(rt)
}
}
});
y.plugin(At), y.plugin(Tt)
}(window.kendo.jQuery),
function (e, t) {
var n = window.kendo,
i = "change",
r = "cancel",
o = "dataBound",
a = "dataBinding",
s = n.ui.Widget,
l = n.keys,
d = ">*",
c = "progress",
u = "error",
p = "k-state-focused",
f = "k-state-selected",
h = "k-edit-item",
g = "string",
m = "edit",
v = "remove",
_ = "save",
b = "click",
y = ".kendoListView",
w = e.proxy,
x = n._activeElement,
k = n.ui.progress,
C = n.data.DataSource,
T = s.extend({
init: function (t, i) {
var r = this;
i = e.isArray(i) ? {
dataSource: i
} : i, s.fn.init.call(r, t, i), i = r.options, r.wrapper = t = r.element, t[0].id && (r._itemId = t[0].id + "_lv_active"), r._element(), r._dataSource(), r.template = n.template(i.template || ""), r.altTemplate = n.template(i.altTemplate || i.template), r.editTemplate = n.template(i.editTemplate || ""), r._navigatable(), r._selectable(), r._pageable(), r._crudHandlers(), r.options.autoBind && r.dataSource.fetch(), n.notify(r)
},
events: [i, r, a, o, m, v, _],
options: {
name: "ListView",
autoBind: !0,
selectable: !1,
navigatable: !1,
template: "",
altTemplate: "",
editTemplate: ""
},
_item: function (e) {
return this.element.children()[e]()
},
items: function () {
return this.element.children()
},
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource(), this.options.autoBind && e.fetch()
},
_unbindDataSource: function () {
var e = this;
e.dataSource.unbind(i, e._refreshHandler).unbind(c, e._progressHandler).unbind(u, e._errorHandler)
},
_dataSource: function () {
var e = this;
e.dataSource && e._refreshHandler ? e._unbindDataSource() : (e._refreshHandler = w(e.refresh, e), e._progressHandler = w(e._progress, e), e._errorHandler = w(e._error, e)), e.dataSource = C.create(e.options.dataSource).bind(i, e._refreshHandler).bind(c, e._progressHandler).bind(u, e._errorHandler)
},
_progress: function () {
k(this.element, !0)
},
_error: function () {
k(this.element, !1)
},
_element: function () {
this.element.addClass("k-widget k-listview").attr("role", "listbox")
},
refresh: function (i) {
var r, s, l, d, c, u = this,
p = u.dataSource.view(),
f = "",
h = u.template,
g = u.altTemplate,
m = x();
if (i && "itemchange" === i.action) return u.editable || (r = i.items[0], d = e.inArray(r, p), d >= 0 && (u.items().eq(d).replaceWith(h(r)), l = u.items().eq(d), l.attr(n.attr("uid"), r.uid), u.trigger("itemChange", {
item: l,
data: r
}))), t;
if (i = i || {}, !u.trigger(a, {
action: i.action || "rebind",
items: i.items,
index: i.index
})) {
for (u._destroyEditable(), d = 0, c = p.length; c > d; d++) f += d % 2 ? g(p[d]) : h(p[d]);
for (u.element.html(f), s = u.items(), d = 0, c = p.length; c > d; d++) s.eq(d).attr(n.attr("uid"), p[d].uid).attr("role", "option").attr("aria-selected", "false");
u.element[0] === m && u.options.navigatable && u.current(s.eq(0)), u.trigger(o)
}
},
_pageable: function () {
var t, i, r = this,
o = r.options.pageable;
e.isPlainObject(o) && (i = o.pagerId, t = e.extend({}, o, {
dataSource: r.dataSource,
pagerId: null
}), r.pager = new n.ui.Pager(e("#" + i), t))
},
_selectable: function () {
var e, r, o = this,
a = o.options.selectable,
s = o.options.navigatable;
a && (e = typeof a === g && a.toLowerCase().indexOf("multiple") > -1, e && o.element.attr("aria-multiselectable", !0), o.selectable = new n.ui.Selectable(o.element, {
aria: !0,
multiple: e,
filter: d,
change: function () {
o.trigger(i)
}
}), s && o.element.on("keydown" + y, function (n) {
if (n.keyCode === l.SPACEBAR) {
if (r = o.current(), n.target == n.currentTarget && n.preventDefault(), e)
if (n.ctrlKey) {
if (r && r.hasClass(f)) return r.removeClass(f), t
} else o.selectable.clear();
else o.selectable.clear();
o.selectable.value(r)
}
}))
},
current: function (e) {
var n = this,
i = n.element,
r = n._current,
o = n._itemId;
return e === t ? r : (r && (r[0].id === o && r.removeAttr("id"), r.removeClass(p), i.removeAttr("aria-activedescendant")), e && e[0] && (o = e[0].id || o, n._scrollTo(e[0]), i.attr("aria-activedescendant", o), e.addClass(p).attr("id", o)), n._current = e, t)
},
_scrollTo: function (t) {
var n, i, r = this,
o = !1,
a = "scroll";
"auto" == r.wrapper.css("overflow") || r.wrapper.css("overflow") == a ? n = r.wrapper[0] : (n = window, o = !0), i = function (i, r) {
var s = o ? e(t).offset()[i.toLowerCase()] : t["offset" + i],
l = t["client" + r],
d = e(n)[a + i](),
c = e(n)[r.toLowerCase()]();
s + l > d + c ? e(n)[a + i](s + l - c) : d > s && e(n)[a + i](s)
}, i("Top", "Height"), i("Left", "Width")
},
_navigatable: function () {
var t = this,
i = t.options.navigatable,
r = t.element,
o = function (n) {
t.current(e(n.currentTarget)), e(n.target).is(":button,a,:input,a>.k-icon,textarea") || r.focus()
};
i && (t._tabindex(), r.on("focus" + y, function () {
var e = t._current;
e && e.is(":visible") || (e = t._item("first")), t.current(e)
}).on("focusout" + y, function () {
t._current && t._current.removeClass(p)
}).on("keydown" + y, function (i) {
var o, a, s = i.keyCode,
d = t.current(),
c = e(i.target),
u = !c.is(":button,textarea,a,a>.t-icon,input"),
p = c.is(":text"),
f = n.preventDefault,
g = r.find("." + h),
m = x();
if (!(!u && !p && l.ESC != s || p && l.ESC != s && l.ENTER != s))
if (l.UP === s || l.LEFT === s) d && (d = d.prev()), t.current(d && d[0] ? d : t._item("last")), f(i);
else if (l.DOWN === s || l.RIGHT === s) d && (d = d.next()), t.current(d && d[0] ? d : t._item("first")), f(i);
else if (l.PAGEUP === s) t.current(null), t.dataSource.page(t.dataSource.page() - 1), f(i);
else if (l.PAGEDOWN === s) t.current(null), t.dataSource.page(t.dataSource.page() + 1), f(i);
else if (l.HOME === s) t.current(t._item("first")), f(i);
else if (l.END === s) t.current(t._item("last")), f(i);
else if (l.ENTER === s) 0 !== g.length && (u || p) ? (o = t.items().index(g), m && m.blur(), t.save(), a = function () {
t.element.trigger("focus"), t.current(t.items().eq(o))
}, t.one("dataBound", a)) : "" !== t.options.editTemplate && t.edit(d);
else if (l.ESC === s) {
if (g = r.find("." + h), 0 === g.length) return;
o = t.items().index(g), t.cancel(), t.element.trigger("focus"), t.current(t.items().eq(o))
}
}), r.on("mousedown" + y + " touchstart" + y, d, w(o, t)))
},
clearSelection: function () {
var e = this;
e.selectable.clear(), e.trigger(i)
},
select: function (n) {
var i = this,
r = i.selectable;
return n = e(n), n.length ? (r.options.multiple || (r.clear(), n = n.first()), r.value(n), t) : r.value()
},
_destroyEditable: function () {
var e = this;
e.editable && (e.editable.destroy(), delete e.editable)
},
_modelFromElement: function (e) {
var t = e.attr(n.attr("uid"));
return this.dataSource.getByUid(t)
},
_closeEditable: function (e) {
var t, i, r = this,
o = r.editable,
a = r.template,
s = !0;
return o && (e && (s = o.end()), s && (o.element.index() % 2 && (a = r.altTemplate), t = r._modelFromElement(o.element), r._destroyEditable(), i = o.element.index(), o.element.replaceWith(a(t)), r.items().eq(i).attr(n.attr("uid"), t.uid))), s
},
edit: function (e) {
var t, i = this,
r = i._modelFromElement(e),
o = e.index();
i.cancel(), e.replaceWith(i.editTemplate(r)), t = i.items().eq(o).addClass(h).attr(n.attr("uid"), r.uid), i.editable = t.kendoEditable({
model: r,
clearContainer: !1,
errorTemplate: !1
}).data("kendoEditable"), i.trigger(m, {
model: r,
item: t
})
},
save: function () {
var e, t = this,
n = t.editable;
n && (n = n.element, e = t._modelFromElement(n), !t.trigger(_, {
model: e,
item: n
}) && t._closeEditable(!0) && t.dataSource.sync())
},
remove: function (e) {
var t = this,
n = t.dataSource,
i = t._modelFromElement(e);
t.trigger(v, {
model: i,
item: e
}) || (e.hide(), n.remove(i), n.sync())
},
add: function () {
var e = this,
t = e.dataSource,
n = t.indexOf((t.view() || [])[0]);
0 > n && (n = 0), e.cancel(), t.insert(n, {}), e.edit(e.element.children().first())
},
cancel: function () {
var e, t, n = this,
i = n.dataSource;
n.editable && (e = n.editable.element, t = n._modelFromElement(e), n.trigger(r, {
model: t,
container: e
}) || (i.cancelChanges(t), n._closeEditable(!1)))
},
_crudHandlers: function () {
var t = this,
i = b + y;
t.element.on(i, ".k-edit-button", function (i) {
var r = e(this).closest("[" + n.attr("uid") + "]");
t.edit(r), i.preventDefault()
}), t.element.on(i, ".k-delete-button", function (i) {
var r = e(this).closest("[" + n.attr("uid") + "]");
t.remove(r), i.preventDefault()
}), t.element.on(i, ".k-update-button", function (e) {
t.save(), e.preventDefault()
}), t.element.on(i, ".k-cancel-button", function (e) {
t.cancel(), e.preventDefault()
})
},
destroy: function () {
var e = this;
s.fn.destroy.call(e), e._unbindDataSource(), e._destroyEditable(), e.element.off(y), e.pager && e.pager.destroy(), e.selectable && e.selectable.destroy(), n.destroy(e.element)
}
});
n.ui.plugin(T)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
var i, r;
e.on("dragenter" + k, function () {
t(), r = new Date, i || (i = setInterval(function () {
var e = new Date - r;
e > 100 && (n(), clearInterval(i), i = null)
}, 100))
}).on("dragover" + k, function () {
r = new Date
})
}
function i(e, t) {
var n = e[t];
return p(n) ? n.field || t : n
}
function r(e, n) {
return e !== t && e.match(/\/$/) || (e = (e || "") + "/"), e + n
}
function o(e) {
if (!e) return "";
var t = " bytes";
return e >= 1073741824 ? (t = " GB", e /= 1073741824) : e >= 1048576 ? (t = " MB", e /= 1048576) : e >= 1024 && (t = " KB", e /= 1024), Math.round(100 * e) / 100 + t
}
var a, s, l, d, c = window.kendo,
u = c.ui.Widget,
p = e.isPlainObject,
f = e.proxy,
h = e.extend,
g = c.support.placeholder,
m = c.support.browser,
v = e.isFunction,
_ = /(^\/|\/$)/g,
b = "change",
y = "apply",
w = "error",
x = "click",
k = ".kendoImageBrowser",
C = ".kendoBreadcrumbs",
T = ".kendoSearchBox",
S = "name",
A = "size",
F = "type",
D = {
field: F,
dir: "asc"
}, I = c.template('
';
h(!0, c.data, {
schemas: {
imagebrowser: {
data: function (e) {
return e.items || e || []
},
model: {
id: "name",
fields: {
name: "name",
size: "size",
type: "type"
}
}
}
}
}), h(!0, c.data, {
transports: {
imagebrowser: c.data.RemoteTransport.extend({
init: function (t) {
c.data.RemoteTransport.fn.init.call(this, e.extend(!0, {}, this.options, t))
},
_call: function (t, n) {
n.data = e.extend({}, n.data, {
path: this.options.path()
}), v(this.options[t]) ? this.options[t].call(this, n) : c.data.RemoteTransport.fn[t].call(this, n)
},
read: function (e) {
this._call("read", e)
},
create: function (e) {
this._call("create", e)
},
destroy: function (e) {
this._call("destroy", e)
},
update: function () {},
options: {
read: {
type: "POST"
},
update: {
type: "POST"
},
create: {
type: "POST"
},
destroy: {
type: "POST"
}
}
})
}
}), a = m.msie && 8 > m.version ? function (e) {
return e.offsetTop
} : function (t) {
return t.offsetTop - e(t).height()
}, s = u.extend({
init: function (e, t) {
var n = this;
t = t || {}, u.fn.init.call(n, e, t), n.element.addClass("k-imagebrowser"), n.element.on(x + k, ".k-toolbar button:not(.k-state-disabled):has(.k-delete)", f(n._deleteClick, n)).on(x + k, ".k-toolbar button:not(.k-state-disabled):has(.k-addfolder)", f(n._addClick, n)).on("keydown" + k, "li.k-state-selected input", f(n._directoryKeyDown, n)).on("blur" + k, "li.k-state-selected input", f(n._directoryBlur, n)), n._dataSource(), n.refresh(), n.path(n.options.path)
},
options: {
name: "ImageBrowser",
messages: {
uploadFile: "Upload",
orderBy: "Arrange by",
orderByName: "Name",
orderBySize: "Size",
directoryNotFound: "A directory with this name was not found.",
emptyFolder: "Empty Folder",
deleteFile: 'Are you sure you want to delete "{0}"?',
invalidFileType: 'The selected file "{0}" is not valid. Supported file types are {1}.',
overwriteFile: 'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',
dropFilesHere: "drop file here to upload",
search: "Search"
},
transport: {},
path: "/",
fileTypes: "*.png,*.gif,*.jpg,*.jpeg"
},
events: [w, b, y],
destroy: function () {
var e = this;
u.fn.destroy.call(e), e.dataSource.unbind(w, e._errorHandler), e.element.add(e.list).add(e.toolbar).off(k), e.arrangeByPopup && e.arrangeByPopup.destroy(), c.destroy(e.element)
},
value: function () {
var e, n = this,
i = n._selectedItem(),
o = n.options.transport.imageUrl;
return i && "f" === i.get(n._getFieldName(F)) ? (e = r(n.path(), i.get(n._getFieldName(S))).replace(_, ""), o && (e = v(o) ? o(e) : c.format(o, encodeURIComponent(e))), e) : t
},
_selectedItem: function () {
var e = this.listView,
n = e.select();
return n.length ? this.dataSource.getByUid(n.attr(c.attr("uid"))) : t
},
_toolbar: function () {
var t, n, i = this,
r = c.template(P),
o = i.options.messages,
a = [{
text: o.orderByName,
value: "name",
ns: c.ns
}, {
text: o.orderBySize,
value: "size",
ns: c.ns
}];
i.toolbar = e(r({
messages: o,
showUpload: i.options.transport.uploadUrl,
showCreate: i.options.transport.create,
showDelete: i.options.transport.destroy
})).appendTo(i.element).find(".k-upload input").kendoUpload({
multiple: !1,
localization: {
dropFilesHere: o.dropFilesHere
},
async: {
saveUrl: i.options.transport.uploadUrl,
autoUpload: !0
},
upload: f(i._fileUpload, i),
error: function (e) {
i._error({
xhr: e.XMLHttpRequest,
status: "error"
})
}
}).end(), i.upload = i.toolbar.find(".k-upload input").data("kendoUpload"), t = i.toolbar.find(".k-tiles-arrange a"), i.arrangeByPopup = n = e("
" + c.render(I, a) + "
").kendoPopup({
anchor: t
}).on(x + k, "li", function () {
var t = e(this),
r = t.attr(c.attr("value"));
i.toolbar.find(".k-tiles-arrange a span:first").html(t.text()), n.close(), i.orderBy(r)
}).data("kendoPopup"), t.on(x + k, function (e) {
e.preventDefault(), n.toggle()
}), i._attachDropzoneEvents()
},
_attachDropzoneEvents: function () {
var t = this;
t.options.transport.uploadUrl && (n(e(document.documentElement), e.proxy(t._dropEnter, t), e.proxy(t._dropLeave, t)), t._scrollHandler = f(t._positionDropzone, t))
},
_dropEnter: function () {
this._positionDropzone(), e(document).on("scroll" + k, this._scrollHandler)
},
_dropLeave: function () {
this._removeDropzone(), e(document).off("scroll" + k, this._scrollHandler)
},
_positionDropzone: function () {
var e = this,
t = e.element,
n = t.offset();
e.toolbar.find(".k-dropzone").addClass("k-imagebrowser-dropzone").offset(n).css({
width: t[0].clientWidth,
height: t[0].clientHeight,
lineHeight: t[0].clientHeight + "px"
})
},
_removeDropzone: function () {
this.toolbar.find(".k-dropzone").removeClass("k-imagebrowser-dropzone").css({
width: "",
height: "",
lineHeight: "",
top: "",
left: ""
})
},
_deleteClick: function () {
var e = this,
t = e.listView.select(),
n = c.format(e.options.messages.deleteFile, t.find("strong").text());
t.length && e._showMessage(n, "confirm") && e.listView.remove(t)
},
_addClick: function () {
this.createDirectory()
},
_fileUpload: function (e) {
var t, n = this,
i = n.options,
r = i.fileTypes,
o = RegExp(("(" + r.split(",").join(")|(") + ")").replace(/\*\./g, ".*."), "i"),
a = e.files[0].name,
s = n._getFieldName(S),
l = n._getFieldName(A);
o.test(a) ? (e.data = {
path: n.path()
}, t = n._createFile(a), t ? n.upload.one("success", function (e) {
t.set(s, e.response[s]), t.set(l, e.response[l]), n._tiles = n.listView.items().filter("[" + c.attr("type") + "=f]"), n._scroll()
}) : e.preventDefault()) : (e.preventDefault(), n._showMessage(c.format(i.messages.invalidFileType, a, r)))
},
_findFile: function (e) {
var t, n, i, r = this.dataSource.data(),
o = this._getFieldName(F),
a = this._getFieldName(S);
for (e = e.toLowerCase(), t = 0, i = r.length; i > t; t++)
if ("f" === r[t].get(o) && r[t].get(a).toLowerCase() === e) {
n = r[t];
break
}
return n
},
_createFile: function (e) {
var t, n, i = this,
r = 0,
o = {}, a = i._getFieldName(F),
s = i.dataSource.view(),
l = i._findFile(e);
if (l && !i._showMessage(c.format(i.options.messages.overwriteFile, e), "confirm")) return null;
if (l) return l;
for (t = 0, n = s.length; n > t; t++)
if ("f" === s[t].get(a)) {
r = t;
break
}
return o[a] = "f", o[i._getFieldName(S)] = e, o[i._getFieldName(A)] = 0, i.dataSource.insert(++r, o)
},
createDirectory: function () {
var e, t, n = this,
i = 0,
r = n._getFieldName(F),
o = n._getFieldName(S),
a = n.dataSource.data(),
s = n._nameDirectory(),
l = new n.dataSource.reader.model;
for (e = 0, t = a.length; t > e; e++) "d" === a[e].get(r) && (i = e);
l.set(r, "d"), l.set(o, s), n.listView.one("dataBound", function () {
var e = n.listView.items().filter("[" + c.attr("uid") + "=" + l.uid + "]"),
t = e.find("input");
e.length && this.edit(e), this.element.scrollTop(e.attr("offsetTop") - this.element[0].offsetHeight), setTimeout(function () {
t.select()
})
}).one("save", function (e) {
var t = e.model.get(o);
t ? e.model.set(o, n._nameExists(t, l.uid) ? n._nameDirectory() : t) : e.model.set(o, s)
}), n.dataSource.insert(++i, l)
},
_directoryKeyDown: function (e) {
13 == e.keyCode && e.currentTarget.blur()
},
_directoryBlur: function () {
this.listView.save()
},
_nameExists: function (e, t) {
var n, i, r = this.dataSource.data(),
o = this._getFieldName(F),
a = this._getFieldName(S);
for (n = 0, i = r.length; i > n; n++)
if ("d" === r[n].get(o) && r[n].get(a).toLowerCase() === e.toLowerCase() && r[n].uid !== t) return !0;
return !1
},
_nameDirectory: function () {
var t, n, i, r = "New folder",
o = this.dataSource.data(),
a = [],
s = this._getFieldName(F),
l = this._getFieldName(S);
for (n = 0, i = o.length; i > n; n++) "d" === o[n].get(s) && o[n].get(l).toLowerCase().indexOf(r.toLowerCase()) > -1 && a.push(o[n].get(l));
if (e.inArray(r, a) > -1) {
n = 2;
do t = r + " (" + n + ")", n++; while (e.inArray(t, a) > -1);
r = t
}
return r
},
orderBy: function (e) {
this.dataSource.sort([{
field: this._getFieldName(F),
dir: "asc"
}, {
field: this._getFieldName(e),
dir: "asc"
}])
},
search: function (e) {
this.dataSource.filter({
field: this._getFieldName(S),
operator: "contains",
value: e
})
},
_content: function () {
var t = this;
t.list = e('
').appendTo(t.element).on("scroll" + k, f(t._scroll, t)).on("dblclick" + k, "li", f(t._dblClick, t)), t.listView = new c.ui.ListView(t.list, {
dataSource: t.dataSource,
template: t._itemTmpl(),
editTemplate: t._editTmpl(),
selectable: !0,
autoBind: !1,
dataBinding: function (e) {
t.toolbar.find(".k-delete").parent().addClass("k-state-disabled"), ("remove" === e.action || "sync" === e.action) && e.preventDefault()
},
dataBound: function () {
t.dataSource.view().length ? (t._tiles = this.items().filter("[" + c.attr("type") + "=f]"), t._scroll()) : this.wrapper.append(E({
text: t.options.messages.emptyFolder
}))
},
change: f(t._listViewChange, t)
})
},
_dblClick: function (t) {
var n, i = this,
o = e(t.currentTarget);
o.filter("[" + c.attr("type") + "=d]").length ? (n = i.dataSource.getByUid(o.attr(c.attr("uid"))), n && (i.path(r(i.path(), n.get(i._getFieldName(S)))), i.breadcrumbs.value(i.path()))) : o.filter("[" + c.attr("type") + "=f]").length && i.trigger(y)
},
_listViewChange: function () {
var e = this._selectedItem();
e && (this.toolbar.find(".k-delete").parent().removeClass("k-state-disabled"), "f" === e.get(this._getFieldName(F)) && this.trigger(b))
},
_dataSource: function () {
var e, t = this,
n = t.options,
r = n.transport,
o = h({}, D),
a = {
field: S,
dir: "asc"
}, s = {
type: r.type || "imagebrowser",
sort: [o, a]
};
p(r) && (r.path = f(t.path, t), s.transport = r), p(n.schema) ? (s.schema = n.schema, p(n.schema.model) && n.schema.model.fields && (o.field = i(n.schema.model.fields, F), a.field = i(n.schema.model.fields, S))) : r.type && p(c.data.schemas[r.type]) && (e = c.data.schemas[r.type], p(e.model) && e.model.fields && (o.field = i(e.model.fields, F), a.field = i(e.model.fields, S))), t.dataSource && t._errorHandler ? t.dataSource.unbind(w, t._errorHandler) : t._errorHandler = f(t._error, t), t.dataSource = c.data.DataSource.create(s).bind(w, t._errorHandler)
},
_navigation: function () {
var t = this,
n = e('').appendTo(this.element);
t.breadcrumbs = n.find("input:first").kendoBreadcrumbs({
value: t.options.path,
change: function () {
t.path(this.value())
}
}).data("kendoBreadcrumbs"), t.searchBox = n.parent().find("input:last").kendoSearchBox({
label: t.options.messages.search,
change: function () {
t.search(this.value())
}
}).data("kendoSearchBox")
},
_error: function (e) {
var t, n = this;
n.trigger(w, e) || (t = e.xhr.status, "error" == e.status ? "404" == t ? n._showMessage(n.options.messages.directoryNotFound) : "0" != t && n._showMessage("Error! The requested URL returned " + t + " - " + e.xhr.statusText) : "timeout" == t && n._showMessage("Error! Server timeout."))
},
_showMessage: function (e, t) {
return window[t || "alert"](e)
},
refresh: function () {
var e = this;
e._navigation(), e._toolbar(), e._content()
},
_loadImage: function (t) {
var n = this,
i = e(t),
r = n.dataSource.getByUid(i.attr(c.attr("uid"))),
o = r.get(n._getFieldName(S)),
a = n.options.transport.thumbnailUrl,
s = e("", {
alt: o
}).hide().on("load" + k, function () {
e(this).prev().remove().end().addClass("k-image").fadeIn()
}),
l = "?";
i.find(".k-loading").after(s), v(a) ? a = a(n.path(), encodeURIComponent(o)) : (a.indexOf("?") >= 0 && (l = "&"), a = a + l + "path=" + n.path() + encodeURIComponent(o)), s.attr("src", a), t.loaded = !0
},
_scroll: function () {
var e = this;
e.options.transport && e.options.transport.thumbnailUrl && (clearTimeout(e._timeout), e._timeout = setTimeout(function () {
var n = e.list.outerHeight(),
i = e.list.scrollTop(),
r = i + n;
e._tiles.each(function () {
var n = a(this),
o = n + this.offsetHeight;
return (n >= i && r > n || o >= i && r > o) && e._loadImage(this), n > r ? !1 : t
}), e._tiles = e._tiles.filter(function () {
return !this.loaded
})
}, 250))
},
_editTmpl: function () {
var e = this,
t = '
', t += "#if(" + e._getFieldName(F) + ' == "d") { #', t += '
', t += "#}else{#", t += '
', t += "#}#", t += "#if(" + e._getFieldName(F) + ' == "d") { #', t += '', t += "#}#", t += "
", f(c.template(t), {
sizeFormatter: o
})
},
_itemTmpl: function () {
var e = this,
t = '
', t += "#if(" + e._getFieldName(F) + ' == "d") { #', t += '
', t += "#}else{#", t += e.options.transport && e.options.transport.thumbnailUrl ? '
' : '
', t += "#}#", t += "${" + e._getFieldName(S) + "}", t += "#if(" + e._getFieldName(F) + ' == "f") { # ${this.sizeFormatter(' + e._getFieldName(A) + ")} #}#", t += "
", f(c.template(t), {
sizeFormatter: o
})
},
_getFieldName: function (e) {
return i(this.dataSource.reader.model.fields, e)
},
path: function (e) {
var n = this,
i = n._path || "";
return e !== t ? (n._path = e.replace(_, "") + "/", n.dataSource.read({
path: n._path
}), t) : (i && (i = i.replace(_, "")), "/" === i || "" === i ? "" : i + "/")
}
}), l = u.extend({
init: function (e, t) {
var n = this;
t = t || {}, u.fn.init.call(n, e, t), g && n.element.attr("placeholder", n.options.label), n._wrapper(), n.element.on("keydown" + T, f(n._keydown, n)).on("change" + T, f(n._updateValue, n)), n.wrapper.on(x + T, "a", f(n._click, n)), g || n.element.on("focus" + T, f(n._focus, n)).on("blur" + T, f(n._blur, n))
},
options: {
name: "SearchBox",
label: "Search",
value: ""
},
events: [b],
destroy: function () {
var e = this;
e.wrapper.add(e.element).add(e.label).off(T), u.fn.destroy.call(e)
},
_keydown: function (e) {
13 === e.keyCode && this._updateValue()
},
_click: function (e) {
e.preventDefault(), this._updateValue()
},
_updateValue: function () {
var e = this,
t = e.element.val();
t !== e.value() && (e.value(t), e.trigger(b))
},
_blur: function () {
this._updateValue(), this._toggleLabel()
},
_toggleLabel: function () {
g || this.label.toggle(!this.element.val())
},
_focus: function () {
this.label.hide()
},
_wrapper: function () {
var t = this.element,
n = t.parents(".k-search-wrap");
t[0].style.width = "", t.addClass("k-input k-textbox"), n.length || (n = t.wrap(e('')).parent(), g || e('").insertBefore(t), e('').appendTo(n)), this.wrapper = n, this.label = n.find(">label")
},
value: function (e) {
var n = this;
return e !== t ? (n.options.value = e, n.element.val(e), n._toggleLabel(), t) : n.options.value
}
}), d = u.extend({
init: function (e, t) {
var n = this;
t = t || {}, u.fn.init.call(n, e, t), n._wrapper(), n.wrapper.on("focus" + C, "input", f(n._focus, n)).on("blur" + C, "input", f(n._blur, n)).on("keydown" + C, "input", f(n._keydown, n)).on(x + C, "a.k-i-arrow-n:first", f(n._rootClick, n)).on(x + C, "a:not(.k-i-arrow-n)", f(n._click, n)), n.value(n.options.value)
},
options: {
name: "Breadcrumbs",
gap: 50
},
events: [b],
destroy: function () {
var e = this;
u.fn.destroy.call(e), e.wrapper.add(e.wrapper.find("input")).add(e.wrapper.find("a")).off(C)
},
_update: function (e) {
e = "/" === (e || "").charAt(0) ? e : "/" + (e || ""), e !== this.value() && (this.value(e), this.trigger(b))
},
_click: function (t) {
t.preventDefault(), this._update(this._path(e(t.target).prevAll("a:not(.k-i-arrow-n)").andSelf()))
},
_rootClick: function (e) {
e.preventDefault(), this._update("")
},
_focus: function () {
var e = this,
t = e.element;
e.overlay.hide(), e.element.val(e.value()), setTimeout(function () {
t.select()
})
},
_blur: function () {
if (!this.overlay.is(":visible")) {
var e = this,
t = e.element,
n = t.val().replace(/\/{2,}/g, "/");
e.overlay.show(), t.val(""), e._update(n)
}
},
_keydown: function (e) {
var t = this;
13 === e.keyCode && (t._blur(), setTimeout(function () {
t.overlay.find("a:first").focus()
}))
},
_wrapper: function () {
var t, n = this.element,
i = n.parents(".k-breadcrumbs");
n[0].style.width = "", n.addClass("k-input"), i.length || (i = n.wrap(e('')).parent()), t = i.find(".k-breadcrumbs-wrap"), t.length || (t = e('').appendTo(i)), this.wrapper = i, this.overlay = t
},
refresh: function () {
var n, i, r, o, a = "",
s = this.value();
for (s !== t && s.match(/^\//) || (s = "/" + (s || "")), n = s.split("/"), r = 0, o = n.length; o > r; r++) i = n[r], i && (a || (a += 'root'), a += '' + n[r] + "", a += '>');
this.overlay.empty().append(e(a)), this._adjustSectionWidth()
},
_adjustSectionWidth: function () {
var t, n = this,
i = n.wrapper,
r = i.width() - n.options.gap,
o = n.overlay.find("a");
o.each(function (n) {
t = e(this), t.parent().width() > r && (n == o.length - 1 ? t.width(r) : t.prev().andSelf().hide())
})
},
value: function (e) {
return e !== t ? (this._value = e.replace(/\/{2,}/g, "/"), this.refresh(), t) : this._value
},
_path: function (t) {
return "/" + e.map(t, function (t) {
return e(t).text()
}).join("/")
}
}), c.ui.plugin(s), c.ui.plugin(d), c.ui.plugin(l)
}(window.kendo.jQuery),
function (e, t) {
var n, i, r = window.kendo,
o = r.Class,
a = r.ui.Widget,
s = r.support.mobileOS,
l = r.support.browser,
d = e.extend,
c = r.deepExtend,
u = ".kendoEditor",
p = r.keys,
f = o.extend({
init: function (e) {
this.options = e
},
getHtml: function () {
var e = this.options;
return r.template(e.template)({
cssClass: e.cssClass,
tooltip: e.title,
initialValue: e.initialValue
})
}
}),
h = {
select: function (e) {
e.trigger("select", {})
},
editorWrapperTemplate: '
',
comboBoxTemplate: '',
dropDownListTemplate: '',
separatorTemplate: '',
focusable: ".k-colorpicker,a.k-tool-icon:not(.k-state-disabled),.k-selectbox, .k-combobox .k-input",
wrapTextarea: function (t) {
var n = t[0].style.width,
i = t[0].style.height,
r = h.editorWrapperTemplate,
o = e(r).insertBefore(t).width(n).height(i),
a = o.find(".k-editable-area");
return t.appendTo(a).addClass("k-content k-raw-content").hide(), t.closest(".k-editor")
},
renderTools: function (t, n) {
var i, o, a, s, l, c = {}, u = t._nativeTools,
p = e(t.element).closest(".k-editor").find(".k-editor-toolbar");
if (n)
for (a = 0; n.length > a; a++) i = n[a], l = null, e.isPlainObject(i) ? i.name && t.tools[i.name] ? (e.extend(t.tools[i.name].options, i), c[i.name] = t.tools[i.name], l = c[i.name].options) : (l = d({
cssClass: "k-i-custom",
type: "button",
tooltip: ""
}, i), l.name && (l.cssClass = "k-" + ("custom" == l.name ? "i-custom" : l.name)), l.template || "button" == l.type && (l.template = h.buttonTemplate)) : t.tools[i] && (c[i] = t.tools[i], l = c[i].options), l && (s = l.template, s && (s.getHtml ? s = s.getHtml() : (e.isFunction(s) || (s = r.template(s)), s = s(l)), 0 !== s.indexOf("
" + s + "
"), o = e(s).appendTo(p), "button" == l.type && l.exec && o.find(".k-tool-icon").click(e.proxy(l.exec, t.element[0]))));
for (a = 0; u.length > a; a++) c[u[a]] || (c[u[a]] = t.tools[u[a]]);
t.options.tools = c
},
decorateStyleToolItems: function (t) {
var n, i = t.data.closest(".k-editor").find(".k-style").data("kendoSelectBox");
i && (n = i.dataSource.view(), i.list.find(".k-item").each(function (i, o) {
var a = e(o),
s = a.text(),
l = r.ui.editor.Dom.inlineStyle(t.data.data("kendoEditor").document, "span", {
className: n[i].value
});
a.html('' + s + "")
}))
},
createContentElement: function (t, n) {
var i, o, a, s = r.support.isRtl(t) ? "direction:rtl;" : "";
return t.hide(), i = e("", {
src: 'javascript:""',
frameBorder: "0"
}).css("display", "").addClass("k-content").insertBefore(t)[0], o = i.contentWindow || i, n.length > 0 && e(i).one("load", t, h.decorateStyleToolItems), a = o.document || i.contentDocument, a.open(), a.write("" + e.map(n, function (e) {
return ""
}).join("") + ""), a.close(), o
},
initializeContentElement: function (n) {
var i = !0;
n.window = h.createContentElement(e(n.textarea), n.options.stylesheets), n.document = n.window.contentDocument || n.window.document, n.body = n.document.body, e(n.document).on("keydown" + u, function (e) {
var o, a, s, l, d;
return e.keyCode === p.F10 ? (setTimeout(function () {
var e = "tabIndex",
t = n.wrapper,
i = t.attr(e);
t.attr(e, i || 0).focus().find("li:has(" + m + ")").first().focus(), i || 0 === i || t.removeAttr(e)
}, 100), e.preventDefault(), t) : (e.keyCode === p.BACKSPACE && (o = n.getRange(), s = r.support.browser.msie ? "" : ' ', l = r.ui.editor.Dom, o.deleteContents(), a = o.commonAncestorContainer, "p" === l.name(a) && "" === a.innerHTML && (a.innerHTML = s, o.setStart(a, 0), o.collapse(!0), n.selectRange(o))), (d = n.keyboard.toolFromShortcut(n.options.tools, e)) ? (e.preventDefault(), /undo|redo/.test(d) || n.keyboard.endTyping(!0), n.trigger("keydown", e), n.exec(d), !1) : (n.keyboard.isTypingKey(e) && n.pendingFormats.hasPending() && (i ? i = !1 : (o = n.getRange(), n.pendingFormats.apply(o), n.selectRange(o))), n.keyboard.clearTimeout(), n.keyboard.keydown(e), t))
}).on("keyup" + u, function (t) {
var r, o = [8, 9, 33, 34, 35, 36, 37, 38, 39, 40, 40, 45, 46];
(e.inArray(t.keyCode, o) > -1 || 65 == t.keyCode && t.ctrlKey && !t.altKey && !t.shiftKey) && (n.pendingFormats.clear(), g(n)), n.keyboard.isTypingKey(t) ? n.pendingFormats.hasPending() && (r = n.getRange(), n.pendingFormats.apply(r), n.selectRange(r)) : i = !0, n.keyboard.keyup(t)
}).on("mousedown" + u, function (t) {
n.pendingFormats.clear();
var i = e(t.target);
!l.gecko && 2 == t.which && i.is("a[href]") && window.open(i.attr("href"), "_new")
}).on("mouseup" + u, function () {
g(n)
}).on("click" + u, function (e) {
var t, i = r.ui.editor.Dom;
"img" === i.name(e.target) && (t = n.createRange(), t.selectNode(e.target), n.selectRange(t))
}), e(n.window).on("blur" + u, function () {
var e = n.textarea.value,
t = n.encodedValue();
n.update(), t != e && n.trigger("change")
}), e(n.body).on("cut" + u + " paste" + u, function (e) {
n.clipboard["on" + e.type](e)
})
},
formatByName: function (t, n) {
for (var i = 0; n.length > i; i++)
if (e.inArray(t, n[i].tags) >= 0) return n[i]
},
registerTool: function (e, t) {
var n = t.options;
n && n.template && (n.template.options.cssClass = "k-" + e), x.defaultTools[e] = t
},
registerFormat: function (e, t) {
x.fn.options.formats[e] = t
},
createDialog: function (t, n, i) {
var o = r.support.isRtl(n.wrapper),
a = e(t).appendTo(document.body).kendoWindow(i);
return o && a.closest(".k-window").addClass("k-rtl"), a
}
}, g = h.select,
m = h.focusable,
v = h.wrapTextarea,
_ = h.renderTools,
b = h.initializeContentElement,
y = {
bold: "Bold",
italic: "Italic",
underline: "Underline",
strikethrough: "Strikethrough",
superscript: "Superscript",
subscript: "Subscript",
justifyCenter: "Center text",
justifyLeft: "Align text left",
justifyRight: "Align text right",
justifyFull: "Justify",
insertUnorderedList: "Insert unordered list",
insertOrderedList: "Insert ordered list",
indent: "Indent",
outdent: "Outdent",
createLink: "Insert hyperlink",
unlink: "Remove hyperlink",
insertImage: "Insert image",
insertHtml: "Insert HTML",
viewHtml: "View HTML",
fontName: "Select font family",
fontNameInherit: "(inherited font)",
fontSize: "Select font size",
fontSizeInherit: "(inherited size)",
formatBlock: "Format",
foreColor: "Color",
backColor: "Background color",
style: "Styles",
emptyFolder: "Empty Folder",
uploadFile: "Upload",
orderBy: "Arrange by:",
orderBySize: "Size",
orderByName: "Name",
invalidFileType: 'The selected file "{0}" is not valid. Supported file types are {1}.',
deleteFile: 'Are you sure you want to delete "{0}"?',
overwriteFile: 'A file with name "{0}" already exists in the current directory. Do you want to overwrite it?',
directoryNotFound: "A directory with this name was not found.",
imageWebAddress: "Web address",
imageAltText: "Alternate text",
linkWebAddress: "Web address",
linkText: "Text",
linkToolTip: "ToolTip",
linkOpenInNewWindow: "Open link in new window",
dialogUpdate: "Update",
dialogInsert: "Insert",
dialogButtonSeparator: "or",
dialogCancel: "Cancel"
}, w = !s || s.ios && s.flatVersion >= 500 || !s.ios && document.documentElement.contentEditable !== t,
x = a.extend({
init: function (t, n) {
function i(t) {
var n = e.grep(t.className.split(" "), function (e) {
return !/^k-(widget|tool-icon|state-hover|header|combobox|dropdown|selectbox|colorpicker)$/i.test(e)
});
return n[0] ? n[0].substring(n[0].lastIndexOf("-") + 1) : "custom"
}
function o(e, t) {
if (!t.key) return e;
var n = e + " (";
return t.ctrl && (n += "Ctrl + "), t.shift && (n += "Shift + "), t.alt && (n += "Alt + "), n += t.key + ")"
}
var s, l, d, f, h, g, x, k, C;
if (w) {
d = this, f = r.ui.editor, a.fn.init.call(d, t, n), d.tools = c({}, r.ui.Editor.defaultTools), d.options = c({}, d.options, n), t = e(t), t.closest("form").on("submit" + u, function () {
d.update()
});
for (h in d.tools) d.tools[h].name = h.toLowerCase();
d.textarea = t.attr("autocomplete", "off")[0], s = d.wrapper = v(t), d.textarea.id && s.find(".k-editor-toolbar").attr("aria-controls", d.textarea.id), _(d, d.options.tools), b(d), d.keyboard = new f.Keyboard([new f.TypingHandler(d), new f.SystemHandler(d)]), d.clipboard = new f.Clipboard(this), d.pendingFormats = new f.PendingFormats(this), d.undoRedoStack = new f.UndoRedoStack, l = n && n.value ? n.value : t.val().replace(/[\r\n\v\f\t ]+/gi, " "), d.value(l), g = ".k-editor-toolbar > li > *, .k-editor-toolbar > li select", x = ".k-editor-button .k-tool-icon", k = x + ":not(.k-state-disabled)", C = x + ".k-state-disabled", s.find(".k-combobox .k-input").keydown(function (t) {
var n = e(this).closest(".k-combobox").data("kendoComboBox"),
i = t.keyCode;
i == p.RIGHT || i == p.LEFT ? n.close() : i == p.DOWN && (n.dropDown.isOpened() || (t.stopImmediatePropagation(), n.open()))
}), s.on("mouseenter" + u, k, function () {
e(this).addClass("k-state-hover")
}).on("mouseleave" + u, k, function () {
e(this).removeClass("k-state-hover")
}).on("mousedown" + u, x, !1).on("keydown" + u, m, function (t) {
var n, i = e(this).closest("li"),
r = "li:has(" + m + ")",
o = t.keyCode;
if (o == p.RIGHT) n = i.nextAll(r).first().find(m);
else if (o == p.LEFT) n = i.prevAll(r).first().find(m);
else if (o == p.ESC) n = d;
else if (o == p.TAB && !t.ctrlKey && !t.altKey)
if (t.shiftKey) {
if (n = i.prevAll(r).first().find(m), !n.length) return;
t.preventDefault()
} else t.preventDefault(), n = i.nextAll(r).first().find(m), n.length || (n = d);
n && n.focus()
}).on("click" + u, k, function (t) {
t.preventDefault(), t.stopPropagation(), e(this).removeClass("k-state-hover"), d.exec(i(this))
}).on("click" + u, C, function (e) {
e.preventDefault()
}).find(g).each(function () {
var t, n = i(this),
r = d.options,
a = r.tools[n],
s = r.messages[n],
l = e(this);
a && (("fontSize" == n || "fontName" == n) && (t = r.messages[n + "Inherit"] || y[n + "Inherit"], l.find("input").val(t).end().find("span.k-input").text(t).end()), a.initialize(l, {
title: o(s, a),
editor: d
}))
}), d.bind("select", function () {
var t = d.getRange(),
n = f.RangeUtils.textNodes(t);
n.length || (n = [t.startContainer]), s.find(g).each(function () {
var t = d.options.tools[i(this)];
t && t.update(e(this), n, d.pendingFormats)
})
}), d._DOMNodeInsertedHandler = function (e) {
d._DOMNodeInserted(e)
}, d._endTypingHandler = function () {
d._endTyping()
}, e(document).on("DOMNodeInserted", d._DOMNodeInsertedHandler).on("mousedown", d._endTypingHandler), r.notify(d)
}
},
_endTyping: function () {
var e = this;
try {
e.keyboard.isTypingInProgress() && e.keyboard.endTyping(!0), e.selectionRestorePoint || (e.selectionRestorePoint = new r.ui.editor.RestorePoint(e.getRange()))
} catch (t) {}
},
_DOMNodeInserted: function (t) {
var n = this.wrapper;
(e.contains(t.target, n[0]) || n[0] == t.target) && this.refresh()
},
refresh: function () {
var e = this;
e.textarea.value = e.value(), e.wrapper.find("iframe").remove(), b(e), e.value(e.textarea.value)
},
events: ["select", "change", "execute", "error", "paste", "keydown", "keyup"],
options: {
name: "Editor",
messages: y,
formats: {},
encoded: !0,
stylesheets: [],
dialogOptions: {
modal: !0,
resizable: !1,
draggable: !0,
animation: !1
},
fontName: [{
text: "Arial",
value: "Arial,Helvetica,sans-serif"
}, {
text: "Courier New",
value: "'Courier New',Courier,monospace"
}, {
text: "Georgia",
value: "Georgia,serif"
}, {
text: "Impact",
value: "Impact,Charcoal,sans-serif"
}, {
text: "Lucida Console",
value: "'Lucida Console',Monaco,monospace"
}, {
text: "Tahoma",
value: "Tahoma,Geneva,sans-serif"
}, {
text: "Times New Roman",
value: "'Times New Roman',Times,serif"
}, {
text: "Trebuchet MS",
value: "'Trebuchet MS',Helvetica,sans-serif"
}, {
text: "Verdana",
value: "Verdana,Geneva,sans-serif"
}],
fontSize: [{
text: "1 (8pt)",
value: "xx-small"
}, {
text: "2 (10pt)",
value: "x-small"
}, {
text: "3 (12pt)",
value: "small"
}, {
text: "4 (14pt)",
value: "medium"
}, {
text: "5 (18pt)",
value: "large"
}, {
text: "6 (24pt)",
value: "x-large"
}, {
text: "7 (36pt)",
value: "xx-large"
}],
formatBlock: [{
text: "Paragraph",
value: "p"
}, {
text: "Quotation",
value: "blockquote"
}, {
text: "Heading 1",
value: "h1"
}, {
text: "Heading 2",
value: "h2"
}, {
text: "Heading 3",
value: "h3"
}, {
text: "Heading 4",
value: "h4"
}, {
text: "Heading 5",
value: "h5"
}, {
text: "Heading 6",
value: "h6"
}],
tools: ["bold", "italic", "underline", "strikethrough", "fontName", "fontSize", "foreColor", "backColor", "justifyLeft", "justifyCenter", "justifyRight", "justifyFull", "insertUnorderedList", "insertOrderedList", "indent", "outdent", "formatBlock", "createLink", "unlink", "insertImage"]
},
destroy: function () {
var t = this;
a.fn.destroy.call(t), e(t.window).add(t.document).add(t.wrapper).add(t.element.closest("form")).off(u), e(document).off("DOMNodeInserted", t._DOMNodeInsertedHandler).off("mousedown", t._endTypingHandler), r.destroy(t.wrapper)
},
_nativeTools: ["insertLineBreak", "insertParagraph", "redo", "undo", "insertHtml"],
tools: {},
value: function (n) {
var i, o, a, s = this.body,
d = r.ui.editor.Dom,
c = r.ui.editor.Serializer.domToXhtml(s);
return n === t ? c : (n != c && (this.pendingFormats.clear(), i = /onerror\s*=\s*(?:'|")?([^'">\s]*)(?:'|")?/i, n = (n || "").replace(//g, "").replace(/")
}
},
b: {
start: function () {
p.push("")
},
end: function () {
p.push("")
}
},
i: {
start: function () {
p.push("")
},
end: function () {
p.push("")
}
},
u: {
start: function () {
p.push('')
},
end: function () {
p.push("")
}
},
iframe: {
start: function (e) {
p.push("")
}
},
font: {
start: function (e) {
var t, n, i;
p.push('')
},
end: function () {
p.push("")
}
}
};
return 1 == n.childNodes.length && 3 == n.firstChild.nodeType ? r.encode(n.firstChild.nodeValue.replace(/[\r\n\v\f\t ]+/, " ")) : (o(n), p = p.join(""), "" === p.replace(l, "").replace(d, "") ? "" : p)
}
};
o(i, {
Serializer: u
})
}(window.kendo.jQuery),
function (e) {
function t(e, t, n, i) {
var r, o, a, s;
if (e == t) return i - n;
for (r = t; r && r.parentNode != e;) r = r.parentNode;
if (r) return f(r) - n;
for (r = e; r && r.parentNode != t;) r = r.parentNode;
if (r) return i - f(r) - 1;
for (o = p.commonAncestor(e, t), a = e; a && a.parentNode != o;) a = a.parentNode;
for (a || (a = o), s = t; s && s.parentNode != o;) s = s.parentNode;
return s || (s = o), a == s ? 0 : f(s) - f(a)
}
function n(e, n) {
function i(e) {
try {
return 0 > t(e.startContainer, e.endContainer, e.startOffset, e.endOffset)
} catch (n) {
return !0
}
}
i(e) && (n ? (e.commonAncestorContainer = e.endContainer = e.startContainer, e.endOffset = e.startOffset) : (e.commonAncestorContainer = e.startContainer = e.endContainer, e.startOffset = e.endOffset), e.collapsed = !0)
}
function i(e) {
e.collapsed = e.startContainer == e.endContainer && e.startOffset == e.endOffset;
for (var t = e.startContainer; t && t != e.endContainer && !p.isAncestorOf(t, e.endContainer);) t = t.parentNode;
e.commonAncestorContainer = t
}
function r(e) {
var t = e.duplicate(),
n = e.duplicate();
return t.collapse(!0), n.collapse(!1), p.commonAncestor(e.parentElement(), t.parentElement(), n.parentElement())
}
function o(e, t, n) {
var i, r, o = t[n ? "startContainer" : "endContainer"],
a = t[n ? "startOffset" : "endOffset"],
s = 0,
l = h(o),
d = l ? o : o.childNodes[a] || null,
c = l ? o.parentNode : o;
(3 == o.nodeType || 4 == o.nodeType) && (s = a), r = c.insertBefore(p.create(t.ownerDocument, "a"), d), i = t.ownerDocument.body.createTextRange(), i.moveToElementText(r), p.remove(r), i[n ? "moveStart" : "moveEnd"]("character", s), i.collapse(!1), e.setEndPoint(n ? "StartToStart" : "EndToStart", i)
}
function a(e, t, n, i) {
var r, o, a, s, l, d, c, u = p.create(t.ownerDocument, "a"),
g = e.duplicate(),
m = i ? "StartToStart" : "StartToEnd";
u.innerHTML = "", g.collapse(i), o = g.parentElement(), p.isAncestorOrSelf(n, o) || (o = n);
do o.insertBefore(u, u.previousSibling), g.moveToElementText(u); while ((r = g.compareEndPoints(m, e)) > 0 && u.previousSibling);
a = u.nextSibling, -1 == r && h(a) ? (g.setEndPoint(i ? "EndToStart" : "EndToEnd", e), p.remove(u), d = [a, g.text.length]) : (s = !i && u.previousSibling, l = i && u.nextSibling, h(l) ? d = [l, 0] : h(s) ? d = [s, s.length] : (c = f(u), d = o.nextSibling && c == o.childNodes.length - 1 ? [o.nextSibling, 0] : [o, c]), p.remove(u)), t[i ? "setStart" : "setEnd"].apply(t, d)
}
var s = window.kendo,
l = s.Class,
d = e.extend,
c = s.ui.editor,
u = s.support.browser,
p = c.Dom,
f = p.findNodeIndex,
h = p.isDataNode,
g = p.findClosestAncestor,
m = p.getNodeLength,
v = p.normalize,
_ = {
selectionFromWindow: function (e) {
return "getSelection" in e ? e.getSelection() : new w(e.document)
},
selectionFromRange: function (e) {
var t = S.documentFromRange(e);
return _.selectionFromDocument(t)
},
selectionFromDocument: function (e) {
return _.selectionFromWindow(p.windowFromDocument(e))
}
}, b = l.extend({
init: function (t) {
e.extend(this, {
ownerDocument: t,
startContainer: t,
endContainer: t,
commonAncestorContainer: t,
startOffset: 0,
endOffset: 0,
collapsed: !0
})
},
setStart: function (e, t) {
this.startContainer = e, this.startOffset = t, i(this), n(this, !0)
},
setEnd: function (e, t) {
this.endContainer = e, this.endOffset = t, i(this), n(this, !1)
},
setStartBefore: function (e) {
this.setStart(e.parentNode, f(e))
},
setStartAfter: function (e) {
this.setStart(e.parentNode, f(e) + 1)
},
setEndBefore: function (e) {
this.setEnd(e.parentNode, f(e))
},
setEndAfter: function (e) {
this.setEnd(e.parentNode, f(e) + 1)
},
selectNode: function (e) {
this.setStartBefore(e), this.setEndAfter(e)
},
selectNodeContents: function (e) {
this.setStart(e, 0), this.setEnd(e, e[1 === e.nodeType ? "childNodes" : "nodeValue"].length)
},
collapse: function (e) {
var t = this;
e ? t.setEnd(t.startContainer, t.startOffset) : t.setStart(t.endContainer, t.endOffset)
},
deleteContents: function () {
var e = this,
t = e.cloneRange();
e.startContainer != e.commonAncestorContainer && e.setStartAfter(g(e.commonAncestorContainer, e.startContainer)), e.collapse(!0),
function n(e) {
for (; e.next();) e.hasPartialSubtree() ? n(e.getSubtreeIterator()) : e.remove()
}(new y(t))
},
cloneContents: function () {
var e = S.documentFromRange(this);
return function t(n) {
for (var i, r = e.createDocumentFragment(); i = n.next();) i = i.cloneNode(!n.hasPartialSubtree()), n.hasPartialSubtree() && i.appendChild(t(n.getSubtreeIterator())), r.appendChild(i);
return r
}(new y(this))
},
extractContents: function () {
var e, t = this,
n = t.cloneRange();
return t.startContainer != t.commonAncestorContainer && t.setStartAfter(g(t.commonAncestorContainer, t.startContainer)), t.collapse(!0), e = S.documentFromRange(t),
function i(n) {
for (var r, o = e.createDocumentFragment(); r = n.next();) n.hasPartialSubtree() ? (r = r.cloneNode(!1), r.appendChild(i(n.getSubtreeIterator()))) : n.remove(t.originalRange), o.appendChild(r);
return o
}(new y(n))
},
insertNode: function (e) {
var t = this;
h(t.startContainer) ? (t.startOffset != t.startContainer.nodeValue.length && p.splitDataNode(t.startContainer, t.startOffset), p.insertAfter(e, t.startContainer)) : p.insertAt(t.startContainer, e, t.startOffset), t.setStart(t.startContainer, t.startOffset)
},
cloneRange: function () {
return e.extend(new b(this.ownerDocument), {
startContainer: this.startContainer,
endContainer: this.endContainer,
commonAncestorContainer: this.commonAncestorContainer,
startOffset: this.startOffset,
endOffset: this.endOffset,
collapsed: this.collapsed,
originalRange: this
})
},
toString: function () {
var e = this.startContainer.nodeName,
t = this.endContainer.nodeName;
return ["#text" == e ? this.startContainer.nodeValue : e, "(", this.startOffset, ") : ", "#text" == t ? this.endContainer.nodeValue : t, "(", this.endOffset, ")"].join("")
}
}),
y = l.extend({
init: function (t) {
if (e.extend(this, {
range: t,
_current: null,
_next: null,
_end: null
}), !t.collapsed) {
var n = t.commonAncestorContainer;
this._next = t.startContainer != n || h(t.startContainer) ? g(n, t.startContainer) : t.startContainer.childNodes[t.startOffset], this._end = t.endContainer != n || h(t.endContainer) ? g(n, t.endContainer).nextSibling : t.endContainer.childNodes[t.endOffset]
}
},
hasNext: function () {
return !!this._next
},
next: function () {
var e = this,
t = e._current = e._next;
return e._next = e._current && e._current.nextSibling != e._end ? e._current.nextSibling : null, h(e._current) && (e.range.endContainer == e._current && (t = t.cloneNode(!0), t.deleteData(e.range.endOffset, t.length - e.range.endOffset)), e.range.startContainer == e._current && (t = t.cloneNode(!0), t.deleteData(0, e.range.startOffset))), t
},
traverse: function (e) {
function t() {
return i._current = i._next, i._next = i._current && i._current.nextSibling != i._end ? i._current.nextSibling : null, i._current
}
for (var n, i = this; n = t();) i.hasPartialSubtree() ? i.getSubtreeIterator().traverse(e) : e(n);
return n
},
remove: function (e) {
var t, n, i, r, o, a = this,
s = a.range.startContainer == a._current,
l = a.range.endContainer == a._current;
h(a._current) && (s || l) ? (t = s ? a.range.startOffset : 0, n = l ? a.range.endOffset : a._current.length, i = n - t, e && (s || l) && (a._current == e.startContainer && e.startOffset >= t && (e.startOffset -= i), a._current == e.endContainer && e.endOffset >= n && (e.endOffset -= i)), a._current.deleteData(t, i)) : (r = a._current.parentNode, !e || a.range.startContainer != r && a.range.endContainer != r || (o = f(a._current), r == e.startContainer && e.startOffset >= o && (e.startOffset -= 1), r == e.endContainer && e.endOffset > o && (e.endOffset -= 1)), p.remove(a._current))
},
hasPartialSubtree: function () {
return !h(this._current) && (p.isAncestorOrSelf(this._current, this.range.startContainer) || p.isAncestorOrSelf(this._current, this.range.endContainer))
},
getSubtreeIterator: function () {
var e = this,
t = e.range.cloneRange();
return t.selectNodeContents(e._current), p.isAncestorOrSelf(e._current, e.range.startContainer) && t.setStart(e.range.startContainer, e.range.startOffset), p.isAncestorOrSelf(e._current, e.range.endContainer) && t.setEnd(e.range.endContainer, e.range.endOffset), new y(t)
}
}),
w = l.extend({
init: function (e) {
this.ownerDocument = e, this.rangeCount = 1
},
addRange: function (e) {
var t = this.ownerDocument.body.createTextRange();
o(t, e, !1), o(t, e, !0), t.select()
},
removeAllRanges: function () {
this.ownerDocument.selection.empty()
},
getRangeAt: function () {
var e, t, n, i, o, s, l, d, c = new b(this.ownerDocument),
u = this.ownerDocument.selection;
try {
if (e = u.createRange(), t = e.item ? e.item(0) : e.parentElement(), t.ownerDocument != this.ownerDocument) return c
} catch (p) {
return c
}
if ("Control" == u.type) c.selectNode(e.item(0));
else if (n = r(e), a(e, c, n, !0), a(e, c, n, !1), 9 == c.startContainer.nodeType && c.setStart(c.endContainer, c.startOffset), 9 == c.endContainer.nodeType && c.setEnd(c.startContainer, c.endOffset), 0 === e.compareEndPoints("StartToEnd", e) && c.collapse(!1), i = c.startContainer, o = c.endContainer, s = this.ownerDocument.body, !(c.collapsed || 0 !== c.startOffset || c.endOffset != m(c.endContainer) || i == o && h(i) && i.parentNode == s)) {
for (l = !1, d = !1; 0 === f(i) && i == i.parentNode.firstChild && i != s;) i = i.parentNode, l = !0;
for (; f(o) == m(o.parentNode) - 1 && o == o.parentNode.lastChild && o != s;) o = o.parentNode, d = !0;
i == s && o == s && l && d && (c.setStart(i, 0), c.setEnd(o, m(s)))
}
return c
}
}),
x = l.extend({
init: function (e) {
this.enumerate = function () {
function t(e) {
if (p.is(e, "img") || 3 == e.nodeType && !p.isWhitespace(e)) n.push(e);
else
for (e = e.firstChild; e;) t(e), e = e.nextSibling
}
var n = [];
return new y(e).traverse(t), n
}
}
}),
k = l.extend({
init: function (e) {
var t = this;
t.range = e, t.rootNode = S.documentFromRange(e), t.body = t.rootNode.body, t.html = t.body.innerHTML, t.startContainer = t.nodeToPath(e.startContainer), t.endContainer = t.nodeToPath(e.endContainer), t.startOffset = t.offset(e.startContainer, e.startOffset), t.endOffset = t.offset(e.endContainer, e.endOffset)
},
index: function (e) {
for (var t, n = 0, i = e.nodeType; e = e.previousSibling;) t = e.nodeType, (3 != t || i != t) && n++, i = t;
return n
},
offset: function (e, t) {
if (3 == e.nodeType)
for (;
(e = e.previousSibling) && 3 == e.nodeType;) t += e.nodeValue.length;
return t
},
nodeToPath: function (e) {
for (var t = []; e != this.rootNode;) t.push(this.index(e)), e = e.parentNode;
return t
},
toRangePoint: function (e, t, n, i) {
for (var r = this.rootNode, o = n.length, a = i; o--;) r = r.childNodes[n[o]];
for (; 3 == r.nodeType && a > r.nodeValue.length;) a -= r.nodeValue.length, r = r.nextSibling;
e[t ? "setStart" : "setEnd"](r, a)
},
toRange: function () {
var e = this,
t = e.range.cloneRange();
return e.toRangePoint(t, !0, e.startContainer, e.startOffset), e.toRangePoint(t, !1, e.endContainer, e.endOffset), t
}
}),
C = l.extend({
init: function () {
this.caret = null
},
addCaret: function (e) {
var t = this;
return t.caret = p.create(S.documentFromRange(e), "span", {
className: "k-marker"
}), e.insertNode(t.caret), e.selectNode(t.caret), t.caret
},
removeCaret: function (e) {
var t, n, i, r, o = this,
a = o.caret.previousSibling,
s = 0;
a && (s = h(a) ? a.nodeValue.length : f(a)), t = o.caret.parentNode, n = a ? f(a) : 0, p.remove(o.caret), v(t), i = t.childNodes[n], h(i) ? e.setStart(i, s) : i ? (r = p.lastTextNode(i), r ? e.setStart(r, r.nodeValue.length) : e[a ? "setStartAfter" : "setStartBefore"](i)) : (u.msie || t.innerHTML || (t.innerHTML = ' '), e.selectNodeContents(t)), e.collapse(!0)
},
add: function (e, t) {
var n, i = this;
return t && e.collapsed && (i.addCaret(e), e = S.expand(e)), n = e.cloneRange(), n.collapse(!1), i.end = p.create(S.documentFromRange(e), "span", {
className: "k-marker"
}), n.insertNode(i.end), n = e.cloneRange(), n.collapse(!0), i.start = i.end.cloneNode(!0), n.insertNode(i.start), e.setStartBefore(i.start), e.setEndAfter(i.end), v(e.commonAncestorContainer), e
},
remove: function (e) {
var t, n, i, r, o, a, s, l, d, c, u, g, m, _ = this,
b = _.start,
y = _.end;
for (v(e.commonAncestorContainer); !b.nextSibling && b.parentNode;) b = b.parentNode;
for (; !y.previousSibling && y.parentNode;) y = y.parentNode;
if (t = b.previousSibling && 3 == b.previousSibling.nodeType && b.nextSibling && 3 == b.nextSibling.nodeType, n = y.previousSibling && 3 == y.previousSibling.nodeType && y.nextSibling && 3 == y.nextSibling.nodeType, i = t && n, b = b.nextSibling, y = y.previousSibling, r = !1, o = !1, b == _.end && (o = !! _.start.previousSibling, b = y = _.start.previousSibling || _.end.nextSibling, r = !0), p.remove(_.start), p.remove(_.end), !b || !y) return e.selectNodeContents(e.commonAncestorContainer), e.collapse(!0), void 0;
if (a = r ? h(b) ? b.nodeValue.length : b.childNodes.length : 0, s = h(y) ? y.nodeValue.length : y.childNodes.length, 3 == b.nodeType)
for (; b.previousSibling && 3 == b.previousSibling.nodeType;) b = b.previousSibling, a += b.nodeValue.length;
if (3 == y.nodeType)
for (; y.previousSibling && 3 == y.previousSibling.nodeType;) y = y.previousSibling, s += y.nodeValue.length;
for (l = f(b), d = b.parentNode, c = f(y), u = y.parentNode, g = b; g.previousSibling; g = g.previousSibling) 3 == g.nodeType && 3 == g.previousSibling.nodeType && l--;
for (m = y; m.previousSibling; m = m.previousSibling) 3 == m.nodeType && 3 == m.previousSibling.nodeType && c--;
v(d), 3 == b.nodeType && (b = d.childNodes[l]), v(u), 3 == y.nodeType && (y = u.childNodes[c]), r ? (3 == b.nodeType ? e.setStart(b, a) : e[o ? "setStartAfter" : "setStartBefore"](b), e.collapse(!0)) : (3 == b.nodeType ? e.setStart(b, a) : e.setStartBefore(b), 3 == y.nodeType ? e.setEnd(y, s) : e.setEndAfter(y)), _.caret && _.removeCaret(e)
}
}),
T = /[\u0009-\u000d]|\u0020|\u00a0|\ufeff|\.|,|;|:|!|\(|\)|\?/,
S = {
nodes: function (e) {
var t = S.textNodes(e);
return t.length || (e.selectNodeContents(e.commonAncestorContainer), t = S.textNodes(e), t.length || (t = p.significantChildNodes(e.commonAncestorContainer))), t
},
textNodes: function (e) {
return new x(e).enumerate()
},
documentFromRange: function (e) {
var t = e.startContainer;
return 9 == t.nodeType ? t : t.ownerDocument
},
createRange: function (e) {
return u.msie && 9 > u.version ? new b(e) : e.createRange()
},
selectRange: function (e) {
var t, n = S.image(e);
n && (e.setStartAfter(n), e.setEndAfter(n)), t = _.selectionFromRange(e), t.removeAllRanges(), t.addRange(e)
},
split: function (e, t, n) {
function i(i) {
var r, o = e.cloneRange();
o.collapse(i), o[i ? "setStartBefore" : "setEndAfter"](t), r = o.extractContents(), n && (r = p.trim(r)), p[i ? "insertBefore" : "insertAfter"](r, t)
}
i(!0), i(!1)
},
getMarkers: function (e) {
var t = [];
return new y(e).traverse(function (e) {
"k-marker" == e.className && t.push(e)
}), t
},
image: function (e) {
var t = [];
return new y(e).traverse(function (e) {
p.is(e, "img") && t.push(e)
}), 1 == t.length ? t[0] : void 0
},
expand: function (e) {
var t, n, i, r, o = e.cloneRange(),
a = o.startContainer.childNodes[0 === o.startOffset ? 0 : o.startOffset - 1],
s = o.endContainer.childNodes[o.endOffset];
return h(a) && h(s) ? (t = a.nodeValue, n = s.nodeValue, t && n ? (i = t.split("").reverse().join("").search(T), r = n.search(T), i && r ? (r = -1 == r ? n.length : r, i = -1 == i ? 0 : t.length - i, o.setStart(a, i), o.setEnd(s, r), o) : o) : o) : o
},
isExpandable: function (e) {
var t, n, i, r, o, a, s = e.startContainer,
l = S.documentFromRange(e);
return s == l || s == l.body ? !1 : (t = e.cloneRange(), (n = s.nodeValue) ? (i = n.substring(0, t.startOffset), r = n.substring(t.startOffset), o = 0, a = 0, i && (o = i.split("").reverse().join("").search(T)), r && (a = r.search(T)), o && a) : !1)
}
};
d(c, {
SelectionUtils: _,
W3CRange: b,
RangeIterator: y,
W3CSelection: w,
RangeEnumerator: x,
RestorePoint: k,
Marker: C,
RangeUtils: S
})
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.Class,
i = t.ui.editor,
r = i.EditorUtils,
o = r.registerTool,
a = i.Dom,
s = i.RangeUtils,
l = s.selectRange,
d = i.Tool,
c = i.ToolTemplate,
u = i.RestorePoint,
p = i.Marker,
f = e.extend,
h = n.extend({
init: function (e) {
var t = this;
t.options = e, t.restorePoint = new u(e.range), t.marker = new p, t.formatter = e.formatter
},
getRange: function () {
return this.restorePoint.toRange()
},
lockRange: function (e) {
return this.marker.add(this.getRange(), e)
},
releaseRange: function (e) {
this.marker.remove(e), l(e)
},
undo: function () {
var e = this.restorePoint;
e.body.innerHTML = e.html, l(e.toRange())
},
redo: function () {
this.exec()
},
exec: function () {
var e = this,
t = e.lockRange(!0);
e.formatter.editor = e.editor, e.formatter.toggle(t), e.releaseRange(t)
}
}),
g = n.extend({
init: function (e, t) {
this.body = e.body, this.startRestorePoint = e, this.endRestorePoint = t
},
redo: function () {
this.body.innerHTML = this.endRestorePoint.html, l(this.endRestorePoint.toRange())
},
undo: function () {
this.body.innerHTML = this.startRestorePoint.html, l(this.startRestorePoint.toRange())
}
}),
m = h.extend({
init: function (e) {
h.fn.init.call(this, e), this.managesUndoRedo = !0
},
exec: function () {
var e = this.editor,
t = e.getRange(),
n = new u(t);
e.clipboard.paste(this.options.value || ""), e.undoRedoStack.push(new g(n, new u(e.getRange()))), e.focus()
}
}),
v = d.extend({
initialize: function (e, t) {
var n = t.editor,
r = this.options,
o = r.items ? r.items : n.options.insertHtml;
new i.SelectBox(e, {
dataSource: o,
dataTextField: "text",
dataValueField: "value",
change: function () {
d.exec(n, "insertHtml", this.value())
},
title: n.options.messages.insertHtml,
highlightFirst: !1
})
},
command: function (e) {
return new m(e)
},
update: function (e) {
var t = e.data("kendoSelectBox") || e.find("select").data("kendoSelectBox");
t.close(), t.value(t.options.title)
}
}),
_ = n.extend({
init: function () {
this.stack = [], this.currentCommandIndex = -1
},
push: function (e) {
var t = this;
t.stack = t.stack.slice(0, t.currentCommandIndex + 1), t.currentCommandIndex = t.stack.push(e) - 1
},
undo: function () {
this.canUndo() && this.stack[this.currentCommandIndex--].undo()
},
redo: function () {
this.canRedo() && this.stack[++this.currentCommandIndex].redo()
},
canUndo: function () {
return this.currentCommandIndex >= 0
},
canRedo: function () {
return this.currentCommandIndex != this.stack.length - 1
}
}),
b = n.extend({
init: function (e) {
this.editor = e
},
keydown: function (t) {
var n, i = this,
r = i.editor,
o = r.keyboard,
a = o.isTypingKey(t),
s = f(e.Event(), t);
return i.editor.trigger("keydown", s), s.isDefaultPrevented() && t.preventDefault(), s.isDefaultPrevented() || !a || o.isTypingInProgress() ? !1 : (n = r.getRange(), i.startRestorePoint = new u(n), o.startTyping(function () {
r.selectionRestorePoint = i.endRestorePoint = new u(r.getRange()), r.undoRedoStack.push(new g(i.startRestorePoint, i.endRestorePoint))
}), !0)
},
keyup: function (e) {
var t = this.editor.keyboard;
return this.editor.trigger("keyup", e), t.isTypingInProgress() ? (t.endTyping(), !0) : !1
}
}),
y = n.extend({
init: function (e) {
this.editor = e, this.systemCommandIsInProgress = !1
},
createUndoCommand: function () {
var e = this;
e.endRestorePoint = new u(e.editor.getRange()), e.editor.undoRedoStack.push(new g(e.startRestorePoint, e.endRestorePoint)), e.startRestorePoint = e.endRestorePoint
},
changed: function () {
return this.startRestorePoint ? this.startRestorePoint.html != this.editor.body.innerHTML : !1
},
keydown: function (e) {
var t = this,
n = t.editor,
i = n.keyboard;
return i.isModifierKey(e) ? (i.isTypingInProgress() && i.endTyping(!0), t.startRestorePoint = new u(n.getRange()), !0) : i.isSystem(e) ? (t.systemCommandIsInProgress = !0, t.changed() && (t.systemCommandIsInProgress = !1, t.createUndoCommand()), !0) : !1
},
keyup: function (e) {
var t = this;
return t.systemCommandIsInProgress && t.changed() ? (t.systemCommandIsInProgress = !1, t.createUndoCommand(e), !0) : !1
}
}),
w = n.extend({
init: function (e) {
this.handlers = e, this.typingInProgress = !1
},
isCharacter: function (e) {
return e >= 48 && 90 >= e || e >= 96 && 111 >= e || e >= 186 && 192 >= e || e >= 219 && 222 >= e
},
toolFromShortcut: function (t, n) {
var i, r, o = String.fromCharCode(n.keyCode);
for (i in t)
if (r = e.extend({
ctrl: !1,
alt: !1,
shift: !1
}, t[i].options), (r.key == o || r.key == n.keyCode) && r.ctrl == n.ctrlKey && r.alt == n.altKey && r.shift == n.shiftKey) return i
},
isTypingKey: function (e) {
var t = e.keyCode;
return this.isCharacter(t) && !e.ctrlKey && !e.altKey || 32 == t || 13 == t || 8 == t || 46 == t && !e.shiftKey && !e.ctrlKey && !e.altKey
},
isModifierKey: function (e) {
var t = e.keyCode;
return 17 == t && !e.shiftKey && !e.altKey || 16 == t && !e.ctrlKey && !e.altKey || 18 == t && !e.ctrlKey && !e.shiftKey
},
isSystem: function (e) {
return 46 == e.keyCode && e.ctrlKey && !e.altKey && !e.shiftKey
},
startTyping: function (e) {
this.onEndTyping = e, this.typingInProgress = !0
},
stopTyping: function () {
this.typingInProgress = !1, this.onEndTyping && this.onEndTyping()
},
endTyping: function (t) {
var n = this;
n.clearTimeout(), t ? n.stopTyping() : n.timeout = window.setTimeout(e.proxy(n.stopTyping, n), 1e3)
},
isTypingInProgress: function () {
return this.typingInProgress
},
clearTimeout: function () {
window.clearTimeout(this.timeout)
},
notify: function (e, t) {
var n, i = this.handlers;
for (n = 0; i.length > n && !i[n][t](e); n++);
},
keydown: function (e) {
this.notify(e, "keydown")
},
keyup: function (e) {
this.notify(e, "keyup")
}
}),
x = n.extend({
init: function (e) {
this.editor = e, this.cleaners = [new C, new T]
},
htmlToFragment: function (e) {
var t = this.editor,
n = t.document,
i = a.create(n, "div"),
r = n.createDocumentFragment();
for (i.innerHTML = e; i.firstChild;) r.appendChild(i.firstChild);
return r
},
isBlock: function (e) {
return /<(div|p|ul|ol|table|h[1-6])/i.test(e)
},
oncut: function () {
var e = this.editor,
t = new u(e.getRange());
setTimeout(function () {
e.undoRedoStack.push(new g(t, new u(e.getRange())))
})
},
onpaste: function (t) {
var n, r, o, s = this.editor,
d = s.getRange(),
c = "",
p = new u(d),
f = a.create(s.document, "div", {
className: "k-paste-container",
innerHTML: c
});
a.persistScrollTop(s.document), s.body.appendChild(f), s.body.createTextRange ? (t.preventDefault(), n = s.createRange(), n.selectNodeContents(f), s.selectRange(n), r = s.body.createTextRange(), r.moveToElementText(f), e(s.body).unbind("paste"), r.execCommand("Paste"), e(s.body).bind("paste", e.proxy(arguments.callee, this))) : (o = s.createRange(), o.selectNodeContents(f), l(o)), d.deleteContents(), setTimeout(function () {
var e, t = {
html: ""
};
l(d), f.parentNode || (f = s.body.lastChild), a.remove(f), f.lastChild && a.is(f.lastChild, "br") && a.remove(f.lastChild), e = f.innerHTML, e != c && (t.html = e), s.trigger("paste", t), s.clipboard.paste(t.html, !0), s.undoRedoStack.push(new g(p, new u(s.getRange()))), i.EditorUtils.select(s)
})
},
splittableParent: function (e, t) {
var n, i;
if (e) return a.parentOfType(t, ["p", "ul", "ol"]) || t.parentNode;
if (n = t.parentNode, i = t.ownerDocument.body, a.isInline(n))
for (; n.parentNode != i && !a.isBlock(n.parentNode);) n = n.parentNode;
return n
},
paste: function (e, t) {
var n, i, r, o, d, c, u, f, h, g, m = this.editor;
for (n = 0, i = this.cleaners.length; i > n; n++) this.cleaners[n].applicable(e) && (e = this.cleaners[n].clean(e));
if (t && (e = e.replace(/( (\s| )*)+(<\/?(div|p|li|col|t))/gi, "$3"), e = e.replace(/<(a|span)[^>]*><\/\1>/gi, "")), e = e.replace(/^
$/g, "li>"), r = this.isBlock(e), o = m.getRange(), o.deleteContents(), o.startContainer == m.document && o.selectNodeContents(m.body), d = new p, c = d.addCaret(o), u = this.splittableParent(r, c), f = !1, /body|td/.test(a.name(u)) || !r && !a.isInline(u) || (o.selectNode(c), s.split(o, u, !0), f = !0), h = this.htmlToFragment(e), h.firstChild && "k-paste-container" === h.firstChild.className) {
for (g = [], n = 0, i = h.childNodes.length; i > n; n++) g.push(h.childNodes[n].innerHTML);
h = this.htmlToFragment(g.join(" "))
}
if (o.insertNode(h), u = this.splittableParent(r, c), f) {
for (; c.parentNode != u;) a.unwrap(c.parentNode);
a.unwrap(c.parentNode)
}
a.normalize(o.commonAncestorContainer), c.style.display = "inline", a.restoreScrollTop(m.document), a.scrollTo(c), d.removeCaret(o), l(o)
}
}),
k = n.extend({
clean: function (e) {
var t, n, i = this,
r = i.replacements;
for (t = 0, n = r.length; n > t; t += 2) e = e.replace(r[t], r[t + 1]);
return e
}
}),
C = k.extend({
init: function () {
this.replacements = [/<\?xml[^>]*>/gi, "", //g, "", /"/g, "'", /(?: [\s\r\n]+| )*(<\/?(h[1-6]|hr|p|div|table|tbody|thead|tfoot|th|tr|td|li|ol|ul|caption|address|pre|form|blockquote|dl|dt|dd|dir|fieldset)[^>]*>)(?: [\s\r\n]+| )*/g, "$1", /
')({
messages: this.editor.options.messages,
showBrowser: e
})
},
redo: function () {
var e = this,
t = e.lockRange();
e.insertImage(d.image(t), t) || e.releaseRange(t)
},
exec: function () {
function r(e) {
var t = c.element;
g.attributes = {
src: t.find(p).val().replace(/ /g, "%20"),
alt: t.find(f).val()
}, v = g.insertImage(_, m), s(e), g.change && g.change()
}
function s(e) {
e.preventDefault(), c.destroy(), a.windowFromDocument(d.documentFromRange(m)).focus(), v || g.releaseRange(m)
}
function l(e) {
e.keyCode == u.ENTER ? r(e) : e.keyCode == u.ESC && s(e)
}
var c, h, g = this,
m = g.lockRange(),
v = !1,
_ = d.image(m),
b = g.editor.options,
y = b.messages,
w = b.imageBrowser,
x = !! (n.ui.ImageBrowser && w && w.transport && w.transport.read !== t);
h = x ? {
width: "960px",
height: "650px"
} : {}, c = o.createDialog(g._dialogTemplate(x), g.editor, i(h, b.dialogOptions, {
title: y.insertImage,
close: s,
visible: !1,
resizable: x,
activate: function () {
if (x) {
var e = this;
new n.ui.ImageBrowser(e.element.find(".k-imagebrowser"), i({}, w, {
change: function () {
e.element.find(p).val(this.value())
},
apply: r
}))
}
}
})).find(".k-dialog-insert").click(r).end().find(".k-dialog-close").click(s).end().find(".k-form-text-row input").keydown(l).end().find(p).val(_ ? _.getAttribute("src", 2) : "http://").end().find(f).val(_ ? _.alt : "").end().data("kendoWindow").center().open(), e(p, c.element).focus().select()
}
});
n.ui.editor.ImageCommand = h, s("insertImage", new r.Tool({
command: h,
template: new l({
template: o.buttonTemplate,
title: "Insert Image"
})
}))
}(window.kendo.jQuery),
function (e, t) {
var n = window.kendo,
i = n.ui.DropDownList,
r = i.extend({
init: function (e, t) {
var n = this;
i.fn.init.call(n, e, t), n.value(n.options.title)
},
options: {
name: "SelectBox"
},
value: function (e) {
var n = this,
r = i.fn.value.call(n, e);
return e === t ? r : (e !== i.fn.value.call(n) && (n.text(n.options.title), n._current.removeClass("k-state-selected"), n.current(null), n._oldIndex = n.selectedIndex = -1), t)
}
});
n.ui.plugin(r), n.ui.editor.SelectBox = r
}(window.kendo.jQuery),
function (e, t) {
function n(n, i) {
var r = "rtl" == e(n).css("direction"),
o = r ? "Right" : "Left",
a = "td" != s.name(n) ? "margin" + o : "padding" + o;
return i === t ? n.style[a] || 0 : (i > 0 ? n.style[a] = i + "px" : (n.style[a] = "", n.style.cssText || n.removeAttribute("style")), t)
}
var i = window.kendo,
r = i.Class,
o = e.extend,
a = i.ui.editor,
s = a.Dom,
l = a.EditorUtils,
d = l.registerTool,
c = a.Command,
u = a.Tool,
p = a.ToolTemplate,
f = a.RangeUtils,
h = s.blockElements,
g = a.BlockFormatFinder,
m = a.BlockFormatter,
v = r.extend({
init: function () {
this.finder = new g([{
tags: s.blockElements
}])
},
apply: function (t) {
var i, r, o, a, l, d, c, u, p, f, h = this.finder.findSuitable(t),
g = [];
if (h.length) {
for (i = 0, r = h.length; r > i; i++) s.is(h[i], "li") ? e(h[i]).index() ? 0 > e.inArray(h[i].parentNode, g) && g.push(h[i]) : g.push(h[i].parentNode) : g.push(h[i]);
for (; g.length;)
if (o = g.shift(), s.is(o, "li"))
if (a = o.parentNode, l = e(o).prev("li"), d = l.find("ul,ol").last(), c = e(o).children("ul,ol")[0], c && l[0]) d[0] ? (d.append(o), d.append(e(c).children()), s.remove(c)) : (l.append(c), c.insertBefore(o, c.firstChild));
else
for (c = l.children("ul,ol")[0], c || (c = s.create(o.ownerDocument, s.name(a)), l.append(c)); o && o.parentNode == a;) c.appendChild(o), o = g.shift();
else
for (u = parseInt(n(o), 10) + 30, n(o, u), p = 0; g.length > p; p++) e.contains(o, g[p]) && g.splice(p, 1)
} else f = new m([{
tags: "p"
}], {
style: {
marginLeft: 30
}
}), f.apply(t)
},
remove: function (t) {
var i, r, o, a, s, l, d, c, u = this.finder.findSuitable(t);
for (r = 0, o = u.length; o > r; r++) {
if (d = e(u[r]), d.is("li")) {
if (a = d.parent(), s = a.parent(), s.is("li,ul,ol") && !n(a[0])) {
if (i && e.contains(i, s[0])) continue;
l = d.nextAll("li"), l.length && e(a[0].cloneNode(!1)).appendTo(d).append(l), s.is("li") ? d.insertAfter(s) : d.appendTo(s), a.children("li").length || a.remove();
continue
}
if (i == a[0]) continue;
i = a[0]
} else i = u[r];
c = parseInt(n(i), 10) - 30, n(i, c)
}
}
}),
_ = c.extend({
init: function (e) {
e.formatter = {
toggle: function (e) {
(new v).apply(f.nodes(e))
}
}, c.fn.init.call(this, e)
}
}),
b = c.extend({
init: function (e) {
e.formatter = {
toggle: function (e) {
(new v).remove(f.nodes(e))
}
}, c.fn.init.call(this, e)
}
}),
y = u.extend({
init: function (e) {
u.fn.init.call(this, e), this.finder = new g([{
tags: h
}])
},
update: function (i, r) {
var o, a, l, d, c = this.finder.findSuitable(r);
for (l = 0, d = c.length; d > l; l++)
if (o = n(c[l]), o || (a = e(c[l]).parents("ul,ol").length, o = s.is(c[l], "li") && (a > 1 || n(c[l].parentNode)) || s.ofType(c[l], ["ul", "ol"]) && a > 0), o) return i.removeClass("k-state-disabled"), t;
i.addClass("k-state-disabled").removeClass("k-state-hover")
}
});
o(a, {
IndentFormatter: v,
IndentCommand: _,
OutdentCommand: b,
OutdentTool: y
}), d("indent", new u({
command: _,
template: new p({
template: l.buttonTemplate,
title: "Indent"
})
})), d("outdent", new y({
command: b,
template: new p({
template: l.buttonTemplate,
title: "Outdent"
})
}))
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = e.extend,
i = t.ui.editor,
r = i.Dom,
o = i.RangeUtils,
a = i.EditorUtils,
s = i.Command,
l = i.Tool,
d = i.ToolTemplate,
c = s.extend({
init: function (e) {
var t = this;
t.options = e, s.fn.init.call(t, e), t.attributes = null, t.async = !0
},
exec: function () {
function i(e) {
d.value(f.find(g).val()), s(e), l.change && l.change(), d.trigger("change")
}
function s(e) {
e.preventDefault(), f.data("kendoWindow").destroy();
try {
r.windowFromDocument(o.documentFromRange(u)).focus()
} catch (t) {}
}
var l = this,
d = l.editor,
u = d.getRange(),
p = d.options.messages,
f = e(t.template(c.template)(p)).appendTo(document.body),
h = c.indent(d.value()),
g = ".k-editor-textarea";
a.createDialog(f, d, n({}, d.options.dialogOptions, {
title: p.viewHtml,
close: s,
visible: !1
})).find(g).val(h).end().find(".k-dialog-update").click(i).end().find(".k-dialog-close").click(s).end().data("kendoWindow").center().open(), f.find(g).focus()
}
});
n(c, {
template: "
",
indent: function (e) {
return e.replace(/<\/(p|li|ul|ol|h[1-6]|table|tr|td|th)>/gi, "$1>\n").replace(/<(ul|ol)([^>]*)>
\n
/gi, " \n").replace(/\n$/, "")
}
}), t.ui.editor.ViewHtmlCommand = c, i.EditorUtils.registerTool("viewHtml", new l({
command: c,
template: new d({
template: a.buttonTemplate,
title: "View HTML"
})
}))
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.Class,
i = e.extend,
r = t.ui.editor,
o = r.RangeUtils,
a = r.Marker,
s = n.extend({
init: function (e) {
this.editor = e, this.formats = []
},
apply: function (e) {
var t, n, r, s, l, d, c, u;
if (this.hasPending()) {
if (t = new a, t.addCaret(e), n = e.startContainer.childNodes[e.startOffset], r = n.previousSibling, r ? (r.nodeValue || (r = r.previousSibling), e.setStart(r, r.nodeValue.length - 1)) : e.setStart(e.startContainer, e.startOffset), t.add(e), !o.textNodes(e).length) return t.remove(e), e.collapse(!0), this.editor.selectRange(e), void 0;
for (s = t.end.previousSibling.previousSibling, d = this.formats, c = 0; d.length > c; c++) l = d[c], u = l.command(i({
range: e
}, l.options.params)), u.editor = this.editor, u.exec(), e.selectNode(s);
t.remove(e), s.parentNode && (e.setStart(s, 1), e.collapse(!0)), this.clear(), this.editor.selectRange(e)
}
},
hasPending: function () {
return this.formats.length > 0
},
isPending: function (e) {
return !!this.getPending(e)
},
getPending: function (e) {
var t, n = this.formats;
for (t = 0; n.length > t; t++)
if (n[t].name == e) return n[t]
},
toggle: function (e) {
var t, n = this.formats;
for (t = 0; n.length > t; t++)
if (n[t].name == e.name) return n[t].params && n[t].params.value != e.params.value ? n[t].params.value = e.params.value : n.splice(t, 1), void 0;
n.push(e)
},
clear: function () {
this.formats = []
}
});
i(r, {
PendingFormats: s
})
}(window.kendo.jQuery),
function (e, t) {
function n(e, t) {
return '' + t + ""
}
function i(n, i) {
var r, o, a, s, l, d = i !== t;
return n.selectionStart !== t ? d ? (n.focus(), n.setSelectionRange(i, i)) : i = [n.selectionStart, n.selectionEnd] : document.selection && (e(n).is(":visible") && n.focus(), r = document.selection.createRange(), d ? (r.move("character", i), r.select()) : (s = n.createTextRange(), l = s.duplicate(), s.moveToBookmark(r.getBookmark()), l.setEndPoint("EndToStart", s), o = l.text.length, a = o + s.text.length, i = [o, a])), i
}
var r = window.kendo,
o = r.keys,
a = r.ui,
s = a.Widget,
l = r._activeElement,
d = r._extractFormat,
c = r.parseFloat,
u = r.support.placeholder,
p = r.getCulture,
f = r._round,
h = "change",
g = "disabled",
m = "readonly",
v = "k-input",
_ = "spin",
b = ".kendoNumericTextBox",
y = "touchend",
w = "mouseleave" + b,
x = "mouseenter" + b + " " + w,
k = "k-state-default",
C = "k-state-focused",
T = "k-state-hover",
S = "focus",
A = ".",
F = "k-state-selected",
D = "k-state-disabled",
I = "aria-disabled",
E = "aria-readonly",
P = null,
z = e.proxy,
H = {
190: ".",
188: ","
}, R = s.extend({
init: function (e, n) {
var i, o, a, l, c, u = this,
p = n && n.step !== t;
s.fn.init.call(u, e, n), n = u.options, e = u.element.on("blur" + b, z(u._focusout, u)).attr("role", "spinbutton"), n.placeholder = n.placeholder || e.attr("placeholder"), u._reset(), u._wrapper(), u._arrows(), u._input(), r.support.mobileOS ? u._text.on(y + b + " " + S + b, function (t) {
u._toggleText(!1), t.type === S && e.focus()
}) : u._text.on(S + b, z(u._click, u)), i = u.min(e.attr("min")), o = u.max(e.attr("max")), a = u._parse(e.attr("step")), n.min === P && i !== P && (n.min = i), n.max === P && o !== P && (n.max = o), p || a === P || (n.step = a), e.attr("aria-valuemin", n.min).attr("aria-valuemax", n.max), n.format = d(n.format), l = n.value, u.value(l !== P ? l : e.val()), c = e.is("[disabled]"), c ? u.enable(!1) : u.readonly(e.is("[readonly]")), r.notify(u)
},
options: {
name: "NumericTextBox",
decimals: P,
min: P,
max: P,
value: P,
step: 1,
culture: "",
format: "n",
spinners: !0,
placeholder: "",
upArrowText: "Increase value",
downArrowText: "Decrease value"
},
events: [h, _],
_editable: function (e) {
var t = this,
n = t.element,
i = e.disable,
r = e.readonly,
o = t._text.add(n),
a = t._inputWrapper.off(x);
t._toggleText(!0), t._upArrowEventHandler.unbind("press"), t._downArrowEventHandler.unbind("press"), n.off("keydown" + b).off("paste" + b), r || i ? (a.addClass(i ? D : k).removeClass(i ? k : D), o.attr(g, i).attr(m, r).attr(I, i).attr(E, r)) : (a.addClass(k).removeClass(D).on(x, t._toggleHover), o.removeAttr(g).removeAttr(m).attr(I, !1).attr(E, !1), t._upArrowEventHandler.bind("press", function (e) {
e.preventDefault(), t._spin(1), t._upArrow.addClass(F)
}), t._downArrowEventHandler.bind("press", function (e) {
e.preventDefault(), t._spin(-1), t._downArrow.addClass(F)
}), t.element.on("keydown" + b, z(t._keydown, t)).on("paste" + b, z(t._paste, t)))
},
readonly: function (e) {
this._editable({
readonly: e === t ? !0 : e,
disable: !1
})
},
enable: function (e) {
this._editable({
readonly: !1,
disable: !(e = e === t ? !0 : e)
})
},
destroy: function () {
var e = this;
e.element.add(e._text).add(e._upArrow).add(e._downArrow).add(e._inputWrapper).off(b), e._form && e._form.off("reset", e._resetHandler), s.fn.destroy.call(e)
},
min: function (e) {
return this._option("min", e)
},
max: function (e) {
return this._option("max", e)
},
step: function (e) {
return this._option("step", e)
},
value: function (e) {
var n, i = this;
return e === t ? i._value : (e = i._parse(e), n = i._adjust(e), e === n && (i._update(e), i._old = i._value), t)
},
focus: function () {
this._focusin()
},
_adjust: function (e) {
var t = this,
n = t.options,
i = n.min,
r = n.max;
return e === P ? e : (i !== P && i > e ? e = i : r !== P && e > r && (e = r), e)
},
_arrows: function () {
var t, i = this,
o = function () {
clearTimeout(i._spinning), t.removeClass(F)
}, a = i.options,
s = a.spinners,
l = i.element;
t = l.siblings(".k-icon"), t[0] || (t = e(n("n", a.upArrowText) + n("s", a.downArrowText)).insertAfter(l), t.wrapAll('')), s || (t.parent().toggle(s), i._inputWrapper.addClass("k-expand-padding")), i._upArrow = t.eq(0), i._upArrowEventHandler = new r.UserEvents(i._upArrow, {
release: o
}), i._downArrow = t.eq(1), i._downArrowEventHandler = new r.UserEvents(i._downArrow, {
release: o
})
},
_blur: function () {
var e = this;
e._toggleText(!0), e._change(e.element.val())
},
_click: function (e) {
var t = this;
clearTimeout(t._focusing), t._focusing = setTimeout(function () {
var n = e.target,
r = i(n)[0],
o = n.value.substring(0, r),
a = t._format(t.options.format),
s = a[","],
l = RegExp("\\" + s, "g"),
d = RegExp("([\\d\\" + s + "]+)(\\" + a[A] + ")?(\\d+)?"),
c = d.exec(o),
u = 0;
c && (u = c[0].replace(l, "").length, -1 != o.indexOf("(") && 0 > t._value && u++), t._focusin(), i(t.element[0], u)
})
},
_change: function (e) {
var t = this;
t._update(e), e = t._value, t._old != e && (t._old = e, t.trigger(h), t.element.trigger(h))
},
_culture: function (e) {
return e || p(this.options.culture)
},
_focusin: function () {
var e = this;
e._inputWrapper.addClass(C), e._toggleText(!1), e.element[0].focus()
},
_focusout: function () {
var e = this;
clearTimeout(e._focusing), e._inputWrapper.removeClass(C).removeClass(T), e._blur()
},
_format: function (e, t) {
var n = this._culture(t).numberFormat;
return e = e.toLowerCase(), e.indexOf("c") > -1 ? n = n.currency : e.indexOf("p") > -1 && (n = n.percent), n
},
_input: function () {
var t, n = this,
i = "k-formatted-value",
r = n.element.addClass(v).show()[0],
o = r.accessKey,
a = n.wrapper;
t = a.find(A + i), t[0] || (t = e('').insertBefore(r).addClass(i)), r.type = "text", t[0].tabIndex = r.tabIndex, t[0].style.cssText = r.style.cssText, t.prop("placeholder", n.options.placeholder), o && (t.attr("accesskey", o), r.accessKey = ""), n._text = t.addClass(r.className)
},
_keydown: function (e) {
var t = this,
n = e.keyCode;
n == o.DOWN ? t._step(-1) : n == o.UP ? t._step(1) : n == o.ENTER && t._change(t.element.val()), t._prevent(n, e.shiftKey) && !e.ctrlKey && e.preventDefault()
},
_paste: function (e) {
var t = this,
n = e.target,
i = n.value;
setTimeout(function () {
t._parse(n.value) === P && t._update(i)
})
},
_prevent: function (e, t) {
var n, r = this,
a = r.element[0],
s = a.value,
l = r.options,
d = l.min,
c = r._format(l.format),
u = c[A],
p = l.decimals,
f = i(a),
h = f[0],
g = f[1],
m = 0 === h && g === s.length,
v = !0;
return p === P && (p = c.decimals), e > 16 && 21 > e || e > 32 && 37 > e || e > 47 && 58 > e || e > 95 && 106 > e || e == o.INSERT || e == o.DELETE || e == o.LEFT || e == o.RIGHT || e == o.TAB || e == o.BACKSPACE || e == o.ENTER ? (v = !1, t && (n = parseInt(String.fromCharCode(e), 10), isNaN(n) || (n += "", s = s.substring(0, h) + n + s.substring(g), (-1 === a.maxLength || a.maxLength >= s.length) && (a.value = s, i(a, h + n.length)), v = !0))) : (H[e] === u || 110 == e) && p > 0 && (-1 == s.indexOf(u) || m) ? 110 == e ? (a.value = s.substring(0, h) + u + s.substring(g), i(a, h + u.length)) : t || (v = !1) : !(d === P || 0 > d) || -1 != s.indexOf("-") || 189 != e && 109 != e && 173 != e || 0 !== h || (v = !1), v
},
_option: function (e, n) {
var i = this,
r = i.options;
return n === t ? r[e] : (n = i._parse(n), (n || "step" !== e) && (r[e] = n, i.element.attr("aria-value" + e, n).attr(e, n)), t)
},
_spin: function (e, t) {
var n = this;
t = t || 500, clearTimeout(n._spinning), n._spinning = setTimeout(function () {
n._spin(e, 50)
}, t), n._step(e)
},
_step: function (e) {
var t = this,
n = t.element,
i = t._parse(n.val()) || 0;
l() != n[0] && t._focusin(), i += t.options.step * e, t._update(t._adjust(i)), t.trigger(_)
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(T, "mouseenter" === t.type)
},
_toggleText: function (e) {
var t = this;
t._text.toggle(e), t.element.toggle(!e)
},
_parse: function (e, t) {
return c(e, this._culture(t), this.options.format)
},
_update: function (e) {
var t, n = this,
i = n.options,
o = i.format,
a = i.decimals,
s = n._culture(),
l = n._format(o, s);
a === P && (a = l.decimals), e = n._parse(e, s), t = e !== P, t && (e = parseFloat(f(e, a))), n._value = e = n._adjust(e), n._placeholder(r.toString(e, o, s)), t ? (e = "" + e, -1 !== e.indexOf("e") && (e = f(+e, a))) : e = "", n.element.val(e).attr("aria-valuenow", e)
},
_placeholder: function (e) {
this._text.val(e), u || e || this._text.val(this.options.placeholder)
},
_wrapper: function () {
var t, n = this,
i = n.element,
r = i[0];
t = i.parents(".k-numerictextbox"), t.is("span.k-numerictextbox") || (t = i.hide().wrap('').parent(), t = t.wrap("").parent()), t[0].style.cssText = r.style.cssText, r.style.width = "", n.wrapper = t.addClass("k-widget k-numerictextbox").addClass(r.className).css("display", ""), n._inputWrapper = e(t[0].firstChild)
},
_reset: function () {
var e = this,
t = e.element,
n = t.closest("form");
n[0] && (e._resetHandler = function () {
setTimeout(function () {
e.value(t[0].value)
})
}, e._form = n.on("reset", e._resetHandler))
}
});
a.plugin(R)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t) {
return e = e.split(" ")[!t + 0] || e, e.replace("top", "up").replace("bottom", "down")
}
function i(e, t, n) {
e = e.split(" ")[!t + 0] || e;
var i = {
origin: ["bottom", n ? "right" : "left"],
position: ["top", n ? "right" : "left"]
}, r = /left|right/.test(e);
return r ? (i.origin = ["top", e], i.position[1] = l.directions[e].reverse) : (i.origin[0] = e, i.position[0] = l.directions[e].reverse), i.origin = i.origin.join(" "), i.position = i.position.join(" "), i
}
function r(t, n) {
try {
return e.contains(t, n)
} catch (i) {
return !1
}
}
function o(t) {
t = e(t), t.addClass("k-item").children(k).addClass(E), t.children("a").addClass(S).children(k).addClass(E), t.filter(":not([disabled])").addClass(B), t.filter(".k-separator:empty").append(" "), t.filter("li[disabled]").addClass(U).removeAttr("disabled").attr("aria-disabled", !0), t.filter("[role]").length || t.attr("role", "menuitem"), t.children("." + S).length || t.contents().filter(function () {
return !(this.nodeName.match(w) || 3 == this.nodeType && !e.trim(this.nodeValue))
}).wrapAll(""), a(t), s(t)
}
function a(t) {
t = e(t), t.find("> .k-link > [class*=k-i-arrow]").remove(), t.filter(":has(.k-group)").children(".k-link:not(:has([class*=k-i-arrow]))").each(function () {
var t = e(this),
n = t.parent().parent();
t.append("")
})
}
function s(t) {
t = e(t), t.filter(".k-first:not(:first-child)").removeClass(I), t.filter(".k-last:not(:last-child)").removeClass(A), t.filter(":first-child").addClass(I), t.filter(":last-child").addClass(A)
}
var l = window.kendo,
d = l.ui,
c = l._activeElement,
u = l.support.touch && l.support.mobileOS,
p = u || l.support.pointers,
f = "mousedown",
h = "click",
g = e.extend,
m = e.proxy,
v = e.each,
_ = l.template,
b = l.keys,
y = d.Widget,
w = /^(ul|a|div)$/i,
x = ".kendoMenu",
k = "img",
C = "open",
T = "k-menu",
S = "k-link",
A = "k-last",
F = "close",
D = "timer",
I = "k-first",
E = "k-image",
P = "select",
z = "zIndex",
H = "activate",
R = "deactivate",
O = l.support.pointers ? "MSPointerOver" : "mouseenter",
M = l.support.pointers ? "MSPointerOut" : "mouseleave",
N = "kendoPopup",
B = "k-state-default",
L = "k-state-hover",
V = "k-state-focused",
U = "k-state-disabled",
W = ".k-group",
j = ":not(.k-list) > .k-item",
q = ".k-item.k-state-disabled",
G = ".k-item:not(.k-state-disabled)",
$ = ".k-item:not(.k-state-disabled) > .k-link",
Y = ":not(.k-item.k-separator)",
Q = Y + ":eq(0)",
K = Y + ":last",
X = "div:not(.k-animation-container,.k-list-container)",
J = {
content: _("
"),
image: _(""),
arrow: _(""),
sprite: _(""),
empty: _("")
}, Z = {
wrapperCssClass: function (e, t) {
var n = "k-item",
i = t.index;
return n += t.enabled === !1 ? " k-state-disabled" : " k-state-default", e.firstLevel && 0 === i && (n += " k-first"), i == e.length - 1 && (n += " k-last"), t.cssClass && (n += " " + t.cssClass), n
},
textClass: function () {
return S
},
textAttributes: function (e) {
return e.url ? " href='" + e.url + "'" : ""
},
arrowClass: function (e, t) {
var n = "k-icon";
return n += t.horizontal ? " k-i-arrow-s" : " k-i-arrow-e"
},
text: function (e) {
return e.encoded === !1 ? e.text : l.htmlEncode(e.text)
},
tag: function (e) {
return e.url ? "a" : "span"
},
groupAttributes: function (e) {
return e.expanded !== !0 ? " style='display:none'" : ""
},
groupCssClass: function () {
return "k-group"
},
content: function (e) {
return e.content ? e.content : " "
}
}, et = y.extend({
init: function (t, n) {
var i = this;
y.fn.init.call(i, t, n), t = i.wrapper = i.element, n = i.options, i._initData(n), i._updateClasses(), i._animations(n), i.nextItemZIndex = 100, i._tabindex(), i._focusProxy = m(i._focusHandler, i), t.on("touchstart MSPointerDown", i._focusProxy).on(h + x, q, !1).on(h + x, G, m(i._click, i)).on("keydown" + x, m(i._keydown, i)).on("focus" + x, m(i._focus, i)).on("focus" + x, ".k-content", m(i._focus, i)).on("blur" + x, m(i._removeHoverItem, i)).on("blur" + x, "[tabindex]", m(i._checkActiveElement, i)).on(O + x, G, m(i._mouseenter, i)).on(M + x, G, m(i._mouseleave, i)).on(O + x + " " + M + x + " " + f + x + " " + h + x, $, m(i._toggleHover, i)), n.openOnClick && (i.clicked = !1, i._documentClickHandler = m(i._documentClick, i), e(document).click(i._documentClickHandler)), t.attr("role", "menubar"), t[0].id && (i._ariaId = l.format("{0}_mn_active", t[0].id)), l.notify(i)
},
events: [C, F, H, R, P],
options: {
name: "Menu",
animation: {
open: {
duration: 200
},
close: {
duration: 100
}
},
orientation: "horizontal",
direction: "default",
openOnClick: !1,
closeOnClick: !0,
hoverDelay: 100
},
_initData: function (e) {
var t = this;
e.dataSource && (t.element.empty(), t.append(e.dataSource, t.element))
},
setOptions: function (e) {
var t = this.options.animation;
this._animations(e), e.animation = g(!0, t, e.animation), "dataSource" in e && this._initData(e), y.fn.setOptions.call(this, e)
},
destroy: function () {
var t = this;
y.fn.destroy.call(t), t.element.off(x), t._documentClickHandler && e(document).unbind("click", t._documentClickHandler)
},
enable: function (e, t) {
return this._toggleDisabled(e, t !== !1), this
},
disable: function (e) {
return this._toggleDisabled(e, !1), this
},
append: function (e, t) {
t = this.element.find(t);
var n = this._insert(e, t, t.length ? t.find("> .k-group, > .k-animation-container > .k-group") : null);
return v(n.items, function () {
n.group.append(this), a(this)
}), a(t), s(n.group.find(".k-first, .k-last").add(n.items)), this
},
insertBefore: function (e, t) {
t = this.element.find(t);
var n = this._insert(e, t, t.parent());
return v(n.items, function () {
t.before(this), a(this), s(this)
}), s(t), this
},
insertAfter: function (e, t) {
t = this.element.find(t);
var n = this._insert(e, t, t.parent());
return v(n.items, function () {
t.after(this), a(this), s(this)
}), s(t), this
},
_insert: function (t, n, i) {
var r, a, s, l, d = this;
return n && n.length || (i = d.element), s = e.isPlainObject(t), l = {
firstLevel: i.hasClass(T),
horizontal: i.hasClass(T + "-horizontal"),
expanded: !0,
length: i.children().length
}, n && !i.length && (i = e(et.renderGroup({
group: l
})).appendTo(n)), s || e.isArray(t) ? r = e.map(s ? [t] : t, function (t, n) {
return "string" == typeof t ? e(t) : e(et.renderItem({
group: l,
item: g(t, {
index: n
})
}))
}) : (r = e(t), a = r.find("> ul").addClass("k-group").attr("role", "menu"), r = r.filter("li"), r.add(a.find("> li")).each(function () {
o(this)
})), {
items: r,
group: i
}
},
remove: function (e) {
var t, n, i, r;
return e = this.element.find(e), t = this, n = e.parentsUntil(t.element, j), i = e.parent("ul"), e.remove(), i && !i.children(j).length && (r = i.parent(".k-animation-container"), r.length ? r.remove() : i.remove()), n.length && (n = n.eq(0), a(n), s(n)), t
},
open: function (r) {
var o = this,
a = o.options,
s = "horizontal" == a.orientation,
d = a.direction,
c = l.support.isRtl(o.wrapper);
return r = o.element.find(r), /^(top|bottom|default)$/.test(d) && (d = c ? s ? (d + " left").replace("default", "bottom") : "left" : s ? (d + " right").replace("default", "bottom") : "right"), r.siblings().find(">.k-popup:visible,>.k-animation-container>.k-popup:visible").each(function () {
var t = e(this).data("kendoPopup");
t && t.close()
}), r.each(function () {
var r = e(this);
clearTimeout(r.data(D)), r.data(D, setTimeout(function () {
var e, l, u, p, f, h, m = r.find(".k-group:first:hidden");
m[0] && o.trigger(C, {
item: r[0]
}) === !1 && (r.data(z, r.css(z)), r.css(z, o.nextItemZIndex++), e = m.data(N), l = r.parent().hasClass(T), u = l && s, p = i(d, l, c), f = a.animation.open.effects, h = f !== t ? f : "slideIn:" + n(d, l), e ? (e = m.data(N), e.options.origin = p.origin, e.options.position = p.position, e.options.animation.open.effects = h) : e = m.kendoPopup({
activate: function () {
o.trigger(H, {
item: this.wrapper.parent()
})
},
deactivate: function () {
o.trigger(R, {
item: this.wrapper.parent()
})
},
origin: p.origin,
position: p.position,
collision: a.popupCollision !== t ? a.popupCollision : u ? "fit" : "fit flip",
anchor: r,
appendTo: r,
animation: {
open: g(!0, {
effects: h
}, a.animation.open),
close: a.animation.close
},
close: function (e) {
var t = e.sender.wrapper.parent();
o.trigger(F, {
item: t[0]
}) ? e.preventDefault() : (t.css(z, t.data(z)), t.removeData(z))
}
}).data(N), m.removeAttr("aria-hidden"), e.open())
}, o.options.hoverDelay))
}), o
},
close: function (t) {
var n = this,
i = n.element;
return t = i.find(t), t.length || (t = i.find(">.k-item")), t.each(function () {
var t = e(this);
clearTimeout(t.data(D)), t.data(D, setTimeout(function () {
var e = t.find(".k-group:not(.k-list-container):first:visible").data(N);
e && (e.close(), e.element.attr("aria-hidden", !0))
}, n.options.hoverDelay))
}), n
},
_toggleDisabled: function (t, n) {
this.element.find(t).each(function () {
e(this).toggleClass(B, n).toggleClass(U, !n).attr("aria-disabled", !n)
})
},
_toggleHover: function (t) {
var n = e(l.eventTarget(t) || t.target).closest(j),
i = t.type == O || -1 !== f.indexOf(t.type);
n.parents("li." + U).length || n.toggleClass(L, i || "mousedown" == t.type || "click" == t.type), this._removeHoverItem()
},
_checkActiveElement: function (t) {
var n = this,
i = e(this._hoverItem()[0] || (t ? t.currentTarget : {})),
o = n._findRootParent(i)[0];
setTimeout(function () {
document.hasFocus() && r(o, l._activeElement()) || n.close(o)
}, 0)
},
_removeHoverItem: function () {
var e = this._hoverItem();
e && e.hasClass(V) && (e.removeClass(V), this._oldHoverItem = null)
},
_updateClasses: function () {
var e, t = this.element;
t.addClass("k-widget k-reset k-header " + T).addClass(T + "-" + this.options.orientation), t.find("li > ul").addClass("k-group").attr("role", "menu").attr("aria-hidden", t.is(":visible")).end().find("li > div").addClass("k-content").attr("tabindex", "-1"), e = t.find("> li,.k-group > li"), e.each(function () {
o(this)
})
},
_mouseenter: function (t) {
var n = this,
i = e(t.currentTarget),
o = i.children(".k-animation-container").length || i.children(W).length;
t.delegateTarget == i.parents(".k-menu")[0] && ((!n.options.openOnClick || n.clicked) && !r(t.currentTarget, t.relatedTarget) && o && n.open(i), (n.options.openOnClick && n.clicked || p) && i.siblings().each(m(function (e, t) {
n.close(t)
}, n)))
},
_mouseleave: function (n) {
var i = this,
o = e(n.currentTarget),
a = o.children(".k-animation-container").length || o.children(W).length;
return o.parentsUntil(".k-animation-container", ".k-list-container,.k-calendar-container")[0] ? (n.stopImmediatePropagation(), t) : (i.options.openOnClick || u || l.support.pointers && 2 == n.originalEvent.pointerType || r(n.currentTarget, n.relatedTarget) || !a || i.close(o), t)
},
_click: function (n) {
var i, r, o, a = this,
s = a.options,
d = e(l.eventTarget(n)),
c = d[0] ? d[0].nodeName.toUpperCase() : "",
u = "INPUT" == c || "SELECT" == c || "BUTTON" == c,
f = d.closest("." + S),
h = d.closest(j),
g = f.attr("href"),
m = !! g && "#" != g.charAt(g.length - 1);
if (!h.children(X)[0]) return h.hasClass(U) ? (n.preventDefault(), t) : (n.handled || !a.trigger(P, {
item: h[0]
}) || u || n.preventDefault(), n.handled = !0, r = h.children(W + ",.k-animation-container"), o = r.is(":visible"), s.closeOnClick && !m && (!r.length || s.openOnClick && o) ? (h.removeClass(L).css("height"), a._oldHoverItem = a._findRootParent(h), a.close(f.parentsUntil(a.element, j)), a.clicked = !1, -1 != "MSPointerUp".indexOf(n.type) && n.preventDefault(), t) : ((h.parent().hasClass(T) && s.openOnClick || !p) && (m || u || n.preventDefault(), a.clicked = !0, i = r.is(":visible") ? F : C, (s.closeOnClick || i != F) && a[i](h)), t))
},
_documentClick: function (e) {
r(this.element[0], e.target) || (this.clicked = !1)
},
_focus: function (n) {
var i = this,
r = n.target,
o = i._hoverItem(),
a = c();
return r == i.wrapper[0] || e(r).is(":focusable") ? (a === n.currentTarget && (o.length ? i._moveHover([], o) : i._oldHoverItem || i._moveHover([], i.wrapper.children().first())), t) : (n.stopPropagation(), e(r).closest(".k-content").closest(".k-group").closest(".k-item").addClass(V), i.wrapper.focus(), t)
},
_keydown: function (e) {
var n, i, r, o = this,
a = e.keyCode,
s = o._oldHoverItem,
d = l.support.isRtl(o.wrapper);
if (e.target == e.currentTarget || a == b.ESC) {
if (s || (s = o._oldHoverItem = o._hoverItem()), i = o._itemBelongsToVertival(s), r = o._itemHasChildren(s), a == b.RIGHT) n = o[d ? "_itemLeft" : "_itemRight"](s, i, r);
else if (a == b.LEFT) n = o[d ? "_itemRight" : "_itemLeft"](s, i, r);
else if (a == b.DOWN) n = o._itemDown(s, i, r);
else if (a == b.UP) n = o._itemUp(s, i, r);
else if (a == b.ESC) n = o._itemEsc(s, i);
else if (a == b.ENTER || a == b.SPACEBAR) n = s.children(".k-link"), n.length > 0 && (o._click({
target: n[0],
preventDefault: function () {}
}), o._moveHover(s, o._findRootParent(s)));
else if (a == b.TAB) return n = o._findRootParent(s), o._moveHover(s, n), o._checkActiveElement(), t;
n && n[0] && (e.preventDefault(), e.stopPropagation())
}
},
_hoverItem: function () {
return this.wrapper.find(".k-item.k-state-hover,.k-item.k-state-focused").filter(":visible")
},
_itemBelongsToVertival: function (e) {
var t = this.wrapper.hasClass("k-menu-vertical");
return e.length ? e.parent().hasClass("k-group") || t : t
},
_itemHasChildren: function (e) {
return e.length ? e.children("ul.k-group, div.k-animation-container").length > 0 : !1
},
_moveHover: function (e, t) {
var n = this,
i = n._ariaId;
e.length && t.length && (e.removeClass(V), e[0].id === i && e.removeAttr("id")), t.length && (t[0].id && (i = t[0].id), t.addClass(V), n._oldHoverItem = t, i && (n.element.removeAttr("aria-activedescendant"), t.attr("id", i), n.element.attr("aria-activedescendant", i)))
},
_findRootParent: function (e) {
return e.parent().hasClass("k-menu") ? e : e.parentsUntil(".k-menu", "li.k-item").last()
},
_isRootItem: function (e) {
return e.parent().hasClass("k-menu")
},
_itemRight: function (e, t, n) {
var i, r, o = this;
return t ? n ? (o.open(e), i = e.find(".k-group").children().first()) : "horizontal" == o.options.orientation && (r = o._findRootParent(e), o.close(r), i = r.nextAll(Q)) : (i = e.nextAll(Q), i.length || (i = e.prevAll(K))), i && !i.length ? i = o.wrapper.children(".k-item").first() : i || (i = []), o._moveHover(e, i), i
},
_itemLeft: function (e, t) {
var n, i = this;
return t ? (n = e.parent().closest(".k-item"), i.close(n), i._isRootItem(n) && "horizontal" == i.options.orientation && (n = n.prevAll(Q))) : (n = e.prevAll(Q), n.length || (n = e.nextAll(K))), n.length || (n = i.wrapper.children(".k-item").last()), i._moveHover(e, n), n
},
_itemDown: function (e, t, n) {
var i, r = this;
if (t) i = e.nextAll(Q);
else {
if (!n || e.hasClass(U)) return;
r.open(e), i = e.find(".k-group").children().first()
}
return !i.length && e.length ? i = e.parent().children().first() : e.length || (i = r.wrapper.children(".k-item").first()), r._moveHover(e, i), i
},
_itemUp: function (e, t) {
var n, i = this;
if (t) return n = e.prevAll(Q), !n.length && e.length ? n = e.parent().children().last() : e.length || (n = i.wrapper.children(".k-item").last()), i._moveHover(e, n), n
},
_itemEsc: function (e, t) {
var n, i = this;
return t ? (n = e.parent().closest(".k-item"), i.close(n), i._moveHover(e, n), n) : e
},
_focusHandler: function (t) {
var n = this,
i = e(l.eventTarget(t)).closest(j);
setTimeout(function () {
n._moveHover([], i), i.children(".k-content")[0] && i.parent().closest(".k-item").removeClass(V)
}, 200)
},
_animations: function (e) {
e && "animation" in e && !e.animation && (e.animation = {
open: {
effects: {}
},
close: {
hide: !0,
effects: {}
}
})
}
});
g(et, {
renderItem: function (e) {
e = g({
menu: {},
group: {}
}, e);
var t = J.empty,
n = e.item;
return J.item(g(e, {
image: n.imageUrl ? J.image : t,
sprite: n.spriteCssClass ? J.sprite : t,
itemWrapper: J.itemWrapper,
renderContent: et.renderContent,
arrow: n.items || n.content ? J.arrow : t,
subGroup: et.renderGroup
}, Z))
},
renderGroup: function (e) {
return J.group(g({
renderItems: function (e) {
for (var t = "", n = 0, i = e.items, r = i ? i.length : 0, o = g({
length: r
}, e.group); r > n; n++) t += et.renderItem(g(e, {
group: o,
item: g({
index: n
}, i[n])
}));
return t
}
}, e, Z))
},
renderContent: function (e) {
return J.content(g(e, Z))
}
}), l.ui.plugin(et)
}(window.kendo.jQuery),
function (e, t) {
function n(t) {
return t = null != t ? t : "", t.type || e.type(t) || "string"
}
function i(t) {
t.find(":input:not(:button, [" + s.attr("role") + "=upload], [" + s.attr("skip") + "], [type=file]), select").each(function () {
var t = s.attr("bind"),
n = this.getAttribute(t) || "",
i = "checkbox" === this.type || "radio" === this.type ? "checked:" : "value:",
r = this.name; - 1 === n.indexOf(i) && r && (n += (n.length ? "," : "") + i + r, e(this).attr(t, n))
})
}
function r(e) {
var t, i, r = (e.model.fields || e.model)[e.field],
o = n(r),
a = r ? r.validation : {}, l = s.attr("type"),
d = s.attr("bind"),
c = {
name: e.field
};
for (t in a) i = a[t], h(t, _) >= 0 ? c[l] = t : p(i) || (c[t] = f(i) ? i.value || t : i), c[s.attr(t + "-msg")] = i.message;
return h(o, _) >= 0 && (c[l] = o), c[d] = ("boolean" === o ? "checked:" : "value:") + e.field, c
}
function o(e) {
var t, n, i, r, o, a;
if (e && e.length)
for (a = [], t = 0, n = e.length; n > t; t++) i = e[t], o = i.text || i.value || i, r = null == i.value ? i.text || i : i.value, a[t] = {
text: o,
value: r
};
return a
}
function a(e, t) {
var n, i = e ? e.validation || {} : {};
for (n in i) p(i[n]) && (t[n] = i[n])
}
var s = window.kendo,
l = s.ui,
d = l.Widget,
c = e.extend,
u = s.support.browser.msie && 9 > s.support.browser.version,
p = e.isFunction,
f = e.isPlainObject,
h = e.inArray,
g = /("|\%|'|\[|\]|\$|\.|\,|\:|\;|\+|\*|\&|\!|\#|\(|\)|<|>|\=|\?|\@|\^|\{|\}|\~|\/|\||`)/g,
m = '
#=message#
',
v = "change",
_ = ["url", "email", "number", "date", "boolean"],
b = {
number: function (t, n) {
var i = r(n);
e('').attr(i).appendTo(t).kendoNumericTextBox({
format: n.format
}), e("').hide().appendTo(t)
},
date: function (t, n) {
var i = r(n),
o = n.format;
o && (o = s._extractFormat(o)), i[s.attr("format")] = o, e('').attr(i).appendTo(t).kendoDatePicker({
format: n.format
}), e("').hide().appendTo(t)
},
string: function (t, n) {
var i = r(n);
e('').attr(i).appendTo(t)
},
"boolean": function (t, n) {
var i = r(n);
e('').attr(i).appendTo(t)
},
values: function (t, n) {
var i = r(n);
e("').attr(i).appendTo(t), e("').hide().appendTo(t)
}
}, y = d.extend({
init: function (t, n) {
var i = this;
d.fn.init.call(i, t, n), i._validateProxy = e.proxy(i._validate, i), i.refresh()
},
events: [v],
options: {
name: "Editable",
editors: b,
clearContainer: !0,
errorTemplate: m
},
editor: function (e, t) {
var i = this,
r = i.options.editors,
o = f(e),
a = o ? e.field : e,
l = i.options.model || {}, d = o && e.values,
u = d ? "values" : n(t),
p = o && e.editor,
h = p ? e.editor : r[u],
m = i.element.find("[" + s.attr("container-for") + "=" + a.replace(g, "\\$1") + "]");
h = h ? h : r.string, p && "string" == typeof e.editor && (h = function (t) {
t.append(e.editor)
}), m = m.length ? m : i.element, h(m, c(!0, {}, o ? e : {
field: a
}, {
model: l
}))
},
_validate: function (t) {
var n, i = this,
r = "boolean" == typeof t.value,
o = i._validationEventInProgress,
a = {};
a[t.field] = t.value, n = e(":input[" + s.attr("bind") + '="' + (r ? "checked:" : "value:") + t.field.replace(g, "\\$1") + '"]', i.element);
try {
i._validationEventInProgress = !0, (!i.validatable.validateInput(n) || !o && i.trigger(v, {
values: a
})) && t.preventDefault()
} finally {
i._validationEventInProgress = !1
}
},
end: function () {
return this.validatable.validate()
},
destroy: function () {
var e = this;
d.fn.destroy.call(e), e.options.model.unbind("set", e._validateProxy), s.unbind(e.element), s.destroy(e.element), e.element.removeData("kendoValidator")
},
refresh: function () {
var n, r, o, l, d, c, p, h, g = this,
m = g.options.fields || [],
v = g.options.clearContainer ? g.element.empty() : g.element,
_ = g.options.model || {}, b = {};
for (e.isArray(m) || (m = [m]), n = 0, r = m.length; r > n; n++) o = m[n], l = f(o), d = l ? o.field : o, c = (_.fields || _)[d], a(c, b), g.editor(o, c);
if (!r) {
p = _.fields || _;
for (d in p) a(p[d], b)
}
i(v), s.bind(v, g.options.model), g.options.model.bind("set", g._validateProxy), g.validatable = v.kendoValidator({
validateOnBlur: !1,
errorTemplate: g.options.errorTemplate || t,
rules: b
}).data("kendoValidator"), h = v.find(":focusable:first").focus(), u && h.focus()
}
});
l.plugin(y)
}(window.kendo.jQuery),
function (e) {
function t(n, i) {
n.filters && (n.filters = e.grep(n.filters, function (e) {
return t(e, i), e.filters ? e.filters.length : e.field != i
}))
}
function n(e) {
var t, n, i, r, o, a;
if (e && e.length)
for (a = [], t = 0, n = e.length; n > t; t++) i = e[t], o = i.text || i.value || i, r = null == i.value ? i.text || i : i.value, a[t] = {
text: o,
value: r
};
return a
}
function i(t, n) {
return e.grep(t, function (t) {
return t.filters ? (t.filters = e.grep(t.filters, function (e) {
return e.field != n
}), t.filters.length) : t.field != n
})
}
var r = window.kendo,
o = r.ui,
a = e.proxy,
s = "kendoPopup",
l = "init",
d = ".kendoFilterMenu",
c = "Is equal to",
u = "Is not equal to",
p = {
number: "numerictextbox",
date: "datepicker"
}, f = e.isFunction,
h = o.Widget,
g = '
"),
image: u(""),
sprite: u(""),
empty: u("")
}, V = {
wrapperCssClass: function (e, t) {
var n = "k-item",
i = t.index;
return n += t.enabled === !1 ? " k-state-disabled" : " k-state-default", 0 === i && (n += " k-first"), i == e.length - 1 && (n += " k-last"), n
},
textAttributes: function (e) {
return e.url ? " href='" + e.url + "'" : ""
},
text: function (e) {
return e.encoded === !1 ? e.text : r.htmlEncode(e.text)
},
tag: function (e) {
return e.url ? "a" : "span"
},
contentAttributes: function (e) {
return e.active !== !0 ? " style='display:none' aria-hidden='true' aria-expanded='false'" : ""
},
content: function (e) {
return e.content ? e.content : e.contentUrl ? "" : " "
},
contentUrl: function (e) {
return e.contentUrl ? r.attr("content-url") + '="' + e.contentUrl + '"' : ""
}
}, U = p.extend({
init: function (t, n) {
var i, o, a = this;
p.fn.init.call(a, t, n), a._animations(a.options), a.wrapper = a.element.is("ul") ? a.element.wrapAll("").parent() : a.element, n = a.options, a._isRtl = r.support.isRtl(a.wrapper), a._tabindex(), a._updateClasses(), a._dataSource(), n.dataSource && a.dataSource.fetch(), a.options.contentUrls && a.wrapper.find(".k-tabstrip-items > .k-item").each(function (t, n) {
e(n).find(">." + _).data(F, a.options.contentUrls[t])
}), a.wrapper.on(D + h + " " + I + h, B, a._toggleHover).on("keydown" + h, e.proxy(a._keydown, a)).on("focus" + h, e.proxy(a._active, a)).on("blur" + h, function () {
a._current(null)
}), a.wrapper.children(".k-tabstrip-items").on(y + h, ".k-state-disabled .k-link", !1).on(y + h, " > " + N, function (t) {
a._click(e(t.currentTarget)) && t.preventDefault()
}), i = a.tabGroup.children("li." + H), o = a.contentHolder(i.index()), o.length > 0 && 0 === o[0].childNodes.length && a.activateTab(i.eq(0)), a.element.attr("role", "tablist"), a.element[0].id && (a._ariaId = a.element[0].id + "_ts_active"), r.notify(a)
},
_active: function () {
var e = this.tabGroup.children().filter("." + H);
e = e[0] ? e : this._endItem("first"), e[0] && this._current(e)
},
_endItem: function (e) {
return this.tabGroup.children(N)[e]()
},
_item: function (e, t) {
var n;
return n = t === v ? "last" : "first", e ? (e = e[t](), e[0] || (e = this._endItem(n)), e.hasClass(P) && (e = this._item(e, t)), e) : this._endItem(n)
},
_current: function (e) {
var n = this,
i = n._focused,
r = n._ariaId;
return e === t ? i : (i && (i[0].id === r && i.removeAttr("id"), i.removeClass(R)), e && (e.hasClass(H) || e.addClass(R), n.element.removeAttr("aria-activedescendant"), r = e[0].id || r, r && (e.attr("id", r), n.element.attr("aria-activedescendant", r))), n._focused = e, t)
},
_keydown: function (e) {
var n, i = this,
r = e.keyCode,
o = i._current(),
s = i._isRtl;
if (e.target == e.currentTarget) {
if (r == a.DOWN || r == a.RIGHT) n = s ? v : "next";
else if (r == a.UP || r == a.LEFT) n = s ? "next" : v;
else if (r == a.ENTER || r == a.SPACEBAR) i._click(o), e.preventDefault();
else {
if (r == a.HOME) return i._click(i._endItem("first")), e.preventDefault(), t;
if (r == a.END) return i._click(i._endItem("last")), e.preventDefault(), t
}
n && (i._click(i._item(o, n)), e.preventDefault())
}
},
_dataSource: function () {
var t = this;
t.dataSource && t._refreshHandler ? t.dataSource.unbind("change", t._refreshHandler) : t._refreshHandler = e.proxy(t.refresh, t), t.dataSource = r.data.DataSource.create(t.options.dataSource).bind("change", t._refreshHandler)
},
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource(), e.fetch()
},
_animations: function (e) {
e && "animation" in e && !e.animation && (e.animation = {
open: {
effects: {}
},
close: {
effects: {}
}
})
},
refresh: function (e) {
var t, n, i, o, a = this,
s = a.options,
l = r.getter(s.dataTextField),
d = r.getter(s.dataContentField),
c = r.getter(s.dataContentUrlField),
u = r.getter(s.dataImageUrlField),
p = r.getter(s.dataUrlField),
f = r.getter(s.dataSpriteCssClass),
h = [],
g = a.dataSource.view();
for (e = e || {}, i = e.action, i && (g = e.items), t = 0, o = g.length; o > t; t++) n = {
text: l(g[t])
}, s.dataContentField && (n.content = d(g[t])), s.dataContentUrlField && (n.contentUrl = c(g[t])), s.dataUrlField && (n.url = p(g[t])), s.dataImageUrlField && (n.imageUrl = u(g[t])), s.dataSpriteCssClass && (n.spriteCssClass = f(g[t])), h[t] = n;
if ("add" == e.action) e.index < a.tabGroup.children().length ? a.insertBefore(h, a.tabGroup.children().eq(e.index)) : a.append(h);
else if ("remove" == e.action)
for (t = 0; g.length > t; t++) a.remove(e.index);
else "itemchange" == e.action ? (t = a.dataSource.view().indexOf(g[0]), e.field === s.dataTextField && a.tabGroup.children().eq(t).find(".k-link").text(g[0].get(e.field))) : (a.trigger("dataBinding"), a.remove("li"), a.append(h), a.trigger("dataBound"))
},
value: function (n) {
var i = this;
return n === t ? i.select().text() : (n != i.value() && i.tabGroup.children().each(function () {
e.trim(e(this).text()) == n && i.select(this)
}), t)
},
items: function () {
return this.tabGroup[0].children
},
setOptions: function (e) {
var t = this.options.animation;
this._animations(e), e.animation = c(!0, t, e.animation), p.fn.setOptions.call(this, e)
},
events: [T, S, w, E, "change", "dataBinding", "dataBound"],
options: {
name: "TabStrip",
dataTextField: "",
dataContentField: "",
dataImageUrlField: "",
dataUrlField: "",
dataSpriteCssClass: "",
dataContentUrlField: "",
animation: {
open: {
effects: "expand:vertical fadeIn",
duration: 200
},
close: {
duration: 200
}
},
collapsible: !1
},
destroy: function () {
var e = this;
p.fn.destroy.call(e), e._refreshHandler && e.dataSource.unbind("change", e._refreshHandler), e.wrapper.off(h), r.destroy(e.wrapper)
},
select: function (t) {
var n = this;
return 0 === arguments.length ? n.tabGroup.children("li." + H) : (isNaN(t) || (t = n.tabGroup.children().get(t)), t = n.tabGroup.find(t), e(t).each(function (t, i) {
i = e(i), i.hasClass(H) || n.trigger(T, {
item: i[0],
contentElement: n.contentHolder(i.index())[0]
}) || n.activateTab(i)
}), n)
},
enable: function (e, t) {
return this._toggleDisabled(e, t !== !1), this
},
disable: function (e) {
return this._toggleDisabled(e, !1), this
},
reload: function (t) {
t = this.tabGroup.find(t);
var n = this;
return t.each(function () {
var t = e(this),
i = t.find("." + _).data(F),
r = n.contentHolder(t.index());
i && n.ajaxRequest(t, r, null, i)
}), n
},
append: function (e) {
var t = this,
n = t._create(e);
return l(n.tabs, function (e) {
t.tabGroup.append(this), t.wrapper.append(n.contents[e])
}), i(t.tabGroup), t._updateContentElements(), t
},
insertBefore: function (t, n) {
var r = this,
o = r._create(t),
a = e(r.contentElement(n.index()));
return l(o.tabs, function (e) {
n.before(this), a.before(o.contents[e])
}), i(r.tabGroup), r._updateContentElements(), r
},
insertAfter: function (t, n) {
var r = this,
o = r._create(t),
a = e(r.contentElement(n.index()));
return l(o.tabs, function (e) {
n.after(this), a.after(o.contents[e])
}), i(r.tabGroup), r._updateContentElements(), r
},
remove: function (t) {
var n = this,
i = typeof t,
r = e();
return "string" === i ? t = n.tabGroup.find(t) : "number" === i && (t = n.tabGroup.children().eq(t)), t.each(function () {
r.push(n.contentElement(e(this).index()))
}), t.remove(), r.remove(), n._updateContentElements(), n
},
_create: function (i) {
var r, o, a = e.isPlainObject(i),
l = this;
return a || e.isArray(i) ? (i = e.isArray(i) ? i : [i], r = s(i, function (t, n) {
return e(U.renderItem({
group: l.tabGroup,
item: c(t, {
index: n
})
}))
}), o = s(i, function (n, i) {
return n.content || n.contentUrl ? e(U.renderContent({
item: c(n, {
index: i
})
})) : t
})) : (r = e(i), o = e(""), n(r)), {
tabs: r,
contents: o
}
},
_toggleDisabled: function (t, n) {
t = this.tabGroup.find(t), t.each(function () {
e(this).toggleClass(z, n).toggleClass(P, !n)
})
},
_updateClasses: function () {
var r, o, a, s = this;
s.wrapper.addClass("k-widget k-header k-tabstrip"), s.tabGroup = s.wrapper.children("ul").addClass("k-tabstrip-items k-reset"), s.tabGroup[0] || (s.tabGroup = e("
").appendTo(s.wrapper)), r = s.tabGroup.find("li").addClass("k-item"), r.length && (o = r.filter("." + H).index(), a = o >= 0 ? o : t, s.tabGroup.contents().filter(function () {
return 3 == this.nodeType && !d(this.nodeValue)
}).remove()), o >= 0 && r.eq(o).addClass(M), s.contentElements = s.wrapper.children("div"), s.contentElements.addClass(A).eq(a).addClass(H).css({
display: "block"
}), r.length && (n(r), i(s.tabGroup), s._updateContentElements())
},
_updateContentElements: function () {
var t = this,
n = t.options.contentUrls || [],
i = t.element.attr("id"),
o = t.wrapper.children("div");
t.tabGroup.find(".k-item").each(function (r) {
var a = o.eq(r),
s = i + "-" + (r + 1);
this.setAttribute("aria-controls", s), !a.length && n[r] ? e("").appendTo(t.wrapper) : a.attr("id", s), a.attr("role", "tabpanel"), a.filter(":not(." + H + ")").attr("aria-hidden", !0).attr("aria-expanded", !1), a.filter("." + H).attr("aria-expanded", !0)
}), t.contentElements = t.contentAnimators = t.wrapper.children("div"), r.kineticScrollNeeded && r.mobile.ui.Scroller && (r.touchScroller(t.contentElements), t.contentElements = t.contentElements.children(".km-scroll-container"))
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(O, t.type == D)
},
_click: function (e) {
var t, n, i = this,
r = e.find("." + _),
o = r.attr(m),
a = i.options.collapsible,
s = i.contentHolder(e.index());
if (e.closest(".k-widget")[0] == i.wrapper[0]) {
if (e.is("." + P + (a ? "" : ",." + H))) return !0;
if (n = r.data(F) || o && ("#" == o.charAt(o.length - 1) || -1 != o.indexOf("#" + i.element[0].id + "-")), t = !o || n, i.tabGroup.children("[data-animating]").length) return t;
if (i.trigger(T, {
item: e[0],
contentElement: s[0]
})) return !0;
if (t !== !1) return a && e.is("." + H) ? (i.deactivateTab(e), !0) : (i.activateTab(e) && (t = !0), t)
}
},
deactivateTab: function (e) {
var t = this,
n = t.options.animation,
i = n.open,
o = c({}, n.close),
a = o && "effects" in o;
e = t.tabGroup.find(e), o = c(a ? o : c({
reverse: !0
}, i), {
hide: !0
}), r.size(i.effects) ? (e.kendoAddClass(z, {
duration: i.duration
}), e.kendoRemoveClass(H, {
duration: i.duration
})) : (e.addClass(z), e.removeClass(H)), e.removeAttr("aria-selected"), t.contentAnimators.filter("." + H).kendoStop(!0, !0).kendoAnimate(o).removeClass(H).attr("aria-hidden", !0)
},
activateTab: function (e) {
var t, n, i, o, a, s, l, d, u, p, f, h, g, m, v;
return e = this.tabGroup.find(e), t = this, n = t.options.animation, i = n.open, o = c({}, n.close), a = o && "effects" in o, s = e.parent().children(), l = s.filter("." + H), d = s.index(e), o = c(a ? o : c({
reverse: !0
}, i), {
hide: !0
}), r.size(i.effects) ? (l.kendoRemoveClass(H, {
duration: o.duration
}), e.kendoRemoveClass(O, {
duration: o.duration
})) : (l.removeClass(H), e.removeClass(O)), u = t.contentAnimators, e.data("in-request") && (t.xhr.abort(), e.removeAttr("data-in-request")), 0 === u.length ? (l.removeClass(M), e.addClass(M).css("z-index"), e.addClass(H), t._current(e), t.trigger("change"), !1) : (p = u.filter("." + H), f = t.contentHolder(d), h = f.closest(".k-content"), 0 === f.length ? (p.removeClass(H).attr("aria-hidden", !0).kendoStop(!0, !0).kendoAnimate(o), !1) : (e.attr("data-animating", !0), g = (e.children("." + _).data(F) || !1) && f.is(x), m = function () {
l.removeClass(M), e.addClass(M).css("z-index"), r.size(i.effects) ? (l.kendoAddClass(z, {
duration: i.duration
}), e.kendoAddClass(H, {
duration: i.duration
})) : (l.addClass(z), e.addClass(H)), l.removeAttr("aria-selected"), e.attr("aria-selected", !0), t._current(e), h.addClass(H).removeAttr("aria-hidden").kendoStop(!0, !0).attr("aria-expanded", !0).kendoAnimate(c({
init: function () {
t.trigger(S, {
item: e[0],
contentElement: f[0]
})
}
}, i, {
complete: function () {
e.removeAttr("data-animating")
}
}))
}, v = function () {
g ? (e.removeAttr("data-animating"), t.ajaxRequest(e, f, function () {
e.attr("data-animating", !0), m(), t.trigger("change")
})) : (m(), t.trigger("change"))
}, p.removeClass(H), p.attr("aria-hidden", !0), p.attr("aria-expanded", !1), p.length ? p.kendoStop(!0, !0).kendoAnimate(c({
complete: v
}, o)) : v(), !0))
},
contentElement: function (e) {
var n, i, o, a;
if (isNaN(e - 0)) return t;
if (n = this.contentElements && this.contentElements[0] && !r.kineticScrollNeeded ? this.contentElements : this.contentAnimators, i = RegExp("-" + (e + 1) + "$"), n)
for (o = 0, a = n.length; a > o; o++)
if (i.test(n.closest(".k-content")[o].id)) return n[o];
return t
},
contentHolder: function (t) {
var n = e(this.contentElement(t)),
i = n.children(".km-scroll-container");
return r.support.touch && i[0] ? i : n
},
ajaxRequest: function (t, n, i, r) {
if (t = this.tabGroup.find(t), !t.find(".k-loading").length) {
var o = this,
a = t.find("." + _),
s = {}, l = null,
d = setTimeout(function () {
l = e("").prependTo(a)
}, 100);
r = r || a.data(F) || a.attr(m), t.attr("data-in-request", !0), o.xhr = e.ajax({
type: "GET",
cache: !1,
url: r,
dataType: "html",
data: s,
error: function (e, t) {
o.trigger("error", {
xhr: e,
status: t
}) && this.complete()
},
complete: function () {
t.removeAttr("data-in-request"), clearTimeout(d), null !== l && l.remove()
},
success: function (e) {
try {
n.html(e)
} catch (a) {
var s = window.console;
s && s.error && s.error(a.name + ": " + a.message + " in " + r), this.error(this.xhr, "error")
}
i && i.call(o, n), o.trigger(E, {
item: t[0],
contentElement: n[0]
})
}
})
}
}
});
c(U, {
renderItem: function (e) {
e = c({
tabStrip: {},
group: {}
}, e);
var t = L.empty,
n = e.item;
return L.item(c(e, {
image: n.imageUrl ? L.image : t,
sprite: n.spriteCssClass ? L.sprite : t,
itemWrapper: L.itemWrapper
}, V))
},
renderContent: function (e) {
return L.content(c(e, V))
}
}), r.ui.plugin(U)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
var i, r = e.getTimezoneOffset();
e.setTime(e.getTime() + t), n || (i = e.getTimezoneOffset() - r, e.setTime(e.getTime() + i * P))
}
function i() {
var e = new G,
t = new G(e.getFullYear(), e.getMonth(), e.getDate(), 0, 0, 0),
n = new G(e.getFullYear(), e.getMonth(), e.getDate(), 12, 0, 0);
return -1 * (t.getTimezoneOffset() - n.getTimezoneOffset())
}
function r(e) {
return 60 * e.getHours() * P + e.getMinutes() * P + 1e3 * e.getSeconds() + e.getMilliseconds()
}
function o(e, t, n) {
var i, o = r(t),
a = r(n);
return e && o != a ? (i = r(e), o > i && (i += z), o > a && (a += z), i >= o && a >= i) : !0
}
function a(e) {
var t = e.parseFormats;
e.format = f(e.format || c.getCulture(e.culture).calendars.standard.patterns.t), t = W(t) ? t : [t], t.splice(0, 0, e.format), e.parseFormats = t
}
function s(e) {
e.preventDefault()
}
var l, d, c = window.kendo,
u = c.keys,
p = c._activeElement,
f = c._extractFormat,
h = c.support,
g = h.browser,
m = c.ui,
v = m.Widget,
_ = "open",
b = "close",
y = "change",
w = ".kendoTimePicker",
x = "click" + w,
k = "k-state-default",
C = "disabled",
T = "readonly",
S = "li",
A = "",
F = "k-state-focused",
D = "k-state-hover",
I = "mouseenter" + w + " mouseleave" + w,
E = "mousedown" + w,
P = 6e4,
z = 864e5,
H = "k-state-selected",
R = "k-state-disabled",
O = "aria-selected",
M = "aria-expanded",
N = "aria-hidden",
B = "aria-disabled",
L = "aria-readonly",
V = "aria-activedescendant",
U = "id",
W = e.isArray,
j = e.extend,
q = e.proxy,
G = Date,
$ = new G;
$ = new G($.getFullYear(), $.getMonth(), $.getDate(), 0, 0, 0), l = function (t) {
var n = this,
i = t.id;
n.options = t, n.ul = e('
').css({
overflow: h.kineticScrollNeeded ? "" : "auto"
}).on(x, S, q(n._click, n)).on("mouseenter" + w, S, function () {
e(this).addClass(D)
}).on("mouseleave" + w, S, function () {
e(this).removeClass(D)
}), n.list = e("").append(n.ul).on(E, s), i && (n._timeViewID = i + "_timeview", n._optionID = i + "_option_selected", n.ul.attr(U, n._timeViewID)), n._popup(), n.template = c.template('
#=data#
', {
useWithBlock: !1
})
}, l.prototype = {
current: function (n) {
var i = this,
r = i.options.active;
return n === t ? i._current : (i._current && i._current.removeClass(H).removeAttr(O).removeAttr(U), n && (n = e(n).addClass(H).attr(U, i._optionID).attr(O, !0), i.scroll(n[0])), i._current = n, r && r(n), t)
},
close: function () {
this.popup.close()
},
destroy: function () {
var e = this;
e.ul.off(w), e.list.off(w), e.popup.destroy()
},
open: function () {
var e = this;
e.ul[0].firstChild || e.bind(), e.popup.open(), e._current && e.scroll(e._current[0])
},
dataBind: function (e) {
for (var t, n = this, i = n.options, r = i.format, a = c.toString, s = n.template, l = e.length, d = 0, u = ""; l > d; d++) t = e[d], o(t, i.min, i.max) && (u += s(a(t, r, i.culture)));
n._html(u, l)
},
refresh: function () {
var e, t, o, a = this,
s = a.options,
l = s.format,
d = i(),
u = 0 > d,
p = s.min,
f = s.max,
h = r(p),
g = r(f),
m = s.interval * P,
v = c.toString,
_ = a.template,
b = new G(+p),
y = b.getDate(),
w = 0,
x = "";
for (o = u ? (z + d * P) / m : z / m, h != g && (h > g && (g += z), o = (g - h) / m + 1), t = parseInt(o, 10); o > w; w++) w && n(b, m, u), g && t == w && (e = r(b), b.getDate() > y && (e += z), e > g && (b = new G(+f))), x += _(v(b, l, s.culture));
a._html(x, o)
},
bind: function () {
var e = this,
t = e.options.dates;
t && t[0] ? e.dataBind(t) : e.refresh()
},
_html: function (e, t) {
var n = this;
n.ul[0].innerHTML = e, n._height(t), n.current(null), n.select(n._value)
},
scroll: function (e) {
if (e) {
var t = this.ul[0],
n = e.offsetTop,
i = e.offsetHeight,
r = t.scrollTop,
o = t.clientHeight,
a = n + i;
t.scrollTop = r > n ? n : a > r + o ? a - o : r
}
},
select: function (t) {
var n = this,
i = n.options,
r = n._current;
t instanceof Date && (t = c.toString(t, i.format, i.culture)), "string" == typeof t && (r && r.text() === t ? t = r : (t = e.grep(n.ul[0].childNodes, function (e) {
return (e.textContent || e.innerText) == t
}), t = t[0] ? t : null)), n.current(t)
},
toggle: function () {
var e = this;
e.popup.visible() ? e.close() : e.open()
},
value: function (e) {
var t = this;
t._value = e, t.ul[0].firstChild && t.select(e)
},
_click: function (t) {
var n = this,
i = e(t.currentTarget);
t.isDefaultPrevented() || (n.select(i), n.options.change(i.text(), !0), n.close())
},
_height: function (e) {
if (e) {
var t = this,
n = t.list,
i = n.parent(".k-animation-container"),
r = t.options.height;
n.add(i).show().height(t.ul[0].scrollHeight > r ? r : "auto").hide()
}
},
_parse: function (e) {
var t = this,
n = t.options,
i = t._value || $;
return e instanceof G ? e : (e = c.parseDate(e, n.parseFormats, n.culture), e && (e = new G(i.getFullYear(), i.getMonth(), i.getDate(), e.getHours(), e.getMinutes(), e.getSeconds(), e.getMilliseconds())), e)
},
_adjustListWidth: function () {
var e, t, n = this.list,
i = n[0].style.width,
r = this.options.anchor;
(n.data("width") || !i) && (e = window.getComputedStyle ? window.getComputedStyle(r[0], null) : 0, t = e ? parseFloat(e.width) : r.outerWidth(), e && (g.mozilla || g.msie) && (t += parseFloat(e.paddingLeft) + parseFloat(e.paddingRight) + parseFloat(e.borderLeftWidth) + parseFloat(e.borderRightWidth)), i = t - (n.outerWidth() - n.width()), n.css({
fontFamily: r.css("font-family"),
width: i
}).data("width", i))
},
_popup: function () {
var e = this,
t = e.list,
n = e.options,
i = n.anchor;
e.popup = new m.Popup(t, j(n.popup, {
anchor: i,
open: n.open,
close: n.close,
animation: n.animation,
isRtl: h.isRtl(n.anchor)
})), c.touchScroller(e.popup.element)
},
move: function (e) {
var n = this,
i = e.keyCode,
r = n.ul[0],
o = n._current,
a = i === u.DOWN;
if (i === u.UP || a) {
if (e.altKey) return n.toggle(a), t;
o = a ? o ? o[0].nextSibling : r.firstChild : o ? o[0].previousSibling : r.lastChild, o && n.select(o), n.options.change(n._current.text()), e.preventDefault()
} else(i === u.ENTER || i === u.TAB || i === u.ESC) && (e.preventDefault(), o && n.options.change(o.text(), !0), n.close())
}
}, l.getMilliseconds = r, c.TimeView = l, d = v.extend({
init: function (e, t) {
var n, i, r, o = this;
v.fn.init.call(o, e, t), e = o.element, t = o.options, a(t), o._wrapper(), o.timeView = i = new l(j({}, t, {
id: e.attr(U),
anchor: o.wrapper,
format: t.format,
change: function (t, n) {
n ? o._change(t) : e.val(t)
},
open: function (t) {
o.timeView._adjustListWidth(), o.trigger(_) ? t.preventDefault() : (e.attr(M, !0), n.attr(N, !1))
},
close: function (t) {
o.trigger(b) ? t.preventDefault() : (e.attr(M, !1), n.attr(N, !0))
},
active: function (t) {
e.removeAttr(V), t && e.attr(V, i._optionID)
}
})), n = i.ul, o._icon(), o._reset(), e[0].type = "text", e.addClass("k-input").attr({
role: "textbox",
"aria-haspopup": !0,
"aria-expanded": !1,
"aria-owns": i._timeViewID
}), r = e.is("[disabled]"), r ? o.enable(!1) : o.readonly(e.is("[readonly]")), o.value(t.value || e.val()), c.notify(o)
},
options: {
name: "TimePicker",
min: $,
max: $,
format: "",
dates: [],
parseFormats: [],
value: null,
interval: 30,
height: 200,
animation: {}
},
events: [_, b, y],
setOptions: function (e) {
var t = this,
n = t.timeView,
i = n.options;
v.fn.setOptions.call(t, e), a(t.options), n.options = j(i, t.options, {
active: i.active,
change: i.change,
close: i.close,
open: i.open
}), n.ul[0].innerHTML = ""
},
dataBind: function (e) {
W(e) && this.timeView.dataBind(e)
},
_editable: function (e) {
var t = this,
n = e.disable,
i = e.readonly,
r = t._arrow.off(w),
o = t.element.off(w),
a = t._inputWrapper.off(w);
i || n ? (a.addClass(n ? R : k).removeClass(n ? k : R), o.attr(C, n).attr(T, i).attr(B, n).attr(L, i)) : (a.addClass(k).removeClass(R).on(I, t._toggleHover), o.removeAttr(C).removeAttr(T).attr(B, !1).attr(L, !1).on("keydown" + w, q(t._keydown, t)).on("blur" + w, q(t._blur, t)).on("focus" + w, function () {
t._inputWrapper.addClass(F)
}), r.on(x, q(t._click, t)).on(E, s))
},
readonly: function (e) {
this._editable({
readonly: e === t ? !0 : e,
disable: !1
})
},
enable: function (e) {
this._editable({
readonly: !1,
disable: !(e = e === t ? !0 : e)
})
},
destroy: function () {
var e = this;
v.fn.destroy.call(e), e.timeView.destroy(), e.element.off(w), e._arrow.off(w), e._inputWrapper.off(w), e._form && e._form.off("reset", e._resetHandler)
},
close: function () {
this.timeView.close()
},
open: function () {
this.timeView.open()
},
min: function (e) {
return this._option("min", e)
},
max: function (e) {
return this._option("max", e)
},
value: function (e) {
var n = this;
return e === t ? n._value : (n._old = n._update(e), null === n._old && n.element.val(""), n._oldText = n.element.val(), t)
},
_blur: function () {
var e = this,
t = e.element.val();
e.close(), t !== e._oldText && e._change(t), e._inputWrapper.removeClass(F)
},
_click: function () {
var e = this,
t = e.element;
e.timeView.toggle(), h.touch || t[0] === p() || t.focus()
},
_change: function (e) {
var t = this;
e = t._update(e), +t._old != +e && (t._old = e, t._oldText = t.element.val(), t.trigger(y), t.element.trigger(y))
},
_icon: function () {
var t, n = this,
i = n.element;
t = i.next("span.k-select"), t[0] || (t = e('select').insertAfter(i)), n._arrow = t.attr({
role: "button",
"aria-controls": n.timeView._timeViewID
})
},
_keydown: function (e) {
var t = this,
n = e.keyCode,
i = t.timeView,
r = t.element.val();
i.popup.visible() || e.altKey ? i.move(e) : n === u.ENTER && r !== t._oldText && t._change(r)
},
_option: function (e, n) {
var i = this,
r = i.options;
return n === t ? r[e] : (n = i.timeView._parse(n), n && (n = new G(+n), r[e] = n, i.timeView.options[e] = n, i.timeView.bind()), t)
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(D, "mouseenter" === t.type)
},
_update: function (e) {
var t = this,
n = t.options,
i = t.timeView,
r = i._parse(e);
return o(r, n.min, n.max) || (r = null), t._value = r, t.element.val(r ? c.toString(r, n.format, n.culture) : e), i.value(r), r
},
_wrapper: function () {
var t, n = this,
i = n.element;
t = i.parents(".k-timepicker"), t[0] || (t = i.wrap(A).parent().addClass("k-picker-wrap k-state-default"), t = t.wrap(A).parent()), t[0].style.cssText = i[0].style.cssText, n.wrapper = t.addClass("k-widget k-timepicker k-header").addClass(i[0].className), i.css({
width: "100%",
height: i[0].style.height
}), n._inputWrapper = e(t[0].firstChild)
},
_reset: function () {
var e = this,
t = e.element,
n = t.closest("form");
n[0] && (e._resetHandler = function () {
e.value(t[0].defaultValue)
}, e._form = n.on("reset", e._resetHandler))
}
}), m.plugin(d)
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
e.preventDefault()
}
function i(t) {
var n, i = r.getCulture(t.culture).calendars.standard.patterns;
t.format = l(t.format || i.g), t.timeFormat = n = l(t.timeFormat || i.t), r.DateView.normalize(t), -1 === e.inArray(n, t.parseFormats) && t.parseFormats.splice(1, 0, n)
}
var r = window.kendo,
o = r.TimeView,
a = r.parseDate,
s = r._activeElement,
l = r._extractFormat,
d = r.calendar,
c = d.isInRange,
u = d.restrictValue,
p = d.isEqualDatePart,
f = o.getMilliseconds,
h = r.ui,
g = h.Widget,
m = "open",
v = "close",
_ = "change",
b = ".kendoDateTimePicker",
y = "click" + b,
w = "disabled",
x = "readonly",
k = "k-state-default",
C = "k-state-focused",
T = "k-state-hover",
S = "k-state-disabled",
A = "mouseenter" + b + " mouseleave" + b,
F = "mousedown" + b,
D = "month",
I = "",
E = "aria-activedescendant",
P = "aria-expanded",
z = "aria-hidden",
H = "aria-owns",
R = "aria-disabled",
O = "aria-readonly",
M = Date,
N = new M(1900, 0, 1),
B = new M(2099, 11, 31),
L = {
view: "date"
}, V = {
view: "time"
}, U = e.extend,
W = g.extend({
init: function (e, t) {
var n, o = this;
g.fn.init.call(o, e, t), e = o.element, t = o.options, i(t), o._wrapper(), o._views(), o._icons(), o._reset(), o._template(), e[0].type = "text", e.addClass("k-input").attr({
role: "textbox",
"aria-haspopup": !0,
"aria-expanded": !1
}), o._midnight = 0 === f(t.min) + f(t.max), n = e.is("[disabled]"), n ? o.enable(!1) : o.readonly(e.is("[readonly]")), o.value(t.value || e.val()), r.notify(o)
},
options: {
name: "DateTimePicker",
value: null,
format: "",
timeFormat: "",
culture: "",
parseFormats: [],
dates: [],
min: new M(N),
max: new M(B),
interval: 30,
height: 200,
footer: "",
start: D,
depth: D,
animation: {},
month: {},
ARIATemplate: 'Current focused date is #=kendo.toString(data.current, "G")#'
},
events: [m, v, _],
setOptions: function (e) {
var t = this,
n = t.dateView.options,
r = t.timeView.options;
g.fn.setOptions.call(t, e), i(t.options), e = t.options, U(n, e, {
change: n.change,
close: n.close,
open: n.open
}), U(r, e, {
format: e.timeFormat,
active: r.active,
change: r.change,
close: r.close,
open: r.open
}), t.timeView.ul[0].innerHTML = ""
},
_editable: function (t) {
var i = this,
o = i.element.off(b),
a = i._dateIcon.off(b),
l = i._timeIcon.off(b),
d = i._inputWrapper.off(b),
c = t.readonly,
u = t.disable;
c || u ? (d.addClass(u ? S : k).removeClass(u ? k : S), o.attr(w, u).attr(x, c).attr(R, u).attr(O, c)) : (d.addClass(k).removeClass(S).on(A, i._toggleHover), o.removeAttr(w).removeAttr(x).attr(R, !1).attr(O, !1).on("keydown" + b, e.proxy(i._keydown, i)).on("focus" + b, function () {
i._inputWrapper.addClass(C)
}).on("blur" + b, function () {
i._inputWrapper.removeClass(C), o.val() !== i._oldText && i._change(o.val()), i.close("date"), i.close("time")
}), a.on(F, n).on(y, function () {
i.toggle("date"), r.support.touch || o[0] === s() || o.focus()
}), l.on(F, n).on(y, function () {
i.toggle("time"), r.support.touch || o[0] === s() || o.focus()
}))
},
readonly: function (e) {
this._editable({
readonly: e === t ? !0 : e,
disable: !1
})
},
enable: function (e) {
this._editable({
readonly: !1,
disable: !(e = e === t ? !0 : e)
})
},
destroy: function () {
var e = this;
g.fn.destroy.call(e), e.dateView.destroy(), e.timeView.destroy(), e.element.off(b), e._dateIcon.off(b), e._timeIcon.off(b), e._inputWrapper.off(b), e._form && e._form.off("reset", e._resetHandler)
},
close: function (e) {
"time" !== e && (e = "date"), this[e + "View"].close()
},
open: function (e) {
"time" !== e && (e = "date"), this[e + "View"].open()
},
min: function (e) {
return this._option("min", e)
},
max: function (e) {
return this._option("max", e)
},
toggle: function (e) {
var t = "timeView";
"time" !== e ? e = "date" : t = "dateView", this[e + "View"].toggle(), this[t].close()
},
value: function (e) {
var n = this;
return e === t ? n._value : (n._old = n._update(e), null === n._old && n.element.val(""), n._oldText = n.element.val(), t)
},
_change: function (e) {
var t = this;
e = t._update(e), +t._old != +e && (t._old = e, t._oldText = t.element.val(), t.trigger(_), t.element.trigger(_))
},
_option: function (e, n) {
var i = this,
r = i.options,
o = i.timeView,
s = o.options,
l = i._value || i._old;
if (n === t) return r[e];
if (n = a(n, r.parseFormats, r.culture)) {
if (r[e] = new M(+n), i.dateView[e](n), i._midnight = 0 === f(r.min) + f(r.max), l && p(n, l)) {
if (i._midnight && "max" == e) return s[e] = B, o.dataBind([B]), t;
s[e] = n
} else s.max = B, s.min = N;
o.bind()
}
},
_toggleHover: function (t) {
e(t.currentTarget).toggleClass(T, "mouseenter" === t.type)
},
_update: function (t) {
var n, i, o, s, l, d = this,
f = d.options,
h = f.min,
g = f.max,
m = f.dates,
v = d.timeView,
_ = a(t, f.parseFormats, f.culture);
return +_ === +d._value ? (l = r.toString(_, f.format, f.culture), l !== t && d.element.val(null === _ ? t : l), _) : (null !== _ && p(_, h) ? _ = u(_, h, g) : c(_, h, g) || (_ = null), d._value = _, v.value(_), d.dateView.value(_), _ && (o = d._old, i = v.options, m[0] && (m = e.grep(m, function (e) {
return p(_, e)
}), m[0] && (v.dataBind(m), s = !0)), s || (p(_, h) && (i.min = h, i.max = B, n = !0), p(_, g) && (d._midnight ? (v.dataBind([B]), s = !0) : (i.max = g, n || (i.min = N), n = !0))), !s && (!o && n || o && !p(o, _)) && (n || (i.max = B, i.min = N), v.bind())), d.element.val(_ ? r.toString(_, f.format, f.culture) : t), d._updateARIA(_), _)
},
_keydown: function (e) {
var t = this,
n = t.dateView,
i = t.timeView,
o = t.element.val(),
a = n.popup.visible();
e.altKey && e.keyCode === r.keys.DOWN ? t.toggle(a ? "time" : "date") : a ? (n.move(e), t._updateARIA(n._current)) : i.popup.visible() ? i.move(e) : e.keyCode === r.keys.ENTER && o !== t._oldText && t._change(o)
},
_views: function () {
var e, t, n, i, s, l = this,
d = l.element,
u = l.options,
p = d.attr("id");
l.dateView = e = new r.DateView(U({}, u, {
id: p,
anchor: l.wrapper,
change: function () {
var t, n = e.calendar.value(),
i = +n,
r = +u.min,
o = +u.max;
(i === r || i === o) && (t = new M(+l._value), t.setFullYear(n.getFullYear()), t.setMonth(n.getMonth()), t.setDate(n.getDate()), c(t, r, o) && (n = t)), l._change(n), l.close("date")
},
close: function (e) {
l.trigger(v, L) ? e.preventDefault() : (d.attr(P, !1), n.attr(z, !0), t.popup.visible() || d.removeAttr(H))
},
open: function (t) {
l.trigger(m, L) ? t.preventDefault() : (l.element.val() !== l._oldText && (s = a(d.val(), u.parseFormats, u.culture), s ? (l.dateView._current = s, l.dateView.calendar._focus(s)) : l.dateView.value(s)), n.attr(z, !1), d.attr(P, !0).attr(H, e._dateViewID))
}
})), n = e.div, l.timeView = t = new o({
id: p,
value: u.value,
anchor: l.wrapper,
animation: u.animation,
format: u.timeFormat,
culture: u.culture,
height: u.height,
interval: u.interval,
min: new M(N),
max: new M(B),
parseFormats: u.parseFormats,
change: function (n, i) {
n = t._parse(n), u.min > n ? (n = new M(+u.min), t.options.min = n) : n > u.max && (n = new M(+u.max), t.options.max = n), i ? (l._timeSelected = !0, l._change(n)) : (d.val(r.toString(n, u.format, u.culture)), e.value(n), l._updateARIA(n))
},
close: function (t) {
l.trigger(v, V) ? t.preventDefault() : (i.attr(z, !0), d.attr(P, !1), e.popup.visible() || d.removeAttr(H))
},
open: function (e) {
t._adjustListWidth(), l.trigger(m, V) ? e.preventDefault() : (i.attr(z, !1), d.attr(P, !0).attr(H, t._timeViewID))
},
active: function (e) {
d.removeAttr(E), e && d.attr(E, t._optionID)
}
}), i = t.ul
},
_icons: function () {
var t, n = this,
i = n.element;
t = i.next("span.k-select"), t[0] || (t = e('selectselect').insertAfter(i)), t = t.children(), n._dateIcon = t.eq(0).attr({
role: "button",
"aria-controls": n.dateView._dateViewID
}), n._timeIcon = t.eq(1).attr({
role: "button",
"aria-controls": n.timeView._timeViewID
})
},
_wrapper: function () {
var t, n = this,
i = n.element;
t = i.parents(".k-datetimepicker"), t[0] || (t = i.wrap(I).parent().addClass("k-picker-wrap k-state-default"), t = t.wrap(I).parent()), t[0].style.cssText = i[0].style.cssText, i.css({
width: "100%",
height: i[0].style.height
}), n.wrapper = t.addClass("k-widget k-datetimepicker k-header").addClass(i[0].className), n._inputWrapper = e(t[0].firstChild)
},
_reset: function () {
var e = this,
t = e.element,
n = t.closest("form");
n[0] && (e._resetHandler = function () {
e.value(t[0].defaultValue)
}, e._form = n.on("reset", e._resetHandler))
},
_template: function () {
this._ariaTemplate = r.template(this.options.ARIATemplate)
},
_updateARIA: function (e) {
this.element.attr("aria-label", this._ariaTemplate({
current: e
}))
}
});
h.plugin(W)
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
return function (t) {
var n = t.children(".k-animation-container");
return n.length || (n = t), n.children(e)
}
}
function i(e) {
return e.children("div").find(".k-checkbox:first :checkbox")
}
function r(e) {
return function (t, n) {
n = n.closest(L);
var i, r = n.parent();
return r.parent().is("li") && (i = r.parent()), this._dataSourceMove(t, r, i, function (t, i) {
return this._insert(t.data(), i, n.index() + e)
})
}
}
function o(t) {
var n, i, r = t.children("div"),
o = t.children("ul"),
a = r.children(".k-icon"),
s = t.children(":checkbox"),
l = r.children(".k-in");
if (!t.hasClass("k-treeview") && (r.length || (r = e("").prependTo(t)), !a.length && o.length ? a = e("").prependTo(r) : o.length && o.children().length || (a.remove(), o.remove()), s.length && e("").appendTo(r).append(s), !l.length))
for (l = e("").appendTo(r)[0], n = r[0].nextSibling, l = r.find(".k-in")[0]; n && "ul" != n.nodeName.toLowerCase();) i = n, n = n.nextSibling, 3 == i.nodeType && (i.nodeValue = e.trim(i.nodeValue)), l.appendChild(i)
}
function a(e) {
var t = this;
t.treeview = e, t.hovered = e.element, t._draggable = new p.Draggable(e.element, {
filter: "div:not(.k-state-disabled) .k-in",
hint: function (t) {
return e.templates.dragClue({
item: e.dataItem(t),
treeview: e.options
})
},
cursorOffset: {
left: 10,
top: u.support.touch || u.support.pointers ? -40 / u.support.zoomLevel() : 10
},
dragstart: b(t.dragstart, t),
dragcancel: b(t.dragcancel, t),
drag: b(t.drag, t),
dragend: b(t.dragend, t)
})
}
var s, l, d, c, u = window.kendo,
p = u.ui,
f = u.data,
h = e.extend,
g = u.template,
m = e.isArray,
v = p.Widget,
_ = f.HierarchicalDataSource,
b = e.proxy,
y = u.keys,
w = ".kendoTreeView",
x = "select",
k = "navigate",
C = "expand",
T = "change",
S = "error",
A = "checked",
F = "collapse",
D = "dragstart",
I = "drag",
E = "drop",
P = "dragend",
z = "dataBound",
H = "click",
R = "visibility",
O = "undefined",
M = "k-state-hover",
N = "k-treeview",
B = ":visible",
L = ".k-item",
V = "string",
U = "aria-selected",
W = "aria-disabled",
j = {
text: "dataTextField",
url: "dataUrlField",
spriteCssClass: "dataSpriteCssClassField",
imageUrl: "dataImageUrlField"
}, q = function (e) {
return "object" == typeof HTMLElement ? e instanceof HTMLElement : e && "object" == typeof e && 1 === e.nodeType && typeof e.nodeName === V
};
l = n(".k-group"), d = n(".k-group,.k-content"), c = function (e) {
return e.children("div").children(".k-icon")
}, s = v.extend({
init: function (e, t) {
var n, i = this,
r = !1;
m(t) && (n = !0, t = {
dataSource: t
}), t && typeof t.loadOnDemand == O && m(t.dataSource) && (t.loadOnDemand = !1), v.prototype.init.call(i, e, t), e = i.element, t = i.options, r = e.is("ul") || e.hasClass(N), r && (t.dataSource.list = e.is("ul") ? e : e.children("ul")), i._animation(), i._accessors(), i._templates(), e.hasClass(N) ? (i.wrapper = e, i.root = e.children("ul").eq(0)) : (i._wrapper(), r && (i.root = e, i._group(i.wrapper))), i._tabindex(), i.wrapper.filter("[role=tree]").length || i.wrapper.attr("role", "tree"), i._dataSource(r), i._attachEvents(), t.dragAndDrop && (i.dragging = new a(i)), r ? i._attachUids() : t.autoBind && (i._progress(!0), i.dataSource.fetch()), t.checkboxes && t.checkboxes.checkChildren && i._updateIndeterminateInitial(i.wrapper), i.element[0].id && (i._ariaId = u.format("{0}_tv_active", i.element[0].id))
},
_attachEvents: function () {
var t = this,
n = ".k-in:not(.k-state-selected,.k-state-disabled)",
i = "mouseenter";
t.wrapper.on(i + w, ".k-in.k-state-selected", function (e) {
e.preventDefault()
}).on(i + w, n, function () {
e(this).addClass(M)
}).on("mouseleave" + w, n, function () {
e(this).removeClass(M)
}).on(H + w, n, b(t._click, t)).on("dblclick" + w, ".k-in:not(.k-state-disabled)", b(t._toggleButtonClick, t)).on(H + w, ".k-plus,.k-minus", b(t._toggleButtonClick, t)).on("keydown" + w, b(t._keydown, t)).on("focus" + w, b(t._focus, t)).on("blur" + w, b(t._blur, t)).on("mousedown" + w, ".k-in,.k-checkbox :checkbox,.k-plus,.k-minus", b(t._mousedown, t)).on("change" + w, ".k-checkbox :checkbox", b(t._checkboxChange, t)).on("click" + w, ".k-checkbox :checkbox", b(t._checkboxClick, t)).on("click" + w, ".k-request-retry", b(t._retryRequest, t)).on("click" + w, function (n) {
e(n.target).is(":focusable") || t.focus()
})
},
_checkboxClick: function (t) {
var n = e(t.target);
n.data("indeterminate") && (n.data("indeterminate", !1).prop("indeterminate", !1).prop(A, !0), this._checkboxChange(t))
},
_attachUids: function (t, n) {
var i, r = this,
o = u.attr("uid");
t = t || r.root, n = n || r.dataSource, i = n.view(), t.children("li").each(function (t, n) {
n = e(n).attr(o, i[t].uid), n.attr("role", "treeitem"), r._attachUids(n.children("ul"), i[t].children)
})
},
_animation: function () {
var e = this.options,
t = e.animation;
t === !1 ? t = {
expand: {
effects: {}
},
collapse: {
hide: !0,
effects: {}
}
} : t.collapse && "effects" in t.collapse || (t.collapse = h({
reverse: !0
}, t.expand)), h(t.collapse, {
hide: !0
}), e.animation = t
},
_templates: function () {
var e = this,
t = e.options,
n = b(e._fieldAccessor, e);
t.template && typeof t.template == V ? t.template = g(t.template) : t.template || (t.template = g("# var text = " + n("text") + "(item); #" + "# if (typeof item.encoded != 'undefined' && item.encoded === false) {#" + "#= text #" + "# } else { #" + "#: text #" + "# } #")), e._checkboxes(), e.templates = {
wrapperCssClass: function (e, t) {
var n = "k-item",
i = t.index;
return e.firstLevel && 0 === i && (n += " k-first"), i == e.length - 1 && (n += " k-last"), n
},
cssClass: function (e, t) {
var n = "",
i = t.index,
r = e.length - 1;
return e.firstLevel && 0 === i && (n += "k-top "), n += 0 === i && i != r ? "k-top" : i == r ? "k-bot" : "k-mid"
},
textClass: function (e) {
var t = "k-in";
return e.enabled === !1 && (t += " k-state-disabled"), e.selected === !0 && (t += " k-state-selected"), t
},
toggleButtonClass: function (e) {
var t = "k-icon";
return t += e.expanded !== !0 ? " k-plus" : " k-minus", e.enabled === !1 && (t += "-disabled"), t
},
groupAttributes: function (e) {
return e.expanded !== !0 ? " style='display:none'" : ""
},
groupCssClass: function (e) {
var t = "k-group";
return e.firstLevel && (t += " k-treeview-lines"), t
},
dragClue: g("
"),
loading: g(" Loading..."),
retry: g("Request failed. ")
}
},
items: function () {
return this.element.find(".k-item")
},
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource(), this.dataSource.fetch()
},
_dataSource: function (e) {
function t(e) {
for (var n = 0; e.length > n; n++) e[n]._initChildren(), e[n].children.fetch(), t(e[n].children.view())
}
var n = this,
i = n.options,
r = i.dataSource;
r = m(r) ? {
data: r
} : r, n.dataSource && (n.dataSource.unbind(T, b(n.refresh, n)), n.dataSource.unbind(S, b(n._error, n))), r.fields || (r.fields = [{
field: "text"
}, {
field: "url"
}, {
field: "spriteCssClass"
}, {
field: "imageUrl"
}]), n.dataSource = r = _.create(r), e && (r.fetch(), t(r.view())), r.bind(T, b(n.refresh, n)), r.bind(S, b(n._error, n))
},
events: [D, I, E, P, z, C, F, x, T, k],
options: {
name: "TreeView",
dataSource: {},
animation: {
expand: {
effects: "expand:vertical",
duration: 200
},
collapse: {
duration: 100
}
},
dragAndDrop: !1,
checkboxes: !1,
autoBind: !0,
loadOnDemand: !0,
template: "",
dataTextField: null
},
_accessors: function () {
var e, t, n, i = this,
r = i.options,
o = i.element;
for (e in j) t = r[j[e]], n = o.attr(u.attr(e + "-field")), !t && n && (t = n), t || (t = e), m(t) || (t = [t]), r[j[e]] = t
},
_fieldAccessor: function (t) {
var n = this.options[j[t]],
i = n.length,
r = "(function(item) {";
return 0 === i ? r += "return item['" + t + "'];" : (r += "var level = item.level();var levels = [" + e.map(n, function (e) {
return "function(d){ return " + u.expr(e) + "}"
}).join(",") + "];", r += "return levels[Math.min(level, " + i + "-1)](item)"), r += "})"
},
setOptions: function (e) {
var t = this;
"dragAndDrop" in e && e.dragAndDrop && !t.options.dragAndDrop && (t.dragging = new a(t)), v.fn.setOptions.call(t, e), t._animation(), t._templates()
},
_trigger: function (e, t) {
return this.trigger(e, {
node: t.closest(L)[0]
})
},
_setChecked: function (t, n) {
if (t && e.isFunction(t.view))
for (var i = 0, r = t.view(); r.length > i; i++) r[i][A] = n, r[i].children && this._setChecked(r[i].children, n)
},
_setIndeterminate: function (e) {
var t, n, r, o = l(e),
a = !0;
if (o.length) {
if (t = i(o.children()), n = t.length, n > 1) {
for (r = 1; n > r; r++)
if (t[r].checked != t[r - 1].checked || t[r].indeterminate || t[r - 1].indeterminate) {
a = !1;
break
}
} else a = !t[0].indeterminate;
i(e).data("indeterminate", !a).prop("indeterminate", !a).prop(A, a && t[0].checked)
}
},
_updateIndeterminateInitial: function (e) {
var t, n = l(e).children();
if (n.length) {
for (t = 0; n.length > t; t++) this._updateIndeterminateInitial(n.eq(t));
this._setIndeterminate(e)
}
},
_updateIndeterminate: function (e) {
var t, n = this.parent(e);
n.length && (this._setIndeterminate(n), t = n.children("div").find(".k-checkbox :checkbox"), t.prop("indeterminate") === !1 ? this.dataItem(n).set(A, t.prop(A)) : this.dataItem(n).checked = !1, this._updateIndeterminate(n))
},
_checkboxChange: function (t) {
var n = e(t.target),
i = n.prop(A),
r = n.closest(L),
o = this;
o.dataItem(r).set(A, i)
},
_toggleButtonClick: function (t) {
this.toggle(e(t.target).closest(L))
},
_mousedown: function (t) {
var n = e(t.currentTarget).closest(L);
this._clickTarget = n, this.current(n)
},
_focusable: function (e) {
return e && e.length && e.is(":visible") && !e.find(".k-in:first").hasClass("k-state-disabled")
},
_focus: function () {
var t = this.select(),
n = this._clickTarget;
u.support.touch || (n && n.length && (t = n), this._focusable(t) || (t = this.current()), this._focusable(t) || (t = this._nextVisible(e())), this.current(t))
},
focus: function () {
var e, t = this.wrapper,
n = t[0],
i = [],
r = [],
o = document.documentElement;
do n = n.parentNode, n.scrollHeight > n.clientHeight && (i.push(n), r.push(n.scrollTop)); while (n != o);
for (t.focus(), e = 0; i.length > e; e++) i[e].scrollTop = r[e]
},
_blur: function () {
this.current().find(".k-in:first").removeClass("k-state-focused")
},
_enabled: function (e) {
return !e.children("div").children(".k-in").hasClass("k-state-disabled")
},
parent: function (t) {
var n, i, r = /\bk-treeview\b/,
o = /\bk-item\b/;
typeof t == V && (t = this.element.find(t)), q(t) || (t = t[0]), i = o.test(t.className);
do t = t.parentNode, o.test(t.className) && (i ? n = t : i = !0); while (!r.test(t.className) && !n);
return e(n)
},
_nextVisible: function (e) {
var t, n = this,
i = n._expanded(e);
if (e.length && e.is(":visible"))
if (i) t = l(e).children().first();
else {
for (; e.length && !e.next().length;) e = n.parent(e);
t = e.next().length ? e.next() : e
} else t = n.root.children().eq(0);
return n._enabled(t) || (t = n._nextVisible(t)), t
},
_previousVisible: function (e) {
var t, n = this;
if (!e.length || e.prev().length)
for (t = e.length ? e.prev() : n.root.children().last(); n._expanded(t);) t = l(t).children().last();
else t = n.parent(e) || e;
return n._enabled(t) || (t = n._previousVisible(t)), t
},
_keydown: function (n) {
var i, r = this,
o = n.keyCode,
a = r.current(),
s = r._expanded(a),
l = a.find(".k-checkbox:first :checkbox"),
d = u.support.isRtl(r.element);
n.target == n.currentTarget && (!d && o == y.RIGHT || d && o == y.LEFT ? s ? i = r._nextVisible(a) : r.expand(a) : !d && o == y.LEFT || d && o == y.RIGHT ? s ? r.collapse(a) : (i = r.parent(a), r._enabled(i) || (i = t)) : o == y.DOWN ? i = r._nextVisible(a) : o == y.UP ? i = r._previousVisible(a) : o == y.HOME ? i = r._nextVisible(e()) : o == y.END ? i = r._previousVisible(e()) : o == y.ENTER ? a.find(".k-in:first").hasClass("k-state-selected") || r._trigger(x, a) || r.select(a) : o == y.SPACEBAR && l.length && (l.prop(A, !l.prop(A)).data("indeterminate", !1).prop("indeterminate", !1), r._checkboxChange({
target: l
}), i = a), i && (n.preventDefault(), a[0] != i[0] && (r._trigger(k, i), r.current(i))))
},
_click: function (t) {
var n, i = this,
r = e(t.target),
o = d(r.closest(L)),
a = r.attr("href");
n = a ? "#" == a || a.indexOf("#" + this.element.id + "-") >= 0 : o.length && !o.children().length, n && t.preventDefault(), r.hasClass(".k-state-selected") || i._trigger(x, r) || i.select(r)
},
_wrapper: function () {
var e, t, n = this,
i = n.element,
r = "k-widget k-treeview";
i.is("div") ? (e = i, t = e.children("ul").eq(0)) : (e = i.wrap("").parent(), t = i), n.wrapper = e.addClass(r), n.root = t
},
_group: function (e) {
var t = this,
n = e.hasClass(N),
i = {
firstLevel: n,
expanded: n || t._expanded(e)
}, r = e.children("ul");
r.addClass(t.templates.groupCssClass(i)).css("display", i.expanded ? "" : "none"), t._nodes(r, i)
},
_nodes: function (t, n) {
var i, r = this,
a = t.children("li");
n = h({
length: a.length
}, n), a.each(function (t, a) {
a = e(a), i = {
index: t,
expanded: r._expanded(a)
}, o(a), r._updateNodeClasses(a, n, i), r._group(a)
})
},
_checkboxes: function () {
var e, t = this.options,
n = t.checkboxes;
(n || t.checkboxTemplate) && (t.checkboxTemplate ? e = t.checkboxTemplate : (e = ""), n = h({
template: e
}, t.checkboxes), typeof n.template == V && (n.template = g(n.template)), t.checkboxes = n)
},
_updateNodeClasses: function (e, t, n) {
var i = e.children("div"),
r = e.children("ul"),
o = this.templates;
e.hasClass("k-treeview") || (n = n || {}, n.expanded = typeof n.expanded != O ? n.expanded : this._expanded(e), n.index = typeof n.index != O ? n.index : e.index(), n.enabled = typeof n.enabled != O ? n.enabled : !i.children(".k-in").hasClass("k-state-disabled"), t = t || {}, t.firstLevel = typeof t.firstLevel != O ? t.firstLevel : e.parent().parent().hasClass(N), t.length = typeof t.length != O ? t.length : e.parent().children().length, e.removeClass("k-first k-last").addClass(o.wrapperCssClass(t, n)), i.removeClass("k-top k-mid k-bot").addClass(o.cssClass(t, n)), i.children(".k-in").removeClass("k-in k-state-default k-state-disabled").addClass(o.textClass(n)), (r.length || "true" == e.attr("data-hasChildren")) && (i.children(".k-icon").removeClass("k-plus k-minus k-plus-disabled k-minus-disabled").addClass(o.toggleButtonClass(n)), r.addClass("k-group")))
},
_processNodes: function (t, n) {
var i = this;
i.element.find(t).each(function (t, r) {
n.call(i, t, e(r).closest(L))
})
},
dataItem: function (t) {
var n = e(t).closest(L).attr(u.attr("uid")),
i = this.dataSource;
return i && i.getByUid(n)
},
_insertNode: function (t, n, i, r, a) {
var s, d, c, u, p = this,
f = l(i),
h = f.children().length + 1,
g = {
firstLevel: i.hasClass(N),
expanded: !a,
length: h
}, m = "",
v = function (e, t) {
e.appendTo(t)
};
for (c = 0; t.length > c; c++) u = t[c], u.index = n + c, m += p._renderItem({
group: g,
item: u
});
if (d = e(m), d.length) {
for (f.length || (f = e(p._renderGroup({
group: g
})).appendTo(i)), r(d, f), i.hasClass("k-item") && (o(i), p._updateNodeClasses(i)), p._updateNodeClasses(d.prev().first()), p._updateNodeClasses(d.next().last()), c = 0; t.length > c; c++) u = t[c], u.hasChildren && (s = u.children.data(), s.length && p._insertNode(s, u.index, d.eq(c), v, !p._expanded(d.eq(c))));
return d
}
},
_updateNode: function (t, n) {
function i() {
f = !0
}
function r(e, t) {
e.find(".k-checkbox :checkbox").prop(A, t).data("indeterminate", !1).prop("indeterminate", !1)
}
var o, a, s, l, c, u = this,
p = {
treeview: u.options,
item: s
}, f = !1;
if ("selected" == t) s = n[0], a = u.findByUid(s.uid).find(".k-in:first").removeClass("k-state-hover").toggleClass("k-state-selected", s[t]).end(), s[t] ? (u.current(a), a.attr(U, !0)) : a.attr(U, !1);
else
for (e.inArray(t, u.options.dataTextField) >= 0 ? f = !0 : (p.item = n[0], p.item.bind("get", i), u.templates.itemContent(p), p.item.unbind("set", i)), o = 0; n.length > o; o++) p.item = s = n[o], "spriteCssClass" == t || "imageUrl" == t || f ? u.findByUid(s.uid).find(">div>.k-in").html(u.templates.itemContent(p)) : t == A ? (a = u.findByUid(s.uid), l = s[t], r(a.children("div"), l), u.options.checkboxes.checkChildren && (r(a.children(".k-group"), l), u._setChecked(s.children, l), u._updateIndeterminate(a))) : "expanded" == t ? u._toggle(u.findByUid(s.uid), s, s[t]) : "enabled" == t && (a = u.findByUid(s.uid), a.find(".k-checkbox :checkbox").prop("disabled", !s[t]), c = !d(a).is(B), a.removeAttr(W), s[t] || (s.selected && s.set("selected", !1), s.expanded && s.set("expanded", !1), c = !0, a.removeAttr(U).attr(W, !0)), u._updateNodeClasses(a, {}, {
enabled: s[t],
expanded: !c
}))
},
refresh: function (e) {
function n(e, t) {
var n = l(t),
i = n.children(),
o = !r._expanded(t);
typeof u == O && (u = i.length), r._insertNode(e, u, t, function (e, t) {
u == i.length ? e.appendTo(t) : e.insertBefore(i.eq(u))
}, o), r._expanded(t) && (r._updateNodeClasses(t), l(t).css("display", "block"))
}
var i, r = this,
a = r.wrapper,
s = e.node,
d = e.action,
c = e.items,
u = e.index,
p = r.options,
f = p.loadOnDemand,
h = p.checkboxes && p.checkboxes.checkChildren;
if (e.field) return r._updateNode(e.field, c);
if (s && (a = r.findByUid(s.uid), r._progress(a, !1)), h && "remove" != d && s && s.checked)
for (i = 0; c.length > i; i++) c[i].checked = !0;
for ("add" == d ? n(c, a) : "remove" == d ? r._remove(r.findByUid(c[0].uid), !1) : s ? (l(a).empty(), c.length ? n(c, a) : o(a)) : r.root = r.wrapper.html(r._renderGroup({
items: c,
group: {
firstLevel: !0,
expanded: !0
}
})).children("ul"), i = 0; c.length > i; i++)(!f || c[i].expanded) && c[i].load();
r.trigger(z, {
node: s ? a : t
})
},
_error: function (e) {
var t = this,
n = e.node && t.findByUid(e.node.uid);
n ? (this._progress(n, !1), c(n).addClass("k-i-refresh"), e.node.loaded(!1)) : (this._progress(!1), this.element.html(this.templates.retry))
},
_retryRequest: function (e) {
e.preventDefault(), this.dataSource.fetch()
},
expand: function (e) {
this._processNodes(e, function (e, t) {
this.toggle(t, !0)
})
},
collapse: function (e) {
this._processNodes(e, function (e, t) {
this.toggle(t, !1)
})
},
enable: function (e, t) {
t = 2 == arguments.length ? !! t : !0, this._processNodes(e, function (e, n) {
this.dataItem(n).set("enabled", t)
})
},
current: function (n) {
var i = this,
r = i._current,
o = i.element,
a = i._ariaId;
return arguments.length > 0 && n && n.length ? (r && (r[0].id === a && r.removeAttr("id"), r.find(".k-in:first").removeClass("k-state-focused")), r = i._current = e(n, o).closest(L), r.find(".k-in:first").addClass("k-state-focused"), a = r[0].id || a, a && (i.wrapper.removeAttr("aria-activedescendant"), r.attr("id", a), i.wrapper.attr("aria-activedescendant", a)), t) : (r || (r = i._nextVisible(e())), r)
},
select: function (n) {
var i = this,
r = i.element;
return arguments.length ? (n = e(n, r).closest(L), r.find(".k-state-selected").each(function () {
var e = i.dataItem(this);
e.set("selected", !1), delete e.selected
}), n.length && i.dataItem(n).set("selected", !0), i.trigger(T), t) : r.find(".k-state-selected").closest(L)
},
_toggle: function (e, t, n) {
var i, r = this,
o = r.options,
a = d(e),
s = n ? "expand" : "collapse",
l = o.animation[s];
if (!a.data("animating") && !r._trigger(s, e))
if (r._expanded(e, n), i = t && t.loaded(), i && a.children().length > 0) {
if (r._updateNodeClasses(e, {}, {
expanded: n
}), a.css("display") == (n ? "block" : "none")) return;
n || a.css("height", a.height()).css("height"), a.kendoStop(!0, !0).kendoAnimate(h({
reset: !0
}, l, {
complete: function () {
n && a.css("height", "")
}
}))
} else(!i || i && n) && (o.loadOnDemand && r._progress(e, !0), a.remove(), t.load())
},
toggle: function (t, n) {
t = e(t), c(t).is(".k-minus,.k-plus,.k-minus-disabled,.k-plus-disabled") && (1 == arguments.length && (n = !this._expanded(t)), this._expanded(t, n))
},
destroy: function () {
var e = this;
v.fn.destroy.call(e), e.element.off(w), e.dragging && e.dragging.destroy(), u.destroy(e.element)
},
_expanded: function (e, n) {
var i = u.attr("expanded"),
r = this.dataItem(e);
return 1 == arguments.length ? "true" === e.attr(i) || r && r.expanded : (d(e).data("animating") || (r && r.set("expanded", n), n ? (e.attr(i, "true"), e.attr("aria-expanded", "true")) : (e.removeAttr(i), e.attr("aria-expanded", "false"))), t)
},
_progress: function (e, t) {
var n = this.element;
1 == arguments.length ? (t = e, t ? n.html(this.templates.loading) : n.empty()) : c(e).toggleClass("k-loading", t)
},
text: function (e, n) {
var i = this.dataItem(e),
r = this.options[j.text],
o = i.level(),
a = r.length,
s = r[Math.min(o, a - 1)];
return n ? (i.set(s, n), t) : i[s]
},
_objectOrSelf: function (t) {
return e(t).closest("[data-role=treeview]").data("kendoTreeView") || this
},
_dataSourceMove: function (e, t, n, i) {
var r, o = this._objectOrSelf(n || t),
a = o.dataSource;
return n && n[0] != o.element[0] && (r = o.dataItem(n), r.loaded() || (o._progress(n, !0), r.load()), n != this.root && (a = r.children, a && a instanceof _ || (r._initChildren(), r.loaded(!0), a = r.children))), e = this._toObservableData(e), i.call(this, a, e)
},
_toObservableData: function (t) {
var n, i, r = t;
return (t instanceof window.jQuery || q(t)) && (n = this._objectOrSelf(t).dataSource, i = e(t).attr(u.attr("uid")), r = n.getByUid(i), r && (r = n.remove(r))), r
},
_insert: function (e, t, n) {
t instanceof u.data.ObservableArray ? t = t.toJSON() : m(t) || (t = [t]);
var i = e.parent();
return i && (i.hasChildren = !0, i._initChildren()), e.splice.apply(e, [n, 0].concat(t)), this.findByUid(e[n].uid)
},
insertAfter: r(1),
insertBefore: r(0),
append: function (e, t) {
var n = this,
i = n.root;
return t && (i = l(t)), n._dataSourceMove(e, i, t, function (e, i) {
function r() {
t && n._expanded(t, !0);
var r = e.data(),
o = Math.max(r.length, 0);
return n._insert(r, i, o)
}
return e.data() ? r() : (e.one(T, r), null)
})
},
_remove: function (t, n) {
var i, r, a, s = this;
return t = e(t, s.element), i = t.parent().parent(), r = t.prev(), a = t.next(), t[n ? "detach" : "remove"](), i.hasClass("k-item") && (o(i), s._updateNodeClasses(i)), s._updateNodeClasses(r), s._updateNodeClasses(a), t
},
remove: function (e) {
var t = this.dataItem(e);
t && this.dataSource.remove(t)
},
detach: function (e) {
return this._remove(e, !0)
},
findByText: function (t) {
return e(this.element).find(".k-in").filter(function (n, i) {
return e(i).text() == t
}).closest(L)
},
findByUid: function (e) {
return this.element.find(".k-item[" + u.attr("uid") + "=" + e + "]")
},
_renderItem: function (e) {
return e.group || (e.group = {}), e.treeview = this.options, e.r = this.templates, this.templates.item(e)
},
_renderGroup: function (e) {
var t = this;
return e.renderItems = function (e) {
var n = "",
i = 0,
r = e.items,
o = r ? r.length : 0,
a = e.group;
for (a.length = o; o > i; i++) e.group = a, e.item = r[i], e.item.index = i, n += t._renderItem(e);
return n
}, e.r = t.templates, t.templates.group(e)
}
}), a.prototype = {
_removeTouchHover: function () {
var e = this;
u.support.touch && e.hovered && (e.hovered.find("." + M).removeClass(M), e.hovered = !1)
},
_hintStatus: function (n) {
var i = this._draggable.hint.find(".k-drag-status")[0];
return n ? (i.className = "k-icon k-drag-status " + n, t) : e.trim(i.className.replace(/k-(icon|drag-status)/g, ""))
},
dragstart: function (t) {
var n = this,
i = n.treeview,
r = n.sourceNode = t.currentTarget.closest(L);
i.trigger(D, {
sourceNode: r[0]
}) && t.preventDefault(), n.dropHint = e("").css(R, "hidden").appendTo(i.element)
},
drag: function (t) {
var n, i, r, o, a, s, l, d, c, p, f = this,
h = f.treeview,
g = f.sourceNode,
m = f.dropTarget = e(u.eventTarget(t)),
v = m.closest(".k-treeview");
v.length ? e.contains(g[0], m[0]) ? n = "k-denied" : (n = "k-insert-middle", i = m.closest(".k-top,.k-mid,.k-bot"), i.length ? (o = i.outerHeight(), a = u.getOffset(i).top, s = m.closest(".k-in"), l = o / (s.length > 0 ? 4 : 2), d = a + l > t.y.location, c = t.y.location > a + o - l, f._removeTouchHover(), p = s.length && !d && !c, f.hovered = p ? v : !1, f.dropHint.css(R, p ? "hidden" : "visible"), s.toggleClass(M, p), p ? n = "k-add" : (r = i.position(), r.top += d ? 0 : o, f.dropHint.css(r)[d ? "prependTo" : "appendTo"](m.closest(L).children("div:first")), d && i.hasClass("k-top") && (n = "k-insert-top"), c && i.hasClass("k-bot") && (n = "k-insert-bottom"))) : m[0] != f.dropHint[0] && (n = v[0] != h.element[0] ? "k-add" : "k-denied")) : (n = "k-denied", f._removeTouchHover()), h.trigger(I, {
sourceNode: g[0],
dropTarget: m[0],
pageY: t.y.location,
pageX: t.x.location,
statusClass: n.substring(2),
setStatusClass: function (e) {
n = e
}
}), 0 !== n.indexOf("k-insert") && f.dropHint.css(R, "hidden"), f._hintStatus(n)
},
dragcancel: function () {
this.dropHint.remove()
},
dragend: function () {
var e, n, i, r = this,
o = r.treeview,
a = "over",
s = r.sourceNode,
l = r.dropHint,
d = r.dropTarget;
return "visible" == l.css(R) ? (a = l.prevAll(".k-in").length > 0 ? "after" : "before", e = l.closest(L)) : d && (e = d.closest(L), e.length || (e = d.closest(".k-treeview"))), n = "k-denied" != r._hintStatus(), i = o.trigger(E, {
sourceNode: s[0],
destinationNode: e[0],
valid: n,
setValid: function (e) {
n = e
},
dropTarget: d[0],
dropPosition: a
}), l.remove(), r._removeTouchHover(), !n || i ? (r._draggable.dropped = n, t) : (r._draggable.dropped = !0, "over" == a ? s = o.append(s, e) : "before" == a ? s = o.insertBefore(s, e) : "after" == a && (s = o.insertAfter(s, e)), o.trigger(P, {
sourceNode: s && s[0],
destinationNode: e[0],
dropPosition: a
}), t)
},
destroy: function () {
this._draggable.destroy()
}
}, p.plugin(s)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
var i = n ? " k-slider-horizontal" : " k-slider-vertical",
r = e.style ? e.style : t.attr("style"),
o = t.attr("class") ? " " + t.attr("class") : "",
a = "";
return "bottomRight" == e.tickPlacement ? a = " k-slider-bottomright" : "topLeft" == e.tickPlacement && (a = " k-slider-topleft"), r = r ? " style='" + r + "'" : "", "
" + "
"
}
function i(e, t, n) {
var i = "";
return i = "increase" == t ? n ? "k-i-arrow-e" : "k-i-arrow-n" : n ? "k-i-arrow-w" : "k-i-arrow-s", "" + e[t + "ButtonTitle"] + ""
}
function r(e, t) {
var n, i = "
",
r = w.floor(d(t / e.smallStep)) + 1;
for (n = 0; r > n; n++) i += "
";
return i += "
"
}
function o(e, t) {
var n = t.is("input") ? 1 : 2,
i = 2 == n ? e.leftDragHandleTitle : e.dragHandleTitle;
return "
"
}
function a(e) {
return function (t) {
return t + e
}
}
function s(e) {
return function () {
return e
}
}
function l(e) {
return (e + "").replace(".", f.cultures.current.numberFormat["."])
}
function d(e) {
e = parseFloat(e, 10);
var t = w.pow(10, W || 0);
return w.round(e * t) / t
}
function c(e, n) {
var i = _(e.getAttribute(n));
return null === i && (i = t), i
}
function u(e) {
return typeof e !== q
}
var p, f = window.kendo,
h = f.ui.Widget,
g = f.ui.Draggable,
m = e.extend,
v = f.format,
_ = f.parseFloat,
b = e.proxy,
y = e.isArray,
w = Math,
x = f.support,
k = x.pointers,
C = "change",
T = "slide",
S = ".slider",
A = "touchstart" + S + " mousedown" + S,
F = k ? "MSPointerDown" + S : A,
D = "touchend" + S + " mouseup" + S,
I = k ? "MSPointerUp" + S : D,
E = "moveSelection",
P = "keydown" + S,
z = "click" + S,
H = "mouseover" + S,
R = "focus" + S,
O = "blur" + S,
M = ".k-draghandle",
N = ".k-slider-track",
B = ".k-tick",
L = "k-state-selected",
V = "k-state-default",
U = "k-state-disabled",
W = 3,
j = "disabled",
q = "undefined",
G = "tabindex",
$ = f.getTouches,
Y = h.extend({
init: function (e, t) {
var n, i, o, l = this;
h.fn.init.call(l, e, t), t = l.options, l._distance = t.max - t.min, l._isHorizontal = "horizontal" == t.orientation, l._isRtl = l._isHorizontal && f.support.isRtl(e), l._position = l._isHorizontal ? "left" : "bottom", l._size = l._isHorizontal ? "width" : "height", l._outerSize = l._isHorizontal ? "outerWidth" : "outerHeight", t.tooltip.format = t.tooltip.enabled ? t.tooltip.format || "{0}" : "{0}", l._createHtml(), l.wrapper = l.element.closest(".k-slider"), l._trackDiv = l.wrapper.find(N), l._setTrackDivWidth(), l._maxSelection = l._trackDiv[l._size](), n = l._maxSelection / ((t.max - t.min) / t.smallStep), i = l._calculateItemsWidth(w.floor(l._distance / t.smallStep)), "none" != t.tickPlacement && n >= 2 && (l._trackDiv.before(r(t, l._distance)), l._setItemsWidth(i), l._setItemsTitle(), l._setItemsLargeTick()), l._calculateSteps(i), l._tabindex(l.wrapper.find(M)), l[t.enabled ? "enable" : "disable"](), o = f.support.isRtl(l.wrapper) ? -1 : 1, l._keyMap = {
37: a(-1 * o * t.smallStep),
40: a(-t.smallStep),
39: a(1 * o * t.smallStep),
38: a(+t.smallStep),
35: s(t.max),
36: s(t.min),
33: a(+t.largeStep),
34: a(-t.largeStep)
}, f.notify(l)
},
events: [C, T],
options: {
enabled: !0,
min: 0,
max: 10,
smallStep: 1,
largeStep: 5,
orientation: "horizontal",
tickPlacement: "both",
tooltip: {
enabled: !0,
format: "{0}"
}
},
_setTrackDivWidth: function () {
var e = this,
t = 2 * parseFloat(e._trackDiv.css(e._isRtl ? "right" : e._position), 10);
e._trackDiv[e._size](e.wrapper[e._size]() - 2 - t)
},
_setItemsWidth: function (t) {
var n, i = this,
r = i.options,
o = 0,
a = t.length - 1,
s = i.wrapper.find(B),
l = 0,
d = 2,
c = s.length,
u = 0;
for (n = 0; c - 2 > n; n++) e(s[n + 1])[i._size](t[n]);
if (i._isHorizontal ? (e(s[o]).addClass("k-first")[i._size](t[a - 1]), e(s[a]).addClass("k-last")[i._size](t[a])) : (e(s[a]).addClass("k-first")[i._size](t[a]), e(s[o]).addClass("k-last")[i._size](t[a - 1])), 0 !== i._distance % r.smallStep && !i._isHorizontal) {
for (n = 0; t.length > n; n++) u += t[n];
l = i._maxSelection - u, l += parseFloat(i._trackDiv.css(i._position), 10) + d, i.wrapper.find(".k-slider-items").css("padding-top", l)
}
},
_setItemsTitle: function () {
for (var t = this, n = t.options, i = t.wrapper.find(B), r = n.min, o = i.length, a = t._isHorizontal && !t._isRtl ? 0 : o - 1, s = t._isHorizontal && !t._isRtl ? o : -1, l = t._isHorizontal && !t._isRtl ? 1 : -1; 0 !== a - s; a += l) e(i[a]).attr("title", v(n.tooltip.format, d(r))), r += n.smallStep
},
_setItemsLargeTick: function () {
var t, n = this,
i = n.options,
r = n.wrapper.find(B),
o = {}, a = d(i.largeStep / i.smallStep);
if (0 === 1e3 * i.largeStep % (1e3 * i.smallStep))
if (n._isHorizontal && !n._isRtl)
for (t = 0; r.length > t; t = d(t + a)) o = e(r[t]), o.addClass("k-tick-large").html("" + o.attr("title") + "");
else
for (t = r.length - 1; t >= 0; t = d(t - a)) o = e(r[t]), o.addClass("k-tick-large").html("" + o.attr("title") + ""), n._isRtl || 0 !== t && t !== r.length - 1 && o.css("line-height", o[n._size]() + "px")
},
_calculateItemsWidth: function (e) {
var t, n, i, r = this,
o = r.options,
a = parseFloat(r._trackDiv.css(r._size)) + 1,
s = a / r._distance;
for (r._distance / o.smallStep - w.floor(r._distance / o.smallStep) > 0 && (a -= r._distance % o.smallStep * s), t = a / e, n = [], i = 0; e - 1 > i; i++) n[i] = t;
return n[e - 1] = n[e] = t / 2, r._roundWidths(n)
},
_roundWidths: function (e) {
var t, n = 0,
i = e.length;
for (t = 0; i > t; t++) n += e[t] - w.floor(e[t]), e[t] = w.floor(e[t]);
return n = w.round(n), this._addAdditionalSize(n, e)
},
_addAdditionalSize: function (e, t) {
if (0 === e) return t;
var n, i = parseFloat(t.length - 1) / parseFloat(1 == e ? e : e - 1);
for (n = 0; e > n; n++) t[parseInt(w.round(i * n), 10)] += 1;
return t
},
_calculateSteps: function (e) {
var t, n = this,
i = n.options,
r = i.min,
o = 0,
a = w.ceil(n._distance / i.smallStep),
s = 1;
if (a += 0 === n._distance / i.smallStep % 1 ? 1 : 0, e.splice(0, 0, 2 * e[a - 2]), e.splice(a - 1, 1, 2 * e.pop()), n._pixelSteps = [o], n._values = [r], 0 !== a) {
for (; a > s;) o += (e[s - 1] + e[s]) / 2, n._pixelSteps[s] = o, n._values[s] = r += i.smallStep, s++;
t = 0 === n._distance % i.smallStep ? a - 1 : a, n._pixelSteps[t] = n._maxSelection, n._values[t] = i.max, n._isRtl && (n._pixelSteps.reverse(), n._values.reverse())
}
},
_getValueFromPosition: function (e, t) {
var n, i = this,
r = i.options,
o = w.max(r.smallStep * (i._maxSelection / i._distance), 0),
a = 0,
s = o / 2;
if (i._isHorizontal ? (a = e - t.startPoint, i._isRtl && (a = i._maxSelection - a)) : a = t.startPoint - e, a > i._maxSelection - (parseInt(i._maxSelection % o, 10) - 3) / 2) return r.max;
for (n = 0; i._pixelSteps.length > n; n++)
if (s >= w.abs(i._pixelSteps[n] - a) - 1) return d(i._values[n])
},
_getFormattedValue: function (e, t) {
var n, i, r, o = this,
a = "",
s = o.options.tooltip;
return y(e) ? (i = e[0], r = e[1]) : t && t.type && (i = t.selectionStart, r = t.selectionEnd), t && (n = t.tooltipTemplate), !n && s.template && (n = f.template(s.template)), y(e) || t && t.type ? n ? a = n({
selectionStart: i,
selectionEnd: r
}) : (i = v(s.format, i), r = v(s.format, r), a = i + " - " + r) : (t && (t.val = e), a = n ? n({
value: e
}) : v(s.format, e)), a
},
_getDraggableArea: function () {
var e = this,
t = f.getOffset(e._trackDiv);
return {
startPoint: e._isHorizontal ? t.left : t.top + e._maxSelection,
endPoint: e._isHorizontal ? t.left + e._maxSelection : t.top
}
},
_createHtml: function () {
var e = this,
t = e.element,
r = e.options,
a = t.find("input");
2 == a.length ? (a.eq(0).val(r.selectionStart), a.eq(1).val(r.selectionEnd)) : t.val(r.value), t.wrap(n(r, t, e._isHorizontal)).hide(), r.showButtons && t.before(i(r, "increase", e._isHorizontal)).before(i(r, "decrease", e._isHorizontal)), t.before(o(r, t))
},
_focus: function (t) {
var n = this,
i = t.target,
r = n.value(),
o = n._drag;
o || (i == n.wrapper.find(M).eq(0)[0] ? (o = n._firstHandleDrag, n._activeHandle = 0) : (o = n._lastHandleDrag, n._activeHandle = 1), r = r[n._activeHandle]), e(i).addClass(L), o && (n._activeHandleDrag = o, o.selectionStart = n.options.selectionStart, o.selectionEnd = n.options.selectionEnd, o._updateTooltip(r))
},
_focusWithMouse: function (t) {
var n = this,
i = e(t.target),
r = i.is(M) ? i.index() : 0;
window.setTimeout(function () {
n.wrapper.find(M)[2 == r ? 1 : 0].focus()
}, 1), n._setTooltipTimeout()
},
_blur: function (t) {
var n = this,
i = n._activeHandleDrag;
e(t.target).removeClass(L), i && (i._removeTooltip(), delete n._activeHandleDrag, delete n._activeHandle)
},
_setTooltipTimeout: function () {
var e = this;
e._tooltipTimeout = window.setTimeout(function () {
var t = e._drag || e._activeHandleDrag;
t && t._removeTooltip()
}, 300)
},
_clearTooltipTimeout: function () {
var e, t = this;
window.clearTimeout(this._tooltipTimeout), e = t._drag || t._activeHandleDrag, e && e.tooltipDiv && e.tooltipDiv.stop(!0, !1).css("opacity", 1)
}
}),
Q = Y.extend({
init: function (n, i) {
var r, o = this;
n.type = "text", i = m({}, {
value: c(n, "value"),
min: c(n, "min"),
max: c(n, "max"),
smallStep: c(n, "step")
}, i), n = e(n), i && i.enabled === t && (i.enabled = !n.is("[disabled]")), Y.fn.init.call(o, n, i), i = o.options, u(i.value) && null !== i.value || (i.value = i.min, n.val(i.min)), i.value = w.max(w.min(i.value, i.max), i.min), r = o.wrapper.find(M), new Q.Selection(r, o, i), o._drag = new Q.Drag(r, "", o, i)
},
options: {
name: "Slider",
showButtons: !0,
increaseButtonTitle: "Increase",
decreaseButtonTitle: "Decrease",
dragHandleTitle: "drag",
tooltip: {
format: "{0}"
},
value: null
},
enable: function (n) {
var i, r, o, a = this,
s = a.options;
a.disable(), n !== !1 && (a.wrapper.removeClass(U).addClass(V), a.wrapper.find("input").removeAttr(j), i = function (n) {
var i, r, o, s = $(n)[0];
if (s) {
if (i = a._isHorizontal ? s.location.pageX : s.location.pageY, r = a._getDraggableArea(), o = e(n.target), o.hasClass("k-draghandle")) return o.addClass(L), t;
a._update(a._getValueFromPosition(i, r)), a._focusWithMouse(n), a._drag.dragstart(n), n.preventDefault()
}
}, a.wrapper.find(B + ", " + N).on(F, i).end().on(F, function () {
e(document.documentElement).one("selectstart", f.preventDefault)
}).on(I, function () {
a._drag._end()
}), a.wrapper.find(M).attr(G, 0).on(D, function () {
a._setTooltipTimeout()
}).on(z, function (e) {
a._focusWithMouse(e), e.preventDefault()
}).on(R, b(a._focus, a)).on(O, b(a._blur, a)), r = b(function (e) {
var t = a._nextValueByIndex(a._valueIndex + 1 * e);
a._setValueInRange(t), a._drag._updateTooltip(t)
}, a), s.showButtons && (o = b(function (e, t) {
this._clearTooltipTimeout(), (1 === e.which || x.touch && 0 === e.which) && (r(t), this.timeout = setTimeout(b(function () {
this.timer = setInterval(function () {
r(t)
}, 60)
}, this), 200))
}, a), a.wrapper.find(".k-button").on(D, b(function (e) {
this._clearTimer(), a._focusWithMouse(e)
}, a)).on(H, function (t) {
e(t.currentTarget).addClass("k-state-hover")
}).on("mouseout" + S, b(function (t) {
e(t.currentTarget).removeClass("k-state-hover"), this._clearTimer()
}, a)).eq(0).on(A, b(function (e) {
o(e, 1)
}, a)).click(!1).end().eq(1).on(A, b(function (e) {
o(e, -1)
}, a)).click(f.preventDefault)), a.wrapper.find(M).off(P, !1).on(P, b(this._keydown, a)), s.enabled = !0)
},
disable: function () {
var t = this;
t.wrapper.removeClass(V).addClass(U), e(t.element).prop(j, j), t.wrapper.find(".k-button").off(A).on(A, f.preventDefault).off(D).on(D, f.preventDefault).off("mouseleave" + S).on("mouseleave" + S, f.preventDefault).off(H).on(H, f.preventDefault), t.wrapper.find(B + ", " + N).off(F).off(I), t.wrapper.find(M).attr(G, -1).off(D).off(P).off(z).off(R).off(O), t.options.enabled = !1
},
_update: function (e) {
var t = this,
n = t.value() != e;
t.value(e), n && t.trigger(C, {
value: t.options.value
})
},
value: function (e) {
var n = this,
i = n.options;
return e = d(e), isNaN(e) ? i.value : (e >= i.min && i.max >= e && i.value != e && (n.element.prop("value", l(e)), i.value = e, n._refreshAriaAttr(e), n._refresh()), t)
},
_refresh: function () {
this.trigger(E, {
value: this.options.value
})
},
_refreshAriaAttr: function (e) {
var t, n = this,
i = n._drag;
t = i && i._tooltipDiv ? i._tooltipDiv.text() : n._getFormattedValue(e, null), this.wrapper.find(M).attr("aria-valuenow", e).attr("aria-valuetext", t)
},
_clearTimer: function () {
clearTimeout(this.timeout), clearInterval(this.timer)
},
_keydown: function (e) {
var t = this;
e.keyCode in t._keyMap && (t._clearTooltipTimeout(), t._setValueInRange(t._keyMap[e.keyCode](t.options.value)), t._drag._updateTooltip(t.value()), e.preventDefault())
},
_setValueInRange: function (e) {
var n = this,
i = n.options;
return e = d(e), isNaN(e) ? (n._update(i.min), t) : (e = w.max(w.min(e, i.max), i.min), n._update(e), t)
},
_nextValueByIndex: function (e) {
var t = this._values.length;
return this._isRtl && (e = t - 1 - e), this._values[w.max(0, w.min(e, t - 1))]
},
destroy: function () {
var e = this;
h.fn.destroy.call(e), e.wrapper.off(S).find(".k-button").off(S).end().find(M).off(S).end().find(B + ", " + N).off(S).end(), e._drag.draggable.destroy()
}
});
Q.Selection = function (e, t, n) {
function i(i) {
var r = i - n.min,
o = t._valueIndex = w.ceil(d(r / n.smallStep)),
a = parseInt(t._pixelSteps[o], 10),
s = t._trackDiv.find(".k-slider-selection"),
l = parseInt(e[t._outerSize]() / 2, 10),
c = t._isRtl ? 2 : 0;
s[t._size](t._isRtl ? t._maxSelection - a : a), e.css(t._position, a - l - c)
}
i(n.value), t.bind([C, T, E], function (e) {
i(parseFloat(e.value, 10))
})
}, Q.Drag = function (e, t, n, i) {
var r = this;
r.owner = n, r.options = i, r.dragHandle = e, r.dragHandleSize = e[n._outerSize](), r.type = t, r.draggable = new g(e, {
distance: 0,
dragstart: b(r._dragstart, r),
drag: b(r.drag, r),
dragend: b(r.dragend, r),
dragcancel: b(r.dragcancel, r)
}), e.click(!1)
}, Q.Drag.prototype = {
dragstart: function (e) {
this.draggable.userEvents._start(e)
},
_dragstart: function (n) {
var i = this,
r = i.owner,
o = i.options;
return o.enabled ? (r.element.off(H), i.dragHandle.addClass(L), e(document.documentElement).css("cursor", "pointer"), i.dragableArea = r._getDraggableArea(), i.step = w.max(o.smallStep * (r._maxSelection / r._distance), 0), i.type ? (i.selectionStart = o.selectionStart, i.selectionEnd = o.selectionEnd, r._setZIndex(i.type)) : i.oldVal = i.val = o.value, i._removeTooltip(!0), i._createTooltip(), t) : (n.preventDefault(), t)
},
_createTooltip: function () {
var t, n, i = this,
r = i.owner,
o = i.options.tooltip,
a = "",
s = e(window);
o.enabled && (o.template && (t = i.tooltipTemplate = f.template(o.template)), e(".k-slider-tooltip").remove(), i.tooltipDiv = e("").appendTo(document.body), a = r._getFormattedValue(i.val || r.value(), i), i.type || (n = "k-callout-" + (r._isHorizontal ? "s" : "e"), i.tooltipInnerDiv = "", a += i.tooltipInnerDiv), i.tooltipDiv.html(a), i._scrollOffset = {
top: s.scrollTop(),
left: s.scrollLeft()
}, i.moveTooltip())
},
drag: function (e) {
var t, n = this,
i = n.owner,
r = e.x.location,
o = e.y.location,
a = n.dragableArea.startPoint,
s = n.dragableArea.endPoint;
e.preventDefault(), n.val = i._isHorizontal ? i._isRtl ? n.constrainValue(r, a, s, s > r) : n.constrainValue(r, a, s, r >= s) : n.constrainValue(o, s, a, s >= o), n.oldVal != n.val && (n.oldVal = n.val, n.type ? ("firstHandle" == n.type ? n.selectionStart = n.val < n.selectionEnd ? n.val : n.selectionEnd = n.val : n.val > n.selectionStart ? n.selectionEnd = n.val : n.selectionStart = n.selectionEnd = n.val, t = {
values: [n.selectionStart, n.selectionEnd],
value: [n.selectionStart, n.selectionEnd]
}) : t = {
value: n.val
}, i.trigger(T, t)), n._updateTooltip(n.val)
},
_updateTooltip: function (e) {
var t = this,
n = t.options,
i = n.tooltip,
r = "";
i.enabled && (t.tooltipDiv || t._createTooltip(), r = t.owner._getFormattedValue(d(e), t), t.type || (r += t.tooltipInnerDiv), t.tooltipDiv.html(r), t.moveTooltip())
},
dragcancel: function () {
return this.owner._refresh(), e(document.documentElement).css("cursor", ""), this._end()
},
dragend: function () {
var t = this,
n = t.owner;
return e(document.documentElement).css("cursor", ""), t.type ? n._update(t.selectionStart, t.selectionEnd) : n._update(t.val), t._end()
},
_end: function () {
var e = this,
t = e.owner;
return t._focusWithMouse({
target: e.dragHandle[0]
}), t.element.on(H), !1
},
_removeTooltip: function (t) {
var n = this,
i = n.owner;
n.tooltipDiv && i.options.tooltip.enabled && i.options.enabled && (t ? (n.tooltipDiv.remove(), n.tooltipDiv = null) : n.tooltipDiv.fadeOut("slow", function () {
e(this).remove(), n.tooltipDiv = null
}))
},
moveTooltip: function () {
var t, n, i, r, o = this,
a = o.owner,
s = 0,
l = 0,
d = o.dragHandle,
c = f.getOffset(d),
u = 8,
p = e(window),
h = o.tooltipDiv.find(".k-callout"),
g = o.tooltipDiv.outerWidth(),
m = o.tooltipDiv.outerHeight();
o.type ? (t = a.wrapper.find(M), c = f.getOffset(t.eq(0)), n = f.getOffset(t.eq(1)), a._isHorizontal ? (s = n.top, l = c.left + (n.left - c.left) / 2) : (s = c.top + (n.top - c.top) / 2, l = n.left), r = t.eq(0).outerWidth() + 2 * u) : (s = c.top, l = c.left, r = d.outerWidth() + 2 * u), a._isHorizontal ? (l -= parseInt((g - d[a._outerSize]()) / 2, 10), s -= m + h.height() + u) : (s -= parseInt((m - d[a._outerSize]()) / 2, 10), l -= g + h.width() + u), a._isHorizontal ? (i = o._flip(s, m, r, p.outerHeight() + o._scrollOffset.top), s += i, l += o._fit(l, g, p.outerWidth() + o._scrollOffset.left)) : (i = o._flip(l, g, r, p.outerWidth() + o._scrollOffset.left), s += o._fit(s, m, p.outerHeight() + o._scrollOffset.top), l += i), i > 0 && h && (h.removeClass(), h.addClass("k-callout k-callout-" + (a._isHorizontal ? "n" : "w"))), o.tooltipDiv.css({
top: s,
left: l
})
},
_fit: function (e, t, n) {
var i = 0;
return e + t > n && (i = n - (e + t)), 0 > e && (i = -e), i
},
_flip: function (e, t, n, i) {
var r = 0;
return e + t > i && (r += -(n + t)), 0 > e + r && (r += n + t), r
},
constrainValue: function (e, t, n, i) {
var r = this,
o = 0;
return o = e > t && n > e ? r.owner._getValueFromPosition(e, r.dragableArea) : i ? r.options.max : r.options.min
}
}, f.ui.plugin(Q), p = Y.extend({
init: function (n, i) {
var r, o = this,
a = e(n).find("input"),
s = a.eq(0)[0],
l = a.eq(1)[0];
s.type = "text", l.type = "text", i = m({}, {
selectionStart: c(s, "value"),
min: c(s, "min"),
max: c(s, "max"),
smallStep: c(s, "step")
}, {
selectionEnd: c(l, "value"),
min: c(l, "min"),
max: c(l, "max"),
smallStep: c(l, "step")
}, i), i && i.enabled === t && (i.enabled = !a.is("[disabled]")), Y.fn.init.call(o, n, i), i = o.options, u(i.selectionStart) && null !== i.selectionStart || (i.selectionStart = i.min, a.eq(0).val(i.min)), u(i.selectionEnd) && null !== i.selectionEnd || (i.selectionEnd = i.max, a.eq(1).val(i.max)), r = o.wrapper.find(M), new p.Selection(r, o, i), o._firstHandleDrag = new Q.Drag(r.eq(0), "firstHandle", o, i), o._lastHandleDrag = new Q.Drag(r.eq(1), "lastHandle", o, i)
},
options: {
name: "RangeSlider",
leftDragHandleTitle: "drag",
rightDragHandleTitle: "drag",
tooltip: {
format: "{0}"
},
selectionStart: null,
selectionEnd: null
},
enable: function (n) {
var i, r = this,
o = r.options;
r.disable(), n !== !1 && (r.wrapper.removeClass(U).addClass(V), r.wrapper.find("input").removeAttr(j), i = function (n) {
var i, a, s, l, d, c = $(n)[0];
if (c) {
if (a = r._isHorizontal ? c.location.pageX : c.location.pageY, s = r._getDraggableArea(), l = r._getValueFromPosition(a, s), d = e(n.target), d.hasClass("k-draghandle")) return d.addClass(L), t;
o.selectionStart > l ? (r._setValueInRange(l, o.selectionEnd), r._firstHandleDrag.dragstart(n), i = 0) : l > r.selectionEnd ? (r._setValueInRange(o.selectionStart, l), r._lastHandleDrag.dragstart(n), i = 1) : l - o.selectionStart <= o.selectionEnd - l ? (r._setValueInRange(l, o.selectionEnd), r._firstHandleDrag.dragstart(n), i = 0) : (r._setValueInRange(o.selectionStart, l), r._lastHandleDrag.dragstart(n), i = 1), r._focusWithMouse({
target: r.wrapper.find(M)[i]
})
}
}, r.wrapper.find(B + ", " + N).on(F, i).end().on(F, function () {
e(document.documentElement).one("selectstart", f.preventDefault)
}).on(I, function () {
r._drag._end()
}), r.wrapper.find(M).attr(G, 0).on(D, function () {
r._setTooltipTimeout()
}).on(z, function (e) {
r._focusWithMouse(e), e.preventDefault()
}).on(R, b(r._focus, r)).on(O, b(r._blur, r)), r.wrapper.find(M).off(P, f.preventDefault).eq(0).on(P, b(function (e) {
this._keydown(e, "firstHandle")
}, r)).end().eq(1).on(P, b(function (e) {
this._keydown(e, "lastHandle")
}, r)), r.options.enabled = !0)
},
disable: function () {
var e = this;
e.wrapper.removeClass(V).addClass(U), e.wrapper.find("input").prop(j, j), e.wrapper.find(B + ", " + N).off(F).off(I), e.wrapper.find(M).attr(G, -1).off(D).off(P).off(z).off(R).off(O), e.options.enabled = !1
},
_keydown: function (e, t) {
var n, i, r, o = this,
a = o.options.selectionStart,
s = o.options.selectionEnd;
e.keyCode in o._keyMap && (o._clearTooltipTimeout(), "firstHandle" == t ? (r = o._activeHandleDrag = o._firstHandleDrag, a = o._keyMap[e.keyCode](a), a > s && (s = a)) : (r = o._activeHandleDrag = o._lastHandleDrag, s = o._keyMap[e.keyCode](s), a > s && (a = s)), o._setValueInRange(a, s), n = Math.max(a, o.options.selectionStart), i = Math.min(s, o.options.selectionEnd), r.selectionEnd = Math.max(i, o.options.selectionStart), r.selectionStart = Math.min(n, o.options.selectionEnd), r._updateTooltip(o.value()[o._activeHandle]), e.preventDefault())
},
_update: function (e, t) {
var n = this,
i = n.value(),
r = i[0] != e || i[1] != t;
n.value([e, t]), r && n.trigger(C, {
values: [e, t],
value: [e, t]
})
},
value: function (e) {
return e && e.length ? this._value(e[0], e[1]) : this._value()
},
_value: function (e, n) {
var i = this,
r = i.options,
o = r.selectionStart,
a = r.selectionEnd;
return isNaN(e) && isNaN(n) ? [o, a] : (e = d(e), n = d(n), e >= r.min && r.max >= e && n >= r.min && r.max >= n && n >= e && (o != e || a != n) && (i.element.find("input").eq(0).prop("value", l(e)).end().eq(1).prop("value", l(n)), r.selectionStart = e, r.selectionEnd = n, i._refresh(), i._refreshAriaAttr(e, n)), t)
},
values: function (e, t) {
return y(e) ? this._value(e[0], e[1]) : this._value(e, t)
},
_refresh: function () {
var e = this,
t = e.options;
e.trigger(E, {
values: [t.selectionStart, t.selectionEnd],
value: [t.selectionStart, t.selectionEnd]
}), t.selectionStart == t.max && t.selectionEnd == t.max && e._setZIndex("firstHandle")
},
_refreshAriaAttr: function (e, t) {
var n, i = this,
r = i.wrapper.find(M),
o = i._activeHandleDrag;
n = i._getFormattedValue([e, t], o), r.eq(0).attr("aria-valuenow", e), r.eq(1).attr("aria-valuenow", t), r.attr("aria-valuetext", n)
},
_setValueInRange: function (e, t) {
var n = this.options;
e = w.max(w.min(e, n.max), n.min), t = w.max(w.min(t, n.max), n.min), e == n.max && t == n.max && this._setZIndex("firstHandle"), this._update(w.min(e, t), w.max(e, t))
},
_setZIndex: function (t) {
this.wrapper.find(M).each(function (n) {
e(this).css("z-index", "firstHandle" == t ? 1 - n : n)
})
},
destroy: function () {
var e = this;
h.fn.destroy.call(e), e.wrapper.off(S).find(B + ", " + N).off(S).end().find(M).off(S), e._firstHandleDrag.draggable.destroy(), e._lastHandleDrag.draggable.destroy()
}
}), p.Selection = function (e, t, n) {
function i(i) {
i = i || [];
var o = i[0] - n.min,
a = i[1] - n.min,
s = w.ceil(d(o / n.smallStep)),
l = w.ceil(d(a / n.smallStep)),
c = t._pixelSteps[s],
u = t._pixelSteps[l],
p = parseInt(e.eq(0)[t._outerSize]() / 2, 10),
f = t._isRtl ? 2 : 0;
e.eq(0).css(t._position, c - p - f).end().eq(1).css(t._position, u - p - f), r(c, u)
}
function r(e, n) {
var i, r, o = t._trackDiv.find(".k-slider-selection");
i = w.abs(e - n), o[t._size](i), t._isRtl ? (r = w.max(e, n), o.css("right", t._maxSelection - r - 1)) : (r = w.min(e, n), o.css(t._position, r - 1))
}
i(t.value()), t.bind([C, T, E], function (e) {
i(e.values)
})
}, f.ui.plugin(p)
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
return m.test(e)
}
function i(e) {
return g.test(e) || /^\d+$/.test(e)
}
function r(e) {
return !n(e) && !i(e)
}
function o(e, n) {
return function (i, r) {
var o, a = this.element.find(i).data(A);
return 1 == arguments.length ? a[e] : (a[e] = r, n && (o = this.element.data("kendoSplitter"), o.trigger(w)), t)
}
}
function a(e) {
var t = this,
n = e.orientation;
t.owner = e, t._element = e.element, t.orientation = n, p(t, n === k ? l : s), t._resizable = new d.ui.Resizable(e.element, {
orientation: n,
handle: ".k-splitbar-draggable-" + n + "[data-marker=" + e._marker + "]",
hint: f(t._createHint, t),
start: f(t._start, t),
max: f(t._max, t),
min: f(t._min, t),
invalidClass: "k-restricted-size-" + n,
resizeend: f(t._stop, t)
})
}
var s, l, d = window.kendo,
c = d.ui,
u = d.keys,
p = e.extend,
f = e.proxy,
h = c.Widget,
g = /^\d+(\.\d+)?px$/i,
m = /^\d+(\.\d+)?%$/i,
v = ".kendoSplitter",
_ = "expand",
b = "collapse",
y = "contentLoad",
w = "resize",
x = "layoutChange",
k = "horizontal",
C = "vertical",
T = "mouseenter",
S = "click",
A = "pane",
F = "mouseleave",
D = "k-state-focused",
I = "k-" + A,
E = "." + I,
P = h.extend({
init: function (t, n) {
var i, r = this;
h.fn.init.call(r, t, n), r.wrapper = r.element, i = r.options.orientation.toLowerCase() != C, r.orientation = i ? k : C, r._dimension = i ? "width" : "height", r._keys = {
decrease: i ? u.LEFT : u.UP,
increase: i ? u.RIGHT : u.DOWN
}, r._resizeStep = 10, r.bind(w, f(r._resize, r)), r._marker = d.guid().substring(0, 8), r._initPanes(), r._resizeHandler = function () {
r.trigger(w), r._detachEvents(), r._attachEvents()
}, r._attachEvents(), e(window).on("resize", r._resizeHandler), r.element.children(".k-splitbar-draggable-" + r.orientation).length && (r.resizing = new a(r)), r.element.triggerHandler("init" + v)
},
events: [_, b, y, w, x],
_parentSplitter: function () {
return this.element.parent().closest(".k-splitter")
},
_attachEvents: function () {
var t = this,
n = t.options.orientation;
t.element.children(".k-splitbar-draggable-" + n).on("keydown" + v, e.proxy(t._keydown, t)).on("mousedown" + v, function (e) {
e.currentTarget.focus()
}).on("focus" + v, function (t) {
e(t.currentTarget).addClass(D)
}).on("blur" + v, function (n) {
e(n.currentTarget).removeClass(D), t.resizing && t.resizing.end()
}).on(T + v, function () {
e(this).addClass("k-splitbar-" + t.orientation + "-hover")
}).on(F + v, function () {
e(this).removeClass("k-splitbar-" + t.orientation + "-hover")
}).on("mousedown" + v, function () {
t._panes().append("")
}).on("mouseup" + v, function () {
t._panes().children(".k-splitter-overlay").remove()
}).end().children(".k-splitbar").on("dblclick" + v, f(t._togglePane, t)).children(".k-collapse-next, .k-collapse-prev").on(S + v, t._arrowClick(b)).end().children(".k-expand-next, .k-expand-prev").on(S + v, t._arrowClick(_)).end().end(), t._parentSplitter().each(function () {
var n = e(this),
i = n.data("kendoSplitter");
i ? i.bind(w, t._resizeHandler) : n.off("init" + v).one("init" + v, function () {
e(this).data("kendoSplitter").bind(w, t._resizeHandler), t._resizeHandler()
})
})
},
_detachEvents: function () {
var e = this,
t = e._parentSplitter().data("kendoSplitter");
e.element.children(".k-splitbar-draggable-" + e.orientation).off(v).end().children(".k-splitbar").off("dblclick" + v).children(".k-collapse-next, .k-collapse-prev, .k-expand-next, .k-expand-prev").off(v), t && t.unbind(w, e._resizeHandler)
},
options: {
name: "Splitter",
orientation: k,
panes: []
},
destroy: function () {
var t = this;
h.fn.destroy.call(t), t._detachEvents(), t.resizing && t.resizing.destroy(), e(window).off("resize", t._resizeHandler), d.destroy(t.element)
},
_keydown: function (t) {
var n, i = this,
r = t.keyCode,
o = i.resizing,
a = e(t.currentTarget),
s = i._keys,
l = r === s.increase,
d = r === s.decrease;
l || d ? (t.ctrlKey ? (n = a[d ? "next" : "prev"](), o && o.isResizing() && o.end(), n[i._dimension]() ? i._triggerAction(b, a[d ? "prev" : "next"]()) : i._triggerAction(_, n)) : o && o.move((d ? -1 : 1) * i._resizeStep, a), t.preventDefault()) : r === u.ENTER && o && (o.end(), t.preventDefault())
},
_initPanes: function () {
var t = this,
n = t.options.panes || [];
t.element.addClass("k-widget").addClass("k-splitter").children(":not(script)").each(function (i, r) {
var o = n && n[i];
r = e(r).attr("role", "group").addClass(I), r.data(A, o ? o : {}).toggleClass("k-scrollable", o ? o.scrollable !== !1 : !0), t.ajaxRequest(r)
}).end(), t.trigger(w)
},
ajaxRequest: function (e, t, n) {
var i, r = this;
e = r.element.find(e), i = e.data(A), t = t || i.contentUrl, t && (e.append(""), d.isLocalUrl(t) ? jQuery.ajax({
url: t,
data: n || {},
type: "GET",
dataType: "html",
success: function (t) {
e.html(t), r.trigger(y, {
pane: e[0]
})
}
}) : e.removeClass("k-scrollable").html(""))
},
_triggerAction: function (e, t) {
this.trigger(e, {
pane: t[0]
}) || this[e](t[0])
},
_togglePane: function (t) {
var n, i = this,
r = e(t.target);
r.closest(".k-splitter")[0] == i.element[0] && (n = r.children(".k-icon:not(.k-resize-handle)"), 1 === n.length && (n.is(".k-collapse-prev") ? i._triggerAction(b, r.prev()) : n.is(".k-collapse-next") ? i._triggerAction(b, r.next()) : n.is(".k-expand-prev") ? i._triggerAction(_, r.prev()) : n.is(".k-expand-next") && i._triggerAction(_, r.next())))
},
_arrowClick: function (t) {
var n = this;
return function (i) {
var r, o = e(i.target);
o.closest(".k-splitter")[0] == n.element[0] && (r = o.is(".k-" + t + "-prev") ? o.parent().prev() : o.parent().next(), n._triggerAction(t, r))
}
},
_updateSplitBar: function (e, t, n) {
var i = function (e, t) {
return t ? "" : ""
}, r = this.orientation,
o = t.resizable !== !1 && n.resizable !== !1,
a = t.collapsible,
s = t.collapsed,
l = n.collapsible,
d = n.collapsed;
e.addClass("k-splitbar k-state-default k-splitbar-" + r).attr("role", "separator").attr("aria-expanded", !(s || d)).removeClass("k-splitbar-" + r + "-hover").toggleClass("k-splitbar-draggable-" + r, o && !s && !d).toggleClass("k-splitbar-static-" + r, !o && !a && !l).html(i("k-collapse-prev", a && !s && !d) + i("k-expand-prev", a && s && !d) + i("k-resize-handle", o) + i("k-collapse-next", l && !d && !s) + i("k-expand-next", l && d && !s))
},
_updateSplitBars: function () {
var t = this;
this.element.children(".k-splitbar").each(function () {
var n = e(this),
i = n.prev(E).data(A),
r = n.next(E).data(A);
r && t._updateSplitBar(n, i, r)
})
},
_panes: function () {
return this.element.children(E)
},
_resize: function () {
var i, o, a, s, l, d, c, u, p, f, h = this,
g = h.element,
m = g.children(":not(.k-splitbar)"),
v = h.orientation == k,
_ = g.children(".k-splitbar"),
b = _.length,
y = v ? "width" : "height",
w = g[y]();
0 === b ? (b = m.length - 1, m.slice(0, b).after(""), h._updateSplitBars(), _ = g.children(".k-splitbar")) : h._updateSplitBars(), _.each(function () {
w -= this[v ? "offsetWidth" : "offsetHeight"]
}), i = 0, o = 0, a = e(), m.css({
position: "absolute",
top: 0
})[y](function () {
var s, l = e(this).data(A) || {};
if (l.collapsed) s = 0, e(this).css("overflow", "hidden");
else {
if (r(l.size)) return a = a.add(this), t;
s = parseInt(l.size, 10), n(l.size) && (s = Math.floor(s * w / 100))
}
return o++, i += s, s
}), w -= i, s = a.length, l = Math.floor(w / s), a.slice(0, s - 1).css(y, l).end().eq(s - 1).css(y, w - (s - 1) * l), d = 0, c = v ? "height" : "width", u = v ? "left" : "top", p = v ? "offsetWidth" : "offsetHeight", 0 === s && (f = m.filter(function () {
return !(e(this).data(A) || {}).collapsed
}).last(), f[y](w + f[0][p])), g.children().css(c, g[c]()).each(function (e, t) {
t.style[u] = Math.floor(d) + "px", d += t[p]
}), h.trigger(x)
},
toggle: function (e, n) {
var i;
e = this.element.find(e), i = e.data(A), (n || i.collapsible) && (1 == arguments.length && (n = i.collapsed === t ? !1 : i.collapsed), i.collapsed = !n, i.collapsed ? e.css("overflow", "hidden") : e.css("overflow", ""), this.trigger(w), this.resizing && this.resizing.destroy(), this._detachEvents(), this._attachEvents(), this.element.children(".k-splitbar-draggable-" + this.orientation).length && (this.resizing = new a(this)))
},
collapse: function (e) {
this.toggle(e, !1)
},
expand: function (e) {
this.toggle(e, !0)
},
size: o("size", !0),
min: o("min"),
max: o("max")
});
c.plugin(P), s = {
sizingProperty: "height",
sizingDomProperty: "offsetHeight",
alternateSizingProperty: "width",
positioningProperty: "top",
mousePositioningProperty: "pageY"
}, l = {
sizingProperty: "width",
sizingDomProperty: "offsetWidth",
alternateSizingProperty: "height",
positioningProperty: "left",
mousePositioningProperty: "pageX"
}, a.prototype = {
press: function (e) {
this._resizable.press(e)
},
move: function (e, t) {
this.pressed || (this.press(t), this.pressed = !0), this._resizable.target || this._resizable.press(t), this._resizable.move(e)
},
end: function () {
this._resizable.end(), this.pressed = !1
},
destroy: function () {
this._resizable.destroy()
},
isResizing: function () {
return this._resizable.resizing
},
_createHint: function (t) {
var n = this;
return e("").css(n.alternateSizingProperty, t[n.alternateSizingProperty]())
},
_start: function (t) {
var n = this,
r = e(t.currentTarget),
o = r.prev(),
a = r.next(),
s = o.data(A),
l = a.data(A),
d = parseInt(o[0].style[n.positioningProperty], 10),
c = parseInt(a[0].style[n.positioningProperty], 10) + a[0][n.sizingDomProperty] - r[0][n.sizingDomProperty],
u = parseInt(n._element.css(n.sizingProperty), 10),
p = function (e) {
var t = parseInt(e, 10);
return (i(e) ? t : u * t / 100) || 0
}, f = p(s.min),
h = p(s.max) || c - d,
g = p(l.min),
m = p(l.max) || c - d;
n.previousPane = o, n.nextPane = a, n._maxPosition = Math.min(c - g, d + h), n._minPosition = Math.max(d + f, c - m)
},
_max: function () {
return this._maxPosition
},
_min: function () {
return this._minPosition
},
_stop: function (t) {
var n, i, o, a, s, l, c, u, p = this,
f = e(t.currentTarget),
h = p.owner;
return h._panes().children(".k-splitter-overlay").remove(), t.keyCode !== d.keys.ESC && (n = t.position, i = f.prev(), o = f.next(), a = i.data(A), s = o.data(A), l = n - parseInt(i[0].style[p.positioningProperty], 10), c = parseInt(o[0].style[p.positioningProperty], 10) + o[0][p.sizingDomProperty] - n - f[0][p.sizingDomProperty], u = p._element.children(E).filter(function () {
return r(e(this).data(A).size)
}).length, (!r(a.size) || u > 1) && (r(a.size) && u--, a.size = l + "px"), (!r(s.size) || u > 1) && (s.size = c + "px"), h._resizeHandler()), !1
}
}
}(window.kendo.jQuery),
function (e, t) {
function n(t) {
return e.map(i(t), function (e) {
return e.name
}).join(", ")
}
function i(e) {
var t = e[0];
return t.files ? r(t.files) : [{
name: s(t.value),
extension: a(t.value),
size: null
}]
}
function r(t) {
return e.map(t, function (e) {
return o(e)
})
}
function o(e) {
var t = e.name || e.fileName;
return {
name: _.htmlEncode(t),
extension: a(t),
size: e.size || e.fileSize,
rawFile: e
}
}
function a(e) {
var t = e.match(w);
return t ? t[0] : ""
}
function s(e) {
var t = e.lastIndexOf("\\");
return -1 != t ? e.substr(t + 1) : e
}
function l(t, n, i) {
var r, o;
n._supportsRemove() && (r = t.data("fileNames"), o = e.map(r, function (e) {
return e.name
}), n._submitRemove(o, i, function (e, i, o) {
n._removeFileEntry(t), n.trigger(T, {
operation: "remove",
files: r,
response: e,
XMLHttpRequest: o
})
}, function (e) {
n.trigger(S, {
operation: "remove",
files: r,
XMLHttpRequest: e
}), y("Server response: " + e.responseText)
}))
}
function d(t, n, i) {
var r = !1,
o = "";
try {
o = e.parseJSON(c(t)), r = !0
} catch (a) {
i()
}
r && n(o)
}
function c(e) {
return (e === t || "" === e) && (e = "{}"), e
}
function u(e) {
e.stopPropagation(), e.preventDefault()
}
function p(e, t, n, i) {
var r, o;
e.on("dragenter" + t, function () {
n(), o = new Date, r || (r = setInterval(function () {
var e = new Date - o;
e > 100 && (i(), clearInterval(r), r = null)
}, 100))
}).on("dragover" + t, function () {
o = new Date
})
}
function f(e) {
return e.children(".k-icon").is(".k-loading, .k-success, .k-fail")
}
function h(t) {
return e(t.target).closest(".k-file")
}
function g() {
var n = {}, i = e("meta[name=csrf-token]").attr("content"),
r = e("meta[name=csrf-param]").attr("content");
return e("input[name^='__RequestVerificationToken']").each(function () {
n[this.name] = this.value
}), r !== t && i !== t && (n[r] = i), n
}
var m, v, _ = window.kendo,
b = _.ui.Widget,
y = _.logToConsole,
w = /\.([^\.]+)$/,
x = ".kendoUpload",
k = "select",
C = "upload",
T = "success",
S = "error",
A = "complete",
F = "cancel",
D = "progress",
I = "remove",
E = b.extend({
init: function (t, n) {
var i, r, o = this;
b.fn.init.call(o, t, n), o.name = t.name, o.multiple = o.options.multiple, o.localization = o.options.localization, i = o.element, o.wrapper = i.closest(".k-upload"), 0 === o.wrapper.length && (o.wrapper = o._wrapInput(i)), o._activeInput(i), o.toggle(o.options.enabled), r = o._ns = x + "-" + _.guid(), i.closest("form").on("submit" + r, e.proxy(o._onParentFormSubmit, o)).on("reset" + r, e.proxy(o._onParentFormReset, o)), o.options.async.saveUrl ? (o._module = o._supportsFormData() ? new v(o) : new m(o), o._async = !0) : o._module = new P(o), o._supportsDrop() && o._setupDropZone(), o.wrapper.delegate(".k-upload-action", "click", e.proxy(o._onFileAction, o)).delegate(".k-upload-selected", "click", e.proxy(o._onUploadSelected, o)).delegate(".k-file", "t:progress", e.proxy(o._onFileProgress, o)).delegate(".k-file", "t:upload-success", e.proxy(o._onUploadSuccess, o)).delegate(".k-file", "t:upload-error", e.proxy(o._onUploadError, o))
},
events: [k, C, T, S, A, F, D, I],
options: {
name: "Upload",
enabled: !0,
multiple: !0,
showFileList: !0,
async: {
removeVerb: "POST",
autoUpload: !0
},
localization: {
select: "Select...",
cancel: "Cancel",
retry: "Retry",
remove: "Remove",
uploadSelectedFiles: "Upload files",
dropFilesHere: "drop files here to upload",
statusUploading: "uploading",
statusUploaded: "uploaded",
statusFailed: "failed"
}
},
setOptions: function (e) {
var t = this,
n = t.element;
b.fn.setOptions.call(t, e), t.multiple = t.options.multiple, n.attr("multiple", t._supportsMultiple() ? t.multiple : !1), t.toggle(t.options.enabled)
},
enable: function (e) {
e = e === t ? !0 : e, this.toggle(e)
},
disable: function () {
this.toggle(!1)
},
toggle: function (e) {
e = e === t ? e : !e, this.wrapper.toggleClass("k-state-disabled", e)
},
destroy: function () {
var t = this;
e(document).add(e(".k-dropzone", t.wrapper)).add(t.wrapper.closest("form")).off(t._ns), e(t.element).off(x), b.fn.destroy.call(t)
},
_addInput: function (t) {
var n = this;
t.insertAfter(n.element).data("kendoUpload", n), e(n.element).hide().removeAttr("id").off(x), n._activeInput(t)
},
_activeInput: function (t) {
var n = this,
i = n.wrapper;
n.element = t, t.attr("multiple", n._supportsMultiple() ? n.multiple : !1).attr("autocomplete", "off").on("click" + x, function (e) {
i.hasClass("k-state-disabled") && e.preventDefault()
}).on("focus" + x, function () {
e(this).parent().addClass("k-state-focused")
}).on("blur" + x, function () {
e(this).parent().removeClass("k-state-focused")
}).on("change" + x, e.proxy(n._onInputChange, n))
},
_onInputChange: function (t) {
var n = this,
r = e(t.target),
o = n.trigger(k, {
files: i(r)
});
o ? (n._addInput(r.clone().val("")), r.remove()) : r.trigger("t:select")
},
_onDrop: function (t) {
var n, i = t.originalEvent.dataTransfer,
o = this,
a = i.files;
u(t), a.length > 0 && (n = o.trigger(k, {
files: r(a)
}), n || e(".k-dropzone", o.wrapper).trigger("t:select", [a]))
},
_enqueueFile: function (t, n) {
var i, r, o = this,
a = e(".k-upload-files", o.wrapper);
return 0 === a.length && (a = e("
").appendTo(o.wrapper), o.options.showFileList || a.hide()), i = e(".k-file", a), r = e("
" + t + "
").appendTo(a).data(n), o._async && r.prepend(""), o.multiple || i.trigger("t:remove"), r
},
_removeFileEntry: function (t) {
var n, i = t.closest(".k-upload-files");
t.remove(), n = e(".k-file", i), n.find("> .k-fail").length === n.length && this._hideUploadButton(), 0 === n.length && i.remove()
},
_fileAction: function (e, t) {
var n = {
remove: "k-delete",
cancel: "k-cancel",
retry: "k-retry"
};
n.hasOwnProperty(t) && (this._clearFileAction(e), e.append(this._renderAction(n[t], this.localization[t]).addClass("k-upload-action")))
},
_fileState: function (e, t) {
var n, i = this.localization,
r = {
uploading: {
cssClass: "k-loading",
text: i.statusUploading
},
uploaded: {
cssClass: "k-success",
text: i.statusUploaded
},
failed: {
cssClass: "k-fail",
text: i.statusFailed
}
}, o = r[t];
o && (n = e.children(".k-icon").text(o.text), n[0].className = "k-icon " + o.cssClass)
},
_renderAction: function (t, n) {
return "" !== t ? e("") : e("")
},
_clearFileAction: function (e) {
e.find(".k-upload-action").remove()
},
_onFileAction: function (t) {
var n, i, r, o, a = this;
return a.wrapper.hasClass("k-state-disabled") || (n = e(t.target).closest(".k-upload-action"), i = n.find(".k-icon"), r = n.closest(".k-file"), o = {
files: r.data("fileNames")
}, i.hasClass("k-delete") ? a.trigger(I, o) || r.trigger("t:remove", o.data) : i.hasClass("k-cancel") ? (a.trigger(F, o), r.trigger("t:cancel"), this._checkAllComplete()) : i.hasClass("k-retry") && r.trigger("t:retry")), !1
},
_onUploadSelected: function () {
return this.wrapper.trigger("t:saveSelected"), !1
},
_onFileProgress: function (t, n) {
var i = e(".k-progress-status", t.target);
0 === i.length && (i = e("").appendTo(e(".k-filename", t.target)).find(".k-progress-status")), i.width(n + "%"), this.trigger(D, {
files: h(t).data("fileNames"),
percentComplete: n
})
},
_onUploadSuccess: function (e, t, n) {
var i = h(e);
this._fileState(i, "uploaded"), this.trigger(T, {
files: i.data("fileNames"),
response: t,
operation: "upload",
XMLHttpRequest: n
}), this._supportsRemove() ? this._fileAction(i, I) : this._clearFileAction(i), this._checkAllComplete()
},
_onUploadError: function (e, t) {
var n = h(e);
this._fileState(n, "failed"), this._fileAction(n, "retry"), this.trigger(S, {
operation: "upload",
files: n.data("fileNames"),
XMLHttpRequest: t
}), y("Server response: " + t.responseText), this._checkAllComplete()
},
_showUploadButton: function () {
var t = e(".k-upload-selected", this.wrapper);
0 === t.length && (t = this._renderAction("", this.localization.uploadSelectedFiles).addClass("k-upload-selected")), this.wrapper.append(t)
},
_hideUploadButton: function () {
e(".k-upload-selected", this.wrapper).remove()
},
_onParentFormSubmit: function () {
var t, n = this,
i = n.element;
i.trigger("t:abort"), i.value || (t = e(i), t.attr("disabled", "disabled"), window.setTimeout(function () {
t.removeAttr("disabled")
}, 0))
},
_onParentFormReset: function () {
e(".k-upload-files", this.wrapper).remove()
},
_supportsFormData: function () {
return "undefined" != typeof FormData
},
_supportsMultiple: function () {
var e = this._userAgent().indexOf("Windows") > -1;
return !(_.support.browser.opera || _.support.browser.safari && e)
},
_supportsDrop: function () {
var e = this._userAgent().toLowerCase(),
t = /chrome/.test(e),
n = !t && /safari/.test(e),
i = n && /windows/.test(e);
return !i && this._supportsFormData() && this.options.async.saveUrl
},
_userAgent: function () {
return navigator.userAgent
},
_setupDropZone: function () {
var t, n, i = this;
e(".k-upload-button", this.wrapper).wrap(""), t = i._ns, n = e(".k-dropzone", i.wrapper).append(e("" + i.localization.dropFilesHere + "")).on("dragenter" + t, u).on("dragover" + t, function (e) {
e.preventDefault()
}).on("drop" + t, e.proxy(this._onDrop, this)), p(n, t, function () {
n.addClass("k-dropzone-hovered")
}, function () {
n.removeClass("k-dropzone-hovered")
}), p(e(document), t, function () {
n.addClass("k-dropzone-active")
}, function () {
n.removeClass("k-dropzone-active")
})
},
_supportsRemove: function () {
return !!this.options.async.removeUrl
},
_submitRemove: function (t, n, i, r) {
var o = this,
a = o.options.async.removeField || "fileNames",
s = e.extend(n, g());
s[a] = t, jQuery.ajax({
type: this.options.async.removeVerb,
dataType: "json",
dataFilter: c,
url: this.options.async.removeUrl,
traditional: !0,
data: s,
success: i,
error: r
})
},
_wrapInput: function (e) {
return e.wrap("
"), e.closest(".k-button").append("" + this.localization.select + ""), e.closest(".k-upload")
},
_checkAllComplete: function () {
0 === e(".k-file .k-icon.k-loading", this.wrapper).length && this.trigger(A)
}
}),
P = function (t) {
this.name = "syncUploadModule", this.element = t.wrapper, this.upload = t, this.element.bind("t:select", e.proxy(this.onSelect, this)).bind("t:remove", e.proxy(this.onRemove, this)).closest("form").attr("enctype", "multipart/form-data").attr("encoding", "multipart/form-data")
};
P.prototype = {
onSelect: function (t) {
var r, o = this.upload,
a = e(t.target);
o._addInput(a.clone().val("")), r = o._enqueueFile(n(a), {
relatedInput: a,
fileNames: i(a)
}), o._fileAction(r, I)
},
onRemove: function (e) {
var t = h(e);
t.data("relatedInput").remove(), this.upload._removeFileEntry(t)
}
}, m = function (t) {
this.name = "iframeUploadModule", this.element = t.wrapper, this.upload = t, this.iframes = [], this.element.bind("t:select", e.proxy(this.onSelect, this)).bind("t:cancel", e.proxy(this.onCancel, this)).bind("t:retry", e.proxy(this.onRetry, this)).bind("t:remove", e.proxy(this.onRemove, this)).bind("t:saveSelected", e.proxy(this.onSaveSelected, this)).bind("t:abort", e.proxy(this.onAbort, this))
}, E._frameId = 0, m.prototype = {
onSelect: function (t) {
var n = this.upload,
i = e(t.target),
r = this.prepareUpload(i);
n.options.async.autoUpload ? this.performUpload(r) : (n._supportsRemove() && this.upload._fileAction(r, I), n._showUploadButton())
},
prepareUpload: function (t) {
var r, o, a, s = this.upload,
l = e(s.element),
d = s.options.async.saveField || t.attr("name");
return s._addInput(t.clone().val("")), t.attr("name", d), r = this.createFrame(s.name + "_" + E._frameId++), this.registerFrame(r), o = this.createForm(s.options.async.saveUrl, r.attr("name")).append(l), a = s._enqueueFile(n(t), {
frame: r,
relatedInput: l,
fileNames: i(t)
}), r.data({
form: o,
file: a
}), a
},
performUpload: function (t) {
var n, i, r, o = {
files: t.data("fileNames")
}, a = t.data("frame"),
s = this.upload;
if (s.trigger(C, o)) s._removeFileEntry(a.data("file")), this.cleanupFrame(a), this.unregisterFrame(a);
else {
s._hideUploadButton(), a.appendTo(document.body), n = a.data("form").appendTo(document.body), o.data = e.extend({}, o.data, g());
for (i in o.data) r = n.find("input[name='" + i + "']"), 0 === r.length && (r = e("", {
type: "hidden",
name: i
}).appendTo(n)), r.val(o.data[i]);
s._fileAction(t, F), s._fileState(t, "uploading"), a.one("load", e.proxy(this.onIframeLoad, this)), n[0].submit()
}
},
onSaveSelected: function () {
var t = this;
e(".k-file", this.element).each(function () {
var n = e(this),
i = f(n);
i || t.performUpload(n)
})
},
onIframeLoad: function (t) {
var n, i = e(t.target);
try {
n = i.contents().text()
} catch (r) {
n = "Error trying to get server response: " + r
}
this.processResponse(i, n)
},
processResponse: function (t, n) {
var i = t.data("file"),
r = this,
o = {
responseText: n
};
d(n, function (n) {
e.extend(o, {
statusText: "OK",
status: "200"
}), i.trigger("t:progress", [100]), i.trigger("t:upload-success", [n, o]), r.cleanupFrame(t), r.unregisterFrame(t)
}, function () {
e.extend(o, {
statusText: "error",
status: "500"
}), i.trigger("t:upload-error", [o])
})
},
onCancel: function (t) {
var n = e(t.target).data("frame");
this.stopFrameSubmit(n), this.cleanupFrame(n), this.unregisterFrame(n), this.upload._removeFileEntry(n.data("file"))
},
onRetry: function (e) {
var t = h(e);
this.performUpload(t)
},
onRemove: function (e, t) {
var n = h(e),
i = n.data("frame");
i ? (this.unregisterFrame(i), this.upload._removeFileEntry(n), this.cleanupFrame(i)) : l(n, this.upload, t)
},
onAbort: function () {
var t = this.element,
n = this;
e.each(this.iframes, function () {
e("input", this.data("form")).appendTo(t), n.stopFrameSubmit(this[0]), this.data("form").remove(), this.remove()
}), this.iframes = []
},
createFrame: function (t) {
return e("")
},
createForm: function (t, n) {
return e("")
},
stopFrameSubmit: function (e) {
e.stop !== t ? e.stop() : e.document && e.document.execCommand("Stop")
},
registerFrame: function (e) {
this.iframes.push(e)
},
unregisterFrame: function (t) {
this.iframes = e.grep(this.iframes, function (e) {
return e.attr("name") != t.attr("name")
})
},
cleanupFrame: function (e) {
var t = e.data("form");
e.data("file").data("frame", null), setTimeout(function () {
t.remove(), e.remove()
}, 1)
}
}, v = function (t) {
this.name = "formDataUploadModule", this.element = t.wrapper, this.upload = t, this.element.bind("t:select", e.proxy(this.onSelect, this)).bind("t:cancel", e.proxy(this.onCancel, this)).bind("t:remove", e.proxy(this.onRemove, this)).bind("t:retry", e.proxy(this.onRetry, this)).bind("t:saveSelected", e.proxy(this.onSaveSelected, this)).bind("t:abort", e.proxy(this.onAbort, this))
}, v.prototype = {
onSelect: function (t, n) {
var i = this.upload,
o = this,
a = e(t.target),
s = n ? r(n) : this.inputFiles(a),
l = this.prepareUpload(a, s);
e.each(l, function () {
i.options.async.autoUpload ? o.performUpload(this) : (i._supportsRemove() && i._fileAction(this, I), i._showUploadButton())
})
},
prepareUpload: function (t, n) {
var i = this.enqueueFiles(n);
return t.is("input") && (e.each(i, function () {
e(this).data("relatedInput", t)
}), t.data("relatedFileEntries", i), this.upload._addInput(t.clone().val(""))), i
},
enqueueFiles: function (t) {
var n, i, r, o, a = this.upload,
s = t.length,
l = [];
if (a.options.async.batch === !0) n = e.map(t, function (e) {
return e.name
}).join(", "), o = a._enqueueFile(n, {
fileNames: t
}), o.data("files", t), l.push(o);
else
for (i = 0; s > i; i++) r = t[i], n = r.name, o = a._enqueueFile(n, {
fileNames: [r]
}), o.data("files", [r]), l.push(o);
return l
},
inputFiles: function (e) {
return i(e)
},
performUpload: function (t) {
var n, i = this.upload,
r = this.createFormData(t.data("files")),
o = new XMLHttpRequest,
a = {
files: t.data("fileNames"),
XMLHttpRequest: o
};
if (i.trigger(C, a)) this.removeFileEntry(t);
else {
i._fileAction(t, F), i._hideUploadButton(), a.data = e.extend({}, a.data, g());
for (n in a.data) r.append(n, a.data[n]);
i._fileState(t, "uploading"), this.postFormData(i.options.async.saveUrl, r, t, o)
}
},
onSaveSelected: function () {
var t = this;
e(".k-file", this.element).each(function () {
var n = e(this),
i = f(n);
i || t.performUpload(n)
})
},
onCancel: function (e) {
var t = h(e);
this.stopUploadRequest(t), this.removeFileEntry(t)
},
onRetry: function (e) {
var t = h(e);
this.performUpload(t)
},
onRemove: function (e, t) {
var n = h(e);
n.children(".k-icon").is(".k-success") ? l(n, this.upload, t) : this.removeFileEntry(n)
},
postFormData: function (e, t, n, i) {
var r = this;
n.data("request", i), i.addEventListener("load", function (e) {
r.onRequestSuccess.call(r, e, n)
}, !1), i.addEventListener(S, function (e) {
r.onRequestError.call(r, e, n)
}, !1), i.upload.addEventListener("progress", function (e) {
r.onRequestProgress.call(r, e, n)
}, !1), i.open("POST", e), i.withCredentials = "true", i.send(t)
},
createFormData: function (e) {
var t, n = new FormData,
i = this.upload,
r = e.length;
for (t = 0; r > t; t++) n.append(i.options.async.saveField || i.name, e[t].rawFile);
return n
},
onRequestSuccess: function (e, t) {
function n() {
t.trigger("t:upload-error", [i])
}
var i = e.target,
r = this;
i.status >= 200 && 299 >= i.status ? d(i.responseText, function (e) {
t.trigger("t:progress", [100]), t.trigger("t:upload-success", [e, i]), r.cleanupFileEntry(t)
}, n) : n()
},
onRequestError: function (e, t) {
var n = e.target;
t.trigger("t:upload-error", [n])
},
cleanupFileEntry: function (t) {
var n = t.data("relatedInput"),
i = !0;
n && (e.each(n.data("relatedFileEntries") || [], function () {
this.parent().length > 0 && this[0] != t[0] && (i = i && this.children(".k-icon").is(".k-success"))
}), i && n.remove())
},
removeFileEntry: function (e) {
this.cleanupFileEntry(e), this.upload._removeFileEntry(e)
},
onRequestProgress: function (e, t) {
var n = Math.round(100 * e.loaded / e.total);
t.trigger("t:progress", [n])
},
stopUploadRequest: function (e) {
e.data("request").abort()
}
}, _.ui.plugin(E)
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
return e !== t
}
function i(e, t, n) {
return Math.max(Math.min(parseInt(e, 10), 1 / 0 === n ? n : parseInt(n, 10)), parseInt(t, 10))
}
function r(e, t) {
var n = e.children(k);
return n.data("kendoWindow") || n.data("kendo" + t)
}
function o(t) {
return e(y).filter(function () {
var n = e(this),
i = r(n, t);
return i.options.modal && n.is(I) && i.options.visible
}).sort(function (t, n) {
return +e(t).css("zIndex") - +e(n).css("zIndex")
})
}
function a(e, t) {
return function () {
var e = this,
n = e.wrapper,
i = n[0].style,
r = e.options;
if (!r.isMaximized && !r.isMinimized) return e.restoreOptions = {
width: i.width,
height: i.height
}, n.find(C).hide().end().find(j).parent().hide().eq(0).before(Y.action({
name: "Restore"
})), t.call(e), e
}
}
function s(e) {
var t = this;
t.owner = e, t._draggable = new u(e.wrapper, {
filter: C,
group: e.wrapper.id + "-resizing",
dragstart: h(t.dragstart, t),
drag: h(t.drag, t),
dragend: h(t.dragend, t)
})
}
function l(e) {
var t = this;
t.owner = e, t._draggable = new u(e.wrapper, {
filter: x,
group: e.wrapper.id + "-moving",
dragstart: h(t.dragstart, t),
drag: h(t.drag, t),
dragend: h(t.dragend, t),
dragcancel: h(t.dragcancel, t)
})
}
var d = window.kendo,
c = d.ui.Widget,
u = d.ui.Draggable,
p = e.isPlainObject,
f = d._activeElement,
h = e.proxy,
g = e.extend,
m = e.each,
v = d.template,
_ = "body",
b = ".kendoWindow",
y = ".k-window",
w = ".k-window-title",
x = w + "bar",
k = ".k-window-content",
C = ".k-resize-handle",
T = ".k-overlay",
S = "k-content-frame",
A = "k-loading",
F = "k-state-hover",
D = "k-state-focused",
I = ":visible",
E = "hidden",
P = "cursor",
z = "open",
H = "activate",
R = "deactivate",
O = "close",
M = "refresh",
N = "resize",
B = "dragstart",
L = "dragend",
V = "error",
U = "overflow",
W = "zIndex",
j = ".k-window-actions .k-i-minimize,.k-window-actions .k-i-maximize",
q = ".k-window-titlebar .k-window-action",
G = d.isLocalUrl,
$ = c.extend({
init: function (t, i) {
var r, o, a, u, f, g, v, _ = this,
C = !1,
T = i && i.actions && !i.actions.length;
c.fn.init.call(_, t, i), i = _.options, t = _.element, f = i.content, T && (i.actions = []), _.appendTo = e(i.appendTo || document.body), _._animations(), f && !p(f) && (f = i.content = {
url: f
}), t.find("script").filter(function () {
return !this.type || this.type.toLowerCase().indexOf("script") >= 0
}).remove(), t.parent().is(_.appendTo) || (t.is(I) ? (o = t.offset(), C = !0) : (a = t.css("visibility"), u = t.css("display"), t.css({
visibility: E,
display: ""
}), o = t.offset(), t.css({
visibility: a,
display: u
}))), n(i.visible) && null !== i.visible || (i.visible = t.is(I)), r = _.wrapper = t.closest(y), t.is(".k-content") && r[0] || (t.addClass("k-window-content k-content"), _._createWindow(t, i), r = _.wrapper = t.closest(y), _._dimensions()), o && r.css({
top: o.top,
left: o.left
}), f && _.refresh(f), i.visible && _.toFront(), g = r.children(k), _._tabindex(g), i.visible && i.modal && _._overlay(r.is(I)).css({
opacity: .5
}), r.on("mouseenter" + b, q, function () {
e(this).addClass(F)
}).on("mouseleave" + b, q, function () {
e(this).removeClass(F)
}).on("click" + b, q, h(_._windowActionHandler, _)), g.on("keydown" + b, h(_._keydown, _)).on("focus" + b, function () {
r.addClass(D)
}).on("blur" + b, function () {
r.removeClass(D)
}), i.resizable && (r.on("dblclick" + b, x, function (t) {
return e(t.target).closest(".k-window-action").length || _.toggleMaximization(), this
}), m("n e s w se sw ne nw".split(" "), function (e, t) {
r.append(Y.resizeHandle(t))
}), _.resizing = new s(_)), i.draggable && (_.dragging = new l(_)), v = t.attr("id"), v && (v += "_wnd_title", r.find(x).children(w).attr("id", v), g.attr({
role: "dialog",
"aria-labelledby": v
})), r.add(r.find(".k-resize-handle,.k-window-titlebar")).on("mousedown" + b, h(_.toFront, _)), _.touchScroller = d.touchScroller(t), _._resizeHandler = function (e) {
return _._onDocumentResize(e)
}, e(window).on("resize", _._resizeHandler), i.visible && (_.trigger(z), _.trigger(H)), d.notify(_)
},
_dimensions: function () {
var e = this,
t = e.wrapper,
n = e.options,
r = n.width,
o = n.height,
a = n.maxHeight;
e.title(n.title), m(["minWidth", "minHeight", "maxWidth", "maxHeight"], function (e, i) {
var r = n[i];
r && 1 / 0 != r && t.css(i, r)
}), a && 1 / 0 != a && e.element.css("maxHeight", a), r && (("" + r).indexOf("%") > 0 ? t.width(r) : t.width(i(r, n.minWidth, n.maxWidth))), o && (("" + o).indexOf("%") > 0 ? t.height(o) : t.height(i(o, n.minHeight, n.maxHeight))), n.visible || t.hide()
},
_animations: function () {
var e = this.options;
e.animation === !1 && (e.animation = {
open: {
effects: {}
},
close: {
hide: !0,
effects: {}
}
})
},
setOptions: function (e) {
c.fn.setOptions.call(this, e), this._animations(), this._dimensions()
},
events: [z, H, R, O, M, N, B, L, V],
options: {
name: "Window",
animation: {
open: {
effects: {
zoom: {
direction: "in"
},
fade: {
direction: "in"
}
},
duration: 350
},
close: {
effects: {
zoom: {
direction: "out",
properties: {
scale: .7
}
},
fade: {
direction: "out"
}
},
duration: 350,
hide: !0
}
},
title: "",
actions: ["Close"],
modal: !1,
resizable: !0,
draggable: !0,
minWidth: 90,
minHeight: 50,
maxWidth: 1 / 0,
maxHeight: 1 / 0,
visible: null,
height: null,
width: null
},
_closable: function () {
return e.inArray("close", e.map(this.options.actions, function (e) {
return e.toLowerCase()
})) > -1
},
_keydown: function (e) {
var t, n, r, o, a = this,
s = a.options,
l = d.keys,
c = e.keyCode,
u = a.wrapper,
p = 10,
f = a.options.isMaximized;
e.target == e.currentTarget && (c == l.ESC && a._closable() && a._close(!0), !s.draggable || e.ctrlKey || f || (t = d.getOffset(u), c == l.UP ? n = u.css("top", t.top - p) : c == l.DOWN ? n = u.css("top", t.top + p) : c == l.LEFT ? n = u.css("left", t.left - p) : c == l.RIGHT && (n = u.css("left", t.left + p))), s.resizable && e.ctrlKey && !f && (c == l.UP ? (n = !0, o = u.height() - p) : c == l.DOWN && (n = !0, o = u.height() + p), c == l.LEFT ? (n = !0, r = u.width() - p) : c == l.RIGHT && (n = !0, r = u.width() + p), n && (u.css({
width: i(r, s.minWidth, s.maxWidth),
height: i(o, s.minHeight, s.maxHeight)
}), a.trigger(N))), n && e.preventDefault())
},
_overlay: function (t) {
var n = this.appendTo.children(".k-overlay"),
i = this.wrapper;
return n.length || (n = e("")), n.insertBefore(i[0]).toggle(t).css(W, parseInt(i.css(W), 10) - 1), n
},
_windowActionHandler: function (n) {
var i = e(n.target).closest(".k-window-action").find(".k-icon"),
r = this;
r._closing || m({
"k-i-close": function () {
r._close(!0)
},
"k-i-maximize": r.maximize,
"k-i-minimize": r.minimize,
"k-i-restore": r.restore,
"k-i-refresh": r.refresh
}, function (e, o) {
return i.hasClass(e) ? (n.preventDefault(), o.call(r), !1) : t
})
},
center: function () {
var t = this.wrapper,
n = e(window);
return t.css({
left: n.scrollLeft() + Math.max(0, (n.width() - t.width()) / 2),
top: n.scrollTop() + Math.max(0, (n.height() - t.height()) / 2)
}), this
},
title: function (e) {
var t = this,
n = t.wrapper,
i = t.options,
r = n.find(x),
o = r.children(w),
a = r.outerHeight();
return arguments.length ? (e === !1 ? (n.addClass("k-window-titleless"), r.remove()) : (r.length || n.prepend(Y.titlebar(g(Y, i))), n.css("padding-top", a), r.css("margin-top", -a)), o.text(e), t) : o.text()
},
content: function (e) {
var t = this.wrapper.children(k),
n = t.children(".km-scroll-container");
return t = n[0] ? n : t, e ? (d.destroy(this.element.children()), t.html(e), this) : t.html()
},
open: function () {
var t, n = this,
i = n.wrapper,
r = n.options,
o = r.animation.open,
a = i.children(k),
s = a.css(U);
return n.trigger(z) || (n._closing = !1, n.toFront(), n.element.focus(), r.visible = !0, r.modal && (t = n._overlay(!1), o.duration ? t.kendoStop().kendoAnimate({
effects: "fade:in",
duration: o.duration
}).show() : t.css("opacity", .5).show()), i.is(I) || (a.css(U, E), i.show().kendoStop().kendoAnimate({
effects: o.effects,
duration: o.duration,
complete: function () {
n.element.focus(), n.trigger(H), a.css(U, s)
}
}))), r.isMaximized && (n._documentScrollTop = e(document).scrollTop(), e("html, body").css(U, E)), n
},
_close: function (n) {
var i, a, s, l = this,
d = l.wrapper,
c = l.options,
u = c.animation.open,
p = c.animation.close;
d.is(I) && !l.trigger(O, {
userTriggered: !! n
}) && (l._closing = !0, c.visible = !1, e(y).each(function (t, n) {
var i = e(n),
r = i.find(k);
n != d && r.find("> ." + S).length > 0 && r.children(".k-overlay").remove()
}), i = o(c.name), a = c.modal && !i.length, s = c.modal ? l._overlay(!0) : e(t), a ? p.duration ? s.kendoStop().kendoAnimate({
effects: "fade:out",
duration: p.duration,
hide: !0
}) : s.hide() : i.length && r(i.eq(i.length - 1), c.name)._overlay(!0), d.kendoStop().kendoAnimate({
effects: p.effects || u.effects,
reverse: p.reverse === !0,
duration: p.duration,
complete: function () {
d.hide(), l.trigger(R)
}
})), l.options.isMaximized && (e("html, body").css(U, ""), l._documentScrollTop && l._documentScrollTop > 0 && e(document).scrollTop(l._documentScrollTop))
},
close: function () {
return this._close(!1), this
},
toFront: function (t) {
var n, i, r = this,
o = r.wrapper,
a = o[0],
s = +o.css(W),
l = s,
d = f(),
c = r.element,
u = t && t.target ? t.target : null;
return e(y).each(function (t, n) {
var i = e(n),
r = i.css(W),
o = i.find(k);
isNaN(r) || (s = Math.max(+r, s)), n != a && o.find("> ." + S).length > 0 && o.append(Y.overlay)
}), (10001 == s || s > l) && o.css(W, s + 2), r.element.find("> .k-overlay").remove(), e(d).is(c) || e(u).is(q + "," + q + " .k-icon,:input,a") || c.find(d).length && c.find(u).length || (c.focus(), n = e(window).scrollTop(), i = parseInt(r.wrapper.position().top, 10), i > 0 && 0 > i - n && (n > 0 ? e(window).scrollTop(i) : r.wrapper.css("top", n))), r
},
toggleMaximization: function () {
return this._closing ? this : this[this.options.isMaximized ? "restore" : "maximize"]()
},
restore: function () {
var t = this,
n = t.options,
i = t.restoreOptions;
if (n.isMaximized || n.isMinimized) return t.wrapper.css({
position: "absolute",
left: i.left,
top: i.top,
width: i.width,
height: i.height
}).find(".k-window-content,.k-resize-handle").show().end().find(".k-window-titlebar .k-i-restore").parent().remove().end().end().find(j).parent().show(), e("html, body").css(U, ""), this._documentScrollTop && this._documentScrollTop > 0 && e(document).scrollTop(this._documentScrollTop), n.isMaximized = n.isMinimized = !1, t.trigger(N), t
},
maximize: a("maximize", function () {
var t = this,
n = t.wrapper,
i = n.position();
g(t.restoreOptions, {
left: i.left,
top: i.top
}), n.css({
left: 0,
top: 0,
position: "fixed"
}), this._documentScrollTop = e(document).scrollTop(), e("html, body").css(U, E), t.options.isMaximized = !0, t._onDocumentResize()
}),
minimize: a("minimize", function () {
var e = this;
e.wrapper.css("height", ""), e.element.hide(), e.options.isMinimized = !0
}),
_onDocumentResize: function () {
var t = this,
n = t.wrapper,
i = e(window);
t.options.isMaximized && (n.css({
width: i.width(),
height: i.height() - parseInt(n.css("padding-top"), 10)
}), t.trigger(N))
},
refresh: function (t) {
var i, r, o, a = this,
s = a.options,
l = e(a.element);
return p(t) || (t = {
url: t
}), t = g({}, s.content, t), r = n(s.iframe) ? s.iframe : t.iframe, o = t.url, o ? (n(r) || (r = !G(o)), r ? (i = l.find("." + S)[0], i ? i.src = o || i.src : l.html(Y.contentFrame(g({}, s, {
content: t
}))), l.find("." + S).unbind("load" + b).on("load" + b, function () {
a.trigger(M)
})) : a._ajaxRequest(t)) : (t.template && a.content(v(t.template)({})), a.trigger(M)), a
},
_ajaxRequest: function (t) {
var n = this,
i = t.template,
r = n.wrapper.find(".k-window-titlebar .k-i-refresh"),
o = setTimeout(function () {
r.addClass(A)
}, 100);
e.ajax(g({
type: "GET",
dataType: "html",
cache: !1,
error: h(function (e, t) {
n.trigger(V, {
status: t,
xhr: e
})
}, n),
complete: function () {
clearTimeout(o), r.removeClass(A)
},
success: h(function (e) {
i && (e = v(i)(e || {})), n.content(e), n.element.prop("scrollTop", 0), n.trigger(M)
}, n)
}, t))
},
destroy: function () {
var t, n, i = this;
c.fn.destroy.call(i), d.destroy(i.wrapper), i.resizing && i.resizing.destroy(), i.dragging && i.dragging.destroy(), i.element.children("iframe").remove(), i.wrapper.remove().add(i.wrapper.find(".k-resize-handle,.k-window-titlebar")).off(b), e(window).off("resize", i._resizeHandler), t = o(), n = i.options.modal && !t.length, n ? i._overlay(!1).remove() : t.length > 0 && r(t.eq(t.length - 1), i.options.name)._overlay(!0)
},
_createWindow: function () {
var t, n, i = this,
r = i.element,
o = i.options,
a = d.support.isRtl(r);
o.scrollable === !1 && r.attr("style", "overflow:hidden;"), n = e(Y.wrapper(o)), o.title !== !1 && n.append(Y.titlebar(g(Y, o))), t = r.find("iframe:not(.k-content)").map(function () {
var e = this.getAttribute("src");
return this.src = "", e
}), n.toggleClass("k-rtl", a).appendTo(i.appendTo).append(r).find("iframe:not(.k-content)").each(function (e) {
this.src = t[e]
}), n.find(".k-window-title").css(a ? "left" : "right", n.find(".k-window-actions").outerWidth() + 10), r.show()
}
}),
Y = {
wrapper: v(""),
action: v("#= name #"),
titlebar: v("
#= title #
# for (var i = 0; i < actions.length; i++) { ##= action({ name: actions[i] }) ## } #
"),
overlay: "",
contentFrame: v(""),
resizeHandle: v("")
};
s.prototype = {
dragstart: function (t) {
var n = this,
i = n.owner,
r = i.wrapper;
n.elementPadding = parseInt(i.wrapper.css("padding-top"), 10), n.initialCursorPosition = d.getOffset(r, "position"), n.resizeDirection = t.currentTarget.prop("className").replace("k-resize-handle k-resize-", ""), n.initialSize = {
width: r.width(),
height: r.height()
}, n.containerOffset = d.getOffset(i.appendTo), r.append(Y.overlay).find(C).not(t.currentTarget).hide(), e(_).css(P, t.currentTarget.css(P))
},
drag: function (e) {
var t, n, r, o, a = this,
s = a.owner,
l = s.wrapper,
d = s.options,
c = a.resizeDirection,
u = a.containerOffset,
p = a.initialCursorPosition,
f = a.initialSize,
h = Math.max(e.x.location, u.left),
g = Math.max(e.y.location, u.top);
c.indexOf("e") >= 0 ? (t = h - p.left, l.width(i(t, d.minWidth, d.maxWidth))) : c.indexOf("w") >= 0 && (o = p.left + f.width, t = i(o - h, d.minWidth, d.maxWidth), l.css({
left: o - t - u.left,
width: t
})), c.indexOf("s") >= 0 ? (n = g - p.top - a.elementPadding, l.height(i(n, d.minHeight, d.maxHeight))) : c.indexOf("n") >= 0 && (r = p.top + f.height, n = i(r - g, d.minHeight, d.maxHeight), l.css({
top: r - n - u.top,
height: n
})), s.trigger(N)
},
dragend: function (t) {
var n = this,
i = n.owner,
r = i.wrapper;
return r.find(T).remove().end().find(C).not(t.currentTarget).show(), e(_).css(P, ""), i.touchScroller && i.touchScroller.reset(), 27 == t.keyCode && r.css(n.initialCursorPosition).css(n.initialSize), !1
},
destroy: function () {
this._draggable.destroy()
}
}, l.prototype = {
dragstart: function (t) {
var n = this.owner,
i = n.element,
r = i.find(".k-window-actions"),
o = d.getOffset(n.appendTo);
n.trigger(B), n.initialWindowPosition = d.getOffset(n.wrapper, "position"), n.startPosition = {
left: t.x.client - n.initialWindowPosition.left,
top: t.y.client - n.initialWindowPosition.top
}, n.minLeftPosition = r.length > 0 ? r.outerWidth() + parseInt(r.css("right"), 10) - i.outerWidth() : 20 - i.outerWidth(), n.minLeftPosition -= o.left, n.minTopPosition = -o.top, n.wrapper.append(Y.overlay).find(C).hide(), e(_).css(P, t.currentTarget.css(P))
},
drag: function (t) {
var n = this.owner,
i = {
left: Math.max(t.x.client - n.startPosition.left, n.minLeftPosition),
top: Math.max(t.y.client - n.startPosition.top, n.minTopPosition)
};
e(n.wrapper).css(i)
},
_finishDrag: function () {
var t = this.owner;
t.wrapper.find(C).toggle(!t.options.isMinimized).end().find(T).remove(), e(_).css(P, "")
},
dragcancel: function (e) {
this._finishDrag(), e.currentTarget.closest(y).css(this.owner.initialWindowPosition)
},
dragend: function () {
return this._finishDrag(), this.owner.trigger(L), !1
},
destroy: function () {
this._draggable.destroy()
}
}, d.ui.plugin($)
}(window.kendo.jQuery),
function (e, t) {
function n(e) {
var t = {
top: 0,
right: 0,
bottom: 0,
left: 0
};
return "number" == typeof e ? t[Nt] = t[Ot] = t[ft] = t[Dt] = e : (t[Nt] = e[Nt] || 0, t[Ot] = e[Ot] || 0, t[ft] = e[ft] || 0, t[Dt] = e[Dt] || 0), t
}
function i(e, t) {
return et.extend({
init: function (e) {
this.view = e
},
decorate: function (n) {
var i, r = this,
o = r.view,
a = n.options.animation;
return a && a.type === e && o.options.transitions && (i = n._animation = new t(n, a), o.animations.push(i)), n
}
})
}
function r(t, n, i) {
var o, s, d, c, u, p, f, h, g, m, v, _ = a(n),
b = t + _ + i,
y = r.cache.get(b),
w = {
width: 0,
height: 0,
baseline: 0
};
if (y) return y;
o = r.measureBox, s = r.baselineMarker.cloneNode(!1), o && o.parentNode || (o = r.measureBox = e("").appendTo(X.body)[0]);
for (d in n) o.style[d] = n[d];
return o.innerHTML = t, o.appendChild(s), (t + "").length && (w = {
width: o.offsetWidth - ut,
height: o.offsetHeight,
baseline: s.offsetTop + ut
}), i && (c = w.width, u = w.height, p = c / 2, f = u / 2, h = l(0, 0, p, f, i), g = l(c, 0, p, f, i), m = l(c, u, p, f, i), v = l(0, u, p, f, i), w.normalWidth = c, w.normalHeight = u, w.width = ot.max(h.x, g.x, m.x, v.x) - ot.min(h.x, g.x, m.x, v.x), w.height = ot.max(h.y, g.y, m.y, v.y) - ot.min(h.y, g.y, m.y, v.y)), r.cache.put(b, w), w
}
function o(e, t) {
var n, i, r, o = t - e;
if (0 === o) {
if (0 === t) return .1;
o = ot.abs(t)
}
return n = ot.pow(10, ot.floor(ot.log(o) / ot.log(10))), i = m(o / n, bt), r = 1, r = 1.904762 > i ? .2 : 4.761904 > i ? .5 : 9.523809 > i ? 1 : 2, m(n * r, bt)
}
function a(e) {
var t, n = [];
for (t in e) n.push(t + e[t]);
return n.sort().join(" ")
}
function s() {
return Y.current.alloc()
}
function l(e, t, n, i, r) {
var o = r * wt;
return {
x: n + (e - n) * ot.cos(o) + (t - i) * ot.sin(o),
y: i - (e - n) * ot.sin(o) + (t - i) * ot.cos(o)
}
}
function d(t, n) {
if (t.x1 == n.x1 && t.y1 == n.y1 && t.x2 == n.x2 && t.y2 == n.y2) return n;
var i = ot.min(t.x1, n.x1),
r = ot.max(t.x1, n.x1),
o = ot.min(t.x2, n.x2),
a = ot.max(t.x2, n.x2),
s = ot.min(t.y1, n.y1),
l = ot.max(t.y1, n.y1),
d = ot.min(t.y2, n.y2),
c = ot.max(t.y2, n.y2),
u = [];
return u[0] = C(r, s, o, l), u[1] = C(i, l, r, d), u[2] = C(o, l, a, d), u[3] = C(r, d, o, c), t.x1 == i && t.y1 == s || n.x1 == i && n.y1 == s ? (u[4] = C(i, s, r, l), u[5] = C(o, d, a, c)) : (u[4] = C(o, s, a, l), u[5] = C(i, d, r, c)), e.grep(u, function (e) {
return e.height() > 0 && e.width() > 0
})[0]
}
function c() {
return X.implementation.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure", "1.1")
}
function u(e, t) {
return -1 != rt(e, t)
}
function p(e) {
return e[e.length - 1]
}
function f(e, t) {
[].push.apply(e, t)
}
function h(e, t) {
return m(ot.ceil(e / t) * t, bt)
}
function g(e, t) {
return m(ot.floor(e / t) * t, bt)
}
function m(e, t) {
var n = ot.pow(10, t || 0);
return ot.round(e * n) / n
}
function v(e, t, n) {
return m(e + (t - e) * n, gt)
}
function _(e) {
return typeof e !== Bt
}
function b(e, t) {
return e - t
}
function y(e, t, n) {
var i, r = e.length;
for (i = 0; r > i; i++) e[i][t] = n
}
function w(e, t) {
return e.match(kt) ? J.format.apply(this, arguments) : J.toString(t, e)
}
function x(e) {
return X.getElementById(e)
}
function k(e) {
for (var t = e.parentNode; t && t.parentNode;) t = t.parentNode;
return t !== X
}
var C, T, S, A, F, D, I, E, P, z, H, R, O, M, N, B, L, V, U, W, j, q, G, $, Y, Q, K, X = document,
J = window.kendo,
Z = J.dataviz = {}, et = J.Class,
tt = J.template,
nt = e.map,
it = e.noop,
rt = e.inArray,
ot = Math,
at = J.deepExtend,
st = function (e) {
return tt(e, {
useWithBlock: !1,
paramName: "d"
})
}, lt = "k-",
dt = 10,
ct = "axisLabelClick",
ut = 1,
pt = "#000",
ft = "bottom",
ht = "center",
gt = 3,
mt = "clip",
vt = "12px sans-serif",
_t = 400,
bt = 6,
yt = 600,
wt = ot.PI / 180,
xt = "fadeIn",
kt = /\{\d+:?/,
Ct = "height",
Tt = "k",
St = 1e3,
At = 1e4,
Ft = 600,
Dt = "left",
It = "linear",
Et = Number.MAX_VALUE,
Pt = -Number.MAX_VALUE,
zt = "none",
Ht = "outside",
Rt = "radial",
Ot = "right",
Mt = "swing",
Nt = "top",
Bt = "undefined",
Lt = /([A-Z])/g,
Vt = "width",
Ut = "#fff",
Wt = "x",
jt = "y",
qt = .2,
Gt = function (e, n) {
var i = this;
return i instanceof Gt ? (i.x = m(e || 0, gt), i.y = m(n || 0, gt), t) : new Gt(e, n)
};
Gt.fn = Gt.prototype = {
clone: function () {
var e = this;
return new Gt(e.x, e.y)
}
}, C = function (e, n, i, r) {
var o = this;
return o instanceof C ? (o.x1 = e || 0, o.x2 = i || 0, o.y1 = n || 0, o.y2 = r || 0, t) : new C(e, n, i, r)
}, C.fn = C.prototype = {
width: function () {
return this.x2 - this.x1
},
height: function () {
return this.y2 - this.y1
},
translate: function (e, t) {
var n = this;
return n.x1 += e, n.x2 += e, n.y1 += t, n.y2 += t, n
},
move: function (e, t) {
var n = this,
i = n.height(),
r = n.width();
return n.x1 = e, n.y1 = t, n.x2 = n.x1 + r, n.y2 = n.y1 + i, n
},
wrap: function (e) {
var t = this;
return t.x1 = ot.min(t.x1, e.x1), t.y1 = ot.min(t.y1, e.y1), t.x2 = ot.max(t.x2, e.x2), t.y2 = ot.max(t.y2, e.y2), t
},
wrapPoint: function (e) {
return this.wrap(new C(e.x, e.y, e.x, e.y)), this
},
snapTo: function (e, t) {
var n = this;
return t != Wt && t || (n.x1 = e.x1, n.x2 = e.x2), t != jt && t || (n.y1 = e.y1, n.y2 = e.y2), n
},
alignTo: function (e, t) {
var n, i, r = this,
o = r.height(),
a = r.width(),
s = t == Nt || t == ft ? jt : Wt,
l = s == jt ? o : a;
return t === ht ? (n = e.center(), i = r.center(), r.x1 += n.x - i.x, r.y1 += n.y - i.y) : r[s + 1] = t === Nt || t === Dt ? e[s + 1] - l : e[s + 2], r.x2 = r.x1 + a, r.y2 = r.y1 + o, r
},
shrink: function (e, t) {
var n = this;
return n.x2 -= e, n.y2 -= t, n
},
expand: function (e, t) {
return this.shrink(-e, -t), this
},
pad: function (e) {
var t = this,
i = n(e);
return t.x1 -= i.left, t.x2 += i.right, t.y1 -= i.top, t.y2 += i.bottom, t
},
unpad: function (e) {
var t = this,
i = n(e);
return i.left = -i.left, i.top = -i.top, i.right = -i.right, i.bottom = -i.bottom, t.pad(i)
},
clone: function () {
var e = this;
return new C(e.x1, e.y1, e.x2, e.y2)
},
center: function () {
var e = this;
return {
x: e.x1 + e.width() / 2,
y: e.y1 + e.height() / 2
}
},
containsPoint: function (e) {
var t = this;
return e.x >= t.x1 && e.x <= t.x2 && e.y >= t.y1 && e.y <= t.y2
},
points: function () {
var e = this;
return [new Gt(e.x1, e.y1), new Gt(e.x2, e.y1), new Gt(e.x2, e.y2), new Gt(e.x1, e.y2)]
},
getHash: function () {
var e = this;
return [e.x1, e.y1, e.x2, e.y2].join(",")
}
}, T = et.extend({
init: function (e, t, n, i, r) {
var o = this;
o.c = e, o.ir = t, o.r = n, o.startAngle = i, o.angle = r
},
clone: function () {
var e = this;
return new T(e.c, e.ir, e.r, e.startAngle, e.angle)
},
middle: function () {
return this.startAngle + this.angle / 2
},
radius: function (e, t) {
var n = this;
return t ? n.ir = e : n.r = e, n
},
point: function (e, t) {
var n = this,
i = e * wt,
r = ot.cos(i),
o = ot.sin(i),
a = t ? n.ir : n.r,
s = n.c.x - r * a,
l = n.c.y - o * a;
return new Gt(s, l)
},
getBBox: function () {
var e, t, n, i = this,
r = new C(Et, Et, Pt, Pt),
o = m(i.startAngle % 360),
a = m((o + i.angle) % 360),
s = i.ir,
l = [0, 90, 180, 270, o, a].sort(b),
d = rt(o, l),
c = rt(a, l);
for (e = o == a ? l : c > d ? l.slice(d, c + 1) : [].concat(l.slice(0, c + 1), l.slice(d, l.length)), t = 0; e.length > t; t++) n = i.point(e[t]), r.wrapPoint(n), r.wrapPoint(n, s);
return s || r.wrapPoint(i.c), r
},
expand: function (e) {
return this.r += e, this
}
}), S = T.extend({
init: function (e, t, n, i) {
T.fn.init.call(this, e, 0, t, n, i)
},
expand: function (e) {
return T.fn.expand.call(this, e)
},
clone: function () {
var e = this;
return new S(e.c, e.r, e.startAngle, e.angle)
},
radius: function (e) {
return T.fn.radius.call(this, e)
},
point: function (e) {
return T.fn.point.call(this, e)
}
}), A = et.extend({
init: function (e) {
at(this, {
height: 40,
rotation: 90,
radius: 10,
arcAngle: 10
}, e)
}
}), F = et.extend({
init: function (e) {
var t = this;
t.children = [], t.options = at({}, t.options, e)
},
reflow: function (e) {
var t, n, i, r = this,
o = r.children;
for (n = 0; o.length > n; n++) i = o[n], i.reflow(e), t = t ? t.wrap(i.box) : i.box.clone();
r.box = t || e
},
getViewElements: function (e) {
var t, n, i, r = this,
o = r.options,
a = o.modelId,
s = [],
l = r.children,
d = l.length;
for (n = 0; d > n; n++) i = l[n], i.discoverable || (i.options = i.options || {}, i.options.modelId = a), s.push.apply(s, i.getViewElements(e));
return r.discoverable && (t = r.getRoot(), t && (t.modelMap[a] = r)), s
},
enableDiscovery: function () {
var e = this,
t = e.options;
t.modelId = Y.current.alloc(), e.discoverable = !0
},
destroy: function () {
var e, n = this,
i = n.children,
r = n.getRoot(),
o = n.options.modelId;
for (r && o && (r.modelMap[o] && Y.current.free(o), r.modelMap[o] = t), e = 0; i.length > e; e++) i[e].destroy()
},
getRoot: function () {
var e = this.parent;
return e ? e.getRoot() : null
},
translateChildren: function (e, t) {
var n, i = this,
r = i.children,
o = r.length;
for (n = 0; o > n; n++) r[n].box.translate(e, t)
},
append: function () {
var e, t = this,
n = arguments.length;
for (f(t.children, arguments), e = 0; n > e; e++) arguments[e].parent = t
}
}), D = F.extend({
init: function (e) {
var t = this;
t.modelMap = {}, F.fn.init.call(t, e)
},
options: {
width: yt,
height: _t,
background: Ut,
border: {
color: pt,
width: 0
},
margin: n(5),
zIndex: -2
},
reflow: function () {
var e, t = this,
n = t.options,
i = t.children,
r = new C(0, 0, n.width, n.height);
for (t.box = r.unpad(n.margin), e = 0; i.length > e; e++) i[e].reflow(r), r = d(r, i[e].box)
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = n.border || {}, r = t.box.clone().pad(n.margin).unpad(i.width),
o = [e.createRect(r, {
stroke: i.width ? i.color : "",
strokeWidth: i.width,
dashType: i.dashType,
fill: n.background,
fillOpacity: n.opacity,
zIndex: n.zIndex
})];
return o.concat(F.fn.getViewElements.call(t, e))
},
getRoot: function () {
return this
}
}), I = F.extend({
init: function (e) {
F.fn.init.call(this, e)
},
options: {
align: Dt,
vAlign: Nt,
margin: {},
padding: {},
border: {
color: pt,
width: 0
},
background: "",
shrinkToFit: !1,
width: 0,
height: 0,
visible: !0
},
reflow: function (e) {
function t() {
o.align(e, Wt, a.align), o.align(e, jt, a.vAlign), o.paddingBox = i.clone().unpad(s).unpad(d)
}
var i, r, o = this,
a = o.options,
s = n(a.margin),
l = n(a.padding),
d = a.border.width;
F.fn.reflow.call(o, e), i = a.width && a.height ? o.box = new C(0, 0, a.width, a.height) : o.box, a.shrinkToFit ? (t(), r = o.contentBox = o.paddingBox.clone().unpad(l)) : (r = o.contentBox = i.clone(), i.pad(l).pad(d).pad(s), t()), o.translateChildren(i.x1 - r.x1 + s.left + d + l.left, i.y1 - r.y1 + s.top + d + l.top)
},
align: function (e, t, n) {
var i = this,
r = i.box,
o = t + 1,
a = t + 2,
s = t === Wt ? Vt : Ct,
l = r[s]();
u(n, [Dt, Nt]) ? (r[o] = e[o], r[a] = r[o] + l) : u(n, [Ot, ft]) ? (r[a] = e[a], r[o] = r[a] - l) : n == ht && (r[o] = e[o] + (e[s]() - l) / 2, r[a] = r[o] + l)
},
hasBox: function () {
var e = this.options;
return e.border.width || e.background
},
getViewElements: function (e, t) {
var n = this,
i = n.options,
r = [];
return i.visible ? (n.hasBox() && r.push(e.createRect(n.paddingBox, at(n.elementStyle(), t))), r.concat(F.fn.getViewElements.call(n, e))) : []
},
elementStyle: function () {
var e = this,
t = e.options,
n = t.border || {};
return {
id: t.id,
stroke: n.width ? n.color : "",
strokeWidth: n.width,
dashType: n.dashType,
strokeOpacity: t.opacity,
fill: t.background,
fillOpacity: t.opacity,
animation: t.animation,
zIndex: t.zIndex,
data: {
modelId: t.modelId
}
}
}
}), E = F.extend({
init: function (e, t) {
var n = this;
F.fn.init.call(n, t), n.content = e, n.reflow(new C)
},
options: {
font: vt,
color: pt,
align: Dt,
vAlign: ""
},
reflow: function (e) {
var t, n, i = this,
o = i.options;
t = o.size = r(i.content, {
font: o.font
}, o.rotation), i.baseline = t.baseline, o.align == Dt ? i.box = new C(e.x1, e.y1, e.x1 + t.width, e.y1 + t.height) : o.align == Ot ? i.box = new C(e.x2 - t.width, e.y1, e.x2, e.y1 + t.height) : o.align == ht && (n = (e.width() - t.width) / 2, i.box = new C(m(e.x1 + n, gt), e.y1, m(e.x2 - n, gt), e.y1 + t.height)), o.vAlign == ht ? (n = (e.height() - t.height) / 2, i.box = new C(i.box.x1, e.y1 + n, i.box.x2, e.y2 - n)) : o.vAlign == ft ? i.box = new C(i.box.x1, e.y2 - t.height, i.box.x2, e.y2) : o.vAlign == Nt && (i.box = new C(i.box.x1, e.y1, i.box.x2, e.y1 + t.height))
},
getViewElements: function (e) {
var t = this,
n = t.options;
return F.fn.getViewElements.call(this, e), [e.createText(t.content, at({}, n, {
x: t.box.x1,
y: t.box.y1,
baseline: t.baseline,
data: {
modelId: n.modelId
}
}))]
}
}), P = I.extend({
init: function (e, t) {
var n, i = this;
I.fn.init.call(i, t), t = i.options, n = new E(e, at({}, t, {
align: Dt,
vAlign: Nt
})), i.append(n), i.hasBox() && (n.options.id = s()), i.reflow(new C)
}
}), z = F.extend({
init: function (e) {
var t = this;
F.fn.init.call(t, e), e = t.options, t.append(new P(e.text, at({}, e, {
vAlign: e.position
})))
},
options: {
color: pt,
position: Nt,
align: ht,
margin: n(5),
padding: n(5)
},
reflow: function (e) {
var t = this;
F.fn.reflow.call(t, e), t.box.snapTo(e, Wt)
}
}), z.buildTitle = function (e, t, n) {
var i;
return "string" == typeof e && (e = {
text: e
}), e = at({
visible: !0
}, n, e), e && e.visible && e.text && (i = new z(e), t.append(i)), i
}, H = P.extend({
init: function (e, t, n, i) {
var r = this,
o = e;
i.template ? (r.template = tt(i.template), o = r.template({
value: e,
dataItem: n
})) : i.format && (o = r.formatValue(e, i)), r.text = o, r.value = e, r.index = t, r.dataItem = n, P.fn.init.call(r, o, at({
id: s()
}, i)), r.enableDiscovery()
},
formatValue: function (e, t) {
return w(t.format, e)
},
click: function (t, n) {
var i = this;
t.trigger(ct, {
element: e(n.target),
value: i.value,
text: i.text,
index: i.index,
dataItem: i.dataItem,
axis: i.parent.options
})
}
}), R = F.extend({
init: function (e) {
var t = this;
F.fn.init.call(t, e), t.options.visible || (t.options = at({}, t.options, {
labels: {
visible: !1
},
line: {
visible: !1
},
margin: 0,
majorTickSize: 0,
minorTickSize: 0
})), t.options.minorTicks = at({}, {
color: t.options.line.color,
width: t.options.line.width,
visible: t.options.minorTickType != zt
}, t.options.minorTicks, {
size: t.options.minorTickSize,
align: t.options.minorTickType
}), t.options.majorTicks = at({}, {
color: t.options.line.color,
width: t.options.line.width,
visible: t.options.majorTickType != zt
}, t.options.majorTicks, {
size: t.options.majorTickSize,
align: t.options.majorTickType
}), t.createLabels(), t.createTitle()
},
options: {
labels: {
visible: !0,
rotation: 0,
mirror: !1,
step: 1,
skip: 0
},
line: {
width: 1,
color: pt,
visible: !0
},
title: {
visible: !0,
position: ht
},
majorTicks: {
align: Ht,
size: 4
},
minorTicks: {
align: Ht,
size: 3
},
axisCrossingValue: 0,
majorTickType: Ht,
minorTickType: zt,
minorGridLines: {
visible: !1,
width: 1,
color: pt
},
margin: 5,
visible: !0,
reverse: !1,
justified: !0,
_alignLines: !0
},
createLabels: function () {
var e, t, n, i = this,
r = i.options,
o = r.vertical ? Ot : ht,
a = at({}, r.labels, {
align: o,
zIndex: r.zIndex,
modelId: r.modelId
}),
s = a.step;
if (i.labels = [], a.visible)
for (n = i.labelsCount(), t = a.skip; n > t; t += s) e = i.createAxisLabel(t, a), i.append(e), i.labels.push(e)
},
destroy: function () {
var e, t = this,
n = t.labels;
for (e = 0; n.length > e; e++) n[e].destroy();
F.fn.destroy.call(t)
},
lineBox: function () {
var e = this,
t = e.options,
n = e.box,
i = t.vertical,
r = e.labels,
o = i ? Ct : Vt,
a = t.justified,
s = t.labels.mirror,
l = s ? n.x1 : n.x2,
d = s ? n.y2 : n.y1,
c = 0,
u = t.line.width;
return a && r.length > 1 && (c = r[0].box[o]() / 2, u = p(r).box[o]() / 2), i ? new C(l, n.y1 + c, l, n.y2 - u) : new C(n.x1 + c, d, n.x2 - u, d)
},
createTitle: function () {
var e, t = this,
n = t.options,
i = at({
rotation: n.vertical ? -90 : 0,
text: "",
zIndex: 1
}, n.title);
i.visible && i.text && (e = new P(i.text, i), t.append(e), t.title = e)
},
renderTicks: function (e) {
function t(t, a, u, p, f) {
var h, g = f / a,
m = t.length;
if (p)
for (h = 0; m > h; h++) 0 !== h % g && (n = c ? d.x2 : d.x2 - u.size, i = c ? d.y1 - u.size : d.y1, r = t[h], o = {
strokeWidth: u.width,
stroke: u.color,
align: l._alignLines
}, l.vertical ? s.push(e.createLine(n, r, n + u.size, r, o)) : s.push(e.createLine(r, i, r, i + u.size, o)))
}
var n, i, r, o, a = this,
s = [],
l = a.options,
d = a.lineBox(),
c = l.labels.mirror;
return t(a.getMajorTickPositions(), l.majorUnit, l.majorTicks, l.majorTicks.visible), t(a.getMinorTickPositions(), l.minorUnit, l.minorTicks, l.minorTicks.visible, l.majorTicks.visible ? l.majorUnit : 0), s
},
getViewElements: function (e) {
var t, n = this,
i = n.options,
r = i.line,
o = n.lineBox(),
a = F.fn.getViewElements.call(n, e);
return r.width > 0 && r.visible && (t = {
strokeWidth: r.width,
stroke: r.color,
dashType: r.dashType,
zIndex: r.zIndex,
align: i._alignLines
}, a.push(e.createLine(o.x1, o.y1, o.x2, o.y2, t)), f(a, n.renderTicks(e))), f(a, n.renderPlotBands(e)), a
},
getActualTickSize: function () {
var e = this,
t = e.options,
n = 0;
return t.majorTicks.visible && t.minorTicks.visible ? n = ot.max(t.majorTicks.size, t.minorTicks.size) : t.majorTicks.visible ? n = t.majorTicks.size : t.minorTicks.visible && (n = t.minorTicks.size), n
},
renderPlotBands: function (e) {
var t, n, i, r, o = this,
a = o.options,
s = a.plotBands || [],
l = a.vertical,
d = [],
c = o.plotArea;
return s.length && (d = nt(s, function (a) {
return i = _(a.from) ? a.from : Pt, r = _(a.to) ? a.to : Et, l ? (t = c.axisX.lineBox(), n = o.getSlot(a.from, a.to)) : (t = o.getSlot(a.from, a.to), n = c.axisY.lineBox()), e.createRect(new C(t.x1, n.y1, t.x2, n.y2), {
fill: a.color,
fillOpacity: a.opacity,
zIndex: -1
})
})), d
},
renderGridLines: function (e, n) {
var i = this,
r = i.plotArea.options.modelId,
o = i.options,
a = o.vertical,
s = n.lineBox(),
l = s[a ? "x1" : "y1"],
d = s[a ? "x2" : "y2"],
c = i.getMajorTickPositions(),
p = [],
f = function (e, t) {
return {
pos: e,
options: t
}
};
return o.majorGridLines.visible && (p = nt(c, function (e) {
return f(e, o.majorGridLines)
})), o.minorGridLines.visible && (p = p.concat(nt(i.getMinorTickPositions(), function (e) {
return o.majorGridLines.visible ? u(e, c) ? t : f(e, o.minorGridLines) : f(e, o.minorGridLines)
}))), nt(p, function (t) {
var i = {
data: {
modelId: r
},
strokeWidth: t.options.width,
stroke: t.options.color,
dashType: t.options.dashType,
zIndex: -1
}, o = m(t.pos),
s = n.lineBox();
if (a) {
if (!n.options.line.visible || s.y1 !== o) return e.createLine(l, o, d, o, i)
} else if (!n.options.line.visible || s.x1 !== o) return e.createLine(o, l, o, d, i)
})
},
reflow: function (e) {
var t, n, i = this,
r = i.options,
o = r.vertical,
a = i.labels,
s = a.length,
l = i.getActualTickSize() + r.margin,
d = 0,
c = 0,
u = i.title;
for (n = 0; s > n; n++) t = a[n], d = ot.max(d, t.box.height()), c = ot.max(c, t.box.width());
u && (o ? c += u.box.width() : d += u.box.height()), i.box = o ? new C(e.x1, e.y1, e.x1 + c + l, e.y2) : new C(e.x1, e.y1, e.x2, e.y1 + d + l), i.arrangeTitle(), i.arrangeLabels(c, d)
},
arrangeLabels: function () {
var e, t, n, i, r, o, a, s, l, d, c, u = this,
p = u.options,
f = p.labels,
h = u.labels,
g = !p.justified,
m = p.vertical,
v = u.lineBox(),
_ = p.labels.mirror,
b = u.getMajorTickPositions(),
y = u.getActualTickSize() + p.margin;
for (n = 0; h.length > n; n++) s = h[n], l = f.skip + f.step * n, d = m ? s.box.height() : s.box.width(), c = b[l] - d / 2, m ? (g && (i = b[l], r = b[l + 1], o = i + (r - i) / 2, c = o - d / 2), a = v.x2, _ ? a += y : a -= y + s.box.width(), e = s.box.move(a, c)) : (g ? (i = b[l], r = b[l + 1]) : (i = c, r = c + d), t = v.y1, _ ? t -= y + s.box.height() : t += y, e = new C(i, t, r, t + s.box.height())), s.reflow(e)
},
arrangeTitle: function () {
var e = this,
t = e.options,
n = t.labels.mirror,
i = t.vertical,
r = e.title;
r && (i ? (r.options.align = n ? Ot : Dt, r.options.vAlign = r.options.position) : (r.options.align = r.options.position, r.options.vAlign = n ? Nt : ft), r.reflow(e.box))
},
alignTo: function (e) {
var t = this,
n = e.lineBox(),
i = t.options.vertical,
r = i ? jt : Wt;
t.box.snapTo(n, r), i ? t.box.shrink(0, t.lineBox().height() - n.height()) : t.box.shrink(t.lineBox().width() - n.width(), 0), t.box[r + 1] -= t.lineBox()[r + 1] - n[r + 1], t.box[r + 2] -= t.lineBox()[r + 2] - n[r + 2]
}
}), O = R.extend({
init: function (e, t, n) {
var i = this,
r = i.initDefaults(e, t, n);
R.fn.init.call(i, r)
},
options: {
type: "numeric",
min: 0,
max: 1,
vertical: !0,
majorGridLines: {
visible: !0,
width: 1,
color: pt
},
zIndex: 1
},
initDefaults: function (e, t, n) {
var i, r = this,
a = n.narrowRange,
s = r.autoAxisMin(e, t, a),
l = r.autoAxisMax(e, t, a),
d = o(s, l),
c = {
majorUnit: d
};
return 0 > s && (s -= d), l > 0 && (l += d), c.min = g(s, d), c.max = h(l, d), n && (i = _(n.min) || _(n.max), i && n.min === n.max && (n.min > 0 ? n.min = 0 : n.max = 1), n.majorUnit ? (c.min = g(c.min, n.majorUnit), c.max = h(c.max, n.majorUnit)) : i && (n = at(c, n), c.majorUnit = o(n.min, n.max))), c.minorUnit = (n.majorUnit || c.majorUnit) / 5, at(c, n)
},
range: function () {
var e = this.options;
return {
min: e.min,
max: e.max
}
},
autoAxisMax: function (e, t, n) {
var i, r;
if (!e && !t) return 1;
if (0 >= e && 0 >= t) {
if (t = e == t ? 0 : t, r = ot.abs((t - e) / t), !n && r > qt) return 0;
i = ot.min(0, t - (e - t) / 2)
} else e = e == t ? 0 : e, i = t;
return i
},
autoAxisMin: function (e, t, n) {
var i, r;
if (!e && !t) return 0;
if (e >= 0 && t >= 0) {
if (e = e == t ? 0 : e, r = (t - e) / t, !n && r > qt) return 0;
i = ot.max(0, e - (t - e) / 2)
} else t = e == t ? 0 : t, i = e;
return i
},
getDivisions: function (e) {
var t = this.options,
n = t.max - t.min;
return ot.floor(m(n / e, gt)) + 1
},
getTickPositions: function (e) {
var t, n = this,
i = n.options,
r = i.vertical,
o = i.reverse,
a = n.lineBox(),
s = r ? a.height() : a.width(),
l = i.max - i.min,
d = s / l,
c = e * d,
u = n.getDivisions(e),
p = (r ? -1 : 1) * (o ? -1 : 1),
f = 1 === p ? 1 : 2,
h = a[(r ? jt : Wt) + f],
g = [];
for (t = 0; u > t; t++) g.push(m(h, gt)), h += c * p;
return g
},
getMajorTickPositions: function () {
var e = this;
return e.getTickPositions(e.options.majorUnit)
},
getMinorTickPositions: function () {
var e = this;
return e.getTickPositions(e.options.minorUnit)
},
getSlot: function (e, t) {
var n, i, r = this,
o = r.options,
a = o.reverse,
s = o.vertical,
l = s ? jt : Wt,
d = r.lineBox(),
c = d[l + (a ? 2 : 1)],
u = s ? d.height() : d.width(),
p = a ? -1 : 1,
f = p * (u / (o.max - o.min)),
h = new C(d.x1, d.y1, d.x1, d.y1);
return _(e) || (e = t || 0), _(t) || (t = e || 0), e = ot.max(ot.min(e, o.max), o.min), t = ot.max(ot.min(t, o.max), o.min), s ? (n = o.max - ot.max(e, t), i = o.max - ot.min(e, t)) : (n = ot.min(e, t) - o.min, i = ot.max(e, t) - o.min), h[l + 1] = c + f * (a ? i : n), h[l + 2] = c + f * (a ? n : i), h
},
getValue: function (e) {
var t, n = this,
i = n.options,
r = i.reverse,
o = i.vertical,
a = 1 * i.max,
s = 1 * i.min,
l = o ? jt : Wt,
d = n.lineBox(),
c = d[l + (r ? 2 : 1)],
u = o ? d.height() : d.width(),
p = r ? -1 : 1,
f = p * (e[l] - c),
h = (a - s) / u,
g = f * h;
return 0 > f || f > u ? null : (t = o ? a - g : s + g, m(t, bt))
},
translateRange: function (e) {
var t = this,
n = t.options,
i = t.lineBox(),
r = n.vertical,
o = n.reverse,
a = r ? i.height() : i.width(),
s = n.max - n.min,
l = a / s,
d = m(e / l, bt);
return !r && !o || r && o || (d = -d), {
min: n.min + d,
max: n.max + d
}
},
scaleRange: function (e) {
var t = this,
n = t.options,
i = -e * n.majorUnit;
return {
min: n.min - i,
max: n.max + i
}
},
labelsCount: function () {
return this.getDivisions(this.options.majorUnit)
},
createAxisLabel: function (e, t) {
var n = this,
i = n.options,
r = m(i.min + e * i.majorUnit, bt);
return new H(r, e, null, t)
}
}), M = et.extend({
init: function (e) {
var t = this;
t.children = [], t.options = at({}, t.options, e)
},
render: function () {
return this.template(this)
},
renderContent: function () {
var e, t = this,
n = "",
i = t.sortChildren(),
r = i.length;
for (e = 0; r > e; e++) n += i[e].render();
return n
},
sortChildren: function () {
var e, t, n = this,
i = n.children;
for (t = 0, e = i.length; e > t; t++) i[t]._childIndex = t;
return i.slice(0).sort(n.compareChildren)
},
refresh: e.noop,
compareChildren: function (e, t) {
var n = e.options.zIndex || 0,
i = t.options.zIndex || 0;
return n !== i ? n - i : e._childIndex - t._childIndex
},
renderId: function () {
var e = this,
t = "";
return e.options.id && (t = e.renderAttr("id", e.options.id)), t
},
renderAttr: function (e, t) {
return _(t) ? " " + e + "='" + t + "' " : ""
},
renderDataAttributes: function () {
var e, t, n = this,
i = n.options.data,
r = "";
for (e in i) t = "data-" + e.replace(Lt, "-$1").toLowerCase(), r += n.renderAttr(t, i[e]);
return r
}
}), N = M.extend({
init: function (e) {
var t = this;
M.fn.init.call(t, e), t.definitions = {}, t.decorators = [], t.animations = []
},
destroy: function () {
for (var e = this.animations; e.length > 0;) e.shift().destroy()
},
renderDefinitions: function () {
var e, t = this.definitions,
n = "";
for (e in t) t.hasOwnProperty(e) && (n += t[e].render());
return n
},
decorate: function (e) {
var t, n, i = this.decorators,
r = i.length;
for (t = 0; r > t; t++) n = i[t], this._decorateChildren(n, e), e = n.decorate.call(n, e);
return e
},
_decorateChildren: function (e, t) {
var n, i = this,
r = t.children,
o = r.length;
for (n = 0; o > n; n++) i._decorateChildren(e, r[n]), r[n] = e.decorate.call(e, r[n])
},
setupAnimations: function () {
for (var e = 0; this.animations.length > e; e++) this.animations[e].setup()
},
playAnimations: function () {
for (var e = 0; this.animations.length > e; e++) this.animations[e].play()
},
buildGradient: function (e) {
var t, n, i, r = this,
o = r._gradientCache;
return o || (o = r._gradientCache = []), e && (t = a(e), n = o[t], i = Z.Gradients[e.gradient], !n && i && (n = at({
id: s()
}, i, e), o[t] = n)), n
},
setDefaults: function (e) {
var t = this.options;
return e = e || {}, _(e.inline) || (e.inline = t.inline), _(e.align) || (e.align = t.align), e
}
}), Z.Gradients = {
glass: {
type: It,
rotation: 0,
stops: [{
offset: 0,
color: Ut,
opacity: 0
}, {
offset: .25,
color: Ut,
opacity: .3
}, {
offset: 1,
color: Ut,
opacity: 0
}]
},
sharpBevel: {
type: Rt,
stops: [{
offset: 0,
color: Ut,
opacity: .55
}, {
offset: .65,
color: Ut,
opacity: 0
}, {
offset: .95,
color: Ut,
opacity: .25
}]
},
roundedBevel: {
type: Rt,
stops: [{
offset: .33,
color: Ut,
opacity: .06
}, {
offset: .83,
color: Ut,
opacity: .2
}, {
offset: .95,
color: Ut,
opacity: 0
}]
},
roundedGlass: {
type: Rt,
supportVML: !1,
stops: [{
offset: 0,
color: Ut,
opacity: 0
}, {
offset: .5,
color: Ut,
opacity: .3
}, {
offset: .99,
color: Ut,
opacity: 0
}]
},
sharpGlass: {
type: Rt,
supportVML: !1,
stops: [{
offset: 0,
color: Ut,
opacity: .2
}, {
offset: .15,
color: Ut,
opacity: .15
}, {
offset: .17,
color: Ut,
opacity: .35
}, {
offset: .85,
color: Ut,
opacity: .05
}, {
offset: .87,
color: Ut,
opacity: .15
}, {
offset: .99,
color: Ut,
opacity: 0
}]
}
}, B = et.extend({
init: function (e, t) {
var n = this;
n.options = at({}, n.options, t), n.element = e
},
options: {
duration: Ft,
easing: Mt
},
play: function () {
var t, n, i, r, o, a = this,
s = a.options,
l = a.element,
d = l.options.id,
c = s.delay || 0,
u = +new Date + c,
p = s.duration,
f = u + p,
h = e.easing[s.easing];
setTimeout(function () {
var e = function () {
a._stopped || (n = +new Date, i = ot.min(n - u, p), r = i / p, o = h(r, i, 0, 1, p), a.step(o), (!t || k(t)) && (t = x(d)), l.refresh(t), f > n ? Z.requestFrame(e) : a.destroy())
};
e()
}, c)
},
abort: function () {
this._stopped = !0
},
destroy: function () {
this.abort()
},
setup: it,
step: it
}), L = B.extend({
options: {
duration: 200,
easing: It
},
setup: function () {
var e = this,
t = e.element.options;
e.targetFillOpacity = t.fillOpacity, e.targetStrokeOpacity = t.strokeOpacity, t.fillOpacity = t.strokeOpacity = 0
},
step: function (e) {
var t = this,
n = t.element.options;
n.fillOpacity = e * t.targetFillOpacity, n.strokeOpacity = e * t.targetStrokeOpacity
}
}), V = B.extend({
options: {
size: 0,
easing: It
},
setup: function () {
var e = this.element.points;
e[1].x = e[2].x = e[0].x
},
step: function (e) {
var t = this.options,
n = v(0, t.size, e),
i = this.element.points;
i[1].x = i[2].x = i[0].x + n
},
destroy: function () {
B.fn.destroy.call(this), this.element.destroy()
}
}), U = B.extend({
options: {
easing: It,
duration: 900
},
setup: function () {
var e, t, n = this,
i = n.element,
r = i.options,
o = n.options,
a = o.center;
r.rotation && (e = o.startAngle, t = r.rotation[0], o.duration = ot.max(1e3 * (ot.abs(e - t) / o.speed), 1), n.endState = t, r.rotation = [e, a.x, a.y])
},
step: function (e) {
var t = this,
n = t.element;
n.options.rotation && (n.options.rotation[0] = v(t.options.startAngle, t.endState, e))
}
}), W = B.extend({
options: {
easing: Mt
},
setup: function () {
var e, t = this,
n = t.element,
i = n.points,
r = n.options,
o = r.vertical ? jt : Wt,
a = r.stackBase,
s = r.aboveAxis,
l = t.endState = {
top: i[0].y,
right: i[1].x,
bottom: i[3].y,
left: i[0].x
};
e = o === jt ? _(a) ? a : l[s ? ft : Nt] : _(a) ? a : l[s ? Dt : Ot], t.startPosition = e, y(i, o, e)
},
step: function (e) {
var t = this,
n = t.startPosition,
i = t.endState,
r = t.element,
o = r.points;
r.options.vertical ? (o[0].y = o[1].y = v(n, i.top, e), o[2].y = o[3].y = v(n, i.bottom, e)) : (o[0].x = o[3].x = v(n, i.left, e), o[1].x = o[2].x = v(n, i.right, e))
}
}), j = B.extend({
options: {
easing: Mt,
duration: 1e3
},
setup: function () {
var e, t, n, i = this,
r = i.element,
o = r.points,
a = r.options.animation,
s = a.vertical,
l = a.reverse,
d = i.axis = s ? "y" : "x",
c = i.options.endPosition,
u = i.initialState = {
top: o[0].y,
right: o[1].x,
bottom: o[3].y,
left: o[0].x
}, p = !_(i.options.endPosition);
s ? (n = l ? "y2" : "y1", e = u[p && !l ? ft : Nt], t = p ? u[l ? ft : Nt] : c[n]) : (n = l ? "x1" : "x2", e = u[p && !l ? Dt : Ot], t = p ? u[l ? Dt : Ot] : c[n]), i.start = e, i.end = t, p ? y(o, d, i.start) : a.speed && (i.options.duration = ot.max(1e3 * (ot.abs(i.start - i.end) / a.speed), 1))
},
step: function (e) {
var t = this,
n = t.start,
i = t.end,
r = t.element,
o = r.points,
a = t.axis;
r.options.animation.vertical ? o[0][a] = o[1][a] = v(n, i, e) : o[1][a] = o[2][a] = v(n, i, e)
}
}), q = B.extend({
options: {
easing: Mt,
duration: 1e3
},
setup: function () {
var e, t, n, i = this,
r = i.element,
o = r.points,
a = r.options.animation,
s = a.vertical,
l = a.reverse,
d = s ? "y" : "x",
c = d + (l ? "1" : "2"),
u = d + (l ? "2" : "1"),
p = a.startPosition[s ? c : u],
f = a.size / 2,
h = o.length,
g = !_(i.options.endPosition),
m = f;
for (i.axis = d, i.endPositions = [], i.startPositions = [], g || (p = o[1][d], t = i.options.endPosition[s ? u : c], a.speed && (i.options.duration = ot.max(1e3 * (ot.abs(p - t) / a.speed), 1))), n = 0; h > n; n++) e = at({}, o[n]), g ? (i.endPositions[n] = e[d], o[n][d] = p - m) : i.endPositions[n] = t - m, i.startPositions[n] = o[n][d], m -= f
},
step: function (e) {
var t, n = this,
i = n.startPositions,
r = n.endPositions,
o = n.element,
a = o.points,
s = n.axis,
l = a.length;
for (t = 0; l > t; t++) a[t][s] = v(i[t], r[t], e)
}
}), G = i(xt, L), $ = function (e) {
var t, n, i, r, o, a = this,
s = $.formats;
if (1 === arguments.length)
for (e = a.resolveColor(e), r = 0; s.length > r; r++) t = s[r].re, n = s[r].process, i = t.exec(e), i && (o = n(i), a.r = o[0], a.g = o[1], a.b = o[2]);
else a.r = arguments[0], a.g = arguments[1], a.b = arguments[2];
a.r = a.normalizeByte(a.r), a.g = a.normalizeByte(a.g), a.b = a.normalizeByte(a.b)
}, $.prototype = {
toHex: function () {
var e = this,
t = e.padDigit,
n = e.r.toString(16),
i = e.g.toString(16),
r = e.b.toString(16);
return "#" + t(n) + t(i) + t(r)
},
resolveColor: function (e) {
return e = e || pt, "#" == e.charAt(0) && (e = e.substr(1, 6)), e = e.replace(/ /g, ""), e = e.toLowerCase(), e = $.namedColors[e] || e
},
normalizeByte: function (e) {
return 0 > e || isNaN(e) ? 0 : e > 255 ? 255 : e
},
padDigit: function (e) {
return 1 === e.length ? "0" + e : e
},
brightness: function (e) {
var t = this,
n = ot.round;
return t.r = n(t.normalizeByte(t.r * e)), t.g = n(t.normalizeByte(t.g * e)), t.b = n(t.normalizeByte(t.b * e)), t
},
percBrightness: function () {
var e = this;
return ot.sqrt(.241 * e.r * e.r + .691 * e.g * e.g + .068 * e.b * e.b)
}
}, $.formats = [{
re: /^rgb\((\d{1,3}),\s*(\d{1,3}),\s*(\d{1,3})\)$/,
process: function (e) {
return [parseInt(e[1], 10), parseInt(e[2], 10), parseInt(e[3], 10)]
}
}, {
re: /^(\w{2})(\w{2})(\w{2})$/,
process: function (e) {
return [parseInt(e[1], 16), parseInt(e[2], 16), parseInt(e[3], 16)]
}
}, {
re: /^(\w{1})(\w{1})(\w{1})$/,
process: function (e) {
return [parseInt(e[1] + e[1], 16), parseInt(e[2] + e[2], 16), parseInt(e[3] + e[3], 16)]
}
}], $.namedColors = {
aqua: "00ffff",
azure: "f0ffff",
beige: "f5f5dc",
black: "000000",
blue: "0000ff",
brown: "a52a2a",
coral: "ff7f50",
cyan: "00ffff",
darkblue: "00008b",
darkcyan: "008b8b",
darkgray: "a9a9a9",
darkgreen: "006400",
darkorange: "ff8c00",
darkred: "8b0000",
dimgray: "696969",
fuchsia: "ff00ff",
gold: "ffd700",
goldenrod: "daa520",
gray: "808080",
green: "008000",
greenyellow: "adff2f",
indigo: "4b0082",
ivory: "fffff0",
khaki: "f0e68c",
lightblue: "add8e6",
lightgrey: "d3d3d3",
lightgreen: "90ee90",
lightpink: "ffb6c1",
lightyellow: "ffffe0",
lime: "00ff00",
limegreen: "32cd32",
linen: "faf0e6",
magenta: "ff00ff",
maroon: "800000",
mediumblue: "0000cd",
navy: "000080",
olive: "808000",
orange: "ffa500",
orangered: "ff4500",
orchid: "da70d6",
pink: "ffc0cb",
plum: "dda0dd",
purple: "800080",
red: "ff0000",
royalblue: "4169e1",
salmon: "fa8072",
silver: "c0c0c0",
skyblue: "87ceeb",
slateblue: "6a5acd",
slategray: "708090",
snow: "fffafa",
steelblue: "4682b4",
tan: "d2b48c",
teal: "008080",
tomato: "ff6347",
turquoise: "40e0d0",
violet: "ee82ee",
wheat: "f5deb3",
white: "ffffff",
whitesmoke: "f5f5f5",
yellow: "ffff00",
yellowgreen: "9acd32"
}, Y = et.extend({
init: function (e, t, n) {
this._pool = [], this._freed = {}, this._size = e, this._id = n, this._prefix = t
},
alloc: function () {
var e, t = this,
n = t._pool;
return n.length > 0 ? (e = n.pop(), t._freed[e] = !1) : e = t._prefix + t._id++, e
},
free: function (e) {
var t = this,
n = t._pool,
i = t._freed;
n.length < t._size && !i[e] && (n.push(e), i[e] = !0)
}
}), Y.current = new Y(St, Tt, At), Q = et.extend({
init: function (e) {
this._size = e, this._length = 0, this._map = {}
},
put: function (e, t) {
var n = this,
i = n._map,
r = {
key: e,
value: t
};
i[e] = r, n._head ? (n._tail.newer = r, r.older = n._tail, n._tail = r) : n._head = n._tail = r, n._length >= n._size ? (i[n._head.key] = null, n._head = n._head.newer, n._head.older = null) : n._length++
},
get: function (e) {
var n = this,
i = n._map[e];
return i ? (i === n._head && i !== n._tail && (n._head = i.newer, n._head.older = null), i !== n._tail && (i.older && (i.older.newer = i.newer, i.newer.older = i.older), i.older = n._tail, i.newer = null, n._tail.newer = i, n._tail = i), i.value) : t
}
}), r.cache = new Q(1e3), r.baselineMarker = e("")[0], K = window.requestAnimationFrame || window.webkitRequestAnimationFrame || window.mozRequestAnimationFrame || window.oRequestAnimationFrame || window.msRequestAnimationFrame || function (e) {
setTimeout(e, dt)
}, Z.requestFrame = function (e, t) {
return K(e, t)
}, at(J.dataviz, {
init: function (e) {
J.init(e, J.dataviz.ui)
},
ui: {
roles: {},
themes: {},
views: [],
defaultView: function () {
var e, t = Z.ui.views,
n = t.length;
for (e = 0; n > e; e++)
if (t[e].available()) return t[e];
J.logToConsole("Warning: KendoUI DataViz cannot render. Possible causes:\n- The browser does not support SVG or VML. User agent: " + navigator.userAgent + "\n" + "- The kendo.dataviz.svg.js or kendo.dataviz.vml.js scripts are not loaded")
},
registerView: function (e) {
var t = Z.ui.views[0];
!t || e.preference > t.preference ? Z.ui.views.unshift(e) : Z.ui.views.push(e)
},
plugin: function (e) {
J.ui.plugin(e, Z.ui)
}
},
AXIS_LABEL_CLICK: ct,
COORD_PRECISION: gt,
DEFAULT_PRECISION: bt,
DEFAULT_WIDTH: yt,
DEFAULT_HEIGHT: _t,
DEFAULT_FONT: vt,
INITIAL_ANIMATION_DURATION: Ft,
CLIP: mt,
Axis: R,
AxisLabel: H,
Box2D: C,
BoxElement: I,
ChartElement: F,
Color: $,
ElementAnimation: B,
ExpandAnimation: V,
ArrowAnimation: q,
BarAnimation: W,
BarIndicatorAnimatin: j,
FadeAnimation: L,
FadeAnimationDecorator: G,
IDPool: Y,
LRUCache: Q,
NumericAxis: O,
Point2D: Gt,
Ring: T,
Pin: A,
RootElement: D,
RotationAnimation: U,
Sector: S,
Text: E,
TextBox: P,
Title: z,
ViewBase: N,
ViewElement: M,
animationDecorator: i,
append: f,
autoFormat: w,
autoMajorUnit: o,
boxDiff: d,
defined: _,
getElement: x,
getSpacing: n,
inArray: u,
interpolateValue: v,
last: p,
measureText: r,
rotatePoint: l,
round: m,
ceil: h,
floor: g,
supportsSVG: c,
renderTemplate: st,
uniqueId: s
})
}(window.kendo.jQuery),
function () {
var e = window.kendo,
t = e.dataviz.ui,
n = e.deepExtend,
i = 1.5,
r = .4,
o = "#000",
a = "Arial,Helvetica,sans-serif",
s = "11px " + a,
l = "12px " + a,
d = "16px " + a,
c = "#fff",
u = {
title: {
font: d
},
legend: {
labels: {
font: l
}
},
seriesDefaults: {
visible: !0,
labels: {
font: s
},
donut: {
margin: 1
},
line: {
width: 4
},
area: {
line: {
opacity: 1,
width: 0
}
},
candlestick: {
line: {
width: 1,
color: o
},
border: {
width: 1,
_brightness: .8
},
gap: 1,
spacing: .3,
downColor: c,
aggregate: {
open: "max",
high: "max",
low: "min",
close: "max"
},
highlight: {
line: {
width: 2
},
border: {
width: 2,
opacity: 1
}
}
},
ohlc: {
line: {
width: 1
},
gap: 1,
spacing: .3,
aggregate: {
open: "max",
high: "max",
low: "min",
close: "max"
},
highlight: {
line: {
width: 3,
opacity: 1
}
}
},
bubble: {
opacity: .6,
border: {
width: 0
},
labels: {
background: "transparent"
}
},
bar: {
gap: i,
spacing: r
},
column: {
gap: i,
spacing: r
},
bullet: {
gap: i,
spacing: r,
target: {
color: "#ff0000"
}
},
verticalBullet: {
gap: i,
spacing: r,
target: {
color: "#ff0000"
}
}
},
categoryAxis: {
majorGridLines: {
visible: !0
}
},
axisDefaults: {
labels: {
font: l
},
title: {
font: d,
margin: 5
},
crosshair: {
tooltip: {
font: l
}
}
},
tooltip: {
font: l
},
navigator: {
pane: {
height: 90,
margin: {
top: 10
}
}
}
}, p = {
scale: {
labels: {
font: l
}
}
}, f = t.themes,
h = t.registerTheme = function (e, t) {
var i, r = {};
r.chart = n({}, u, t.chart), r.gauge = n({}, p, t.gauge), i = r.chart.seriesDefaults, i.verticalLine = n({}, i.line), i.verticalArea = n({}, i.area), f[e] = r
};
h("black", {
chart: {
title: {
color: c
},
legend: {
labels: {
color: c
},
inactiveItems: {
labels: {
color: "#919191"
},
markers: {
color: "#919191"
}
}
},
seriesDefaults: {
labels: {
color: c
},
pie: {
overlay: {
gradient: "sharpBevel"
}
},
donut: {
overlay: {
gradient: "sharpGlass"
}
},
line: {
markers: {
background: "#3d3d3d"
}
},
scatter: {
markers: {
background: "#3d3d3d"
}
},
scatterLine: {
markers: {
background: "#3d3d3d"
}
},
area: {
opacity: .4,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#555",
line: {
color: c
},
border: {
_brightness: 1.5,
opacity: 1
},
highlight: {
border: {
color: c,
opacity: .2
}
}
},
ohlc: {
line: {
color: c
}
}
},
chartArea: {
background: "#3d3d3d"
},
seriesColors: ["#0081da", "#3aafff", "#99c900", "#ffeb3d", "#b20753", "#ff4195"],
axisDefaults: {
line: {
color: "#8e8e8e"
},
labels: {
color: c
},
majorGridLines: {
color: "#545454"
},
minorGridLines: {
color: "#454545"
},
title: {
color: c
},
crosshair: {
color: "#8e8e8e"
}
}
},
gauge: {
pointer: {
color: "#0070e4"
},
scale: {
rangePlaceholderColor: "#1d1d1d",
labels: {
color: c
},
minorTicks: {
color: c
},
majorTicks: {
color: c
},
line: {
color: c
}
}
}
}), h("blueopal", {
chart: {
title: {
color: "#293135"
},
legend: {
labels: {
color: "#293135"
},
inactiveItems: {
labels: {
color: "#27A5BA"
},
markers: {
color: "#27A5BA"
}
}
},
seriesDefaults: {
labels: {
color: o,
background: c,
opacity: .5
},
area: {
opacity: .4,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#c4d0d5",
line: {
color: "#9aabb2"
}
}
},
seriesColors: ["#0069a5", "#0098ee", "#7bd2f6", "#ffb800", "#ff8517", "#e34a00"],
axisDefaults: {
line: {
color: "#9aabb2"
},
labels: {
color: "#293135"
},
majorGridLines: {
color: "#c4d0d5"
},
minorGridLines: {
color: "#edf1f2"
},
title: {
color: "#293135"
},
crosshair: {
color: "#9aabb2"
}
}
},
gauge: {
pointer: {
color: "#005c83"
},
scale: {
rangePlaceholderColor: "#daecf4",
labels: {
color: "#293135"
},
minorTicks: {
color: "#293135"
},
majorTicks: {
color: "#293135"
},
line: {
color: "#293135"
}
}
}
}), h("highcontrast", {
chart: {
title: {
color: "#ffffff"
},
legend: {
labels: {
color: "#ffffff"
},
inactiveItems: {
labels: {
color: "#66465B"
},
markers: {
color: "#66465B"
}
}
},
seriesDefaults: {
labels: {
color: "#ffffff"
},
pie: {
overlay: {
gradient: "sharpGlass"
}
},
donut: {
overlay: {
gradient: "sharpGlass"
}
},
line: {
markers: {
background: "#2c232b"
}
},
scatter: {
markers: {
background: "#2c232b"
}
},
scatterLine: {
markers: {
background: "#2c232b"
}
},
area: {
opacity: .5,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#664e62",
line: {
color: "#ffffff"
},
border: {
_brightness: 1.5,
opacity: 1
},
highlight: {
border: {
color: "#ffffff",
opacity: 1
}
}
},
ohlc: {
line: {
color: "#ffffff"
}
}
},
chartArea: {
background: "#2c232b"
},
seriesColors: ["#a7008f", "#ffb800", "#3aafff", "#99c900", "#b20753", "#ff4195"],
axisDefaults: {
line: {
color: "#ffffff"
},
labels: {
color: "#ffffff"
},
majorGridLines: {
color: "#664e62"
},
minorGridLines: {
color: "#4f394b"
},
title: {
color: "#ffffff"
},
crosshair: {
color: "#ffffff"
}
}
},
gauge: {
pointer: {
color: "#a7008f"
},
scale: {
rangePlaceholderColor: "#2c232b",
labels: {
color: "#ffffff"
},
minorTicks: {
color: "#2c232b"
},
majorTicks: {
color: "#664e62"
},
line: {
color: "#ffffff"
}
}
}
}), h("default", {
chart: {
title: {
color: "#8e8e8e"
},
legend: {
labels: {
color: "#232323"
},
inactiveItems: {
labels: {
color: "#919191"
},
markers: {
color: "#919191"
}
}
},
seriesDefaults: {
labels: {
color: o,
background: c,
opacity: .5
},
area: {
opacity: .4,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#dedede",
line: {
color: "#8d8d8d"
}
}
},
seriesColors: ["#ff6800", "#a0a700", "#ff8d00", "#678900", "#ffb53c", "#396000"],
axisDefaults: {
line: {
color: "#8e8e8e"
},
labels: {
color: "#232323"
},
minorGridLines: {
color: "#f0f0f0"
},
majorGridLines: {
color: "#dfdfdf"
},
title: {
color: "#232323"
},
crosshair: {
color: "#8e8e8e"
}
}
},
gauge: {
pointer: {
color: "#ea7001"
},
scale: {
rangePlaceholderColor: "#dedede",
labels: {
color: "#2e2e2e"
},
minorTicks: {
color: "#2e2e2e"
},
majorTicks: {
color: "#2e2e2e"
},
line: {
color: "#2e2e2e"
}
}
}
}), h("silver", {
chart: {
title: {
color: "#4e5968"
},
legend: {
labels: {
color: "#4e5968"
},
inactiveItems: {
labels: {
color: "#B1BCC8"
},
markers: {
color: "#B1BCC8"
}
}
},
seriesDefaults: {
labels: {
color: "#293135",
background: "#eaeaec",
opacity: .5
},
line: {
markers: {
background: "#eaeaec"
}
},
scatter: {
markers: {
background: "#eaeaec"
}
},
scatterLine: {
markers: {
background: "#eaeaec"
}
},
pie: {
connectors: {
color: "#A6B1C0"
}
},
donut: {
connectors: {
color: "#A6B1C0"
}
},
area: {
opacity: .4,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#a6afbe"
}
},
chartArea: {
background: "#eaeaec"
},
seriesColors: ["#007bc3", "#76b800", "#ffae00", "#ef4c00", "#a419b7", "#430B62"],
axisDefaults: {
line: {
color: "#a6b1c0"
},
labels: {
color: "#4e5968"
},
majorGridLines: {
color: "#dcdcdf"
},
minorGridLines: {
color: "#eeeeef"
},
title: {
color: "#4e5968"
},
crosshair: {
color: "#a6b1c0"
}
}
},
gauge: {
pointer: {
color: "#0879c0"
},
scale: {
rangePlaceholderColor: "#f3f3f4",
labels: {
color: "#515967"
},
minorTicks: {
color: "#515967"
},
majorTicks: {
color: "#515967"
},
line: {
color: "#515967"
}
}
}
}), h("metro", {
chart: {
title: {
color: "#777777"
},
legend: {
labels: {
color: "#777777"
},
inactiveItems: {
labels: {
color: "#CBCBCB"
},
markers: {
color: "#CBCBCB"
}
}
},
seriesDefaults: {
labels: {
color: o
},
area: {
opacity: .4,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#c7c7c7",
line: {
color: "#787878"
}
},
overlay: {
gradient: "none"
},
border: {
_brightness: 1
}
},
seriesColors: ["#8ebc00", "#309b46", "#25a0da", "#ff6900", "#e61e26", "#d8e404", "#16aba9", "#7e51a1", "#313131", "#ed1691"],
axisDefaults: {
line: {
color: "#c7c7c7"
},
labels: {
color: "#777777"
},
minorGridLines: {
color: "#c7c7c7"
},
majorGridLines: {
color: "#c7c7c7"
},
title: {
color: "#777777"
},
crosshair: {
color: "#c7c7c7"
}
}
},
gauge: {
pointer: {
color: "#8ebc00"
},
scale: {
rangePlaceholderColor: "#e6e6e6",
labels: {
color: "#777"
},
minorTicks: {
color: "#777"
},
majorTicks: {
color: "#777"
},
line: {
color: "#777"
}
}
}
}), h("metroblack", {
chart: {
title: {
color: "#ffffff"
},
legend: {
labels: {
color: "#ffffff"
},
inactiveItems: {
labels: {
color: "#797979"
},
markers: {
color: "#797979"
}
}
},
seriesDefaults: {
border: {
_brightness: 1
},
labels: {
color: "#ffffff"
},
line: {
markers: {
background: "#0e0e0e"
}
},
bubble: {
opacity: .6
},
scatter: {
markers: {
background: "#0e0e0e"
}
},
scatterLine: {
markers: {
background: "#0e0e0e"
}
},
area: {
opacity: .4,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#828282",
line: {
color: "#ffffff"
}
},
overlay: {
gradient: "none"
}
},
chartArea: {
background: "#0e0e0e"
},
seriesColors: ["#00aba9", "#309b46", "#8ebc00", "#ff6900", "#e61e26", "#d8e404", "#25a0da", "#7e51a1", "#313131", "#ed1691"],
axisDefaults: {
line: {
color: "#cecece"
},
labels: {
color: "#ffffff"
},
minorGridLines: {
color: "#2d2d2d"
},
majorGridLines: {
color: "#333333"
},
title: {
color: "#ffffff"
},
crosshair: {
color: "#cecece"
}
}
},
gauge: {
pointer: {
color: "#00aba9"
},
scale: {
rangePlaceholderColor: "#2d2d2d",
labels: {
color: "#ffffff"
},
minorTicks: {
color: "#333333"
},
majorTicks: {
color: "#cecece"
},
line: {
color: "#cecece"
}
}
}
}), h("moonlight", {
chart: {
title: {
color: "#ffffff"
},
legend: {
labels: {
color: "#ffffff"
},
inactiveItems: {
labels: {
color: "#A1A7AB"
},
markers: {
color: "#A1A7AB"
}
}
},
seriesDefaults: {
labels: {
color: "#ffffff"
},
pie: {
overlay: {
gradient: "sharpBevel"
}
},
donut: {
overlay: {
gradient: "sharpGlass"
}
},
line: {
markers: {
background: "#212a33"
}
},
bubble: {
opacity: .6
},
scatter: {
markers: {
background: "#212a33"
}
},
scatterLine: {
markers: {
background: "#212a33"
}
},
area: {
opacity: .3,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#757d87",
line: {
color: "#ea9d06"
},
border: {
_brightness: 1.5,
opacity: 1
},
highlight: {
border: {
color: c,
opacity: .2
}
}
},
ohlc: {
line: {
color: "#ea9d06"
}
}
},
chartArea: {
background: "#212a33"
},
seriesColors: ["#ffca08", "#ff710f", "#ed2e24", "#ff9f03", "#e13c02", "#a00201"],
axisDefaults: {
line: {
color: "#8c909e"
},
minorTicks: {
color: "#8c909e"
},
majorTicks: {
color: "#8c909e"
},
labels: {
color: "#ffffff"
},
majorGridLines: {
color: "#3e424d"
},
minorGridLines: {
color: "#2f3640"
},
title: {
color: "#ffffff"
},
crosshair: {
color: "#8c909e"
}
}
},
gauge: {
pointer: {
color: "#f4af03"
},
scale: {
rangePlaceholderColor: "#2f3640",
labels: {
color: c
},
minorTicks: {
color: "#8c909e"
},
majorTicks: {
color: "#8c909e"
},
line: {
color: "#8c909e"
}
}
}
}), h("uniform", {
chart: {
title: {
color: "#686868"
},
legend: {
labels: {
color: "#686868"
},
inactiveItems: {
labels: {
color: "#B6B6B6"
},
markers: {
color: "#B6B6B6"
}
}
},
seriesDefaults: {
labels: {
color: "#686868"
},
pie: {
overlay: {
gradient: "sharpBevel"
}
},
donut: {
overlay: {
gradient: "sharpGlass"
}
},
line: {
markers: {
background: "#ffffff"
}
},
bubble: {
opacity: .6
},
scatter: {
markers: {
background: "#ffffff"
}
},
scatterLine: {
markers: {
background: "#ffffff"
}
},
area: {
opacity: .3,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#cccccc",
line: {
color: "#cccccc"
},
border: {
_brightness: 1.5,
opacity: 1
},
highlight: {
border: {
color: "#cccccc",
opacity: .2
}
}
},
ohlc: {
line: {
color: "#cccccc"
}
}
},
chartArea: {
background: "#ffffff"
},
seriesColors: ["#527aa3", "#6f91b3", "#8ca7c2", "#a8bdd1", "#c5d3e0", "#e2e9f0"],
axisDefaults: {
line: {
color: "#9e9e9e"
},
minorTicks: {
color: "#aaaaaa"
},
majorTicks: {
color: "#888888"
},
labels: {
color: "#686868"
},
majorGridLines: {
color: "#dadada"
},
minorGridLines: {
color: "#e7e7e7"
},
title: {
color: "#686868"
},
crosshair: {
color: "#9e9e9e"
}
}
},
gauge: {
pointer: {
color: "#527aa3"
},
scale: {
rangePlaceholderColor: "#e7e7e7",
labels: {
color: "#686868"
},
minorTicks: {
color: "#aaaaaa"
},
majorTicks: {
color: "#888888"
},
line: {
color: "#9e9e9e"
}
}
}
}), h("bootstrap", {
chart: {
title: {
color: "#343434"
},
legend: {
labels: {
color: "#343434"
},
inactiveItems: {
labels: {
color: "#9A9A9A"
},
markers: {
color: "#9A9A9A"
}
}
},
seriesDefaults: {
labels: {
color: "#343434"
},
pie: {
overlay: {
gradient: "sharpBevel"
}
},
donut: {
overlay: {
gradient: "sharpGlass"
}
},
line: {
markers: {
background: "#ffffff"
}
},
bubble: {
opacity: .6
},
scatter: {
markers: {
background: "#ffffff"
}
},
scatterLine: {
markers: {
background: "#ffffff"
}
},
area: {
opacity: .3,
markers: {
visible: !1,
size: 6
}
},
candlestick: {
downColor: "#d0d0d0",
line: {
color: "#d0d0d0"
},
border: {
_brightness: 1.5,
opacity: 1
},
highlight: {
border: {
color: "#b8b8b8",
opacity: .2
}
}
},
ohlc: {
line: {
color: "#d0d0d0"
}
}
},
chartArea: {
background: "#ffffff"
},
seriesColors: ["#006dcc", "#49AFCD", "#5BB75B", "#FAA732", "#DA4F49", "#363636"],
axisDefaults: {
line: {
color: "#b8b8b8"
},
minorTicks: {
color: "#dddddd"
},
majorTicks: {
color: "#b8b8b8"
},
labels: {
color: "#343434"
},
majorGridLines: {
color: "#b8b8b8"
},
minorGridLines: {
color: "#dddddd"
},
title: {
color: "#343434"
},
crosshair: {
color: "#b8b8b8"
}
}
},
gauge: {
pointer: {
color: "#0044cc"
},
scale: {
rangePlaceholderColor: "#b8b8b8",
labels: {
color: "#343434"
},
minorTicks: {
color: "#dddddd"
},
majorTicks: {
color: "#b8b8b8"
},
line: {
color: "#b8b8b8"
}
}
}
})
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
function i(e, t, i) {
var r, o = typeof t;
return r = o === Gi ? It[t](e) : "function" === o ? t(e, i, n) : It.max(e)
}
function r(e, t, n) {
var r, o, a, s = T(n.type),
l = s.length,
d = e.length,
c = [],
u = [];
for (r = 0; l > r; r++) {
for (a = s[r], o = 0; d > o; o++) u.push(e[o][a]);
c.push(i(u, t[a], n)), u = []
}
return c
}
var o, a = t.aggregate;
return o = "object" == typeof a ? r(e, a, t) : i(e, a, t)
}
function i(e) {
return o(e).min
}
function r(e) {
return o(e).max
}
function o(e) {
var n, i, r = vi,
o = _i,
a = e.length;
for (n = 0; a > n; n++) i = e[n], null !== i && isFinite(i) && (r = Rt.min(r, i), o = Rt.max(o, i));
return {
min: r === vi ? t : r,
max: o === _i ? t : o
}
}
function a(e, t, n, i) {
var r, o, a = (i.x - n.x) * (e.y - n.y) - (i.y - n.y) * (e.x - n.x),
s = (i.y - n.y) * (t.x - e.x) - (i.x - n.x) * (t.y - e.y);
return 0 !== s && (o = a / s, r = new nn(e.x + o * (t.x - e.x), e.y + o * (t.y - e.y))), r
}
function s(e, t) {
var n, i, r = e.series,
o = r.length,
a = e.seriesDefaults,
s = jt({}, e.seriesDefaults),
d = t ? jt({}, t.seriesDefaults) : {}, c = jt({}, d);
for (l(s), l(c), n = 0; o > n; n++) i = r[n].type || e.seriesDefaults.type, r[n] = jt({}, c, d[i], {
tooltip: e.tooltip
}, s, a[i], r[n])
}
function l(e) {
delete e.bar, delete e.column, delete e.line, delete e.verticalLine, delete e.pie, delete e.donut, delete e.area, delete e.verticalArea, delete e.scatter, delete e.scatterLine, delete e.bubble, delete e.candlestick, delete e.ohlc, delete e.bullet, delete e.verticalBullet
}
function d(e) {
var t, n = e.series,
i = n.length,
r = e.seriesColors || [];
for (t = 0; i > t; t++) n[t].color = n[t].color || r[t % r.length]
}
function c(e) {
var t;
Pt([On, lr, hr, gr], function () {
t = this + "Axes", e[t] && (e[this + "Axis"] = e[t], delete e[t])
})
}
function u(t, n) {
var i = (n || {}).axisDefaults || {};
Pt([On, lr, hr, gr], function () {
var n = this + "Axis",
r = [].concat(t[n]),
o = t.axisDefaults || {};
r = e.map(r, function (e) {
var t = (e || {}).color,
r = jt({}, i, i[n], o, o[n], {
line: {
color: t
},
labels: {
color: t
},
title: {
color: t
}
}, e);
return delete r[n], r
}), t[n] = r.length > 1 ? r : r[0]
})
}
function p(e, t, n) {
e[t] = (e[t] || 0) + n
}
function f(e) {
var t, n = e.length,
i = 0;
for (t = 0; n > t; t++) i = Rt.max(i, e[t].data.length);
return i
}
function h(e) {
return e * e
}
function g(e, t) {
if (null === t) return t;
var n = qt(e, !0);
return n(t)
}
function m(e) {
var t, n, i;
if (e instanceof Date) t = e;
else if (typeof e === Gi) n = $n.exec(e), t = new Date(n ? parseInt(n[1], 10) : e);
else if (e)
if (e.length)
for (t = [], i = 0; e.length > i; i++) t.push(m(e[i]));
else t = new Date(e);
return t
}
function v(e) {
return zt(e) ? Ht(e, v) : e ? m(e).getTime() : t
}
function _(e, t, n, i) {
var r = e;
return e && (e = m(e), n === mr ? r = new Date(e.getFullYear() + t, 0, 1) : n === yi ? r = new Date(e.getFullYear(), e.getMonth() + t, 1) : n === pr ? r = _(b(e, i), 7 * t, Yn) : n === Yn ? r = new Date(e.getFullYear(), e.getMonth(), e.getDate() + t) : n === si ? (r = new Date(e.getFullYear(), e.getMonth(), e.getDate(), e.getHours() + t), t > 0 && H(e, r) && (r = _(e, t + 1, n, i))) : n === bi && (r = new Date(e.getTime() + t * $i), r.setSeconds(0))), r
}
function b(e, t) {
var n = e.getDay(),
i = 0;
for (t = t || 0; n !== t;) 0 === n ? n = 6 : n--, i++;
return k(e, -i * Qi)
}
function y(e, t, n) {
return e = m(e), _(e, 0, t, n)
}
function w(e, t, n) {
return e = m(e), e && y(e, t, n).getTime() === e.getTime() ? e : _(e, 1, t, n)
}
function x(e, t) {
var n = e.getTime() - t,
i = e.getTimezoneOffset() - t.getTimezoneOffset();
return n - i * $i
}
function k(e, t) {
var n = e.getTimezoneOffset(),
i = new Date(e.getTime() + t),
r = i.getTimezoneOffset() - n;
return new Date(i.getTime() + r * $i)
}
function C(e, t, n) {
var i;
return i = n === mr ? t.getFullYear() - e.getFullYear() : n === yi ? 12 * C(e, t, mr) + t.getMonth() - e.getMonth() : n === Yn ? Rt.floor(x(t, e) / Qi) : Rt.floor((t - e) / Zi[n])
}
function T(e) {
var t = [lr];
return gn(e, [Rn, Di]) ? t = ["open", "high", "low", "close"] : gn(e, [Hn, cr]) ? t = ["current", "target"] : gn(e, kr) && (t = [hr, gr], e === zn && t.push("size")), t
}
function S(e, t, n) {
var i, r, o, a, s = e.data[t],
l = {}, d = T(e.type),
c = {
value: s
};
return pn(s) ? zt(s) ? (i = s.slice(d.length), a = A(s, d), l = A(i, n)) : "object" == typeof s && (r = D(e, d), o = D(e, n), a = F(s, d, r), l = F(s, n, o)) : a = F({}, d), pn(a) && (1 === d.length && (a = a[d[0]]), c.value = a), c.fields = l, c
}
function A(e, t) {
var n, i, r = {};
if (t)
for (i = Rt.min(t.length, e.length), n = 0; i > n; n++) r[t[n]] = e[n];
return r
}
function F(e, t, n) {
var i, r, o, a, s = {};
if (t)
for (r = t.length, n = n || t, i = 0; r > i; i++) o = t[i], a = n[i], s[o] = g(a, e);
return s
}
function D(e, t) {
var n, i, r, o, a;
if (t)
for (i = t.length, o = [], n = 0; i > n; n++) r = t[n], a = r === lr ? "field" : r + "Field", o.push(e[a] || r);
return o
}
function I(e) {
return 1 === e.length ? e[0] : e
}
function E(e, t, n) {
return Rt.max(Rt.min(e, n), t)
}
function P(e) {
var t, n, i, r = e.length;
if (r > 0)
for (n = 0; r > n; n++) i = e[n].box, t ? t.wrap(i) : t = i.clone();
return t || Kt()
}
function z(e, t) {
return e && t ? e.toLowerCase() === t.toLowerCase() : e === t
}
function H(e, t) {
return e && t ? v(e) === v(t) : e === t
}
function R(e) {
for (var t, n = e.length; n--;)
if (t = e[n], pn(t) && null !== t) return t
}
function O(e, t) {
null !== t && e.push(t)
}
function M(e, t) {
for (var n, i, r = 0, o = e.length - 1; o >= r;)
if (n = Rt.floor((r + o) / 2), i = e[n], t > i) r = n + 1;
else {
if (!(i > t)) return n;
o = n - 1
}
return t >= e[n] ? n : n - 1
}
function N(e) {
var t, n, i = !0,
r = e.length;
for (t = 0; r > t; t++)
if (n = e[t], "number" != typeof n || isNaN(n)) {
i = !1;
break
}
return i
}
function B(e) {
var t, n, i, r = {};
for (t = 0; e.length > t; t++) n = e[t], i = n.options.name, i && (r[i] = n.range());
return r
}
function L(e) {
var t = e.originalEvent,
n = 0;
return t.wheelDelta && (n = -t.wheelDelta / 120, n = n > 0 ? Rt.ceil(n) : Rt.floor(n)), t.detail && (n = _n(t.detail / 3)), n
}
function V(e, n) {
var i, r, o, a = [],
s = n.length;
for (e.groupNameTemplate && (i = Wt(e.groupNameTemplate)), r = 0; s > r; r++) o = jt({}, e), o.color = t, o._groupIx = r, a.push(o), i && (o.name = i({
series: o,
group: n[r]
}));
return a
}
var U, W, j, q, G, $, Y, Q, K, X, J, Z, et, tt, nt, it, rt, ot, at, st, lt, dt, ct, ut, pt, ft, ht, gt, mt, vt, _t, bt, yt, wt, xt, kt, Ct, Tt, St, At, Ft, Dt, It, Et, Pt = e.each,
zt = e.isArray,
Ht = e.map,
Rt = Math,
Ot = e.extend,
Mt = e.proxy,
Nt = window.kendo,
Bt = Nt.Class,
Lt = Nt.Observable,
Vt = Nt.data.DataSource,
Ut = Nt.ui.Widget,
Wt = Nt.template,
jt = Nt.deepExtend,
qt = Nt.getter,
Gt = Nt.dataviz,
$t = Gt.Axis,
Yt = Gt.AxisLabel,
Qt = Gt.BarAnimation,
Kt = Gt.Box2D,
Xt = Gt.BoxElement,
Jt = Gt.ChartElement,
Zt = Gt.Color,
en = Gt.ElementAnimation,
tn = Gt.NumericAxis,
nn = Gt.Point2D,
rn = Gt.RootElement,
on = Gt.Ring,
an = Gt.Text,
sn = Gt.TextBox,
ln = Gt.Title,
dn = Gt.animationDecorator,
cn = Gt.append,
un = Gt.autoFormat,
pn = Gt.defined,
fn = Gt.getElement,
hn = Gt.getSpacing,
gn = Gt.inArray,
mn = Gt.interpolateValue,
vn = Gt.last,
_n = Gt.round,
bn = Gt.renderTemplate,
yn = Gt.uniqueId,
wn = ".kendoChart",
xn = "above",
kn = "area",
Cn = "auto",
Tn = "fit",
Sn = Gt.AXIS_LABEL_CLICK,
An = "bar",
Fn = .8,
Dn = "below",
In = "#000",
En = "both",
Pn = "bottom",
zn = "bubble",
Hn = "bullet",
Rn = "candlestick",
On = "category",
Mn = "center",
Nn = "change",
Bn = "circle",
Ln = "click" + wn,
Vn = Gt.CLIP,
Un = "column",
Wn = Gt.COORD_PRECISION,
jn = "k-",
qn = "dataBound",
Gn = "date",
$n = /^\/Date\((.*?)\)\/$/,
Yn = "days",
Qn = Gt.DEFAULT_FONT,
Kn = Gt.DEFAULT_HEIGHT,
Xn = Gt.DEFAULT_PRECISION,
Jn = Gt.DEFAULT_WIDTH,
Zn = Rt.PI / 180,
ei = "donut",
ti = 50,
ni = "drag",
ii = "dragEnd",
ri = "dragStart",
oi = "fadeIn",
ai = "glass",
si = "hours",
li = Gt.INITIAL_ANIMATION_DURATION,
di = "insideBase",
ci = "insideEnd",
ui = "interpolate",
pi = "left",
fi = "legendItemClick",
hi = "legendItemHover",
gi = "line",
mi = 8,
vi = Number.MAX_VALUE,
_i = -Number.MAX_VALUE,
bi = "minutes",
yi = "months",
wi = "mouseleave" + wn,
xi = "mousemove.tracking",
ki = "mouseover" + wn,
Ci = "mouseout" + wn,
Ti = "mousemove" + wn,
Si = 20,
Ai = 150,
Fi = "DOMMouseScroll" + wn + " mousewheel" + wn,
Di = "ohlc",
Ii = "outsideEnd",
Ei = "_outline",
Pi = "pie",
zi = 70,
Hi = "plotAreaClick",
Ri = "pointer",
Oi = "right",
Mi = "roundedBevel",
Ni = "roundedGlass",
Bi = "scatter",
Li = "scatterLine",
Vi = "selectStart",
Ui = "select",
Wi = "selectEnd",
ji = "seriesClick",
qi = "seriesHover",
Gi = "string",
$i = 6e4,
Yi = 60 * $i,
Qi = 24 * Yi,
Ki = 7 * Qi,
Xi = 31 * Qi,
Ji = 365 * Qi,
Zi = {
years: Ji,
months: Xi,
weeks: Ki,
days: Qi,
hours: Yi,
minutes: $i
}, er = "top",
tr = 150,
nr = 5,
ir = 100,
rr = 100,
or = "tooltip-inverse",
ar = "touchstart" + wn,
sr = "triangle",
lr = "value",
dr = "verticalArea",
cr = "verticalBullet",
ur = "verticalLine",
pr = "weeks",
fr = "#fff",
hr = "x",
gr = "y",
mr = "years",
vr = "zero",
_r = 3,
br = "zoomStart",
yr = "zoom",
wr = "zoomEnd",
xr = [An, Un, gi, ur, kn, dr, Rn, Di, Hn, cr],
kr = [Bi, Li, zn],
Cr = [bi, si, Yn, pr, yi, mr],
Tr = {
minutes: "HH:mm",
hours: "HH:mm",
days: "M/d",
weeks: "M/d",
months: "MMM 'yy",
years: "yyyy"
}, Sr = Ut.extend({
init: function (e, t) {
var n, i, r, o, a = this,
s = Gt.ui.themes || {};
Nt.destroy(e), Ut.fn.init.call(a, e), n = jt({}, a.options, t), a.element.addClass(jn + n.name.toLowerCase()).css("position", "relative"), a._originalOptions = jt({}, n), o = n.theme, r = s[o] || s[o.toLowerCase()], i = o && r ? r.chart : {}, c(n), a._applyDefaults(n, i), a.options = jt({}, i, n), d(a.options), a.bind(a.events, a.options), a.wrapper = a.element, a._initDataSource(t), Nt.notify(a, Gt.ui)
},
_initDataSource: function (e) {
var t = this,
n = (e || {}).dataSource;
t._dataChangeHandler = Mt(t._onDataChanged, t), t.dataSource = Vt.create(n).bind(Nn, t._dataChangeHandler), t._redraw(), t._attachEvents(), n && t.options.autoBind && t.dataSource.fetch()
},
setDataSource: function (e) {
var t = this;
t.dataSource.unbind(Nn, t._dataChangeHandler), t.dataSource = e, e.bind(Nn, t._dataChangeHandler), t.options.autoBind && e.fetch()
},
events: [qn, ji, qi, Sn, fi, hi, Hi, ri, ni, ii, br, yr, wr, Vi, Ui, Wi],
items: function () {
return e()
},
options: {
name: "Chart",
theme: "default",
chartArea: {},
legend: {
visible: !0,
labels: {}
},
categoryAxis: {},
autoBind: !0,
seriesDefaults: {
type: Un,
data: [],
highlight: {
visible: !0
},
groupNameTemplate: "#= group.value + (kendo.dataviz.defined(series.name) ? ': ' + series.name : '') #",
labels: {}
},
series: [],
tooltip: {
visible: !1
},
transitions: !0,
valueAxis: {},
plotArea: {},
title: {},
xAxis: {},
yAxis: {}
},
refresh: function () {
var e = this;
e._applyDefaults(e.options), d(e.options), e._bindSeries(), e._bindCategories(), e.trigger(qn), e._redraw()
},
redraw: function (e) {
var t, n, i = this;
i._applyDefaults(i.options), e ? (n = i._model._plotArea, t = n.findPane(e), n.redraw(t)) : i._redraw()
},
_redraw: function () {
var e, t = this,
n = t._getModel(),
i = Gt.ui.defaultView();
t._destroyView(), t._model = n, t._plotArea = n._plotArea, i && (e = t._view = i.fromModel(n), t._viewElement = t._renderView(e), t._tooltip = t._createTooltip(), t._highlight = new Ct(e, t._viewElement), t._setupSelection())
},
_sharedTooltip: function () {
var e = this,
t = e.options;
return e._plotArea instanceof ht && t.tooltip.shared
},
_createTooltip: function () {
var e, t = this,
n = t.options,
i = t.element;
return e = t._sharedTooltip() ? new At(i, t._plotArea, n.tooltip) : new St(i, n.tooltip)
},
_renderView: function () {
var e = this;
return e._view.renderTo(e.element[0])
},
svg: function () {
var e = this._getModel(),
t = Gt.SVGView.fromModel(e);
return t.render()
},
_applyDefaults: function (e, t) {
u(e, t), s(e, t)
},
_getModel: function () {
var e, t = this,
n = t.options,
i = new rn(t._modelOptions());
return i.parent = t, ln.buildTitle(n.title, i), e = i._plotArea = t._createPlotArea(), n.legend.visible && i.append(new Dr(e.options.legend)), i.append(e), i.reflow(), i
},
_modelOptions: function () {
var e = this,
t = e.options,
n = e.element,
i = Rt.floor(n.height()),
r = Rt.floor(n.width());
return jt({
width: r || Jn,
height: i || Kn,
transitions: t.transitions
}, t.chartArea)
},
_createPlotArea: function () {
var e, t, n, i = this,
r = i.options,
o = r.series,
a = o.length,
s = [],
l = [],
d = [],
c = [],
u = [];
for (e = 0; a > e; e++) t = o[e], gn(t.type, xr) ? s.push(t) : gn(t.type, kr) ? l.push(t) : t.type === Pi ? d.push(t) : t.type === ei ? c.push(t) : t.type === Hn && u.push(t);
return n = d.length > 0 ? new vt(d, r) : c.length > 0 ? new _t(c, r) : l.length > 0 ? new mt(l, r) : new ht(s, r)
},
_setupSelection: function () {
var e, t, n, i, r, o, a = this,
s = a._plotArea,
l = s.axes,
d = a._selections = [];
for (a._selectStartHandler || (a._selectStartHandler = Mt(a._selectStart, a), a._selectHandler = Mt(a._select, a), a._selectEndHandler = Mt(a._selectEnd, a)), t = 0; l.length > t; t++) n = l[t], o = n.options, n instanceof Ir && o.select && !o.vertical && (i = 0, r = o.categories.length - 1, n instanceof Pr && (i = o.categories[i], r = o.categories[r]), o.justified || (n instanceof Pr ? r = _(r, 1, o.baseUnit, o.weekStartDay) : r++), e = new Et(a, n, jt({
min: i,
max: r
}, o.select)), e.bind(Vi, a._selectStartHandler), e.bind(Ui, a._selectHandler), e.bind(Wi, a._selectEndHandler), d.push(e))
},
_selectStart: function (e) {
return this.trigger(Vi, e)
},
_select: function (e) {
return this.trigger(Ui, e)
},
_selectEnd: function (e) {
return this.trigger(Wi, e)
},
_attachEvents: function () {
var e = this,
t = e.element;
t.on(Ln, Mt(e._click, e)), t.on(ki, Mt(e._mouseover, e)), t.on(Ci, Mt(e._mouseout, e)), t.on(Fi, Mt(e._mousewheel, e)), t.on(ar, Mt(e._tap, e)), t.on(wi, Mt(e._mouseleave, e)), (e._plotArea.crosshairs.length || e._tooltip && e._sharedTooltip()) && t.on(Ti, Mt(e._mousemove, e)), Nt.UserEvents && (e._userEvents = new Nt.UserEvents(t, {
global: !0,
threshold: 5,
filter: ":not(.k-selector)",
multiTouch: !1,
start: Mt(e._start, e),
move: Mt(e._move, e),
end: Mt(e._end, e)
}))
},
_mouseout: function (e) {
var t = this,
n = t._model.modelMap[e.target.getAttribute("data-model-id")];
n && n.leave && n.leave(t, e)
},
_start: function (e) {
var t = this,
n = t._events;
pn(n[ri] || n[ni] || n[ii]) && t._startNavigation(e, ri)
},
_move: function (e) {
var t, n, i, r, o, a, s = this,
l = s._navState,
d = {};
if (l) {
for (e.preventDefault(), t = l.axes, n = 0; t.length > n; n++) i = t[n], r = i.options.name, r && (o = i.options.vertical ? e.y : e.x, a = o.startLocation - o.location, 0 !== a && (d[i.options.name] = i.translateRange(a)));
l.axisRanges = d, s.trigger(ni, {
axisRanges: d,
originalEvent: e
})
}
},
_end: function (e) {
this._endNavigation(e, ii)
},
_mousewheel: function (e) {
var t, n, i, r, o, a, s = this,
l = e.originalEvent,
d = L(e),
c = s._navState,
u = {};
if (c || (t = s._startNavigation(l, br), t || (c = s._navState)), c) {
for (n = c.totalDelta || d, c.totalDelta = n + d, i = s._navState.axes, r = 0; i.length > r; r++) o = i[r], a = o.options.name, a && (u[a] = o.scaleRange(n));
s.trigger(yr, {
delta: d,
axisRanges: u,
originalEvent: e
}), s._mwTimeout && clearTimeout(s._mwTimeout), s._mwTimeout = setTimeout(function () {
s._endNavigation(e, wr)
}, Ai)
}
},
_startNavigation: function (e, t) {
var n, i, r, o = this,
a = o._eventCoordinates(e),
s = o._model._plotArea,
l = s.findPointPane(a),
d = s.axes.slice(0),
c = !1;
if (l) {
for (n = 0; d.length > n; n++)
if (i = d[n], i.box.containsPoint(a)) {
c = !0;
break
}!c && s.backgroundBox().containsPoint(a) && (r = o.trigger(t, {
axisRanges: B(d),
originalEvent: e
}), r ? o._userEvents.cancel() : (o._suppressHover = !0, o._unsetActivePoint(), o._navState = {
pane: l,
axes: d
}))
}
},
_endNavigation: function (e, t) {
var n = this;
n._navState && (n.trigger(t, {
axisRanges: n._navState.axisRanges,
originalEvent: e
}), n._suppressHover = !1, n._navState = null)
},
_getChartElement: function (t) {
var n, i = this,
r = e(t.target).data("modelId"),
o = i._model;
return r && (n = o.modelMap[r]), n && n.aliasFor && (n = n.aliasFor(t, i._eventCoordinates(t))), n
},
_eventCoordinates: function (e) {
var t = this,
n = pn((e.x || {}).client),
i = n ? e.x.client : e.clientX,
r = n ? e.y.client : e.clientY;
return t._toModelCoordinates(i, r)
},
_toModelCoordinates: function (t, n) {
var i = this.element,
r = i.offset(),
o = parseInt(i.css("paddingLeft"), 10),
a = parseInt(i.css("paddingTop"), 10),
s = e(window);
return new nn(t - r.left - o + s.scrollLeft(), n - r.top - a + s.scrollTop())
},
_click: function (e) {
for (var t = this, n = t._getChartElement(e); n;) n.click && n.click(t, e), n = n.parent
},
_startHover: function (e) {
var n, i = this,
r = i._tooltip,
o = i._highlight,
a = i.options.tooltip;
if (!i._suppressHover && o && !gn(e.target, o._overlays) && !i._sharedTooltip()) return n = i._getChartElement(e), n && n.hover && (n.hover(i, e), !e.isDefaultPrevented()) ? (i._activePoint = n, a = jt({}, a, n.options.tooltip), a.visible && r.show(n), o.show(n), !0) : t
},
_mouseover: function (t) {
var n = this;
n._startHover(t) && e(document).on(xi, Mt(n._mouseMoveTracking, n))
},
_mouseMoveTracking: function (t) {
var n, i, r, o = this,
a = o.options,
s = o._tooltip,
l = o._highlight,
d = o._eventCoordinates(t),
c = o._activePoint;
o._plotArea.box.containsPoint(d) ? c && c.series && (c.series.type === gi || c.series.type === kn) && (i = c.parent, r = i.getNearestPoint(d.x, d.y, c.seriesIx), r && r != c && (r.hover(o, t), o._activePoint = r, n = jt({}, a.tooltip, c.options.tooltip), n.visible && s.show(r), l.show(r))) : (e(document).off(xi), o._unsetActivePoint())
},
_mousemove: function (e) {
var t, n = this,
i = new Date,
r = n._mousemove.timestamp;
(!r || i - r > Si) && (t = n._eventCoordinates(e), n._trackCrosshairs(t), n._sharedTooltip() && n._trackSharedTooltip(t), n._mousemove.timestamp = i)
},
_trackCrosshairs: function (e) {
var t, n, i = this._plotArea.crosshairs;
for (t = 0; i.length > t; t++) n = i[t], n.box.containsPoint(e) ? n.showAt(e) : n.hide()
},
_trackSharedTooltip: function (e) {
var t, n, i = this,
r = i.options,
o = i._plotArea,
a = o.categoryAxis,
s = i._tooltip,
l = r.tooltip,
d = i._highlight;
t = a.getCategoryIndex(e), t !== i._tooltipCategoryIx && (n = o.pointsByCategoryIndex(t), n.length > 0 ? (l.visible && s.showAt(n, e), d.show(n)) : s.hide(), i._tooltipCategoryIx = t)
},
_mouseleave: function () {
var e, t = this,
n = t._plotArea,
i = n.crosshairs,
r = t._tooltip,
o = t._highlight;
for (e = 0; i.length > e; e++) i[e].hide();
setTimeout(Mt(r.hide, r), rr), o.hide(), t._tooltipCategoryIx = null
},
_unsetActivePoint: function () {
var e = this,
t = e._tooltip,
n = e._highlight;
e._activePoint = null, t && t.hide(), n && n.hide()
},
_onDataChanged: function () {
var e, t, n = this,
i = n.options,
r = n._sourceSeries || i.series,
o = r.length,
a = n.dataSource.view(),
s = (n.dataSource.group() || []).length > 0,
l = [];
for (e = 0; o > e; e++) t = r[e], n._isBindable(t) && s ? cn(l, V(t, a)) : l.push(t || []);
n._sourceSeries = r, i.series = l, d(n.options), n._bindSeries(), n._bindCategories(), n.trigger(qn), n._redraw()
},
_bindSeries: function () {
var e, t, n, i, r = this,
o = r.dataSource.view(),
a = r.options.series,
s = a.length;
for (e = 0; s > e; e++) t = a[e], r._isBindable(t) && (n = t._groupIx, i = pn(n) ? (o[n] || {}).items : o, t.autoBind !== !1 && (t.data = i))
},
_bindCategories: function () {
var e, t, n = this,
i = n.dataSource.view(),
r = (n.dataSource.group() || []).length > 0,
o = (r ? i[0].items : i) || [],
a = n.options,
s = [].concat(a.categoryAxis);
for (e = 0; s.length > e; e++) t = s[e], t.autoBind !== !1 && n._bindCategoryAxis(t, o)
},
_bindCategoryAxis: function (e, t) {
var n, i, r;
if (e.field)
for (e.categories = [], n = 0; t.length > n; n++) r = t[n], i = g(e.field, r), 0 === n ? (e.categories = [i], e.dataItems = [r]) : (e.categories.push(i), e.dataItems.push(r))
},
_isBindable: function (e) {
var t, n, i = T(e.type),
r = !0;
for (n = 0; i.length > n; n++)
if (t = i[n], t === lr ? t = "field" : t += "Field", !e[t]) {
r = !1;
break
}
return r
},
_tap: function (e) {
var t = this;
t._startHover(e) || t._unsetActivePoint(), t._click(e)
},
_legendItemClick: function (e, t) {
var n, i, r = this,
o = r._plotArea,
a = (o.srcSeries || o.series)[e];
gn(a.type, [Pi, ei]) ? (n = a.data[t], n.visible = pn(n.visible) ? !n.visible : !1) : a.visible = !a.visible, r.options.transitions && (r.options.transitions = !1, i = !0), r.redraw(), i && (r.options.transitions = !0)
},
_legendItemHover: function (e, t) {
var n, i = this,
r = i._plotArea,
o = i._highlight,
a = (r.srcSeries || r.series)[e];
n = gn(a.type, [Pi, ei]) ? r.charts[0].segments[t] : r.pointsBySeriesIndex(e), o.show(n)
},
destroy: function () {
var t = this,
n = t.dataSource;
t.element.off(wn), n.unbind(Nn, t._dataChangeHandler), e(document).off(xi), t._userEvents && t._userEvents.destroy(), t._destroyView(), Ut.fn.destroy.call(t)
},
_destroyView: function () {
var t = this,
n = Gt.IDPool.current,
i = t._model,
r = t._view,
o = t._viewElement,
a = t._selections;
if (i && i.destroy(), r && r.destroy(), o && e("[id]", o).each(function () {
n.free(e(this).attr("id"))
}), a)
for (; a.length > 0;) a.shift().destroy()
}
}),
Ar = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.append(new sn(e, n.options))
},
options: {
position: Ii,
margin: hn(3),
padding: hn(4),
color: In,
background: "",
border: {
width: 1,
color: ""
},
aboveAxis: !0,
vertical: !1,
animation: {
type: oi,
delay: li
},
zIndex: 1
},
reflow: function (e) {
var t = this,
n = t.options,
i = n.vertical,
r = n.aboveAxis,
o = t.children[0],
a = o.box,
s = o.options.padding;
o.options.align = i ? Mn : pi, o.options.vAlign = i ? er : Mn, n.position == ci ? i ? (o.options.vAlign = er, !r && a.height() < e.height() && (o.options.vAlign = Pn)) : o.options.align = r ? Oi : pi : n.position == Mn ? (o.options.vAlign = Mn, o.options.align = Mn) : n.position == di ? i ? o.options.vAlign = r ? Pn : er : o.options.align = r ? pi : Oi : n.position == Ii && (i ? e = r ? new Kt(e.x1, e.y1 - a.height(), e.x2, e.y1) : new Kt(e.x1, e.y2, e.x2, e.y2 + a.height()) : (o.options.align = Mn, e = r ? new Kt(e.x2 + a.width(), e.y1, e.x2, e.y2) : new Kt(e.x1 - a.width(), e.y1, e.x1, e.y2))), i ? s.left = s.right = (e.width() - o.contentBox.width()) / 2 : s.top = s.bottom = (e.height() - o.contentBox.height()) / 2, o.reflow(e)
}
}),
Fr = an.extend({
init: function (e, t) {
var n = this;
n.item = e, an.fn.init.call(n, e.text, jt({
id: yn(),
cursor: {
style: Ri
}
}, t)), n.enableDiscovery()
},
click: function (t, n) {
var i = this.item;
n.preventDefault(), t.trigger(fi, {
element: e(n.target),
text: i.text,
series: i.series,
seriesIndex: i.series.index,
pointIndex: i.pointIndex
}), t._legendItemClick(i.series.index, i.pointIndex)
},
hover: function (t, n) {
var i = this.item;
n.preventDefault(), t.trigger(hi, {
element: e(n.target),
text: i.text,
series: i.series,
seriesIndex: i.series.index,
pointIndex: i.pointIndex
}), t._legendItemHover(i.series.index, i.pointIndex)
},
leave: function (e) {
e._unsetActivePoint()
}
}),
Dr = Jt.extend({
init: function (e) {
var t = this;
Jt.fn.init.call(t, e), t.createLabels()
},
options: {
position: Oi,
items: [],
labels: {},
offsetX: 0,
offsetY: 0,
margin: hn(10),
padding: hn(5),
border: {
color: In,
width: 0
},
background: "",
zIndex: 1,
markers: {
border: {
width: 1
}
}
},
createLabels: function () {
var e, t, n = this,
i = n.options.items,
r = i.length;
for (e = 0; r > e; e++) t = i[e], n.append(new Fr(t, jt({}, n.options.labels, {
color: t.labelColor
})))
},
reflow: function (e) {
var n = this,
i = n.options,
r = n.children.length;
return 0 === r ? (n.box = e.clone(), t) : "custom" == i.position ? (n.customLayout(e), t) : (i.position == er || i.position == Pn ? n.horizontalLayout(e) : n.verticalLayout(e), t)
},
getViewElements: function (e) {
var t, n, i, r, o, a, s, l = this,
d = l.children,
c = l.options,
u = c.items,
p = u.length,
f = l.markerSize(),
h = e.createGroup({
zIndex: c.zIndex
}),
g = c.border || {};
for (cn(h.children, Jt.fn.getViewElements.call(l, e)), s = 0; p > s; s++) r = u[s].markerColor, o = d[s], n = Kt(), a = o.box, i = i ? i.wrap(a) : a.clone(), n.x1 = a.x1 - 2 * f, n.x2 = n.x1 + f, n.y1 = c.position == er || c.position == Pn ? a.y1 + f / 2 : a.y1 + (a.height() - f) / 2, n.y2 = n.y1 + f, h.children.push(e.createRect(n, {
fill: r,
stroke: r,
strokeWidth: c.markers.border.width,
data: {
modelId: o.options.modelId
},
cursor: {
style: Ri
}
}));
return d.length > 0 && (t = hn(c.padding), t.left += 2 * f, i.pad(t), h.children.unshift(e.createRect(i, {
stroke: g.width ? g.color : "",
strokeWidth: g.width,
dashType: g.dashType,
fill: c.background
}))), [h]
},
verticalLayout: function (e) {
var t, n, i, r, o, a = this,
s = a.options,
l = a.children,
d = l.length,
c = l[0].box.clone(),
u = hn(s.margin),
p = 2 * a.markerSize();
for (r = 1; d > r; r++) i = a.children[r], i.box.alignTo(a.children[r - 1].box, Pn), c.wrap(i.box);
s.position == pi ? (t = e.x1 + p + u.left, n = (e.y2 - c.height()) / 2, c.x2 += p + u.left + u.right) : (t = e.x2 - c.width() - u.right, n = (e.y2 - c.height()) / 2, c.translate(t, n), c.x1 -= p + u.left), a.translateChildren(t + s.offsetX, n + s.offsetY), o = c.width(), c.x1 = Rt.max(e.x1, c.x1), c.x2 = c.x1 + o, c.y1 = e.y1, c.y2 = e.y2, a.box = c
},
horizontalLayout: function (e) {
var t, n, i, r, o = this,
a = o.options,
s = o.children,
l = s.length,
d = s[0].box.clone(),
c = 3 * o.markerSize(),
u = hn(a.margin),
p = s[0].box.width() + c,
f = e.width(),
h = 0;
for (r = 1; l > r; r++) i = s[r], p += i.box.width() + c, p > f - c ? (i.box = Kt(d.x1, d.y2, d.x1 + i.box.width(), d.y2 + i.box.height()), p = i.box.width() + c, h = i.box.y1) : (i.box.alignTo(s[r - 1].box, Oi), i.box.y2 = h + i.box.height(), i.box.y1 = h, i.box.translate(c, 0)), d.wrap(i.box);
t = (e.width() - d.width() + c) / 2, a.position === er ? (n = e.y1 + u.top, d.y2 = e.y1 + d.height() + u.top + u.bottom, d.y1 = e.y1) : (n = e.y2 - d.height() - u.bottom, d.y1 = e.y2 - d.height() - u.top - u.bottom, d.y2 = e.y2), o.translateChildren(t + a.offsetX, n + a.offsetY), d.x1 = e.x1, d.x2 = e.x2, o.box = d
},
customLayout: function (e) {
var t, n = this,
i = n.options,
r = n.children,
o = r.length,
a = r[0].box.clone(),
s = 2 * n.markerSize();
for (t = 1; o > t; t++) a = n.children[t].box, a.alignTo(n.children[t - 1].box, Pn), a.wrap(a);
n.translateChildren(i.offsetX + s, i.offsetY), n.box = e
},
markerSize: function () {
var e = this,
t = e.children;
return t.length > 0 ? t[0].box.height() / 2 : 0
}
}),
Ir = $t.extend({
init: function (e) {
var t = this;
$t.fn.init.call(t, e), e = t.options, e.categories = e.categories.slice(0), t._ticks = {}
},
options: {
type: On,
categories: [],
vertical: !1,
majorGridLines: {
visible: !1,
width: 1,
color: In
},
zIndex: 1,
justified: !1
},
range: function () {
return {
min: 0,
max: this.options.categories.length
}
},
getTickPositions: function (e) {
var t, n = this,
i = n.options,
r = i.vertical,
o = i.justified,
a = n.lineBox(),
s = r ? a.height() : a.width(),
l = e - (o ? 1 : 0),
d = s / l,
c = r ? gr : hr,
u = a[c + 1],
p = [];
for (t = 0; e > t; t++) p.push(_n(u, Wn)), u += d;
return o || p.push(a[c + 2]), i.reverse ? p.reverse() : p
},
getMajorTickPositions: function () {
return this.getTicks().majorTicks
},
getMinorTickPositions: function () {
return this.getTicks().minorTicks
},
getTicks: function () {
var e, t = this,
n = t._ticks,
i = t.options,
r = i.categories.length,
o = i.reverse,
a = i.justified,
s = t.lineBox();
return e = s.getHash() + r + o + a, n._hash !== e && (n._hash = e, n.majorTicks = t.getTickPositions(r), n.minorTicks = t.getTickPositions(2 * r)), n
},
getSlot: function (e, t) {
var n, i, r, o = this,
a = o.options,
s = o.getMajorTickPositions(),
l = a.reverse,
d = a.justified,
c = a.vertical ? gr : hr,
u = o.lineBox(),
p = u[c + (l ? 2 : 1)],
f = u[c + (l ? 1 : 2)],
h = u.clone(),
g = Rt.max(1, s.length - (d ? 0 : 1));
return e = pn(e) ? e : 0, t = pn(t) ? t : e, e = E(e, 0, g), t = E(t - 1, e, g), t = Rt.max(e, t), n = 0 === e ? p : s[e], i = d ? n : s[t], r = t - e, (r > 0 || e === t) && (i = s[t + 1] || f), d && (e === g ? n = i : i = n), h[c + 1] = l ? i : n, h[c + 2] = l ? n : i, h
},
getCategoryIndex: function (e) {
var t, n, i, r, o = this,
a = o.options,
s = a.reverse,
l = a.vertical,
d = l ? gr : hr,
c = o.lineBox(),
u = c[d + 1],
p = c[d + 2],
f = e[d],
h = o.getMajorTickPositions(),
g = vi;
if (u > f || f > p) return null;
for (i = 0; h.length > i; i++)
if (t = h[i], n = h[i + 1], pn(n) || (n = s ? u : p), s && (t = n, n = h[i]), a.justified) {
if (f === n) {
r = Rt.max(0, l ? h.length - i - 1 : i + 1);
break
}
g > Rt.abs(f - t) && (g = f - t, r = i)
} else if (f >= t && n >= f) {
r = i;
break
}
return r
},
getCategory: function (e) {
var t = this.getCategoryIndex(e);
return null === t ? null : this.options.categories[t]
},
translateRange: function (e) {
var t = this,
n = t.options,
i = t.lineBox(),
r = n.vertical ? i.height() : i.width(),
o = n.categories.length,
a = r / o,
s = _n(e / a, Xn);
return {
min: s,
max: o + s
}
},
scaleRange: function (e) {
var t = this,
n = t.options,
i = n.categories.length,
r = e * i;
return {
min: -r,
max: i + r
}
},
labelsCount: function () {
return this.options.categories.length
},
createAxisLabel: function (e, t) {
var n = this,
i = n.options,
r = i.dataItems ? i.dataItems[e] : null,
o = pn(i.categories[e]) ? i.categories[e] : "";
return new Yt(o, e, r, t)
}
}),
Er = Yt.extend({
formatValue: function (e, t) {
return Nt.toString(e, t.format, t.culture)
}
}),
Pr = Ir.extend({
init: function (e) {
var t, n, i = this;
e = e || {}, e = jt({
roundToBaseUnit: !0
}, e, {
min: m(e.min),
max: m(e.max)
}), e.categories && e.categories.length > 0 && (t = (e.baseUnit || "").toLowerCase(), n = t !== Tn && !gn(t, Cr), n && (e.baseUnit = i.defaultBaseUnit(e)), (t === Tn || e.baseUnitStep === Cn) && i.autoBaseUnit(e), i.groupCategories(e)), Ir.fn.init.call(i, e)
},
options: {
type: Gn,
labels: {
dateFormats: Tr
},
autoBaseUnitSteps: {
minutes: [1, 2, 5, 15, 30],
hours: [1, 2, 3],
days: [1, 2, 3],
weeks: [1, 2],
months: [1, 2, 3, 6],
years: [1, 2, 3, 5, 10, 25, 50]
},
maxDateGroups: 10
},
translateRange: function (e) {
var t = this,
n = Ir.fn.translateRange.call(t, e),
i = t.options,
r = i.baseUnit,
o = Rt.round(n.min),
a = i.weekStartDay;
return {
min: _(i.min, o, r, a),
max: _(i.max, o, r, a)
}
},
scaleRange: function (e) {
for (var t, n, i = this, r = i.options, o = Rt.abs(e), a = r.min, s = r.max; o--;) t = x(a, s), n = Rt.round(.1 * t), 0 > e ? (a = k(a, n), s = k(s, -n)) : (a = k(a, -n), s = k(s, n));
return {
min: a,
max: s
}
},
defaultBaseUnit: function (e) {
var t, n, i, r, o, a = e.categories,
s = pn(a) ? a.length : 0,
l = vi;
for (t = 0; s > t; t++) n = m(a[t]), n && r && (i = x(n, r), i > 0 && (l = Rt.min(l, i), o = l >= Ji ? mr : l >= Xi - 3 * Qi ? yi : l >= Ki ? pr : l >= Qi ? Yn : l >= Yi ? si : bi)), r = n;
return o || Yn
},
range: function (e) {
e = e || this.options;
var t = m(e.categories),
n = e.baseUnit === Tn,
i = n ? Cr[0] : e.baseUnit,
r = v(e.min),
a = v(e.max),
s = o(t),
l = v(s.min),
d = v(s.max);
return e.roundToBaseUnit ? {
min: _(r || l, 0, i, e.weekStartDay),
max: _(a || d, 1, i, e.weekStartDay)
} : {
min: m(r || l),
max: m(a || d)
}
},
autoBaseUnit: function (e) {
for (var t, n, i, r = this, o = r.range(e), a = e.baseUnit === Tn, s = 0, l = a ? Cr[s++] : e.baseUnit, d = o.max - o.min, c = d / Zi[l], u = c, p = e.maxDateGroups || r.options.maxDateGroups, f = jt({}, r.options.autoBaseUnitSteps, e.autoBaseUnitSteps); !n || c > p;)
if (t = t || f[l].slice(0), i = t.shift()) n = i, c = u / n;
else {
if (l === vn(Cr)) {
n = Rt.ceil(u / p);
break
}
if (!a) {
c > p && (n = Rt.ceil(u / p));
break
}
l = Cr[s++] || vn(Cr), u = d / Zi[l], t = null
}
e.baseUnitStep = n, e.baseUnit = l
},
getMajorTickPositions: function () {
var e, t, n, i, r, o, a, s, l, d, c, u, p, f, h, g, m, v = this,
_ = v.options,
b = _.categories,
y = [];
if (_.roundToBaseUnit || 0 === b.length) y = Ir.fn.getMajorTickPositions.call(v);
else {
for (n = _.vertical, i = _.reverse, r = v.lineBox(), o = n ? r.height() : r.width(), a = b[0].getTime(), s = v.range(v.options), l = s.max - s.min, d = o / l, c = b.length, u = (n ? -1 : 1) * (i ? -1 : 1), p = 1 === u ? 1 : 2, f = 1 === u ? 2 : 1, h = r[(n ? gr : hr) + p], g = r[(n ? gr : hr) + f], m = h, e = 0; c > e; e++) t = b[e] - a, m = h + t * d * u, y.push(_n(m, Wn));
vn(y) !== g && y.push(g)
}
return y
},
groupCategories: function (e) {
var t, n, i, r, o, a, s = this,
l = m(e.categories),
d = e.baseUnit,
c = e.baseUnitStep || 1,
u = s.range(e),
p = e.roundToBaseUnit,
f = [],
h = s.categoryMap = [],
g = [];
for (t = p ? _(u.max, c - 1, d, e.weekStartDay) : u.max, H(u.min, u.max) && (t = m(v(t) + 1)), n = u.min; t > n; n = i) {
for (i = _(n, c, d, e.weekStartDay), f.push(n), r = [], o = M(l, n); l.length > o; o++)
if (a = l[o], a && a >= n)
if (i > a) e.justified && H(a, t) ? g.push(o) : r.push(o);
else {
if (p || !H(i, t)) break;
g.push(o)
}
h.push(r)
}
g.length && (f.push(t), h.push(g)), e.max || 0 !== (vn(h) || []).length || (h.pop(), f.pop()), e.min = f[0], e.max = p ? vn(f) : t, e.categories = f
},
createAxisLabel: function (e, t) {
var n, i = this.options,
r = i.dataItems ? i.dataItems[e] : null,
o = i.categories[e],
a = i.baseUnit,
s = !0,
l = t.dateFormats[a];
return i.justified && (n = y(o, a, i.weekStartDay), s = H(n, o)), t = jt({
format: l
}, t, {
visible: s
}), new Er(o, e, r, t)
}
}),
zr = $t.extend({
init: function (e, t, n) {
var i = this;
n = n || {}, jt(n, {
min: m(n.min),
max: m(n.max),
axisCrossingValue: m(n.axisCrossingValues || n.axisCrossingValue)
}), n = i.applyDefaults(m(e), m(t), n), $t.fn.init.call(i, n)
},
options: {
type: Gn,
labels: {
dateFormats: Tr
}
},
applyDefaults: function (e, n, i) {
var r = this,
o = i.min || e,
a = i.max || n,
s = i.baseUnit || r.timeUnits(a - o),
l = Zi[s],
d = y(v(o) - 1, s) || m(a),
c = w(v(a) + 1, s),
u = i.majorUnit ? i.majorUnit : t,
p = u || Gt.ceil(Gt.autoMajorUnit(d.getTime(), c.getTime()), l) / l,
f = C(d, c, s),
h = Gt.ceil(f, p),
g = h - f,
b = Rt.floor(g / 2),
x = g - b;
return i.baseUnit || delete i.baseUnit, jt({
baseUnit: s,
min: _(d, -b, s),
max: _(c, x, s),
minorUnit: p / 5
}, i, {
majorUnit: p
})
},
range: function () {
var e = this.options;
return {
min: e.min,
max: e.max
}
},
getDivisions: function (e) {
var t = this.options;
return Rt.floor(C(t.min, t.max, t.baseUnit) / e + 1)
},
getTickPositions: function (e) {
var t, n = this,
i = n.options,
r = i.vertical,
o = i.reverse,
a = n.lineBox(),
s = r ? a.height() : a.width(),
l = C(i.min, i.max, i.baseUnit),
d = s / l,
c = e * d,
u = n.getDivisions(e),
p = (r ? -1 : 1) * (o ? -1 : 1),
f = 1 === p ? 1 : 2,
h = a[(r ? gr : hr) + f],
g = [];
for (t = 0; u > t; t++) g.push(_n(h, Wn)), h += c * p;
return g
},
getMajorTickPositions: function () {
var e = this;
return e.getTickPositions(e.options.majorUnit)
},
getMinorTickPositions: function () {
var e = this;
return e.getTickPositions(e.options.minorUnit)
},
getSlot: function (e, t) {
return tn.fn.getSlot.call(this, m(e), m(t))
},
getValue: function (e) {
var t = tn.fn.getValue.call(this, e);
return null !== t ? m(t) : null
},
labelsCount: function () {
return this.getDivisions(this.options.majorUnit)
},
createAxisLabel: function (e, t) {
var n = this.options,
i = e * n.majorUnit,
r = _(n.min, i, n.baseUnit),
o = t.dateFormats[n.baseUnit];
return t.format = t.format || o, new Er(r, e, null, t)
},
timeUnits: function (e) {
var t = si;
return e >= Ji ? t = mr : e >= Xi ? t = yi : e >= Ki ? t = pr : e >= Qi && (t = Yn), t
},
translateRange: function (e) {
var t = this,
n = t.options,
i = n.baseUnit,
r = n.weekStartDay,
o = t.lineBox(),
a = n.vertical ? o.height() : o.width(),
s = t.range(),
l = a / (s.max - s.min),
d = _n(e / l, Xn),
c = k(n.min, d),
u = k(n.max, d);
return {
min: _(c, 0, i, r),
max: _(u, 0, i, r)
}
},
scaleRange: function (e) {
for (var t, n, i = this, r = i.options, o = r.baseUnit, a = r.weekStartDay, s = Rt.abs(e), l = r.min, d = r.max; s--;) t = x(l, d), n = Rt.round(.1 * t), 0 > e ? (l = k(l, n), d = k(d, -n)) : (l = k(l, -n), d = k(d, n)), l = _(l, 0, o, a), d = _(d, 1, o, a);
return {
min: l,
max: d
}
}
}),
Hr = Jt.extend({
init: function (e) {
var t = this;
Jt.fn.init.call(t, e)
},
options: {
vertical: !1,
gap: 0,
spacing: 0
},
reflow: function (e) {
var t, n, i = this,
r = i.options,
o = r.vertical,
a = o ? gr : hr,
s = i.children,
l = r.gap,
d = r.spacing,
c = s.length,
u = c + l + d * (c - 1),
p = (o ? e.height() : e.width()) / u,
f = e[a + 1] + p * (l / 2);
for (n = 0; c > n; n++) t = (s[n].box || e).clone(), t[a + 1] = f, t[a + 2] = f + p, s[n].reflow(t), c - 1 > n && (f += p * d), f += p
}
}),
Rr = Jt.extend({
init: function (e) {
var t = this;
Jt.fn.init.call(t, e)
},
options: {
vertical: !0,
isReversed: !1
},
reflow: function (e) {
var t, n, i, r, o = this,
a = o.options,
s = a.vertical,
l = s ? hr : gr,
d = s ? gr : hr,
c = e[d + 2],
u = o.children,
p = o.box = new Kt,
f = u.length;
for (t = a.isReversed ? s ? Pn : pi : s ? er : Oi, n = 0; f > n; n++) i = u[n], r = i.box.clone(), r.snapTo(e, l), i.options && (i.options.stackBase = c), 0 === n ? p = o.box = r.clone() : r.alignTo(u[n - 1].box, t), i.reflow(r), p.wrap(r)
}
}),
Or = {
click: function (t, n) {
var i = this;
t.trigger(ji, {
value: i.value,
category: i.category,
series: i.series,
dataItem: i.dataItem,
element: e(n.target)
})
},
hover: function (t, n) {
var i = this;
t.trigger(qi, {
value: i.value,
category: i.category,
series: i.series,
dataItem: i.dataItem,
element: e(n.target)
})
}
}, Mr = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.value = e, 0 > e && t.negativeColor && (n.options.color = t.negativeColor), n.options.id = yn(), n.enableDiscovery()
},
options: {
color: fr,
border: {
width: 1
},
vertical: !0,
overlay: {
gradient: ai
},
aboveAxis: !0,
labels: {
visible: !1
},
animation: {
type: An
},
opacity: 1
},
render: function () {
var e, t = this,
n = t.value,
i = t.options,
r = i.labels,
o = n;
t._rendered || (t._rendered = !0, r.visible && n && (r.template ? (e = Wt(r.template), o = e({
dataItem: t.dataItem,
category: t.category,
value: t.value,
series: t.series
})) : r.format && (o = un(r.format, o)), t.append(new Ar(o, jt({
vertical: i.vertical,
id: yn()
}, i.labels)))))
},
reflow: function (e) {
this.render();
var t = this,
n = t.options,
i = t.children,
r = i[0];
t.box = e, r && (r.options.aboveAxis = n.aboveAxis, r.reflow(e))
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = n.vertical,
r = n.border.width > 0 ? {
stroke: t.getBorderColor(),
strokeWidth: n.border.width,
strokeOpacity: n.border.opacity,
dashType: n.border.dashType
} : {}, o = t.box,
a = jt({
id: n.id,
fill: n.color,
fillOpacity: n.opacity,
strokeOpacity: n.opacity,
vertical: n.vertical,
aboveAxis: n.aboveAxis,
stackBase: n.stackBase,
animation: n.animation,
data: {
modelId: n.modelId
}
}, r),
s = [];
return o.width() > 0 && o.height() > 0 && (n.overlay && (a.overlay = jt({
rotation: i ? 0 : 90
}, n.overlay)), s.push(e.createRect(o, a))), cn(s, Jt.fn.getViewElements.call(t, e)), s
},
highlightOverlay: function (e, t) {
var n = this,
i = n.box;
return t = jt({
data: {
modelId: n.options.modelId
}
}, t), t.id = null, e.createRect(i, t)
},
getBorderColor: function () {
var e = this,
t = e.options,
n = t.color,
i = t.border,
r = i.color,
o = i._brightness || Fn;
return pn(r) || (r = new Zt(n).brightness(o).toHex()), r
},
tooltipAnchor: function (e, t) {
var n, i, r = this,
o = r.options,
a = r.box,
s = o.vertical,
l = o.aboveAxis;
return s ? (n = a.x2 + nr, i = l ? a.y1 : a.y2 - t) : o.isStacked ? (n = l ? a.x2 - e : a.x1, i = a.y1 - t - nr) : (n = l ? a.x2 + nr : a.x1 - e - nr, i = a.y1), new nn(n, i)
},
formatValue: function (e) {
var t = this;
return t.owner.formatPointValue(t, e)
}
});
jt(Mr.fn, Or), U = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.plotArea = e, n.categoryAxis = e.seriesCategoryAxis(t.series[0]), n.valueAxisRanges = {}, n.points = [], n.categoryPoints = [], n.seriesPoints = [], n.render()
},
options: {
series: [],
invertAxes: !1,
isStacked: !1
},
render: function () {
var e = this;
e.traverseDataPoints(Mt(e.addValue, e))
},
addValue: function (e, t, n, i, r) {
var o, a = this,
s = e.value,
l = a.categoryPoints[n],
d = a.seriesPoints[r];
l || (a.categoryPoints[n] = l = []), d || (a.seriesPoints[r] = d = []), a.updateRange(s, n, i), o = a.createPoint(e, t, n, i, r), o && (o.category = t, o.series = i, o.seriesIx = r, o.owner = a, o.dataItem = i.data[n]), a.points.push(o), d.push(o), l.push(o)
},
updateRange: function (e, t, n) {
var i = this,
r = n.axis,
o = i.valueAxisRanges[r];
pn(e) && !isNaN(e) && (o = i.valueAxisRanges[r] = o || {
min: vi,
max: _i
}, o.min = Rt.min(o.min, e), o.max = Rt.max(o.max, e))
},
seriesValueAxis: function (e) {
var t = this.plotArea,
n = e.axis,
i = n ? t.namedValueAxes[n] : t.valueAxis;
if (!i) throw Error("Unable to locate value axis with name " + n);
return i
},
reflow: function (e) {
var t, n, i, r, o = this,
a = o.options,
s = a.invertAxes,
l = 0,
d = o.categorySlots = [],
c = o.points,
u = o.categoryAxis;
o.traverseDataPoints(function (e, a, p, f) {
if (f.visible !== !1) {
t = o.pointValue(e), n = o.seriesValueAxis(f), i = o.categoryAxisCrossingValue(n), r = c[l++], r && r.plotValue && (t = r.plotValue);
var h = o.categorySlot(u, p, n),
g = o.valueSlot(n, t, i),
m = s ? g : h,
v = s ? h : g,
_ = new Kt(m.x1, v.y1, m.x2, v.y2),
b = n.options.reverse ? i > t : t >= i;
r && (r.options.aboveAxis = b, r.reflow(_)), d[p] || (d[p] = h)
}
}), o.reflowCategories(d), o.box = e
},
categoryAxisCrossingValue: function (e) {
var t = this.categoryAxis,
n = e.options,
i = [].concat(n.axisCrossingValues || n.axisCrossingValue);
return i[t.axisIndex || 0] || 0
},
reflowCategories: function () {},
valueSlot: function (e, t, n) {
return e.getSlot(t, n)
},
categorySlot: function (e, t) {
return e.getSlot(t)
},
traverseDataPoints: function (e) {
var t, n, i, r, o, a = this,
s = a.options,
l = s.series,
d = a.categoryAxis.options.categories || [],
c = f(l),
u = a.bindableFields(),
p = l.length;
for (t = 0; c > t; t++)
for (n = 0; p > n; n++) o = l[n], r = d[t], i = S(o, t, u), e(i, r, t, o, n)
},
bindableFields: function () {
return []
},
formatPointValue: function (e, t) {
return un(t, e.value)
},
pointValue: function (e) {
return e.value
}
}), W = U.extend({
init: function (e, t) {
var n = this;
n._groupTotals = {}, n._groups = [], U.fn.init.call(n, e, t)
},
render: function () {
var e = this;
U.fn.render.apply(e), e.computeAxisRanges()
},
createPoint: function (e, n, i, r) {
var o, a, s, l, d, c = this,
u = e.value,
p = c.options,
f = c.children,
h = c.options.isStacked,
g = jt({}, r.labels);
return h && g.position == Ii && (g.position = ci), o = new Mr(u, jt({}, {
vertical: !p.invertAxes,
overlay: r.overlay,
labels: g,
isStacked: h
}, r, {
color: e.fields.color || t
})), a = f[i], a || (a = new Hr({
vertical: p.invertAxes,
gap: p.gap,
spacing: p.spacing
}), c.append(a)), h ? (d = c.getStackWrap(r, a), 0 === d.children.length ? (s = new Rr({
vertical: !p.invertAxes
}), l = new Rr({
vertical: !p.invertAxes,
isReversed: !0
}), d.append(s, l)) : (s = d.children[0], l = d.children[1]), u > 0 ? s.append(o) : l.append(o)) : a.append(o), o
},
getStackWrap: function (e, t) {
var n, i, r = t.children,
o = e.stack,
a = r.length;
if (typeof o === Gi) {
for (i = 0; a > i; i++)
if (r[i]._stackGroup === o) {
n = r[i];
break
}
} else n = r[0];
return n || (n = new Jt, n._stackGroup = o, t.append(n)), n
},
updateRange: function (e, t, n) {
var i, r = this,
o = r.options.isStacked;
pn(e) && (o ? (i = r.groupTotals(n.stack), p(e > 0 ? i.positive : i.negative, t, e)) : U.fn.updateRange.apply(r, arguments))
},
computeAxisRanges: function () {
var e, t, n = this,
o = n.options.isStacked;
o && (e = n.options.series[0].axis, t = n.categoryTotals(), n.valueAxisRanges[e] = {
min: i(t.negative.concat(0)),
max: r(t.positive.concat(0))
})
},
seriesValueAxis: function (e) {
var t = this,
n = t.options;
return U.fn.seriesValueAxis.call(t, n.isStacked ? t.options.series[0] : e)
},
valueSlot: function (e, t, n) {
return e.getSlot(t, this.options.isStacked ? 0 : n)
},
categorySlot: function (e, t, n) {
var i, r, o = this,
a = o.options,
s = e.getSlot(t);
return a.isStacked && (r = n.getSlot(0, 0), i = a.invertAxes ? hr : gr, s[i + 1] = s[i + 2] = r[i + 1]), s
},
reflow: function (e) {
var t = this;
t.setStacksDirection(), U.fn.reflow.call(t, e)
},
setStacksDirection: function () {
var e, t, n, i, r, o, a, s, l, d = this,
c = d.options,
u = c.series,
p = f(u),
h = d.children,
g = u.length;
for (t = 0; g > t; t++)
for (n = u[t], i = d.seriesValueAxis(n), e = 0; p > e; e++) r = h[e], o = d.getStackWrap(n, r), a = o.children, s = a[0], l = a[1], s && l && (s.options.isReversed = i.options.reverse, l.options.isReversed = !i.options.reverse)
},
reflowCategories: function (e) {
var t, n = this,
i = n.children,
r = i.length;
for (t = 0; r > t; t++) i[t].reflow(e[t])
},
groupTotals: function (e) {
var t, n, i = this;
return t = typeof e === Gi ? e : i._groups[0] || "default", n = i._groupTotals[t], n || (n = i._groupTotals[t] = {
positive: [],
negative: []
}, i._groups.push(t)), n
},
categoryTotals: function () {
var e, t, n, i = this,
r = i._groups,
o = i._groupTotals,
a = {
positive: [],
negative: []
}, s = r.length;
for (n = 0; s > n; n++) e = r[n], t = o[e], cn(a.positive, t.positive), cn(a.negative, t.negative);
return a
},
bindableFields: function () {
return ["color"]
}
}), j = U.extend({
init: function (e, t) {
var n = this;
n.wrapData(t), U.fn.init.call(n, e, t)
},
wrapData: function (e) {
var t, n, i, r = e.series;
for (t = 0; r.length > t; t++) i = r[t], n = i.data, n && !zt(n[0]) && "object" != typeof n[0] && (i.data = [n])
},
addValue: function (e, t, n, i, r) {
var o, a = this,
s = a.categoryPoints[n],
l = a.seriesPoints[r];
s || (a.categoryPoints[n] = s = []), l || (a.seriesPoints[r] = l = []), a.updateRange(e.value, n, i), o = a.createPoint(e.value, n, i), o && (o.category = t, o.series = i, o.seriesIx = r, o.owner = a, o.dataItem = i.data[n]), a.points.push(o), l.push(o), s.push(o)
},
reflowCategories: function (e) {
var t, n = this,
i = n.children,
r = i.length;
for (t = 0; r > t; t++) i[t].reflow(e[t])
},
createPoint: function (e, t, n) {
var i, r, o = this,
a = o.options,
s = o.children;
return i = new q(e, jt({}, {
vertical: !a.invertAxes,
overlay: n.overlay,
categoryIx: t,
invertAxes: a.invertAxes
}, n)), r = s[t], r || (r = new Hr({
vertical: a.invertAxes,
gap: a.gap,
spacing: a.spacing
}), o.append(r)), r.append(i), i
},
updateRange: function (e, t, n) {
var i = this,
r = n.axis,
o = e.current,
a = e.target,
s = i.valueAxisRanges[r];
pn(o) && !isNaN(o) && pn(a && !isNaN(a)) && (s = i.valueAxisRanges[r] = s || {
min: vi,
max: _i
}, s.min = Rt.min.apply(Rt, [s.min, o, a]), s.max = Rt.max.apply(Rt, [s.max, o, a]))
},
formatPointValue: function (e, t) {
return un(t, e.value.current, e.value.target)
},
pointValue: function (e) {
return e.value.current
}
}), q = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.value = e, n.options.id = yn(), n.enableDiscovery(), n.render()
},
options: {
color: fr,
border: {
width: 1
},
vertical: !1,
animation: {
type: An
},
opacity: 1,
target: {
shape: "",
border: {
width: 0,
color: "green"
},
line: {
width: 2
}
},
tooltip: {
format: "Current: {0}Target: {1}"
}
},
render: function () {
var e = this,
t = e.options;
e.target = new $({
id: e.options.id,
type: t.target.shape,
background: t.target.color || t.color,
opacity: t.opacity,
zIndex: t.zIndex,
border: t.target.border,
vAlign: er,
align: Oi
}), e.append(e.target)
},
reflow: function (e) {
var t = this,
n = t.options,
i = t.owner,
r = t.target,
o = n.invertAxes,
a = i.seriesValueAxis(t.options),
s = i.categorySlot(i.categoryAxis, n.categoryIx, a),
l = i.valueSlot(a, t.value.target, t.value.target),
d = o ? l : s,
c = o ? s : l,
u = new Kt(d.x1, c.y1, d.x2, c.y2);
r.options.height = o ? u.height() : n.target.line.width, r.options.width = o ? n.target.line.width : u.width(), r.reflow(u), t.box = e
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = n.vertical,
r = n.border.width > 0 ? {
stroke: n.border.color || n.color,
strokeWidth: n.border.width,
dashType: n.border.dashType
} : {}, o = t.box,
a = jt({
id: n.id,
fill: n.color,
fillOpacity: n.opacity,
strokeOpacity: n.opacity,
vertical: n.vertical,
aboveAxis: n.aboveAxis,
animation: n.animation,
data: {
modelId: n.modelId
}
}, r),
s = [];
return o.width() > 0 && o.height() > 0 && (n.overlay && (a.overlay = jt({
rotation: i ? 0 : 90
}, n.overlay)), s.push(e.createRect(o, a))), cn(s, Jt.fn.getViewElements.call(t, e)), s
},
tooltipAnchor: function (e, t) {
var n, i, r = this,
o = r.options,
a = r.box,
s = o.vertical,
l = o.aboveAxis;
return s ? (n = a.x2 + nr, i = l ? a.y1 : a.y2 - t) : o.isStacked ? (n = l ? a.x2 - e : a.x1, i = a.y1 - t - nr) : (n = l ? a.x2 + nr : a.x1 - e - nr, i = a.y1), new nn(n, i)
},
highlightOverlay: function (e, t) {
var n = this,
i = n.box;
return t = jt({
data: {
modelId: n.options.modelId
}
}, t), t.id = null, e.createRect(i, t)
},
formatValue: function (e) {
var t = this;
return t.owner.formatPointValue(t, e)
}
}), jt(q.fn, Or), G = Xt.extend({
options: {
type: Bn,
align: Mn,
vAlign: Mn
},
getViewElements: function (e, t) {
var n, i, r = this,
o = r.options,
a = o.type,
s = r.paddingBox,
l = s.width() / 2;
return o.visible && r.hasBox() ? (i = jt(r.elementStyle(), t), n = a === sr ? e.createPolyline([new nn(s.x1 + l, s.y1), new nn(s.x1, s.y2), new nn(s.x2, s.y2)], !0, i) : a === Bn ? e.createCircle(new nn(_n(s.x1 + l, Wn), _n(s.y1 + s.height() / 2, Wn)), l, i) : e.createRect(s, i), [n]) : []
}
}), $ = G.extend(), jt($.fn, Or), Y = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.value = e, n.options.id = yn(), n.enableDiscovery()
},
options: {
aboveAxis: !0,
vertical: !0,
markers: {
visible: !0,
background: fr,
size: mi,
type: Bn,
border: {
width: 2
},
opacity: 1
},
labels: {
visible: !1,
position: xn,
margin: hn(3),
padding: hn(4),
animation: {
type: oi,
delay: li
}
}
},
render: function () {
var e, t = this,
n = t.options,
i = n.markers,
r = n.labels,
o = i.background,
a = jt({}, i.border),
s = t.value;
t._rendered || (t._rendered = !0, pn(a.color) || (a.color = new Zt(o).brightness(Fn).toHex()), t.marker = new G({
id: t.options.id,
visible: i.visible && i.size,
type: i.type,
width: i.size,
height: i.size,
background: o,
border: a,
opacity: i.opacity,
zIndex: i.zIndex,
animation: i.animation
}), t.append(t.marker), r.visible && (r.template ? (e = Wt(r.template), s = e({
dataItem: t.dataItem,
category: t.category,
value: t.value,
series: t.series
})) : r.format && (s = t.formatValue(r.format)), t.label = new sn(s, jt({
id: yn(),
align: Mn,
vAlign: Mn,
margin: {
left: 5,
right: 5
}
}, r)), t.append(t.label)))
},
markerBox: function () {
return this.marker.box
},
reflow: function (e) {
var t, n = this,
i = n.options,
r = i.vertical,
o = i.aboveAxis;
n.render(), n.box = e, t = e.clone(), r ? o ? t.y1 -= t.height() : t.y2 += t.height() : o ? t.x1 += t.width() : t.x2 -= t.width(), n.marker.reflow(t), n.reflowLabel(t)
},
reflowLabel: function (e) {
var t = this,
n = t.options,
i = t.marker,
r = t.label,
o = n.labels.position;
r && (o = o === xn ? er : o, o = o === Dn ? Pn : o, r.reflow(e), r.box.alignTo(i.box, o), r.reflow(r.box))
},
highlightOverlay: function (e, t) {
var n = this,
i = n.marker;
return t = jt({
data: {
modelId: n.options.modelId
}
}, t), i.getViewElements(e, jt(t, {
id: null,
fill: i.options.border.color,
fillOpacity: 1,
strokeOpacity: 0
}))[0]
},
tooltipAnchor: function (e, t) {
var n = this,
i = n.marker.box,
r = n.options.aboveAxis;
return new nn(i.x2 + nr, r ? i.y1 - t : i.y2)
},
formatValue: function (e) {
var t = this;
return t.owner.formatPointValue(t, e)
}
}), jt(Y.fn, Or), Q = Y.extend({
init: function (e, t) {
var n = this;
Y.fn.init.call(n, e, t), n.category = e.category
},
options: {
labels: {
position: Mn
},
highlight: {
opacity: 1,
border: {
width: 1,
opacity: 1
}
}
},
highlightOverlay: function (e) {
var t = this,
n = t.options,
i = n.highlight,
r = i.border.width,
o = n.markers,
a = t.box.center(),
s = o.size / 2 - r / 2,
l = i.border.color || new Zt(o.background).brightness(Fn).toHex();
return e.createCircle(a, s, {
id: null,
data: {
modelId: t.options.modelId
},
stroke: l,
strokeWidth: r,
strokeOpacity: i.border.opacity
})
},
toggleHighlight: function (e) {
var n, i = this,
r = i.options.highlight.opacity;
i.highlighted = !i.highlighted, n = i.marker.getViewElements(e, {
fillOpacity: i.highlighted ? r : t
})[0], n.refresh(fn(this.options.id))
}
}), K = Jt.extend({
init: function (e, t, n) {
var i = this;
Jt.fn.init.call(i), i.linePoints = e, i.series = t, i.seriesIx = n, i.options.id = yn(), i.enableDiscovery()
},
options: {},
points: function (e) {
var t, n, i = this,
r = i.linePoints.concat(e || []),
o = [],
a = r.length;
for (t = 0; a > t; t++) n = r[t].markerBox().center(), o.push(new nn(n.x, n.y));
return o
},
getViewElements: function (e) {
var t = this,
n = t.series;
return Jt.fn.getViewElements.call(t, e), [e.createPolyline(t.points(), !1, {
id: t.options.id,
stroke: n.color,
strokeWidth: n.width,
strokeOpacity: n.opacity,
fill: "",
dashType: n.dashType,
data: {
modelId: t.options.modelId
},
zIndex: -1
})]
},
aliasFor: function (e, t) {
var n = this,
i = n.seriesIx;
return n.parent.getNearestPoint(t.x, t.y, i)
}
}), X = {
renderSegments: function () {
var e, t, n, i, r, o, a, s = this,
l = s.options,
d = l.series,
c = s.seriesPoints,
u = c.length,
p = [];
for (t = 0; u > t; t++) {
for (e = d[t], n = c[t], a = n.length, i = [], o = 0; a > o; o++) r = n[o], r ? i.push(r) : s.seriesMissingValues(e) !== ui && (i.length > 1 && p.push(s.createSegment(i, e, t, vn(p))), i = []);
i.length > 1 && p.push(s.createSegment(i, e, t, vn(p)))
}
s._segments = p, s.append.apply(s, p)
},
seriesMissingValues: function (e) {
var t = e.missingValues,
n = !t && this.options.isStacked;
return n ? vr : t
},
createSegment: function (e, t, n) {
return new K(e, t, n)
},
getNearestPoint: function (e, t, n) {
var i, r, o, a, s, l = this,
d = l.options.invertAxes,
c = d ? gr : hr,
u = d ? t : e,
p = l.seriesPoints[n],
f = vi,
h = p.length;
for (s = 0; h > s; s++) i = p[s], i && pn(i.value) && null !== i.value && (r = i.box, o = Rt.abs(r.center()[c] - u), f > o && (a = i, f = o));
return a
}
}, J = U.extend({
init: function (e, t) {
var n = this;
n._stackAxisRange = {
min: vi,
max: _i
}, n._categoryTotals = [], n.enableDiscovery(), U.fn.init.call(n, e, t)
},
render: function () {
var e = this;
U.fn.render.apply(e), e.computeAxisRanges(), e.renderSegments()
},
createPoint: function (e, t, n, i) {
var r, o, a = this,
s = e.value,
l = a.options,
d = l.isStacked,
c = a.categoryPoints[n],
u = a.seriesMissingValues(i),
p = 0,
f = e.fields;
if (!pn(s) || null === s) {
if (u !== vr) return null;
s = 0
}
return o = new Y(s, jt({
vertical: !l.invertAxes,
markers: {
border: {
color: i.color
}
}
}, i, {
color: f.color,
markers: {
border: {
color: f.color
}
}
})), d && (r = R(c), r && (p = r.plotValue), o.plotValue = s + p), a.append(o), o
},
updateRange: function (e, t) {
var n, i = this,
r = i.options.isStacked,
a = i._stackAxisRange,
s = i._categoryTotals;
pn(e) && (r ? (p(s, t, e), n = o(s), a.min = Rt.min(a.min, n.min), a.max = Rt.max(a.max, n.max)) : U.fn.updateRange.apply(i, arguments))
},
computeAxisRanges: function () {
var e, t = this,
n = t.options.isStacked;
n && (e = t.options.series[0].axis, t.valueAxisRanges[e] = t._stackAxisRange)
},
getViewElements: function (e) {
var t = this,
n = U.fn.getViewElements.call(t, e),
i = e.createGroup({
animation: {
type: Vn
}
});
return i.children = n, [i]
},
bindableFields: function () {
return ["color"]
}
}), jt(J.fn, X), Z = K.extend({
init: function (e, t, n, i) {
var r = this;
r.stackPoints = t, K.fn.init.call(r, e, n, i)
},
points: function () {
var e, t, n = this,
i = n.parent,
r = i.plotArea,
o = i.options.invertAxes,
a = i.seriesValueAxis(n.series),
s = a.lineBox(),
l = r.seriesCategoryAxis(n.series),
d = l.lineBox(),
c = o ? d.x1 : d.y1,
u = n.stackPoints,
p = K.fn.points.call(n, u),
f = o ? hr : gr;
return c = E(c, s[f + 1], s[f + 2]), !n.stackPoints && p.length > 1 && (e = p[0], t = vn(p), o ? (p.unshift(nn(c, e.y)), p.push(nn(c, t.y))) : (p.unshift(nn(e.x, c)), p.push(nn(t.x, c)))), p
},
getViewElements: function (e) {
var t = this,
n = t.series,
i = jt({
color: n.color,
opacity: n.opacity
}, n.line),
r = K.fn.points.call(t),
o = t.points();
return Jt.fn.getViewElements.call(t, e), [e.createPolyline(o, !1, {
id: t.options.id,
fillOpacity: n.opacity,
fill: n.color,
stack: n.stack,
data: {
modelId: t.options.modelId
},
zIndex: -1
}), e.createPolyline(r, !1, {
stroke: i.color,
strokeWidth: i.width,
strokeOpacity: i.opacity,
dashType: i.dashType,
data: {
modelId: t.options.modelId
},
strokeLineCap: "butt",
zIndex: -1
})]
}
}), et = J.extend({
createSegment: function (e, t, n, i) {
var r, o = this,
a = o.options;
return a.isStacked && n > 0 && i && (r = i.linePoints.slice(0).reverse()), new Z(e, r, t, n)
},
seriesMissingValues: function (e) {
return e.missingValues || vr
}
}), tt = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.plotArea = e, n.xAxisRanges = {}, n.yAxisRanges = {}, n.points = [], n.seriesPoints = [], n.render()
},
options: {
series: [],
tooltip: {
format: "{0}, {1}"
},
labels: {
format: "{0}, {1}"
}
},
render: function () {
var e = this;
e.traverseDataPoints(Mt(e.addValue, e))
},
addValue: function (e, t) {
var n, i = this,
r = e.x,
o = e.y,
a = t.seriesIx,
s = i.seriesPoints[a];
i.updateRange(e, t.series), pn(r) && null !== r && pn(o) && null !== o && (n = i.createPoint(e, t.series, a, t), n && Ot(n, t)), i.points.push(n), s.push(n)
},
updateRange: function (e, t) {
var n = this,
i = e.x,
r = e.y,
o = t.xAxis,
a = t.yAxis,
s = n.xAxisRanges[o],
l = n.yAxisRanges[a];
pn(i) && null !== i && (s = n.xAxisRanges[o] = s || {
min: vi,
max: _i
}, typeof i === Gi && (i = m(i)), s.min = Rt.min(s.min, i), s.max = Rt.max(s.max, i)), pn(r) && null !== r && (l = n.yAxisRanges[a] = l || {
min: vi,
max: _i
}, typeof r === Gi && (r = m(r)), l.min = Rt.min(l.min, r), l.max = Rt.max(l.max, r))
},
createPoint: function (e, t, n, i) {
var r, o = this;
return r = new Y(e, jt({
markers: {
border: {
color: t.color
},
opacity: t.opacity
},
tooltip: {
format: o.options.tooltip.format
},
labels: {
format: o.options.labels.format
}
}, t, {
color: i.color,
markers: {
border: {
color: i.color
}
}
})), o.append(r), r
},
seriesAxes: function (e) {
var t = this.plotArea,
n = e.xAxis,
i = n ? t.namedXAxes[n] : t.axisX,
r = e.yAxis,
o = r ? t.namedYAxes[r] : t.axisY;
if (!i) throw Error("Unable to locate X axis with name " + n);
if (!o) throw Error("Unable to locate Y axis with name " + r);
return {
x: i,
y: o
}
},
reflow: function (e) {
var t, n, i = this,
r = i.points,
o = 0;
i.traverseDataPoints(function (e, a) {
t = r[o++], n = i.seriesAxes(a.series);
var s = n.x.getSlot(e.x, e.x),
l = n.y.getSlot(e.y, e.y),
d = new Kt(s.x1, l.y1, s.x2, l.y2);
t && t.reflow(d)
}), i.box = e
},
getViewElements: function (e) {
var t = this,
n = Jt.fn.getViewElements.call(t, e),
i = e.createGroup({
animation: {
type: Vn
}
});
return i.children = n, [i]
},
traverseDataPoints: function (e) {
var t, n, i, r, o, a, s, l = this,
d = l.options,
c = d.series,
u = l.seriesPoints,
p = l.bindableFields();
for (n = 0; c.length > n; n++)
for (i = c[n], r = u[n], r || (u[n] = []), t = 0; i.data.length > t; t++) o = S(i, t, p), a = o.value, s = o.fields, e(a, jt({
pointIx: t,
series: i,
seriesIx: n,
dataItem: i.data[t],
owner: l
}, s))
},
bindableFields: function () {
return ["color"]
},
formatPointValue: function (e, t) {
var n = e.value;
return un(t, n.x, n.y)
}
}), nt = tt.extend({
render: function () {
var e = this;
tt.fn.render.call(e), e.renderSegments()
}
}), jt(nt.fn, X), it = tt.extend({
options: {
tooltip: {
format: "{3}"
},
labels: {
format: "{3}"
}
},
addValue: function (e, t) {
var n, i = this,
r = t.series,
o = r.negativeValues,
a = i.plotArea.options.seriesColors || [],
s = !0;
n = t.color || r.color || a[t.pointIx % a.length], 0 > e.size && (n = o.color || n, s = o.visible), t.color = n, s && tt.fn.addValue.call(this, e, t)
},
reflow: function (e) {
var t = this;
t.updateBubblesSize(e), tt.fn.reflow.call(t, e)
},
createPoint: function (e, t, n, i) {
var r, o = this,
a = t.data.length,
s = i.pointIx * (li / a),
l = {
delay: s,
duration: li - s,
type: zn
};
return r = new Q(e, jt({
tooltip: {
format: o.options.tooltip.format
},
labels: {
format: o.options.labels.format,
animation: l
}
}, t, {
color: i.color,
markers: {
type: Bn,
background: i.color,
border: t.border,
opacity: t.opacity,
animation: l
}
})), o.append(r), r
},
updateBubblesSize: function (e) {
var t, n, i, r, o, a, s, l, d, c, u, p, f, h, g, m, v = this,
_ = v.options,
b = _.series,
y = Rt.min(e.width(), e.height());
for (t = 0; b.length > t; t++)
for (i = b[t], r = v.seriesPoints[t], o = v.maxSize(r), a = i.minSize || Rt.max(.02 * y, 10), s = i.maxSize || .2 * y, l = a / 2, d = s / 2, c = Rt.PI * l * l, u = Rt.PI * d * d, p = u - c, f = p / o, n = 0; r.length > n; n++) h = r[n], g = Rt.abs(h.value.size) * f, m = Rt.sqrt((c + g) / Rt.PI), jt(h.options, {
markers: {
size: 2 * m,
zIndex: d - m
},
labels: {
zIndex: d - m + 1
}
})
},
maxSize: function (e) {
var t, n, i = e.length,
r = 0;
for (t = 0; i > t; t++) n = e[t].value.size, r = Rt.max(r, Rt.abs(n));
return r
},
bindableFields: function () {
return ["color", "category", "visibleInLegend"]
},
getViewElements: function (e) {
var t = this,
n = Jt.fn.getViewElements.call(t, e),
i = e.createGroup();
return i.children = n, [i]
},
formatPointValue: function (e, t) {
var n = e.value;
return un(t, n.x, n.y, n.size, e.category)
}
}), rt = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.value = e, n.options.id = yn(), n.enableDiscovery()
},
options: {
border: {
_brightness: .8
},
line: {
width: 2
},
overlay: {
gradient: ai
},
tooltip: {
format: "
{4:d}
Open:
{0:C}
High:
{1:C}
Low:
{2:C}
Close:
{3:C}
"
},
highlight: {
opacity: 1,
border: {
width: 1,
opacity: 1
},
line: {
width: 1,
opacity: 1
}
}
},
reflow: function (e) {
var t, n, i, r = this,
o = r.options,
a = r.owner,
s = r.value,
l = a.seriesValueAxis(o),
d = [];
n = l.getSlot(s.open, s.close), i = l.getSlot(s.low, s.high), n.x1 = i.x1 = e.x1, n.x2 = i.x2 = e.x2, r.realBody = n, t = i.center().x, d.push([new nn(t, i.y1), new nn(t, n.y1)]), d.push([new nn(t, n.y2), new nn(t, i.y2)]), r.lowHighLinePoints = d, r.box = i.clone().wrap(n)
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = [],
r = n.border.width > 0 ? {
stroke: t.getBorderColor(),
strokeWidth: n.border.width,
dashType: n.border.dashType,
strokeOpacity: pn(n.border.opacity) ? n.border.opacity : n.opacity
} : {}, o = jt({
fill: n.color,
fillOpacity: n.opacity
}, r),
a = {
strokeOpacity: pn(n.line.opacity) ? n.line.opacity : n.opacity,
strokeWidth: n.line.width,
stroke: n.line.color || n.color,
dashType: n.line.dashType,
strokeLineCap: "butt"
}, s = e.createGroup({
animation: {
type: Vn
}
});
return n.overlay && (o.overlay = jt({
rotation: 0
}, n.overlay)), i.push(e.createRect(t.realBody, o)), i.push(e.createPolyline(t.lowHighLinePoints[0], !1, a)), i.push(e.createPolyline(t.lowHighLinePoints[1], !1, a)), i.push(t.createOverlayRect(e, n)), cn(i, Jt.fn.getViewElements.call(t, e)), s.children = i, [s]
},
getBorderColor: function () {
var e = this,
t = e.options,
n = t.border,
i = n.color;
return pn(i) || (i = new Zt(t.color).brightness(n._brightness).toHex()), i
},
createOverlayRect: function (e, t) {
return e.createRect(this.box, {
data: {
modelId: t.modelId
},
fill: "#fff",
fillOpacity: 0
})
},
highlightOverlay: function (e, t) {
var n = this,
i = n.options,
r = i.highlight,
o = r.border,
a = n.getBorderColor(),
s = r.line,
l = {
data: {
modelId: i.modelId
}
}, d = jt({}, l, t, {
stroke: a,
strokeOpacity: o.opacity,
strokeWidth: o.width
}),
c = jt({}, l, {
stroke: s.color || a,
strokeWidth: s.width,
strokeOpacity: s.opacity,
strokeLineCap: "butt"
}),
u = e.createGroup();
return u.children.push(e.createRect(n.realBody, d)), u.children.push(e.createPolyline(n.lowHighLinePoints[0], !1, c)), u.children.push(e.createPolyline(n.lowHighLinePoints[1], !1, c)), u
},
tooltipAnchor: function () {
var e = this,
t = e.box;
return new nn(t.x2 + nr, t.y1 + nr)
},
formatValue: function (e) {
var t = this;
return t.owner.formatPointValue(t, e)
}
}), jt(rt.fn, Or), ot = U.extend({
options: {},
bindableFields: function () {
return ["color", "downColor"]
},
reflowCategories: function (e) {
var t, n = this,
i = n.children,
r = i.length;
for (t = 0; r > t; t++) i[t].reflow(e[t])
},
addValue: function (e, t, n, i, r) {
var o, a, s = this,
l = s.options,
d = e.value,
c = s.children,
u = e.fields.color || i.color,
p = this.splitValue(d),
f = N(p),
h = s.categoryPoints[n];
h || (s.categoryPoints[n] = h = []), f && (i.type == Rn && d.open > d.close && (u = e.fields.downColor || i.downColor), o = s.createPoint(d, jt({}, i, {
color: u
}))), a = c[n], a || (a = new Hr({
vertical: l.invertAxes,
gap: l.gap,
spacing: l.spacing
}), s.append(a)), o && (s.updateRange(d, n, i), a.append(o), o.categoryIx = n, o.category = t, o.series = i, o.seriesIx = r, o.owner = s, o.dataItem = i.data[n]), s.points.push(o), h.push(o)
},
createPoint: function (e, t) {
return new rt(e, t)
},
splitValue: function (e) {
return [e.low, e.open, e.close, e.high]
},
updateRange: function (e, t, n) {
var i = this,
r = n.axis,
o = i.valueAxisRanges[r],
a = i.splitValue(e);
o = i.valueAxisRanges[r] = o || {
min: vi,
max: _i
}, o = i.valueAxisRanges[r] = {
min: Rt.min.apply(Rt, a.concat([o.min])),
max: Rt.max.apply(Rt, a.concat([o.max]))
}
},
formatPointValue: function (e, t) {
var n = e.value;
return un(t, n.open, n.high, n.low, n.close, e.category)
}
}), at = rt.extend({
reflow: function (e) {
var t, n, i, r, o = this,
a = o.options,
s = o.owner,
l = o.value,
d = s.seriesValueAxis(a),
c = [],
u = [],
p = [];
r = d.getSlot(l.low, l.high), n = d.getSlot(l.open, l.open), i = d.getSlot(l.close, l.close), n.x1 = i.x1 = r.x1 = e.x1, n.x2 = i.x2 = r.x2 = e.x2, t = r.center().x, c.push(new nn(n.x1, n.y1)), c.push(new nn(t, n.y1)), u.push(new nn(t, i.y1)), u.push(new nn(i.x2, i.y1)), p.push(new nn(t, r.y1)), p.push(new nn(t, r.y2)), o.oPoints = c, o.cPoints = u, o.lhPoints = p, o.box = r.clone().wrap(n.clone().wrap(i))
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = [],
r = {
strokeOpacity: n.opacity,
zIndex: -1,
strokeWidth: n.width,
stroke: n.color,
dashType: n.dashType
}, o = e.createGroup({
animation: {
type: Vn
}
});
return i.push(t.createOverlayRect(e, n)), i.push(e.createPolyline(t.oPoints, !0, r)), i.push(e.createPolyline(t.cPoints, !0, r)), i.push(e.createPolyline(t.lhPoints, !0, r)), cn(i, Jt.fn.getViewElements.call(t, e)), o.children = i, [o]
},
highlightOverlay: function (e) {
var t = this,
n = t.options,
i = n.highlight,
r = {
data: {
modelId: n.modelId
}
}, o = jt(r, {
strokeWidth: i.line.width,
strokeOpacity: i.line.opacity,
stroke: i.line.color || t.color
}),
a = e.createGroup();
return a.children.push(e.createPolyline(t.oPoints, !0, o)), a.children.push(e.createPolyline(t.cPoints, !0, o)), a.children.push(e.createPolyline(t.lhPoints, !0, o)), a
}
}), st = ot.extend({
createPoint: function (e, t) {
return new at(e, t)
},
bindableFields: function () {
return ["color"]
}
}), lt = Jt.extend({
init: function (e, t, n) {
var i = this;
i.value = e, i.sector = t, i.enableDiscovery(), Jt.fn.init.call(i, n)
},
options: {
color: fr,
overlay: {
gradient: Mi
},
border: {
width: .5
},
labels: {
visible: !1,
distance: 35,
font: Qn,
margin: hn(.5),
align: Bn,
zIndex: 1,
position: Ii
},
animation: {
type: Pi
},
highlight: {
visible: !0,
border: {
width: 1
}
},
visible: !0
},
render: function () {
var e, t = this,
n = t.options,
i = n.labels,
r = t.value;
t._rendered || t.visible === !1 || (t._rendered = !0, i.template ? (e = Wt(i.template), r = e({
dataItem: t.dataItem,
category: t.category,
value: t.value,
series: t.series,
percentage: t.percentage
})) : i.format && (r = un(i.format, r)), i.visible && r && (t.label = new sn(r, jt({}, i, {
id: yn(),
align: Mn,
vAlign: "",
animation: {
type: oi,
delay: t.animationDelay
}
})), t.append(t.label)))
},
reflow: function (e) {
var t = this;
t.render(), t.box = e, t.reflowLabel()
},
reflowLabel: function () {
var e, t, n, i, r = this,
o = r.sector.clone(),
a = r.options,
s = r.label,
l = a.labels,
d = l.distance,
c = o.middle();
s && (i = s.box.height(), n = s.box.width(), l.position == Mn ? (o.r = Rt.abs((o.r - i) / 2) + i, e = o.point(c), s.reflow(Kt(e.x, e.y - i / 2, e.x, e.y))) : l.position == ci ? (o.r = o.r - i / 2, e = o.point(c), s.reflow(Kt(e.x, e.y - i / 2, e.x, e.y))) : (e = o.clone().expand(d).point(c), e.x >= o.c.x ? (t = e.x + n, s.orientation = Oi) : (t = e.x - n, s.orientation = pi), s.reflow(Kt(t, e.y - i, e.x, e.y))))
},
getViewElements: function (e) {
var t = this,
n = t.sector,
i = t.options,
r = i.border || {}, o = r.width > 0 ? {
stroke: r.color,
strokeWidth: r.width,
strokeOpacity: r.opacity,
dashType: r.dashType
} : {}, a = [],
s = i.overlay;
return s && (s = jt({}, i.overlay, {
r: n.r,
ir: n.ir,
cx: n.c.x,
cy: n.c.y,
bbox: n.getBBox()
})), t.value && a.push(t.createSegment(e, n, jt({
id: i.id,
fill: i.color,
overlay: s,
fillOpacity: i.opacity,
strokeOpacity: i.opacity,
animation: jt(i.animation, {
delay: t.animationDelay
}),
data: {
modelId: i.modelId
},
zIndex: i.zIndex,
singleSegment: 1 === (t.options.data || []).length
}, o))), cn(a, Jt.fn.getViewElements.call(t, e)), a
},
createSegment: function (e, t, n) {
return n.singleSegment ? e.createCircle(t.c, t.r, n) : e.createSector(t, n)
},
highlightOverlay: function (e, t) {
var n, i = this,
r = i.options.highlight || {}, o = r.border || {}, a = i.options.id + Ei;
return t = jt({}, t, {
id: a
}), 0 !== i.value && (n = i.createSegment(e, i.sector, jt({}, t, {
fill: r.color,
fillOpacity: r.opacity,
strokeOpacity: o.opacity,
strokeWidth: o.width,
stroke: o.color,
id: null,
data: {
modelId: i.options.modelId
}
}))), n
},
tooltipAnchor: function (e, t) {
var n = this,
i = n.sector.clone().expand(nr),
r = e / 2,
o = t / 2,
a = i.middle(),
s = a * Zn,
l = i.point(a),
d = l.x - r,
c = l.y - o,
u = Rt.sin(s),
p = Rt.cos(s);
return .9 > Rt.abs(u) && (d += r * -p / Rt.abs(p)), .9 > Rt.abs(p) && (c += o * -u / Rt.abs(u)), new nn(d, c)
},
formatValue: function (e) {
var t = this;
return t.owner.formatPointValue(t, e)
}
}), jt(lt.fn, Or), dt = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.plotArea = e, n.segments = [], n.legendItems = [], n.render()
},
options: {
startAngle: 90,
connectors: {
width: 1,
color: "#939393",
padding: 4
},
inactiveItems: {
markers: {},
labels: {}
}
},
render: function () {
var e = this;
e.traverseDataPoints(Mt(e.addValue, e))
},
traverseDataPoints: function (e) {
var t, n, i, r, o, a, s, l, d, c, u, p, f = this,
h = f.options,
g = f.plotArea.options.seriesColors || [],
m = g.length,
v = h.series,
_ = v.length,
b = yn(),
y = f.bindableFields(),
w = 0;
for (r = 0; _ > r; r++) {
for (t = v[r], a = t.data, c = f.pointsTotal(t, y), s = 360 / c, u = pn(t.startAngle) ? t.startAngle : h.startAngle, r != _ - 1 && t.labels.position == Ii && (t.labels.position = Mn), p = 0; a.length > p; p++) n = S(t, p, y), l = n.value, i = n.fields, o = _n(l * s, Xn), d = 1 != a.length && !! i.explode, t.color = i.color || g[p % m], e(l, new on(null, 0, 0, u, o), {
owner: f,
category: i.category || "",
index: w,
series: t,
seriesIx: r,
dataItem: a[p],
percentage: l / c,
explode: d,
visibleInLegend: i.visibleInLegend,
visible: i.visible,
overlay: {
id: b + r
},
zIndex: _ - r,
animationDelay: f.animationDelay(p, r, _)
}), n.fields.visible !== !1 && (u += o), w++;
w = 0
}
},
bindableFields: function () {
return ["category", "color", "explode", "visibleInLegend", "visible"]
},
addValue: function (e, t, n) {
var i, r = this;
r.createLegendItem(e, n), n.visible !== !1 && (i = new lt(e, t, n.series), i.options.id = yn(), Ot(i, n), r.append(i), r.segments.push(i))
},
createLegendItem: function (e, t) {
var n, i, r, o, a = this,
s = (a.options.legend || {}).labels || {}, l = (a.options.legend || {}).inactiveItems || {};
t && t.visibleInLegend !== !1 && (n = t.category || "", (s || {}).template && (i = Wt(s.template), n = i({
text: n,
series: t.series,
dataItem: t.dataItem,
percentage: t.percentage,
value: e
})), t.visible === !1 ? (r = (l.markers || {}).color, o = (l.labels || {}).color) : (r = (t.series || {}).color, o = s.color), a.legendItems.push({
pointIndex: t.index,
text: n,
series: t.series,
markerColor: r,
labelColor: o
}))
},
pointsTotal: function (e, t) {
var n, i, r, o = e.data,
a = o.length,
s = 0;
for (i = 0; a > i; i++) r = S(e, i, t), n = r.value, n && r.fields.visible !== !1 && (s += n);
return s
},
reflow: function (e) {
var t, n, i, r, o, a, s, l, d = this,
c = d.options,
u = e.clone(),
p = 5,
f = Rt.min(u.width(), u.height()),
h = f / 2,
g = f - .85 * f,
m = pn(c.padding) ? c.padding : g,
v = Kt(u.x1, u.y1, u.x1 + f, u.y1 + f),
_ = v.center(),
b = d.seriesConfigs || [],
y = u.center(),
w = d.segments,
x = w.length,
k = c.series.length,
C = [],
T = [];
for (m = m > h - p ? h - p : m, v.translate(y.x - _.x, y.y - _.y), a = h - m, l = nn(a + v.x1 + m, a + v.y1 + m), s = 0; x > s; s++) r = w[s], o = r.sector, o.r = a, o.c = l, n = r.seriesIx, b.length && (t = b[n], o.ir = t.ir, o.r = t.r), n == k - 1 && r.explode && (o.c = o.clone().radius(.15 * o.r).point(o.middle())), r.reflow(v), i = r.label, i && i.options.position === Ii && n == k - 1 && (i.orientation === Oi ? T.push(i) : C.push(i));
C.length > 0 && (C.sort(d.labelComparator(!0)), d.leftLabelsReflow(C)), T.length > 0 && (T.sort(d.labelComparator(!1)), d.rightLabelsReflow(T)), d.box = v
},
leftLabelsReflow: function (e) {
var t = this,
n = t.distanceBetweenLabels(e);
t.distributeLabels(n, e)
},
rightLabelsReflow: function (e) {
var t = this,
n = t.distanceBetweenLabels(e);
t.distributeLabels(n, e)
},
distanceBetweenLabels: function (e) {
var t, n, i, r = this,
o = r.segments,
a = o[o.length - 1],
s = a.sector,
l = e[0].box,
d = e.length - 1,
c = s.r + a.options.labels.distance,
u = [];
for (n = _n(l.y1 - (s.c.y - c - l.height() - l.height() / 2)), u.push(n), i = 0; d > i; i++) l = e[i].box, t = e[i + 1].box, n = _n(t.y1 - l.y2), u.push(n);
return n = _n(s.c.y + c - e[d].box.y2 - e[d].box.height() / 2), u.push(n), u
},
distributeLabels: function (e, t) {
var n, i, r, o, a = this,
s = e.length;
for (o = 0; s > o; o++)
for (i = r = o, n = -e[o]; n > 0 && (i >= 0 || s > r);) n = a._takeDistance(e, o, --i, n), n = a._takeDistance(e, o, ++r, n);
a.reflowLabels(e, t)
},
_takeDistance: function (e, t, n, i) {
if (e[n] > 0) {
var r = Rt.min(e[n], i);
i -= r, e[n] -= r, e[t] += r
}
return i
},
reflowLabels: function (e, t) {
var n, i, r, o, a = this,
s = a.segments,
l = s[s.length - 1],
d = l.sector,
c = t.length,
u = l.options.labels,
p = u.distance,
f = d.c.y - (d.r + p) - t[0].box.height();
for (e[0] += 2, o = 0; c > o; o++) n = t[o], f += e[o], r = n.box, i = a.hAlignLabel(r.x2, d.clone().expand(p), f, f + r.height(), n.orientation == Oi), n.orientation == Oi ? (u.align !== Bn && (i = d.r + d.c.x + p), n.reflow(new Kt(i + r.width(), f, i, f))) : (u.align !== Bn && (i = d.c.x - d.r - p), n.reflow(new Kt(i - r.width(), f, i, f))), f += r.height()
},
getViewElements: function (e) {
var t, n, i, r, o, s, l, d, c, u, p, f, h, g, m, v = this,
_ = v.options,
b = _.connectors,
y = v.segments,
w = [],
x = y.length,
k = 4;
for (d = 0; x > d; d++) o = y[d], n = o.sector, i = n.middle(), l = o.label, s = {
seriesId: o.seriesIx
}, l && (r = [], l.options.position === Ii && 0 !== o.value && (f = l.box, h = n.c, g = n.point(i), m = nn(f.x1, f.center().y), g = n.clone().expand(b.padding).point(i), r.push(g), l.orientation == Oi ? (u = nn(f.x1 - b.padding, f.center().y), p = a(h, g, m, u), m = nn(u.x - k, u.y), p = p || m, p.x = Rt.min(p.x, m.x), v.pointInCircle(p, n.c, n.r + k) || p.x < n.c.x ? (c = n.c.x + n.r + k, o.options.labels.align !== Un ? m.x > c ? r.push(nn(c, g.y)) : r.push(nn(g.x + 2 * k, g.y)) : r.push(nn(c, g.y)), r.push(nn(m.x, u.y))) : (p.y = u.y, r.push(p))) : (u = nn(f.x2 + b.padding, f.center().y), p = a(h, g, m, u), m = nn(u.x + k, u.y), p = p || m, p.x = Rt.max(p.x, m.x), v.pointInCircle(p, n.c, n.r + k) || p.x > n.c.x ? (c = n.c.x - n.r - k, o.options.labels.align !== Un ? c > m.x ? r.push(nn(c, g.y)) : r.push(nn(g.x - 2 * k, g.y)) : r.push(nn(c, g.y)), r.push(nn(m.x, u.y))) : (p.y = u.y, r.push(p))), r.push(u), t = e.createPolyline(r, !1, {
id: yn(),
stroke: b.color,
strokeWidth: b.width,
animation: {
type: oi,
delay: o.animationDelay
},
data: {
modelId: o.options.modelId
}
}), w.push(t)));
return cn(w, Jt.fn.getViewElements.call(v, e)), w
},
labelComparator: function (e) {
return e = e ? -1 : 1,
function (t, n) {
return t = (t.parent.sector.middle() + 270) % 360, n = (n.parent.sector.middle() + 270) % 360, (t - n) * e
}
},
hAlignLabel: function (e, t, n, i, r) {
var o = t.c.x,
a = t.c.y,
s = t.r,
l = Rt.min(Rt.abs(a - n), Rt.abs(a - i));
return l > s ? e : o + Rt.sqrt(s * s - l * l) * (r ? 1 : -1)
},
pointInCircle: function (e, t, n) {
return h(t.x - e.x) + h(t.y - e.y) < h(n)
},
formatPointValue: function (e, t) {
return un(t, e.value)
},
animationDelay: function (e) {
return e * zi
}
}), ct = lt.extend({
options: {
overlay: {
gradient: Ni
},
labels: {
position: Mn
},
animation: {
type: Pi
}
},
reflowLabel: function () {
var e, t, n = this,
i = n.sector.clone(),
r = n.options,
o = n.label,
a = r.labels,
s = i.middle();
o && (t = o.box.height(), a.position == Mn ? (i.r -= (i.r - i.ir) / 2, e = i.point(s), o.reflow(new Kt(e.x, e.y - t / 2, e.x, e.y))) : lt.fn.reflowLabel.call(n))
},
createSegment: function (e, t, n) {
return e.createRing(t, n)
}
}), jt(ct.fn, Or), ut = dt.extend({
options: {
startAngle: 90,
connectors: {
width: 1,
color: "#939393",
padding: 4
}
},
addValue: function (e, t, n) {
var i, r = this;
r.createLegendItem(e, n), e && n.visible !== !1 && (i = new ct(e, t, n.series), i.options.id = yn(), Ot(i, n), r.append(i), r.segments.push(i))
},
reflow: function (e) {
var t, n, i, r, o, a, s = this,
l = s.options,
d = e.clone(),
c = 5,
u = Rt.min(d.width(), d.height()),
p = u / 2,
f = u - .85 * u,
h = pn(l.padding) ? l.padding : f,
g = l.series,
m = g.length,
v = 0,
_ = 0,
b = 0,
y = 0;
for (s.seriesConfigs = [], h = h > p - c ? p - c : h, i = p - h, o = 0; m > o; o++) t = g[o], 0 === o && pn(t.holeSize) && (n = t.holeSize, i -= t.holeSize), pn(t.size) ? i -= t.size : v++, pn(t.margin) && o != m - 1 && (i -= t.margin);
for (pn(n) || (y = (p - h) / (m + .75), n = .75 * y, i -= n), b = n, o = 0; m > o; o++) t = g[o], r = pn(t.size) ? t.size : i / v, b += _, a = b + r, s.seriesConfigs.push({
ir: b,
r: a
}), _ = t.margin || 0, b = a;
dt.fn.reflow.call(s, e)
},
animationDelay: function (e, t, n) {
return e * ti + li * (t + 1) / (n + 1)
}
}), pt = Xt.extend({
init: function (e) {
var t = this;
Xt.fn.init.call(t, e), e = t.options, e.id = yn(), t.title = ln.buildTitle(e.title, t, pt.fn.options.title), t.content = new Jt, t.append(t.content), t.axes = [], t.charts = []
},
options: {
zIndex: -1,
shrinkToFit: !0,
title: {
align: pi
},
visible: !0
},
appendAxis: function (e) {
var t = this;
t.content.append(e), t.axes.push(e), e.pane = t
},
appendChart: function (e) {
var t = this;
t.charts.push(e), t.content.append(e), e.pane = t
},
empty: function () {
var e, t = this,
n = t.parent;
if (n) {
for (e = 0; t.axes.length > e; e++) n.removeAxis(t.axes[e]);
for (e = 0; t.charts.length > e; e++) n.removeChart(t.charts[e])
}
t.axes = [], t.charts = [], t.content.destroy(), t.content.children = []
},
reflow: function (e) {
var t = this;
vn(t.children) === t.content && t.children.pop(), Xt.fn.reflow.call(t, e), t.title && (t.contentBox.y1 += t.title.box.height())
},
getViewElements: function (e) {
var t = this,
n = U.fn.getViewElements.call(t, e),
i = e.createGroup({
id: t.options.id
}),
r = [];
return i.children = n.concat(t.renderGridLines(e), t.content.getViewElements(e)), t.view = e, t.options.visible && (r = [i]), r
},
renderGridLines: function (e) {
var t, n, i, r, o, a, s = this,
l = s.axes,
d = l.concat(s.parent.axes),
c = [],
u = [];
for (n = 0; l.length > n; n++)
for (r = l[n], o = r.options.vertical, t = o ? c : u, i = 0; d.length > i; i++) 0 === t.length && (a = d[i], o !== a.options.vertical && cn(t, r.renderGridLines(e, a, r)));
return c.concat(u)
},
refresh: function () {
var e = this,
t = e.view,
n = fn(e.options.id);
t && n && n.parentNode.replaceChild(t.renderElement(e.getViewElements(t)[0]), n)
}
}), ft = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.series = e, n.setSeriesIndexes(), n.charts = [], n.options.legend.items = [], n.axes = [], n.crosshairs = [], n.options.id = yn(), n.enableDiscovery(), n.createPanes(), n.render(), n.createCrosshairs()
},
options: {
series: [],
plotArea: {
margin: {}
},
background: "",
border: {
color: In,
width: 0
},
legend: {}
},
setSeriesIndexes: function () {
var e, t, n = this.series;
for (e = 0; n.length > e; e++) t = n[e], t.index = e
},
createPanes: function () {
var e, t, n = this,
i = [],
r = n.options.panes || [],
o = Rt.max(r.length, 1);
for (e = 0; o > e; e++) t = new pt(r[e]), t.paneIndex = e, i.push(t), n.append(t);
n.panes = i
},
destroy: function () {
var e, t = this,
n = t.charts,
i = t.axes;
for (e = 0; n.length > e; e++) n[e].destroy();
for (e = 0; i.length > e; e++) i[e].destroy();
Jt.fn.destroy.call(t)
},
createCrosshairs: function () {
var e, t, n, i, r, o = this,
a = o.panes;
for (e = 0; a.length > e; e++)
for (n = a[e], t = 0; n.axes.length > t; t++) i = n.axes[t], i.options.crosshair && i.options.crosshair.visible && (r = new Ft(i, i.options.crosshair), o.crosshairs.push(r), o.append(r))
},
findPane: function (e) {
var t, n, i = this,
r = i.panes;
for (t = 0; r.length > t; t++)
if (r[t].options.name === e) {
n = r[t];
break
}
return n || r[0]
},
findPointPane: function (e) {
var t, n, i = this,
r = i.panes;
for (t = 0; r.length > t; t++)
if (r[t].box.containsPoint(e)) {
n = r[t];
break
}
return n
},
appendAxis: function (e) {
var t = this,
n = t.findPane(e.options.pane);
n.appendAxis(e), t.axes.push(e), e.plotArea = t
},
removeAxis: function (e) {
var t, n, i = this,
r = [];
for (t = 0; i.axes.length > t; t++) n = i.axes[t], e !== n && r.push(n);
i.axes = r
},
appendChart: function (e, t) {
var n = this;
n.charts.push(e), t ? t.appendChart(e) : n.append(e)
},
removeChart: function (e) {
var t, n, i = this,
r = [];
for (t = 0; i.charts.length > t; t++) n = i.charts[t], n !== e && r.push(n);
i.charts = r
},
addToLegend: function (e) {
var t, n, i, r, o, a = e.length,
s = [],
l = this.options.legend,
d = l.labels || {}, c = l.inactiveItems || {};
for (t = 0; a > t; t++) n = e[t], n.visibleInLegend !== !1 && (i = n.name || "", d.template && (i = Wt(d.template)({
text: i,
series: n
})), n.visible === !1 ? (r = c.labels.color, o = c.markers.color) : (r = d.color, o = n.color), s.push({
text: i,
labelColor: r,
markerColor: o,
series: n,
active: n.visible
}));
cn(l.items, s)
},
groupAxes: function (e) {
var t, n, i, r, o = [],
a = [];
for (i = 0; e.length > i; i++)
for (t = e[i].axes, r = 0; t.length > r; r++) n = t[r], n.options.vertical ? a.push(n) : o.push(n);
return {
x: o,
y: a,
any: o.concat(a)
}
},
groupSeriesByPane: function () {
var e, t, n, i = this,
r = i.series,
o = {};
for (e = 0; r.length > e; e++) n = r[e], t = i.seriesPaneName(n), o[t] ? o[t].push(n) : o[t] = [n];
return o
},
filterSeriesByType: function (e, t) {
var n, i, r = [];
for (t = [].concat(t), n = 0; e.length > n; n++) i = e[n], gn(i.type, t) && r.push(i);
return r
},
filterVisibleSeries: function (e) {
var t, n, i = [];
for (t = 0; e.length > t; t++) n = e[t], n.visible !== !1 && i.push(n);
return i
},
reflow: function (e) {
var t = this,
n = t.options.plotArea,
i = t.panes,
r = hn(n.margin);
t.box = e.clone().unpad(r), t.reflowPanes(), t.reflowAxes(i), t.reflowCharts(i)
},
redraw: function (e) {
var t, n = this;
for (e = [].concat(e), t = 0; e.length > t; t++) e[t].empty();
for (n.render(e), n.reflowAxes(n.panes), n.reflowCharts(e), t = 0; e.length > t; t++) e[t].refresh()
},
axisCrossingValues: function (e, t) {
var n, i = e.options,
r = [].concat(i.axisCrossingValues || i.axisCrossingValue),
o = t.length - r.length,
a = r[0] || 0;
for (n = 0; o > n; n++) r.push(a);
return r
},
alignAxisTo: function (e, t, n, i) {
var r = e.getSlot(n, n),
o = e.options.reverse ? 2 : 1,
a = t.getSlot(i, i),
s = t.options.reverse ? 2 : 1,
l = e.box.translate(a[hr + s] - r[hr + o], a[gr + s] - r[gr + o]);
e.pane !== t.pane && l.translate(0, e.pane.box.y1 - t.pane.box.y1), e.reflow(l)
},
alignAxes: function (e, t) {
var n, i, r, o, a = this,
s = e[0],
l = t[0],
d = a.axisCrossingValues(s, t),
c = a.axisCrossingValues(l, e),
u = {}, p = {}, f = {}, h = {};
for (o = 0; t.length > o; o++) r = t[o], n = r.pane, i = n.options.id, a.alignAxisTo(r, s, c[o], d[o]), r.options._overlap || (_n(r.lineBox().x1) === _n(s.lineBox().x1) && (u[i] && r.reflow(r.box.alignTo(u[i].box, pi).translate(-r.options.margin, 0)), u[i] = r), _n(r.lineBox().x2) === _n(s.lineBox().x2) && (r._mirrored || (r.options.labels.mirror = !r.options.labels.mirror, r._mirrored = !0), a.alignAxisTo(r, s, c[o], d[o]), p[i] && r.reflow(r.box.alignTo(p[i].box, Oi).translate(r.options.margin, 0)), p[i] = r), 0 !== o && l.pane === r.pane && r.alignTo(l));
for (o = 0; e.length > o; o++) r = e[o], n = r.pane, i = n.options.id, a.alignAxisTo(r, l, d[o], c[o]), r.options._overlap || (_n(r.lineBox().y1) === _n(l.lineBox().y1) && (r._mirrored || (r.options.labels.mirror = !r.options.labels.mirror, r._mirrored = !0), a.alignAxisTo(r, l, d[o], c[o]), f[i] && r.reflow(r.box.alignTo(f[i].box, er).translate(0, -r.options.margin)), f[i] = r), _n(r.lineBox().y2, Wn) === _n(l.lineBox().y2, Wn) && (h[i] && r.reflow(r.box.alignTo(h[i].box, Pn).translate(0, r.options.margin)), h[i] = r), 0 !== o && r.alignTo(s))
},
shrinkAxisWidth: function (e) {
var t, n, i, r = this,
o = r.groupAxes(e).any,
a = P(o),
s = 0;
for (t = 0; e.length > t; t++) n = e[t], n.axes.length > 0 && (s = Rt.max(s, a.width() - n.contentBox.width()));
for (t = 0; o.length > t; t++) i = o[t], i.options.vertical || i.reflow(i.box.shrink(s, 0))
},
shrinkAxisHeight: function (e) {
var t, n, i, r, o, a;
for (t = 0; e.length > t; t++)
for (n = e[t], i = n.axes, r = Rt.max(0, P(i).height() - n.contentBox.height()), o = 0; i.length > o; o++) a = i[o], a.options.vertical && a.reflow(a.box.shrink(0, r))
},
fitAxes: function (e) {
var t, n, i, r, o, a, s, l, d = this,
c = d.groupAxes(e).any,
u = 0;
for (s = 0; e.length > s; s++)
if (o = e[s], t = o.axes, n = o.contentBox, t.length > 0)
for (i = P(t), u = Rt.max(u, n.x1 - i.x1), r = Rt.max(n.y1 - i.y1, n.y2 - i.y2), l = 0; t.length > l; l++) a = t[l], a.reflow(a.box.translate(0, r));
for (s = 0; c.length > s; s++) a = c[s], a.reflow(a.box.translate(u, 0))
},
reflowAxes: function (e) {
var t, n = this,
i = n.groupAxes(e);
for (t = 0; e.length > t; t++) n.reflowPaneAxes(e[t]);
i.x.length > 0 && i.y.length > 0 && (n.alignAxes(i.x, i.y), n.shrinkAxisWidth(e), n.alignAxes(i.x, i.y), n.shrinkAxisHeight(e), n.alignAxes(i.x, i.y), n.fitAxes(e))
},
reflowPaneAxes: function (e) {
var t, n = e.axes,
i = n.length;
if (i > 0)
for (t = 0; i > t; t++) n[t].reflow(e.contentBox)
},
reflowCharts: function (e) {
var t, n, i = this,
r = i.charts,
o = r.length,
a = i.box;
for (n = 0; o > n; n++) t = r[n].pane, (!t || gn(t, e)) && r[n].reflow(a)
},
reflowPanes: function () {
var e, t, n, i, r, o = this,
a = o.box,
s = o.panes,
l = s.length,
d = a.height(),
c = l,
u = 0,
p = a.y1;
for (e = 0; l > e; e++) t = s[e], i = t.options.height, t.options.width = a.width(), t.options.height ? (i.indexOf && i.indexOf("%") && (r = parseInt(i, 10) / 100, t.options.height = r * a.height()), t.reflow(a.clone()), d -= t.options.height) : u++;
for (e = 0; l > e; e++) t = s[e], t.options.height || (t.options.height = d / u);
for (e = 0; l > e; e++) t = s[e], n = a.clone().move(a.x1, p), t.reflow(n), c--, p += t.options.height
},
backgroundBox: function () {
var e, t, n, i, r, o, a = this,
s = a.axes,
l = s.length;
for (n = 0; l > n; n++)
for (r = s[n], i = 0; l > i; i++) o = s[i], r.options.vertical !== o.options.vertical && (e = r.lineBox().clone().wrap(o.lineBox()), t = t ? t.wrap(e) : e);
return t || a.box
},
getViewElements: function (e) {
var t = this,
n = t.backgroundBox(),
i = t.options,
r = i.plotArea,
o = r.border || {}, a = Jt.fn.getViewElements.call(t, e);
return cn(a, [e.createRect(n, {
fill: r.background,
fillOpacity: r.opacity,
zIndex: -2,
strokeWidth: .1
}), e.createRect(n, {
id: i.id,
data: {
modelId: i.modelId
},
stroke: o.width ? o.color : "",
strokeWidth: o.width,
fill: fr,
fillOpacity: 0,
zIndex: -1,
dashType: o.dashType
})]), a
},
pointsByCategoryIndex: function (e) {
var t, n, i, r, o, a = this.charts,
s = [];
if (null !== e)
for (t = 0; a.length > t; t++)
if (o = a[t], "_navigator" !== o.pane.options.name && (i = a[t].categoryPoints[e], i && i.length))
for (n = 0; i.length > n; n++) r = i[n], r && pn(r.value) && null !== r.value && s.push(r);
return s
},
pointsBySeriesIndex: function (e) {
var t, n, i, r, o, a = this.charts,
s = [];
for (i = 0; a.length > i; i++)
for (o = a[i], t = o.points, r = 0; t.length > r; r++) n = t[r], n.options.index === e && s.push(n);
return s
},
paneByPoint: function (e) {
var t, n, i = this,
r = i.panes;
for (n = 0; r.length > n; n++)
if (t = r[n], t.box.containsPoint(e)) return t
}
}), ht = ft.extend({
init: function (e, t) {
var n = this;
n.namedCategoryAxes = {}, n.namedValueAxes = {}, n.valueAxisRangeTracker = new gt, e.length > 0 && (n.invertAxes = gn(e[0].type, [An, Hn, ur, dr])), ft.fn.init.call(n, e, t)
},
options: {
categoryAxis: {
categories: []
},
valueAxis: {}
},
render: function (e) {
var t = this;
e = e || t.panes, t.createCategoryAxes(e), t.aggregateDateSeries(e), t.createCharts(e), t.createValueAxes(e)
},
removeAxis: function (e) {
var t = this,
n = e.options.name;
ft.fn.removeAxis.call(t, e), e instanceof Ir ? delete t.namedCategoryAxes[n] : (t.valueAxisRangeTracker.reset(n), delete t.namedValueAxes[n]), e === t.categoryAxis && delete t.categoryAxis, e === t.valueAxis && delete t.valueAxis
},
createCharts: function (e) {
var t, n, i, r, o = this,
a = o.groupSeriesByPane();
for (t = 0; e.length > t; t++) n = e[t], i = a[n.options.name || "default"] || [], o.addToLegend(i), r = o.filterVisibleSeries(i), r && (o.createAreaChart(o.filterSeriesByType(r, [kn, dr]), n), o.createBarChart(o.filterSeriesByType(r, [Un, An]), n), o.createLineChart(o.filterSeriesByType(r, [gi, ur]), n), o.createCandlestickChart(o.filterSeriesByType(r, Rn), n), o.createOHLCChart(o.filterSeriesByType(r, Di), n), o.createBulletChart(o.filterSeriesByType(r, [Hn, cr]), n))
},
aggregateDateSeries: function (e) {
var t, i, r, o, a, s, l, d, c, u, p, f, h, g, m, v, _, b = this,
y = b.srcSeries || b.series,
w = [];
for (l = 0; y.length > l; l++) {
if (d = y[l], c = jt({}, d), t = b.seriesCategoryAxis(d), i = b.findPane(t.options.pane), gn(i, e) && z(t.options.type, Gn))
for (r = t.options.categories, o = t.categoryMap, u = c.data, c.data = p = [], a = 0; r.length > a; a++) {
for (s = o[a], f = [], _ = [], h = 0; s.length > h; h++) g = s[h], m = S(d, g), v = m.value, pn(v) && f.push(m.value), _.push(d.data[g]);
p[a] = f.length > 1 ? n(f, d, _) : u[s[0]]
}
w.push(c)
}
b.srcSeries = y, b.series = w
},
appendChart: function (e, t) {
for (var n = this, i = e.options.series, r = n.seriesCategoryAxis(i[0]), o = r.options.categories, a = Rt.max(0, f(i) - o.length); a--;) o.push("");
n.valueAxisRangeTracker.update(e.valueAxisRanges), ft.fn.appendChart.call(n, e, t)
},
seriesPaneName: function (t) {
var n = this,
i = n.options,
r = t.axis,
o = [].concat(i.valueAxis),
a = e.grep(o, function (e) {
return e.name === r
})[0],
s = i.panes || [{}],
l = (s[0] || {}).name || "default",
d = (a || {}).pane || l;
return d
},
seriesCategoryAxis: function (e) {
var t = this,
n = e.categoryAxis,
i = n ? t.namedCategoryAxes[n] : t.categoryAxis;
if (!i) throw Error("Unable to locate category axis with name " + n);
return i
},
createBarChart: function (e, t) {
if (0 !== e.length) {
var n = this,
i = e[0],
r = new W(n, {
series: e,
invertAxes: n.invertAxes,
isStacked: i.stack && e.length > 1,
gap: i.gap,
spacing: i.spacing
});
n.appendChart(r, t)
}
},
createBulletChart: function (e, t) {
if (0 !== e.length) {
var n = this,
i = e[0],
r = new j(n, {
series: e,
invertAxes: n.invertAxes,
gap: i.gap,
spacing: i.spacing
});
n.appendChart(r, t)
}
},
createLineChart: function (e, t) {
if (0 !== e.length) {
var n = this,
i = e[0],
r = new J(n, {
invertAxes: n.invertAxes,
isStacked: i.stack && e.length > 1,
series: e
});
n.appendChart(r, t)
}
},
createAreaChart: function (e, t) {
if (0 !== e.length) {
var n = this,
i = e[0],
r = new et(n, {
invertAxes: n.invertAxes,
isStacked: i.stack && e.length > 1,
series: e
});
n.appendChart(r, t)
}
},
createOHLCChart: function (e, t) {
if (0 !== e.length) {
var n = this,
i = e[0],
r = new st(n, {
invertAxes: n.invertAxes,
gap: i.gap,
series: e,
spacing: i.spacing
});
n.appendChart(r, t)
}
},
createCandlestickChart: function (e, t) {
if (0 !== e.length) {
var n = this,
i = e[0],
r = new ot(n, {
invertAxes: n.invertAxes,
gap: i.gap,
series: e,
spacing: i.spacing
});
n.appendChart(r, t)
}
},
axisRequiresRounding: function (e, t) {
var n, i, r = this,
o = r.filterSeriesByType(r.series, [An, Un, Di, Rn]);
for (n = 0; o.length > n; n++)
if (i = o[n].categoryAxis || "", i === e || !i && 0 === t) return !0
},
createCategoryAxes: function (e) {
var t, n, i, r, o, a, s, l, d, c = this,
u = c.invertAxes,
p = [].concat(c.options.categoryAxis),
f = [];
for (t = 0; p.length > t; t++)
if (n = p[t], i = c.findPane(n.pane), gn(i, e)) {
if (a = n.name, r = n.categories || [], s = r[0] instanceof Date, o = n.type || "", n = jt({
vertical: u,
axisCrossingValue: u ? vi : 0
}, n), pn(n.justified) || (n.justified = c.inJustified()), c.axisRequiresRounding(a, t) && (n.justified = !1, n.roundToBaseUnit = !0), l = !o && s || z(o, Gn) ? new Pr(n) : new Ir(n), a) {
if (c.namedCategoryAxes[a]) throw Error("Category axis with name " + a + " is already defined");
c.namedCategoryAxes[a] = l
}
l.axisIndex = t, f.push(l), c.appendAxis(l)
}
d = c.categoryAxis || f[0], c.categoryAxis = d, u ? c.axisY = d : c.axisX = d
},
inJustified: function () {
var e, t, n = this,
i = n.series;
for (e = 0; i.length > e; e++)
if (t = i[e], t.type !== kn) return !1;
return !0
},
createValueAxes: function (e) {
var t, n, i, r, o, a, s, l = this,
d = l.valueAxisRangeTracker,
c = d.query(),
u = [].concat(l.options.valueAxis),
p = l.invertAxes,
f = {
vertical: !p
}, h = [];
for (s = 0; u.length > s; s++)
if (t = u[s], n = l.findPane(t.pane), gn(n, e)) {
if (a = t.name, o = d.query(a) || c || {
min: 0,
max: 1
}, 0 === s && o && c && (o.min = Rt.min(o.min, c.min), o.max = Rt.max(o.max, c.max)), i = new tn(o.min, o.max, jt({}, f, t)), a) {
if (l.namedValueAxes[a]) throw Error("Value axis with name " + a + " is already defined");
l.namedValueAxes[a] = i
}
i.axisIndex = s, h.push(i), l.appendAxis(i)
}
r = l.valueAxis || h[0], l.valueAxis = r, p ? l.axisX = r : l.axisY = r
},
click: function (t, n) {
var i, r, o, a = this,
s = t._eventCoordinates(n),
l = new nn(s.x, s.y),
d = a.pointPane(l),
c = [],
u = [];
if (d) {
for (i = d.axes, r = 0; i.length > r; r++) o = i[r], o.getValue ? O(u, o.getValue(l)) : O(c, o.getCategory(l));
0 === c.length && O(c, a.categoryAxis.getCategory(l)), c.length > 0 && u.length > 0 && t.trigger(Hi, {
element: e(n.target),
category: I(c),
value: I(u)
})
}
},
pointPane: function (e) {
var t, n, i = this,
r = i.panes;
for (n = 0; r.length > n; n++)
if (t = r[n], t.contentBox.containsPoint(e)) return t
}
}), gt = Bt.extend({
init: function () {
var e = this;
e.axisRanges = {}
},
update: function (e) {
var t, n, i, r = this,
o = r.axisRanges;
for (i in e) t = o[i], n = e[i], o[i] = t = t || {
min: vi,
max: _i
}, t.min = Rt.min(t.min, n.min), t.max = Rt.max(t.max, n.max)
},
reset: function (e) {
this.axisRanges[e] = t
},
query: function (e) {
return this.axisRanges[e]
}
}), mt = ft.extend({
init: function (e, t) {
var n = this;
n.namedXAxes = {}, n.namedYAxes = {}, n.xAxisRangeTracker = new gt, n.yAxisRangeTracker = new gt, ft.fn.init.call(n, e, t)
},
options: {
xAxis: {},
yAxis: {}
},
render: function (e) {
var t, n, i, r, o = this,
a = o.groupSeriesByPane();
for (e = e || o.panes, t = 0; e.length > t; t++) n = e[t], i = a[n.options.name || "default"] || [], o.addToLegend(i), r = o.filterVisibleSeries(i), r && (o.createScatterChart(o.filterSeriesByType(r, Bi), n), o.createScatterLineChart(o.filterSeriesByType(r, Li), n), o.createBubbleChart(o.filterSeriesByType(r, zn), n));
o.createAxes(e)
},
appendChart: function (e, t) {
var n = this;
n.xAxisRangeTracker.update(e.xAxisRanges), n.yAxisRangeTracker.update(e.yAxisRanges), ft.fn.appendChart.call(n, e, t)
},
removeAxis: function (e) {
var t = this,
n = e.options.name;
ft.fn.removeAxis.call(t, e), e.options.vertical ? (t.yAxisRangeTracker.reset(n), delete t.namedYAxes[n]) : (t.xAxisRangeTracker.reset(n), delete t.namedXAxes[n]), e === t.axisX && delete t.axisX, e === t.axisY && delete t.axisY
},
seriesPaneName: function (t) {
var n = this,
i = n.options,
r = t.xAxis,
o = [].concat(i.xAxis),
a = e.grep(o, function (e) {
return e.name === r
})[0],
s = t.yAxis,
l = [].concat(i.yAxis),
d = e.grep(l, function (e) {
return e.name === s
})[0],
c = i.panes || [{}],
u = c[0].name || "default",
p = (a || {}).pane || (d || {}).pane || u;
return p
},
createScatterChart: function (e, t) {
var n = this;
e.length > 0 && n.appendChart(new tt(n, {
series: e
}), t)
},
createScatterLineChart: function (e, t) {
var n = this;
e.length > 0 && n.appendChart(new nt(n, {
series: e
}), t)
},
createBubbleChart: function (e, t) {
var n = this;
e.length > 0 && n.appendChart(new it(n, {
series: e
}), t)
},
createXYAxis: function (e, t, n) {
var i, r, o, a, s, l, d, c = this,
u = e.name,
p = t ? c.namedYAxes : c.namedXAxes,
f = t ? c.yAxisRangeTracker : c.xAxisRangeTracker,
h = f.query(),
g = f.query(u) || h || {
min: 0,
max: 1
}, m = jt({}, e, {
vertical: t
}),
v = c.series,
_ = [m.min, m.max];
for (r = 0; v.length > r; r++)
if (o = v[r], a = o[t ? "yAxis" : "xAxis"], a == m.name || 0 === n && !a) {
s = S(o, 0).value, _.push(s[t ? "y" : "x"]);
break
}
for (0 === n && h && (g.min = Rt.min(g.min, h.min), g.max = Rt.max(g.max, h.max)), d = 0; _.length > d; d++)
if (_[d] instanceof Date) {
l = !0;
break
}
if (i = z(m.type, Gn) || !m.type && l ? new zr(g.min, g.max, m) : new tn(g.min, g.max, m), u) {
if (p[u]) throw Error((t ? "Y" : "X") + " axis with name " + u + " is already defined");
p[u] = i
}
return c.appendAxis(i), i
},
createAxes: function (e) {
var t, n = this,
i = n.options,
r = [].concat(i.xAxis),
o = [],
a = [].concat(i.yAxis),
s = [];
Pt(r, function (i) {
t = n.findPane(this.pane), gn(t, e) && o.push(n.createXYAxis(this, !1, i))
}), Pt(a, function (i) {
t = n.findPane(this.pane), gn(t, e) && s.push(n.createXYAxis(this, !0, i))
}), n.axisX = n.axisX || o[0], n.axisY = n.axisY || s[0]
},
click: function (t, n) {
var i, r, o, a, s = this,
l = t._eventCoordinates(n),
d = new nn(l.x, l.y),
c = s.axes,
u = c.length,
p = [],
f = [];
for (i = 0; u > i; i++) r = c[i], a = r.options.vertical ? f : p, o = r.getValue(d), null !== o && a.push(o);
p.length > 0 && f.length > 0 && t.trigger(Hi, {
element: e(n.target),
x: I(p),
y: I(f)
})
}
}), vt = ft.extend({
render: function () {
var e = this,
t = e.series;
e.createPieChart(t)
},
createPieChart: function (e) {
var t = this,
n = e[0],
i = new dt(t, {
series: e,
padding: n.padding,
startAngle: n.startAngle,
connectors: n.connectors,
legend: t.options.legend
});
t.appendChart(i)
},
appendChart: function (e, t) {
ft.fn.appendChart.call(this, e, t), cn(this.options.legend.items, e.legendItems)
}
}), _t = vt.extend({
render: function () {
var e = this,
t = e.series;
e.createDonutChart(t)
},
createDonutChart: function (e) {
var t = this,
n = e[0],
i = new ut(t, {
series: e,
padding: n.padding,
connectors: n.connectors,
legend: t.options.legend
});
t.appendChart(i)
}
}), bt = en.extend({
options: {
easing: "easeOutElastic",
duration: li
},
setup: function () {
var e, t = this.element,
n = t.config;
t.options.singleSegment && (n = t), this.endRadius = n.r, e = this.startRadius = n.ir || 0, n.r = e
},
step: function (e) {
var t = this,
n = t.element,
i = t.endRadius,
r = n.config,
o = t.startRadius;
n.options.singleSegment && (r = n), r.r = mn(o, i, e)
}
}), yt = en.extend({
options: {
easing: "easeOutElastic",
duration: li
},
setup: function () {
var e = this.element;
e.endRadius = e.radius, e.radius = 0
},
step: function (e) {
var t = this.element,
n = t.endRadius;
t.radius = mn(0, n, e)
}
}), wt = dn(An, Qt), xt = dn(Pi, bt), kt = dn(zn, yt), Ct = Bt.extend({
init: function (e, t, n) {
var i = this;
i.options = jt({}, i.options, n), i.view = e, i.viewElement = t, i._overlays = []
},
options: {
fill: fr,
fillOpacity: .2,
stroke: fr,
strokeWidth: 1,
strokeOpacity: .2
},
show: function (e) {
var t, n, i, r, o, a = this,
s = a.view,
l = a.viewElement,
d = a._overlays;
for (a.hide(), a._points = e = [].concat(e), i = 0; e.length > i; i++) r = e[i], r && (o = r.options, (!o || (o.highlight || {}).visible) && (r.highlightOverlay && (t = r.highlightOverlay(s, a.options), t && (n = s.renderElement(t), l.appendChild(n), d.push(n))), r.toggleHighlight && r.toggleHighlight(s)))
},
hide: function () {
for (var e, t, n, i, r = this, o = r._points, a = r._overlays; a.length;) e = r._overlays.pop(), e.parentNode.removeChild(e);
if (o)
for (t = 0; o.length > t; t++) n = o[t], n && (i = n.options, (!i || (i.highlight || {}).visible) && n.toggleHighlight && n.toggleHighlight(r.view));
r._points = []
}
}), Tt = Bt.extend({
init: function (t, n) {
var i = this;
i.options = jt({}, i.options, n), i.chartElement = t, i.chartPadding = {
top: parseInt(t.css("paddingTop"), 10),
left: parseInt(t.css("paddingLeft"), 10)
}, i.template = Tt.template, i.template || (i.template = Tt.template = bn("
" + "
")), i.element = e(i.template(i.options)).appendTo(t), i._moveProxy = Mt(i.move, i)
},
options: {
border: {
width: 1
},
opacity: 1,
animation: {
duration: tr
}
},
move: function () {
var e = this,
t = e.options,
n = e.element,
i = e._offset();
e.visible || n.css({
top: i.top,
left: i.left
}), n.stop(!0, !0).show().animate({
left: i.left,
top: i.top
}, t.animation.duration), e.visible = !0
},
_offset: function () {
var t = this,
n = t.element,
i = t.anchor,
r = t.chartPadding,
o = _n(i.y + r.top),
a = _n(i.x + r.left),
s = Nt.support.zoomLevel(),
l = e(window),
d = window.pageYOffset || document.documentElement.scrollTop || 0,
c = window.pageXOffset || document.documentElement.scrollLeft || 0;
return d = t.chartElement.offset().top - d, c = t.chartElement.offset().left - c, o += t._currentPosition(o + d, n.outerHeight(), l.outerHeight() / s), a += t._currentPosition(a + c, n.outerWidth(), l.outerWidth() / s), {
top: o,
left: a
}
},
setStyle: function (e) {
this.element.css({
backgroundColor: e.background,
borderColor: e.border.color || e.background,
font: e.font,
color: e.color,
opacity: e.opacity,
borderWidth: e.border.width
})
},
show: function () {
var e = this;
e.showTimeout = setTimeout(e._moveProxy, ir)
},
hide: function () {
var e = this;
clearTimeout(e.showTimeout), e.visible && (e._hideElement(), e.point = null, e.visible = !1, e.index = null)
},
_hideElement: function () {
this.element.fadeOut()
},
_pointContent: function (e) {
var t, n, i = this,
r = jt({}, i.options, e.options.tooltip);
return pn(e.value) && (t = "" + e.value), r.template ? (n = Wt(r.template), t = n({
value: e.value,
category: e.category,
series: e.series,
dataItem: e.dataItem,
percentage: e.percentage
})) : r.format && (t = e.formatValue(r.format)), t
},
_pointAnchor: function (e) {
var t = this,
n = t.element;
return e.tooltipAnchor(n.outerWidth(), n.outerHeight())
},
_currentPosition: function (e, t, n) {
var i = 0;
return e + t > n && (i = n - (e + t)), 0 > e && (i = -e), i
},
_updateStyle: function (e, t) {
if (pn(e.background) || (e.background = t.color), !pn(e.color)) {
var n = this,
i = n.element,
r = new Zt(e.background).percBrightness();
r > 180 ? i.addClass(jn + or) : i.removeClass(jn + or)
}
}
}), St = Tt.extend({
show: function (e) {
var t = this,
n = jt({}, t.options, e.options.tooltip);
e && (t.element.html(t._pointContent(e)), t.anchor = t._pointAnchor(e), t._updateStyle(n, e.options), t.setStyle(n), Tt.fn.show.call(t, e))
}
}), At = Tt.extend({
init: function (e, t, n) {
var i = this;
Tt.fn.init.call(i, e, n), i.plotArea = t
},
options: {
sharedTemplate: "
#= categoryText #
# for(var i = 0; i < points.length; i++) { ## var point = points[i]; #
# if(point.series.name) { #
#= point.series.name #:
# } #
#= content(point) #
# } #
",
categoryFormat: "{0:d}"
},
showAt: function (e, t) {
var n, i = this,
r = i.options,
o = i.plotArea,
a = o.categoryAxis,
s = a.getCategoryIndex(t),
l = a.getCategory(t),
d = a.getSlot(s);
n = i._content(e, l), i.element.html(n), i.anchor = i._slotAnchor(t, d), i._updateStyle(r, e[0].options), i.setStyle(r), Tt.fn.show.call(i)
},
_slotAnchor: function (e, t) {
var n, i = this,
r = i.plotArea,
o = r.categoryAxis,
a = e.y - i.element.height() / 2;
return n = o.options.vertical ? nn(e.x, a) : nn(t.center().x, a)
},
_content: function (e, t) {
var n, i, r = this;
return n = Nt.template(r.options.sharedTemplate), i = n({
points: e,
category: t,
categoryText: un(r.options.categoryFormat, t),
content: r._pointContent
})
}
}), Ft = Jt.extend({
init: function (e, t) {
var n = this;
Jt.fn.init.call(n, t), n.axis = e, n.options.id || (n.options.id = yn()), n._visible = !1, n.stickyMode = e instanceof Ir
},
options: {
color: In,
width: 1,
zIndex: -1,
tooltip: {
visible: !1
}
},
repaint: function () {
var e = this,
t = e.element;
e.getViewElements(e._view), t = e.element, t.refresh(fn(e.options.id))
},
showAt: function (e) {
var t = this;
t.updateAxisReference(), t._visible = !0, t.point = e, t.repaint(), t.options.tooltip.visible && (t.tooltip || (t.tooltip = new Dt(t, jt({}, t.options.tooltip, {
stickyMode: t.stickyMode
}))), t.tooltip.showAt(e))
},
hide: function () {
var e = this;
e._visible && (e._visible = !1, e.repaint(), e.tooltip && e.tooltip.hide())
},
linePoints: function () {
var e, t, n, i = this,
r = i.axis,
o = r.options.vertical,
a = i.getBox(),
s = i.point,
l = o ? gr : hr;
return t = nn(a.x1, a.y1), n = o ? nn(a.x2, a.y1) : nn(a.x1, a.y2), s && (i.stickyMode ? (e = r.getSlot(r.getCategoryIndex(s)), t[l] = n[l] = e.center()[l]) : t[l] = n[l] = s[l]), i.box = a, [t, n]
},
getBox: function () {
var e, t, n, i = this,
r = i.axis,
o = r.pane.axes,
a = o.length,
s = r.options.vertical,
l = r.lineBox().clone(),
d = s ? hr : gr;
for (n = 0; a > n; n++) t = o[n], t.options.vertical != s && (e ? e.wrap(t.lineBox()) : e = t.lineBox().clone());
return l[d + 1] = e[d + 1], l[d + 2] = e[d + 2], l
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = [];
return t.points = t.linePoints(), t.element = e.createPolyline(t.points, !1, {
id: n.id,
stroke: n.color,
strokeWidth: n.width,
strokeOpacity: n.opacity,
dashType: n.dashType,
zIndex: n.zIndex,
visible: t._visible
}), i.push(t.element), t._view = e, cn(i, Jt.fn.getViewElements.call(t, e)), i
},
updateAxisReference: function () {
var e, t, n = this,
i = n.axis,
r = i.plotArea,
o = r.axes;
for (t = 0; o.length > t; t++)
if (e = o[t], pn(i.axisIndex) && i instanceof tn != e instanceof Ir && i.axisIndex === e.axisIndex) {
n.axis = e;
break
}
}
}), Dt = Tt.extend({
init: function (e, t) {
var n = this,
i = e.axis.getRoot().parent.element;
n.crosshair = e, Tt.fn.init.call(n, i, jt({}, n.options, {
background: e.axis.plotArea.options.seriesColors[0]
}, t)), n._updateStyle(n.options, {}), n.setStyle(n.options)
},
options: {
padding: 10
},
showAt: function (e) {
var t = this,
n = t.element;
t.point = e, t.element.html(t.content(e)), t.anchor = t.getAnchor(n.outerWidth(), n.outerHeight()), t.move()
},
move: function () {
var e = this,
t = e.element,
n = e._offset();
t.css({
top: n.top,
left: n.left
}).show()
},
content: function (e) {
var t, n, i, r = this,
o = r.options,
a = r.crosshair.axis,
s = a.options;
return n = t = a[o.stickyMode ? "getCategory" : "getValue"](e), o.template ? (i = Wt(o.template), t = i({
value: n
})) : o.format ? t = un(o.format, n) : s.type === Gn && (t = un(s.labels.dateFormats[s.baseUnit], n)), t
},
getAnchor: function (e, t) {
var n, i, r = this,
o = r.options,
a = o.position,
s = r.crosshair.axis.options.vertical,
l = r.crosshair.points,
d = l[0],
c = l[1],
u = e / 2,
p = t / 2,
f = o.padding;
return s ? a === pi ? (n = d.x - e - f, i = d.y - p) : (n = c.x + f, i = c.y - p) : a === Pn ? (n = c.x - u, i = c.y + f) : (n = d.x - u, i = d.y - t - f), nn(n, i)
},
hide: function () {
this.element.hide(), this.point = null
}
}), It = {
max: function (e) {
var t = Rt.max.apply(Rt, e);
return isNaN(t) ? r(e) : t
},
min: function (e) {
var t = Rt.min.apply(Rt, e);
return isNaN(t) ? i(e) : t
},
sum: function (e) {
var t, n, i = e.length,
r = 0;
for (t = 0; i > t; t++) n = e[t], pn(n) && !isNaN(n) && (r += n);
return r
},
count: function (e) {
return e.length
},
avg: function (e) {
return It.sum(e) / It.count(e)
}
}, Et = Lt.extend({
init: function (t, n, i) {
var r, o, a = this,
s = t.element,
l = n.lineBox(),
d = a.getValueAxis(n),
c = d.lineBox(),
u = "." + jn;
Lt.fn.init.call(a), a.options = jt({}, a.options, i), i = a.options, a.chart = t, a.chartElement = s, a.categoryAxis = n, a._dateAxis = a.categoryAxis instanceof Pr, a.valueAxis = d, a._dateAxis && jt(i, {
min: m(i.min),
max: m(i.max),
from: m(i.from),
to: m(i.to)
}), a.template = Et.template, a.template || (a.template = Et.template = bn("
" + "" + "" + "
" + "" + "
" + "
" + "
")), o = {
left: parseInt(s.css("paddingLeft"), 10),
right: parseInt(s.css("paddingTop"), 10)
}, a.options = jt({}, {
width: l.width(),
height: c.height(),
padding: o,
offset: {
left: c.x2 + o.left,
top: c.y1 + o.right
},
from: i.min,
to: i.max
}, i), a.options.visible && (a.wrapper = r = e(a.template(a.options)).appendTo(s), a.selection = r.find(u + "selection"), a.leftMask = r.find(u + "mask").first(), a.rightMask = r.find(u + "mask").last(), a.leftHandle = r.find(u + "leftHandle"), a.rightHandle = r.find(u + "rightHandle"), a.options.selection = {
border: {
left: parseFloat(a.selection.css("border-left-width"), 10),
right: parseFloat(a.selection.css("border-right-width"), 10)
}
}, a.leftHandle.css("top", (a.selection.height() - a.leftHandle.height()) / 2), a.rightHandle.css("top", (a.selection.height() - a.rightHandle.height()) / 2), a.set(a._index(i.from), a._index(i.to)), a.bind(a.events, a.options), a.wrapper[0].style.cssText = a.wrapper[0].style.cssText, a.wrapper.on(Fi, Mt(a._mousewheel, a)), Nt.UserEvents ? a.userEvents = new Nt.UserEvents(a.wrapper, {
global: !0,
threshold: 5,
stopPropagation: !0,
multiTouch: !0,
start: Mt(a._start, a),
move: Mt(a._move, a),
end: Mt(a._end, a),
tap: Mt(a._tap, a),
gesturestart: Mt(a._gesturechange, a),
gesturechange: Mt(a._gesturechange, a)
}) : a.leftHandle.add(a.rightHandle).removeClass(jn + "handle"))
},
events: [Vi, Ui, Wi],
options: {
visible: !0,
mousewheel: {
zoom: En
},
min: _i,
max: vi
},
destroy: function () {
var e = this,
t = e.userEvents;
t && t.destroy()
},
_rangeEventArgs: function (e) {
var t = this;
return {
axis: t.categoryAxis.options,
from: t._value(e.from),
to: t._value(e.to)
}
},
_start: function (t) {
var n, i = this,
r = i.options,
o = e(t.event.target);
!i._state && o && (i.chart._unsetActivePoint(), i._state = {
moveTarget: o.parents(".k-handle").add(o).first(),
startLocation: t.x ? t.x.location : 0,
range: {
from: i._index(r.from),
to: i._index(r.to)
}
}, n = i._rangeEventArgs({
from: i._index(r.from),
to: i._index(r.to)
}), i.trigger(Vi, n) && (i.userEvents.cancel(), i._state = null))
},
_move: function (e) {
if (this._state) {
var t = this,
n = t._state,
i = t.options,
r = t.categoryAxis.options.categories,
o = t._index(i.from),
a = t._index(i.to),
s = t._index(i.min),
l = t._index(i.max),
d = n.startLocation - e.x.location,
c = n.range,
u = {
from: c.from,
to: c.to
}, p = c.to - c.from,
f = n.moveTarget,
h = t.wrapper.width() / (r.length - 1),
g = Rt.round(d / h);
f && (e.preventDefault(), f.is(".k-selection, .k-selection-bg") ? (c.from = Rt.min(Rt.max(s, o - g), l - p), c.to = Rt.min(c.from + p, l)) : f.is(".k-leftHandle") ? (c.from = Rt.min(Rt.max(s, o - g), l - 1), c.to = Rt.max(c.from + 1, c.to)) : f.is(".k-rightHandle") && (c.to = Rt.min(Rt.max(s + 1, a - g), l), c.from = Rt.min(c.to - 1, c.from)), (c.from !== u.from || c.to !== u.to) && (t.move(c.from, c.to), t.trigger(Ui, t._rangeEventArgs(c))))
}
},
_end: function () {
var e = this,
t = e._state.range;
delete e._state, e.set(t.from, t.to), e.trigger(Wi, e._rangeEventArgs(t))
},
_gesturechange: function (e) {
if (this._state) {
var t = this,
n = t.chart,
i = t._state,
r = t.options,
o = t.categoryAxis,
a = i.range,
s = n._toModelCoordinates(e.touches[0].x.location).x,
l = n._toModelCoordinates(e.touches[1].x.location).x,
d = Rt.min(s, l),
c = Rt.max(s, l);
e.preventDefault(), i.moveTarget = null, a.from = o.getCategoryIndex(new Gt.Point2D(d)) || r.min, a.to = o.getCategoryIndex(new Gt.Point2D(c)) || r.max, t.move(a.from, a.to)
}
},
_tap: function (e) {
var t = this,
n = t.options,
i = t.chart._eventCoordinates(e),
r = t.categoryAxis,
o = r.getCategoryIndex(new Gt.Point2D(i.x, r.box.y1)),
a = t._index(n.from),
s = t._index(n.to),
l = t._index(n.min),
d = t._index(n.max),
c = s - a,
u = a + c / 2,
p = Rt.round(u - o),
f = {}, h = 3 === e.event.which;
t._state || h || (e.preventDefault(), t.chart._unsetActivePoint(), r.options.justified || p--, f.from = Rt.min(Rt.max(l, a - p), d - c), f.to = Rt.min(f.from + c, d), t._start(e), t._state && (t._state.range = f, t.trigger(Ui, t._rangeEventArgs(f)), t._end()))
},
_mousewheel: function (e) {
var t, n = this,
i = n.options,
r = L(e);
n._start({
event: {
target: n.selection
}
}), n._state && (t = n._state.range, e.preventDefault(), e.stopPropagation(), Rt.abs(r) > 1 && (r *= _r), i.mousewheel.reverse && (r *= -1), n.expand(r) && n.trigger(Ui, {
axis: n.categoryAxis.options,
delta: r,
originalEvent: e,
from: n._value(t.from),
to: n._value(t.to)
}), n._mwTimeout && clearTimeout(n._mwTimeout), n._mwTimeout = setTimeout(function () {
n._end()
}, Ai))
},
_index: function (e) {
var t = this,
n = t.categoryAxis,
i = n.options.categories,
r = e;
return e instanceof Date && (r = M(i, e), !n.options.justified && e > vn(i) && (r += 1)), r
},
_value: function (e) {
var t = this,
n = this.categoryAxis,
i = n.options.categories,
r = e;
return t._dateAxis && (r = e > i.length - 1 ? t.options.max : i[e]), r
},
_slot: function (e) {
var t = this,
n = this.categoryAxis;
return n.getSlot(t._index(e))
},
move: function (e, t) {
var n, i, r, o, a = this,
s = a.options,
l = s.offset,
d = s.padding,
c = s.selection.border;
r = a._slot(e), n = _n(r.x1 - l.left + d.left), a.leftMask.width(n), a.selection.css("left", n), r = a._slot(t), i = _n(s.width - (r.x1 - l.left + d.left)), a.rightMask.width(i), o = s.width - i, o != s.width && (o += c.right), a.rightMask.css("left", o), a.selection.width(Rt.max(s.width - (n + i) - c.right, 0))
},
set: function (e, t) {
var n = this,
i = n.options,
r = n._index(i.min),
o = n._index(i.max);
e = E(n._index(e), r, o), t = E(n._index(t), e + 1, o), i.visible && n.move(e, t), i.from = n._value(e), i.to = n._value(t)
},
expand: function (e) {
var n = this,
i = n.options,
r = n._index(i.min),
o = n._index(i.max),
a = i.mousewheel.zoom,
s = n._index(i.from),
l = n._index(i.to),
d = {
from: s,
to: l
}, c = jt({}, d);
return n._state && (d = n._state.range), a !== Oi && (d.from = E(E(s - e, 0, l - 1), r, o)), a !== pi && (d.to = E(E(l + e, d.from + 1, o), r, o)), d.from !== c.from || d.to !== c.to ? (n.set(d.from, d.to), !0) : t
},
getValueAxis: function (e) {
var t, n, i = e.pane.axes,
r = i.length;
for (t = 0; r > t; t++)
if (n = i[t], n.options.vertical !== e.options.vertical) return n
}
}), Ot(e.easing, {
easeOutElastic: function (e, t, n, i) {
var r = 1.70158,
o = 0,
a = i;
return 0 === e ? n : 1 === e ? n + i : (o || (o = .5), Rt.abs(i) > a ? (a = i, r = o / 4) : r = o / (2 * Rt.PI) * Rt.asin(i / a), a * Rt.pow(2, -10 * e) * Rt.sin((1 * e - r) * 1.1 * Rt.PI / o) + i + n)
}
}), Gt.ui.plugin(Sr), jt(Gt, {
Aggregates: It,
AreaChart: et,
Bar: Mr,
BarAnimationDecorator: wt,
BarChart: W,
BarLabel: Ar,
BubbleAnimationDecorator: kt,
BubbleChart: it,
CandlestickChart: ot,
Candlestick: rt,
CategoricalPlotArea: ht,
CategoryAxis: Ir,
ClusterLayout: Hr,
Crosshair: Ft,
CrosshairTooltip: Dt,
DateCategoryAxis: Pr,
DateValueAxis: zr,
DonutChart: ut,
DonutPlotArea: _t,
DonutSegment: ct,
Highlight: Ct,
SharedTooltip: At,
Legend: Dr,
LineChart: J,
LinePoint: Y,
Pane: pt,
PieAnimation: bt,
PieAnimationDecorator: xt,
PieChart: dt,
PiePlotArea: vt,
PieSegment: lt,
ScatterChart: tt,
ScatterLineChart: nt,
Selection: Et,
ShapeElement: G,
StackLayout: Rr,
Tooltip: St,
OHLCChart: st,
OHLCPoint: at,
XYPlotArea: mt,
addDuration: _,
axisGroupBox: P,
validNumbers: N,
bindPoint: S,
categoriesCount: f,
ceilDate: w,
duration: C,
floorDate: y,
lteDateIndex: M,
sparseArrayLimits: o,
toDate: m,
toTime: v
})
}(window.kendo.jQuery),
function () {
function e(e, n, i) {
var r = w(e.from) ? e.from : H,
o = w(e.to) ? e.to : z;
return e.from = t.max(t.min(o, r), n), e.to = t.min(t.max(o, r), i), e
}
var t = Math,
n = window.kendo,
i = n.ui.Widget,
r = n.deepExtend,
o = n.dataviz,
a = o.Axis,
s = o.Box2D,
l = o.ChartElement,
d = o.NumericAxis,
c = o.Pin,
u = o.Ring,
p = o.RootElement,
f = o.RotationAnimation,
h = o.BarIndicatorAnimatin,
g = o.ArrowAnimation,
m = o.append,
v = o.animationDecorator,
_ = o.autoMajorUnit,
b = o.getElement,
y = o.getSpacing,
w = o.defined,
x = o.rotatePoint,
k = o.Point2D,
C = o.round,
T = o.uniqueId,
S = 150,
A = "arrow",
F = "arrowPointer",
D = "barIndicator",
I = "#000",
E = .05,
P = o.COORD_PRECISION,
z = Number.MAX_VALUE,
H = -Number.MAX_VALUE,
R = 200,
O = .5,
M = 200,
N = 60,
B = 60,
L = t.PI / 180,
V = "inside",
U = "needle",
W = "outside",
j = "radialPointer",
q = 90,
G = l.extend({
init: function (e, n) {
var i = this,
r = e.options;
l.fn.init.call(i, n), n = i.options, n.id || (n.id = T()), n.fill = n.color, i.scale = e, n.value = w(n.value) ? t.min(t.max(n.value, r.min), r.max) : r.min
},
options: {
color: I
},
value: function (e) {
var n = this,
i = n.options,
r = i.value,
o = n.scale.options;
return 0 === arguments.length ? r : (i._oldValue = i.value, i.value = t.min(t.max(e, o.min), o.max), n.repaint(), undefined)
}
}),
$ = G.extend({
options: {
shape: U,
cap: {
size: E
},
arrow: {
width: 16,
height: 14
},
animation: {
type: j,
speed: S
}
},
reflow: function () {
var e = this,
t = e.options,
n = e.scale,
i = n.ring,
r = i.c,
o = i.r * t.cap.size;
e.box = new s(r.x - o, r.y - o, r.x + o, r.y + o)
},
repaint: function () {
var e = this,
t = e.scale,
n = e.options,
i = e.elements[0],
o = n.animation,
a = t.slotAngle(t.options.min),
s = t.slotAngle(n._oldValue) - a,
l = i._animation;
i.options.rotation[0] = t.slotAngle(n.value) - a, l && l.abort(), o.transitions === !1 ? i.refresh(b(n.id)) : (l = i._animation = new f(i, r(o, {
startAngle: s,
reverse: t.options.reverse
})), l.setup(), l.play())
},
_renderNeedle: function (e, t, n, i) {
var r = this,
o = r.options,
a = r.scale,
s = a.ring.r * o.cap.size;
return [e.createPolyline([x((t.x1 + t.x2) / 2, t.y1 + a.options.minorTicks.size, n.x, n.y, i), x(n.x - s / 2, n.y, n.x, n.y, i), x(n.x + s / 2, n.y, n.x, n.y, i)], !0, o), e.createCircle(n, s, {
fill: o.cap.color || o.color
})]
},
_renderArrow: function (e, t, n, i) {
var r = this,
o = r.options,
a = r.scale,
s = a.ring.clone(),
l = 5,
d = o.arrow,
u = d.height;
return s.ir = s.r - l, [e.createPin(new c({
origin: x((t.x1 + t.x2) / 2, t.y1 + u, n.x, n.y, i),
height: d.height,
radius: l,
rotation: i,
arcAngle: 180
}), o), e.createRing(s, {
fill: o.color
})]
},
renderPointer: function (e) {
var t, n = this,
i = n.scale,
o = i.ring,
a = o.c,
l = o.r,
d = n.options,
c = new s(a.x - l, a.y - l, a.x + l, a.y + l),
u = c.center(),
p = i.slotAngle(i.options.min),
f = q - p;
return d.animation !== !1 && r(d.animation, {
startAngle: 0,
center: u,
reverse: i.options.reverse
}), r(d, {
rotation: [i.slotAngle(d.value) - p, u.x, u.y]
}), t = d.shape == A ? n._renderArrow(e, c, u, f) : n._renderNeedle(e, c, u, f)
},
getViewElements: function (e) {
var t = this,
n = t.renderPointer(e);
return t.elements = n, n
}
}),
Y = d.extend({
init: function (e) {
var t = this;
t.options = r({}, t.options, e), t.options.majorUnit = t.options.majorUnit || _(t.options.min, t.options.max), a.fn.init.call(t, t.options), t.options.minorUnit = t.options.minorUnit || t.options.majorUnit / 10
},
options: {
min: 0,
max: 100,
majorTicks: {
size: 15,
align: V,
color: I,
width: O,
visible: !0
},
minorTicks: {
size: 10,
align: V,
color: I,
width: O,
visible: !0
},
startAngle: -30,
endAngle: 210,
labels: {
position: V,
padding: 2
}
},
reflow: function (e) {
var n = this,
i = n.options,
r = e.center(),
a = t.min(e.height(), e.width()) / 2,
s = n.ring || new o.Ring(r, a - i.majorTicks.size, a, i.startAngle, i.endAngle - i.startAngle);
n.ring = s, n.box = s.getBBox(), n.arrangeLabels()
},
slotAngle: function (e) {
var t, n = this.options,
i = n.startAngle,
r = n.reverse,
o = n.endAngle - i,
a = n.min,
s = n.max;
return t = r ? n.endAngle - (e - a) / (s - a) * o : (e - a) / (s - a) * o + i
},
renderTicks: function (e) {
function t(t, r, o, a, s) {
var l, d, c, u = n.tickAngles(t, r),
p = s / r,
f = u.length;
if (a)
for (l = 0; f > l; l++) 0 !== l % p && (c = t.point(u[l]), d = t.point(u[l], !0), i.push(e.createLine(d.x, d.y, c.x, c.y, {
align: !1,
stroke: o.color,
strokeWidth: o.width
})))
}
var n = this,
i = [],
r = n.ring,
o = r.clone(),
a = n.options,
s = a.minorTicks.size;
return t(r, a.majorUnit, a.majorTicks, a.majorTicks.visible), a.labels.position == V ? o.radius(o.r - s, !0) : o.radius(o.ir + s), t(o, a.minorUnit, a.minorTicks, a.minorTicks.visible, a.majorUnit), i
},
arrangeLabels: function () {
var e, n, i, r, o, a, l, d, c, u, p = this,
f = p.options,
h = p.ring.clone(),
g = p.tickAngles(h, f.majorUnit),
m = p.labels,
v = m.length,
_ = f.labels,
b = _.padding,
y = .05 * h.r,
w = f.rangeSize = f.rangeSize || .1 * h.r,
x = f.ranges || [];
for (p.options.rangeDistance !== undefined ? y = p.options.rangeDistance : p.options.rangeDistance = y, _.position === V && x.length && (h.r -= w + y, h.ir -= w + y), l = 0; v > l; l++) o = m[l], e = o.box.width() / 2, n = o.box.height() / 2, r = g[l], i = r * L, u = _.position === V, a = h.point(r, u), d = a.x + t.cos(i) * (e + b) * (u ? 1 : -1), c = a.y + t.sin(i) * (n + b) * (u ? 1 : -1), o.reflow(new s(d - e, c - n, d + e, c + n)), p.box.wrap(o.box)
},
tickAngles: function (e, t) {
var n, i = this,
r = i.options,
o = r.reverse,
a = r.max - r.min,
s = e.angle,
l = e.startAngle,
d = a / t,
c = s / d,
u = [];
for (o && (l += s, c = -c), n = 0; d > n; n++) u.push(C(l, P)), l += c;
return C(l) <= r.endAngle && u.push(l), u
},
renderRanges: function (e) {
var t, n, i, r, o, a = this,
s = [],
l = a.rangeSegments(),
d = l.length,
c = a.options.reverse;
if (d)
for (r = a.getRadius(), o = 0; d > o; o++) i = l[o], t = a.slotAngle(i[c ? "to" : "from"]), n = a.slotAngle(i[c ? "from" : "to"]), 0 !== n - t && s.push(e.createRing(new u(a.ring.c, r.inner, r.outer, t, n - t), {
fill: i.color,
fillOpacity: i.opacity,
zIndex: -1
}));
return s
},
rangeSegments: function () {
function t(e, t, n) {
return {
from: e,
to: t,
color: n
}
}
var n, i, r, o, a, s = this,
l = s.options,
d = l.ranges || [],
c = d.length,
u = l.rangePlaceholderColor,
p = [],
f = l.min,
h = l.max;
if (c)
for (p.push(t(f, h, u)), o = 0; c > o; o++)
for (n = e(d[o], f, h), i = p.length, a = 0; i > a; a++)
if (r = p[a], r.from <= n.from && n.from <= r.to) {
p.push(t(n.from, n.to, n.color)), r.from <= n.to && n.to <= r.to && p.push(t(n.to, r.to, u)), r.to = n.from;
break
}
return p
},
getRadius: function () {
var e, t, n = this,
i = n.options,
r = i.rangeSize,
o = i.rangeDistance,
a = n.ring;
return i.labels.position === W ? (t = a.ir - o, e = t - r) : (t = a.r, e = t - r, a.r -= r + o, a.ir -= r + o), {
inner: e,
outer: t
}
},
getViewElements: function (e) {
var t = this,
n = l.fn.getViewElements.call(t, e);
return m(n, t.renderRanges(e)), m(n, t.renderTicks(e)), n
}
}),
Q = l.extend({
init: function (e) {
l.fn.init.call(this, e), this.render()
},
options: {
margin: {},
background: "",
border: {
color: I,
width: 0
},
minorTicks: {
align: V
}
},
reflow: function (e) {
var t, n = this,
i = n.scale,
r = n.pointer;
i.reflow(e), t = i.box.clone(), r.scale = i, r.reflow(), t.wrap(r.box), n.box = t, n.fitScale(e), n.alignScale(e)
},
alignScale: function (e) {
var t = this,
n = t.box.center(),
i = e.center(),
r = n.x - i.x,
o = n.y - i.y,
a = t.scale,
s = t.pointer;
a.ring.c.x -= r, a.ring.c.y -= o, a.reflow(e), s.reflow(), t.box = a.box.clone().wrap(s.box)
},
fitScale: function (e) {
for (var n, i, r, o, a = this, s = a.scale, l = s.ring, d = a.box, c = t.abs(a.getDiff(d, e)), u = C(c, P), p = C(-c, P), f = 0; !(!(100 > f) || (f++, u != o && (n = a.getPlotBox(u, e, l), n >= 0 && 2 >= n)) || p != o && (r = a.getPlotBox(p, e, l), r >= 0 && 2 >= r) || (o = n > 0 && r > 0 ? 2 * u : 0 > n && 0 > r ? 2 * p : C((u + p) / 2 || 1, P), i = a.getPlotBox(o, e, l), i >= 0 && 2 >= i));) i > 0 ? (p = o, r = i) : (u = o, n = i)
},
getPlotBox: function (e, t, n) {
var i = this,
r = i.scale,
o = i.pointer;
return n = n.clone(), n.r += e, n.ir += e, r.ring = n, r.reflow(t), o.scale = r, o.reflow(), i.box = r.box.clone().wrap(o.box), i.getDiff(i.box, t)
},
getDiff: function (e, n) {
return t.min(n.width() - e.width(), n.height() - e.height())
},
render: function () {
var e, t = this,
n = t.options;
e = t.scale = new Y(n.scale), t.append(t.scale), t.pointer = new $(e, r({}, n.pointer, {
animation: {
transitions: n.transitions
}
})), t.append(t.pointer)
}
}),
K = d.extend({
init: function (e) {
var t = this;
t.options = r({}, t.options, e), t.options = r({}, t.options, {
labels: {
mirror: t.options.mirror
}
}), t.options.majorUnit = t.options.majorUnit || _(t.options.min, t.options.max), a.fn.init.call(t, t.options), t.options.minorUnit = t.options.minorUnit || t.options.majorUnit / 10
},
options: {
min: 0,
max: 50,
majorTicks: {
size: 15,
align: V,
color: I,
width: O,
visible: !0
},
minorTicks: {
size: 10,
align: V,
color: I,
width: O,
visible: !0
},
line: {
width: O
},
labels: {
position: V,
padding: 2
},
mirror: !1,
_alignLines: !1
},
renderRanges: function (t) {
var n, i, r, o, a, l = this,
d = l.options,
c = d.min,
u = d.max,
p = d.ranges || [],
f = d.vertical,
h = d.labels.mirror,
g = [],
m = p.length,
v = d.rangeSize || d.minorTicks.size / 2;
if (m)
for (o = 0; m > o; o++) n = e(p[o], c, u), a = l.getSlot(n.from, n.to), i = f ? l.lineBox() : a, r = f ? a : l.lineBox(), f ? i.x1 -= v * (h ? -1 : 1) : r.y2 += v * (h ? -1 : 1), g.push(t.createRect(new s(i.x1, r.y1, i.x2, r.y2), {
fill: n.color,
fillOpacity: n.opacity
}));
return g
},
getViewElements: function (e) {
var t = this,
n = d.fn.getViewElements.call(t, e);
return m(n, t.renderRanges(e)), n
}
}),
X = G.extend({
init: function (e, t) {
var n = this;
G.fn.init.call(n, e, t), n.options = r({
size: n.pointerSize(),
track: {
visible: w(t.track)
}
}, n.options)
},
options: {
shape: D,
track: {
border: {
width: 1
}
},
color: I,
border: {
width: 1
},
opacity: 1,
margin: y(3),
animation: {
type: D
},
visible: !0
},
repaint: function () {
var e = this,
t = e.scale,
n = e.options,
i = e.element,
o = i._animation;
o && o.abort(), n.animation.transitions === !1 ? (e.getViewElements(e._view), i.points = e.element.points, i.refresh(b(n.id))) : (n.animation = r({}, n.animation, {
endPosition: t.getSlot(t.options.min, n.value),
reverse: t.options.reverse
}), o = i._animation = n.shape === A ? new g(i, n.animation) : new h(i, n.animation), o.setup(), o.play())
},
reflow: function () {
var e, t, n, i = this,
r = i.options,
o = i.scale,
a = o.lineBox(),
l = r.track.size || r.size,
d = r.size / 2,
c = o.options.mirror,
u = y(r.margin),
p = o.options.vertical,
f = p ? u[c ? "left" : "right"] : u[c ? "bottom" : "top"];
f = c ? -f : f, p ? (n = new s(a.x1 + f, a.y1, a.x1 + f, a.y2), c ? n.x1 -= l : n.x2 += l, r.shape !== D && (t = new s(a.x2 + f, a.y1 - d, a.x2 + f, a.y2 + d), e = t)) : (n = new s(a.x1, a.y1 - f, a.x2, a.y1 - f), c ? n.y2 += l : n.y1 -= l, r.shape !== D && (t = new s(a.x1 - d, a.y1 - f, a.x2 + d, a.y1 - f), e = t)), i.trackBox = n, i.pointerRangeBox = t, i.box = e || n.clone().pad(r.border.width)
},
renderPointer: function (e) {
var t, n = this,
i = n.scale,
o = n.options,
a = w(o.border) ? {
stroke: o.border.width ? o.border.color || o.color : "",
strokeWidth: o.border.width,
dashType: o.border.dashType
} : {}, s = r({
fill: o.color,
fillOpacity: o.opacity,
animation: r(o.animation, {
startPosition: i.getSlot(i.options.min, o.value),
size: o.size,
vertical: i.options.vertical,
reverse: i.options.reverse
}),
id: o.id,
zIndex: 2,
align: !1
}, a),
l = n.pointerShape(o.value);
return o.shape === A ? (s.animation.type = F, t = e.createPolyline(l, !0, s)) : t = e.createRect(l, s), t
},
pointerShape: function (e) {
var t, n, i, r = this,
o = r.options,
a = r.scale,
l = a.getSlot(e, a.options.min),
d = o.size,
c = r.pointerRangeBox,
u = a.options.vertical,
p = d / 2,
f = a.options.mirror ? -1 : 1,
h = a.options.reverse;
return o.shape == A ? u ? (n = h ? "y2" : "y1", t = [new k(c.x1, l[n] - p), new k(c.x1 - f * d, l[n]), new k(c.x1, l[n] + p)]) : (n = h ? "x1" : "x2", t = [new k(l[n] - p, c.y2), new k(l[n], c.y2 + f * d), new k(l[n] + p, c.y2)]) : (i = r.trackBox, t = u ? new s(i.x1, l.y1, i.x1 + d, l.y2) : new s(l.x1, i.y1, l.x2, i.y1 + d)), t
},
pointerSize: function () {
var e, t = this,
n = t.options,
i = t.scale,
r = i.options.majorTicks.size;
return e = n.shape === A ? .6 * r : .3 * r, C(e)
},
renderTrack: function (e) {
var t = this,
n = t.options,
i = n.track,
r = i.border || {}, o = t.trackBox.clone().pad(r.width || 0);
return e.createRect(o, {
fill: i.color,
fillOpacity: i.opacity,
stroke: r.width ? r.color || i.color : "",
strokeWidth: r.width,
dashType: r.dashType,
align: !1
})
},
getViewElements: function (e) {
var t = this,
n = t.options,
i = [];
return t.element = t.renderPointer(e), i.push(t.element), !n.track.visible || n.shape !== D && "" !== n.shape || i.push(t.renderTrack(e)), t._view = e, m(i, G.fn.getViewElements.call(t, e)), i
}
}),
J = l.extend({
init: function (e) {
l.fn.init.call(this, e), this.render()
},
options: {
plotArea: {
margin: {},
background: "",
border: {
color: I,
width: 0
}
},
pointer: {},
scale: {}
},
reflow: function (e) {
var t = this,
n = t.scale,
i = t.pointer;
n.reflow(e), i.reflow(e), t.box = t.getBox(e), t.alignElements(), t.shrinkElements()
},
shrinkElements: function () {
var e = this,
n = e.scale,
i = e.pointer,
r = n.box.clone(),
o = i.box,
a = n.options.vertical ? "y" : "x";
r[a + 1] += t.max(r[a + 1] - o[a + 1], 0), r[a + 2] -= t.max(o[a + 2] - r[a + 2], 0), n.reflow(r), i.reflow(e.box)
},
getBox: function (e) {
var t, n = this,
i = n.scale,
r = n.pointer,
o = e.center(),
a = r.box.clone().wrap(i.box);
return i.options.vertical ? (t = a.width() / 2, a = new s(o.x - t, e.y1, o.x + t, e.y2)) : (t = a.height() / 2, a = new s(e.x1, o.y - t, e.x2, o.y + t)), a
},
alignElements: function () {
var e, t = this,
n = t.scale,
i = t.pointer,
r = n.box,
o = i.box.clone().wrap(n.box),
a = t.box;
n.options.vertical ? (e = a.center().x - o.center().x, n.reflow(new s(r.x1 + e, a.y1, r.x2 + e, a.y2))) : (e = a.center().y - o.center().y, n.reflow(new s(a.x1, r.y1 + e, a.x2, r.y2 + e))), i.reflow(t.box)
},
render: function () {
var e, t = this,
n = t.options;
e = t.scale = new K(n.scale), t.append(t.scale), t.pointer = new X(e, r({}, n.pointer, {
animation: {
transitions: n.transitions
}
})), t.append(t.pointer)
},
getViewElements: function (e) {
var t = this,
n = t.options.plotArea,
i = l.fn.getViewElements.call(t, e),
r = n.border || {}, o = [e.createRect(t.box, {
fill: n.background,
stroke: r.width ? r.color : "",
strokeWidth: r.width,
dashType: r.dashType
})];
return m(o, i), o
}
}),
Z = i.extend({
init: function (e, t) {
var n, a, s, l, d = this,
c = o.ui.themes || {};
i.fn.init.call(d, e), d.wrapper = d.element, d._originalOptions = r({}, t), n = r({}, d.options, t), s = n.theme, l = c[s] || c[s.toLowerCase()], a = s && l ? l.gauge : {}, d.options = r({}, a, n), d.element.addClass("k-gauge"), d.redraw()
},
options: {
plotArea: {},
theme: "default",
pointer: {},
scale: {},
gaugeArea: {}
},
value: function (e) {
return 0 === arguments.length ? this._pointers[0].value() : (this._pointers[0].value(e), undefined)
},
redraw: function () {
var e, t = this,
n = t.element,
i = t._model = t._getModel(),
r = o.ui.defaultView();
t._plotArea = i._plotArea, r && (e = t._view = r.fromModel(i), n.css("position", "relative"), t._viewElement = e.renderTo(n[0]))
},
svg: function () {
var e = this._getModel(),
t = o.SVGView.fromModel(e);
return t.render()
},
_createModel: function () {
var e = this,
t = e.options,
n = e._getSize();
return new p(r({
width: n.width,
height: n.height,
transitions: t.transitions
}, t.gaugeArea))
},
_getSize: function () {
var e = this,
t = e.element,
n = t.width(),
i = t.height();
return n || (n = M), i || (i = R), {
width: n,
height: i
}
}
}),
et = Z.extend({
init: function (e, t) {
var i = this;
Z.fn.init.call(i, e, t), n.notify(i, o.ui)
},
options: {
name: "RadialGauge",
transitions: !0,
gaugeArea: {
background: ""
}
},
_getModel: function () {
var e, t = this,
n = t.options,
i = t._createModel();
return e = i._plotArea = new Q(n), t._pointers = [e.pointer], i.append(e), i.reflow(), i
}
}),
tt = Z.extend({
init: function (e, t) {
var i = this;
Z.fn.init.call(i, e, t), n.notify(i, o.ui)
},
options: {
name: "LinearGauge",
transitions: !0,
gaugeArea: {
background: ""
},
scale: {
vertical: !0
}
},
_getModel: function () {
var e, t = this,
n = t.options,
i = t._createModel();
return e = i._plotArea = new J(n), t._pointers = [e.pointer], i.append(e), i.reflow(), i
},
_getSize: function () {
var e = this,
t = e.element,
n = t.width(),
i = t.height(),
r = e.options.scale.vertical;
return n || (n = r ? N : M), i || (i = r ? R : B), {
width: n,
height: i
}
}
}),
nt = v(j, f),
it = v(F, g),
rt = v(D, h);
o.ui.plugin(et), o.ui.plugin(tt), r(o, {
Gauge: Z,
RadialGaugePlotArea: Q,
LinearGaugePlotArea: J,
RadialPointer: $,
LinearPointer: X,
LinearScale: K,
RadialScale: Y,
RadialPointerAnimationDecorator: nt,
ArrowPointerAnimationDecorator: it,
BarIndicatorAnimationDecorator: rt
})
}(window.kendo.jQuery),
function (e) {
function t() {}
function n(e) {
return t.prototype = e, new t
}
var i, r = window.kendo,
o = r.Class,
a = r.Observable,
s = r.deepExtend,
l = Math,
d = e.proxy,
c = r.dataviz,
u = r.template,
p = c.defined,
f = c.ui.Chart,
h = c.Selection,
g = c.addDuration,
m = c.duration,
v = c.last,
_ = c.lteDateIndex,
b = c.renderTemplate,
y = c.toDate,
w = c.toTime,
x = 28,
k = "change",
C = "k-",
T = "drag",
S = "dragEnd",
A = "_navigator",
F = A,
D = 3,
I = "zoom",
E = "zoomEnd",
P = f.extend({
init: function (t, n) {
e(t).addClass(C + "chart"), f.fn.init.call(this, t, n)
},
_applyDefaults: function (e, t) {
var n = this,
i = n.element.width() || c.DEFAULT_WIDTH,
r = {
axisDefaults: {
categoryAxis: {
name: "default",
field: e.dateField,
majorGridLines: {
visible: !1
},
labels: {
step: 2
},
majorTicks: {
visible: !1
},
maxDateGroups: l.floor(i / x)
}
}
};
t && (t = s({}, t, r)), n._navigator || z.setup(e, t), f.fn._applyDefaults.call(n, e, t)
},
_initDataSource: function (e) {
var t, n, i = e || {}, r = i.dataSource,
o = r && r.serverFiltering,
a = [].concat(i.categoryAxis)[0],
l = i.navigator || {}, d = l.select,
u = d && d.from && d.to;
o && u && (t = [].concat(r.filter || []), n = new c.DateCategoryAxis(s({
baseUnit: "fit"
}, a, {
categories: [d.from, d.to]
})), r.filter = z.buildFilter(n.options.min, d.to).concat(t)), f.fn._initDataSource.call(this, e)
},
options: {
name: "StockChart",
dateField: "date",
axisDefaults: {
categoryAxis: {
type: "date",
baseUnit: "fit",
justified: !0
},
valueAxis: {
narrowRange: !0,
labels: {
format: "C"
}
}
},
navigator: {
select: {},
seriesDefaults: {
markers: {
visible: !1
},
tooltip: {
visible: !0,
template: "#= kendo.toString(category, 'd') #"
},
line: {
width: 2
}
},
hint: {},
visible: !0
},
tooltip: {
visible: !0
},
legend: {
visible: !1
}
},
_redraw: function () {
var e = this,
t = e._navigator;
t && t.dataSource ? t.redrawSlaves() : (t || (t = e._navigator = new z(e)), t.filterAxes(), f.fn._redraw.call(e), t.redraw())
},
_onDataChanged: function () {
var e = this;
f.fn._onDataChanged.call(e), e._dataBound = !0
},
_trackSharedTooltip: function (e) {
var t = this,
n = t._plotArea,
i = n.paneByPoint(e);
i && i.options.name === A ? t._unsetActivePoint() : f.fn._trackSharedTooltip.call(t, e)
},
destroy: function () {
var e = this;
e._navigator.destroy(), f.fn.destroy.call(e)
}
}),
z = a.extend({
init: function (e) {
var t = this;
t.chart = e, t.options = s({}, t.options, e.options.navigator), t._initDataSource(), p(t.options.hint.visible) || (t.options.hint.visible = t.options.visible), e.bind(T, d(t._drag, t)), e.bind(S, d(t._dragEnd, t)), e.bind(I, d(t._zoom, t)), e.bind(E, d(t._zoomEnd, t))
},
options: {},
_initDataSource: function () {
var e = this,
t = e.options,
n = t.autoBind,
i = t.dataSource;
p(n) || (n = e.chart.options.autoBind), e._dataChangedHandler = d(e._onDataChanged, e), i && (e.dataSource = r.data.DataSource.create(i).bind(k, e._dataChangedHandler), n && e.dataSource.fetch())
},
_onDataChanged: function () {
var e, t, n, i, r = this,
o = r.chart,
a = o.options.series,
s = a.length,
l = o.options.categoryAxis,
d = l.length,
c = r.dataSource.view();
for (e = 0; s > e; e++) n = a[e], n.axis == F && o._isBindable(n) && (n.data = c);
for (t = 0; d > t; t++) i = l[t], i.pane == A && o._bindCategoryAxis(i, c);
o._model && (r.redraw(), r.filterAxes(), (!o.options.dataSource || o.options.dataSource && o._dataBound) && r.redrawSlaves())
},
destroy: function () {
var e = this,
t = e.dataSource;
t && t.unbind(k, e._dataChangeHandler), e.selection && e.selection.destroy()
},
redraw: function () {
this._redrawSelf();
var t = this,
r = t.chart,
o = t.options,
a = t.mainAxis(),
s = n(a),
l = a.options.categories,
d = t.options.select || {}, c = t.selection,
u = l[0],
p = v(l),
f = d.from || u,
g = d.to || p;
l.length > 0 && (c && (c.destroy(), c.wrapper.remove()), s.box = a.box, c = t.selection = new h(r, s, {
min: u,
max: p,
from: f,
to: g,
selectStart: e.proxy(t._selectStart, t),
select: e.proxy(t._select, t),
selectEnd: e.proxy(t._selectEnd, t),
mousewheel: {
zoom: "left"
}
}), o.hint.visible && (t.hint = new i(r.element, {
min: l[0],
max: v(l),
template: o.hint.template,
format: o.hint.format
})))
},
_redrawSelf: function (e) {
var t = this.chart._plotArea;
t && t.redraw(v(t.panes), e)
},
redrawSlaves: function () {
var e = this,
t = e.chart,
n = t._plotArea,
i = n.panes.slice(0, -1);
n.srcSeries = t.options.series, n.redraw(i)
},
_drag: function (e) {
var t, n, i = this,
r = i.chart,
o = r._eventCoordinates(e.originalEvent),
a = i.mainAxis(),
s = a.pane.box.containsPoint(o),
d = a.options.categories,
u = r._plotArea.categoryAxis,
p = u.options.baseUnit,
f = e.axisRanges[u.options.name],
h = i.selection,
v = m(u.options.min, u.options.max, u.options.baseUnit);
f && !s && (t = y(l.min(l.max(d[0], f.min), g(c.last(d), -v, p))), n = y(l.min(g(t, v, p), c.last(d))), i.options.select = {
from: t,
to: n
}, i._liveDrag() && (i.filterAxes(), i.redrawSlaves()), h.set(t, g(t, v + 1, p)), i.showHint(t, n))
},
_dragEnd: function () {
var e = this;
e.filterAxes(), e.filterDataSource(), e.redrawSlaves(), e.hint && e.hint.hide()
},
_liveDrag: function () {
var e = r.support,
t = e.touch,
n = e.browser,
i = n.mozilla,
o = n.msie && 9 > n.version;
return !t && !i && !o
},
readSelection: function () {
var e = this,
t = e.selection,
n = t.options,
i = e.options.select;
i.from = n.from, i.to = n.to
},
filterAxes: function () {
var e, t, n, i, r, o = this,
a = o.options.select || {}, s = o.chart,
l = s.options.categoryAxis,
d = a.from,
c = a.to;
for (i = 0; l.length > i; i++)
if (r = l[i], r.name === F && (e = r.categories, e && e.length > 0)) {
t = w(e[0]), n = w(v(e)), d = w(d), (t > d || d > n) && (d = t), c = w(c), (t > c || c > n) && (c = n);
break
}
for (i = 0; l.length > i; i++) r = l[i], r.pane !== A && (r.min = y(d), r.max = y(c))
},
filterDataSource: function () {
var e, t = this,
n = t.options.select || {}, i = t.chart,
r = i.dataSource,
o = r && r.options.serverFiltering;
t.dataSource && o && (e = new c.DateCategoryAxis(s({
baseUnit: "fit"
}, i.options.categoryAxis[0], {
categories: [n.from, n.to]
})).options, r.filter(z.buildFilter(g(e.min, -e.baseUnitStep, e.baseUnit), g(e.max, e.baseUnitStep, e.baseUnit))))
},
_zoom: function (e) {
var t = this,
n = t.chart,
i = e.delta,
o = n._plotArea.categoryAxis,
a = t.options.select,
s = t.selection,
d = t.mainAxis().options.categories,
c = _(d, s.options.from),
u = _(d, s.options.to);
e.originalEvent.preventDefault(), l.abs(i) > 1 && (i *= D), u - c > 1 ? (s.expand(i), t.readSelection()) : (o.options.min = a.from, a.from = o.scaleRange(-e.delta).min), r.support.touch || (t.filterAxes(), t.redrawSlaves()), s.set(a.from, a.to), t.showHint(t.options.select.from, t.options.select.to)
},
_zoomEnd: function (e) {
this._dragEnd(e)
},
showHint: function (e, t) {
var n = this,
i = n.chart,
r = i._plotArea;
n.hint && n.hint.show(e, t, r.backgroundBox())
},
_selectStart: function (e) {
var t = this.chart;
t._selectStart.call(t, e)
},
_select: function (e) {
var t = this,
n = t.chart;
t.showHint(e.from, e.to), n._select.call(n, e)
},
_selectEnd: function (e) {
var t = this,
n = t.chart;
t.hint && t.hint.hide(), t.readSelection(), t.filterAxes(), t.filterDataSource(), t.redrawSlaves(), n._selectEnd.call(n, e)
},
mainAxis: function () {
var e = this.chart._plotArea;
return e ? e.namedCategoryAxes[F] : undefined
}
});
z.setup = function (e, t) {
e = e || {}, t = t || {};
var n = s({}, t.navigator, e.navigator),
i = e.panes = [].concat(e.panes),
r = s({}, n.pane, {
name: A
});
n.visible || (r.visible = !1, r.height = .1), i.push(r), z.attachAxes(e, n), z.attachSeries(e, n, t)
}, z.attachAxes = function (e, t) {
var n = e.categoryAxis = [].concat(e.categoryAxis),
i = e.valueAxis = [].concat(e.valueAxis),
r = s({
type: "date",
pane: A,
field: t.dateField,
roundToBaseUnit: !1,
justified: !0,
tooltip: {
visible: !1
},
labels: {
step: 1
},
autoBind: !t.dataSource,
autoBaseUnitSteps: {
minutes: [1],
hours: [1],
days: [1],
weeks: [],
months: [1],
years: [1]
},
_overlap: !1
}, t.categoryAxis);
n.push(s({}, r, {
name: F,
baseUnit: "fit",
maxDateGroups: 200,
baseUnitStep: "auto",
labels: {
visible: !1
},
majorTicks: {
visible: !1
}
}), s({}, r, {
name: F + "_labels",
maxDateGroups: 20,
baseUnitStep: "auto",
autoBaseUnitSteps: {
minutes: []
},
majorTicks: {
visible: !0
}
}), s({}, r, {
name: F + "_ticks",
maxDateGroups: 200,
majorTicks: {
visible: !0,
width: .5
},
labels: {
visible: !1,
mirror: !0
}
})), i.push({
name: F,
pane: A,
majorGridLines: {
visible: !1
},
visible: !1
})
}, z.attachSeries = function (e, t, n) {
var i, r = e.series = e.series || [],
o = [].concat(t.series),
a = n.seriesColors,
l = t.seriesDefaults;
for (i = 0; o.length > i; i++) r.push(s({
color: a[i % a.length],
visibleInLegend: !1,
tooltip: {
visible: !1
}
}, l, o[i], {
axis: F,
categoryAxis: F,
autoBind: !t.dataSource
}))
}, z.buildFilter = function (e, t) {
return [{
field: "Date",
operator: "gte",
value: y(e)
}, {
field: "Date",
operator: "lt",
value: y(t)
}]
}, i = o.extend({
init: function (t, n) {
var i = this;
i.options = s({}, i.options, n), i.container = t, i.chartPadding = {
top: parseInt(t.css("paddingTop"), 10),
left: parseInt(t.css("paddingLeft"), 10)
}, i.template = i.template, i.template || (i.template = i.template = b("
" + "
" + "" + "
")), i.element = e(i.template()).appendTo(t)
},
options: {
format: "{0:d} - {1:d}",
hideDelay: 500
},
show: function (e, t, n) {
var i, o = this,
a = y(w(e) + w(t - e) / 2),
s = o.options,
l = r.format(o.options.format, e, t),
d = o.element.find("." + C + "tooltip"),
c = o.element.find("." + C + "scroll"),
p = .4 * n.width(),
f = n.center().x - p,
h = n.center().x,
g = h - f,
m = s.max - s.min,
v = g / m,
_ = a - s.min;
o._hideTimeout && clearTimeout(o._hideTimeout), o._visible || (o.element.stop(!1, !0).css("visibility", "hidden").show(), o._visible = !0), s.template && (i = u(s.template), l = i({
from: e,
to: t
})), d.text(l).css({
left: n.center().x - d.outerWidth() / 2,
top: n.y1
}), c.css({
width: p,
left: f + _ * v,
top: n.y1 + parseInt(d.css("margin-top"), 10) + parseInt(d.css("border-top-width"), 10) + d.height() / 2
}), o.element.css("visibility", "visible")
},
hide: function () {
var e = this;
e._hideTimeout && clearTimeout(e._hideTimeout), e._hideTimeout = setTimeout(function () {
e._visible = !1, e.element.fadeOut("slow")
}, e.options.hideDelay)
}
}), c.ui.plugin(P), s(c, {
Navigator: z
})
}(window.kendo.jQuery),
function (e) {
function t(e) {
return "number" == typeof e ? [e] : e
}
var n = window.kendo,
i = n.dataviz,
r = i.ui.Chart,
o = n.data.ObservableArray,
a = i.SharedTooltip,
s = n.deepExtend,
l = e.isArray,
d = i.inArray,
c = Math,
u = "k-",
p = 150,
f = 150,
h = "bar",
g = "bullet",
m = "pie",
v = [h, g],
_ = r.extend({
init: function (n, i) {
var a = this,
p = a.stage = e(""),
f = i || {};
n = e(n).addClass(u + "sparkline").empty().append(p), a._initialWidth = c.floor(n.width()), f = t(f), (l(f) || f instanceof o) && (f = {
seriesDefaults: {
data: f
}
}), f.series || (f.series = [{
data: t(f.data)
}]), s(f, {
seriesDefaults: {
type: f.type
}
}), (d(f.series[0].type, v) || d(f.seriesDefaults.type, v)) && (f = s({}, {
categoryAxis: {
crosshair: {
visible: !1
}
}
}, f)), r.fn.init.call(a, n, f)
},
options: {
name: "Sparkline",
chartArea: {
margin: 2
},
axisDefaults: {
visible: !1,
majorGridLines: {
visible: !1
},
valueAxis: {
narrowRange: !0
}
},
seriesDefaults: {
type: "line",
area: {
line: {
width: .5
}
},
bar: {
stack: !0
},
width: .5,
overlay: {
gradient: null
},
highlight: {
visible: !1
},
border: {
width: 0
},
markers: {
size: 2,
visible: !1
}
},
tooltip: {
visible: !0,
shared: !0
},
categoryAxis: {
crosshair: {
visible: !0,
tooltip: {
visible: !1
}
}
},
legend: {
visible: !1
},
transitions: !1,
pointWidth: 5
},
_modelOptions: function () {
var e, t = this,
n = t.options,
i = t._initialWidth,
r = t.stage;
return t.stage[0].innerHTML = " ", e = s({
width: i ? i : t._autoWidth(),
height: r.height(),
transitions: n.transitions
}, n.chartArea, {
inline: !0,
align: !1
}), r.css({
width: e.width,
height: e.height
}), e
},
_createTooltip: function () {
var e, t = this,
n = t.options,
i = t.element;
return e = t._sharedTooltip() ? new b(i, t._plotArea, n.tooltip) : r.fn._createTooltip.call(t)
},
_renderView: function () {
var e = this;
return e.element.empty().append(e.stage), e._view.renderTo(e.stage[0])
},
_autoWidth: function () {
var e, t, n, r = this,
o = r.options,
a = i.getSpacing(o.chartArea.margin),
s = o.series,
l = r.dataSource.total(),
d = 0;
for (t = 0; s.length > t; t++) {
if (n = s[t], n.type === h) return p;
if (n.type === g) return f;
if (n.type === m) return r.stage.height();
n.data && (d = c.max(d, n.data.length))
}
return e = c.max(l, d) * o.pointWidth, e > 0 && (e += a.left + a.right), e
}
}),
b = a.extend({
options: {
animation: {
duration: 0
}
},
_anchor: function (e, t) {
var n = a.fn._anchor.call(this, e, t);
return n.y = -this.element.height() - this.options.offset, n
},
_hideElement: function () {
this.element.hide()
}
});
i.ui.plugin(_), s(i, {})
}(window.kendo.jQuery),
function () {
function e(e) {
this.view = e
}
function t(e) {
this.view = e
}
function n(e) {
return w.round(e) + .5
}
function i(e, t) {
var n, i, r = [];
if (e = e ? e.toLowerCase() : null, e && e != j) {
for (n = $[e], i = 0; n.length > i; i++) r.push(n[i] * (t || 1));
return "stroke-dasharray='" + r.join(" ") + "' "
}
return ""
}
var r, o, a, s, l, d, c, u, p, f, h, g, m, v, _, b = jQuery,
y = document,
w = Math,
x = window.kendo,
k = x.Class,
C = x.dataviz,
T = C.Box2D,
S = C.ExpandAnimation,
A = C.Point2D,
F = C.ViewBase,
D = C.ViewElement,
I = x.deepExtend,
E = C.defined,
P = C.round,
z = C.renderTemplate,
H = C.rotatePoint,
R = C.uniqueId,
O = "butt",
M = C.CLIP,
N = C.COORD_PRECISION,
B = C.DEFAULT_WIDTH,
L = C.DEFAULT_HEIGHT,
V = C.DEFAULT_FONT,
U = "none",
W = "radial",
j = "solid",
q = "square",
G = "http://www.w3.org/2000/svg",
$ = {
dot: [1.5, 3.5],
dash: [4, 3.5],
longdash: [8, 3.5],
dashdot: [3.5, 3.5, 1.5, 3.5],
longdashdot: [8, 3.5, 1.5, 3.5],
longdashdotdot: [8, 3.5, 1.5, 3.5, 1.5, 3.5]
}, Y = "transparent",
Q = "undefined",
K = F.extend({
init: function (n) {
var i = this;
F.fn.init.call(i, n), i.decorators.push(new e(i), new t(i)), C.ui.Chart && i.decorators.push(new C.BarAnimationDecorator(i), new C.PieAnimationDecorator(i), new C.BubbleAnimationDecorator(i)), i.decorators.push(new v(i), new C.FadeAnimationDecorator(i)), C.Gauge && i.decorators.push(new C.RadialPointerAnimationDecorator(i), new C.ArrowPointerAnimationDecorator(i), new C.BarIndicatorAnimationDecorator(i)), i.defsId = R(), i.template = K.template, i.display = i.options.inline ? "inline" : "block", i.template || (i.template = K.template = z(""))
},
options: {
width: B,
height: L
},
renderTo: function (e) {
var t, n = this;
return n.setupAnimations(), C.renderSVG(e, n.render()), t = e.firstElementChild, n.alignToScreen(t), n.playAnimations(), t
},
renderDefinitions: function () {
var e = this,
t = e.defsId,
n = F.fn.renderDefinitions.call(e);
return "" + n + ""
},
renderElement: function (e) {
var t, n, i = this,
r = y.createElement("div"),
o = y.getElementById(i.defsId);
return C.renderSVG(r, ""), t = r.firstElementChild.firstChild, n = r.firstElementChild.lastChild, o && o.textContent !== t.textContent && o.parentNode.replaceChild(t, o), n
},
createGroup: function (e) {
return this.decorate(new u(e))
},
createText: function (e, t) {
return this.decorate(new r(e, t))
},
createRect: function (e, t) {
return this.decorate(new a(e.points(), !0, this.setDefaults(t)))
},
createLine: function (e, t, n, i, r) {
return this.decorate(new a([new A(e, t), new A(n, i)], !1, this.setDefaults(r)))
},
createPolyline: function (e, t, n) {
return this.decorate(new a(e, t, this.setDefaults(n)))
},
createCircle: function (e, t, n) {
return this.decorate(new c(e, t, n))
},
createSector: function (e, t) {
return this.decorate(new d(e, t))
},
createRing: function (e, t) {
return this.decorate(new s(e, t))
},
createPin: function (e, t) {
return this.decorate(new l(e, t))
},
createGradient: function (e) {
return e.type === W ? E(e.ir) ? new m(e) : new g(e) : new h(e)
},
alignToScreen: function (e) {
var t, n, i, r;
try {
t = e.getScreenCTM ? e.getScreenCTM() : null
} catch (o) {}
t && (n = -t.e % 1, i = -t.f % 1, r = e.style, (0 !== n || 0 !== i) && (r.left = n + "px", r.top = i + "px"))
}
});
K.fromModel = function (e) {
var t = new K(e.options);
return [].push.apply(t.children, e.getViewElements(t)), t
}, K.available = C.supportsSVG, K.preference = 100, C.ui.registerView(K), r = D.extend({
init: function (e, t) {
var n = this;
D.fn.init.call(n, t), n.content = e, n.template = r.template, n.template || (n.template = r.template = z("#= d.content #"))
},
options: {
x: 0,
y: 0,
baseline: 0,
font: V,
size: {
width: 0,
height: 0
},
fillOpacity: 1,
cursor: {}
},
refresh: function (e) {
var t = this.options;
b(e).attr({
"fill-opacity": t.fillOpacity
})
},
clone: function () {
var e = this;
return new r(e.content, I({}, e.options))
},
renderCursor: function () {
var e = this.options,
t = "";
return E(e.cursor.style) && (t += "cursor: " + e.cursor.style + ";"), t
},
renderRotation: function () {
var e = this,
t = e.options,
n = t.size,
i = P(t.x + n.normalWidth / 2, N),
r = P(t.y + n.normalHeight / 2, N),
o = P(t.x + n.width / 2, N),
a = P(t.y + n.height / 2, N),
s = P(o - i, N),
l = P(a - r, N);
return "transform='translate(" + s + "," + l + ") " + "rotate(" + t.rotation + "," + i + "," + r + ")'"
}
}), o = D.extend({
init: function (e) {
var t = this;
D.fn.init.call(t, e), t.template = o.template, t.template || (t.template = o.template = z(""))
},
options: {
fill: "",
fillOpacity: 1,
strokeOpacity: 1,
rotation: [0, 0, 0],
strokeLineCap: q,
visible: !0,
cursor: {}
},
refresh: function (e) {
var t = this.options;
b(e).attr({
d: this.renderPoints(),
"fill-opacity": t.fillOpacity,
"stroke-opacity": t.strokeOpacity
}).css("display", this.renderDisplay())
},
clone: function () {
return new o(I({}, this.options))
},
renderPoints: function () {},
renderCursor: function () {
var e = this.options,
t = "";
return E(e.cursor.style) && (t += "cursor: " + e.cursor.style + ";"), t
},
renderDashType: function () {
var e = this,
t = e.options;
return i(t.dashType, t.strokeWidth)
},
renderLinecap: function () {
var e = this.options,
t = e.dashType,
n = e.strokeLineCap;
return t && t != j ? O : n
},
renderFill: function () {
var e = this.options.fill;
return e && e !== Y ? e : U
},
renderDisplay: function () {
return this.options.visible ? "block" : "none"
},
destroy: function () {}
}), a = o.extend({
init: function (e, t, n) {
var i = this;
o.fn.init.call(i, n), i.points = e, i.closed = t
},
renderPoints: function () {
var e, t = this,
n = t.points,
i = n.length,
r = function (e) {
var n = t.options.rotation;
return H(e.x, e.y, n[1], n[2], -n[0])
}, o = "M" + t._print(r(n[0]));
for (e = 1; i > e; e++) o += " " + t._print(r(n[e]));
return t.closed && (o += " z"), o
},
clone: function () {
var e = this;
return new a(I([], e.points), e.closed, I({}, e.options))
},
_print: function (e) {
var t = this,
i = t.options,
r = i.strokeWidth,
o = i.align !== !1 && r && 0 !== r % 2,
a = o ? n : P;
return a(e.x, N) + " " + a(e.y, N)
}
}), s = o.extend({
init: function (e, t) {
var n = this;
o.fn.init.call(n, t), n.pathTemplate = s.pathTemplate, n.pathTemplate || (n.pathTemplate = s.pathTemplate = z("M #= d.firstOuterPoint.x # #= d.firstOuterPoint.y # A#= d.r # #= d.r # 0 #= d.isReflexAngle ? '1' : '0' #,1 #= d.secondOuterPoint.x # #= d.secondOuterPoint.y # L #= d.secondInnerPoint.x # #= d.secondInnerPoint.y # A#= d.ir # #= d.ir # 0 #= d.isReflexAngle ? '1' : '0' #,0 #= d.firstInnerPoint.x # #= d.firstInnerPoint.y # z")), n.config = e || {}
},
renderPoints: function () {
var e, t, n = this,
i = n.config,
r = i.startAngle,
o = i.angle + r,
a = o - r > 180,
s = w.max(i.r, 0),
l = w.max(i.ir, 0),
d = i.c,
c = i.point(r),
u = i.point(r, !0);
return P(r) % 360 === P(o) % 360 && (o -= .05), e = i.point(o), t = i.point(o, !0), n.pathTemplate({
firstOuterPoint: c,
secondOuterPoint: e,
isReflexAngle: a,
r: s,
ir: l,
cx: d.x,
cy: d.y,
firstInnerPoint: u,
secondInnerPoint: t
})
},
clone: function () {
var e = this;
return new s(I({}, e.config), I({}, e.options))
}
}), l = o.extend({
init: function (e, t) {
var n = this;
o.fn.init.call(n, t), n.pathTemplate = l.pathTemplate, n.pathTemplate || (n.pathTemplate = l.pathTemplate = z("M #= d.origin.x # #= d.origin.y # #= d.as.x # #= d.as.y # A#= d.r # #= d.r # 0 #= d.isReflexAngle ? '1' : '0' #,0 #= d.ae.x # #= d.ae.y # z")), n.config = e || new C.Pin
},
renderPoints: function () {
var e = this,
t = e.config,
n = t.radius,
i = w.PI / 180,
r = t.arcAngle,
o = n * w.sin(r * i / 2),
a = t.height - n * (1 - w.cos(r * i / 2)),
s = t.origin,
l = {
x: s.x + o,
y: s.y - a
}, d = {
x: s.x - o,
y: s.y - a
}, c = function (n, i) {
var r = e.options.rotation,
o = t.rotation;
return n = H(n.x, n.y, r[1], r[2], -r[0]), i && (n = H(n.x, n.y, s.x, s.y, o)), n
};
return s = c(s), e.pathTemplate({
origin: s,
as: c(l, !0),
ae: c(d, !0),
r: n,
isReflexAngle: r > 180
})
}
}), d = s.extend({
init: function (e, t) {
var n = this;
s.fn.init.call(n, e, t), n.pathTemplate = d.pathTemplate, n.pathTemplate || (n.pathTemplate = d.pathTemplate = z("M #= d.firstOuterPoint.x # #= d.firstOuterPoint.y # A#= d.r # #= d.r # 0 #= d.isReflexAngle ? '1' : '0' #,1 #= d.secondOuterPoint.x # #= d.secondOuterPoint.y # L #= d.cx # #= d.cy # z"))
},
options: {
fill: "",
fillOpacity: 1,
strokeOpacity: 1,
strokeLineCap: q
},
clone: function () {
var e = this;
return new d(I({}, e.config), I({}, e.options))
}
}), c = D.extend({
init: function (e, t, n) {
var i = this;
D.fn.init.call(i, n), i.c = e, i.r = t, i.template = c.template, i.template || (i.template = c.template = z(""))
},
options: {
fill: "",
fillOpacity: 1,
strokeOpacity: 1
},
refresh: function (e) {
b(e).attr({
r: w.max(0, this.r),
"fill-opacity": this.options.fillOpacity
})
},
clone: function () {
var e = this;
return new c(I({}, e.c), e.r, I({}, e.options))
}
}), u = D.extend({
init: function (e) {
var t = this;
D.fn.init.call(t, e), t.template = u.template, t.template || (t.template = u.template = z('#= d.renderContent() #'))
}
}), p = D.extend({
init: function (e) {
var t = this;
D.fn.init.call(t, e), t.template = p.template, t.template || (t.template = p.template = z('#= d.renderContent() #'))
}
}), f = D.extend({
init: function (e) {
var t = this;
D.fn.init.call(t, e)
},
options: {
id: ""
},
renderStops: function () {
var e, t, n = this,
i = n.options.stops,
r = n.stopTemplate,
o = i.length,
a = "";
for (e = 0; o > e; e++) t = i[e], a += r(t);
return a
}
}), h = f.extend({
init: function (e) {
var t = this;
f.fn.init.call(t, e), t.template = h.template, t.stopTemplate = h.stopTemplate, t.template || (t.template = h.template = z(" #= d.renderStops() #"), t.stopTemplate = h.stopTemplate = z(""))
},
options: {
rotation: 0
}
}), g = f.extend({
init: function (e) {
var t = this;
f.fn.init.call(t, e), t.template = g.template, t.stopTemplate = g.stopTemplate, t.template || (t.template = g.template = z("#= d.renderStops() #"), t.stopTemplate = g.stopTemplate = z(""))
}
}), m = D.extend({
init: function (e) {
var t = this;
D.fn.init.call(t, e), t.template = m.template, t.stopTemplate = m.stopTemplate, t.template || (t.template = m.template = z("#= d.renderStops() #"), t.stopTemplate = m.stopTemplate = z(""))
},
options: {
id: ""
},
renderStops: function () {
var e, t, n = this,
i = n.options,
r = i.stops,
o = n.stopTemplate,
a = 100 * (i.ir / i.r),
s = r.length,
l = "";
for (t = I({}, r[0]), t.offset = a, l += o(t), e = 1; s > e; e++) t = I({}, r[e]), t.offset = t.offset * (100 - a) + a, l += o(t);
return l
}
}), e.prototype = {
decorate: function (e) {
var t, n, i = this,
r = i.view,
o = e.options,
a = o.id;
return o.overlay ? (e.options.id = R(), t = r.createGroup(), n = e.clone(), t.children.push(e, n), n.options.id = a, n.options.fill = o.overlay, t) : e
}
}, t.prototype = {
decorate: function (e) {
var t = this,
n = e.options;
return n.fill = t.getPaint(n.fill), e
},
getPaint: function (e) {
var t, n, i, r = this,
o = r.view,
a = o.definitions;
return e && E(e.gradient) ? (t = o.buildGradient(e), t ? (n = t.id, i = a[n], i || (i = o.createGradient(t), a[n] = i), "url(" + r.baseUrl() + "#" + i.options.id + ")") : U) : e
},
baseUrl: function () {
var e = y.getElementsByTagName("base")[0],
t = "",
n = y.location.href,
i = n.indexOf("#");
return e && !x.support.browser.msie && (-1 !== i && (n = n.substring(0, i)), t = n), t
}
}, v = k.extend({
init: function (e) {
this.view = e
},
decorate: function (e) {
var t, n, i = this,
r = i.view,
o = i.clipId,
a = r.options,
s = e.options.animation,
l = r.definitions;
return s && s.type === M && a.transitions && (o || (i.clipId = o = R()), t = l[o], t || (t = new p({
id: o
}), n = r.createRect(new T(0, 0, a.width, a.height), {
id: R()
}), t.children.push(n), l[o] = t, r.animations.push(new S(n, {
size: a.width
}))), e.options.clipPath = "url(#" + o + ")"), e
}
}), _ = function (e, t) {
e.innerHTML = t
},
function () {
var e = "",
t = y.createElement("div"),
n = typeof DOMParser != Q;
t.innerHTML = e, n && t.firstChild.namespaceURI != G && (_ = function (e, t) {
var n = new DOMParser,
i = n.parseFromString(t, "text/xml"),
r = y.adoptNode(i.documentElement);
e.innerHTML = "", e.appendChild(r)
})
}(), I(C, {
renderSVG: _,
SVGCircle: c,
SVGClipAnimationDecorator: v,
SVGClipPath: p,
SVGGradientDecorator: t,
SVGGroup: u,
SVGLine: a,
SVGLinearGradient: h,
SVGOverlayDecorator: e,
SVGPath: o,
SVGRadialGradient: g,
SVGDonutGradient: m,
SVGRing: s,
SVGSector: d,
SVGText: r,
SVGView: K
})
}(window.kendo.jQuery),
function () {
function e(e) {
this.view = e
}
function t(e) {
this.view = e
}
function n() {
return C.support.browser.msie && !B() && window.performance !== void 0
}
function i(e, t, n) {
var i = new F(e),
o = new F(t),
a = r(i.r, o.r, n),
s = r(i.g, o.g, n),
l = r(i.b, o.b, n);
return new F(a, s, l).toHex()
}
function r(e, t, n) {
return k.round(n * t + (1 - n) * e)
}
function o(e, t) {
var n, r, o, a = t.stops,
s = a.length,
l = S({}, t);
for (l.stops = [], n = 0; s > n; n++) r = a[n], o = l.stops[n] = S({}, a[n]), o.color = i(e, r.color, r.opacity), o.opacity = 0;
return l
}
var a, s, l, d, c, u, p, f, h, g, m, v, _, b, y, w = jQuery,
x = document,
k = Math,
C = window.kendo,
T = C.Class,
S = C.deepExtend,
A = C.dataviz,
F = A.Color,
D = A.Box2D,
I = A.Point2D,
E = A.ExpandAnimation,
P = A.ViewBase,
z = A.ViewElement,
H = A.defined,
R = A.renderTemplate,
O = A.uniqueId,
M = A.rotatePoint,
N = A.round,
B = A.supportsSVG,
L = "#000",
V = A.CLIP,
U = A.COORD_PRECISION,
W = A.DEFAULT_WIDTH,
j = A.DEFAULT_HEIGHT,
q = A.DEFAULT_FONT,
G = "object",
$ = "linear",
Y = "radial",
Q = "transparent",
K = P.extend({
init: function (i) {
var r = this;
P.fn.init.call(r, i), r.decorators.push(new e(r), new t(r)), A.ui.Chart && r.decorators.push(new A.BarAnimationDecorator(r), new A.PieAnimationDecorator(r), new A.BubbleAnimationDecorator(r)), r.decorators.push(new y(r)), n() || r.decorators.push(new A.FadeAnimationDecorator(r)), A.Gauge && r.decorators.push(new A.RadialPointerAnimationDecorator(r), new A.ArrowPointerAnimationDecorator(r), new A.BarIndicatorAnimationDecorator(r)), r.template = K.template, r.tagName = r.options.inline ? "span" : "div", r.template || (r.template = K.template = R("<#= d.tagName # style='width:#= d.options.width #px; height:#= d.options.height #px; position: relative;'>#= d.renderContent() ##= d.tagName #>"))
},
options: {
width: W,
height: j
},
renderTo: function (e) {
var t = this;
return x.namespaces && x.namespaces.add("kvml", "urn:schemas-microsoft-com:vml", "#default#VML"), t.setupAnimations(), e.innerHTML = t.render(), t.playAnimations(), e.firstChild
},
renderElement: function (e) {
var t, n = x.createElement("div");
return n.style.display = "none", x.body.appendChild(n), n.innerHTML = e.render(), t = n.firstChild, x.body.removeChild(n), t
},
createText: function (e, t) {
return this.decorate(t && t.rotation ? new s(e, t) : new a(e, t))
},
createRect: function (e, t) {
return this.decorate(new u(e.points(), !0, this.setDefaults(t)))
},
createLine: function (e, t, n, i, r) {
return this.decorate(new u([new I(e, t), new I(n, i)], !1, this.setDefaults(r)))
},
createPolyline: function (e, t, n) {
return this.decorate(new u(e, t, this.setDefaults(n)))
},
createCircle: function (e, t, n) {
return this.decorate(new h(e, t, n))
},
createSector: function (e, t) {
return this.decorate(new f(e, t))
},
createRing: function (e, t) {
return this.decorate(new p(e, this.setDefaults(t)))
},
createGroup: function (e) {
return this.decorate(new g(this.setDefaults(e)))
},
createGradient: function (e) {
var t = H(e.cx) && H(e.cy) && H(e.bbox);
return e.type === Y && t ? new b(e) : e.type === $ ? new _(e) : L
}
});
K.fromModel = function (e) {
var t = new K(e.options);
return [].push.apply(t.children, e.getViewElements(t)), t
}, K.available = function () {
return C.support.browser.msie
}, K.preference = 50, A.ui.registerView(K), a = z.extend({
init: function (e, t) {
var n = this;
z.fn.init.call(n, t), n.content = e, n.template = a.template, n.template || (n.template = a.template = R("#= d.content #"))
},
options: {
x: 0,
y: 0,
font: q,
color: L,
fillOpacity: 1,
cursor: {}
},
refresh: function (e) {
w(e).css("visibility", this.renderVisibility())
},
clone: function () {
var e = this;
return new a(e.content, S({}, e.options))
},
renderVisibility: function () {
return this.options.fillOpacity > 0 ? "visible" : "hidden"
},
renderCursor: function () {
var e = this.options,
t = "";
return H(e.cursor.style) && (t += "cursor: " + e.cursor.style + ";"), t
}
}), s = z.extend({
init: function (e, t) {
var n = this;
z.fn.init.call(n, t), n.content = e, n.template = s.template, n.template || (n.template = s.template = R("#= d.renderPath() #"))
},
options: {
x: 0,
y: 0,
font: q,
color: L,
size: {
width: 0,
height: 0
}
},
renderPath: function () {
var e = this,
t = e.options,
n = t.size.width,
i = t.size.height,
r = t.x + n / 2,
o = t.y + i / 2,
a = -t.rotation,
s = M(t.x, o, r, o, a),
l = M(t.x + n, o, r, o, a);
return ""
}
}), l = z.extend({
init: function (e) {
var t = this;
z.fn.init.call(t, e), t.template = l.template, t.template || (t.template = l.template = R(''))
},
refresh: function (e) {
try {
e.opacity = this.options.strokeOpacity
} catch (t) {}
}
}), d = z.extend({
init: function (e) {
var t = this;
z.fn.init.call(t, e), t.template = d.template, t.template || (t.template = d.template = R(''))
},
isEnabled: function () {
var e = this.options.fill;
return !!e && e.toLowerCase() !== Q
},
refresh: function (e) {
try {
e.opacity = this.options.fillOpacity
} catch (t) {}
}
}), c = z.extend({
init: function (e) {
var t = this;
z.fn.init.call(t, e), t.template = c.template, t.template || (t.template = c.template = R("#= d.fill.render() + d.stroke.render() #")), t.stroke = new l(t.options), t.fill = new d(t.options)
},
options: {
fill: "",
fillOpacity: 1,
strokeOpacity: 1,
rotation: [0, 0, 0],
visible: !0,
cursor: {}
},
renderCoordsize: function () {
var e = this.options.align === !1 ? 1e4 : 1;
return "coordsize='" + e + " " + e + "'"
},
renderSize: function () {
var e = this.options.align === !1 ? 100 : 1;
return "width:" + e + "px; height:" + e + "px;"
},
render: function () {
var e = this;
return e.fill.options.fillOpacity = e.options.fillOpacity, e.stroke.options.strokeOpacity = e.options.strokeOpacity, z.fn.render.call(e)
},
renderDisplay: function () {
return this.options.visible ? "block" : "none"
},
renderPoints: function () {},
refresh: function (e) {
if (e) {
var t = this,
n = w(e),
i = n[0].parentNode,
r = t.fill,
o = t.stroke;
i && (n.find("path")[0].v = this.renderPoints(), r.options = o.options = t.options, r.refresh(n.find("fill")[0]), o.refresh(n.find("stroke")[0]), n.css("display", t.renderDisplay()), i.style.cssText = i.style.cssText)
}
},
renderCursor: function () {
var e = this.options,
t = "";
return H(e.cursor.style) && (t += "cursor: " + e.cursor.style + ";"), t
}
}), u = c.extend({
init: function (e, t, n) {
var i = this;
c.fn.init.call(i, n), i.points = e, i.closed = t
},
renderPoints: function () {
var e, t = this,
n = t.points,
i = n.length,
r = function (e) {
var n = t.options.rotation;
return M(e.x, e.y, n[1], n[2], -n[0])
}, o = "m " + t._print(r(n[0]));
if (i > 1)
for (o += " l ", e = 1; i > e; e++) o += t._print(r(n[e])), i - 1 > e && (o += ", ");
return t.closed && (o += " x"), o
},
clone: function () {
var e = this;
return new u(S([], e.points), e.closed, S({}, e.options))
},
_print: function (e) {
var t = this.options.align === !1 ? 100 : 1;
return k.round(e.x * t) + "," + k.round(e.y * t)
}
}), p = c.extend({
init: function (e, t) {
var n = this;
c.fn.init.call(n, t), n.pathTemplate = p.pathTemplate, n.pathTemplate || (n.pathTemplate = p.pathTemplate = R("M #= d.osp.x #,#= d.osp.y # WA #= d.obb.l #,#= d.obb.t # #= d.obb.r #,#= d.obb.b # #= d.osp.x #,#= d.osp.y # #= d.oep.x #,#= d.oep.y # L #= d.iep.x #,#= d.iep.y # AT #= d.ibb.l #,#= d.ibb.t # #= d.ibb.r #,#= d.ibb.b # #= d.iep.x #,#= d.iep.y # #= d.isp.x #,#= d.isp.y # X E")), n.config = e
},
renderPoints: function () {
function e(e) {
return new I(N(e.x), N(e.y))
}
var t, n, i, r, o = this,
a = o.config,
s = k.max(N(a.r), 0),
l = k.max(N(a.ir), 0),
d = N(a.c.x),
c = N(a.c.y),
u = a.startAngle,
p = a.angle + u,
f = p - u,
h = {
l: d - s,
t: c - s,
r: d + s,
b: c + s
}, g = {
l: d - l,
t: c - l,
r: d + l,
b: c + l
};
return 1 >= f ? p += 1 - f : f > 359 && (p -= 1 - f), t = e(a.point(u)), n = e(a.point(u, !0)), r = e(a.point(p)), i = e(a.point(p, !0)), o.pathTemplate({
obb: h,
ibb: g,
osp: t,
isp: n,
oep: r,
iep: i,
cx: d,
cy: c
})
},
clone: function () {
var e = this;
return new p(S({}, e.config), S({}, e.options))
}
}), f = p.extend({
init: function (e, t) {
var n = this;
p.fn.init.call(n, e, t), n.pathTemplate = f.pathTemplate, n.pathTemplate || (n.pathTemplate = f.pathTemplate = R("M #= d.osp.x #,#= d.osp.y # WA #= d.obb.l #,#= d.obb.t # #= d.obb.r #,#= d.obb.b # #= d.osp.x #,#= d.osp.y # #= d.oep.x #,#= d.oep.y # L #= d.cx #,#= d.cy # X E"))
},
clone: function () {
var e = this;
return new f(S({}, e.config), S({}, e.options))
}
}), h = z.extend({
init: function (e, t, n) {
var i = this;
z.fn.init.call(i, n), i.c = e, i.r = t, i.template = h.template, i.template || (i.template = h.template = R("#= d.fill.render() + d.stroke.render() #")), i.stroke = new l(i.options), i.fill = new d(i.options)
},
options: {
fill: "",
fillOpacity: 1
},
refresh: function (e) {
var t = this,
n = t.c,
i = k.max(0, t.r),
r = 2 * i,
o = w(e);
o.css({
width: r,
height: r,
top: n.y - i,
left: n.x - i
}), t.fill.options = t.options, t.fill.refresh(o.find("fill")[0])
},
clone: function () {
var e = this;
return new h(S({}, e.c), e.r, S({}, e.options))
}
}), g = z.extend({
init: function (e) {
var t = this;
z.fn.init.call(t, e), t.tagName = t.options.inline ? "span" : "div", t.template = g.template, t.template || (t.template = g.template = R("<#= d.tagName # #= d.renderId() ##= d.renderDataAttributes() #style='position: absolute; white-space: nowrap;'>#= d.renderContent() ##= d.tagName #>"))
}
}), m = z.extend({
init: function (e, t) {
var n = this;
z.fn.init.call(n, t), n.tagName = n.options.inline ? "span" : "div", n.template = m.template, n.clipTemplate = m.clipTemplate, n.template || (n.template = m.template = R("<#= d.tagName # #= d.renderId() #style='position:absolute; width:#= d.box.width() #px; height:#= d.box.height() #px; top:#= d.box.y1 #px; left:#= d.box.x1 #px; clip:#= d._renderClip() #;' >#= d.renderContent() ##= d.tagName #>"), n.clipTemplate = m.clipTemplate = R("rect(#= d.points[0].y #px #= d.points[1].x #px #= d.points[2].y #px #= d.points[0].x #px)")), n.box = e, n.points = e.points()
},
clone: function () {
var e = this;
return new m(e.box, S({}, e.options))
},
refresh: function (e) {
e && (e.style.clip = this._renderClip())
},
_renderClip: function () {
return this.clipTemplate(this)
},
destroy: function () {
w("#" + this.options.id + ">*").unwrap()
}
}), v = z.extend({
init: function (e) {
var t = this;
z.fn.init.call(t, e)
},
options: {
opacity: 1
},
renderColors: function () {
var e, t, n = this,
i = n.options,
r = i.stops,
o = r.length,
a = [],
s = k.round;
for (t = 0; o > t; t++) e = r[t], a.push(s(100 * e.offset) + "% " + e.color);
return a.join(",")
}
}), _ = v.extend({
init: function (e) {
var t = this;
v.fn.init.call(t, e), t.template = _.template, t.template || (t.template = _.template = R(""))
},
options: {
rotation: 0
}
}), b = v.extend({
init: function (e) {
var t = this;
v.fn.init.call(t, e), t.template = b.template, t.template || (t.template = b.template = R(""))
},
focusPosition: function () {
var e = this.options,
t = e.bbox,
n = e.cx,
i = e.cy,
r = Math.max(0, Math.min(1, (n - t.x1) / t.width())),
o = Math.max(0, Math.min(1, (i - t.y1) / t.height()));
return N(r, U) + " " + N(o, U)
},
firstColor: function () {
var e = this.options.stops;
return e[0].color
},
lastColor: function () {
var e = this.options.stops;
return e[e.length - 1].color
}
}), e.prototype = {
decorate: function (e) {
var t, n, i = e.options,
r = this.view;
return i.overlay && (n = i.overlay.bbox, t = r.buildGradient(S({}, i.overlay, {
_overlayFill: i.fill,
_bboxHash: H(n) ? n.getHash() : ""
}))), t ? (delete i.overlay, i.fill = S(o(i.fill, t), {
opacity: i.fillOpacity
}), e) : e
}
}, t.prototype = {
decorate: function (e) {
var t = this,
n = t.view,
i = e.options,
r = i.fill;
return r && r.supportVML !== !1 && (r.gradient && (r = n.buildGradient(r)), typeof r === G && (e.fill = n.createGradient(r))), e
}
}, y = T.extend({
init: function (e) {
this.view = e
},
decorate: function (e) {
var t, n = this,
i = n.view,
r = i.options,
o = e.options.animation;
return o && o.type === V && r.transitions ? (t = new m(new D(0, 0, r.width, r.height), {
id: O(),
inline: r.inline
}), i.animations.push(new E(t, {
size: r.width
})), t.children.push(e), t) : e
}
}), S(A, {
VMLCircle: h,
VMLClipAnimationDecorator: y,
VMLClipRect: m,
VMLFill: d,
VMLGroup: g,
VMLLine: u,
VMLLinearGradient: _,
VMLOverlayDecorator: e,
VMLPath: c,
VMLRadialGradient: b,
VMLRing: p,
VMLRotatedText: s,
VMLSector: f,
VMLStroke: l,
VMLText: a,
VMLView: K,
blendColors: i,
blendGradient: o
})
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.ui.Widget,
i = e.proxy,
r = Math.abs,
o = 20,
a = t.Class.extend({
init: function (n, i, o) {
o = e.extend({
minXDelta: 30,
maxYDelta: 20,
maxDuration: 1e3
}, o), new t.UserEvents(n, {
surface: o.surface,
allowSelection: !0,
start: function (e) {
2 * r(e.x.velocity) >= r(e.y.velocity) && e.sender.capture()
},
move: function (e) {
var t = e.touch,
n = e.event.timeStamp - t.startTime,
a = t.x.initialDelta > 0 ? "right" : "left";
r(t.x.initialDelta) >= o.minXDelta && r(t.y.initialDelta) < o.maxYDelta && o.maxDuration > n && (i({
direction: a,
touch: t,
target: t.target
}), t.cancel())
}
})
}
}),
s = n.extend({
init: function (e, r) {
function o(e) {
return function (t) {
s._triggerTouch(e, t)
}
}
function a(e) {
return function (t) {
s.trigger(e, {
touches: t.touches,
distance: t.distance,
center: t.center,
event: t.event
})
}
}
var s = this;
n.fn.init.call(s, e, r), r = s.options, e = s.element, s.events = new t.UserEvents(e, {
filter: r.filter,
surface: r.surface,
multiTouch: r.multiTouch,
allowSelection: !0,
press: i(s, "_touchstart"),
tap: i(s, "_tap"),
gesturestart: a("gesturestart"),
gesturechange: a("gesturechange"),
gestureend: a("gestureend")
}), r.enableSwipe ? (s.events.bind("start", i(s, "_swipestart")), s.events.bind("move", i(s, "_swipemove"))) : (s.events.bind("start", i(s, "_dragstart")), s.events.bind("move", o("drag")), s.events.bind("end", o("dragend"))), t.notify(s)
},
events: ["touchstart", "dragstart", "drag", "dragend", "tap", "doubletap", "hold", "swipe", "gesturestart", "gesturechange", "gestureend"],
options: {
name: "Touch",
surface: null,
global: !1,
multiTouch: !1,
enableSwipe: !1,
minXDelta: 30,
maxYDelta: 20,
maxDuration: 1e3,
minHold: 800,
doubleTapTimeout: 800
},
_cancelHold: function () {
clearTimeout(this.holdTimeout)
},
_triggerTouch: function (e, t) {
this.trigger(e, {
touch: t.touch,
event: t.event
})
},
_touchstart: function (e) {
var t = this;
t._triggerTouch("touchstart", e), t._cancelHold(), t.holdTimeout = setTimeout(function () {
t._triggerTouch("hold", e)
}, t.options.minHold)
},
_tap: function (e) {
var n = this,
i = n.lastTap,
r = e.touch;
n._cancelHold(), i && r.endTime - i.endTime < n.options.doubleTapTimeout && o > t.touchDelta(r, i).distance ? (n._triggerTouch("doubletap", e), n.lastTap = null) : (n._triggerTouch("tap", e), n.lastTap = r)
},
_dragstart: function (e) {
this._cancelHold(), this._triggerTouch("dragstart", e)
},
_swipestart: function (e) {
this._cancelHold(), 2 * r(e.x.velocity) >= r(e.y.velocity) && e.sender.capture()
},
_swipemove: function (e) {
var t = this,
n = t.options,
i = e.touch,
o = e.event.timeStamp - i.startTime,
a = i.x.initialDelta > 0 ? "right" : "left";
t._cancelHold(), r(i.x.initialDelta) >= n.minXDelta && r(i.y.initialDelta) < n.maxYDelta && n.maxDuration > o && (t.trigger("swipe", {
direction: a,
touch: e.touch
}), i.cancel())
}
});
window.jQuery.fn.kendoMobileSwipe = function (e, t) {
this.each(function () {
new a(this, e, t)
})
}, t.ui.plugin(s)
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.mobile,
i = n.ui,
r = "show",
o = "hide",
a = "open",
s = "close",
l = '',
d = '',
c = '',
u = "km-up km-down km-left km-right",
p = i.Widget,
f = {
down: {
origin: "bottom center",
position: "top center"
},
up: {
origin: "top center",
position: "bottom center"
},
left: {
origin: "center left",
position: "center right",
collision: "fit flip"
},
right: {
origin: "center right",
position: "center left",
collision: "fit flip"
}
}, h = {
animation: {
open: {
effects: "fade:in",
duration: 0
},
close: {
effects: "fade:out",
duration: 400
}
}
}, g = {
horizontal: {
offset: "top",
size: "height"
},
vertical: {
offset: "left",
size: "width"
}
}, m = {
up: "down",
down: "up",
left: "right",
right: "left"
}, v = p.extend({
init: function (i, r) {
var a, s = this,
u = i.closest(".km-modalview-wrapper"),
m = u[0] ? u : n.application.element,
v = {
viewport: n.application.element,
open: function () {
s.overlay.show()
},
activate: e.proxy(s._activate, s),
deactivate: function () {
s.overlay.hide(), s.trigger(o)
}
};
p.fn.init.call(s, i, r), i = s.element, r = s.options, i.wrap(l).addClass("km-popup").show(), a = s.options.direction.match(/left|right/) ? "horizontal" : "vertical", s.dimensions = g[a], s.wrapper = i.parent().css({
width: r.width,
height: r.height
}).addClass("km-popup-wrapper km-" + r.direction).hide(), s.arrow = e(d).prependTo(s.wrapper).hide(), s.overlay = e(c).appendTo(m).hide(), v.appendTo = s.overlay, s.popup = new t.ui.Popup(s.wrapper, e.extend(!0, v, h, f[r.direction]))
},
options: {
name: "Popup",
width: 240,
height: 320,
direction: "down"
},
events: [r, o],
show: function (t) {
var n = this,
i = n.popup;
i.options.anchor = e(t), i.open()
},
target: function () {
return this.popup.options.anchor
},
hide: function () {
this.popup.close()
},
destroy: function () {
p.fn.destroy.call(this), this.popup.destroy()
},
_activate: function () {
var t = this,
n = t.options.direction,
i = t.dimensions,
o = i.offset,
a = t.popup,
s = a.options.anchor,
l = e(s).offset(),
d = e(a.element).offset(),
c = a.flipped ? m[n] : n,
p = l[o] - d[o] + e(s)[i.size]() / 2;
t.wrapper.removeClass(u).addClass("km-" + c), t.arrow.css(o, p).show(), t.trigger(r)
}
}),
_ = p.extend({
init: function (n, r) {
var o, l = this;
l.initialOpen = !1, p.fn.init.call(l, n, r), r = l.options, o = e.extend({
show: function () {
l.trigger(a, {
target: l.popup.target()
})
},
hide: function () {
l.trigger(s)
}
}, this.options.popup), l.popup = new v(l.element, o), l.pane = new i.Pane(l.element, this.options.pane), t.notify(l, i)
},
options: {
name: "PopOver",
popup: {},
pane: {}
},
events: [a, s],
open: function (e) {
this.openFor(e)
},
openFor: function (e) {
this.popup.show(e), this.initialOpen || (this.pane.navigate(""), this.initialOpen = !0)
},
close: function () {
this.popup.hide()
},
destroy: function () {
p.fn.destroy.call(this), this.pane.destroy(), this.popup.destroy(), t.destroy(this.element)
}
});
i.plugin(v), i.plugin(_)
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.mobile.ui,
i = n.Widget,
r = e.map(t.eventMap, function (e) {
return e
}).join(" ").split(" "),
o = i.extend({
init: function (t, n) {
var r = this,
o = e('
'),
p = a.extend({
init: function (s, d) {
var p = this,
f = n.mobileOS,
h = f.tablet ? o : r;
a.fn.init.call(p, s, d), s = p.element, s.addClass("km-actionsheet").append(u({
cancel: p.options.cancel
})).wrap(c).on("up", l, "_click").on("click", l, t.preventDefault), p.wrapper = s.parent(), p.shim = new h(p.wrapper, e.extend({
modal: !(f.android || f.meego || f.wp)
}, p.options.popup)), t.notify(p, i), t.onResize(e.proxy(this, "_resize"))
},
events: [s],
options: {
name: "ActionSheet",
cancel: "Cancel",
popup: {
height: "auto"
}
},
open: function (t, n) {
var i = this;
i.target = e(t), i.context = n, i.shim.show(t)
},
close: function () {
this.context = this.target = null, this.shim.hide()
},
openFor: function (e) {
var t = this,
n = e.data(d);
t.open(e, n), t.trigger(s, {
target: e,
context: n
})
},
destroy: function () {
a.fn.destroy.call(this), this.shim.destroy()
},
_click: function (n) {
if (!n.isDefaultPrevented()) {
var i = e(n.currentTarget).data("action");
i && t.getter(i)(window)({
target: this.target,
context: this.context
}), n.preventDefault(), this.close()
}
},
_resize: function () {
if (n.mobileOS.tablet) this.shim.hide();
else {
var e = this.wrapper.parent(),
t = e.parent();
e.css({
top: t.height() - e.height() + "px",
width: t.width() + "px"
})
}
}
});
i.plugin(p)
}(window.kendo.jQuery),
function (e) {
function t(t, n, i) {
e(n.target).closest(".km-button,.km-detail").toggleClass("km-state-active", i), d && t.deactivateTimeoutID && (clearTimeout(t.deactivateTimeoutID), t.deactivateTimeoutID = 0)
}
function n(t) {
return e('' + t + "")
}
var i = window.kendo,
r = i.mobile,
o = r.ui,
a = o.Widget,
s = i.support,
l = s.mobileOS,
d = l.android && l.flatVersion >= 300,
c = "click",
u = a.extend({
init: function (e, n) {
var r = this;
a.fn.init.call(r, e, n), r._wrap(), r._style(), r._userEvents = new i.UserEvents(r.element, {
press: function (e) {
r._activate(e)
},
tap: function (e) {
r._release(e)
},
end: function (e) {
t(r, e, !1)
}
}), d && r.element.on("move", "_timeoutDeactivate")
},
destroy: function () {
a.fn.destroy.call(this), this._userEvents.destroy()
},
events: [c],
options: {
name: "Button",
icon: "",
style: "",
badge: ""
},
badge: function (e) {
var t = this.badgeElement = this.badgeElement || n(e).appendTo(this.element);
return e ? (t.html(e), this) : e === !1 ? (t.empty().remove(), this.badgeElement = !1, this) : t.html()
},
_timeoutDeactivate: function (e) {
this.deactivateTimeoutID || (this.deactivateTimeoutID = setTimeout(t, 500, this, e, !1))
},
_activate: function (e) {
var n = document.activeElement,
i = n ? n.nodeName : "";
t(this, e, !0), ("INPUT" == i || "TEXTAREA" == i) && n.blur()
},
_release: function (t) {
var n = this;
t.which > 1 || n.trigger(c, {
target: e(t.target),
button: n.element
}) && t.preventDefault()
},
_style: function () {
var t, n = this.options.style,
i = this.element;
n && (t = n.split(" "), e.each(t, function () {
i.addClass("km-" + this)
}))
},
_wrap: function () {
var t = this,
i = t.options.icon,
r = t.options.badge,
o = '').children("span.km-text")), !l[0] && i && (s[0] || (o += " km-notext"), t.iconElement = a.prepend(e(o + '" />'))), r && (t.badgeElement = n(r).appendTo(a))
}
}),
p = u.extend({
options: {
name: "BackButton",
style: "back"
},
init: function (e, t) {
var n = this;
u.fn.init.call(n, e, t), n.element.attr("href") === undefined && n.element.attr("href", "#:back")
}
}),
f = u.extend({
options: {
name: "DetailButton",
style: ""
},
init: function (e, t) {
u.fn.init.call(this, e, t)
},
_style: function () {
var t, n = this.options.style + " detail",
i = this.element;
n && (t = n.split(" "), e.each(t, function () {
i.addClass("km-" + this)
}))
},
_wrap: function () {
var t = this,
n = t.options.icon,
i = '')))
}
});
o.plugin(u), o.plugin(p), o.plugin(f)
}(window.kendo.jQuery),
function (e, t) {
function n(t) {
return e('' + t + "")
}
var i = window.kendo,
r = i.mobile.ui,
o = r.Widget,
a = "km-state-active",
s = "select",
l = "li:not(." + a + ")",
d = o.extend({
init: function (e, t) {
var n = this;
o.fn.init.call(n, e, t), n.element.addClass("km-buttongroup").find("li").each(n._button), n.element.on(n.options.selectOn, l, "_select"), n.select(n.options.index)
},
events: [s],
options: {
name: "ButtonGroup",
selectOn: "down",
index: -1
},
current: function () {
return this.element.find("." + a)
},
select: function (n) {
var i = this,
r = -1;
n !== t && -1 !== n && (i.current().removeClass(a), "number" == typeof n ? (r = n, n = e(i.element[0].children[n])) : n.nodeType && (n = e(n), r = n.index()), n.addClass(a), i.selectedIndex = r)
},
badge: function (t, i) {
var r, o = this.element;
return isNaN(t) || (t = o.children().get(t)), t = o.find(t), r = e(t.children(".km-badge")[0] || n(i).appendTo(t)), i ? (r.html(i), this) : i === !1 ? (r.empty().remove(), this) : r.html()
},
_button: function () {
var t = e(this).addClass("km-button"),
r = i.attrValue(t, "icon"),
o = i.attrValue(t, "badge"),
a = t.children("span"),
s = t.find("img").addClass("km-image");
a[0] || (a = t.wrapInner("").children("span")), a.addClass("km-text"), !s[0] && r && t.prepend(e('')), o && n(o).appendTo(t)
},
_select: function (e) {
if (!(e.which > 1 || e.isDefaultPrevented())) {
var t = this;
t.select(e.currentTarget), t.trigger(s)
}
}
});
r.plugin(d)
}(window.kendo.jQuery),
function (e) {
function t() {
return this.nodeType === s.TEXT_NODE && this.nodeValue.match(F)
}
function n(e, t) {
t && e.prepend('')
}
function i(e) {
n(e, g(e, "icon"))
}
function r(e) {
var i = e.parent(),
r = e.add(i.children(a.roleSelector("detailbutton"))),
o = i.contents().not(r).not(t);
o.length || (e.addClass("km-listview-link").attr(a.attr("role"), "listview-link"), n(e, g(i, "icon")))
}
function o(e) {
if (e.children("input[type=checkbox],input[type=radio]").length) {
var t = e.parent();
t.contents().not(e).not(function () {
return 3 == this.nodeType
})[0] || e.addClass("km-listview-label")
}
}
var a = window.kendo,
s = window.Node,
l = a.mobile,
d = l.ui,
c = a.data.DataSource,
u = d.Widget,
p = ".km-list > li, > li:not(.km-group-container)",
f = ".km-listview-link, .km-listview-label",
h = e.proxy,
g = a.attrValue,
m = "km-group-title",
v = "km-state-active",
_ = '
',
b = a.template('
#= this.headerTemplate(data) #
#= kendo.render(this.template, data.items)#
'),
y = '',
w = a.template(''),
x = ".kendoMobileListView",
k = "lastPageReached",
C = "click",
T = "change",
S = "progress",
A = "function",
F = /^\s+$/,
D = /button/,
I = u.extend({
init: function (e, t) {
var n = this;
u.fn.init.call(n, e, t), e = n.element, t = n.options, t.scrollTreshold && (t.scrollThreshold = t.scrollTreshold), e.on("down", f, "_highlight").on("move up cancel", f, "_dim"), n._userEvents = new a.UserEvents(e, {
filter: p,
allowSelection: !0,
tap: function (e) {
n._click(e)
}
}), e.css("-ms-touch-action", "auto"), e.wrap(y), n.wrapper = n.element.parent(), n._footer(), n._dataSource(), n._bindScroller(), n._fixHeaders(), n._filterable(), t.dataSource && n.options.autoBind ? n.dataSource.fetch() : n._style(), a.notify(n, d)
},
events: [C, "dataBound", k],
options: {
name: "ListView",
style: "",
type: "flat",
autoBind: !0,
fixedHeaders: !1,
template: "#:data#",
headerTemplate: '#:value#',
appendOnRefresh: !1,
loadMore: !1,
loadMoreText: "Press to load more",
endlessScroll: !1,
scrollThreshold: 30,
pullToRefresh: !1,
pullTemplate: "Pull to refresh",
releaseTemplate: "Release to refresh",
refreshTemplate: "Refreshing",
pullOffset: 140,
filterable: !1
},
setOptions: function (e) {
u.fn.setOptions.call(this, e)
},
setDataSource: function (e) {
this.options.dataSource = e, this._dataSource(), this.options.autoBind && e.fetch()
},
destroy: function () {
var e = this;
u.fn.destroy.call(e), e._unbindDataSource(), e.stopEndlessScrolling(), e.stopLoadMore(), a.destroy(e.element), e._userEvents.destroy()
},
refresh: function (t) {
t = t || {};
var n, i, r, o, s, c = this,
u = c.element,
p = c.options,
f = c.dataSource,
h = f.view(),
g = c.loading,
m = "html",
v = t.action,
_ = t.items,
b = 0;
if ("itemchange" === v) return o = _[0], s = e(c.template(o)), u.find("[data-" + a.ns + "uid=" + o.uid + "]").replaceWith(s), c.trigger("itemChange", {
item: s,
data: o,
ns: d
}), c._style(), undefined;
if ("add" === v) {
for (r = _.length; r > b; b++) s = e(c.template(_[b])), s.appendTo(u), l.init(s);
return c._style(), undefined
}
if ("remove" !== v) c.template || c._templates(), c._cacheDataItems(h), c.trigger("dataBinding"), i = f.group(), i && i[0] ? (p.type = "group", n = a.render(c.groupTemplate, h)) : n = a.render(c.template, h), g ? m = "append" : p.appendOnRefresh && !c._filter && (m = "prepend"), c._filter = !1, n = e(n), u[m](n), l.init(n), g && (c.loading = !1, c._calcThreshold(), c._toggleLoader(!1)), p.pullToRefresh && c._scroller().pullHandled(), c._hideLoading(), c._shouldFixHeaders(), c._style(), c._invalidateLoadMore(), c.trigger("dataBound", {
ns: d
});
else
for (r = _.length; r > b; b++) u.find("[data-" + a.ns + "uid=" + _[b].uid + "]").remove()
},
_invalidateLoadMore: function () {
var e = this,
t = e.options,
n = e.dataSource,
i = e._stopLoadMore && (!n.total() || n.page() < n.totalPages());
i && (t.endlessScroll && e.initEndlessScrolling(), t.loadMore && e.initLoadMore())
},
_cacheDataItems: function (e) {
var t, n = this;
n.element[0].firstChild || (n._firstOrigin = n._first = e[0], n._last = e[e.length - 1]), n._pulled && (t = e[0], n._pulled = !1, t && (n._first = t)), n.loading && (t = e[e.length - 1], t && (n._last = t))
},
items: function () {
return "group" === this.options.type ? this.element.find(".km-list").children() : this.element.children()
},
initEndlessScrolling: function () {
this._stopLoadMore = !1, this._scroller().setOptions({
resize: this._scrollerResize,
scroll: this._scrollerScroll
})
},
stopEndlessScrolling: function () {
var e = this,
t = e._scroller();
t && e._loadIcon && (e.loading = !1, e._stopLoadMore = !0, e._loadIcon.parent().hide(), t.unbind("resize", e._scrollerResize).unbind("scroll", e._scrollerScroll), e.trigger(k))
},
initLoadMore: function () {
var e = this;
e._stopLoadMore = !1, e._loadButton.autoApplyNS().on("up", h(e._nextPage, e))
},
stopLoadMore: function () {
var e = this;
e._loadButton && (e._stopLoadMore = !0, e.loading = !1, e._loadButton.kendoDestroy().parent().hide(), e.trigger(k))
},
_dim: function (e) {
this._toggle(e, !1)
},
_highlight: function (e) {
this._toggle(e, !0)
},
_toggle: function (t, n) {
if (!(t.which > 1)) {
var i = e(t.currentTarget),
r = i.parent(),
o = g(i, "role") || "",
a = !o.match(D),
s = t.isDefaultPrevented();
a && r.toggleClass(v, n && !s)
}
},
_unbindDataSource: function () {
var e = this;
e.dataSource.unbind(T, e._refreshHandler).unbind(S, e._progressHandler)
},
_dataSource: function () {
var e = this,
t = e.options;
e.dataSource && e._refreshHandler ? e._unbindDataSource() : (e._refreshHandler = h(e.refresh, e), e._progressHandler = h(e._showLoading, e)), e.dataSource = c.create(t.dataSource).bind(T, e._refreshHandler), t.pullToRefresh || t.loadMore || t.endlessScroll || e.dataSource.bind(S, e._progressHandler)
},
_fixHeader: function (t) {
if (this.fixedHeaders) {
var n, i, r, o = 0,
a = this,
s = a._scroller(),
l = t.scrollTop,
d = a.headers;
do {
if (n = d[o++], !n) {
r = e("");
break
}
i = n.offset, r = n.header
} while (i > l);
a.currentHeader != o && (s.fixedContainer.html(r.clone()), a.currentHeader = o)
}
},
_shouldFixHeaders: function () {
this.fixedHeaders = "group" === this.options.type && this.options.fixedHeaders
},
_cacheHeaders: function () {
var t = this,
n = [];
t.fixedHeaders && (t.element.find("." + m).each(function (t, i) {
i = e(i), n.unshift({
offset: i.position().top,
header: i
})
}), t.headers = n, t._fixHeader({
scrollTop: 0
}))
},
_fixHeaders: function () {
var e = this,
t = e._scroller(),
n = function () {
e._cacheHeaders()
};
e._shouldFixHeaders(), e.container().bind("show", n), t && (a.onResize(n), t.bind("scroll", function (t) {
e._fixHeader(t)
}))
},
_bindScroller: function () {
var e = this,
t = e.options,
n = e._scroller();
n && (t.pullToRefresh && n.setOptions({
pullToRefresh: !0,
pull: function () {
var n = t.pullParameters,
i = {
page: 1
};
n && (i = n.call(e, e._first)), e._pulled = !0, e.dataSource.read(i)
},
pullTemplate: t.pullTemplate,
releaseTemplate: t.releaseTemplate,
refreshTemplate: t.refreshTemplate
}), t.endlessScroll && (e._scrollHeight = n.element.height(), e._scrollerResize = function () {
e._scrollHeight = n.element.height(), e._calcThreshold()
}, e._scrollerScroll = function (t) {
!e.loading && t.scrollTop + e._scrollHeight > e._threshold && e._nextPage()
}, e.initEndlessScrolling()))
},
_calcThreshold: function () {
var e = this,
t = e._scroller();
t && (e._threshold = t.scrollHeight() - e.options.scrollThreshold)
},
_nextPage: function () {
var e, t = this,
n = t.options,
i = n.endlessScrollParameters || n.loadMoreParameters;
t.loading = !0, t._toggleLoader(!0), i && (e = i.call(t, t._firstOrigin, t._last)), t.dataSource.next(e) || (t.stopLoadMore(), t.stopEndlessScrolling())
},
_templates: function () {
var e = this,
t = e.options.template,
n = e.options.headerTemplate,
i = ' data-uid="#=data.uid || ""#"',
r = {}, o = {};
typeof t === A && (r.template = t, t = "#=this.template(data)#"), o.template = e.template = h(a.template("
" + t + "
"), r), typeof n === A && (o._headerTemplate = n, n = "#=this._headerTemplate(data)#"), o.headerTemplate = a.template(n), e.groupTemplate = h(b, o)
},
_click: function (t) {
if (!(t.event.which > 1 || t.isDefaultPrevented())) {
var n, i = this,
r = t.target,
o = e(t.event.target),
s = o.closest(a.roleSelector("button", "detailbutton", "backbutton")),
l = a.widgetInstance(s, d),
c = r.attr(a.attr("uid"));
c && (n = i.dataSource.getByUid(c)), i.trigger(C, {
target: o,
item: r,
dataItem: n,
button: l
}) && t.preventDefault()
}
},
_style: function () {
var t = this,
n = t.options,
i = "group" === n.type,
r = t.element,
o = "inset" === n.style;
r.addClass("km-listview").toggleClass("km-list", !i).toggleClass("km-listinset", !i && o).toggleClass("km-listgroup", i && !o).toggleClass("km-listgroupinset", i && o), i && (r.children().children("ul").addClass("km-list"), r.children("li").each(function () {
var t = e(this),
n = t.contents().first();
t.addClass("km-group-container"), n.is("ul") || n.is("div." + m) || n.wrap(_)
})), t._enhanceItems(), r.parents(".km-listview")[0] || r.closest(".km-content").toggleClass("km-insetcontent", o), t._cacheHeaders()
},
_enhanceItems: function () {
this.items().each(function () {
var t, n = e(this),
a = !1;
n.children().each(function () {
t = e(this), t.is("a") ? (r(t), a = !0) : t.is("label") && (o(t), a = !0)
}), a || i(n)
})
},
_footer: function () {
var t, n = this,
i = n.options,
r = i.loadMore;
(r || i.endlessScroll) && (n._loadIcon = e(''), t = e('').append(n._loadIcon), r && (n._loadButton = e('"), n.initLoadMore(), t.append(n._loadButton)), n.wrapper.append(t))
},
_toggleLoader: function (e) {
var t = this,
n = t._loadIcon,
i = t._loadButton;
i && i.toggle(!e), e ? (n.parent().addClass("km-scroller-refresh"), n.css("display", "block")) : (n.hide(), n.parent().removeClass("km-scroller-refresh"))
},
_scroller: function () {
var e, t = this;
return t._scrollerInstance || (e = t.view(), t._scrollerInstance = e && e.scroller), t._scrollerInstance
},
_showLoading: function () {
var e = this.view();
e && e.loader && e.loader.show()
},
_hideLoading: function () {
var e = this.view();
e && e.loader && e.loader.hide()
},
_filterable: function () {
var e = this,
t = e.options.filterable,
n = "change paste";
t && (e.element.before(w({
placeholder: t.placeholder || "Search..."
})), t.autoFilter !== !1 && (n += " keyup"), e.searchInput = e.wrapper.find("input[type=search]").closest("form").on("submit" + x, function (e) {
e.preventDefault()
}).end().on("focus" + x, function () {
e._oldFilter = e.searchInput.val()
}).on(n.split(" ").join(x + " ") + x, h(e._filterChange, e)), e.clearButton = e.wrapper.find(".km-filter-reset").on(C, h(e._clearFilter, e)).hide())
},
_search: function (e) {
this._filter = !0, this.clearButton[e ? "show" : "hide"](), this.dataSource.filter(e)
},
_filterChange: function (e) {
var t = this;
"paste" == e.type && t.options.filterable.autoFilter !== !1 ? setTimeout(function () {
t._applyFilter()
}, 1) : t._applyFilter()
},
_applyFilter: function () {
var e = this,
t = e.options.filterable,
n = e.searchInput.val(),
i = n.length ? {
field: t.field,
operator: t.operator || "startsWith",
ignoreCase: t.ignoreCase,
value: n
} : null;
n !== e._oldFilter && (e._oldFilter = n, e._search(i))
},
_clearFilter: function (e) {
this.searchInput.val(""), this._search(null), e.preventDefault()
}
});
d.plugin(I)
}(window.kendo.jQuery),
function (e) {
function t(t, n) {
var r = n.find("[" + i.attr("align") + "=" + t + "]");
return r[0] ? e('').append(r).prependTo(n) : undefined
}
function n(t) {
var n = t.siblings(),
i = !! t.children("ul")[0];
t.prevAll().toggleClass("km-absolute", i), t.toggleClass("km-show-title", !! n[0] && "" === e.trim(t.text())), t.toggleClass("km-no-title", i), t.toggleClass("km-hide-title", "hidden" == t.css("visibility") && !n.children().is(":visible"))
}
var i = window.kendo,
r = i.mobile,
o = r.ui,
a = i.roleSelector,
s = o.Widget,
l = s.extend({
init: function (n, i) {
var r = this;
s.fn.init.call(r, n, i), n = r.element, r.container().bind("show", e.proxy(this, "refresh")), n.addClass("km-navbar").wrapInner(e('')), r.leftElement = t("left", n), r.rightElement = t("right", n), r.centerElement = n.find(".km-view-title")
},
options: {
name: "NavBar"
},
title: function (e) {
this.element.find(a("view-title")).text(e), n(this.centerElement)
},
refresh: function (e) {
var t = e.view;
t.options.title ? this.title(t.options.title) : n(this.centerElement)
},
destroy: function () {
s.fn.destroy.call(this), i.destroy(this.element)
}
});
o.plugin(l)
}(window.kendo.jQuery),
function (e) {
var t = window.kendo,
n = t.mobile,
i = n.ui,
r = e.proxy,
o = t.effects.Transition,
a = t.ui.Pane,
s = t.ui.PaneDimensions,
l = i.Widget,
d = Math,
c = d.abs,
u = d.ceil,
p = d.round,
f = d.max,
h = d.min,
g = d.floor,
m = "change",
v = "changing",
_ = "km-current-page",
b = l.extend({
init: function (n, i) {
var d, u, p, f, h, g, v = this;
l.fn.init.call(v, n, i), n = v.element, n.wrapInner("").addClass("km-scrollview").append(''), v.inner = n.children().first(), v.pager = n.children().last(), v.page = 0, v.inner.css("height", v.options.contentHeight), v.container().bind("show", e.proxy(this, "viewShow")).bind("init", e.proxy(this, "viewInit")), d = new t.ui.Movable(v.inner), u = new o({
axis: "x",
movable: d,
onEnd: r(v._transitionEnd, v)
}), p = new t.UserEvents(n, {
start: function (e) {
2 * c(e.x.velocity) >= c(e.y.velocity) ? p.capture() : p.cancel(), u.cancel()
},
allowSelection: !0,
end: r(v._dragEnd, v)
}), f = new s({
element: v.inner,
container: v.element
}), h = f.x, h.bind(m, r(v.refresh, v)), g = new a({
dimensions: f,
userEvents: p,
movable: d,
elastic: !0
}), e.extend(v, {
movable: d,
transition: u,
userEvents: p,
dimensions: f,
dimension: h,
pane: g
}), v.page = v.options.page
},
options: {
name: "ScrollView",
page: 0,
duration: 300,
velocityThreshold: .8,
contentHeight: "auto",
pageSize: 1,
bounceVelocityThreshold: 1.6
},
events: [v, m],
destroy: function () {
l.fn.destroy.call(this), this.userEvents.destroy(), t.destroy(this.element)
},
viewInit: function () {
this.movable.moveAxis("x", -this.page * this.dimension.getSize())
},
viewShow: function () {
this.dimensions.refresh()
},
refresh: function () {
var e, t, n = this,
i = "",
r = n.dimension,
o = r.getSize(),
a = n.element.find("[data-role=page]");
for (a.width(o), r.update(!0), a[0] || (n.page = Math.floor(-n.movable.x / o)), n.scrollTo(n.page, !0), e = n.pages = u(r.getTotal() / o), n.minSnap = -(e - 1) * o, n.maxSnap = 0, t = 0; e > t; t++) i += "";
n.pager.html(i), n._updatePager()
},
content: function (e) {
this.element.children().first().html(e), this.dimensions.refresh()
},
scrollTo: function (e, t) {
this.page = e, this._moveTo(-e * this.dimension.getSize(), o.easeOutExpo, t)
},
_moveTo: function (e, t, n) {
this.transition.moveTo({
location: e,
duration: n ? 1 : this.options.duration,
ease: t
})
},
_dragEnd: function (e) {
var t, n = this,
i = e.x.velocity,
r = n.dimension.size * n.options.pageSize,
a = n.options,
s = a.velocityThreshold,
l = p,
d = o.easeOutExpo;
i > s ? l = u : -s > i && (l = g), c(i) > a.bounceVelocityThreshold && (d = o.easeOutBack), t = f(n.minSnap, h(l(n.movable.x / r) * r, n.maxSnap)), this.trigger(v, {
currentPage: n.page
}) && (t = -n.page * n.dimension.getSize()), this._moveTo(t, d)
},
_transitionEnd: function () {
var e = this,
t = Math.round(-e.movable.x / e.dimension.size);
t != e.page && (e.page = t, e.trigger(m, {
page: t
}), e._updatePager())
},
_updatePager: function () {
this.pager.children().removeClass(_).eq(this.page).addClass(_)
}
});
i.plugin(b)
}(window.kendo.jQuery),
function (e, t) {
function n(e, t, n) {
return Math.max(t, Math.min(n, e))
}
var i = window.kendo,
r = i.mobile.ui,
o = r.Widget,
a = i.support,
s = "change",
l = "km-switch-on",
d = "km-switch-off",
c = "margin-left",
u = "km-state-active",
p = a.transitions.css + "transform",
f = e.proxy,
h = o.extend({
init: function (t, n) {
var r, a = this;
o.fn.init.call(a, t, n), a._wrapper(), a._drag(), a._background(), a.origin = parseInt(a.background.css(c), 10), a._handle(), a.constrain = 0, a.snapPoint = 0, a.container().bind("show", e.proxy(this, "refresh")), t = a.element[0], t.type = "checkbox", a._animateBackground = !0, r = a.options.checked, null === r && (r = t.checked), a.check(r), a.refresh(), i.notify(a, i.mobile.ui)
},
refresh: function () {
var e, t, n = this;
e = n.wrapper.width(), t = n.handle.outerWidth(!0), n.constrain = e - t, n.snapPoint = e / 2 - t / 2, n.background.data("origin", n.origin), n.check(n.element[0].checked)
},
events: [s],
options: {
name: "Switch",
onLabel: "ON",
offLabel: "OFF",
checked: null
},
check: function (e) {
var n = this,
i = n.element[0];
return e === t ? i.checked : (n._position(e ? n.constrain : 0), i.checked = e, n.wrapper.toggleClass(l, e).toggleClass(d, !e), t)
},
destroy: function () {
o.fn.destroy.call(this), this.userEvents.destroy()
},
toggle: function () {
var e = this;
e.check(!e.element[0].checked)
},
_move: function (e) {
var t = this;
e.preventDefault(), t._position(n(t.position + e.x.delta, 0, t.constrain))
},
_position: function (e) {
var t = this;
t.position = e, t.handle.css(p, "translatex(" + e + "px)"), t._animateBackground && t.background.css(c, t.origin + e)
},
_start: function () {
this.userEvents.capture(), this.handle.addClass(u)
},
_stop: function () {
var e = this;
e.handle.removeClass(u), e._toggle(e.position > e.snapPoint)
},
_toggle: function (e) {
var t, n = this,
r = n.handle,
o = n.element[0],
a = o.checked,
c = i.mobile.application && i.mobile.application.os.wp ? 100 : 200;
n.wrapper.toggleClass(l, e).toggleClass(d, !e), n.position = t = e * n.constrain, n._animateBackground && n.background.kendoStop(!0, !0).kendoAnimate({
effects: "slideMargin",
offset: t,
reset: !0,
reverse: !e,
axis: "left",
duration: c
}), r.kendoStop(!0, !0).kendoAnimate({
effects: "slideTo",
duration: c,
offset: t + "px,0",
reset: !0,
complete: function () {
a !== e && (o.checked = e, n.trigger(s, {
checked: e
}))
}
})
},
_background: function () {
var t, n = this;
t = e("").appendTo(n.wrapper).children(".km-switch-background"), n.background = t
},
_handle: function () {
var t = this,
n = t.options;
t.handle = e("").appendTo(t.wrapper).children(".km-switch-handle"), t.handle.append('' + n.onLabel + '' + n.offLabel + "")
},
_wrapper: function () {
var e = this,
t = e.element,
n = t.parent("span.km-switch");
n[0] || (n = t.wrap('').parent()), e.wrapper = n
},
_drag: function () {
var e = this;
e.userEvents = new i.UserEvents(e.wrapper, {
tap: function () {
e._toggle(!e.element[0].checked)
},
start: f(e._start, e),
move: f(e._move, e),
end: f(e._stop, e)
})
}
});
r.plugin(h)
}(window.kendo.jQuery),
function (e) {
function t(t) {
return e('' + t + "")
}
var n = window.kendo,
i = n.mobile.ui,
r = i.Widget,
o = "km-state-active",
a = "select",
s = r.extend({
init: function (t, n) {
var i = this;
r.fn.init.call(i, t, n), i.container().bind("show", e.proxy(this, "refresh")), i.element.addClass("km-tabstrip").find("a").each(i._buildButton).eq(i.options.selectedIndex).addClass(o), i.element.on("down", "a", "_release")
},
events: [a],
switchTo: function (t) {
for (var n, i, r = this.element.find("a"), o = 0, a = r.length; a > o; o++)
if (n = r[o], i = n.href.replace(/(\#.+)(\?.+)$/, "$1"), -1 !== i.indexOf(t, i.length - t.length)) return this._setActiveItem(e(n)), undefined
},
clear: function () {
this.currentItem().removeClass(o)
},
currentItem: function () {
return this.element.children("." + o)
},
badge: function (n, i) {
var r, o = this.element;
return isNaN(n) || (n = o.children().get(n)), n = o.find(n), r = e(n.find(".km-badge")[0] || t(i).appendTo(n.children(".km-icon"))), i ? (r.html(i), this) : i === !1 ? (r.empty().remove(), this) : r.html()
},
_release: function (t) {
if (!(t.which > 1)) {
var n = this,
i = e(t.currentTarget);
i[0] !== n.currentItem()[0] && (n.trigger(a, {
item: i
}) ? t.preventDefault() : n._setActiveItem(i))
}
},
_setActiveItem: function (e) {
e[0] && (this.clear(), e.addClass(o))
},
_buildButton: function () {
var i = e(this),
r = n.attrValue(i, "icon"),
o = n.attrValue(i, "badge"),
a = i.find("img"),
s = e('');
i.addClass("km-button").attr(n.attr("role"), "tab").contents().not(a).wrapAll(''), a[0] ? a.addClass("km-image") : (i.prepend(s), r && (s.addClass("km-" + r), o && t(o).appendTo(s)))
},
refresh: function (e) {
this.switchTo(e.view.id)
},
destroy: function () {
r.fn.destroy.call(this)
},
options: {
name: "TabStrip",
selectedIndex: 0,
enable: !0
}
});
i.plugin(s)
}(window.kendo.jQuery);