Guest User

Untitled

a guest
Oct 26th, 2016
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 377.50 KB | None | 0 0
  1. ! function(a) {
  2. var b = "object" == typeof exports && exports,
  3. c = "object" == typeof module && module && module.exports == b && module,
  4. d = "object" == typeof global && global;
  5. d.global !== d && d.window !== d || (a = d);
  6. var e = function(a) {
  7. this.message = a
  8. };
  9. e.prototype = new Error, e.prototype.name = "InvalidCharacterError";
  10. var f = function(a) {
  11. throw new e(a)
  12. },
  13. g = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",
  14. h = /[\t\n\f\r ]/g,
  15. i = function(a) {
  16. a = String(a).replace(h, "");
  17. var b = a.length;
  18. b % 4 == 0 && (a = a.replace(/==?$/, ""), b = a.length), (b % 4 == 1 || /[^+a-zA-Z0-9/]/.test(a)) && f("Invalid character: the string to be decoded is not correctly encoded.");
  19. for (var c, d, e = 0, i = "", j = -1; ++j < b;) d = g.indexOf(a.charAt(j)), c = e % 4 ? 64 * c + d : d, e++ % 4 && (i += String.fromCharCode(255 & c >> (-2 * e & 6)));
  20. return i
  21. },
  22. j = function(a) {
  23. a = String(a), /[^\0-\xFF]/.test(a) && f("The string to be encoded contains characters outside of the Latin1 range.");
  24. for (var b, c, d, e, h = a.length % 3, i = "", j = -1, k = a.length - h; ++j < k;) b = a.charCodeAt(j) << 16, c = a.charCodeAt(++j) << 8, d = a.charCodeAt(++j), e = b + c + d, i += g.charAt(e >> 18 & 63) + g.charAt(e >> 12 & 63) + g.charAt(e >> 6 & 63) + g.charAt(63 & e);
  25. return 2 == h ? (b = a.charCodeAt(j) << 8, c = a.charCodeAt(++j), e = b + c, i += g.charAt(e >> 10) + g.charAt(e >> 4 & 63) + g.charAt(e << 2 & 63) + "=") : 1 == h && (e = a.charCodeAt(j), i += g.charAt(e >> 2) + g.charAt(e << 4 & 63) + "=="), i
  26. },
  27. k = {
  28. encode: j,
  29. decode: i,
  30. version: "0.1.0"
  31. };
  32. if ("function" == typeof define && "object" == typeof define.amd && define.amd) define(function() {
  33. return k
  34. });
  35. else if (b && !b.nodeType)
  36. if (c) c.exports = k;
  37. else
  38. for (var l in k) k.hasOwnProperty(l) && (b[l] = k[l]);
  39. else a.base64 = k
  40. }(this),
  41. function(a, b) {
  42. "use strict";
  43. var c = function(a) {
  44. if ("object" != typeof a.document) throw new Error("Cookies.js requires a `window` with a `document` object");
  45. var c = function(a, b, d) {
  46. return 1 === arguments.length ? c.get(a) : c.set(a, b, d)
  47. };
  48. return c._document = a.document, c._cacheKeyPrefix = "cookey.", c._maxExpireDate = new Date("Fri, 31 Dec 9999 23:59:59 UTC"), c.defaults = {
  49. path: "/",
  50. secure: !1
  51. }, c.get = function(a) {
  52. c._cachedDocumentCookie !== c._document.cookie && c._renewCache();
  53. var d = c._cache[c._cacheKeyPrefix + a];
  54. return d === b ? b : decodeURIComponent(d)
  55. }, c.set = function(a, d, e) {
  56. return e = c._getExtendedOptions(e), e.expires = c._getExpiresDate(d === b ? -1 : e.expires), c._document.cookie = c._generateCookieString(a, d, e), c
  57. }, c.expire = function(a, d) {
  58. return c.set(a, b, d)
  59. }, c._getExtendedOptions = function(a) {
  60. return {
  61. path: a && a.path || c.defaults.path,
  62. domain: a && a.domain || c.defaults.domain,
  63. expires: a && a.expires || c.defaults.expires,
  64. secure: a && a.secure !== b ? a.secure : c.defaults.secure
  65. }
  66. }, c._isValidDate = function(a) {
  67. return "[object Date]" === Object.prototype.toString.call(a) && !isNaN(a.getTime())
  68. }, c._getExpiresDate = function(a, b) {
  69. if (b = b || new Date, "number" == typeof a ? a = a === 1 / 0 ? c._maxExpireDate : new Date(b.getTime() + 1e3 * a) : "string" == typeof a && (a = new Date(a)), a && !c._isValidDate(a)) throw new Error("`expires` parameter cannot be converted to a valid Date instance");
  70. return a
  71. }, c._generateCookieString = function(a, b, c) {
  72. a = a.replace(/[^#$&+\^`|]/g, encodeURIComponent), a = a.replace(/\(/g, "%28").replace(/\)/g, "%29"), b = (b + "").replace(/[^!#$&-+\--:<-\[\]-~]/g, encodeURIComponent), c = c || {};
  73. var d = a + "=" + b;
  74. return d += c.path ? ";path=" + c.path : "", d += c.domain ? ";domain=" + c.domain : "", d += c.expires ? ";expires=" + c.expires.toUTCString() : "", d += c.secure ? ";secure" : ""
  75. }, c._getCacheFromString = function(a) {
  76. for (var d = {}, e = a ? a.split("; ") : [], f = 0; f < e.length; f++) {
  77. var g = c._getKeyValuePairFromCookieString(e[f]);
  78. d[c._cacheKeyPrefix + g.key] === b && (d[c._cacheKeyPrefix + g.key] = g.value)
  79. }
  80. return d
  81. }, c._getKeyValuePairFromCookieString = function(a) {
  82. var b = a.indexOf("=");
  83. b = b < 0 ? a.length : b;
  84. var c, d = a.substr(0, b);
  85. try {
  86. c = decodeURIComponent(d)
  87. } catch (a) {
  88. console && "function" == typeof console.error && console.error('Could not decode cookie with key "' + d + '"', a)
  89. }
  90. return {
  91. key: c,
  92. value: a.substr(b + 1)
  93. }
  94. }, c._renewCache = function() {
  95. c._cache = c._getCacheFromString(c._document.cookie), c._cachedDocumentCookie = c._document.cookie
  96. }, c._areEnabled = function() {
  97. var a = "cookies.js",
  98. b = "1" === c.set(a, 1).get(a);
  99. return c.expire(a), b
  100. }, c.enabled = c._areEnabled(), c
  101. },
  102. d = "object" == typeof a.document ? c(a) : c;
  103. "function" == typeof define && define.amd ? define(function() {
  104. return d
  105. }) : "object" == typeof exports ? ("object" == typeof module && "object" == typeof module.exports && (exports = module.exports = d), exports.Cookies = d) : a.Cookies = d
  106. }("undefined" == typeof window ? this : window), window.XdUtils = window.XdUtils || function() {
  107. function a(a, b) {
  108. var c, d = b || {};
  109. for (c in a) a.hasOwnProperty(c) && (d[c] = a[c]);
  110. return d
  111. }
  112. return {
  113. extend: a
  114. }
  115. }(), window.xdLocalStorage = window.xdLocalStorage || function() {
  116. function a(a) {
  117. j[a.id] && (j[a.id](a), delete j[a.id])
  118. }
  119.  
  120. function b(b) {
  121. var c;
  122. try {
  123. c = JSON.parse(b.data)
  124. } catch (a) {}
  125. c && c.namespace === g && ("iframe-ready" === c.id ? (l = !0, h.initCallback()) : a(c))
  126. }
  127.  
  128. function c(a, b, c, d) {
  129. i++, j[i] = d;
  130. var e = {
  131. namespace: g,
  132. id: i,
  133. action: a,
  134. key: b,
  135. value: c
  136. };
  137. f.contentWindow.postMessage(JSON.stringify(e), "*")
  138. }
  139.  
  140. function d(a) {
  141. h = XdUtils.extend(a, h);
  142. var c = document.createElement("div");
  143. window.addEventListener ? window.addEventListener("message", b, !1) : window.attachEvent("onmessage", b), c.innerHTML = '<iframe id="' + h.iframeId + '" src=' + h.iframeUrl + ' style="display: none;"></iframe>', document.body.appendChild(c), f = document.getElementById(h.iframeId)
  144. }
  145.  
  146. function e() {
  147. return k ? !!l || (console.log("You must wait for iframe ready message before using the api."), !1) : (console.log("You must call xdLocalStorage.init() before using it."), !1)
  148. }
  149. var f, g = "cross-domain-local-message",
  150. h = {
  151. iframeId: "cross-domain-iframe",
  152. iframeUrl: void 0,
  153. initCallback: function() {}
  154. },
  155. i = -1,
  156. j = {},
  157. k = !1,
  158. l = !0;
  159. return {
  160. init: function(a) {
  161. if (!a.iframeUrl) throw "You must specify iframeUrl";
  162. return k ? void console.log("xdLocalStorage was already initialized!") : (k = !0, void("complete" === document.readyState ? d(a) : window.onload = function() {
  163. d(a)
  164. }))
  165. },
  166. setItem: function(a, b, d) {
  167. e() && c("set", a, b, d)
  168. },
  169. getItem: function(a, b) {
  170. e() && c("get", a, null, b)
  171. },
  172. removeItem: function(a, b) {
  173. e() && c("remove", a, null, b)
  174. },
  175. key: function(a, b) {
  176. e() && c("key", a, null, b)
  177. },
  178. getSize: function(a) {
  179. e() && c("size", null, null, a)
  180. },
  181. getLength: function(a) {
  182. e() && c("length", null, null, a)
  183. },
  184. clear: function(a) {
  185. e() && c("clear", null, null, a)
  186. },
  187. wasInit: function() {
  188. return k
  189. }
  190. }
  191. }(),
  192. function() {
  193. ! function(a) {
  194. var b = this || (0, eval)("this"),
  195. c = b.document,
  196. d = b.navigator,
  197. e = b.jQuery,
  198. f = b.JSON;
  199. ! function(a) {
  200. "function" == typeof require && "object" == typeof exports && "object" == typeof module ? a(module.exports || exports, require) : "function" == typeof define && define.amd ? define(["exports", "require"], a) : a(b.ko = {})
  201. }(function(g, h) {
  202. function i(a, b) {
  203. return (null === a || typeof a in n) && a === b
  204. }
  205.  
  206. function j(b, c) {
  207. var d;
  208. return function() {
  209. d || (d = setTimeout(function() {
  210. d = a, b()
  211. }, c))
  212. }
  213. }
  214.  
  215. function k(a, b) {
  216. var c;
  217. return function() {
  218. clearTimeout(c), c = setTimeout(a, b)
  219. }
  220. }
  221.  
  222. function l(a, b, c, d) {
  223. m.d[a] = {
  224. init: function(a, e, f, g, h) {
  225. var i, j;
  226. return m.s(function() {
  227. var f = m.a.c(e()),
  228. g = !c != !f,
  229. k = !j;
  230. (k || b || g !== i) && (k && m.Y.la() && (j = m.a.ia(m.f.childNodes(a), !0)), g ? (k || m.f.T(a, m.a.ia(j)), m.Ca(d ? d(h, f) : h, a)) : m.f.ja(a), i = g)
  231. }, null, {
  232. o: a
  233. }), {
  234. controlsDescendantBindings: !0
  235. }
  236. }
  237. }, m.h.ha[a] = !1, m.f.Q[a] = !0
  238. }
  239. var m = "undefined" != typeof g ? g : {};
  240. m.b = function(a, b) {
  241. for (var c = a.split("."), d = m, e = 0; e < c.length - 1; e++) d = d[c[e]];
  242. d[c[c.length - 1]] = b
  243. }, m.A = function(a, b, c) {
  244. a[b] = c
  245. }, m.version = "3.2.0", m.b("version", m.version), m.a = function() {
  246. function g(a, b) {
  247. for (var c in a) a.hasOwnProperty(c) && b(c, a[c])
  248. }
  249.  
  250. function h(a, b) {
  251. if (b)
  252. for (var c in b) b.hasOwnProperty(c) && (a[c] = b[c]);
  253. return a
  254. }
  255.  
  256. function i(a, b) {
  257. return a.__proto__ = b, a
  258. }
  259. var j = {
  260. __proto__: []
  261. }
  262. instanceof Array, k = {}, l = {};
  263. k[d && /Firefox\/2/i.test(d.userAgent) ? "KeyboardEvent" : "UIEvents"] = ["keyup", "keydown", "keypress"], k.MouseEvents = "click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave".split(" "), g(k, function(a, b) {
  264. if (b.length)
  265. for (var c = 0, d = b.length; c < d; c++) l[b[c]] = a
  266. });
  267. var n = {
  268. propertychange: !0
  269. },
  270. o = c && function() {
  271. for (var b = 3, d = c.createElement("div"), e = d.getElementsByTagName("i"); d.innerHTML = "<!--[if gt IE " + ++b + "]><i></i><![endif]-->", e[0];);
  272. return 4 < b ? b : a
  273. }();
  274. return {
  275. vb: ["authenticity_token", /^__RequestVerificationToken(_.*)?$/],
  276. u: function(a, b) {
  277. for (var c = 0, d = a.length; c < d; c++) b(a[c], c)
  278. },
  279. m: function(a, b) {
  280. if ("function" == typeof Array.prototype.indexOf) return Array.prototype.indexOf.call(a, b);
  281. for (var c = 0, d = a.length; c < d; c++)
  282. if (a[c] === b) return c;
  283. return -1
  284. },
  285. qb: function(a, b, c) {
  286. for (var d = 0, e = a.length; d < e; d++)
  287. if (b.call(c, a[d], d)) return a[d];
  288. return null
  289. },
  290. ua: function(a, b) {
  291. var c = m.a.m(a, b);
  292. 0 < c ? a.splice(c, 1) : 0 === c && a.shift()
  293. },
  294. rb: function(a) {
  295. a = a || [];
  296. for (var b = [], c = 0, d = a.length; c < d; c++) 0 > m.a.m(b, a[c]) && b.push(a[c]);
  297. return b
  298. },
  299. Da: function(a, b) {
  300. a = a || [];
  301. for (var c = [], d = 0, e = a.length; d < e; d++) c.push(b(a[d], d));
  302. return c
  303. },
  304. ta: function(a, b) {
  305. a = a || [];
  306. for (var c = [], d = 0, e = a.length; d < e; d++) b(a[d], d) && c.push(a[d]);
  307. return c
  308. },
  309. ga: function(a, b) {
  310. if (b instanceof Array) a.push.apply(a, b);
  311. else
  312. for (var c = 0, d = b.length; c < d; c++) a.push(b[c]);
  313. return a
  314. },
  315. ea: function(a, b, c) {
  316. var d = m.a.m(m.a.Xa(a), b);
  317. 0 > d ? c && a.push(b) : c || a.splice(d, 1)
  318. },
  319. xa: j,
  320. extend: h,
  321. za: i,
  322. Aa: j ? i : h,
  323. G: g,
  324. na: function(a, b) {
  325. if (!a) return a;
  326. var c, d = {};
  327. for (c in a) a.hasOwnProperty(c) && (d[c] = b(a[c], c, a));
  328. return d
  329. },
  330. Ka: function(a) {
  331. for (; a.firstChild;) m.removeNode(a.firstChild)
  332. },
  333. oc: function(a) {
  334. a = m.a.S(a);
  335. for (var b = c.createElement("div"), d = 0, e = a.length; d < e; d++) b.appendChild(m.R(a[d]));
  336. return b
  337. },
  338. ia: function(a, b) {
  339. for (var c = 0, d = a.length, e = []; c < d; c++) {
  340. var f = a[c].cloneNode(!0);
  341. e.push(b ? m.R(f) : f)
  342. }
  343. return e
  344. },
  345. T: function(a, b) {
  346. if (m.a.Ka(a), b)
  347. for (var c = 0, d = b.length; c < d; c++) a.appendChild(b[c])
  348. },
  349. Lb: function(a, b) {
  350. var c = a.nodeType ? [a] : a;
  351. if (0 < c.length) {
  352. for (var d = c[0], e = d.parentNode, f = 0, g = b.length; f < g; f++) e.insertBefore(b[f], d);
  353. for (f = 0, g = c.length; f < g; f++) m.removeNode(c[f])
  354. }
  355. },
  356. ka: function(a, b) {
  357. if (a.length) {
  358. for (b = 8 === b.nodeType && b.parentNode || b; a.length && a[0].parentNode !== b;) a.shift();
  359. if (1 < a.length) {
  360. var c = a[0],
  361. d = a[a.length - 1];
  362. for (a.length = 0; c !== d;)
  363. if (a.push(c), c = c.nextSibling, !c) return;
  364. a.push(d)
  365. }
  366. }
  367. return a
  368. },
  369. Nb: function(a, b) {
  370. 7 > o ? a.setAttribute("selected", b) : a.selected = b
  371. },
  372. cb: function(b) {
  373. return null === b || b === a ? "" : b.trim ? b.trim() : b.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, "")
  374. },
  375. vc: function(a, b) {
  376. return a = a || "", !(b.length > a.length) && a.substring(0, b.length) === b
  377. },
  378. cc: function(a, b) {
  379. if (a === b) return !0;
  380. if (11 === a.nodeType) return !1;
  381. if (b.contains) return b.contains(3 === a.nodeType ? a.parentNode : a);
  382. if (b.compareDocumentPosition) return 16 == (16 & b.compareDocumentPosition(a));
  383. for (; a && a != b;) a = a.parentNode;
  384. return !!a
  385. },
  386. Ja: function(a) {
  387. return m.a.cc(a, a.ownerDocument.documentElement)
  388. },
  389. ob: function(a) {
  390. return !!m.a.qb(a, m.a.Ja)
  391. },
  392. t: function(a) {
  393. return a && a.tagName && a.tagName.toLowerCase()
  394. },
  395. n: function(a, b, c) {
  396. var d = o && n[b];
  397. if (!d && e) e(a).bind(b, c);
  398. else if (d || "function" != typeof a.addEventListener) {
  399. if ("undefined" == typeof a.attachEvent) throw Error("Browser doesn't support addEventListener or attachEvent");
  400. var f = function(b) {
  401. c.call(a, b)
  402. },
  403. g = "on" + b;
  404. a.attachEvent(g, f), m.a.w.da(a, function() {
  405. a.detachEvent(g, f)
  406. })
  407. } else a.addEventListener(b, c, !1)
  408. },
  409. oa: function(a, d) {
  410. if (!a || !a.nodeType) throw Error("element must be a DOM node when calling triggerEvent");
  411. var f;
  412. if ("input" === m.a.t(a) && a.type && "click" == d.toLowerCase() ? (f = a.type, f = "checkbox" == f || "radio" == f) : f = !1, e && !f) e(a).trigger(d);
  413. else if ("function" == typeof c.createEvent) {
  414. if ("function" != typeof a.dispatchEvent) throw Error("The supplied element doesn't support dispatchEvent");
  415. f = c.createEvent(l[d] || "HTMLEvents"), f.initEvent(d, !0, !0, b, 0, 0, 0, 0, 0, !1, !1, !1, !1, 0, a), a.dispatchEvent(f)
  416. } else if (f && a.click) a.click();
  417. else {
  418. if ("undefined" == typeof a.fireEvent) throw Error("Browser doesn't support triggering events");
  419. a.fireEvent("on" + d)
  420. }
  421. },
  422. c: function(a) {
  423. return m.C(a) ? a() : a
  424. },
  425. Xa: function(a) {
  426. return m.C(a) ? a.v() : a
  427. },
  428. Ba: function(a, b, c) {
  429. if (b) {
  430. var d = /\S+/g,
  431. e = a.className.match(d) || [];
  432. m.a.u(b.match(d), function(a) {
  433. m.a.ea(e, a, c)
  434. }), a.className = e.join(" ")
  435. }
  436. },
  437. bb: function(b, c) {
  438. var d = m.a.c(c);
  439. null !== d && d !== a || (d = "");
  440. var e = m.f.firstChild(b);
  441. !e || 3 != e.nodeType || m.f.nextSibling(e) ? m.f.T(b, [b.ownerDocument.createTextNode(d)]) : e.data = d, m.a.fc(b)
  442. },
  443. Mb: function(a, b) {
  444. if (a.name = b, 7 >= o) try {
  445. a.mergeAttributes(c.createElement("<input name='" + a.name + "'/>"), !1)
  446. } catch (a) {}
  447. },
  448. fc: function(a) {
  449. 9 <= o && (a = 1 == a.nodeType ? a : a.parentNode, a.style && (a.style.zoom = a.style.zoom))
  450. },
  451. dc: function(a) {
  452. if (o) {
  453. var b = a.style.width;
  454. a.style.width = 0, a.style.width = b
  455. }
  456. },
  457. sc: function(a, b) {
  458. a = m.a.c(a), b = m.a.c(b);
  459. for (var c = [], d = a; d <= b; d++) c.push(d);
  460. return c
  461. },
  462. S: function(a) {
  463. for (var b = [], c = 0, d = a.length; c < d; c++) b.push(a[c]);
  464. return b
  465. },
  466. yc: 6 === o,
  467. zc: 7 === o,
  468. L: o,
  469. xb: function(a, b) {
  470. for (var c = m.a.S(a.getElementsByTagName("input")).concat(m.a.S(a.getElementsByTagName("textarea"))), d = "string" == typeof b ? function(a) {
  471. return a.name === b
  472. } : function(a) {
  473. return b.test(a.name)
  474. }, e = [], f = c.length - 1; 0 <= f; f--) d(c[f]) && e.push(c[f]);
  475. return e
  476. },
  477. pc: function(a) {
  478. return "string" == typeof a && (a = m.a.cb(a)) ? f && f.parse ? f.parse(a) : new Function("return " + a)() : null
  479. },
  480. eb: function(a, b, c) {
  481. if (!f || !f.stringify) throw Error("Cannot find JSON.stringify(). Some browsers (e.g., IE < 8) don't support it natively, but you can overcome this by adding a script reference to json2.js, downloadable from http://www.json.org/json2.js");
  482. return f.stringify(m.a.c(a), b, c)
  483. },
  484. qc: function(a, b, d) {
  485. d = d || {};
  486. var e = d.params || {},
  487. f = d.includeFields || this.vb,
  488. h = a;
  489. if ("object" == typeof a && "form" === m.a.t(a))
  490. for (var h = a.action, i = f.length - 1; 0 <= i; i--)
  491. for (var j = m.a.xb(a, f[i]), k = j.length - 1; 0 <= k; k--) e[j[k].name] = j[k].value;
  492. b = m.a.c(b);
  493. var l = c.createElement("form");
  494. l.style.display = "none", l.action = h, l.method = "post";
  495. for (var n in b) a = c.createElement("input"), a.type = "hidden", a.name = n, a.value = m.a.eb(m.a.c(b[n])), l.appendChild(a);
  496. g(e, function(a, b) {
  497. var d = c.createElement("input");
  498. d.type = "hidden", d.name = a, d.value = b, l.appendChild(d)
  499. }), c.body.appendChild(l), d.submitter ? d.submitter(l) : l.submit(), setTimeout(function() {
  500. l.parentNode.removeChild(l)
  501. }, 0)
  502. }
  503. }
  504. }(), m.b("utils", m.a), m.b("utils.arrayForEach", m.a.u), m.b("utils.arrayFirst", m.a.qb), m.b("utils.arrayFilter", m.a.ta), m.b("utils.arrayGetDistinctValues", m.a.rb), m.b("utils.arrayIndexOf", m.a.m), m.b("utils.arrayMap", m.a.Da), m.b("utils.arrayPushAll", m.a.ga), m.b("utils.arrayRemoveItem", m.a.ua), m.b("utils.extend", m.a.extend), m.b("utils.fieldsIncludedWithJsonPost", m.a.vb), m.b("utils.getFormFields", m.a.xb), m.b("utils.peekObservable", m.a.Xa), m.b("utils.postJson", m.a.qc), m.b("utils.parseJson", m.a.pc), m.b("utils.registerEventHandler", m.a.n), m.b("utils.stringifyJson", m.a.eb), m.b("utils.range", m.a.sc), m.b("utils.toggleDomNodeCssClass", m.a.Ba), m.b("utils.triggerEvent", m.a.oa), m.b("utils.unwrapObservable", m.a.c), m.b("utils.objectForEach", m.a.G), m.b("utils.addOrRemoveItem", m.a.ea), m.b("unwrap", m.a.c), Function.prototype.bind || (Function.prototype.bind = function(a) {
  505. var b = this,
  506. c = Array.prototype.slice.call(arguments);
  507. return a = c.shift(),
  508. function() {
  509. return b.apply(a, c.concat(Array.prototype.slice.call(arguments)))
  510. }
  511. }), m.a.e = new function() {
  512. function b(b, f) {
  513. var g = b[d];
  514. if (!g || "null" === g || !e[g]) {
  515. if (!f) return a;
  516. g = b[d] = "ko" + c++, e[g] = {}
  517. }
  518. return e[g]
  519. }
  520. var c = 0,
  521. d = "__ko__" + (new Date).getTime(),
  522. e = {};
  523. return {
  524. get: function(c, d) {
  525. var e = b(c, !1);
  526. return e === a ? a : e[d]
  527. },
  528. set: function(c, d, e) {
  529. e === a && b(c, !1) === a || (b(c, !0)[d] = e)
  530. },
  531. clear: function(a) {
  532. var b = a[d];
  533. return !!b && (delete e[b], a[d] = null, !0)
  534. },
  535. F: function() {
  536. return c++ + d
  537. }
  538. }
  539. }, m.b("utils.domData", m.a.e), m.b("utils.domData.clear", m.a.e.clear), m.a.w = new function() {
  540. function b(b, c) {
  541. var e = m.a.e.get(b, d);
  542. return e === a && c && (e = [], m.a.e.set(b, d, e)), e
  543. }
  544.  
  545. function c(a) {
  546. var d = b(a, !1);
  547. if (d)
  548. for (var d = d.slice(0), e = 0; e < d.length; e++) d[e](a);
  549. if (m.a.e.clear(a), m.a.w.cleanExternalData(a), g[a.nodeType])
  550. for (d = a.firstChild; a = d;) d = a.nextSibling, 8 === a.nodeType && c(a)
  551. }
  552. var d = m.a.e.F(),
  553. f = {
  554. 1: !0,
  555. 8: !0,
  556. 9: !0
  557. },
  558. g = {
  559. 1: !0,
  560. 9: !0
  561. };
  562. return {
  563. da: function(a, c) {
  564. if ("function" != typeof c) throw Error("Callback must be a function");
  565. b(a, !0).push(c)
  566. },
  567. Kb: function(c, e) {
  568. var f = b(c, !1);
  569. f && (m.a.ua(f, e), 0 == f.length && m.a.e.set(c, d, a))
  570. },
  571. R: function(a) {
  572. if (f[a.nodeType] && (c(a), g[a.nodeType])) {
  573. var b = [];
  574. m.a.ga(b, a.getElementsByTagName("*"));
  575. for (var d = 0, e = b.length; d < e; d++) c(b[d])
  576. }
  577. return a
  578. },
  579. removeNode: function(a) {
  580. m.R(a), a.parentNode && a.parentNode.removeChild(a)
  581. },
  582. cleanExternalData: function(a) {
  583. e && "function" == typeof e.cleanData && e.cleanData([a])
  584. }
  585. }
  586. }, m.R = m.a.w.R, m.removeNode = m.a.w.removeNode, m.b("cleanNode", m.R), m.b("removeNode", m.removeNode), m.b("utils.domNodeDisposal", m.a.w), m.b("utils.domNodeDisposal.addDisposeCallback", m.a.w.da), m.b("utils.domNodeDisposal.removeDisposeCallback", m.a.w.Kb),
  587. function() {
  588. m.a.ba = function(a) {
  589. var d;
  590. if (e) {
  591. if (e.parseHTML) d = e.parseHTML(a) || [];
  592. else if ((d = e.clean([a])) && d[0]) {
  593. for (a = d[0]; a.parentNode && 11 !== a.parentNode.nodeType;) a = a.parentNode;
  594. a.parentNode && a.parentNode.removeChild(a)
  595. }
  596. } else {
  597. var f = m.a.cb(a).toLowerCase();
  598. for (d = c.createElement("div"), f = f.match(/^<(thead|tbody|tfoot)/) && [1, "<table>", "</table>"] || !f.indexOf("<tr") && [2, "<table><tbody>", "</tbody></table>"] || (!f.indexOf("<td") || !f.indexOf("<th")) && [3, "<table><tbody><tr>", "</tr></tbody></table>"] || [0, "", ""], a = "ignored<div>" + f[1] + a + f[2] + "</div>", "function" == typeof b.innerShiv ? d.appendChild(b.innerShiv(a)) : d.innerHTML = a; f[0]--;) d = d.lastChild;
  599. d = m.a.S(d.lastChild.childNodes)
  600. }
  601. return d
  602. }, m.a.$a = function(b, c) {
  603. if (m.a.Ka(b), c = m.a.c(c), null !== c && c !== a)
  604. if ("string" != typeof c && (c = c.toString()), e) e(b).html(c);
  605. else
  606. for (var d = m.a.ba(c), f = 0; f < d.length; f++) b.appendChild(d[f])
  607. }
  608. }(), m.b("utils.parseHtmlFragment", m.a.ba), m.b("utils.setHtml", m.a.$a), m.D = function() {
  609. function b(a, c) {
  610. if (a)
  611. if (8 == a.nodeType) {
  612. var d = m.D.Gb(a.nodeValue);
  613. null != d && c.push({
  614. bc: a,
  615. mc: d
  616. })
  617. } else if (1 == a.nodeType)
  618. for (var d = 0, e = a.childNodes, f = e.length; d < f; d++) b(e[d], c)
  619. }
  620. var c = {};
  621. return {
  622. Ua: function(a) {
  623. if ("function" != typeof a) throw Error("You can only pass a function to ko.memoization.memoize()");
  624. var b = (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1) + (4294967296 * (1 + Math.random()) | 0).toString(16).substring(1);
  625. return c[b] = a, "<!--[ko_memo:" + b + "]-->"
  626. },
  627. Rb: function(b, d) {
  628. var e = c[b];
  629. if (e === a) throw Error("Couldn't find any memo with ID " + b + ". Perhaps it's already been unmemoized.");
  630. try {
  631. return e.apply(null, d || []), !0
  632. } finally {
  633. delete c[b]
  634. }
  635. },
  636. Sb: function(a, c) {
  637. var d = [];
  638. b(a, d);
  639. for (var e = 0, f = d.length; e < f; e++) {
  640. var g = d[e].bc,
  641. h = [g];
  642. c && m.a.ga(h, c), m.D.Rb(d[e].mc, h), g.nodeValue = "", g.parentNode && g.parentNode.removeChild(g)
  643. }
  644. },
  645. Gb: function(a) {
  646. return (a = a.match(/^\[ko_memo\:(.*?)\]$/)) ? a[1] : null
  647. }
  648. }
  649. }(), m.b("memoization", m.D), m.b("memoization.memoize", m.D.Ua), m.b("memoization.unmemoize", m.D.Rb), m.b("memoization.parseMemoText", m.D.Gb), m.b("memoization.unmemoizeDomNodeAndDescendants", m.D.Sb), m.La = {
  650. throttle: function(a, b) {
  651. a.throttleEvaluation = b;
  652. var c = null;
  653. return m.j({
  654. read: a,
  655. write: function(d) {
  656. clearTimeout(c), c = setTimeout(function() {
  657. a(d)
  658. }, b)
  659. }
  660. })
  661. },
  662. rateLimit: function(a, b) {
  663. var c, d, e;
  664. "number" == typeof b ? c = b : (c = b.timeout, d = b.method), e = "notifyWhenChangesStop" == d ? k : j, a.Ta(function(a) {
  665. return e(a, c)
  666. })
  667. },
  668. notify: function(a, b) {
  669. a.equalityComparer = "always" == b ? null : i
  670. }
  671. };
  672. var n = {
  673. undefined: 1,
  674. boolean: 1,
  675. number: 1,
  676. string: 1
  677. };
  678. m.b("extenders", m.La), m.Pb = function(a, b, c) {
  679. this.target = a, this.wa = b, this.ac = c, this.Cb = !1, m.A(this, "dispose", this.K)
  680. }, m.Pb.prototype.K = function() {
  681. this.Cb = !0, this.ac()
  682. }, m.P = function() {
  683. m.a.Aa(this, m.P.fn), this.M = {}
  684. };
  685. var o = "change",
  686. p = {
  687. U: function(a, b, c) {
  688. var d = this;
  689. c = c || o;
  690. var e = new m.Pb(d, b ? a.bind(b) : a, function() {
  691. m.a.ua(d.M[c], e), d.nb && d.nb()
  692. });
  693. return d.va && d.va(c), d.M[c] || (d.M[c] = []), d.M[c].push(e), e
  694. },
  695. notifySubscribers: function(a, b) {
  696. if (b = b || o, this.Ab(b)) try {
  697. m.k.Ea();
  698. for (var c, d = this.M[b].slice(0), e = 0; c = d[e]; ++e) c.Cb || c.wa(a)
  699. } finally {
  700. m.k.end()
  701. }
  702. },
  703. Ta: function(a) {
  704. var b, c, d, e = this,
  705. f = m.C(e);
  706. e.qa || (e.qa = e.notifySubscribers, e.notifySubscribers = function(a, b) {
  707. b && b !== o ? "beforeChange" === b ? e.kb(a) : e.qa(a, b) : e.lb(a)
  708. });
  709. var g = a(function() {
  710. f && d === e && (d = e()), b = !1, e.Pa(c, d) && e.qa(c = d)
  711. });
  712. e.lb = function(a) {
  713. b = !0, d = a, g()
  714. }, e.kb = function(a) {
  715. b || (c = a, e.qa(a, "beforeChange"))
  716. }
  717. },
  718. Ab: function(a) {
  719. return this.M[a] && this.M[a].length
  720. },
  721. yb: function() {
  722. var a = 0;
  723. return m.a.G(this.M, function(b, c) {
  724. a += c.length
  725. }), a
  726. },
  727. Pa: function(a, b) {
  728. return !this.equalityComparer || !this.equalityComparer(a, b)
  729. },
  730. extend: function(a) {
  731. var b = this;
  732. return a && m.a.G(a, function(a, c) {
  733. var d = m.La[a];
  734. "function" == typeof d && (b = d(b, c) || b)
  735. }), b
  736. }
  737. };
  738. m.A(p, "subscribe", p.U), m.A(p, "extend", p.extend), m.A(p, "getSubscriptionsCount", p.yb), m.a.xa && m.a.za(p, Function.prototype), m.P.fn = p, m.Db = function(a) {
  739. return null != a && "function" == typeof a.U && "function" == typeof a.notifySubscribers
  740. }, m.b("subscribable", m.P), m.b("isSubscribable", m.Db), m.Y = m.k = function() {
  741. function a(a) {
  742. d.push(c), c = a
  743. }
  744.  
  745. function b() {
  746. c = d.pop()
  747. }
  748. var c, d = [],
  749. e = 0;
  750. return {
  751. Ea: a,
  752. end: b,
  753. Jb: function(a) {
  754. if (c) {
  755. if (!m.Db(a)) throw Error("Only subscribable things can act as dependencies");
  756. c.wa(a, a.Vb || (a.Vb = ++e))
  757. }
  758. },
  759. B: function(c, d, e) {
  760. try {
  761. return a(), c.apply(d, e || [])
  762. } finally {
  763. b()
  764. }
  765. },
  766. la: function() {
  767. if (c) return c.s.la()
  768. },
  769. ma: function() {
  770. if (c) return c.ma
  771. }
  772. }
  773. }(), m.b("computedContext", m.Y), m.b("computedContext.getDependenciesCount", m.Y.la), m.b("computedContext.isInitial", m.Y.ma), m.b("computedContext.isSleeping", m.Y.Ac), m.p = function(a) {
  774. function b() {
  775. return 0 < arguments.length ? (b.Pa(c, arguments[0]) && (b.X(), c = arguments[0], b.W()), this) : (m.k.Jb(b), c)
  776. }
  777. var c = a;
  778. return m.P.call(b), m.a.Aa(b, m.p.fn), b.v = function() {
  779. return c
  780. }, b.W = function() {
  781. b.notifySubscribers(c)
  782. }, b.X = function() {
  783. b.notifySubscribers(c, "beforeChange")
  784. }, m.A(b, "peek", b.v), m.A(b, "valueHasMutated", b.W), m.A(b, "valueWillMutate", b.X), b
  785. }, m.p.fn = {
  786. equalityComparer: i
  787. };
  788. var q = m.p.rc = "__ko_proto__";
  789. m.p.fn[q] = m.p, m.a.xa && m.a.za(m.p.fn, m.P.fn), m.Ma = function(b, c) {
  790. return null !== b && b !== a && b[q] !== a && (b[q] === c || m.Ma(b[q], c))
  791. }, m.C = function(a) {
  792. return m.Ma(a, m.p)
  793. }, m.Ra = function(a) {
  794. return !!("function" == typeof a && a[q] === m.p || "function" == typeof a && a[q] === m.j && a.hc)
  795. }, m.b("observable", m.p), m.b("isObservable", m.C), m.b("isWriteableObservable", m.Ra), m.b("isWritableObservable", m.Ra), m.aa = function(a) {
  796. if (a = a || [], "object" != typeof a || !("length" in a)) throw Error("The argument passed when initializing an observable array must be an array, or null, or undefined.");
  797. return a = m.p(a), m.a.Aa(a, m.aa.fn), a.extend({
  798. trackArrayChanges: !0
  799. })
  800. }, m.aa.fn = {
  801. remove: function(a) {
  802. for (var b = this.v(), c = [], d = "function" != typeof a || m.C(a) ? function(b) {
  803. return b === a
  804. } : a, e = 0; e < b.length; e++) {
  805. var f = b[e];
  806. d(f) && (0 === c.length && this.X(), c.push(f), b.splice(e, 1), e--)
  807. }
  808. return c.length && this.W(), c
  809. },
  810. removeAll: function(b) {
  811. if (b === a) {
  812. var c = this.v(),
  813. d = c.slice(0);
  814. return this.X(), c.splice(0, c.length), this.W(), d
  815. }
  816. return b ? this.remove(function(a) {
  817. return 0 <= m.a.m(b, a)
  818. }) : []
  819. },
  820. destroy: function(a) {
  821. var b = this.v(),
  822. c = "function" != typeof a || m.C(a) ? function(b) {
  823. return b === a
  824. } : a;
  825. this.X();
  826. for (var d = b.length - 1; 0 <= d; d--) c(b[d]) && (b[d]._destroy = !0);
  827. this.W()
  828. },
  829. destroyAll: function(b) {
  830. return b === a ? this.destroy(function() {
  831. return !0
  832. }) : b ? this.destroy(function(a) {
  833. return 0 <= m.a.m(b, a)
  834. }) : []
  835. },
  836. indexOf: function(a) {
  837. var b = this();
  838. return m.a.m(b, a)
  839. },
  840. replace: function(a, b) {
  841. var c = this.indexOf(a);
  842. 0 <= c && (this.X(), this.v()[c] = b, this.W())
  843. }
  844. }, m.a.u("pop push reverse shift sort splice unshift".split(" "), function(a) {
  845. m.aa.fn[a] = function() {
  846. var b = this.v();
  847. return this.X(), this.sb(b, a, arguments), b = b[a].apply(b, arguments), this.W(), b
  848. }
  849. }), m.a.u(["slice"], function(a) {
  850. m.aa.fn[a] = function() {
  851. var b = this();
  852. return b[a].apply(b, arguments)
  853. }
  854. }), m.a.xa && m.a.za(m.aa.fn, m.p.fn), m.b("observableArray", m.aa);
  855. var r = "arrayChange";
  856. m.La.trackArrayChanges = function(a) {
  857. function b() {
  858. if (!c) {
  859. c = !0;
  860. var b = a.notifySubscribers;
  861. a.notifySubscribers = function(a, c) {
  862. return c && c !== o || ++e, b.apply(this, arguments)
  863. };
  864. var f = [].concat(a.v() || []);
  865. d = null, a.U(function(b) {
  866. if (b = [].concat(b || []), a.Ab(r)) {
  867. var c;
  868. (!d || 1 < e) && (d = m.a.Fa(f, b, {
  869. sparse: !0
  870. })), c = d, c.length && a.notifySubscribers(c, r)
  871. }
  872. f = b, d = null, e = 0
  873. })
  874. }
  875. }
  876. if (!a.sb) {
  877. var c = !1,
  878. d = null,
  879. e = 0,
  880. f = a.U;
  881. a.U = a.subscribe = function(a, c, d) {
  882. return d === r && b(), f.apply(this, arguments)
  883. }, a.sb = function(a, b, f) {
  884. function g(a, b, c) {
  885. return h[h.length] = {
  886. status: a,
  887. value: b,
  888. index: c
  889. }
  890. }
  891. if (c && !e) {
  892. var h = [],
  893. i = a.length,
  894. j = f.length,
  895. k = 0;
  896. switch (b) {
  897. case "push":
  898. k = i;
  899. case "unshift":
  900. for (b = 0; b < j; b++) g("added", f[b], k + b);
  901. break;
  902. case "pop":
  903. k = i - 1;
  904. case "shift":
  905. i && g("deleted", a[k], k);
  906. break;
  907. case "splice":
  908. b = Math.min(Math.max(0, 0 > f[0] ? i + f[0] : f[0]), i);
  909. for (var i = 1 === j ? i : Math.min(b + (f[1] || 0), i), j = b + j - 2, k = Math.max(i, j), l = [], n = [], o = 2; b < k; ++b, ++o) b < i && n.push(g("deleted", a[b], b)), b < j && l.push(g("added", f[o], b));
  910. m.a.wb(n, l);
  911. break;
  912. default:
  913. return
  914. }
  915. d = h
  916. }
  917. }
  918. }
  919. }, m.s = m.j = function(b, c, d) {
  920. function e() {
  921. m.a.G(z, function(a, b) {
  922. b.K()
  923. }), z = {}
  924. }
  925.  
  926. function f() {
  927. e(), A = 0, q = !0, n = !1
  928. }
  929.  
  930. function g() {
  931. var a = i.throttleEvaluation;
  932. a && 0 <= a ? (clearTimeout(B), B = setTimeout(h, a)) : i.ib ? i.ib() : h()
  933. }
  934.  
  935. function h(b) {
  936. if (o) {
  937. if (s) throw Error("A 'pure' computed must not be called recursively")
  938. } else if (!q) {
  939. if (x && x()) {
  940. if (!p) return void y()
  941. } else p = !1;
  942. if (o = !0, t) try {
  943. var d = {};
  944. m.k.Ea({
  945. wa: function(a, b) {
  946. d[b] || (d[b] = 1, ++A)
  947. },
  948. s: i,
  949. ma: a
  950. }), A = 0, l = r.call(c)
  951. } finally {
  952. m.k.end(), o = !1
  953. } else try {
  954. var e = z,
  955. f = A;
  956. m.k.Ea({
  957. wa: function(a, b) {
  958. q || (f && e[b] ? (z[b] = e[b], ++A, delete e[b], --f) : z[b] || (z[b] = a.U(g), ++A))
  959. },
  960. s: i,
  961. ma: s ? a : !A
  962. }), z = {}, A = 0;
  963. try {
  964. var h = c ? r.call(c) : r()
  965. } finally {
  966. m.k.end(), f && m.a.G(e, function(a, b) {
  967. b.K()
  968. }), n = !1
  969. }
  970. i.Pa(l, h) && (i.notifySubscribers(l, "beforeChange"), l = h, !0 !== b && i.notifySubscribers(l))
  971. } finally {
  972. o = !1
  973. }
  974. A || y()
  975. }
  976. }
  977.  
  978. function i() {
  979. if (0 < arguments.length) {
  980. if ("function" != typeof u) throw Error("Cannot write a value to a ko.computed unless you specify a 'write' option. If you wish to read the current value, don't pass any parameters.");
  981. return u.apply(c, arguments), this
  982. }
  983. return m.k.Jb(i), n && h(!0), l
  984. }
  985.  
  986. function j() {
  987. return n && !A && h(!0), l
  988. }
  989.  
  990. function k() {
  991. return n || 0 < A
  992. }
  993. var l, n = !0,
  994. o = !1,
  995. p = !1,
  996. q = !1,
  997. r = b,
  998. s = !1,
  999. t = !1;
  1000. if (r && "object" == typeof r ? (d = r, r = d.read) : (d = d || {}, r || (r = d.read)), "function" != typeof r) throw Error("Pass a function that returns the value of the ko.computed");
  1001. var u = d.write,
  1002. v = d.disposeWhenNodeIsRemoved || d.o || null,
  1003. w = d.disposeWhen || d.Ia,
  1004. x = w,
  1005. y = f,
  1006. z = {},
  1007. A = 0,
  1008. B = null;
  1009. c || (c = d.owner), m.P.call(i), m.a.Aa(i, m.j.fn), i.v = j, i.la = function() {
  1010. return A
  1011. }, i.hc = "function" == typeof d.write, i.K = function() {
  1012. y()
  1013. }, i.Z = k;
  1014. var C = i.Ta;
  1015. return i.Ta = function(a) {
  1016. C.call(i, a), i.ib = function() {
  1017. i.kb(l), n = !0, i.lb(i)
  1018. }
  1019. }, d.pure ? (t = s = !0, i.va = function() {
  1020. t && (t = !1, h(!0))
  1021. }, i.nb = function() {
  1022. i.yb() || (e(), t = n = !0)
  1023. }) : d.deferEvaluation && (i.va = function() {
  1024. j(), delete i.va
  1025. }), m.A(i, "peek", i.v), m.A(i, "dispose", i.K), m.A(i, "isActive", i.Z), m.A(i, "getDependenciesCount", i.la), v && (p = !0, v.nodeType && (x = function() {
  1026. return !m.a.Ja(v) || w && w()
  1027. })), t || d.deferEvaluation || h(), v && k() && v.nodeType && (y = function() {
  1028. m.a.w.Kb(v, y), f()
  1029. }, m.a.w.da(v, y)), i
  1030. }, m.jc = function(a) {
  1031. return m.Ma(a, m.j)
  1032. }, p = m.p.rc, m.j[p] = m.p, m.j.fn = {
  1033. equalityComparer: i
  1034. }, m.j.fn[p] = m.j, m.a.xa && m.a.za(m.j.fn, m.P.fn), m.b("dependentObservable", m.j), m.b("computed", m.j), m.b("isComputed", m.jc), m.Ib = function(a, b) {
  1035. return "function" == typeof a ? m.s(a, b, {
  1036. pure: !0
  1037. }) : (a = m.a.extend({}, a), a.pure = !0, m.s(a, b))
  1038. }, m.b("pureComputed", m.Ib),
  1039. function() {
  1040. function b(e, f, g) {
  1041. if (g = g || new d, e = f(e), "object" != typeof e || null === e || e === a || e instanceof Date || e instanceof String || e instanceof Number || e instanceof Boolean) return e;
  1042. var h = e instanceof Array ? [] : {};
  1043. return g.save(e, h), c(e, function(c) {
  1044. var d = f(e[c]);
  1045. switch (typeof d) {
  1046. case "boolean":
  1047. case "number":
  1048. case "string":
  1049. case "function":
  1050. h[c] = d;
  1051. break;
  1052. case "object":
  1053. case "undefined":
  1054. var i = g.get(d);
  1055. h[c] = i !== a ? i : b(d, f, g)
  1056. }
  1057. }), h
  1058. }
  1059.  
  1060. function c(a, b) {
  1061. if (a instanceof Array) {
  1062. for (var c = 0; c < a.length; c++) b(c);
  1063. "function" == typeof a.toJSON && b("toJSON")
  1064. } else
  1065. for (c in a) b(c)
  1066. }
  1067.  
  1068. function d() {
  1069. this.keys = [], this.hb = []
  1070. }
  1071. m.Qb = function(a) {
  1072. if (0 == arguments.length) throw Error("When calling ko.toJS, pass the object you want to convert.");
  1073. return b(a, function(a) {
  1074. for (var b = 0; m.C(a) && 10 > b; b++) a = a();
  1075. return a
  1076. })
  1077. }, m.toJSON = function(a, b, c) {
  1078. return a = m.Qb(a), m.a.eb(a, b, c)
  1079. }, d.prototype = {
  1080. save: function(a, b) {
  1081. var c = m.a.m(this.keys, a);
  1082. 0 <= c ? this.hb[c] = b : (this.keys.push(a), this.hb.push(b))
  1083. },
  1084. get: function(b) {
  1085. return b = m.a.m(this.keys, b), 0 <= b ? this.hb[b] : a
  1086. }
  1087. }
  1088. }(), m.b("toJS", m.Qb), m.b("toJSON", m.toJSON),
  1089. function() {
  1090. m.i = {
  1091. q: function(b) {
  1092. switch (m.a.t(b)) {
  1093. case "option":
  1094. return !0 === b.__ko__hasDomDataOptionValue__ ? m.a.e.get(b, m.d.options.Va) : 7 >= m.a.L ? b.getAttributeNode("value") && b.getAttributeNode("value").specified ? b.value : b.text : b.value;
  1095. case "select":
  1096. return 0 <= b.selectedIndex ? m.i.q(b.options[b.selectedIndex]) : a;
  1097. default:
  1098. return b.value
  1099. }
  1100. },
  1101. ca: function(b, c, d) {
  1102. switch (m.a.t(b)) {
  1103. case "option":
  1104. switch (typeof c) {
  1105. case "string":
  1106. m.a.e.set(b, m.d.options.Va, a), "__ko__hasDomDataOptionValue__" in b && delete b.__ko__hasDomDataOptionValue__, b.value = c;
  1107. break;
  1108. default:
  1109. m.a.e.set(b, m.d.options.Va, c), b.__ko__hasDomDataOptionValue__ = !0, b.value = "number" == typeof c ? c : ""
  1110. }
  1111. break;
  1112. case "select":
  1113. "" !== c && null !== c || (c = a);
  1114. for (var e, f = -1, g = 0, h = b.options.length; g < h; ++g)
  1115. if (e = m.i.q(b.options[g]), e == c || "" == e && c === a) {
  1116. f = g;
  1117. break
  1118. }(d || 0 <= f || c === a && 1 < b.size) && (b.selectedIndex = f);
  1119. break;
  1120. default:
  1121. null !== c && c !== a || (c = ""), b.value = c
  1122. }
  1123. }
  1124. }
  1125. }(), m.b("selectExtensions", m.i), m.b("selectExtensions.readValue", m.i.q), m.b("selectExtensions.writeValue", m.i.ca), m.h = function() {
  1126. function a(a) {
  1127. a = m.a.cb(a), 123 === a.charCodeAt(0) && (a = a.slice(1, -1));
  1128. var b, c, g = [],
  1129. h = a.match(d),
  1130. i = 0;
  1131. if (h) {
  1132. h.push(",");
  1133. for (var j, k = 0; j = h[k]; ++k) {
  1134. var l = j.charCodeAt(0);
  1135. if (44 === l) {
  1136. if (0 >= i) {
  1137. b && g.push(c ? {
  1138. key: b,
  1139. value: c.join("")
  1140. } : {
  1141. unknown: b
  1142. }), b = c = i = 0;
  1143. continue
  1144. }
  1145. } else if (58 === l) {
  1146. if (!c) continue
  1147. } else if (47 === l && k && 1 < j.length)(l = h[k - 1].match(e)) && !f[l[0]] && (a = a.substr(a.indexOf(j) + 1), h = a.match(d), h.push(","), k = -1, j = "/");
  1148. else if (40 === l || 123 === l || 91 === l) ++i;
  1149. else if (41 === l || 125 === l || 93 === l) --i;
  1150. else if (!b && !c) {
  1151. b = 34 === l || 39 === l ? j.slice(1, -1) : j;
  1152. continue
  1153. }
  1154. c ? c.push(j) : c = [j]
  1155. }
  1156. }
  1157. return g
  1158. }
  1159. var b = ["true", "false", "null", "undefined"],
  1160. c = /^(?:[$_a-z][$\w]*|(.+)(\.\s*[$_a-z][$\w]*|\[.+\]))$/i,
  1161. d = RegExp("\"(?:[^\"\\\\]|\\\\.)*\"|'(?:[^'\\\\]|\\\\.)*'|/(?:[^/\\\\]|\\\\.)*/w*|[^\\s:,/][^,\"'{}()/:[\\]]*[^\\s,\"'{}()/:[\\]]|[^\\s]", "g"),
  1162. e = /[\])"'A-Za-z0-9_$]+$/,
  1163. f = { in: 1,
  1164. return: 1,
  1165. typeof: 1
  1166. },
  1167. g = {};
  1168. return {
  1169. ha: [],
  1170. V: g,
  1171. Wa: a,
  1172. ya: function(d, e) {
  1173. function f(a, d) {
  1174. var e;
  1175. if (!k) {
  1176. var l = m.getBindingHandler(a);
  1177. if (l && l.preprocess && !(d = l.preprocess(d, a, f))) return;
  1178. (l = g[a]) && (e = d, 0 <= m.a.m(b, e) ? e = !1 : (l = e.match(c), e = null !== l && (l[1] ? "Object(" + l[1] + ")" + l[2] : e)), l = e), l && i.push("'" + a + "':function(_z){" + e + "=_z}")
  1179. }
  1180. j && (d = "function(){return " + d + " }"), h.push("'" + a + "':" + d)
  1181. }
  1182. e = e || {};
  1183. var h = [],
  1184. i = [],
  1185. j = e.valueAccessors,
  1186. k = e.bindingParams,
  1187. l = "string" == typeof d ? a(d) : d;
  1188. return m.a.u(l, function(a) {
  1189. f(a.key || a.unknown, a.value)
  1190. }), i.length && f("_ko_property_writers", "{" + i.join(",") + " }"), h.join(",")
  1191. },
  1192. lc: function(a, b) {
  1193. for (var c = 0; c < a.length; c++)
  1194. if (a[c].key == b) return !0;
  1195. return !1
  1196. },
  1197. pa: function(a, b, c, d, e) {
  1198. a && m.C(a) ? !m.Ra(a) || e && a.v() === d || a(d) : (a = b.get("_ko_property_writers")) && a[c] && a[c](d)
  1199. }
  1200. }
  1201. }(), m.b("expressionRewriting", m.h), m.b("expressionRewriting.bindingRewriteValidators", m.h.ha), m.b("expressionRewriting.parseObjectLiteral", m.h.Wa), m.b("expressionRewriting.preProcessBindings", m.h.ya), m.b("expressionRewriting._twoWayBindings", m.h.V), m.b("jsonExpressionRewriting", m.h), m.b("jsonExpressionRewriting.insertPropertyAccessorsIntoJson", m.h.ya),
  1202. function() {
  1203. function a(a) {
  1204. return 8 == a.nodeType && g.test(f ? a.text : a.nodeValue)
  1205. }
  1206.  
  1207. function b(a) {
  1208. return 8 == a.nodeType && h.test(f ? a.text : a.nodeValue)
  1209. }
  1210.  
  1211. function d(c, d) {
  1212. for (var e = c, f = 1, g = []; e = e.nextSibling;) {
  1213. if (b(e) && (f--, 0 === f)) return g;
  1214. g.push(e), a(e) && f++
  1215. }
  1216. if (!d) throw Error("Cannot find closing comment tag to match: " + c.nodeValue);
  1217. return null
  1218. }
  1219.  
  1220. function e(a, b) {
  1221. var c = d(a, b);
  1222. return c ? 0 < c.length ? c[c.length - 1].nextSibling : a.nextSibling : null
  1223. }
  1224. var f = c && "<!--test-->" === c.createComment("test").text,
  1225. g = f ? /^\x3c!--\s*ko(?:\s+([\s\S]+))?\s*--\x3e$/ : /^\s*ko(?:\s+([\s\S]+))?\s*$/,
  1226. h = f ? /^\x3c!--\s*\/ko\s*--\x3e$/ : /^\s*\/ko\s*$/,
  1227. i = {
  1228. ul: !0,
  1229. ol: !0
  1230. };
  1231. m.f = {
  1232. Q: {},
  1233. childNodes: function(b) {
  1234. return a(b) ? d(b) : b.childNodes
  1235. },
  1236. ja: function(b) {
  1237. if (a(b)) {
  1238. b = m.f.childNodes(b);
  1239. for (var c = 0, d = b.length; c < d; c++) m.removeNode(b[c])
  1240. } else m.a.Ka(b)
  1241. },
  1242. T: function(b, c) {
  1243. if (a(b)) {
  1244. m.f.ja(b);
  1245. for (var d = b.nextSibling, e = 0, f = c.length; e < f; e++) d.parentNode.insertBefore(c[e], d)
  1246. } else m.a.T(b, c)
  1247. },
  1248. Hb: function(b, c) {
  1249. a(b) ? b.parentNode.insertBefore(c, b.nextSibling) : b.firstChild ? b.insertBefore(c, b.firstChild) : b.appendChild(c)
  1250. },
  1251. Bb: function(b, c, d) {
  1252. d ? a(b) ? b.parentNode.insertBefore(c, d.nextSibling) : d.nextSibling ? b.insertBefore(c, d.nextSibling) : b.appendChild(c) : m.f.Hb(b, c)
  1253. },
  1254. firstChild: function(c) {
  1255. return a(c) ? !c.nextSibling || b(c.nextSibling) ? null : c.nextSibling : c.firstChild
  1256. },
  1257. nextSibling: function(c) {
  1258. return a(c) && (c = e(c)), c.nextSibling && b(c.nextSibling) ? null : c.nextSibling
  1259. },
  1260. gc: a,
  1261. xc: function(a) {
  1262. return (a = (f ? a.text : a.nodeValue).match(g)) ? a[1] : null
  1263. },
  1264. Fb: function(c) {
  1265. if (i[m.a.t(c)]) {
  1266. var d = c.firstChild;
  1267. if (d)
  1268. do
  1269. if (1 === d.nodeType) {
  1270. var f;
  1271. f = d.firstChild;
  1272. var g = null;
  1273. if (f)
  1274. do
  1275. if (g) g.push(f);
  1276. else if (a(f)) {
  1277. var h = e(f, !0);
  1278. h ? f = h : g = [f]
  1279. } else b(f) && (g = [f]);
  1280. while (f = f.nextSibling);
  1281. if (f = g)
  1282. for (g = d.nextSibling, h = 0; h < f.length; h++) g ? c.insertBefore(f[h], g) : c.appendChild(f[h])
  1283. }
  1284. while (d = d.nextSibling)
  1285. }
  1286. }
  1287. }
  1288. }(), m.b("virtualElements", m.f), m.b("virtualElements.allowedBindings", m.f.Q), m.b("virtualElements.emptyNode", m.f.ja), m.b("virtualElements.insertAfter", m.f.Bb), m.b("virtualElements.prepend", m.f.Hb), m.b("virtualElements.setDomNodeChildren", m.f.T),
  1289. function() {
  1290. m.J = function() {
  1291. this.Yb = {}
  1292. }, m.a.extend(m.J.prototype, {
  1293. nodeHasBindings: function(a) {
  1294. switch (a.nodeType) {
  1295. case 1:
  1296. return null != a.getAttribute("data-bind") || m.g.getComponentNameForNode(a);
  1297. case 8:
  1298. return m.f.gc(a);
  1299. default:
  1300. return !1
  1301. }
  1302. },
  1303. getBindings: function(a, b) {
  1304. var c = this.getBindingsString(a, b),
  1305. c = c ? this.parseBindingsString(c, b, a) : null;
  1306. return m.g.mb(c, a, b, !1)
  1307. },
  1308. getBindingAccessors: function(a, b) {
  1309. var c = this.getBindingsString(a, b),
  1310. c = c ? this.parseBindingsString(c, b, a, {
  1311. valueAccessors: !0
  1312. }) : null;
  1313. return m.g.mb(c, a, b, !0)
  1314. },
  1315. getBindingsString: function(a) {
  1316. switch (a.nodeType) {
  1317. case 1:
  1318. return a.getAttribute("data-bind");
  1319. case 8:
  1320. return m.f.xc(a);
  1321. default:
  1322. return null
  1323. }
  1324. },
  1325. parseBindingsString: function(a, b, c, d) {
  1326. try {
  1327. var e, f = this.Yb,
  1328. g = a + (d && d.valueAccessors || "");
  1329. if (!(e = f[g])) {
  1330. var h, i = "with($context){with($data||{}){return{" + m.h.ya(a, d) + "}}}";
  1331. h = new Function("$context", "$element", i), e = f[g] = h
  1332. }
  1333. return e(b, c)
  1334. } catch (b) {
  1335. throw b.message = "Unable to parse bindings.\nBindings value: " + a + "\nMessage: " + b.message, b
  1336. }
  1337. }
  1338. }), m.J.instance = new m.J
  1339. }(), m.b("bindingProvider", m.J),
  1340. function() {
  1341. function c(a) {
  1342. return function() {
  1343. return a
  1344. }
  1345. }
  1346.  
  1347. function d(a) {
  1348. return a()
  1349. }
  1350.  
  1351. function f(a) {
  1352. return m.a.na(m.k.B(a), function(b, c) {
  1353. return function() {
  1354. return a()[c]
  1355. }
  1356. })
  1357. }
  1358.  
  1359. function g(a, b) {
  1360. return f(this.getBindings.bind(this, a, b))
  1361. }
  1362.  
  1363. function h(a, b, c) {
  1364. var d, e = m.f.firstChild(b),
  1365. f = m.J.instance,
  1366. g = f.preprocessNode;
  1367. if (g) {
  1368. for (; d = e;) e = m.f.nextSibling(d), g.call(f, d);
  1369. e = m.f.firstChild(b)
  1370. }
  1371. for (; d = e;) e = m.f.nextSibling(d), i(a, d, c)
  1372. }
  1373.  
  1374. function i(a, b, c) {
  1375. var d = !0,
  1376. e = 1 === b.nodeType;
  1377. e && m.f.Fb(b), (e && c || m.J.instance.nodeHasBindings(b)) && (d = k(b, null, a, c).shouldBindDescendants), d && !n[m.a.t(b)] && h(a, b, !e)
  1378. }
  1379.  
  1380. function j(a) {
  1381. var b = [],
  1382. c = {},
  1383. d = [];
  1384. return m.a.G(a, function e(f) {
  1385. if (!c[f]) {
  1386. var g = m.getBindingHandler(f);
  1387. g && (g.after && (d.push(f), m.a.u(g.after, function(b) {
  1388. if (a[b]) {
  1389. if (-1 !== m.a.m(d, b)) throw Error("Cannot combine the following bindings, because they have a cyclic dependency: " + d.join(", "));
  1390. e(b)
  1391. }
  1392. }), d.length--), b.push({
  1393. key: f,
  1394. zb: g
  1395. })), c[f] = !0
  1396. }
  1397. }), b
  1398. }
  1399.  
  1400. function k(b, c, e, f) {
  1401. var h = m.a.e.get(b, o);
  1402. if (!c) {
  1403. if (h) throw Error("You cannot apply bindings multiple times to the same element.");
  1404. m.a.e.set(b, o, !0)
  1405. }!h && f && m.Ob(b, e);
  1406. var i;
  1407. if (c && "function" != typeof c) i = c;
  1408. else {
  1409. var k = m.J.instance,
  1410. l = k.getBindingAccessors || g,
  1411. n = m.j(function() {
  1412. return (i = c ? c(e, b) : l.call(k, b, e)) && e.I && e.I(), i
  1413. }, null, {
  1414. o: b
  1415. });
  1416. i && n.Z() || (n = null)
  1417. }
  1418. var p;
  1419. if (i) {
  1420. var q = n ? function(a) {
  1421. return function() {
  1422. return d(n()[a])
  1423. }
  1424. } : function(a) {
  1425. return i[a]
  1426. },
  1427. r = function() {
  1428. return m.a.na(n ? n() : i, d)
  1429. };
  1430. r.get = function(a) {
  1431. return i[a] && d(q(a))
  1432. }, r.has = function(a) {
  1433. return a in i
  1434. }, f = j(i), m.a.u(f, function(c) {
  1435. var d = c.zb.init,
  1436. f = c.zb.update,
  1437. g = c.key;
  1438. if (8 === b.nodeType && !m.f.Q[g]) throw Error("The binding '" + g + "' cannot be used with virtual elements");
  1439. try {
  1440. "function" == typeof d && m.k.B(function() {
  1441. var c = d(b, q(g), r, e.$data, e);
  1442. if (c && c.controlsDescendantBindings) {
  1443. if (p !== a) throw Error("Multiple bindings (" + p + " and " + g + ") are trying to control descendant bindings of the same element. You cannot use these bindings together on the same element.");
  1444. p = g
  1445. }
  1446. }), "function" == typeof f && m.j(function() {
  1447. f(b, q(g), r, e.$data, e)
  1448. }, null, {
  1449. o: b
  1450. })
  1451. } catch (a) {
  1452. throw a.message = 'Unable to process binding "' + g + ": " + i[g] + '"\nMessage: ' + a.message, a
  1453. }
  1454. })
  1455. }
  1456. return {
  1457. shouldBindDescendants: p === a
  1458. }
  1459. }
  1460.  
  1461. function l(a) {
  1462. return a && a instanceof m.N ? a : new m.N(a)
  1463. }
  1464. m.d = {};
  1465. var n = {
  1466. script: !0
  1467. };
  1468. m.getBindingHandler = function(a) {
  1469. return m.d[a]
  1470. }, m.N = function(b, c, d, e) {
  1471. var f, g = this,
  1472. h = "function" == typeof b && !m.C(b),
  1473. i = m.j(function() {
  1474. var a = h ? b() : b,
  1475. f = m.a.c(a);
  1476. return c ? (c.I && c.I(), m.a.extend(g, c), i && (g.I = i)) : (g.$parents = [], g.$root = f, g.ko = m), g.$rawData = a, g.$data = f, d && (g[d] = f), e && e(g, c, f), g.$data
  1477. }, null, {
  1478. Ia: function() {
  1479. return f && !m.a.ob(f)
  1480. },
  1481. o: !0
  1482. });
  1483. i.Z() && (g.I = i, i.equalityComparer = null, f = [], i.Tb = function(b) {
  1484. f.push(b), m.a.w.da(b, function(b) {
  1485. m.a.ua(f, b), f.length || (i.K(), g.I = i = a)
  1486. })
  1487. })
  1488. }, m.N.prototype.createChildContext = function(a, b, c) {
  1489. return new m.N(a, this, b, function(a, b) {
  1490. a.$parentContext = b, a.$parent = b.$data, a.$parents = (b.$parents || []).slice(0), a.$parents.unshift(a.$parent), c && c(a)
  1491. })
  1492. }, m.N.prototype.extend = function(a) {
  1493. return new m.N(this.I || this.$data, this, null, function(b, c) {
  1494. b.$rawData = c.$rawData, m.a.extend(b, "function" == typeof a ? a() : a)
  1495. })
  1496. };
  1497. var o = m.a.e.F(),
  1498. p = m.a.e.F();
  1499. m.Ob = function(a, b) {
  1500. return 2 != arguments.length ? m.a.e.get(a, p) : (m.a.e.set(a, p, b), void(b.I && b.I.Tb(a)))
  1501. }, m.ra = function(a, b, c) {
  1502. return 1 === a.nodeType && m.f.Fb(a), k(a, b, l(c), !0)
  1503. }, m.Wb = function(a, b, d) {
  1504. return d = l(d), m.ra(a, "function" == typeof b ? f(b.bind(null, d, a)) : m.a.na(b, c), d)
  1505. }, m.Ca = function(a, b) {
  1506. 1 !== b.nodeType && 8 !== b.nodeType || h(l(a), b, !0)
  1507. }, m.pb = function(a, c) {
  1508. if (!e && b.jQuery && (e = b.jQuery), c && 1 !== c.nodeType && 8 !== c.nodeType) throw Error("ko.applyBindings: first parameter should be your view model; second parameter should be a DOM node");
  1509. c = c || b.document.body, i(l(a), c, !0)
  1510. }, m.Ha = function(b) {
  1511. switch (b.nodeType) {
  1512. case 1:
  1513. case 8:
  1514. var c = m.Ob(b);
  1515. if (c) return c;
  1516. if (b.parentNode) return m.Ha(b.parentNode)
  1517. }
  1518. return a
  1519. }, m.$b = function(b) {
  1520. return (b = m.Ha(b)) ? b.$data : a
  1521. }, m.b("bindingHandlers", m.d), m.b("applyBindings", m.pb), m.b("applyBindingsToDescendants", m.Ca), m.b("applyBindingAccessorsToNode", m.ra), m.b("applyBindingsToNode", m.Wb), m.b("contextFor", m.Ha), m.b("dataFor", m.$b)
  1522. }(),
  1523. function(a) {
  1524. function b(b, d) {
  1525. var g, h = e.hasOwnProperty(b) ? e[b] : a;
  1526. h || (h = e[b] = new m.P, c(b, function(a) {
  1527. f[b] = a, delete e[b], g ? h.notifySubscribers(a) : setTimeout(function() {
  1528. h.notifySubscribers(a)
  1529. }, 0)
  1530. }), g = !0), h.U(d)
  1531. }
  1532.  
  1533. function c(a, b) {
  1534. d("getConfig", [a], function(c) {
  1535. c ? d("loadComponent", [a, c], function(a) {
  1536. b(a)
  1537. }) : b(null)
  1538. })
  1539. }
  1540.  
  1541. function d(b, c, e, f) {
  1542. f || (f = m.g.loaders.slice(0));
  1543. var g = f.shift();
  1544. if (g) {
  1545. var h = g[b];
  1546. if (h) {
  1547. var i = !1;
  1548. if (h.apply(g, c.concat(function(a) {
  1549. i ? e(null) : null !== a ? e(a) : d(b, c, e, f)
  1550. })) !== a && (i = !0, !g.suppressLoaderExceptions)) throw Error("Component loaders must supply values by invoking the callback, not by returning values synchronously.")
  1551. } else d(b, c, e, f)
  1552. } else e(null)
  1553. }
  1554. var e = {},
  1555. f = {};
  1556. m.g = {
  1557. get: function(c, d) {
  1558. var e = f.hasOwnProperty(c) ? f[c] : a;
  1559. e ? setTimeout(function() {
  1560. d(e)
  1561. }, 0) : b(c, d)
  1562. },
  1563. tb: function(a) {
  1564. delete f[a]
  1565. },
  1566. jb: d
  1567. }, m.g.loaders = [], m.b("components", m.g), m.b("components.get", m.g.get), m.b("components.clearCachedDefinition", m.g.tb)
  1568. }(),
  1569. function() {
  1570. function a(a, b, c, d) {
  1571. function e() {
  1572. 0 === --h && d(f)
  1573. }
  1574. var f = {},
  1575. h = 2,
  1576. i = c.template;
  1577. c = c.viewModel, i ? g(b, i, function(b) {
  1578. m.g.jb("loadTemplate", [a, b], function(a) {
  1579. f.template = a, e()
  1580. })
  1581. }) : e(), c ? g(b, c, function(b) {
  1582. m.g.jb("loadViewModel", [a, b], function(a) {
  1583. f[k] = a, e()
  1584. })
  1585. }) : e()
  1586. }
  1587.  
  1588. function d(a, b, c) {
  1589. if ("function" == typeof b) c(function(a) {
  1590. return new b(a)
  1591. });
  1592. else if ("function" == typeof b[k]) c(b[k]);
  1593. else if ("instance" in b) {
  1594. var e = b.instance;
  1595. c(function() {
  1596. return e
  1597. })
  1598. } else "viewModel" in b ? d(a, b.viewModel, c) : a("Unknown viewModel value: " + b)
  1599. }
  1600.  
  1601. function e(a) {
  1602. switch (m.a.t(a)) {
  1603. case "script":
  1604. return m.a.ba(a.text);
  1605. case "textarea":
  1606. return m.a.ba(a.value);
  1607. case "template":
  1608. if (f(a.content)) return m.a.ia(a.content.childNodes)
  1609. }
  1610. return m.a.ia(a.childNodes)
  1611. }
  1612.  
  1613. function f(a) {
  1614. return b.DocumentFragment ? a instanceof DocumentFragment : a && 11 === a.nodeType
  1615. }
  1616.  
  1617. function g(a, c, d) {
  1618. "string" == typeof c.require ? h || b.require ? (h || b.require)([c.require], d) : a("Uses require, but no AMD loader is present") : d(c)
  1619. }
  1620.  
  1621. function i(a) {
  1622. return function(b) {
  1623. throw Error("Component '" + a + "': " + b)
  1624. }
  1625. }
  1626. var j = {};
  1627. m.g.tc = function(a, b) {
  1628. if (!b) throw Error("Invalid configuration for " + a);
  1629. if (m.g.Qa(a)) throw Error("Component " + a + " is already registered");
  1630. j[a] = b
  1631. }, m.g.Qa = function(a) {
  1632. return a in j
  1633. }, m.g.wc = function(a) {
  1634. delete j[a], m.g.tb(a)
  1635. }, m.g.ub = {
  1636. getConfig: function(a, b) {
  1637. b(j.hasOwnProperty(a) ? j[a] : null)
  1638. },
  1639. loadComponent: function(b, c, d) {
  1640. var e = i(b);
  1641. g(e, c, function(c) {
  1642. a(b, e, c, d)
  1643. })
  1644. },
  1645. loadTemplate: function(a, d, g) {
  1646. if (a = i(a), "string" == typeof d) g(m.a.ba(d));
  1647. else if (d instanceof Array) g(d);
  1648. else if (f(d)) g(m.a.S(d.childNodes));
  1649. else if (d.element)
  1650. if (d = d.element, b.HTMLElement ? d instanceof HTMLElement : d && d.tagName && 1 === d.nodeType) g(e(d));
  1651. else if ("string" == typeof d) {
  1652. var h = c.getElementById(d);
  1653. h ? g(e(h)) : a("Cannot find element with ID " + d)
  1654. } else a("Unknown element type: " + d);
  1655. else a("Unknown template value: " + d)
  1656. },
  1657. loadViewModel: function(a, b, c) {
  1658. d(i(a), b, c)
  1659. }
  1660. };
  1661. var k = "createViewModel";
  1662. m.b("components.register", m.g.tc), m.b("components.isRegistered", m.g.Qa), m.b("components.unregister", m.g.wc), m.b("components.defaultLoader", m.g.ub), m.g.loaders.push(m.g.ub), m.g.Ub = j
  1663. }(),
  1664. function() {
  1665. function a(a, c) {
  1666. var d = a.getAttribute("params");
  1667. if (d) {
  1668. var d = b.parseBindingsString(d, c, a, {
  1669. valueAccessors: !0,
  1670. bindingParams: !0
  1671. }),
  1672. d = m.a.na(d, function(b) {
  1673. return m.s(b, null, {
  1674. o: a
  1675. })
  1676. }),
  1677. e = m.a.na(d, function(b) {
  1678. return b.Z() ? m.s(function() {
  1679. return m.a.c(b())
  1680. }, null, {
  1681. o: a
  1682. }) : b.v()
  1683. });
  1684. return e.hasOwnProperty("$raw") || (e.$raw = d), e
  1685. }
  1686. return {
  1687. $raw: {}
  1688. }
  1689. }
  1690. m.g.getComponentNameForNode = function(a) {
  1691. return a = m.a.t(a), m.g.Qa(a) && a
  1692. }, m.g.mb = function(b, c, d, e) {
  1693. if (1 === c.nodeType) {
  1694. var f = m.g.getComponentNameForNode(c);
  1695. if (f) {
  1696. if (b = b || {}, b.component) throw Error('Cannot use the "component" binding on a custom element matching a component');
  1697. var g = {
  1698. name: f,
  1699. params: a(c, d)
  1700. };
  1701. b.component = e ? function() {
  1702. return g
  1703. } : g
  1704. }
  1705. }
  1706. return b
  1707. };
  1708. var b = new m.J;
  1709. 9 > m.a.L && (m.g.register = function(a) {
  1710. return function(b) {
  1711. return c.createElement(b), a.apply(this, arguments)
  1712. }
  1713. }(m.g.register), c.createDocumentFragment = function(a) {
  1714. return function() {
  1715. var b, c = a(),
  1716. d = m.g.Ub;
  1717. for (b in d) d.hasOwnProperty(b) && c.createElement(b);
  1718. return c
  1719. }
  1720. }(c.createDocumentFragment))
  1721. }(),
  1722. function() {
  1723. var a = 0;
  1724. m.d.component = {
  1725. init: function(b, c, d, e, f) {
  1726. function g() {
  1727. var a = h && h.dispose;
  1728. "function" == typeof a && a.call(h), i = null
  1729. }
  1730. var h, i;
  1731. return m.a.w.da(b, g), m.s(function() {
  1732. var d, e, j = m.a.c(c());
  1733. if ("string" == typeof j ? d = j : (d = m.a.c(j.name), e = m.a.c(j.params)), !d) throw Error("No component name specified");
  1734. var k = i = ++a;
  1735. m.g.get(d, function(a) {
  1736. if (i === k) {
  1737. if (g(), !a) throw Error("Unknown component '" + d + "'");
  1738. var c = a.template;
  1739. if (!c) throw Error("Component '" + d + "' has no template");
  1740. c = m.a.ia(c), m.f.T(b, c);
  1741. var c = e,
  1742. j = a.createViewModel;
  1743. a = j ? j.call(a, c, {
  1744. element: b
  1745. }) : c, c = f.createChildContext(a), h = a, m.Ca(c, b)
  1746. }
  1747. })
  1748. }, null, {
  1749. o: b
  1750. }), {
  1751. controlsDescendantBindings: !0
  1752. }
  1753. }
  1754. }, m.f.Q.component = !0
  1755. }();
  1756. var s = {
  1757. class: "className",
  1758. for: "htmlFor"
  1759. };
  1760. m.d.attr = {
  1761. update: function(b, c) {
  1762. var d = m.a.c(c()) || {};
  1763. m.a.G(d, function(c, d) {
  1764. d = m.a.c(d);
  1765. var e = !1 === d || null === d || d === a;
  1766. e && b.removeAttribute(c), 8 >= m.a.L && c in s ? (c = s[c], e ? b.removeAttribute(c) : b[c] = d) : e || b.setAttribute(c, d.toString()), "name" === c && m.a.Mb(b, e ? "" : d.toString())
  1767. })
  1768. }
  1769. },
  1770. function() {
  1771. m.d.checked = {
  1772. after: ["value", "attr"],
  1773. init: function(b, c, d) {
  1774. function e() {
  1775. var a = b.checked,
  1776. e = l ? g() : a;
  1777. if (!m.Y.ma() && (!i || a)) {
  1778. var f = m.k.B(c);
  1779. j ? k !== e ? (a && (m.a.ea(f, e, !0), m.a.ea(f, k, !1)), k = e) : m.a.ea(f, e, a) : m.h.pa(f, d, "checked", e, !0)
  1780. }
  1781. }
  1782.  
  1783. function f() {
  1784. var a = m.a.c(c());
  1785. b.checked = j ? 0 <= m.a.m(a, g()) : h ? a : g() === a
  1786. }
  1787. var g = m.Ib(function() {
  1788. return d.has("checkedValue") ? m.a.c(d.get("checkedValue")) : d.has("value") ? m.a.c(d.get("value")) : b.value
  1789. }),
  1790. h = "checkbox" == b.type,
  1791. i = "radio" == b.type;
  1792. if (h || i) {
  1793. var j = h && m.a.c(c()) instanceof Array,
  1794. k = j ? g() : a,
  1795. l = i || j;
  1796. i && !b.name && m.d.uniqueName.init(b, function() {
  1797. return !0
  1798. }), m.s(e, null, {
  1799. o: b
  1800. }), m.a.n(b, "click", e), m.s(f, null, {
  1801. o: b
  1802. })
  1803. }
  1804. }
  1805. }, m.h.V.checked = !0, m.d.checkedValue = {
  1806. update: function(a, b) {
  1807. a.value = m.a.c(b())
  1808. }
  1809. }
  1810. }(), m.d.css = {
  1811. update: function(a, b) {
  1812. var c = m.a.c(b());
  1813. "object" == typeof c ? m.a.G(c, function(b, c) {
  1814. c = m.a.c(c), m.a.Ba(a, b, c)
  1815. }) : (c = String(c || ""), m.a.Ba(a, a.__ko__cssValue, !1), a.__ko__cssValue = c, m.a.Ba(a, c, !0))
  1816. }
  1817. }, m.d.enable = {
  1818. update: function(a, b) {
  1819. var c = m.a.c(b());
  1820. c && a.disabled ? a.removeAttribute("disabled") : c || a.disabled || (a.disabled = !0)
  1821. }
  1822. }, m.d.disable = {
  1823. update: function(a, b) {
  1824. m.d.enable.update(a, function() {
  1825. return !m.a.c(b())
  1826. })
  1827. }
  1828. }, m.d.event = {
  1829. init: function(a, b, c, d, e) {
  1830. var f = b() || {};
  1831. m.a.G(f, function(f) {
  1832. "string" == typeof f && m.a.n(a, f, function(a) {
  1833. var g, h = b()[f];
  1834. if (h) {
  1835. try {
  1836. var i = m.a.S(arguments);
  1837. d = e.$data, i.unshift(d), g = h.apply(d, i)
  1838. } finally {
  1839. !0 !== g && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
  1840. }!1 === c.get(f + "Bubble") && (a.cancelBubble = !0, a.stopPropagation && a.stopPropagation())
  1841. }
  1842. })
  1843. })
  1844. }
  1845. }, m.d.foreach = {
  1846. Eb: function(a) {
  1847. return function() {
  1848. var b = a(),
  1849. c = m.a.Xa(b);
  1850. return c && "number" != typeof c.length ? (m.a.c(b), {
  1851. foreach: c.data,
  1852. as: c.as,
  1853. includeDestroyed: c.includeDestroyed,
  1854. afterAdd: c.afterAdd,
  1855. beforeRemove: c.beforeRemove,
  1856. afterRender: c.afterRender,
  1857. beforeMove: c.beforeMove,
  1858. afterMove: c.afterMove,
  1859. templateEngine: m.O.Oa
  1860. }) : {
  1861. foreach: b,
  1862. templateEngine: m.O.Oa
  1863. }
  1864. }
  1865. },
  1866. init: function(a, b) {
  1867. return m.d.template.init(a, m.d.foreach.Eb(b))
  1868. },
  1869. update: function(a, b, c, d, e) {
  1870. return m.d.template.update(a, m.d.foreach.Eb(b), c, d, e)
  1871. }
  1872. }, m.h.ha.foreach = !1, m.f.Q.foreach = !0, m.d.hasfocus = {
  1873. init: function(a, b, c) {
  1874. function d(d) {
  1875. a.__ko_hasfocusUpdating = !0;
  1876. var e = a.ownerDocument;
  1877. if ("activeElement" in e) {
  1878. var f;
  1879. try {
  1880. f = e.activeElement
  1881. } catch (a) {
  1882. f = e.body
  1883. }
  1884. d = f === a
  1885. }
  1886. e = b(), m.h.pa(e, c, "hasfocus", d, !0), a.__ko_hasfocusLastValue = d, a.__ko_hasfocusUpdating = !1
  1887. }
  1888. var e = d.bind(null, !0),
  1889. f = d.bind(null, !1);
  1890. m.a.n(a, "focus", e), m.a.n(a, "focusin", e), m.a.n(a, "blur", f), m.a.n(a, "focusout", f)
  1891. },
  1892. update: function(a, b) {
  1893. var c = !!m.a.c(b());
  1894. a.__ko_hasfocusUpdating || a.__ko_hasfocusLastValue === c || (c ? a.focus() : a.blur(), m.k.B(m.a.oa, null, [a, c ? "focusin" : "focusout"]))
  1895. }
  1896. }, m.h.V.hasfocus = !0, m.d.hasFocus = m.d.hasfocus, m.h.V.hasFocus = !0, m.d.html = {
  1897. init: function() {
  1898. return {
  1899. controlsDescendantBindings: !0
  1900. }
  1901. },
  1902. update: function(a, b) {
  1903. m.a.$a(a, b())
  1904. }
  1905. }, l("if"), l("ifnot", !1, !0), l("with", !0, !1, function(a, b) {
  1906. return a.createChildContext(b)
  1907. });
  1908. var t = {};
  1909. m.d.options = {
  1910. init: function(a) {
  1911. if ("select" !== m.a.t(a)) throw Error("options binding applies only to SELECT elements");
  1912. for (; 0 < a.length;) a.remove(0);
  1913. return {
  1914. controlsDescendantBindings: !0
  1915. }
  1916. },
  1917. update: function(b, c, d) {
  1918. function e() {
  1919. return m.a.ta(b.options, function(a) {
  1920. return a.selected
  1921. })
  1922. }
  1923.  
  1924. function f(a, b, c) {
  1925. var d = typeof b;
  1926. return "function" == d ? b(a) : "string" == d ? a[b] : c
  1927. }
  1928.  
  1929. function g(a, c) {
  1930. if (l.length) {
  1931. var d = 0 <= m.a.m(l, m.i.q(c[0]));
  1932. m.a.Nb(c[0], d), n && !d && m.k.B(m.a.oa, null, [b, "change"])
  1933. }
  1934. }
  1935. var h = 0 != b.length && b.multiple ? b.scrollTop : null,
  1936. i = m.a.c(c()),
  1937. j = d.get("optionsIncludeDestroyed");
  1938. c = {};
  1939. var k, l;
  1940. l = b.multiple ? m.a.Da(e(), m.i.q) : 0 <= b.selectedIndex ? [m.i.q(b.options[b.selectedIndex])] : [], i && ("undefined" == typeof i.length && (i = [i]), k = m.a.ta(i, function(b) {
  1941. return j || b === a || null === b || !m.a.c(b._destroy)
  1942. }), d.has("optionsCaption") && (i = m.a.c(d.get("optionsCaption")), null !== i && i !== a && k.unshift(t)));
  1943. var n = !1;
  1944. c.beforeRemove = function(a) {
  1945. b.removeChild(a)
  1946. }, i = g, d.has("optionsAfterRender") && (i = function(b, c) {
  1947. g(0, c), m.k.B(d.get("optionsAfterRender"), null, [c[0], b !== t ? b : a])
  1948. }), m.a.Za(b, k, function(c, e, g) {
  1949. return g.length && (l = g[0].selected ? [m.i.q(g[0])] : [], n = !0), e = b.ownerDocument.createElement("option"), c === t ? (m.a.bb(e, d.get("optionsCaption")), m.i.ca(e, a)) : (g = f(c, d.get("optionsValue"), c), m.i.ca(e, m.a.c(g)), c = f(c, d.get("optionsText"), g), m.a.bb(e, c)), [e]
  1950. }, c, i), m.k.B(function() {
  1951. d.get("valueAllowUnset") && d.has("value") ? m.i.ca(b, m.a.c(d.get("value")), !0) : (b.multiple ? l.length && e().length < l.length : l.length && 0 <= b.selectedIndex ? m.i.q(b.options[b.selectedIndex]) !== l[0] : l.length || 0 <= b.selectedIndex) && m.a.oa(b, "change")
  1952. }), m.a.dc(b), h && 20 < Math.abs(h - b.scrollTop) && (b.scrollTop = h)
  1953. }
  1954. }, m.d.options.Va = m.a.e.F(), m.d.selectedOptions = {
  1955. after: ["options", "foreach"],
  1956. init: function(a, b, c) {
  1957. m.a.n(a, "change", function() {
  1958. var d = b(),
  1959. e = [];
  1960. m.a.u(a.getElementsByTagName("option"), function(a) {
  1961. a.selected && e.push(m.i.q(a))
  1962. }), m.h.pa(d, c, "selectedOptions", e)
  1963. })
  1964. },
  1965. update: function(a, b) {
  1966. if ("select" != m.a.t(a)) throw Error("values binding applies only to SELECT elements");
  1967. var c = m.a.c(b());
  1968. c && "number" == typeof c.length && m.a.u(a.getElementsByTagName("option"), function(a) {
  1969. var b = 0 <= m.a.m(c, m.i.q(a));
  1970. m.a.Nb(a, b)
  1971. })
  1972. }
  1973. }, m.h.V.selectedOptions = !0, m.d.style = {
  1974. update: function(b, c) {
  1975. var d = m.a.c(c() || {});
  1976. m.a.G(d, function(c, d) {
  1977. d = m.a.c(d), null !== d && d !== a && !1 !== d || (d = ""), b.style[c] = d
  1978. })
  1979. }
  1980. }, m.d.submit = {
  1981. init: function(a, b, c, d, e) {
  1982. if ("function" != typeof b()) throw Error("The value for a submit binding must be a function");
  1983. m.a.n(a, "submit", function(c) {
  1984. var d, f = b();
  1985. try {
  1986. d = f.call(e.$data, a)
  1987. } finally {
  1988. !0 !== d && (c.preventDefault ? c.preventDefault() : c.returnValue = !1)
  1989. }
  1990. })
  1991. }
  1992. }, m.d.text = {
  1993. init: function() {
  1994. return {
  1995. controlsDescendantBindings: !0
  1996. }
  1997. },
  1998. update: function(a, b) {
  1999. m.a.bb(a, b())
  2000. }
  2001. }, m.f.Q.text = !0,
  2002. function() {
  2003. if (b && b.navigator) var c = function(a) {
  2004. if (a) return parseFloat(a[1])
  2005. },
  2006. d = b.opera && b.opera.version && parseInt(b.opera.version()),
  2007. e = b.navigator.userAgent,
  2008. f = c(e.match(/^(?:(?!chrome).)*version\/([^ ]*) safari/i)),
  2009. g = c(e.match(/Firefox\/([^ ]*)/));
  2010. if (10 > m.a.L) var h = m.a.e.F(),
  2011. i = m.a.e.F(),
  2012. j = function(a) {
  2013. var b = this.activeElement;
  2014. (b = b && m.a.e.get(b, i)) && b(a)
  2015. },
  2016. k = function(a, b) {
  2017. var c = a.ownerDocument;
  2018. m.a.e.get(c, h) || (m.a.e.set(c, h, !0), m.a.n(c, "selectionchange", j)), m.a.e.set(a, i, b)
  2019. };
  2020. m.d.textInput = {
  2021. init: function(b, c, e) {
  2022. function h(a, c) {
  2023. m.a.n(b, a, c)
  2024. }
  2025.  
  2026. function i() {
  2027. var d = m.a.c(c());
  2028. null !== d && d !== a || (d = ""), o !== a && d === o ? setTimeout(i, 4) : b.value !== d && (p = d, b.value = d)
  2029. }
  2030.  
  2031. function j() {
  2032. n || (o = b.value, n = setTimeout(l, 4))
  2033. }
  2034.  
  2035. function l() {
  2036. clearTimeout(n), o = n = a;
  2037. var d = b.value;
  2038. p !== d && (p = d, m.h.pa(c(), e, "textInput", d))
  2039. }
  2040. var n, o, p = b.value;
  2041. 10 > m.a.L ? (h("propertychange", function(a) {
  2042. "value" === a.propertyName && l()
  2043. }), 8 == m.a.L && (h("keyup", l), h("keydown", l)), 8 <= m.a.L && (k(b, l), h("dragend", j))) : (h("input", l), 5 > f && "textarea" === m.a.t(b) ? (h("keydown", j), h("paste", j), h("cut", j)) : 11 > d ? h("keydown", j) : 4 > g && (h("DOMAutoComplete", l), h("dragdrop", l), h("drop", l))), h("change", l), m.s(i, null, {
  2044. o: b
  2045. })
  2046. }
  2047. }, m.h.V.textInput = !0, m.d.textinput = {
  2048. preprocess: function(a, b, c) {
  2049. c("textInput", a)
  2050. }
  2051. }
  2052. }(), m.d.uniqueName = {
  2053. init: function(a, b) {
  2054. if (b()) {
  2055. var c = "ko_unique_" + ++m.d.uniqueName.Zb;
  2056. m.a.Mb(a, c)
  2057. }
  2058. }
  2059. }, m.d.uniqueName.Zb = 0, m.d.value = {
  2060. after: ["options", "foreach"],
  2061. init: function(a, b, c) {
  2062. if ("input" != a.tagName.toLowerCase() || "checkbox" != a.type && "radio" != a.type) {
  2063. var d = ["change"],
  2064. e = c.get("valueUpdate"),
  2065. f = !1,
  2066. g = null;
  2067. e && ("string" == typeof e && (e = [e]), m.a.ga(d, e), d = m.a.rb(d));
  2068. var h = function() {
  2069. g = null, f = !1;
  2070. var d = b(),
  2071. e = m.i.q(a);
  2072. m.h.pa(d, c, "value", e)
  2073. };
  2074. !m.a.L || "input" != a.tagName.toLowerCase() || "text" != a.type || "off" == a.autocomplete || a.form && "off" == a.form.autocomplete || -1 != m.a.m(d, "propertychange") || (m.a.n(a, "propertychange", function() {
  2075. f = !0
  2076. }), m.a.n(a, "focus", function() {
  2077. f = !1
  2078. }), m.a.n(a, "blur", function() {
  2079. f && h()
  2080. })), m.a.u(d, function(b) {
  2081. var c = h;
  2082. m.a.vc(b, "after") && (c = function() {
  2083. g = m.i.q(a), setTimeout(h, 0)
  2084. }, b = b.substring(5)), m.a.n(a, b, c)
  2085. });
  2086. var i = function() {
  2087. var d = m.a.c(b()),
  2088. e = m.i.q(a);
  2089. if (null !== g && d === g) setTimeout(i, 0);
  2090. else if (d !== e)
  2091. if ("select" === m.a.t(a)) {
  2092. var f = c.get("valueAllowUnset"),
  2093. e = function() {
  2094. m.i.ca(a, d, f)
  2095. };
  2096. e(), f || d === m.i.q(a) ? setTimeout(e, 0) : m.k.B(m.a.oa, null, [a, "change"])
  2097. } else m.i.ca(a, d)
  2098. };
  2099. m.s(i, null, {
  2100. o: a
  2101. })
  2102. } else m.ra(a, {
  2103. checkedValue: b
  2104. })
  2105. },
  2106. update: function() {}
  2107. }, m.h.V.value = !0, m.d.visible = {
  2108. update: function(a, b) {
  2109. var c = m.a.c(b()),
  2110. d = "none" != a.style.display;
  2111. c && !d ? a.style.display = "" : !c && d && (a.style.display = "none")
  2112. }
  2113. },
  2114. function(a) {
  2115. m.d[a] = {
  2116. init: function(b, c, d, e, f) {
  2117. return m.d.event.init.call(this, b, function() {
  2118. var b = {};
  2119. return b[a] = c(), b
  2120. }, d, e, f)
  2121. }
  2122. }
  2123. }("click"), m.H = function() {}, m.H.prototype.renderTemplateSource = function() {
  2124. throw Error("Override renderTemplateSource")
  2125. }, m.H.prototype.createJavaScriptEvaluatorBlock = function() {
  2126. throw Error("Override createJavaScriptEvaluatorBlock")
  2127. }, m.H.prototype.makeTemplateSource = function(a, b) {
  2128. if ("string" == typeof a) {
  2129. b = b || c;
  2130. var d = b.getElementById(a);
  2131. if (!d) throw Error("Cannot find template with ID " + a);
  2132. return new m.r.l(d)
  2133. }
  2134. if (1 == a.nodeType || 8 == a.nodeType) return new m.r.fa(a);
  2135. throw Error("Unknown template type: " + a)
  2136. }, m.H.prototype.renderTemplate = function(a, b, c, d) {
  2137. return a = this.makeTemplateSource(a, d), this.renderTemplateSource(a, b, c)
  2138. }, m.H.prototype.isTemplateRewritten = function(a, b) {
  2139. return !1 === this.allowTemplateRewriting || this.makeTemplateSource(a, b).data("isRewritten")
  2140. }, m.H.prototype.rewriteTemplate = function(a, b, c) {
  2141. a = this.makeTemplateSource(a, c), b = b(a.text()), a.text(b), a.data("isRewritten", !0)
  2142. }, m.b("templateEngine", m.H), m.fb = function() {
  2143. function a(a, b, c, d) {
  2144. a = m.h.Wa(a);
  2145. for (var e = m.h.ha, f = 0; f < a.length; f++) {
  2146. var g = a[f].key;
  2147. if (e.hasOwnProperty(g)) {
  2148. var h = e[g];
  2149. if ("function" == typeof h) {
  2150. if (g = h(a[f].value)) throw Error(g)
  2151. } else if (!h) throw Error("This template engine does not support the '" + g + "' binding within its templates")
  2152. }
  2153. }
  2154. return c = "ko.__tr_ambtns(function($context,$element){return(function(){return{ " + m.h.ya(a, {
  2155. valueAccessors: !0
  2156. }) + " } })()},'" + c.toLowerCase() + "')", d.createJavaScriptEvaluatorBlock(c) + b
  2157. }
  2158. var b = /(<([a-z]+\d*)(?:\s+(?!data-bind\s*=\s*)[a-z0-9\-]+(?:=(?:\"[^\"]*\"|\'[^\']*\'))?)*\s+)data-bind\s*=\s*(["'])([\s\S]*?)\3/gi,
  2159. c = /\x3c!--\s*ko\b\s*([\s\S]*?)\s*--\x3e/g;
  2160. return {
  2161. ec: function(a, b, c) {
  2162. b.isTemplateRewritten(a, c) || b.rewriteTemplate(a, function(a) {
  2163. return m.fb.nc(a, b)
  2164. }, c)
  2165. },
  2166. nc: function(d, e) {
  2167. return d.replace(b, function(b, c, d, f, g) {
  2168. return a(g, c, d, e)
  2169. }).replace(c, function(b, c) {
  2170. return a(c, "<!-- ko -->", "#comment", e)
  2171. })
  2172. },
  2173. Xb: function(a, b) {
  2174. return m.D.Ua(function(c, d) {
  2175. var e = c.nextSibling;
  2176. e && e.nodeName.toLowerCase() === b && m.ra(e, a, d)
  2177. })
  2178. }
  2179. }
  2180. }(), m.b("__tr_ambtns", m.fb.Xb),
  2181. function() {
  2182. m.r = {}, m.r.l = function(a) {
  2183. this.l = a
  2184. }, m.r.l.prototype.text = function() {
  2185. var a = m.a.t(this.l),
  2186. a = "script" === a ? "text" : "textarea" === a ? "value" : "innerHTML";
  2187. if (0 == arguments.length) return this.l[a];
  2188. var b = arguments[0];
  2189. "innerHTML" === a ? m.a.$a(this.l, b) : this.l[a] = b
  2190. };
  2191. var b = m.a.e.F() + "_";
  2192. m.r.l.prototype.data = function(a) {
  2193. return 1 === arguments.length ? m.a.e.get(this.l, b + a) : void m.a.e.set(this.l, b + a, arguments[1])
  2194. };
  2195. var c = m.a.e.F();
  2196. m.r.fa = function(a) {
  2197. this.l = a
  2198. }, m.r.fa.prototype = new m.r.l, m.r.fa.prototype.text = function() {
  2199. if (0 == arguments.length) {
  2200. var b = m.a.e.get(this.l, c) || {};
  2201. return b.gb === a && b.Ga && (b.gb = b.Ga.innerHTML), b.gb
  2202. }
  2203. m.a.e.set(this.l, c, {
  2204. gb: arguments[0]
  2205. })
  2206. }, m.r.l.prototype.nodes = function() {
  2207. return 0 == arguments.length ? (m.a.e.get(this.l, c) || {}).Ga : void m.a.e.set(this.l, c, {
  2208. Ga: arguments[0]
  2209. })
  2210. }, m.b("templateSources", m.r), m.b("templateSources.domElement", m.r.l), m.b("templateSources.anonymousTemplate", m.r.fa)
  2211. }(),
  2212. function() {
  2213. function b(a, b, c) {
  2214. var d;
  2215. for (b = m.f.nextSibling(b); a && (d = a) !== b;) a = m.f.nextSibling(d), c(d, a)
  2216. }
  2217.  
  2218. function c(a, c) {
  2219. if (a.length) {
  2220. var d = a[0],
  2221. e = a[a.length - 1],
  2222. f = d.parentNode,
  2223. g = m.J.instance,
  2224. h = g.preprocessNode;
  2225. if (h) {
  2226. if (b(d, e, function(a, b) {
  2227. var c = a.previousSibling,
  2228. f = h.call(g, a);
  2229. f && (a === d && (d = f[0] || b), a === e && (e = f[f.length - 1] || c))
  2230. }), a.length = 0, !d) return;
  2231. d === e ? a.push(d) : (a.push(d, e), m.a.ka(a, f))
  2232. }
  2233. b(d, e, function(a) {
  2234. 1 !== a.nodeType && 8 !== a.nodeType || m.pb(c, a)
  2235. }), b(d, e, function(a) {
  2236. 1 !== a.nodeType && 8 !== a.nodeType || m.D.Sb(a, [c])
  2237. }), m.a.ka(a, f)
  2238. }
  2239. }
  2240.  
  2241. function d(a) {
  2242. return a.nodeType ? a : 0 < a.length ? a[0] : null
  2243. }
  2244.  
  2245. function e(a, b, e, g, h) {
  2246. h = h || {};
  2247. var i = a && d(a),
  2248. i = i && i.ownerDocument,
  2249. j = h.templateEngine || f;
  2250. if (m.fb.ec(e, j, i), e = j.renderTemplate(e, g, h, i), "number" != typeof e.length || 0 < e.length && "number" != typeof e[0].nodeType) throw Error("Template engine must return an array of DOM nodes");
  2251. switch (i = !1, b) {
  2252. case "replaceChildren":
  2253. m.f.T(a, e), i = !0;
  2254. break;
  2255. case "replaceNode":
  2256. m.a.Lb(a, e), i = !0;
  2257. break;
  2258. case "ignoreTargetNode":
  2259. break;
  2260. default:
  2261. throw Error("Unknown renderMode: " + b)
  2262. }
  2263. return i && (c(e, g), h.afterRender && m.k.B(h.afterRender, null, [e, g.$data])), e
  2264. }
  2265. var f;
  2266. m.ab = function(b) {
  2267. if (b != a && !(b instanceof m.H)) throw Error("templateEngine must inherit from ko.templateEngine");
  2268. f = b
  2269. }, m.Ya = function(b, c, g, h, i) {
  2270. if (g = g || {}, (g.templateEngine || f) == a) throw Error("Set a template engine before calling renderTemplate");
  2271. if (i = i || "replaceChildren", h) {
  2272. var j = d(h);
  2273. return m.j(function() {
  2274. var a = c && c instanceof m.N ? c : new m.N(m.a.c(c)),
  2275. f = m.C(b) ? b() : "function" == typeof b ? b(a.$data, a) : b,
  2276. a = e(h, i, f, a, g);
  2277. "replaceNode" == i && (h = a, j = d(h))
  2278. }, null, {
  2279. Ia: function() {
  2280. return !j || !m.a.Ja(j)
  2281. },
  2282. o: j && "replaceNode" == i ? j.parentNode : j
  2283. })
  2284. }
  2285. return m.D.Ua(function(a) {
  2286. m.Ya(b, c, g, a, "replaceNode")
  2287. })
  2288. }, m.uc = function(b, d, f, g, h) {
  2289. function i(a, b) {
  2290. c(b, k), f.afterRender && f.afterRender(b, a)
  2291. }
  2292.  
  2293. function j(a, c) {
  2294. k = h.createChildContext(a, f.as, function(a) {
  2295. a.$index = c
  2296. });
  2297. var d = m.C(b) ? b() : "function" == typeof b ? b(a, k) : b;
  2298. return e(null, "ignoreTargetNode", d, k, f)
  2299. }
  2300. var k;
  2301. return m.j(function() {
  2302. var b = m.a.c(d) || [];
  2303. "undefined" == typeof b.length && (b = [b]), b = m.a.ta(b, function(b) {
  2304. return f.includeDestroyed || b === a || null === b || !m.a.c(b._destroy)
  2305. }), m.k.B(m.a.Za, null, [g, b, j, f, i])
  2306. }, null, {
  2307. o: g
  2308. })
  2309. };
  2310. var g = m.a.e.F();
  2311. m.d.template = {
  2312. init: function(a, b) {
  2313. var c = m.a.c(b());
  2314. return "string" == typeof c || c.name ? m.f.ja(a) : (c = m.f.childNodes(a), c = m.a.oc(c), new m.r.fa(a).nodes(c)), {
  2315. controlsDescendantBindings: !0
  2316. }
  2317. },
  2318. update: function(b, c, d, e, f) {
  2319. var h, i = c();
  2320. c = m.a.c(i), d = !0, e = null, "string" == typeof c ? c = {} : (i = c.name, "if" in c && (d = m.a.c(c.if)), d && "ifnot" in c && (d = !m.a.c(c.ifnot)), h = m.a.c(c.data)), "foreach" in c ? e = m.uc(i || b, d && c.foreach || [], c, b, f) : d ? (f = "data" in c ? f.createChildContext(h, c.as) : f, e = m.Ya(i || b, f, c, b)) : m.f.ja(b), f = e, (h = m.a.e.get(b, g)) && "function" == typeof h.K && h.K(), m.a.e.set(b, g, f && f.Z() ? f : a)
  2321. }
  2322. }, m.h.ha.template = function(a) {
  2323. return a = m.h.Wa(a), 1 == a.length && a[0].unknown || m.h.lc(a, "name") ? null : "This template engine does not support anonymous templates nested within its templates"
  2324. }, m.f.Q.template = !0
  2325. }(), m.b("setTemplateEngine", m.ab), m.b("renderTemplate", m.Ya), m.a.wb = function(a, b, c) {
  2326. if (a.length && b.length) {
  2327. var d, e, f, g, h;
  2328. for (d = e = 0;
  2329. (!c || d < c) && (g = a[e]); ++e) {
  2330. for (f = 0; h = b[f]; ++f)
  2331. if (g.value === h.value) {
  2332. g.moved = h.index, h.moved = g.index, b.splice(f, 1), d = f = 0;
  2333. break
  2334. }
  2335. d += f
  2336. }
  2337. }
  2338. }, m.a.Fa = function() {
  2339. function a(a, b, c, d, e) {
  2340. var f, g, h, i, j, k = Math.min,
  2341. l = Math.max,
  2342. n = [],
  2343. o = a.length,
  2344. p = b.length,
  2345. q = p - o || 1,
  2346. r = o + p + 1;
  2347. for (f = 0; f <= o; f++)
  2348. for (i = h, n.push(h = []), j = k(p, f + q), g = l(0, f - 1); g <= j; g++) h[g] = g ? f ? a[f - 1] === b[g - 1] ? i[g - 1] : k(i[g] || r, h[g - 1] || r) + 1 : g + 1 : f + 1;
  2349. for (k = [], l = [], q = [], f = o, g = p; f || g;) p = n[f][g] - 1, g && p === n[f][g - 1] ? l.push(k[k.length] = {
  2350. status: c,
  2351. value: b[--g],
  2352. index: g
  2353. }) : f && p === n[f - 1][g] ? q.push(k[k.length] = {
  2354. status: d,
  2355. value: a[--f],
  2356. index: f
  2357. }) : (--g, --f, e.sparse || k.push({
  2358. status: "retained",
  2359. value: b[g]
  2360. }));
  2361. return m.a.wb(l, q, 10 * o), k.reverse()
  2362. }
  2363. return function(b, c, d) {
  2364. return d = "boolean" == typeof d ? {
  2365. dontLimitMoves: d
  2366. } : d || {}, b = b || [], c = c || [], b.length <= c.length ? a(b, c, "added", "deleted", d) : a(c, b, "deleted", "added", d)
  2367. }
  2368. }(), m.b("utils.compareArrays", m.a.Fa),
  2369. function() {
  2370. function b(b, c, d, e, f) {
  2371. var g = [],
  2372. h = m.j(function() {
  2373. var a = c(d, f, m.a.ka(g, b)) || [];
  2374. 0 < g.length && (m.a.Lb(g, a), e && m.k.B(e, null, [d, a, f])), g.length = 0, m.a.ga(g, a)
  2375. }, null, {
  2376. o: b,
  2377. Ia: function() {
  2378. return !m.a.ob(g)
  2379. }
  2380. });
  2381. return {
  2382. $: g,
  2383. j: h.Z() ? h : a
  2384. }
  2385. }
  2386. var c = m.a.e.F();
  2387. m.a.Za = function(d, e, f, g, h) {
  2388. function i(a, b) {
  2389. u = l[b], r !== b && (x[a] = u), u.Na(r++), m.a.ka(u.$, d), p.push(u), t.push(u)
  2390. }
  2391.  
  2392. function j(a, b) {
  2393. if (a)
  2394. for (var c = 0, d = b.length; c < d; c++) b[c] && m.a.u(b[c].$, function(d) {
  2395. a(d, c, b[c].sa)
  2396. })
  2397. }
  2398. e = e || [], g = g || {};
  2399. var k = m.a.e.get(d, c) === a,
  2400. l = m.a.e.get(d, c) || [],
  2401. n = m.a.Da(l, function(a) {
  2402. return a.sa
  2403. }),
  2404. o = m.a.Fa(n, e, g.dontLimitMoves),
  2405. p = [],
  2406. q = 0,
  2407. r = 0,
  2408. s = [],
  2409. t = [];
  2410. e = [];
  2411. for (var u, v, w, x = [], n = [], y = 0; v = o[y]; y++) switch (w = v.moved, v.status) {
  2412. case "deleted":
  2413. w === a && (u = l[q], u.j && u.j.K(), s.push.apply(s, m.a.ka(u.$, d)), g.beforeRemove && (e[y] = u, t.push(u))), q++;
  2414. break;
  2415. case "retained":
  2416. i(y, q++);
  2417. break;
  2418. case "added":
  2419. w !== a ? i(y, w) : (u = {
  2420. sa: v.value,
  2421. Na: m.p(r++)
  2422. }, p.push(u), t.push(u), k || (n[y] = u))
  2423. }
  2424. j(g.beforeMove, x), m.a.u(s, g.beforeRemove ? m.R : m.removeNode);
  2425. for (var z, y = 0, k = m.f.firstChild(d); u = t[y]; y++) {
  2426. for (u.$ || m.a.extend(u, b(d, f, u.sa, h, u.Na)), q = 0; o = u.$[q]; k = o.nextSibling, z = o, q++) o !== k && m.f.Bb(d, o, z);
  2427. !u.ic && h && (h(u.sa, u.$, u.Na), u.ic = !0)
  2428. }
  2429. j(g.beforeRemove, e), j(g.afterMove, x), j(g.afterAdd, n), m.a.e.set(d, c, p)
  2430. }
  2431. }(), m.b("utils.setDomNodeChildrenFromArrayMapping", m.a.Za), m.O = function() {
  2432. this.allowTemplateRewriting = !1
  2433. }, m.O.prototype = new m.H, m.O.prototype.renderTemplateSource = function(a) {
  2434. var b = (9 > m.a.L ? 0 : a.nodes) ? a.nodes() : null;
  2435. return b ? m.a.S(b.cloneNode(!0).childNodes) : (a = a.text(), m.a.ba(a))
  2436. }, m.O.Oa = new m.O, m.ab(m.O.Oa), m.b("nativeTemplateEngine", m.O),
  2437. function() {
  2438. m.Sa = function() {
  2439. var a = this.kc = function() {
  2440. if (!e || !e.tmpl) return 0;
  2441. try {
  2442. if (0 <= e.tmpl.tag.tmpl.open.toString().indexOf("__")) return 2
  2443. } catch (a) {}
  2444. return 1
  2445. }();
  2446. this.renderTemplateSource = function(b, d, f) {
  2447. if (f = f || {}, 2 > a) throw Error("Your version of jQuery.tmpl is too old. Please upgrade to jQuery.tmpl 1.0.0pre or later.");
  2448. var g = b.data("precompiled");
  2449. return g || (g = b.text() || "", g = e.template(null, "{{ko_with $item.koBindingContext}}" + g + "{{/ko_with}}"), b.data("precompiled", g)), b = [d.$data], d = e.extend({
  2450. koBindingContext: d
  2451. }, f.templateOptions), d = e.tmpl(g, b, d), d.appendTo(c.createElement("div")), e.fragments = {}, d
  2452. }, this.createJavaScriptEvaluatorBlock = function(a) {
  2453. return "{{ko_code ((function() { return " + a + " })()) }}"
  2454. }, this.addTemplate = function(a, b) {
  2455. c.write("<script type='text/html' id='" + a + "'>" + b + "</script>")
  2456. }, 0 < a && (e.tmpl.tag.ko_code = {
  2457. open: "__.push($1 || '');"
  2458. }, e.tmpl.tag.ko_with = {
  2459. open: "with($1) {",
  2460. close: "} "
  2461. })
  2462. }, m.Sa.prototype = new m.H;
  2463. var a = new m.Sa;
  2464. 0 < a.kc && m.ab(a), m.b("jqueryTmplTemplateEngine", m.Sa)
  2465. }()
  2466. })
  2467. }()
  2468. }(),
  2469. function() {
  2470. function a(a) {
  2471. function b(b, c, d, e, f, g) {
  2472. for (; f >= 0 && g > f; f += a) {
  2473. var h = e ? e[f] : f;
  2474. d = c(d, b[h], h, b)
  2475. }
  2476. return d
  2477. }
  2478. return function(c, d, e, f) {
  2479. d = t(d, f, 4);
  2480. var g = !A(c) && s.keys(c),
  2481. h = (g || c).length,
  2482. i = a > 0 ? 0 : h - 1;
  2483. return arguments.length < 3 && (e = c[g ? g[i] : i], i += a), b(c, d, e, g, i, h)
  2484. }
  2485. }
  2486.  
  2487. function b(a) {
  2488. return function(b, c, d) {
  2489. c = u(c, d);
  2490. for (var e = z(b), f = a > 0 ? 0 : e - 1; f >= 0 && e > f; f += a)
  2491. if (c(b[f], f, b)) return f;
  2492. return -1
  2493. }
  2494. }
  2495.  
  2496. function c(a, b, c) {
  2497. return function(d, e, f) {
  2498. var g = 0,
  2499. h = z(d);
  2500. if ("number" == typeof f) a > 0 ? g = f >= 0 ? f : Math.max(f + h, g) : h = f >= 0 ? Math.min(f + 1, h) : f + h + 1;
  2501. else if (c && f && h) return f = c(d, e), d[f] === e ? f : -1;
  2502. if (e !== e) return f = b(k.call(d, g, h), s.isNaN), f >= 0 ? f + g : -1;
  2503. for (f = a > 0 ? g : h - 1; f >= 0 && h > f; f += a)
  2504. if (d[f] === e) return f;
  2505. return -1
  2506. }
  2507. }
  2508.  
  2509. function d(a, b) {
  2510. var c = F.length,
  2511. d = a.constructor,
  2512. e = s.isFunction(d) && d.prototype || h,
  2513. f = "constructor";
  2514. for (s.has(a, f) && !s.contains(b, f) && b.push(f); c--;) f = F[c], f in a && a[f] !== e[f] && !s.contains(b, f) && b.push(f)
  2515. }
  2516. var e = this,
  2517. f = e._,
  2518. g = Array.prototype,
  2519. h = Object.prototype,
  2520. i = Function.prototype,
  2521. j = g.push,
  2522. k = g.slice,
  2523. l = h.toString,
  2524. m = h.hasOwnProperty,
  2525. n = Array.isArray,
  2526. o = Object.keys,
  2527. p = i.bind,
  2528. q = Object.create,
  2529. r = function() {},
  2530. s = function(a) {
  2531. return a instanceof s ? a : this instanceof s ? void(this._wrapped = a) : new s(a)
  2532. };
  2533. "undefined" != typeof exports ? ("undefined" != typeof module && module.exports && (exports = module.exports = s), exports._ = s) : e._ = s, s.VERSION = "1.8.3";
  2534. var t = function(a, b, c) {
  2535. if (void 0 === b) return a;
  2536. switch (null == c ? 3 : c) {
  2537. case 1:
  2538. return function(c) {
  2539. return a.call(b, c)
  2540. };
  2541. case 2:
  2542. return function(c, d) {
  2543. return a.call(b, c, d)
  2544. };
  2545. case 3:
  2546. return function(c, d, e) {
  2547. return a.call(b, c, d, e)
  2548. };
  2549. case 4:
  2550. return function(c, d, e, f) {
  2551. return a.call(b, c, d, e, f)
  2552. }
  2553. }
  2554. return function() {
  2555. return a.apply(b, arguments)
  2556. }
  2557. },
  2558. u = function(a, b, c) {
  2559. return null == a ? s.identity : s.isFunction(a) ? t(a, b, c) : s.isObject(a) ? s.matcher(a) : s.property(a)
  2560. };
  2561. s.iteratee = function(a, b) {
  2562. return u(a, b, 1 / 0)
  2563. };
  2564. var v = function(a, b) {
  2565. return function(c) {
  2566. var d = arguments.length;
  2567. if (2 > d || null == c) return c;
  2568. for (var e = 1; d > e; e++)
  2569. for (var f = arguments[e], g = a(f), h = g.length, i = 0; h > i; i++) {
  2570. var j = g[i];
  2571. b && void 0 !== c[j] || (c[j] = f[j])
  2572. }
  2573. return c
  2574. }
  2575. },
  2576. w = function(a) {
  2577. if (!s.isObject(a)) return {};
  2578. if (q) return q(a);
  2579. r.prototype = a;
  2580. var b = new r;
  2581. return r.prototype = null, b
  2582. },
  2583. x = function(a) {
  2584. return function(b) {
  2585. return null == b ? void 0 : b[a]
  2586. }
  2587. },
  2588. y = Math.pow(2, 53) - 1,
  2589. z = x("length"),
  2590. A = function(a) {
  2591. var b = z(a);
  2592. return "number" == typeof b && b >= 0 && y >= b
  2593. };
  2594. s.each = s.forEach = function(a, b, c) {
  2595. b = t(b, c);
  2596. var d, e;
  2597. if (A(a))
  2598. for (d = 0, e = a.length; e > d; d++) b(a[d], d, a);
  2599. else {
  2600. var f = s.keys(a);
  2601. for (d = 0, e = f.length; e > d; d++) b(a[f[d]], f[d], a)
  2602. }
  2603. return a
  2604. }, s.map = s.collect = function(a, b, c) {
  2605. b = u(b, c);
  2606. for (var d = !A(a) && s.keys(a), e = (d || a).length, f = Array(e), g = 0; e > g; g++) {
  2607. var h = d ? d[g] : g;
  2608. f[g] = b(a[h], h, a)
  2609. }
  2610. return f
  2611. }, s.reduce = s.foldl = s.inject = a(1), s.reduceRight = s.foldr = a(-1), s.find = s.detect = function(a, b, c) {
  2612. var d;
  2613. return d = A(a) ? s.findIndex(a, b, c) : s.findKey(a, b, c), void 0 !== d && d !== -1 ? a[d] : void 0
  2614. }, s.filter = s.select = function(a, b, c) {
  2615. var d = [];
  2616. return b = u(b, c), s.each(a, function(a, c, e) {
  2617. b(a, c, e) && d.push(a)
  2618. }), d
  2619. }, s.reject = function(a, b, c) {
  2620. return s.filter(a, s.negate(u(b)), c)
  2621. }, s.every = s.all = function(a, b, c) {
  2622. b = u(b, c);
  2623. for (var d = !A(a) && s.keys(a), e = (d || a).length, f = 0; e > f; f++) {
  2624. var g = d ? d[f] : f;
  2625. if (!b(a[g], g, a)) return !1
  2626. }
  2627. return !0
  2628. }, s.some = s.any = function(a, b, c) {
  2629. b = u(b, c);
  2630. for (var d = !A(a) && s.keys(a), e = (d || a).length, f = 0; e > f; f++) {
  2631. var g = d ? d[f] : f;
  2632. if (b(a[g], g, a)) return !0
  2633. }
  2634. return !1
  2635. }, s.contains = s.includes = s.include = function(a, b, c, d) {
  2636. return A(a) || (a = s.values(a)), ("number" != typeof c || d) && (c = 0), s.indexOf(a, b, c) >= 0
  2637. }, s.invoke = function(a, b) {
  2638. var c = k.call(arguments, 2),
  2639. d = s.isFunction(b);
  2640. return s.map(a, function(a) {
  2641. var e = d ? b : a[b];
  2642. return null == e ? e : e.apply(a, c)
  2643. })
  2644. }, s.pluck = function(a, b) {
  2645. return s.map(a, s.property(b))
  2646. }, s.where = function(a, b) {
  2647. return s.filter(a, s.matcher(b))
  2648. }, s.findWhere = function(a, b) {
  2649. return s.find(a, s.matcher(b))
  2650. }, s.max = function(a, b, c) {
  2651. var d, e, f = -1 / 0,
  2652. g = -1 / 0;
  2653. if (null == b && null != a) {
  2654. a = A(a) ? a : s.values(a);
  2655. for (var h = 0, i = a.length; i > h; h++) d = a[h], d > f && (f = d)
  2656. } else b = u(b, c), s.each(a, function(a, c, d) {
  2657. e = b(a, c, d), (e > g || e === -1 / 0 && f === -1 / 0) && (f = a, g = e)
  2658. });
  2659. return f
  2660. }, s.min = function(a, b, c) {
  2661. var d, e, f = 1 / 0,
  2662. g = 1 / 0;
  2663. if (null == b && null != a) {
  2664. a = A(a) ? a : s.values(a);
  2665. for (var h = 0, i = a.length; i > h; h++) d = a[h], f > d && (f = d)
  2666. } else b = u(b, c), s.each(a, function(a, c, d) {
  2667. e = b(a, c, d), (g > e || 1 / 0 === e && 1 / 0 === f) && (f = a, g = e)
  2668. });
  2669. return f
  2670. }, s.shuffle = function(a) {
  2671. for (var b, c = A(a) ? a : s.values(a), d = c.length, e = Array(d), f = 0; d > f; f++) b = s.random(0, f), b !== f && (e[f] = e[b]), e[b] = c[f];
  2672. return e
  2673. }, s.sample = function(a, b, c) {
  2674. return null == b || c ? (A(a) || (a = s.values(a)), a[s.random(a.length - 1)]) : s.shuffle(a).slice(0, Math.max(0, b))
  2675. },
  2676. s.sortBy = function(a, b, c) {
  2677. return b = u(b, c), s.pluck(s.map(a, function(a, c, d) {
  2678. return {
  2679. value: a,
  2680. index: c,
  2681. criteria: b(a, c, d)
  2682. }
  2683. }).sort(function(a, b) {
  2684. var c = a.criteria,
  2685. d = b.criteria;
  2686. if (c !== d) {
  2687. if (c > d || void 0 === c) return 1;
  2688. if (d > c || void 0 === d) return -1
  2689. }
  2690. return a.index - b.index
  2691. }), "value")
  2692. };
  2693. var B = function(a) {
  2694. return function(b, c, d) {
  2695. var e = {};
  2696. return c = u(c, d), s.each(b, function(d, f) {
  2697. var g = c(d, f, b);
  2698. a(e, d, g)
  2699. }), e
  2700. }
  2701. };
  2702. s.groupBy = B(function(a, b, c) {
  2703. s.has(a, c) ? a[c].push(b) : a[c] = [b]
  2704. }), s.indexBy = B(function(a, b, c) {
  2705. a[c] = b
  2706. }), s.countBy = B(function(a, b, c) {
  2707. s.has(a, c) ? a[c]++ : a[c] = 1
  2708. }), s.toArray = function(a) {
  2709. return a ? s.isArray(a) ? k.call(a) : A(a) ? s.map(a, s.identity) : s.values(a) : []
  2710. }, s.size = function(a) {
  2711. return null == a ? 0 : A(a) ? a.length : s.keys(a).length
  2712. }, s.partition = function(a, b, c) {
  2713. b = u(b, c);
  2714. var d = [],
  2715. e = [];
  2716. return s.each(a, function(a, c, f) {
  2717. (b(a, c, f) ? d : e).push(a)
  2718. }), [d, e]
  2719. }, s.first = s.head = s.take = function(a, b, c) {
  2720. return null == a ? void 0 : null == b || c ? a[0] : s.initial(a, a.length - b)
  2721. }, s.initial = function(a, b, c) {
  2722. return k.call(a, 0, Math.max(0, a.length - (null == b || c ? 1 : b)))
  2723. }, s.last = function(a, b, c) {
  2724. return null == a ? void 0 : null == b || c ? a[a.length - 1] : s.rest(a, Math.max(0, a.length - b))
  2725. }, s.rest = s.tail = s.drop = function(a, b, c) {
  2726. return k.call(a, null == b || c ? 1 : b)
  2727. }, s.compact = function(a) {
  2728. return s.filter(a, s.identity)
  2729. };
  2730. var C = function(a, b, c, d) {
  2731. for (var e = [], f = 0, g = d || 0, h = z(a); h > g; g++) {
  2732. var i = a[g];
  2733. if (A(i) && (s.isArray(i) || s.isArguments(i))) {
  2734. b || (i = C(i, b, c));
  2735. var j = 0,
  2736. k = i.length;
  2737. for (e.length += k; k > j;) e[f++] = i[j++]
  2738. } else c || (e[f++] = i)
  2739. }
  2740. return e
  2741. };
  2742. s.flatten = function(a, b) {
  2743. return C(a, b, !1)
  2744. }, s.without = function(a) {
  2745. return s.difference(a, k.call(arguments, 1))
  2746. }, s.uniq = s.unique = function(a, b, c, d) {
  2747. s.isBoolean(b) || (d = c, c = b, b = !1), null != c && (c = u(c, d));
  2748. for (var e = [], f = [], g = 0, h = z(a); h > g; g++) {
  2749. var i = a[g],
  2750. j = c ? c(i, g, a) : i;
  2751. b ? (g && f === j || e.push(i), f = j) : c ? s.contains(f, j) || (f.push(j), e.push(i)) : s.contains(e, i) || e.push(i)
  2752. }
  2753. return e
  2754. }, s.union = function() {
  2755. return s.uniq(C(arguments, !0, !0))
  2756. }, s.intersection = function(a) {
  2757. for (var b = [], c = arguments.length, d = 0, e = z(a); e > d; d++) {
  2758. var f = a[d];
  2759. if (!s.contains(b, f)) {
  2760. for (var g = 1; c > g && s.contains(arguments[g], f); g++);
  2761. g === c && b.push(f)
  2762. }
  2763. }
  2764. return b
  2765. }, s.difference = function(a) {
  2766. var b = C(arguments, !0, !0, 1);
  2767. return s.filter(a, function(a) {
  2768. return !s.contains(b, a)
  2769. })
  2770. }, s.zip = function() {
  2771. return s.unzip(arguments)
  2772. }, s.unzip = function(a) {
  2773. for (var b = a && s.max(a, z).length || 0, c = Array(b), d = 0; b > d; d++) c[d] = s.pluck(a, d);
  2774. return c
  2775. }, s.object = function(a, b) {
  2776. for (var c = {}, d = 0, e = z(a); e > d; d++) b ? c[a[d]] = b[d] : c[a[d][0]] = a[d][1];
  2777. return c
  2778. }, s.findIndex = b(1), s.findLastIndex = b(-1), s.sortedIndex = function(a, b, c, d) {
  2779. c = u(c, d, 1);
  2780. for (var e = c(b), f = 0, g = z(a); g > f;) {
  2781. var h = Math.floor((f + g) / 2);
  2782. c(a[h]) < e ? f = h + 1 : g = h
  2783. }
  2784. return f
  2785. }, s.indexOf = c(1, s.findIndex, s.sortedIndex), s.lastIndexOf = c(-1, s.findLastIndex), s.range = function(a, b, c) {
  2786. null == b && (b = a || 0, a = 0), c = c || 1;
  2787. for (var d = Math.max(Math.ceil((b - a) / c), 0), e = Array(d), f = 0; d > f; f++, a += c) e[f] = a;
  2788. return e
  2789. };
  2790. var D = function(a, b, c, d, e) {
  2791. if (!(d instanceof b)) return a.apply(c, e);
  2792. var f = w(a.prototype),
  2793. g = a.apply(f, e);
  2794. return s.isObject(g) ? g : f
  2795. };
  2796. s.bind = function(a, b) {
  2797. if (p && a.bind === p) return p.apply(a, k.call(arguments, 1));
  2798. if (!s.isFunction(a)) throw new TypeError("Bind must be called on a function");
  2799. var c = k.call(arguments, 2),
  2800. d = function() {
  2801. return D(a, d, b, this, c.concat(k.call(arguments)))
  2802. };
  2803. return d
  2804. }, s.partial = function(a) {
  2805. var b = k.call(arguments, 1),
  2806. c = function() {
  2807. for (var d = 0, e = b.length, f = Array(e), g = 0; e > g; g++) f[g] = b[g] === s ? arguments[d++] : b[g];
  2808. for (; d < arguments.length;) f.push(arguments[d++]);
  2809. return D(a, c, this, this, f)
  2810. };
  2811. return c
  2812. }, s.bindAll = function(a) {
  2813. var b, c, d = arguments.length;
  2814. if (1 >= d) throw new Error("bindAll must be passed function names");
  2815. for (b = 1; d > b; b++) c = arguments[b], a[c] = s.bind(a[c], a);
  2816. return a
  2817. }, s.memoize = function(a, b) {
  2818. var c = function(d) {
  2819. var e = c.cache,
  2820. f = "" + (b ? b.apply(this, arguments) : d);
  2821. return s.has(e, f) || (e[f] = a.apply(this, arguments)), e[f]
  2822. };
  2823. return c.cache = {}, c
  2824. }, s.delay = function(a, b) {
  2825. var c = k.call(arguments, 2);
  2826. return setTimeout(function() {
  2827. return a.apply(null, c)
  2828. }, b)
  2829. }, s.defer = s.partial(s.delay, s, 1), s.throttle = function(a, b, c) {
  2830. var d, e, f, g = null,
  2831. h = 0;
  2832. c || (c = {});
  2833. var i = function() {
  2834. h = c.leading === !1 ? 0 : s.now(), g = null, f = a.apply(d, e), g || (d = e = null)
  2835. };
  2836. return function() {
  2837. var j = s.now();
  2838. h || c.leading !== !1 || (h = j);
  2839. var k = b - (j - h);
  2840. return d = this, e = arguments, 0 >= k || k > b ? (g && (clearTimeout(g), g = null), h = j, f = a.apply(d, e), g || (d = e = null)) : g || c.trailing === !1 || (g = setTimeout(i, k)), f
  2841. }
  2842. }, s.debounce = function(a, b, c) {
  2843. var d, e, f, g, h, i = function() {
  2844. var j = s.now() - g;
  2845. b > j && j >= 0 ? d = setTimeout(i, b - j) : (d = null, c || (h = a.apply(f, e), d || (f = e = null)))
  2846. };
  2847. return function() {
  2848. f = this, e = arguments, g = s.now();
  2849. var j = c && !d;
  2850. return d || (d = setTimeout(i, b)), j && (h = a.apply(f, e), f = e = null), h
  2851. }
  2852. }, s.wrap = function(a, b) {
  2853. return s.partial(b, a)
  2854. }, s.negate = function(a) {
  2855. return function() {
  2856. return !a.apply(this, arguments)
  2857. }
  2858. }, s.compose = function() {
  2859. var a = arguments,
  2860. b = a.length - 1;
  2861. return function() {
  2862. for (var c = b, d = a[b].apply(this, arguments); c--;) d = a[c].call(this, d);
  2863. return d
  2864. }
  2865. }, s.after = function(a, b) {
  2866. return function() {
  2867. return --a < 1 ? b.apply(this, arguments) : void 0
  2868. }
  2869. }, s.before = function(a, b) {
  2870. var c;
  2871. return function() {
  2872. return --a > 0 && (c = b.apply(this, arguments)), 1 >= a && (b = null), c
  2873. }
  2874. }, s.once = s.partial(s.before, 2);
  2875. var E = !{
  2876. toString: null
  2877. }.propertyIsEnumerable("toString"),
  2878. F = ["valueOf", "isPrototypeOf", "toString", "propertyIsEnumerable", "hasOwnProperty", "toLocaleString"];
  2879. s.keys = function(a) {
  2880. if (!s.isObject(a)) return [];
  2881. if (o) return o(a);
  2882. var b = [];
  2883. for (var c in a) s.has(a, c) && b.push(c);
  2884. return E && d(a, b), b
  2885. }, s.allKeys = function(a) {
  2886. if (!s.isObject(a)) return [];
  2887. var b = [];
  2888. for (var c in a) b.push(c);
  2889. return E && d(a, b), b
  2890. }, s.values = function(a) {
  2891. for (var b = s.keys(a), c = b.length, d = Array(c), e = 0; c > e; e++) d[e] = a[b[e]];
  2892. return d
  2893. }, s.mapObject = function(a, b, c) {
  2894. b = u(b, c);
  2895. for (var d, e = s.keys(a), f = e.length, g = {}, h = 0; f > h; h++) d = e[h], g[d] = b(a[d], d, a);
  2896. return g
  2897. }, s.pairs = function(a) {
  2898. for (var b = s.keys(a), c = b.length, d = Array(c), e = 0; c > e; e++) d[e] = [b[e], a[b[e]]];
  2899. return d
  2900. }, s.invert = function(a) {
  2901. for (var b = {}, c = s.keys(a), d = 0, e = c.length; e > d; d++) b[a[c[d]]] = c[d];
  2902. return b
  2903. }, s.functions = s.methods = function(a) {
  2904. var b = [];
  2905. for (var c in a) s.isFunction(a[c]) && b.push(c);
  2906. return b.sort()
  2907. }, s.extend = v(s.allKeys), s.extendOwn = s.assign = v(s.keys), s.findKey = function(a, b, c) {
  2908. b = u(b, c);
  2909. for (var d, e = s.keys(a), f = 0, g = e.length; g > f; f++)
  2910. if (d = e[f], b(a[d], d, a)) return d
  2911. }, s.pick = function(a, b, c) {
  2912. var d, e, f = {},
  2913. g = a;
  2914. if (null == g) return f;
  2915. s.isFunction(b) ? (e = s.allKeys(g), d = t(b, c)) : (e = C(arguments, !1, !1, 1), d = function(a, b, c) {
  2916. return b in c
  2917. }, g = Object(g));
  2918. for (var h = 0, i = e.length; i > h; h++) {
  2919. var j = e[h],
  2920. k = g[j];
  2921. d(k, j, g) && (f[j] = k)
  2922. }
  2923. return f
  2924. }, s.omit = function(a, b, c) {
  2925. if (s.isFunction(b)) b = s.negate(b);
  2926. else {
  2927. var d = s.map(C(arguments, !1, !1, 1), String);
  2928. b = function(a, b) {
  2929. return !s.contains(d, b)
  2930. }
  2931. }
  2932. return s.pick(a, b, c)
  2933. }, s.defaults = v(s.allKeys, !0), s.create = function(a, b) {
  2934. var c = w(a);
  2935. return b && s.extendOwn(c, b), c
  2936. }, s.clone = function(a) {
  2937. return s.isObject(a) ? s.isArray(a) ? a.slice() : s.extend({}, a) : a
  2938. }, s.tap = function(a, b) {
  2939. return b(a), a
  2940. }, s.isMatch = function(a, b) {
  2941. var c = s.keys(b),
  2942. d = c.length;
  2943. if (null == a) return !d;
  2944. for (var e = Object(a), f = 0; d > f; f++) {
  2945. var g = c[f];
  2946. if (b[g] !== e[g] || !(g in e)) return !1
  2947. }
  2948. return !0
  2949. };
  2950. var G = function(a, b, c, d) {
  2951. if (a === b) return 0 !== a || 1 / a === 1 / b;
  2952. if (null == a || null == b) return a === b;
  2953. a instanceof s && (a = a._wrapped), b instanceof s && (b = b._wrapped);
  2954. var e = l.call(a);
  2955. if (e !== l.call(b)) return !1;
  2956. switch (e) {
  2957. case "[object RegExp]":
  2958. case "[object String]":
  2959. return "" + a == "" + b;
  2960. case "[object Number]":
  2961. return +a !== +a ? +b !== +b : 0 === +a ? 1 / +a === 1 / b : +a === +b;
  2962. case "[object Date]":
  2963. case "[object Boolean]":
  2964. return +a === +b
  2965. }
  2966. var f = "[object Array]" === e;
  2967. if (!f) {
  2968. if ("object" != typeof a || "object" != typeof b) return !1;
  2969. var g = a.constructor,
  2970. h = b.constructor;
  2971. if (g !== h && !(s.isFunction(g) && g instanceof g && s.isFunction(h) && h instanceof h) && "constructor" in a && "constructor" in b) return !1
  2972. }
  2973. c = c || [], d = d || [];
  2974. for (var i = c.length; i--;)
  2975. if (c[i] === a) return d[i] === b;
  2976. if (c.push(a), d.push(b), f) {
  2977. if (i = a.length, i !== b.length) return !1;
  2978. for (; i--;)
  2979. if (!G(a[i], b[i], c, d)) return !1
  2980. } else {
  2981. var j, k = s.keys(a);
  2982. if (i = k.length, s.keys(b).length !== i) return !1;
  2983. for (; i--;)
  2984. if (j = k[i], !s.has(b, j) || !G(a[j], b[j], c, d)) return !1
  2985. }
  2986. return c.pop(), d.pop(), !0
  2987. };
  2988. s.isEqual = function(a, b) {
  2989. return G(a, b)
  2990. }, s.isEmpty = function(a) {
  2991. return null == a || (A(a) && (s.isArray(a) || s.isString(a) || s.isArguments(a)) ? 0 === a.length : 0 === s.keys(a).length)
  2992. }, s.isElement = function(a) {
  2993. return !(!a || 1 !== a.nodeType)
  2994. }, s.isArray = n || function(a) {
  2995. return "[object Array]" === l.call(a)
  2996. }, s.isObject = function(a) {
  2997. var b = typeof a;
  2998. return "function" === b || "object" === b && !!a
  2999. }, s.each(["Arguments", "Function", "String", "Number", "Date", "RegExp", "Error"], function(a) {
  3000. s["is" + a] = function(b) {
  3001. return l.call(b) === "[object " + a + "]"
  3002. }
  3003. }), s.isArguments(arguments) || (s.isArguments = function(a) {
  3004. return s.has(a, "callee")
  3005. }), "function" != typeof /./ && "object" != typeof Int8Array && (s.isFunction = function(a) {
  3006. return "function" == typeof a || !1
  3007. }), s.isFinite = function(a) {
  3008. return isFinite(a) && !isNaN(parseFloat(a))
  3009. }, s.isNaN = function(a) {
  3010. return s.isNumber(a) && a !== +a
  3011. }, s.isBoolean = function(a) {
  3012. return a === !0 || a === !1 || "[object Boolean]" === l.call(a)
  3013. }, s.isNull = function(a) {
  3014. return null === a
  3015. }, s.isUndefined = function(a) {
  3016. return void 0 === a
  3017. }, s.has = function(a, b) {
  3018. return null != a && m.call(a, b)
  3019. }, s.noConflict = function() {
  3020. return e._ = f, this
  3021. }, s.identity = function(a) {
  3022. return a
  3023. }, s.constant = function(a) {
  3024. return function() {
  3025. return a
  3026. }
  3027. }, s.noop = function() {}, s.property = x, s.propertyOf = function(a) {
  3028. return null == a ? function() {} : function(b) {
  3029. return a[b]
  3030. }
  3031. }, s.matcher = s.matches = function(a) {
  3032. return a = s.extendOwn({}, a),
  3033. function(b) {
  3034. return s.isMatch(b, a)
  3035. }
  3036. }, s.times = function(a, b, c) {
  3037. var d = Array(Math.max(0, a));
  3038. b = t(b, c, 1);
  3039. for (var e = 0; a > e; e++) d[e] = b(e);
  3040. return d
  3041. }, s.random = function(a, b) {
  3042. return null == b && (b = a, a = 0), a + Math.floor(Math.random() * (b - a + 1))
  3043. }, s.now = Date.now || function() {
  3044. return (new Date).getTime()
  3045. };
  3046. var H = {
  3047. "&": "&amp;",
  3048. "<": "&lt;",
  3049. ">": "&gt;",
  3050. '"': "&quot;",
  3051. "'": "&#x27;",
  3052. "`": "&#x60;"
  3053. },
  3054. I = s.invert(H),
  3055. J = function(a) {
  3056. var b = function(b) {
  3057. return a[b]
  3058. },
  3059. c = "(?:" + s.keys(a).join("|") + ")",
  3060. d = RegExp(c),
  3061. e = RegExp(c, "g");
  3062. return function(a) {
  3063. return a = null == a ? "" : "" + a, d.test(a) ? a.replace(e, b) : a
  3064. }
  3065. };
  3066. s.escape = J(H), s.unescape = J(I), s.result = function(a, b, c) {
  3067. var d = null == a ? void 0 : a[b];
  3068. return void 0 === d && (d = c), s.isFunction(d) ? d.call(a) : d
  3069. };
  3070. var K = 0;
  3071. s.uniqueId = function(a) {
  3072. var b = ++K + "";
  3073. return a ? a + b : b
  3074. }, s.templateSettings = {
  3075. evaluate: /<%([\s\S]+?)%>/g,
  3076. interpolate: /<%=([\s\S]+?)%>/g,
  3077. escape: /<%-([\s\S]+?)%>/g
  3078. };
  3079. var L = /(.)^/,
  3080. M = {
  3081. "'": "'",
  3082. "\\": "\\",
  3083. "\r": "r",
  3084. "\n": "n",
  3085. "\u2028": "u2028",
  3086. "\u2029": "u2029"
  3087. },
  3088. N = /\\|'|\r|\n|\u2028|\u2029/g,
  3089. O = function(a) {
  3090. return "\\" + M[a]
  3091. };
  3092. s.template = function(a, b, c) {
  3093. !b && c && (b = c), b = s.defaults({}, b, s.templateSettings);
  3094. var d = RegExp([(b.escape || L).source, (b.interpolate || L).source, (b.evaluate || L).source].join("|") + "|$", "g"),
  3095. e = 0,
  3096. f = "__p+='";
  3097. a.replace(d, function(b, c, d, g, h) {
  3098. return f += a.slice(e, h).replace(N, O), e = h + b.length, c ? f += "'+\n((__t=(" + c + "))==null?'':_.escape(__t))+\n'" : d ? f += "'+\n((__t=(" + d + "))==null?'':__t)+\n'" : g && (f += "';\n" + g + "\n__p+='"), b
  3099. }), f += "';\n", b.variable || (f = "with(obj||{}){\n" + f + "}\n"), f = "var __t,__p='',__j=Array.prototype.join,print=function(){__p+=__j.call(arguments,'');};\n" + f + "return __p;\n";
  3100. try {
  3101. var g = new Function(b.variable || "obj", "_", f)
  3102. } catch (a) {
  3103. throw a.source = f, a
  3104. }
  3105. var h = function(a) {
  3106. return g.call(this, a, s)
  3107. },
  3108. i = b.variable || "obj";
  3109. return h.source = "function(" + i + "){\n" + f + "}", h
  3110. }, s.chain = function(a) {
  3111. var b = s(a);
  3112. return b._chain = !0, b
  3113. };
  3114. var P = function(a, b) {
  3115. return a._chain ? s(b).chain() : b
  3116. };
  3117. s.mixin = function(a) {
  3118. s.each(s.functions(a), function(b) {
  3119. var c = s[b] = a[b];
  3120. s.prototype[b] = function() {
  3121. var a = [this._wrapped];
  3122. return j.apply(a, arguments), P(this, c.apply(s, a))
  3123. }
  3124. })
  3125. }, s.mixin(s), s.each(["pop", "push", "reverse", "shift", "sort", "splice", "unshift"], function(a) {
  3126. var b = g[a];
  3127. s.prototype[a] = function() {
  3128. var c = this._wrapped;
  3129. return b.apply(c, arguments), "shift" !== a && "splice" !== a || 0 !== c.length || delete c[0], P(this, c)
  3130. }
  3131. }), s.each(["concat", "join", "slice"], function(a) {
  3132. var b = g[a];
  3133. s.prototype[a] = function() {
  3134. return P(this, b.apply(this._wrapped, arguments))
  3135. }
  3136. }), s.prototype.value = function() {
  3137. return this._wrapped
  3138. }, s.prototype.valueOf = s.prototype.toJSON = s.prototype.value, s.prototype.toString = function() {
  3139. return "" + this._wrapped
  3140. }, "function" == typeof define && define.amd && define("underscore", [], function() {
  3141. return s
  3142. })
  3143. }.call(this),
  3144. function(a, b) {
  3145. function c(a) {
  3146. var b = oa[a] = {};
  3147. return $.each(a.split(ba), function(a, c) {
  3148. b[c] = !0
  3149. }), b
  3150. }
  3151.  
  3152. function d(a, c, d) {
  3153. if (d === b && 1 === a.nodeType) {
  3154. var e = "data-" + c.replace(qa, "-$1").toLowerCase();
  3155. if (d = a.getAttribute(e), "string" == typeof d) {
  3156. try {
  3157. d = "true" === d || "false" !== d && ("null" === d ? null : +d + "" === d ? +d : pa.test(d) ? $.parseJSON(d) : d)
  3158. } catch (a) {}
  3159. $.data(a, c, d)
  3160. } else d = b
  3161. }
  3162. return d
  3163. }
  3164.  
  3165. function e(a) {
  3166. var b;
  3167. for (b in a)
  3168. if (("data" !== b || !$.isEmptyObject(a[b])) && "toJSON" !== b) return !1;
  3169. return !0
  3170. }
  3171.  
  3172. function f() {
  3173. return !1
  3174. }
  3175.  
  3176. function g() {
  3177. return !0
  3178. }
  3179.  
  3180. function h(a) {
  3181. return !a || !a.parentNode || 11 === a.parentNode.nodeType
  3182. }
  3183.  
  3184. function i(a, b) {
  3185. do a = a[b]; while (a && 1 !== a.nodeType);
  3186. return a
  3187. }
  3188.  
  3189. function j(a, b, c) {
  3190. if (b = b || 0, $.isFunction(b)) return $.grep(a, function(a, d) {
  3191. var e = !!b.call(a, d, a);
  3192. return e === c
  3193. });
  3194. if (b.nodeType) return $.grep(a, function(a, d) {
  3195. return a === b === c
  3196. });
  3197. if ("string" == typeof b) {
  3198. var d = $.grep(a, function(a) {
  3199. return 1 === a.nodeType
  3200. });
  3201. if (Ka.test(b)) return $.filter(b, d, !c);
  3202. b = $.filter(b, d)
  3203. }
  3204. return $.grep(a, function(a, d) {
  3205. return $.inArray(a, b) >= 0 === c
  3206. })
  3207. }
  3208.  
  3209. function k(a) {
  3210. var b = Na.split("|"),
  3211. c = a.createDocumentFragment();
  3212. if (c.createElement)
  3213. for (; b.length;) c.createElement(b.pop());
  3214. return c
  3215. }
  3216.  
  3217. function l(a, b) {
  3218. return a.getElementsByTagName(b)[0] || a.appendChild(a.ownerDocument.createElement(b))
  3219. }
  3220.  
  3221. function m(a, b) {
  3222. if (1 === b.nodeType && $.hasData(a)) {
  3223. var c, d, e, f = $._data(a),
  3224. g = $._data(b, f),
  3225. h = f.events;
  3226. if (h) {
  3227. delete g.handle, g.events = {};
  3228. for (c in h)
  3229. for (d = 0, e = h[c].length; d < e; d++) $.event.add(b, c, h[c][d])
  3230. }
  3231. g.data && (g.data = $.extend({}, g.data))
  3232. }
  3233. }
  3234.  
  3235. function n(a, b) {
  3236. var c;
  3237. 1 === b.nodeType && (b.clearAttributes && b.clearAttributes(), b.mergeAttributes && b.mergeAttributes(a), c = b.nodeName.toLowerCase(), "object" === c ? (b.parentNode && (b.outerHTML = a.outerHTML), $.support.html5Clone && a.innerHTML && !$.trim(b.innerHTML) && (b.innerHTML = a.innerHTML)) : "input" === c && Xa.test(a.type) ? (b.defaultChecked = b.checked = a.checked, b.value !== a.value && (b.value = a.value)) : "option" === c ? b.selected = a.defaultSelected : "input" === c || "textarea" === c ? b.defaultValue = a.defaultValue : "script" === c && b.text !== a.text && (b.text = a.text), b.removeAttribute($.expando))
  3238. }
  3239.  
  3240. function o(a) {
  3241. return "undefined" != typeof a.getElementsByTagName ? a.getElementsByTagName("*") : "undefined" != typeof a.querySelectorAll ? a.querySelectorAll("*") : []
  3242. }
  3243.  
  3244. function p(a) {
  3245. Xa.test(a.type) && (a.defaultChecked = a.checked)
  3246. }
  3247.  
  3248. function q(a, b) {
  3249. if (b in a) return b;
  3250. for (var c = b.charAt(0).toUpperCase() + b.slice(1), d = b, e = rb.length; e--;)
  3251. if (b = rb[e] + c, b in a) return b;
  3252. return d
  3253. }
  3254.  
  3255. function r(a, b) {
  3256. return a = b || a, "none" === $.css(a, "display") || !$.contains(a.ownerDocument, a)
  3257. }
  3258.  
  3259. function s(a, b) {
  3260. for (var c, d, e = [], f = 0, g = a.length; f < g; f++) c = a[f], c.style && (e[f] = $._data(c, "olddisplay"), b ? (!e[f] && "none" === c.style.display && (c.style.display = ""), "" === c.style.display && r(c) && (e[f] = $._data(c, "olddisplay", w(c.nodeName)))) : (d = cb(c, "display"), !e[f] && "none" !== d && $._data(c, "olddisplay", d)));
  3261. for (f = 0; f < g; f++) c = a[f], c.style && (b && "none" !== c.style.display && "" !== c.style.display || (c.style.display = b ? e[f] || "" : "none"));
  3262. return a
  3263. }
  3264.  
  3265. function t(a, b, c) {
  3266. var d = kb.exec(b);
  3267. return d ? Math.max(0, d[1] - (c || 0)) + (d[2] || "px") : b
  3268. }
  3269.  
  3270. function u(a, b, c, d) {
  3271. for (var e = c === (d ? "border" : "content") ? 4 : "width" === b ? 1 : 0, f = 0; e < 4; e += 2) "margin" === c && (f += $.css(a, c + qb[e], !0)), d ? ("content" === c && (f -= parseFloat(cb(a, "padding" + qb[e])) || 0), "margin" !== c && (f -= parseFloat(cb(a, "border" + qb[e] + "Width")) || 0)) : (f += parseFloat(cb(a, "padding" + qb[e])) || 0, "padding" !== c && (f += parseFloat(cb(a, "border" + qb[e] + "Width")) || 0));
  3272. return f
  3273. }
  3274.  
  3275. function v(a, b, c) {
  3276. var d = "width" === b ? a.offsetWidth : a.offsetHeight,
  3277. e = !0,
  3278. f = $.support.boxSizing && "border-box" === $.css(a, "boxSizing");
  3279. if (d <= 0 || null == d) {
  3280. if (d = cb(a, b), (d < 0 || null == d) && (d = a.style[b]), lb.test(d)) return d;
  3281. e = f && ($.support.boxSizingReliable || d === a.style[b]), d = parseFloat(d) || 0
  3282. }
  3283. return d + u(a, b, c || (f ? "border" : "content"), e) + "px"
  3284. }
  3285.  
  3286. function w(a) {
  3287. if (nb[a]) return nb[a];
  3288. var b = $("<" + a + ">").appendTo(P.body),
  3289. c = b.css("display");
  3290. return b.remove(), "none" !== c && "" !== c || (db = P.body.appendChild(db || $.extend(P.createElement("iframe"), {
  3291. frameBorder: 0,
  3292. width: 0,
  3293. height: 0
  3294. })), eb && db.createElement || (eb = (db.contentWindow || db.contentDocument).document, eb.write("<!doctype html><html><body>"), eb.close()), b = eb.body.appendChild(eb.createElement(a)), c = cb(b, "display"), P.body.removeChild(db)), nb[a] = c, c
  3295. }
  3296.  
  3297. function x(a, b, c, d) {
  3298. var e;
  3299. if ($.isArray(b)) $.each(b, function(b, e) {
  3300. c || ub.test(a) ? d(a, e) : x(a + "[" + ("object" == typeof e ? b : "") + "]", e, c, d)
  3301. });
  3302. else if (c || "object" !== $.type(b)) d(a, b);
  3303. else
  3304. for (e in b) x(a + "[" + e + "]", b[e], c, d)
  3305. }
  3306.  
  3307. function y(a) {
  3308. return function(b, c) {
  3309. "string" != typeof b && (c = b, b = "*");
  3310. var d, e, f, g = b.toLowerCase().split(ba),
  3311. h = 0,
  3312. i = g.length;
  3313. if ($.isFunction(c))
  3314. for (; h < i; h++) d = g[h], f = /^\+/.test(d), f && (d = d.substr(1) || "*"), e = a[d] = a[d] || [], e[f ? "unshift" : "push"](c)
  3315. }
  3316. }
  3317.  
  3318. function z(a, c, d, e, f, g) {
  3319. f = f || c.dataTypes[0], g = g || {}, g[f] = !0;
  3320. for (var h, i = a[f], j = 0, k = i ? i.length : 0, l = a === Kb; j < k && (l || !h); j++) h = i[j](c, d, e), "string" == typeof h && (!l || g[h] ? h = b : (c.dataTypes.unshift(h), h = z(a, c, d, e, h, g)));
  3321. return (l || !h) && !g["*"] && (h = z(a, c, d, e, "*", g)), h
  3322. }
  3323.  
  3324. function A(a, c) {
  3325. var d, e, f = $.ajaxSettings.flatOptions || {};
  3326. for (d in c) c[d] !== b && ((f[d] ? a : e || (e = {}))[d] = c[d]);
  3327. e && $.extend(!0, a, e)
  3328. }
  3329.  
  3330. function B(a, c, d) {
  3331. var e, f, g, h, i = a.contents,
  3332. j = a.dataTypes,
  3333. k = a.responseFields;
  3334. for (f in k) f in d && (c[k[f]] = d[f]);
  3335. for (;
  3336. "*" === j[0];) j.shift(), e === b && (e = a.mimeType || c.getResponseHeader("content-type"));
  3337. if (e)
  3338. for (f in i)
  3339. if (i[f] && i[f].test(e)) {
  3340. j.unshift(f);
  3341. break
  3342. }
  3343. if (j[0] in d) g = j[0];
  3344. else {
  3345. for (f in d) {
  3346. if (!j[0] || a.converters[f + " " + j[0]]) {
  3347. g = f;
  3348. break
  3349. }
  3350. h || (h = f)
  3351. }
  3352. g = g || h
  3353. }
  3354. if (g) return g !== j[0] && j.unshift(g), d[g]
  3355. }
  3356.  
  3357. function C(a, b) {
  3358. var c, d, e, f, g = a.dataTypes.slice(),
  3359. h = g[0],
  3360. i = {},
  3361. j = 0;
  3362. if (a.dataFilter && (b = a.dataFilter(b, a.dataType)), g[1])
  3363. for (c in a.converters) i[c.toLowerCase()] = a.converters[c];
  3364. for (; e = g[++j];)
  3365. if ("*" !== e) {
  3366. if ("*" !== h && h !== e) {
  3367. if (c = i[h + " " + e] || i["* " + e], !c)
  3368. for (d in i)
  3369. if (f = d.split(" "), f[1] === e && (c = i[h + " " + f[0]] || i["* " + f[0]])) {
  3370. c === !0 ? c = i[d] : i[d] !== !0 && (e = f[0], g.splice(j--, 0, e));
  3371. break
  3372. }
  3373. if (c !== !0)
  3374. if (c && a.throws) b = c(b);
  3375. else try {
  3376. b = c(b)
  3377. } catch (a) {
  3378. return {
  3379. state: "parsererror",
  3380. error: c ? a : "No conversion from " + h + " to " + e
  3381. }
  3382. }
  3383. }
  3384. h = e
  3385. }
  3386. return {
  3387. state: "success",
  3388. data: b
  3389. }
  3390. }
  3391.  
  3392. function D() {
  3393. try {
  3394. return new a.XMLHttpRequest
  3395. } catch (a) {}
  3396. }
  3397.  
  3398. function E() {
  3399. try {
  3400. return new a.ActiveXObject("Microsoft.XMLHTTP")
  3401. } catch (a) {}
  3402. }
  3403.  
  3404. function F() {
  3405. return setTimeout(function() {
  3406. Ub = b
  3407. }, 0), Ub = $.now()
  3408. }
  3409.  
  3410. function G(a, b) {
  3411. $.each(b, function(b, c) {
  3412. for (var d = ($b[b] || []).concat($b["*"]), e = 0, f = d.length; e < f; e++)
  3413. if (d[e].call(a, b, c)) return
  3414. })
  3415. }
  3416.  
  3417. function H(a, b, c) {
  3418. var d, e = 0,
  3419. f = Zb.length,
  3420. g = $.Deferred().always(function() {
  3421. delete h.elem
  3422. }),
  3423. h = function() {
  3424. for (var b = Ub || F(), c = Math.max(0, i.startTime + i.duration - b), d = 1 - (c / i.duration || 0), e = 0, f = i.tweens.length; e < f; e++) i.tweens[e].run(d);
  3425. return g.notifyWith(a, [i, d, c]), d < 1 && f ? c : (g.resolveWith(a, [i]), !1)
  3426. },
  3427. i = g.promise({
  3428. elem: a,
  3429. props: $.extend({}, b),
  3430. opts: $.extend(!0, {
  3431. specialEasing: {}
  3432. }, c),
  3433. originalProperties: b,
  3434. originalOptions: c,
  3435. startTime: Ub || F(),
  3436. duration: c.duration,
  3437. tweens: [],
  3438. createTween: function(b, c, d) {
  3439. var e = $.Tween(a, i.opts, b, c, i.opts.specialEasing[b] || i.opts.easing);
  3440. return i.tweens.push(e), e
  3441. },
  3442. stop: function(b) {
  3443. for (var c = 0, d = b ? i.tweens.length : 0; c < d; c++) i.tweens[c].run(1);
  3444. return b ? g.resolveWith(a, [i, b]) : g.rejectWith(a, [i, b]), this
  3445. }
  3446. }),
  3447. j = i.props;
  3448. for (I(j, i.opts.specialEasing); e < f; e++)
  3449. if (d = Zb[e].call(i, a, j, i.opts)) return d;
  3450. return G(i, j), $.isFunction(i.opts.start) && i.opts.start.call(a, i), $.fx.timer($.extend(h, {
  3451. anim: i,
  3452. queue: i.opts.queue,
  3453. elem: a
  3454. })), i.progress(i.opts.progress).done(i.opts.done, i.opts.complete).fail(i.opts.fail).always(i.opts.always)
  3455. }
  3456.  
  3457. function I(a, b) {
  3458. var c, d, e, f, g;
  3459. for (c in a)
  3460. if (d = $.camelCase(c), e = b[d], f = a[c], $.isArray(f) && (e = f[1], f = a[c] = f[0]), c !== d && (a[d] = f, delete a[c]), g = $.cssHooks[d], g && "expand" in g) {
  3461. f = g.expand(f), delete a[d];
  3462. for (c in f) c in a || (a[c] = f[c], b[c] = e)
  3463. } else b[d] = e
  3464. }
  3465.  
  3466. function J(a, b, c) {
  3467. var d, e, f, g, h, i, j, k, l = this,
  3468. m = a.style,
  3469. n = {},
  3470. o = [],
  3471. p = a.nodeType && r(a);
  3472. c.queue || (j = $._queueHooks(a, "fx"), null == j.unqueued && (j.unqueued = 0, k = j.empty.fire, j.empty.fire = function() {
  3473. j.unqueued || k()
  3474. }), j.unqueued++, l.always(function() {
  3475. l.always(function() {
  3476. j.unqueued--, $.queue(a, "fx").length || j.empty.fire()
  3477. })
  3478. })), 1 === a.nodeType && ("height" in b || "width" in b) && (c.overflow = [m.overflow, m.overflowX, m.overflowY], "inline" === $.css(a, "display") && "none" === $.css(a, "float") && ($.support.inlineBlockNeedsLayout && "inline" !== w(a.nodeName) ? m.zoom = 1 : m.display = "inline-block")), c.overflow && (m.overflow = "hidden", $.support.shrinkWrapBlocks || l.done(function() {
  3479. m.overflow = c.overflow[0], m.overflowX = c.overflow[1], m.overflowY = c.overflow[2]
  3480. }));
  3481. for (d in b)
  3482. if (f = b[d], Wb.exec(f)) {
  3483. if (delete b[d], f === (p ? "hide" : "show")) continue;
  3484. o.push(d)
  3485. }
  3486. if (g = o.length)
  3487. for (h = $._data(a, "fxshow") || $._data(a, "fxshow", {}), p ? $(a).show() : l.done(function() {
  3488. $(a).hide()
  3489. }), l.done(function() {
  3490. var b;
  3491. $.removeData(a, "fxshow", !0);
  3492. for (b in n) $.style(a, b, n[b])
  3493. }), d = 0; d < g; d++) e = o[d], i = l.createTween(e, p ? h[e] : 0), n[e] = h[e] || $.style(a, e), e in h || (h[e] = i.start, p && (i.end = i.start, i.start = "width" === e || "height" === e ? 1 : 0))
  3494. }
  3495.  
  3496. function K(a, b, c, d, e) {
  3497. return new K.prototype.init(a, b, c, d, e)
  3498. }
  3499.  
  3500. function L(a, b) {
  3501. var c, d = {
  3502. height: a
  3503. },
  3504. e = 0;
  3505. for (b = b ? 1 : 0; e < 4; e += 2 - b) c = qb[e], d["margin" + c] = d["padding" + c] = a;
  3506. return b && (d.opacity = d.width = a), d
  3507. }
  3508.  
  3509. function M(a) {
  3510. return $.isWindow(a) ? a : 9 === a.nodeType && (a.defaultView || a.parentWindow)
  3511. }
  3512. var N, O, P = a.document,
  3513. Q = a.location,
  3514. R = a.navigator,
  3515. S = a.jQuery,
  3516. T = a.$,
  3517. U = Array.prototype.push,
  3518. V = Array.prototype.slice,
  3519. W = Array.prototype.indexOf,
  3520. X = Object.prototype.toString,
  3521. Y = Object.prototype.hasOwnProperty,
  3522. Z = String.prototype.trim,
  3523. $ = function(a, b) {
  3524. return new $.fn.init(a, b, N)
  3525. },
  3526. _ = /[\-+]?(?:\d*\.|)\d+(?:[eE][\-+]?\d+|)/.source,
  3527. aa = /\S/,
  3528. ba = /\s+/,
  3529. ca = /^[\s\uFEFF\xA0]+|[\s\uFEFF\xA0]+$/g,
  3530. da = /^(?:[^#<]*(<[\w\W]+>)[^>]*$|#([\w\-]*)$)/,
  3531. ea = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
  3532. fa = /^[\],:{}\s]*$/,
  3533. ga = /(?:^|:|,)(?:\s*\[)+/g,
  3534. ha = /\\(?:["\\\/bfnrt]|u[\da-fA-F]{4})/g,
  3535. ia = /"[^"\\\r\n]*"|true|false|null|-?(?:\d\d*\.|)\d+(?:[eE][\-+]?\d+|)/g,
  3536. ja = /^-ms-/,
  3537. ka = /-([\da-z])/gi,
  3538. la = function(a, b) {
  3539. return (b + "").toUpperCase()
  3540. },
  3541. ma = function() {
  3542. P.addEventListener ? (P.removeEventListener("DOMContentLoaded", ma, !1), $.ready()) : "complete" === P.readyState && (P.detachEvent("onreadystatechange", ma), $.ready())
  3543. },
  3544. na = {};
  3545. $.fn = $.prototype = {
  3546. constructor: $,
  3547. init: function(a, c, d) {
  3548. var e, f, g;
  3549. if (!a) return this;
  3550. if (a.nodeType) return this.context = this[0] = a, this.length = 1, this;
  3551. if ("string" == typeof a) {
  3552. if (e = "<" === a.charAt(0) && ">" === a.charAt(a.length - 1) && a.length >= 3 ? [null, a, null] : da.exec(a), e && (e[1] || !c)) {
  3553. if (e[1]) return c = c instanceof $ ? c[0] : c, g = c && c.nodeType ? c.ownerDocument || c : P, a = $.parseHTML(e[1], g, !0), ea.test(e[1]) && $.isPlainObject(c) && this.attr.call(a, c, !0), $.merge(this, a);
  3554. if (f = P.getElementById(e[2]), f && f.parentNode) {
  3555. if (f.id !== e[2]) return d.find(a);
  3556. this.length = 1, this[0] = f
  3557. }
  3558. return this.context = P, this.selector = a, this
  3559. }
  3560. return !c || c.jquery ? (c || d).find(a) : this.constructor(c).find(a)
  3561. }
  3562. return $.isFunction(a) ? d.ready(a) : (a.selector !== b && (this.selector = a.selector, this.context = a.context), $.makeArray(a, this))
  3563. },
  3564. selector: "",
  3565. jquery: "1.8.1",
  3566. length: 0,
  3567. size: function() {
  3568. return this.length
  3569. },
  3570. toArray: function() {
  3571. return V.call(this)
  3572. },
  3573. get: function(a) {
  3574. return null == a ? this.toArray() : a < 0 ? this[this.length + a] : this[a]
  3575. },
  3576. pushStack: function(a, b, c) {
  3577. var d = $.merge(this.constructor(), a);
  3578. return d.prevObject = this, d.context = this.context, "find" === b ? d.selector = this.selector + (this.selector ? " " : "") + c : b && (d.selector = this.selector + "." + b + "(" + c + ")"), d
  3579. },
  3580. each: function(a, b) {
  3581. return $.each(this, a, b)
  3582. },
  3583. ready: function(a) {
  3584. return $.ready.promise().done(a), this
  3585. },
  3586. eq: function(a) {
  3587. return a = +a, a === -1 ? this.slice(a) : this.slice(a, a + 1)
  3588. },
  3589. first: function() {
  3590. return this.eq(0)
  3591. },
  3592. last: function() {
  3593. return this.eq(-1)
  3594. },
  3595. slice: function() {
  3596. return this.pushStack(V.apply(this, arguments), "slice", V.call(arguments).join(","))
  3597. },
  3598. map: function(a) {
  3599. return this.pushStack($.map(this, function(b, c) {
  3600. return a.call(b, c, b)
  3601. }))
  3602. },
  3603. end: function() {
  3604. return this.prevObject || this.constructor(null)
  3605. },
  3606. push: U,
  3607. sort: [].sort,
  3608. splice: [].splice
  3609. }, $.fn.init.prototype = $.fn, $.extend = $.fn.extend = function() {
  3610. var a, c, d, e, f, g, h = arguments[0] || {},
  3611. i = 1,
  3612. j = arguments.length,
  3613. k = !1;
  3614. for ("boolean" == typeof h && (k = h, h = arguments[1] || {}, i = 2), "object" != typeof h && !$.isFunction(h) && (h = {}), j === i && (h = this, --i); i < j; i++)
  3615. if (null != (a = arguments[i]))
  3616. for (c in a) d = h[c], e = a[c], h !== e && (k && e && ($.isPlainObject(e) || (f = $.isArray(e))) ? (f ? (f = !1, g = d && $.isArray(d) ? d : []) : g = d && $.isPlainObject(d) ? d : {}, h[c] = $.extend(k, g, e)) : e !== b && (h[c] = e));
  3617. return h
  3618. }, $.extend({
  3619. noConflict: function(b) {
  3620. return a.$ === $ && (a.$ = T), b && a.jQuery === $ && (a.jQuery = S), $
  3621. },
  3622. isReady: !1,
  3623. readyWait: 1,
  3624. holdReady: function(a) {
  3625. a ? $.readyWait++ : $.ready(!0)
  3626. },
  3627. ready: function(a) {
  3628. if (a === !0 ? !--$.readyWait : !$.isReady) {
  3629. if (!P.body) return setTimeout($.ready, 1);
  3630. $.isReady = !0, a !== !0 && --$.readyWait > 0 || (O.resolveWith(P, [$]), $.fn.trigger && $(P).trigger("ready").off("ready"))
  3631. }
  3632. },
  3633. isFunction: function(a) {
  3634. return "function" === $.type(a)
  3635. },
  3636. isArray: Array.isArray || function(a) {
  3637. return "array" === $.type(a)
  3638. },
  3639. isWindow: function(a) {
  3640. return null != a && a == a.window
  3641. },
  3642. isNumeric: function(a) {
  3643. return !isNaN(parseFloat(a)) && isFinite(a)
  3644. },
  3645. type: function(a) {
  3646. return null == a ? String(a) : na[X.call(a)] || "object"
  3647. },
  3648. isPlainObject: function(a) {
  3649. if (!a || "object" !== $.type(a) || a.nodeType || $.isWindow(a)) return !1;
  3650. try {
  3651. if (a.constructor && !Y.call(a, "constructor") && !Y.call(a.constructor.prototype, "isPrototypeOf")) return !1
  3652. } catch (a) {
  3653. return !1
  3654. }
  3655. var c;
  3656. for (c in a);
  3657. return c === b || Y.call(a, c)
  3658. },
  3659. isEmptyObject: function(a) {
  3660. var b;
  3661. for (b in a) return !1;
  3662. return !0
  3663. },
  3664. error: function(a) {
  3665. throw new Error(a)
  3666. },
  3667. parseHTML: function(a, b, c) {
  3668. var d;
  3669. return a && "string" == typeof a ? ("boolean" == typeof b && (c = b, b = 0), b = b || P, (d = ea.exec(a)) ? [b.createElement(d[1])] : (d = $.buildFragment([a], b, c ? null : []), $.merge([], (d.cacheable ? $.clone(d.fragment) : d.fragment).childNodes))) : null
  3670. },
  3671. parseJSON: function(b) {
  3672. return b && "string" == typeof b ? (b = $.trim(b), a.JSON && a.JSON.parse ? a.JSON.parse(b) : fa.test(b.replace(ha, "@").replace(ia, "]").replace(ga, "")) ? new Function("return " + b)() : void $.error("Invalid JSON: " + b)) : null
  3673. },
  3674. parseXML: function(c) {
  3675. var d, e;
  3676. if (!c || "string" != typeof c) return null;
  3677. try {
  3678. a.DOMParser ? (e = new DOMParser, d = e.parseFromString(c, "text/xml")) : (d = new ActiveXObject("Microsoft.XMLDOM"), d.async = "false", d.loadXML(c))
  3679. } catch (a) {
  3680. d = b
  3681. }
  3682. return (!d || !d.documentElement || d.getElementsByTagName("parsererror").length) && $.error("Invalid XML: " + c), d
  3683. },
  3684. noop: function() {},
  3685. globalEval: function(b) {
  3686. b && aa.test(b) && (a.execScript || function(b) {
  3687. a.eval.call(a, b)
  3688. })(b)
  3689. },
  3690. camelCase: function(a) {
  3691. return a.replace(ja, "ms-").replace(ka, la)
  3692. },
  3693. nodeName: function(a, b) {
  3694. return a.nodeName && a.nodeName.toUpperCase() === b.toUpperCase()
  3695. },
  3696. each: function(a, c, d) {
  3697. var e, f = 0,
  3698. g = a.length,
  3699. h = g === b || $.isFunction(a);
  3700. if (d)
  3701. if (h) {
  3702. for (e in a)
  3703. if (c.apply(a[e], d) === !1) break
  3704. } else
  3705. for (; f < g && c.apply(a[f++], d) !== !1;);
  3706. else if (h) {
  3707. for (e in a)
  3708. if (c.call(a[e], e, a[e]) === !1) break
  3709. } else
  3710. for (; f < g && c.call(a[f], f, a[f++]) !== !1;);
  3711. return a
  3712. },
  3713. trim: Z && !Z.call("\ufeff ") ? function(a) {
  3714. return null == a ? "" : Z.call(a)
  3715. } : function(a) {
  3716. return null == a ? "" : a.toString().replace(ca, "")
  3717. },
  3718. makeArray: function(a, b) {
  3719. var c, d = b || [];
  3720. return null != a && (c = $.type(a), null == a.length || "string" === c || "function" === c || "regexp" === c || $.isWindow(a) ? U.call(d, a) : $.merge(d, a)), d
  3721. },
  3722. inArray: function(a, b, c) {
  3723. var d;
  3724. if (b) {
  3725. if (W) return W.call(b, a, c);
  3726. for (d = b.length, c = c ? c < 0 ? Math.max(0, d + c) : c : 0; c < d; c++)
  3727. if (c in b && b[c] === a) return c
  3728. }
  3729. return -1
  3730. },
  3731. merge: function(a, c) {
  3732. var d = c.length,
  3733. e = a.length,
  3734. f = 0;
  3735. if ("number" == typeof d)
  3736. for (; f < d; f++) a[e++] = c[f];
  3737. else
  3738. for (; c[f] !== b;) a[e++] = c[f++];
  3739. return a.length = e, a
  3740. },
  3741. grep: function(a, b, c) {
  3742. var d, e = [],
  3743. f = 0,
  3744. g = a.length;
  3745. for (c = !!c; f < g; f++) d = !!b(a[f], f), c !== d && e.push(a[f]);
  3746. return e
  3747. },
  3748. map: function(a, c, d) {
  3749. var e, f, g = [],
  3750. h = 0,
  3751. i = a.length,
  3752. j = a instanceof $ || i !== b && "number" == typeof i && (i > 0 && a[0] && a[i - 1] || 0 === i || $.isArray(a));
  3753. if (j)
  3754. for (; h < i; h++) e = c(a[h], h, d), null != e && (g[g.length] = e);
  3755. else
  3756. for (f in a) e = c(a[f], f, d), null != e && (g[g.length] = e);
  3757. return g.concat.apply([], g)
  3758. },
  3759. guid: 1,
  3760. proxy: function(a, c) {
  3761. var d, e, f;
  3762. return "string" == typeof c && (d = a[c], c = a, a = d), $.isFunction(a) ? (e = V.call(arguments, 2), f = function() {
  3763. return a.apply(c, e.concat(V.call(arguments)))
  3764. }, f.guid = a.guid = a.guid || f.guid || $.guid++, f) : b
  3765. },
  3766. access: function(a, c, d, e, f, g, h) {
  3767. var i, j = null == d,
  3768. k = 0,
  3769. l = a.length;
  3770. if (d && "object" == typeof d) {
  3771. for (k in d) $.access(a, c, k, d[k], 1, g, e);
  3772. f = 1
  3773. } else if (e !== b) {
  3774. if (i = h === b && $.isFunction(e), j && (i ? (i = c, c = function(a, b, c) {
  3775. return i.call($(a), c)
  3776. }) : (c.call(a, e), c = null)), c)
  3777. for (; k < l; k++) c(a[k], d, i ? e.call(a[k], k, c(a[k], d)) : e, h);
  3778. f = 1
  3779. }
  3780. return f ? a : j ? c.call(a) : l ? c(a[0], d) : g
  3781. },
  3782. now: function() {
  3783. return (new Date).getTime()
  3784. }
  3785. }), $.ready.promise = function(b) {
  3786. if (!O)
  3787. if (O = $.Deferred(), "complete" === P.readyState) setTimeout($.ready, 1);
  3788. else if (P.addEventListener) P.addEventListener("DOMContentLoaded", ma, !1), a.addEventListener("load", $.ready, !1);
  3789. else {
  3790. P.attachEvent("onreadystatechange", ma), a.attachEvent("onload", $.ready);
  3791. var c = !1;
  3792. try {
  3793. c = null == a.frameElement && P.documentElement
  3794. } catch (a) {}
  3795. c && c.doScroll && function a() {
  3796. if (!$.isReady) {
  3797. try {
  3798. c.doScroll("left")
  3799. } catch (b) {
  3800. return setTimeout(a, 50)
  3801. }
  3802. $.ready()
  3803. }
  3804. }()
  3805. }
  3806. return O.promise(b)
  3807. }, $.each("Boolean Number String Function Array Date RegExp Object".split(" "), function(a, b) {
  3808. na["[object " + b + "]"] = b.toLowerCase()
  3809. }), N = $(P);
  3810. var oa = {};
  3811. $.Callbacks = function(a) {
  3812. a = "string" == typeof a ? oa[a] || c(a) : $.extend({}, a);
  3813. var d, e, f, g, h, i, j = [],
  3814. k = !a.once && [],
  3815. l = function(b) {
  3816. for (d = a.memory && b, e = !0, i = g || 0, g = 0, h = j.length, f = !0; j && i < h; i++)
  3817. if (j[i].apply(b[0], b[1]) === !1 && a.stopOnFalse) {
  3818. d = !1;
  3819. break
  3820. }
  3821. f = !1, j && (k ? k.length && l(k.shift()) : d ? j = [] : m.disable())
  3822. },
  3823. m = {
  3824. add: function() {
  3825. if (j) {
  3826. var b = j.length;
  3827. ! function b(c) {
  3828. $.each(c, function(c, d) {
  3829. var e = $.type(d);
  3830. "function" !== e || a.unique && m.has(d) ? d && d.length && "string" !== e && b(d) : j.push(d)
  3831. })
  3832. }(arguments), f ? h = j.length : d && (g = b, l(d))
  3833. }
  3834. return this
  3835. },
  3836. remove: function() {
  3837. return j && $.each(arguments, function(a, b) {
  3838. for (var c;
  3839. (c = $.inArray(b, j, c)) > -1;) j.splice(c, 1), f && (c <= h && h--, c <= i && i--)
  3840. }), this
  3841. },
  3842. has: function(a) {
  3843. return $.inArray(a, j) > -1
  3844. },
  3845. empty: function() {
  3846. return j = [], this
  3847. },
  3848. disable: function() {
  3849. return j = k = d = b, this
  3850. },
  3851. disabled: function() {
  3852. return !j
  3853. },
  3854. lock: function() {
  3855. return k = b, d || m.disable(), this
  3856. },
  3857. locked: function() {
  3858. return !k
  3859. },
  3860. fireWith: function(a, b) {
  3861. return b = b || [], b = [a, b.slice ? b.slice() : b], j && (!e || k) && (f ? k.push(b) : l(b)), this
  3862. },
  3863. fire: function() {
  3864. return m.fireWith(this, arguments), this
  3865. },
  3866. fired: function() {
  3867. return !!e
  3868. }
  3869. };
  3870. return m
  3871. }, $.extend({
  3872. Deferred: function(a) {
  3873. var b = [
  3874. ["resolve", "done", $.Callbacks("once memory"), "resolved"],
  3875. ["reject", "fail", $.Callbacks("once memory"), "rejected"],
  3876. ["notify", "progress", $.Callbacks("memory")]
  3877. ],
  3878. c = "pending",
  3879. d = {
  3880. state: function() {
  3881. return c
  3882. },
  3883. always: function() {
  3884. return e.done(arguments).fail(arguments), this
  3885. },
  3886. then: function() {
  3887. var a = arguments;
  3888. return $.Deferred(function(c) {
  3889. $.each(b, function(b, d) {
  3890. var f = d[0],
  3891. g = a[b];
  3892. e[d[1]]($.isFunction(g) ? function() {
  3893. var a = g.apply(this, arguments);
  3894. a && $.isFunction(a.promise) ? a.promise().done(c.resolve).fail(c.reject).progress(c.notify) : c[f + "With"](this === e ? c : this, [a])
  3895. } : c[f])
  3896. }), a = null
  3897. }).promise()
  3898. },
  3899. promise: function(a) {
  3900. return "object" == typeof a ? $.extend(a, d) : d
  3901. }
  3902. },
  3903. e = {};
  3904. return d.pipe = d.then, $.each(b, function(a, f) {
  3905. var g = f[2],
  3906. h = f[3];
  3907. d[f[1]] = g.add, h && g.add(function() {
  3908. c = h
  3909. }, b[1 ^ a][2].disable, b[2][2].lock), e[f[0]] = g.fire, e[f[0] + "With"] = g.fireWith
  3910. }), d.promise(e), a && a.call(e, e), e
  3911. },
  3912. when: function(a) {
  3913. var b, c, d, e = 0,
  3914. f = V.call(arguments),
  3915. g = f.length,
  3916. h = 1 !== g || a && $.isFunction(a.promise) ? g : 0,
  3917. i = 1 === h ? a : $.Deferred(),
  3918. j = function(a, c, d) {
  3919. return function(e) {
  3920. c[a] = this, d[a] = arguments.length > 1 ? V.call(arguments) : e, d === b ? i.notifyWith(c, d) : --h || i.resolveWith(c, d)
  3921. }
  3922. };
  3923. if (g > 1)
  3924. for (b = new Array(g), c = new Array(g), d = new Array(g); e < g; e++) f[e] && $.isFunction(f[e].promise) ? f[e].promise().done(j(e, d, f)).fail(i.reject).progress(j(e, c, b)) : --h;
  3925. return h || i.resolveWith(d, f), i.promise()
  3926. }
  3927. }), $.support = function() {
  3928. var b, c, d, e, f, g, h, i, j, k, l, m = P.createElement("div");
  3929. if (m.setAttribute("className", "t"), m.innerHTML = " <link/><table></table><a href='/a'>a</a><input type='checkbox'/>", c = m.getElementsByTagName("*"), d = m.getElementsByTagName("a")[0], d.style.cssText = "top:1px;float:left;opacity:.5", !c || !c.length || !d) return {};
  3930. e = P.createElement("select"), f = e.appendChild(P.createElement("option")), g = m.getElementsByTagName("input")[0], b = {
  3931. leadingWhitespace: 3 === m.firstChild.nodeType,
  3932. tbody: !m.getElementsByTagName("tbody").length,
  3933. htmlSerialize: !!m.getElementsByTagName("link").length,
  3934. style: /top/.test(d.getAttribute("style")),
  3935. hrefNormalized: "/a" === d.getAttribute("href"),
  3936. opacity: /^0.5/.test(d.style.opacity),
  3937. cssFloat: !!d.style.cssFloat,
  3938. checkOn: "on" === g.value,
  3939. optSelected: f.selected,
  3940. getSetAttribute: "t" !== m.className,
  3941. enctype: !!P.createElement("form").enctype,
  3942. html5Clone: "<:nav></:nav>" !== P.createElement("nav").cloneNode(!0).outerHTML,
  3943. boxModel: "CSS1Compat" === P.compatMode,
  3944. submitBubbles: !0,
  3945. changeBubbles: !0,
  3946. focusinBubbles: !1,
  3947. deleteExpando: !0,
  3948. noCloneEvent: !0,
  3949. inlineBlockNeedsLayout: !1,
  3950. shrinkWrapBlocks: !1,
  3951. reliableMarginRight: !0,
  3952. boxSizingReliable: !0,
  3953. pixelPosition: !1
  3954. }, g.checked = !0,
  3955. b.noCloneChecked = g.cloneNode(!0).checked, e.disabled = !0, b.optDisabled = !f.disabled;
  3956. try {
  3957. delete m.test
  3958. } catch (a) {
  3959. b.deleteExpando = !1
  3960. }
  3961. if (!m.addEventListener && m.attachEvent && m.fireEvent && (m.attachEvent("onclick", l = function() {
  3962. b.noCloneEvent = !1
  3963. }), m.cloneNode(!0).fireEvent("onclick"), m.detachEvent("onclick", l)), g = P.createElement("input"), g.value = "t", g.setAttribute("type", "radio"), b.radioValue = "t" === g.value, g.setAttribute("checked", "checked"), g.setAttribute("name", "t"), m.appendChild(g), h = P.createDocumentFragment(), h.appendChild(m.lastChild), b.checkClone = h.cloneNode(!0).cloneNode(!0).lastChild.checked, b.appendChecked = g.checked, h.removeChild(g), h.appendChild(m), m.attachEvent)
  3964. for (j in {
  3965. submit: !0,
  3966. change: !0,
  3967. focusin: !0
  3968. }) i = "on" + j, k = i in m, k || (m.setAttribute(i, "return;"), k = "function" == typeof m[i]), b[j + "Bubbles"] = k;
  3969. return $(function() {
  3970. var c, d, e, f, g = "padding:0;margin:0;border:0;display:block;overflow:hidden;",
  3971. h = P.getElementsByTagName("body")[0];
  3972. h && (c = P.createElement("div"), c.style.cssText = "visibility:hidden;border:0;width:0;height:0;position:static;top:0;margin-top:1px", h.insertBefore(c, h.firstChild), d = P.createElement("div"), c.appendChild(d), d.innerHTML = "<table><tr><td></td><td>t</td></tr></table>", e = d.getElementsByTagName("td"), e[0].style.cssText = "padding:0;margin:0;border:0;display:none", k = 0 === e[0].offsetHeight, e[0].style.display = "", e[1].style.display = "none", b.reliableHiddenOffsets = k && 0 === e[0].offsetHeight, d.innerHTML = "", d.style.cssText = "box-sizing:border-box;-moz-box-sizing:border-box;-webkit-box-sizing:border-box;padding:1px;border:1px;display:block;width:4px;margin-top:1%;position:absolute;top:1%;", b.boxSizing = 4 === d.offsetWidth, b.doesNotIncludeMarginInBodyOffset = 1 !== h.offsetTop, a.getComputedStyle && (b.pixelPosition = "1%" !== (a.getComputedStyle(d, null) || {}).top, b.boxSizingReliable = "4px" === (a.getComputedStyle(d, null) || {
  3973. width: "4px"
  3974. }).width, f = P.createElement("div"), f.style.cssText = d.style.cssText = g, f.style.marginRight = f.style.width = "0", d.style.width = "1px", d.appendChild(f), b.reliableMarginRight = !parseFloat((a.getComputedStyle(f, null) || {}).marginRight)), "undefined" != typeof d.style.zoom && (d.innerHTML = "", d.style.cssText = g + "width:1px;padding:1px;display:inline;zoom:1", b.inlineBlockNeedsLayout = 3 === d.offsetWidth, d.style.display = "block", d.style.overflow = "visible", d.innerHTML = "<div></div>", d.firstChild.style.width = "5px", b.shrinkWrapBlocks = 3 !== d.offsetWidth, c.style.zoom = 1), h.removeChild(c), c = d = e = f = null)
  3975. }), h.removeChild(m), c = d = e = f = g = h = m = null, b
  3976. }();
  3977. var pa = /(?:\{[\s\S]*\}|\[[\s\S]*\])$/,
  3978. qa = /([A-Z])/g;
  3979. $.extend({
  3980. cache: {},
  3981. deletedIds: [],
  3982. uuid: 0,
  3983. expando: "jQuery" + ($.fn.jquery + Math.random()).replace(/\D/g, ""),
  3984. noData: {
  3985. embed: !0,
  3986. object: "clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",
  3987. applet: !0
  3988. },
  3989. hasData: function(a) {
  3990. return a = a.nodeType ? $.cache[a[$.expando]] : a[$.expando], !!a && !e(a)
  3991. },
  3992. data: function(a, c, d, e) {
  3993. if ($.acceptData(a)) {
  3994. var f, g, h = $.expando,
  3995. i = "string" == typeof c,
  3996. j = a.nodeType,
  3997. k = j ? $.cache : a,
  3998. l = j ? a[h] : a[h] && h;
  3999. if (l && k[l] && (e || k[l].data) || !i || d !== b) return l || (j ? a[h] = l = $.deletedIds.pop() || ++$.uuid : l = h), k[l] || (k[l] = {}, j || (k[l].toJSON = $.noop)), "object" != typeof c && "function" != typeof c || (e ? k[l] = $.extend(k[l], c) : k[l].data = $.extend(k[l].data, c)), f = k[l], e || (f.data || (f.data = {}), f = f.data), d !== b && (f[$.camelCase(c)] = d), i ? (g = f[c], null == g && (g = f[$.camelCase(c)])) : g = f, g
  4000. }
  4001. },
  4002. removeData: function(a, b, c) {
  4003. if ($.acceptData(a)) {
  4004. var d, f, g, h = a.nodeType,
  4005. i = h ? $.cache : a,
  4006. j = h ? a[$.expando] : $.expando;
  4007. if (i[j]) {
  4008. if (b && (d = c ? i[j] : i[j].data)) {
  4009. $.isArray(b) || (b in d ? b = [b] : (b = $.camelCase(b), b = b in d ? [b] : b.split(" ")));
  4010. for (f = 0, g = b.length; f < g; f++) delete d[b[f]];
  4011. if (!(c ? e : $.isEmptyObject)(d)) return
  4012. }(c || (delete i[j].data, e(i[j]))) && (h ? $.cleanData([a], !0) : $.support.deleteExpando || i != i.window ? delete i[j] : i[j] = null)
  4013. }
  4014. }
  4015. },
  4016. _data: function(a, b, c) {
  4017. return $.data(a, b, c, !0)
  4018. },
  4019. acceptData: function(a) {
  4020. var b = a.nodeName && $.noData[a.nodeName.toLowerCase()];
  4021. return !b || b !== !0 && a.getAttribute("classid") === b
  4022. }
  4023. }), $.fn.extend({
  4024. data: function(a, c) {
  4025. var e, f, g, h, i, j = this[0],
  4026. k = 0,
  4027. l = null;
  4028. if (a === b) {
  4029. if (this.length && (l = $.data(j), 1 === j.nodeType && !$._data(j, "parsedAttrs"))) {
  4030. for (g = j.attributes, i = g.length; k < i; k++) h = g[k].name, 0 === h.indexOf("data-") && (h = $.camelCase(h.substring(5)), d(j, h, l[h]));
  4031. $._data(j, "parsedAttrs", !0)
  4032. }
  4033. return l
  4034. }
  4035. return "object" == typeof a ? this.each(function() {
  4036. $.data(this, a)
  4037. }) : (e = a.split(".", 2), e[1] = e[1] ? "." + e[1] : "", f = e[1] + "!", $.access(this, function(c) {
  4038. return c === b ? (l = this.triggerHandler("getData" + f, [e[0]]), l === b && j && (l = $.data(j, a), l = d(j, a, l)), l === b && e[1] ? this.data(e[0]) : l) : (e[1] = c, void this.each(function() {
  4039. var b = $(this);
  4040. b.triggerHandler("setData" + f, e), $.data(this, a, c), b.triggerHandler("changeData" + f, e)
  4041. }))
  4042. }, null, c, arguments.length > 1, null, !1))
  4043. },
  4044. removeData: function(a) {
  4045. return this.each(function() {
  4046. $.removeData(this, a)
  4047. })
  4048. }
  4049. }), $.extend({
  4050. queue: function(a, b, c) {
  4051. var d;
  4052. if (a) return b = (b || "fx") + "queue", d = $._data(a, b), c && (!d || $.isArray(c) ? d = $._data(a, b, $.makeArray(c)) : d.push(c)), d || []
  4053. },
  4054. dequeue: function(a, b) {
  4055. b = b || "fx";
  4056. var c = $.queue(a, b),
  4057. d = c.length,
  4058. e = c.shift(),
  4059. f = $._queueHooks(a, b),
  4060. g = function() {
  4061. $.dequeue(a, b)
  4062. };
  4063. "inprogress" === e && (e = c.shift(), d--), e && ("fx" === b && c.unshift("inprogress"), delete f.stop, e.call(a, g, f)), !d && f && f.empty.fire()
  4064. },
  4065. _queueHooks: function(a, b) {
  4066. var c = b + "queueHooks";
  4067. return $._data(a, c) || $._data(a, c, {
  4068. empty: $.Callbacks("once memory").add(function() {
  4069. $.removeData(a, b + "queue", !0), $.removeData(a, c, !0)
  4070. })
  4071. })
  4072. }
  4073. }), $.fn.extend({
  4074. queue: function(a, c) {
  4075. var d = 2;
  4076. return "string" != typeof a && (c = a, a = "fx", d--), arguments.length < d ? $.queue(this[0], a) : c === b ? this : this.each(function() {
  4077. var b = $.queue(this, a, c);
  4078. $._queueHooks(this, a), "fx" === a && "inprogress" !== b[0] && $.dequeue(this, a)
  4079. })
  4080. },
  4081. dequeue: function(a) {
  4082. return this.each(function() {
  4083. $.dequeue(this, a)
  4084. })
  4085. },
  4086. delay: function(a, b) {
  4087. return a = $.fx ? $.fx.speeds[a] || a : a, b = b || "fx", this.queue(b, function(b, c) {
  4088. var d = setTimeout(b, a);
  4089. c.stop = function() {
  4090. clearTimeout(d)
  4091. }
  4092. })
  4093. },
  4094. clearQueue: function(a) {
  4095. return this.queue(a || "fx", [])
  4096. },
  4097. promise: function(a, c) {
  4098. var d, e = 1,
  4099. f = $.Deferred(),
  4100. g = this,
  4101. h = this.length,
  4102. i = function() {
  4103. --e || f.resolveWith(g, [g])
  4104. };
  4105. for ("string" != typeof a && (c = a, a = b), a = a || "fx"; h--;) d = $._data(g[h], a + "queueHooks"), d && d.empty && (e++, d.empty.add(i));
  4106. return i(), f.promise(c)
  4107. }
  4108. });
  4109. var ra, sa, ta, ua = /[\t\r\n]/g,
  4110. va = /\r/g,
  4111. wa = /^(?:button|input)$/i,
  4112. xa = /^(?:button|input|object|select|textarea)$/i,
  4113. ya = /^a(?:rea|)$/i,
  4114. za = /^(?:autofocus|autoplay|async|checked|controls|defer|disabled|hidden|loop|multiple|open|readonly|required|scoped|selected)$/i,
  4115. Aa = $.support.getSetAttribute;
  4116. $.fn.extend({
  4117. attr: function(a, b) {
  4118. return $.access(this, $.attr, a, b, arguments.length > 1)
  4119. },
  4120. removeAttr: function(a) {
  4121. return this.each(function() {
  4122. $.removeAttr(this, a)
  4123. })
  4124. },
  4125. prop: function(a, b) {
  4126. return $.access(this, $.prop, a, b, arguments.length > 1)
  4127. },
  4128. removeProp: function(a) {
  4129. return a = $.propFix[a] || a, this.each(function() {
  4130. try {
  4131. this[a] = b, delete this[a]
  4132. } catch (a) {}
  4133. })
  4134. },
  4135. addClass: function(a) {
  4136. var b, c, d, e, f, g, h;
  4137. if ($.isFunction(a)) return this.each(function(b) {
  4138. $(this).addClass(a.call(this, b, this.className))
  4139. });
  4140. if (a && "string" == typeof a)
  4141. for (b = a.split(ba), c = 0, d = this.length; c < d; c++)
  4142. if (e = this[c], 1 === e.nodeType)
  4143. if (e.className || 1 !== b.length) {
  4144. for (f = " " + e.className + " ", g = 0, h = b.length; g < h; g++) ~f.indexOf(" " + b[g] + " ") || (f += b[g] + " ");
  4145. e.className = $.trim(f)
  4146. } else e.className = a;
  4147. return this
  4148. },
  4149. removeClass: function(a) {
  4150. var c, d, e, f, g, h, i;
  4151. if ($.isFunction(a)) return this.each(function(b) {
  4152. $(this).removeClass(a.call(this, b, this.className))
  4153. });
  4154. if (a && "string" == typeof a || a === b)
  4155. for (c = (a || "").split(ba), h = 0, i = this.length; h < i; h++)
  4156. if (e = this[h], 1 === e.nodeType && e.className) {
  4157. for (d = (" " + e.className + " ").replace(ua, " "), f = 0, g = c.length; f < g; f++)
  4158. for (; d.indexOf(" " + c[f] + " ") > -1;) d = d.replace(" " + c[f] + " ", " ");
  4159. e.className = a ? $.trim(d) : ""
  4160. }
  4161. return this
  4162. },
  4163. toggleClass: function(a, b) {
  4164. var c = typeof a,
  4165. d = "boolean" == typeof b;
  4166. return $.isFunction(a) ? this.each(function(c) {
  4167. $(this).toggleClass(a.call(this, c, this.className, b), b)
  4168. }) : this.each(function() {
  4169. if ("string" === c)
  4170. for (var e, f = 0, g = $(this), h = b, i = a.split(ba); e = i[f++];) h = d ? h : !g.hasClass(e), g[h ? "addClass" : "removeClass"](e);
  4171. else "undefined" !== c && "boolean" !== c || (this.className && $._data(this, "__className__", this.className), this.className = this.className || a === !1 ? "" : $._data(this, "__className__") || "")
  4172. })
  4173. },
  4174. hasClass: function(a) {
  4175. for (var b = " " + a + " ", c = 0, d = this.length; c < d; c++)
  4176. if (1 === this[c].nodeType && (" " + this[c].className + " ").replace(ua, " ").indexOf(b) > -1) return !0;
  4177. return !1
  4178. },
  4179. val: function(a) {
  4180. var c, d, e, f = this[0]; {
  4181. if (arguments.length) return e = $.isFunction(a), this.each(function(d) {
  4182. var f, g = $(this);
  4183. 1 === this.nodeType && (f = e ? a.call(this, d, g.val()) : a, null == f ? f = "" : "number" == typeof f ? f += "" : $.isArray(f) && (f = $.map(f, function(a) {
  4184. return null == a ? "" : a + ""
  4185. })), c = $.valHooks[this.type] || $.valHooks[this.nodeName.toLowerCase()], c && "set" in c && c.set(this, f, "value") !== b || (this.value = f))
  4186. });
  4187. if (f) return c = $.valHooks[f.type] || $.valHooks[f.nodeName.toLowerCase()], c && "get" in c && (d = c.get(f, "value")) !== b ? d : (d = f.value, "string" == typeof d ? d.replace(va, "") : null == d ? "" : d)
  4188. }
  4189. }
  4190. }), $.extend({
  4191. valHooks: {
  4192. option: {
  4193. get: function(a) {
  4194. var b = a.attributes.value;
  4195. return !b || b.specified ? a.value : a.text
  4196. }
  4197. },
  4198. select: {
  4199. get: function(a) {
  4200. var b, c, d, e, f = a.selectedIndex,
  4201. g = [],
  4202. h = a.options,
  4203. i = "select-one" === a.type;
  4204. if (f < 0) return null;
  4205. for (c = i ? f : 0, d = i ? f + 1 : h.length; c < d; c++)
  4206. if (e = h[c], e.selected && ($.support.optDisabled ? !e.disabled : null === e.getAttribute("disabled")) && (!e.parentNode.disabled || !$.nodeName(e.parentNode, "optgroup"))) {
  4207. if (b = $(e).val(), i) return b;
  4208. g.push(b)
  4209. }
  4210. return i && !g.length && h.length ? $(h[f]).val() : g
  4211. },
  4212. set: function(a, b) {
  4213. var c = $.makeArray(b);
  4214. return $(a).find("option").each(function() {
  4215. this.selected = $.inArray($(this).val(), c) >= 0
  4216. }), c.length || (a.selectedIndex = -1), c
  4217. }
  4218. }
  4219. },
  4220. attrFn: {},
  4221. attr: function(a, c, d, e) {
  4222. var f, g, h, i = a.nodeType;
  4223. if (a && 3 !== i && 8 !== i && 2 !== i) return e && $.isFunction($.fn[c]) ? $(a)[c](d) : "undefined" == typeof a.getAttribute ? $.prop(a, c, d) : (h = 1 !== i || !$.isXMLDoc(a), h && (c = c.toLowerCase(), g = $.attrHooks[c] || (za.test(c) ? sa : ra)), d !== b ? null === d ? void $.removeAttr(a, c) : g && "set" in g && h && (f = g.set(a, d, c)) !== b ? f : (a.setAttribute(c, "" + d), d) : g && "get" in g && h && null !== (f = g.get(a, c)) ? f : (f = a.getAttribute(c), null === f ? b : f))
  4224. },
  4225. removeAttr: function(a, b) {
  4226. var c, d, e, f, g = 0;
  4227. if (b && 1 === a.nodeType)
  4228. for (d = b.split(ba); g < d.length; g++) e = d[g], e && (c = $.propFix[e] || e, f = za.test(e), f || $.attr(a, e, ""), a.removeAttribute(Aa ? e : c), f && c in a && (a[c] = !1))
  4229. },
  4230. attrHooks: {
  4231. type: {
  4232. set: function(a, b) {
  4233. if (wa.test(a.nodeName) && a.parentNode) $.error("type property can't be changed");
  4234. else if (!$.support.radioValue && "radio" === b && $.nodeName(a, "input")) {
  4235. var c = a.value;
  4236. return a.setAttribute("type", b), c && (a.value = c), b
  4237. }
  4238. }
  4239. },
  4240. value: {
  4241. get: function(a, b) {
  4242. return ra && $.nodeName(a, "button") ? ra.get(a, b) : b in a ? a.value : null
  4243. },
  4244. set: function(a, b, c) {
  4245. return ra && $.nodeName(a, "button") ? ra.set(a, b, c) : void(a.value = b)
  4246. }
  4247. }
  4248. },
  4249. propFix: {
  4250. tabindex: "tabIndex",
  4251. readonly: "readOnly",
  4252. for: "htmlFor",
  4253. class: "className",
  4254. maxlength: "maxLength",
  4255. cellspacing: "cellSpacing",
  4256. cellpadding: "cellPadding",
  4257. rowspan: "rowSpan",
  4258. colspan: "colSpan",
  4259. usemap: "useMap",
  4260. frameborder: "frameBorder",
  4261. contenteditable: "contentEditable"
  4262. },
  4263. prop: function(a, c, d) {
  4264. var e, f, g, h = a.nodeType;
  4265. if (a && 3 !== h && 8 !== h && 2 !== h) return g = 1 !== h || !$.isXMLDoc(a), g && (c = $.propFix[c] || c, f = $.propHooks[c]), d !== b ? f && "set" in f && (e = f.set(a, d, c)) !== b ? e : a[c] = d : f && "get" in f && null !== (e = f.get(a, c)) ? e : a[c]
  4266. },
  4267. propHooks: {
  4268. tabIndex: {
  4269. get: function(a) {
  4270. var c = a.getAttributeNode("tabindex");
  4271. return c && c.specified ? parseInt(c.value, 10) : xa.test(a.nodeName) || ya.test(a.nodeName) && a.href ? 0 : b
  4272. }
  4273. }
  4274. }
  4275. }), sa = {
  4276. get: function(a, c) {
  4277. var d, e = $.prop(a, c);
  4278. return e === !0 || "boolean" != typeof e && (d = a.getAttributeNode(c)) && d.nodeValue !== !1 ? c.toLowerCase() : b
  4279. },
  4280. set: function(a, b, c) {
  4281. var d;
  4282. return b === !1 ? $.removeAttr(a, c) : (d = $.propFix[c] || c, d in a && (a[d] = !0), a.setAttribute(c, c.toLowerCase())), c
  4283. }
  4284. }, Aa || (ta = {
  4285. name: !0,
  4286. id: !0,
  4287. coords: !0
  4288. }, ra = $.valHooks.button = {
  4289. get: function(a, c) {
  4290. var d;
  4291. return d = a.getAttributeNode(c), d && (ta[c] ? "" !== d.value : d.specified) ? d.value : b
  4292. },
  4293. set: function(a, b, c) {
  4294. var d = a.getAttributeNode(c);
  4295. return d || (d = P.createAttribute(c), a.setAttributeNode(d)), d.value = b + ""
  4296. }
  4297. }, $.each(["width", "height"], function(a, b) {
  4298. $.attrHooks[b] = $.extend($.attrHooks[b], {
  4299. set: function(a, c) {
  4300. if ("" === c) return a.setAttribute(b, "auto"), c
  4301. }
  4302. })
  4303. }), $.attrHooks.contenteditable = {
  4304. get: ra.get,
  4305. set: function(a, b, c) {
  4306. "" === b && (b = "false"), ra.set(a, b, c)
  4307. }
  4308. }), $.support.hrefNormalized || $.each(["href", "src", "width", "height"], function(a, c) {
  4309. $.attrHooks[c] = $.extend($.attrHooks[c], {
  4310. get: function(a) {
  4311. var d = a.getAttribute(c, 2);
  4312. return null === d ? b : d
  4313. }
  4314. })
  4315. }), $.support.style || ($.attrHooks.style = {
  4316. get: function(a) {
  4317. return a.style.cssText.toLowerCase() || b
  4318. },
  4319. set: function(a, b) {
  4320. return a.style.cssText = "" + b
  4321. }
  4322. }), $.support.optSelected || ($.propHooks.selected = $.extend($.propHooks.selected, {
  4323. get: function(a) {
  4324. var b = a.parentNode;
  4325. return b && (b.selectedIndex, b.parentNode && b.parentNode.selectedIndex), null
  4326. }
  4327. })), $.support.enctype || ($.propFix.enctype = "encoding"), $.support.checkOn || $.each(["radio", "checkbox"], function() {
  4328. $.valHooks[this] = {
  4329. get: function(a) {
  4330. return null === a.getAttribute("value") ? "on" : a.value
  4331. }
  4332. }
  4333. }), $.each(["radio", "checkbox"], function() {
  4334. $.valHooks[this] = $.extend($.valHooks[this], {
  4335. set: function(a, b) {
  4336. if ($.isArray(b)) return a.checked = $.inArray($(a).val(), b) >= 0
  4337. }
  4338. })
  4339. });
  4340. var Ba = /^(?:textarea|input|select)$/i,
  4341. Ca = /^([^\.]*|)(?:\.(.+)|)$/,
  4342. Da = /(?:^|\s)hover(\.\S+|)\b/,
  4343. Ea = /^key/,
  4344. Fa = /^(?:mouse|contextmenu)|click/,
  4345. Ga = /^(?:focusinfocus|focusoutblur)$/,
  4346. Ha = function(a) {
  4347. return $.event.special.hover ? a : a.replace(Da, "mouseenter$1 mouseleave$1")
  4348. };
  4349. $.event = {
  4350. add: function(a, c, d, e, f) {
  4351. var g, h, i, j, k, l, m, n, o, p, q;
  4352. if (3 !== a.nodeType && 8 !== a.nodeType && c && d && (g = $._data(a))) {
  4353. for (d.handler && (o = d, d = o.handler, f = o.selector), d.guid || (d.guid = $.guid++), i = g.events, i || (g.events = i = {}), h = g.handle, h || (g.handle = h = function(a) {
  4354. return "undefined" == typeof $ || a && $.event.triggered === a.type ? b : $.event.dispatch.apply(h.elem, arguments)
  4355. }, h.elem = a), c = $.trim(Ha(c)).split(" "), j = 0; j < c.length; j++) k = Ca.exec(c[j]) || [], l = k[1], m = (k[2] || "").split(".").sort(), q = $.event.special[l] || {}, l = (f ? q.delegateType : q.bindType) || l, q = $.event.special[l] || {}, n = $.extend({
  4356. type: l,
  4357. origType: k[1],
  4358. data: e,
  4359. handler: d,
  4360. guid: d.guid,
  4361. selector: f,
  4362. namespace: m.join(".")
  4363. }, o), p = i[l], p || (p = i[l] = [], p.delegateCount = 0, q.setup && q.setup.call(a, e, m, h) !== !1 || (a.addEventListener ? a.addEventListener(l, h, !1) : a.attachEvent && a.attachEvent("on" + l, h))), q.add && (q.add.call(a, n), n.handler.guid || (n.handler.guid = d.guid)), f ? p.splice(p.delegateCount++, 0, n) : p.push(n), $.event.global[l] = !0;
  4364. a = null
  4365. }
  4366. },
  4367. global: {},
  4368. remove: function(a, b, c, d, e) {
  4369. var f, g, h, i, j, k, l, m, n, o, p, q = $.hasData(a) && $._data(a);
  4370. if (q && (m = q.events)) {
  4371. for (b = $.trim(Ha(b || "")).split(" "), f = 0; f < b.length; f++)
  4372. if (g = Ca.exec(b[f]) || [], h = i = g[1], j = g[2], h) {
  4373. for (n = $.event.special[h] || {}, h = (d ? n.delegateType : n.bindType) || h, o = m[h] || [], k = o.length, j = j ? new RegExp("(^|\\.)" + j.split(".").sort().join("\\.(?:.*\\.|)") + "(\\.|$)") : null, l = 0; l < o.length; l++) p = o[l], (e || i === p.origType) && (!c || c.guid === p.guid) && (!j || j.test(p.namespace)) && (!d || d === p.selector || "**" === d && p.selector) && (o.splice(l--, 1), p.selector && o.delegateCount--, n.remove && n.remove.call(a, p));
  4374. 0 === o.length && k !== o.length && ((!n.teardown || n.teardown.call(a, j, q.handle) === !1) && $.removeEvent(a, h, q.handle), delete m[h])
  4375. } else
  4376. for (h in m) $.event.remove(a, h + b[f], c, d, !0);
  4377. $.isEmptyObject(m) && (delete q.handle, $.removeData(a, "events", !0))
  4378. }
  4379. },
  4380. customEvent: {
  4381. getData: !0,
  4382. setData: !0,
  4383. changeData: !0
  4384. },
  4385. trigger: function(c, d, e, f) {
  4386. if (!e || 3 !== e.nodeType && 8 !== e.nodeType) {
  4387. var g, h, i, j, k, l, m, n, o, p, q = c.type || c,
  4388. r = [];
  4389. if (Ga.test(q + $.event.triggered)) return;
  4390. if (q.indexOf("!") >= 0 && (q = q.slice(0, -1), h = !0), q.indexOf(".") >= 0 && (r = q.split("."), q = r.shift(), r.sort()), (!e || $.event.customEvent[q]) && !$.event.global[q]) return;
  4391. if (c = "object" == typeof c ? c[$.expando] ? c : new $.Event(q, c) : new $.Event(q), c.type = q, c.isTrigger = !0, c.exclusive = h, c.namespace = r.join("."), c.namespace_re = c.namespace ? new RegExp("(^|\\.)" + r.join("\\.(?:.*\\.|)") + "(\\.|$)") : null, l = q.indexOf(":") < 0 ? "on" + q : "", !e) {
  4392. g = $.cache;
  4393. for (i in g) g[i].events && g[i].events[q] && $.event.trigger(c, d, g[i].handle.elem, !0);
  4394. return
  4395. }
  4396. if (c.result = b, c.target || (c.target = e), d = null != d ? $.makeArray(d) : [], d.unshift(c), m = $.event.special[q] || {}, m.trigger && m.trigger.apply(e, d) === !1) return;
  4397. if (o = [
  4398. [e, m.bindType || q]
  4399. ], !f && !m.noBubble && !$.isWindow(e)) {
  4400. for (p = m.delegateType || q, j = Ga.test(p + q) ? e : e.parentNode, k = e; j; j = j.parentNode) o.push([j, p]), k = j;
  4401. k === (e.ownerDocument || P) && o.push([k.defaultView || k.parentWindow || a, p])
  4402. }
  4403. for (i = 0; i < o.length && !c.isPropagationStopped(); i++) j = o[i][0], c.type = o[i][1], n = ($._data(j, "events") || {})[c.type] && $._data(j, "handle"), n && n.apply(j, d), n = l && j[l], n && $.acceptData(j) && n.apply(j, d) === !1 && c.preventDefault();
  4404. return c.type = q, !f && !c.isDefaultPrevented() && (!m._default || m._default.apply(e.ownerDocument, d) === !1) && ("click" !== q || !$.nodeName(e, "a")) && $.acceptData(e) && l && e[q] && ("focus" !== q && "blur" !== q || 0 !== c.target.offsetWidth) && !$.isWindow(e) && (k = e[l], k && (e[l] = null), $.event.triggered = q, e[q](), $.event.triggered = b, k && (e[l] = k)), c.result
  4405. }
  4406. },
  4407. dispatch: function(c) {
  4408. c = $.event.fix(c || a.event);
  4409. var d, e, f, g, h, i, j, k, l, m = ($._data(this, "events") || {})[c.type] || [],
  4410. n = m.delegateCount,
  4411. o = [].slice.call(arguments),
  4412. p = !c.exclusive && !c.namespace,
  4413. q = $.event.special[c.type] || {},
  4414. r = [];
  4415. if (o[0] = c, c.delegateTarget = this, !q.preDispatch || q.preDispatch.call(this, c) !== !1) {
  4416. if (n && (!c.button || "click" !== c.type))
  4417. for (f = c.target; f != this; f = f.parentNode || this)
  4418. if (f.disabled !== !0 || "click" !== c.type) {
  4419. for (h = {}, j = [], d = 0; d < n; d++) k = m[d], l = k.selector, h[l] === b && (h[l] = $(l, this).index(f) >= 0), h[l] && j.push(k);
  4420. j.length && r.push({
  4421. elem: f,
  4422. matches: j
  4423. })
  4424. }
  4425. for (m.length > n && r.push({
  4426. elem: this,
  4427. matches: m.slice(n)
  4428. }), d = 0; d < r.length && !c.isPropagationStopped(); d++)
  4429. for (i = r[d], c.currentTarget = i.elem, e = 0; e < i.matches.length && !c.isImmediatePropagationStopped(); e++) k = i.matches[e], (p || !c.namespace && !k.namespace || c.namespace_re && c.namespace_re.test(k.namespace)) && (c.data = k.data, c.handleObj = k, g = (($.event.special[k.origType] || {}).handle || k.handler).apply(i.elem, o), g !== b && (c.result = g, g === !1 && (c.preventDefault(), c.stopPropagation())));
  4430. return q.postDispatch && q.postDispatch.call(this, c), c.result
  4431. }
  4432. },
  4433. props: "attrChange attrName relatedNode srcElement altKey bubbles cancelable ctrlKey currentTarget eventPhase metaKey relatedTarget shiftKey target timeStamp view which".split(" "),
  4434. fixHooks: {},
  4435. keyHooks: {
  4436. props: "char charCode key keyCode".split(" "),
  4437. filter: function(a, b) {
  4438. return null == a.which && (a.which = null != b.charCode ? b.charCode : b.keyCode), a
  4439. }
  4440. },
  4441. mouseHooks: {
  4442. props: "button buttons clientX clientY fromElement offsetX offsetY pageX pageY screenX screenY toElement".split(" "),
  4443. filter: function(a, c) {
  4444. var d, e, f, g = c.button,
  4445. h = c.fromElement;
  4446. return null == a.pageX && null != c.clientX && (d = a.target.ownerDocument || P, e = d.documentElement, f = d.body, a.pageX = c.clientX + (e && e.scrollLeft || f && f.scrollLeft || 0) - (e && e.clientLeft || f && f.clientLeft || 0), a.pageY = c.clientY + (e && e.scrollTop || f && f.scrollTop || 0) - (e && e.clientTop || f && f.clientTop || 0)), !a.relatedTarget && h && (a.relatedTarget = h === a.target ? c.toElement : h), !a.which && g !== b && (a.which = 1 & g ? 1 : 2 & g ? 3 : 4 & g ? 2 : 0), a
  4447. }
  4448. },
  4449. fix: function(a) {
  4450. if (a[$.expando]) return a;
  4451. var b, c, d = a,
  4452. e = $.event.fixHooks[a.type] || {},
  4453. f = e.props ? this.props.concat(e.props) : this.props;
  4454. for (a = $.Event(d), b = f.length; b;) c = f[--b], a[c] = d[c];
  4455. return a.target || (a.target = d.srcElement || P), 3 === a.target.nodeType && (a.target = a.target.parentNode), a.metaKey = !!a.metaKey, e.filter ? e.filter(a, d) : a
  4456. },
  4457. special: {
  4458. load: {
  4459. noBubble: !0
  4460. },
  4461. focus: {
  4462. delegateType: "focusin"
  4463. },
  4464. blur: {
  4465. delegateType: "focusout"
  4466. },
  4467. beforeunload: {
  4468. setup: function(a, b, c) {
  4469. $.isWindow(this) && (this.onbeforeunload = c)
  4470. },
  4471. teardown: function(a, b) {
  4472. this.onbeforeunload === b && (this.onbeforeunload = null)
  4473. }
  4474. }
  4475. },
  4476. simulate: function(a, b, c, d) {
  4477. var e = $.extend(new $.Event, c, {
  4478. type: a,
  4479. isSimulated: !0,
  4480. originalEvent: {}
  4481. });
  4482. d ? $.event.trigger(e, null, b) : $.event.dispatch.call(b, e), e.isDefaultPrevented() && c.preventDefault()
  4483. }
  4484. }, $.event.handle = $.event.dispatch, $.removeEvent = P.removeEventListener ? function(a, b, c) {
  4485. a.removeEventListener && a.removeEventListener(b, c, !1)
  4486. } : function(a, b, c) {
  4487. var d = "on" + b;
  4488. a.detachEvent && ("undefined" == typeof a[d] && (a[d] = null), a.detachEvent(d, c))
  4489. }, $.Event = function(a, b) {
  4490. return this instanceof $.Event ? (a && a.type ? (this.originalEvent = a, this.type = a.type, this.isDefaultPrevented = a.defaultPrevented || a.returnValue === !1 || a.getPreventDefault && a.getPreventDefault() ? g : f) : this.type = a, b && $.extend(this, b), this.timeStamp = a && a.timeStamp || $.now(), this[$.expando] = !0, void 0) : new $.Event(a, b)
  4491. }, $.Event.prototype = {
  4492. preventDefault: function() {
  4493. this.isDefaultPrevented = g;
  4494. var a = this.originalEvent;
  4495. a && (a.preventDefault ? a.preventDefault() : a.returnValue = !1)
  4496. },
  4497. stopPropagation: function() {
  4498. this.isPropagationStopped = g;
  4499. var a = this.originalEvent;
  4500. a && (a.stopPropagation && a.stopPropagation(), a.cancelBubble = !0)
  4501. },
  4502. stopImmediatePropagation: function() {
  4503. this.isImmediatePropagationStopped = g, this.stopPropagation()
  4504. },
  4505. isDefaultPrevented: f,
  4506. isPropagationStopped: f,
  4507. isImmediatePropagationStopped: f
  4508. }, $.each({
  4509. mouseenter: "mouseover",
  4510. mouseleave: "mouseout"
  4511. }, function(a, b) {
  4512. $.event.special[a] = {
  4513. delegateType: b,
  4514. bindType: b,
  4515. handle: function(a) {
  4516. var c, d = this,
  4517. e = a.relatedTarget,
  4518. f = a.handleObj;
  4519. f.selector;
  4520. return e && (e === d || $.contains(d, e)) || (a.type = f.origType, c = f.handler.apply(this, arguments), a.type = b), c
  4521. }
  4522. }
  4523. }), $.support.submitBubbles || ($.event.special.submit = {
  4524. setup: function() {
  4525. return !$.nodeName(this, "form") && void $.event.add(this, "click._submit keypress._submit", function(a) {
  4526. var c = a.target,
  4527. d = $.nodeName(c, "input") || $.nodeName(c, "button") ? c.form : b;
  4528. d && !$._data(d, "_submit_attached") && ($.event.add(d, "submit._submit", function(a) {
  4529. a._submit_bubble = !0
  4530. }), $._data(d, "_submit_attached", !0))
  4531. })
  4532. },
  4533. postDispatch: function(a) {
  4534. a._submit_bubble && (delete a._submit_bubble, this.parentNode && !a.isTrigger && $.event.simulate("submit", this.parentNode, a, !0))
  4535. },
  4536. teardown: function() {
  4537. return !$.nodeName(this, "form") && void $.event.remove(this, "._submit")
  4538. }
  4539. }), $.support.changeBubbles || ($.event.special.change = {
  4540. setup: function() {
  4541. return Ba.test(this.nodeName) ? ("checkbox" !== this.type && "radio" !== this.type || ($.event.add(this, "propertychange._change", function(a) {
  4542. "checked" === a.originalEvent.propertyName && (this._just_changed = !0)
  4543. }), $.event.add(this, "click._change", function(a) {
  4544. this._just_changed && !a.isTrigger && (this._just_changed = !1), $.event.simulate("change", this, a, !0)
  4545. })), !1) : void $.event.add(this, "beforeactivate._change", function(a) {
  4546. var b = a.target;
  4547. Ba.test(b.nodeName) && !$._data(b, "_change_attached") && ($.event.add(b, "change._change", function(a) {
  4548. this.parentNode && !a.isSimulated && !a.isTrigger && $.event.simulate("change", this.parentNode, a, !0)
  4549. }), $._data(b, "_change_attached", !0))
  4550. })
  4551. },
  4552. handle: function(a) {
  4553. var b = a.target;
  4554. if (this !== b || a.isSimulated || a.isTrigger || "radio" !== b.type && "checkbox" !== b.type) return a.handleObj.handler.apply(this, arguments)
  4555. },
  4556. teardown: function() {
  4557. return $.event.remove(this, "._change"), !Ba.test(this.nodeName)
  4558. }
  4559. }), $.support.focusinBubbles || $.each({
  4560. focus: "focusin",
  4561. blur: "focusout"
  4562. }, function(a, b) {
  4563. var c = 0,
  4564. d = function(a) {
  4565. $.event.simulate(b, a.target, $.event.fix(a), !0)
  4566. };
  4567. $.event.special[b] = {
  4568. setup: function() {
  4569. 0 === c++ && P.addEventListener(a, d, !0)
  4570. },
  4571. teardown: function() {
  4572. 0 === --c && P.removeEventListener(a, d, !0)
  4573. }
  4574. }
  4575. }), $.fn.extend({
  4576. on: function(a, c, d, e, g) {
  4577. var h, i;
  4578. if ("object" == typeof a) {
  4579. "string" != typeof c && (d = d || c, c = b);
  4580. for (i in a) this.on(i, c, d, a[i], g);
  4581. return this
  4582. }
  4583. if (null == d && null == e ? (e = c, d = c = b) : null == e && ("string" == typeof c ? (e = d, d = b) : (e = d, d = c, c = b)), e === !1) e = f;
  4584. else if (!e) return this;
  4585. return 1 === g && (h = e, e = function(a) {
  4586. return $().off(a), h.apply(this, arguments)
  4587. }, e.guid = h.guid || (h.guid = $.guid++)), this.each(function() {
  4588. $.event.add(this, a, e, d, c)
  4589. })
  4590. },
  4591. one: function(a, b, c, d) {
  4592. return this.on(a, b, c, d, 1)
  4593. },
  4594. off: function(a, c, d) {
  4595. var e, g;
  4596. if (a && a.preventDefault && a.handleObj) return e = a.handleObj, $(a.delegateTarget).off(e.namespace ? e.origType + "." + e.namespace : e.origType, e.selector, e.handler), this;
  4597. if ("object" == typeof a) {
  4598. for (g in a) this.off(g, c, a[g]);
  4599. return this
  4600. }
  4601. return c !== !1 && "function" != typeof c || (d = c, c = b), d === !1 && (d = f), this.each(function() {
  4602. $.event.remove(this, a, d, c)
  4603. })
  4604. },
  4605. bind: function(a, b, c) {
  4606. return this.on(a, null, b, c)
  4607. },
  4608. unbind: function(a, b) {
  4609. return this.off(a, null, b)
  4610. },
  4611. live: function(a, b, c) {
  4612. return $(this.context).on(a, this.selector, b, c), this
  4613. },
  4614. die: function(a, b) {
  4615. return $(this.context).off(a, this.selector || "**", b), this
  4616. },
  4617. delegate: function(a, b, c, d) {
  4618. return this.on(b, a, c, d)
  4619. },
  4620. undelegate: function(a, b, c) {
  4621. return 1 == arguments.length ? this.off(a, "**") : this.off(b, a || "**", c)
  4622. },
  4623. trigger: function(a, b) {
  4624. return this.each(function() {
  4625. $.event.trigger(a, b, this)
  4626. })
  4627. },
  4628. triggerHandler: function(a, b) {
  4629. if (this[0]) return $.event.trigger(a, b, this[0], !0)
  4630. },
  4631. toggle: function(a) {
  4632. var b = arguments,
  4633. c = a.guid || $.guid++,
  4634. d = 0,
  4635. e = function(c) {
  4636. var e = ($._data(this, "lastToggle" + a.guid) || 0) % d;
  4637. return $._data(this, "lastToggle" + a.guid, e + 1), c.preventDefault(), b[e].apply(this, arguments) || !1
  4638. };
  4639. for (e.guid = c; d < b.length;) b[d++].guid = c;
  4640. return this.click(e)
  4641. },
  4642. hover: function(a, b) {
  4643. return this.mouseenter(a).mouseleave(b || a)
  4644. }
  4645. }), $.each("blur focus focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select submit keydown keypress keyup error contextmenu".split(" "), function(a, b) {
  4646. $.fn[b] = function(a, c) {
  4647. return null == c && (c = a, a = null), arguments.length > 0 ? this.on(b, null, a, c) : this.trigger(b)
  4648. }, Ea.test(b) && ($.event.fixHooks[b] = $.event.keyHooks), Fa.test(b) && ($.event.fixHooks[b] = $.event.mouseHooks)
  4649. }),
  4650. function(a, b) {
  4651. function c(a, b, c, d) {
  4652. c = c || [], b = b || C;
  4653. var e, f, g, h, i = b.nodeType;
  4654. if (1 !== i && 9 !== i) return [];
  4655. if (!a || "string" != typeof a) return c;
  4656. if (g = u(b), !g && !d && (e = X.exec(a)))
  4657. if (h = e[1]) {
  4658. if (9 === i) {
  4659. if (f = b.getElementById(h), !f || !f.parentNode) return c;
  4660. if (f.id === h) return c.push(f), c
  4661. } else if (b.ownerDocument && (f = b.ownerDocument.getElementById(h)) && v(b, f) && f.id === h) return c.push(f), c
  4662. } else {
  4663. if (e[2]) return G.apply(c, F.call(b.getElementsByTagName(a), 0)), c;
  4664. if ((h = e[3]) && ha && b.getElementsByClassName) return G.apply(c, F.call(b.getElementsByClassName(h), 0)), c
  4665. }
  4666. return o(a, b, c, d, g)
  4667. }
  4668.  
  4669. function d(a) {
  4670. return function(b) {
  4671. var c = b.nodeName.toLowerCase();
  4672. return "input" === c && b.type === a
  4673. }
  4674. }
  4675.  
  4676. function e(a) {
  4677. return function(b) {
  4678. var c = b.nodeName.toLowerCase();
  4679. return ("input" === c || "button" === c) && b.type === a
  4680. }
  4681. }
  4682.  
  4683. function f(a, b, c) {
  4684. if (a === b) return c;
  4685. for (var d = a.nextSibling; d;) {
  4686. if (d === b) return -1;
  4687. d = d.nextSibling
  4688. }
  4689. return 1
  4690. }
  4691.  
  4692. function g(a, b, d, e) {
  4693. var f, g, h, i, j, k, l, m, n, o, p = !d && b !== C,
  4694. q = (p ? "<s>" : "") + a.replace(T, "$1<s>"),
  4695. r = K[B][q];
  4696. if (r) return e ? 0 : F.call(r, 0);
  4697. for (j = a, k = [], m = 0, n = s.preFilter, o = s.filter; j;) {
  4698. f && !(g = U.exec(j)) || (g && (j = j.slice(g[0].length), h.selector = l), k.push(h = []), l = "", p && (j = " " + j)), f = !1, (g = V.exec(j)) && (l += g[0], j = j.slice(g[0].length), f = h.push({
  4699. part: g.pop().replace(T, " "),
  4700. string: g[0],
  4701. captures: g
  4702. }));
  4703. for (i in o)(g = ca[i].exec(j)) && (!n[i] || (g = n[i](g, b, d))) && (l += g[0], j = j.slice(g[0].length), f = h.push({
  4704. part: i,
  4705. string: g.shift(),
  4706. captures: g
  4707. }));
  4708. if (!f) break
  4709. }
  4710. return l && (h.selector = l), e ? j.length : j ? c.error(a) : F.call(K(q, k), 0)
  4711. }
  4712.  
  4713. function h(a, b, c, d) {
  4714. var e = b.dir,
  4715. f = E++;
  4716. return a || (a = function(a) {
  4717. return a === c
  4718. }), b.first ? function(b) {
  4719. for (; b = b[e];)
  4720. if (1 === b.nodeType) return a(b) && b
  4721. } : d ? function(b) {
  4722. for (; b = b[e];)
  4723. if (1 === b.nodeType && a(b)) return b
  4724. } : function(b) {
  4725. for (var c, d = f + "." + p, g = d + "." + q; b = b[e];)
  4726. if (1 === b.nodeType) {
  4727. if ((c = b[B]) === g) return b.sizset;
  4728. if ("string" == typeof c && 0 === c.indexOf(d)) {
  4729. if (b.sizset) return b
  4730. } else {
  4731. if (b[B] = g, a(b)) return b.sizset = !0, b;
  4732. b.sizset = !1
  4733. }
  4734. }
  4735. }
  4736. }
  4737.  
  4738. function i(a, b) {
  4739. return a ? function(c) {
  4740. var d = b(c);
  4741. return d && a(d === !0 ? c : d)
  4742. } : b
  4743. }
  4744.  
  4745. function j(a, b, c) {
  4746. for (var d, e, f = 0; d = a[f]; f++) e = s.relative[d.part] ? h(e, s.relative[d.part], b, c) : i(e, s.filter[d.part].apply(null, d.captures.concat(b, c)));
  4747. return e
  4748. }
  4749.  
  4750. function k(a) {
  4751. return function(b) {
  4752. for (var c, d = 0; c = a[d]; d++)
  4753. if (c(b)) return !0;
  4754. return !1
  4755. }
  4756. }
  4757.  
  4758. function l(a, b, d, e) {
  4759. for (var f = 0, g = b.length; f < g; f++) c(a, b[f], d, e)
  4760. }
  4761.  
  4762. function m(a, b, d, e, f, g) {
  4763. var h, i = s.setFilters[b.toLowerCase()];
  4764. return i || c.error(b), (a || !(h = f)) && l(a || "*", e, h = [], f), h.length > 0 ? i(h, d, g) : []
  4765. }
  4766.  
  4767. function n(a, d, e, f) {
  4768. for (var g, h, i, j, k, n, o, p, q, r, s, t, u, v = 0, w = a.length, x = ca.POS, y = new RegExp("^" + x.source + "(?!" + M + ")", "i"), z = function() {
  4769. for (var a = 1, c = arguments.length - 2; a < c; a++) arguments[a] === b && (q[a] = b)
  4770. }; v < w; v++) {
  4771. for (g = a[v], h = "", p = f, i = 0, j = g.length; i < j; i++) {
  4772. if (k = g[i], n = k.string, "PSEUDO" === k.part)
  4773. for (x.exec(""), o = 0; q = x.exec(n);) r = !0, s = x.lastIndex = q.index + q[0].length, s > o && (h += n.slice(o, q.index), o = s, t = [d], V.test(h) && (p && (t = p), p = f), (u = Z.test(h)) && (h = h.slice(0, -5).replace(V, "$&*"), o++), q.length > 1 && q[0].replace(y, z), p = m(h, q[1], q[2], t, p, u)), h = "";
  4774. r || (h += n), r = !1
  4775. }
  4776. h ? V.test(h) ? l(h, p || [d], e, f) : c(h, d, e, f ? f.concat(p) : p) : G.apply(e, p)
  4777. }
  4778. return 1 === w ? e : c.uniqueSort(e)
  4779. }
  4780.  
  4781. function o(a, b, c, d, e) {
  4782. a = a.replace(T, "$1");
  4783. var f, h, i, j, k, l, m, o, r, t = g(a, b, e),
  4784. u = b.nodeType;
  4785. if (ca.POS.test(a)) return n(t, b, c, d);
  4786. if (d) f = F.call(d, 0);
  4787. else if (1 === t.length) {
  4788. if ((k = F.call(t[0], 0)).length > 2 && "ID" === (l = k[0]).part && 9 === u && !e && s.relative[k[1].part]) {
  4789. if (b = s.find.ID(l.captures[0].replace(ba, ""), b, e)[0], !b) return c;
  4790. a = a.slice(k.shift().string.length)
  4791. }
  4792. for (o = (t = Y.exec(k[0].string)) && !t.index && b.parentNode || b, m = "", j = k.length - 1; j >= 0 && (l = k[j], r = l.part, m = l.string + m, !s.relative[r]); j--)
  4793. if (s.order.test(r)) {
  4794. if (f = s.find[r](l.captures[0].replace(ba, ""), o, e), null == f) continue;
  4795. a = a.slice(0, a.length - m.length) + m.replace(ca[r], ""), a || G.apply(c, F.call(f, 0));
  4796. break
  4797. }
  4798. }
  4799. if (a)
  4800. for (h = w(a, b, e), p = h.dirruns++, null == f && (f = s.find.TAG("*", Y.test(a) && b.parentNode || b)), j = 0; i = f[j]; j++) q = h.runs++, h(i) && c.push(i);
  4801. return c
  4802. }
  4803. var p, q, r, s, t, u, v, w, x, y, z = !0,
  4804. A = "undefined",
  4805. B = ("sizcache" + Math.random()).replace(".", ""),
  4806. C = a.document,
  4807. D = C.documentElement,
  4808. E = 0,
  4809. F = [].slice,
  4810. G = [].push,
  4811. H = function(a, b) {
  4812. return a[B] = b || !0, a
  4813. },
  4814. I = function() {
  4815. var a = {},
  4816. b = [];
  4817. return H(function(c, d) {
  4818. return b.push(c) > s.cacheLength && delete a[b.shift()], a[c] = d
  4819. }, a)
  4820. },
  4821. J = I(),
  4822. K = I(),
  4823. L = I(),
  4824. M = "[\\x20\\t\\r\\n\\f]",
  4825. N = "(?:\\\\.|[-\\w]|[^\\x00-\\xa0])+",
  4826. O = N.replace("w", "w#"),
  4827. P = "([*^$|!~]?=)",
  4828. Q = "\\[" + M + "*(" + N + ")" + M + "*(?:" + P + M + "*(?:(['\"])((?:\\\\.|[^\\\\])*?)\\3|(" + O + ")|)|)" + M + "*\\]",
  4829. R = ":(" + N + ")(?:\\((?:(['\"])((?:\\\\.|[^\\\\])*?)\\2|([^()[\\]]*|(?:(?:" + Q + ")|[^:]|\\\\.)*|.*))\\)|)",
  4830. S = ":(nth|eq|gt|lt|first|last|even|odd)(?:\\(((?:-\\d)?\\d*)\\)|)(?=[^-]|$)",
  4831. T = new RegExp("^" + M + "+|((?:^|[^\\\\])(?:\\\\.)*)" + M + "+$", "g"),
  4832. U = new RegExp("^" + M + "*," + M + "*"),
  4833. V = new RegExp("^" + M + "*([\\x20\\t\\r\\n\\f>+~])" + M + "*"),
  4834. W = new RegExp(R),
  4835. X = /^(?:#([\w\-]+)|(\w+)|\.([\w\-]+))$/,
  4836. Y = /[\x20\t\r\n\f]*[+~]/,
  4837. Z = /:not\($/,
  4838. _ = /h\d/i,
  4839. aa = /input|select|textarea|button/i,
  4840. ba = /\\(?!\\)/g,
  4841. ca = {
  4842. ID: new RegExp("^#(" + N + ")"),
  4843. CLASS: new RegExp("^\\.(" + N + ")"),
  4844. NAME: new RegExp("^\\[name=['\"]?(" + N + ")['\"]?\\]"),
  4845. TAG: new RegExp("^(" + N.replace("w", "w*") + ")"),
  4846. ATTR: new RegExp("^" + Q),
  4847. PSEUDO: new RegExp("^" + R),
  4848. CHILD: new RegExp("^:(only|nth|last|first)-child(?:\\(" + M + "*(even|odd|(([+-]|)(\\d*)n|)" + M + "*(?:([+-]|)" + M + "*(\\d+)|))" + M + "*\\)|)", "i"),
  4849. POS: new RegExp(S, "ig"),
  4850. needsContext: new RegExp("^" + M + "*[>+~]|" + S, "i")
  4851. },
  4852. da = function(a) {
  4853. var b = C.createElement("div");
  4854. try {
  4855. return a(b)
  4856. } catch (a) {
  4857. return !1
  4858. } finally {
  4859. b = null
  4860. }
  4861. },
  4862. ea = da(function(a) {
  4863. return a.appendChild(C.createComment("")), !a.getElementsByTagName("*").length
  4864. }),
  4865. fa = da(function(a) {
  4866. return a.innerHTML = "<a href='#'></a>", a.firstChild && typeof a.firstChild.getAttribute !== A && "#" === a.firstChild.getAttribute("href")
  4867. }),
  4868. ga = da(function(a) {
  4869. a.innerHTML = "<select></select>";
  4870. var b = typeof a.lastChild.getAttribute("multiple");
  4871. return "boolean" !== b && "string" !== b
  4872. }),
  4873. ha = da(function(a) {
  4874. return a.innerHTML = "<div class='hidden e'></div><div class='hidden'></div>", !(!a.getElementsByClassName || !a.getElementsByClassName("e").length) && (a.lastChild.className = "e", 2 === a.getElementsByClassName("e").length)
  4875. }),
  4876. ia = da(function(a) {
  4877. a.id = B + 0, a.innerHTML = "<a name='" + B + "'></a><div name='" + B + "'></div>", D.insertBefore(a, D.firstChild);
  4878. var b = C.getElementsByName && C.getElementsByName(B).length === 2 + C.getElementsByName(B + 0).length;
  4879. return r = !C.getElementById(B), D.removeChild(a), b
  4880. });
  4881. try {
  4882. F.call(D.childNodes, 0)[0].nodeType
  4883. } catch (a) {
  4884. F = function(a) {
  4885. for (var b, c = []; b = this[a]; a++) c.push(b);
  4886. return c
  4887. }
  4888. }
  4889. c.matches = function(a, b) {
  4890. return c(a, null, null, b)
  4891. }, c.matchesSelector = function(a, b) {
  4892. return c(b, null, null, [a]).length > 0
  4893. }, t = c.getText = function(a) {
  4894. var b, c = "",
  4895. d = 0,
  4896. e = a.nodeType;
  4897. if (e) {
  4898. if (1 === e || 9 === e || 11 === e) {
  4899. if ("string" == typeof a.textContent) return a.textContent;
  4900. for (a = a.firstChild; a; a = a.nextSibling) c += t(a)
  4901. } else if (3 === e || 4 === e) return a.nodeValue
  4902. } else
  4903. for (; b = a[d]; d++) c += t(b);
  4904. return c
  4905. }, u = c.isXML = function(a) {
  4906. var b = a && (a.ownerDocument || a).documentElement;
  4907. return !!b && "HTML" !== b.nodeName
  4908. }, v = c.contains = D.contains ? function(a, b) {
  4909. var c = 9 === a.nodeType ? a.documentElement : a,
  4910. d = b && b.parentNode;
  4911. return a === d || !!(d && 1 === d.nodeType && c.contains && c.contains(d))
  4912. } : D.compareDocumentPosition ? function(a, b) {
  4913. return b && !!(16 & a.compareDocumentPosition(b))
  4914. } : function(a, b) {
  4915. for (; b = b.parentNode;)
  4916. if (b === a) return !0;
  4917. return !1
  4918. }, c.attr = function(a, b) {
  4919. var c, d = u(a);
  4920. return d || (b = b.toLowerCase()), s.attrHandle[b] ? s.attrHandle[b](a) : ga || d ? a.getAttribute(b) : (c = a.getAttributeNode(b), c ? "boolean" == typeof a[b] ? a[b] ? b : null : c.specified ? c.value : null : null);
  4921. }, s = c.selectors = {
  4922. cacheLength: 50,
  4923. createPseudo: H,
  4924. match: ca,
  4925. order: new RegExp("ID|TAG" + (ia ? "|NAME" : "") + (ha ? "|CLASS" : "")),
  4926. attrHandle: fa ? {} : {
  4927. href: function(a) {
  4928. return a.getAttribute("href", 2)
  4929. },
  4930. type: function(a) {
  4931. return a.getAttribute("type")
  4932. }
  4933. },
  4934. find: {
  4935. ID: r ? function(a, b, c) {
  4936. if (typeof b.getElementById !== A && !c) {
  4937. var d = b.getElementById(a);
  4938. return d && d.parentNode ? [d] : []
  4939. }
  4940. } : function(a, c, d) {
  4941. if (typeof c.getElementById !== A && !d) {
  4942. var e = c.getElementById(a);
  4943. return e ? e.id === a || typeof e.getAttributeNode !== A && e.getAttributeNode("id").value === a ? [e] : b : []
  4944. }
  4945. },
  4946. TAG: ea ? function(a, b) {
  4947. if (typeof b.getElementsByTagName !== A) return b.getElementsByTagName(a)
  4948. } : function(a, b) {
  4949. var c = b.getElementsByTagName(a);
  4950. if ("*" === a) {
  4951. for (var d, e = [], f = 0; d = c[f]; f++) 1 === d.nodeType && e.push(d);
  4952. return e
  4953. }
  4954. return c
  4955. },
  4956. NAME: function(a, b) {
  4957. if (typeof b.getElementsByName !== A) return b.getElementsByName(name)
  4958. },
  4959. CLASS: function(a, b, c) {
  4960. if (typeof b.getElementsByClassName !== A && !c) return b.getElementsByClassName(a)
  4961. }
  4962. },
  4963. relative: {
  4964. ">": {
  4965. dir: "parentNode",
  4966. first: !0
  4967. },
  4968. " ": {
  4969. dir: "parentNode"
  4970. },
  4971. "+": {
  4972. dir: "previousSibling",
  4973. first: !0
  4974. },
  4975. "~": {
  4976. dir: "previousSibling"
  4977. }
  4978. },
  4979. preFilter: {
  4980. ATTR: function(a) {
  4981. return a[1] = a[1].replace(ba, ""), a[3] = (a[4] || a[5] || "").replace(ba, ""), "~=" === a[2] && (a[3] = " " + a[3] + " "), a.slice(0, 4)
  4982. },
  4983. CHILD: function(a) {
  4984. return a[1] = a[1].toLowerCase(), "nth" === a[1] ? (a[2] || c.error(a[0]), a[3] = +(a[3] ? a[4] + (a[5] || 1) : 2 * ("even" === a[2] || "odd" === a[2])), a[4] = +(a[6] + a[7] || "odd" === a[2])) : a[2] && c.error(a[0]), a
  4985. },
  4986. PSEUDO: function(a, b, c) {
  4987. var d, e;
  4988. return ca.CHILD.test(a[0]) ? null : (a[3] ? a[2] = a[3] : (d = a[4]) && (W.test(d) && (e = g(d, b, c, !0)) && (e = d.indexOf(")", d.length - e) - d.length) && (d = d.slice(0, e), a[0] = a[0].slice(0, e)), a[2] = d), a.slice(0, 3))
  4989. }
  4990. },
  4991. filter: {
  4992. ID: r ? function(a) {
  4993. return a = a.replace(ba, ""),
  4994. function(b) {
  4995. return b.getAttribute("id") === a
  4996. }
  4997. } : function(a) {
  4998. return a = a.replace(ba, ""),
  4999. function(b) {
  5000. var c = typeof b.getAttributeNode !== A && b.getAttributeNode("id");
  5001. return c && c.value === a
  5002. }
  5003. },
  5004. TAG: function(a) {
  5005. return "*" === a ? function() {
  5006. return !0
  5007. } : (a = a.replace(ba, "").toLowerCase(), function(b) {
  5008. return b.nodeName && b.nodeName.toLowerCase() === a
  5009. })
  5010. },
  5011. CLASS: function(a) {
  5012. var b = J[B][a];
  5013. return b || (b = J(a, new RegExp("(^|" + M + ")" + a + "(" + M + "|$)"))),
  5014. function(a) {
  5015. return b.test(a.className || typeof a.getAttribute !== A && a.getAttribute("class") || "")
  5016. }
  5017. },
  5018. ATTR: function(a, b, d) {
  5019. return b ? function(e) {
  5020. var f = c.attr(e, a),
  5021. g = f + "";
  5022. if (null == f) return "!=" === b;
  5023. switch (b) {
  5024. case "=":
  5025. return g === d;
  5026. case "!=":
  5027. return g !== d;
  5028. case "^=":
  5029. return d && 0 === g.indexOf(d);
  5030. case "*=":
  5031. return d && g.indexOf(d) > -1;
  5032. case "$=":
  5033. return d && g.substr(g.length - d.length) === d;
  5034. case "~=":
  5035. return (" " + g + " ").indexOf(d) > -1;
  5036. case "|=":
  5037. return g === d || g.substr(0, d.length + 1) === d + "-"
  5038. }
  5039. } : function(b) {
  5040. return null != c.attr(b, a)
  5041. }
  5042. },
  5043. CHILD: function(a, b, c, d) {
  5044. if ("nth" === a) {
  5045. var e = E++;
  5046. return function(a) {
  5047. var b, f, g = 0,
  5048. h = a;
  5049. if (1 === c && 0 === d) return !0;
  5050. if (b = a.parentNode, b && (b[B] !== e || !a.sizset)) {
  5051. for (h = b.firstChild; h && (1 !== h.nodeType || (h.sizset = ++g, h !== a)); h = h.nextSibling);
  5052. b[B] = e
  5053. }
  5054. return f = a.sizset - d, 0 === c ? 0 === f : f % c === 0 && f / c >= 0
  5055. }
  5056. }
  5057. return function(b) {
  5058. var c = b;
  5059. switch (a) {
  5060. case "only":
  5061. case "first":
  5062. for (; c = c.previousSibling;)
  5063. if (1 === c.nodeType) return !1;
  5064. if ("first" === a) return !0;
  5065. c = b;
  5066. case "last":
  5067. for (; c = c.nextSibling;)
  5068. if (1 === c.nodeType) return !1;
  5069. return !0
  5070. }
  5071. }
  5072. },
  5073. PSEUDO: function(a, b, d, e) {
  5074. var f, g = s.pseudos[a] || s.pseudos[a.toLowerCase()];
  5075. return g || c.error("unsupported pseudo: " + a), g[B] ? g(b, d, e) : g.length > 1 ? (f = [a, a, "", b], function(a) {
  5076. return g(a, 0, f)
  5077. }) : g
  5078. }
  5079. },
  5080. pseudos: {
  5081. not: H(function(a, b, c) {
  5082. var d = w(a.replace(T, "$1"), b, c);
  5083. return function(a) {
  5084. return !d(a)
  5085. }
  5086. }),
  5087. enabled: function(a) {
  5088. return a.disabled === !1
  5089. },
  5090. disabled: function(a) {
  5091. return a.disabled === !0
  5092. },
  5093. checked: function(a) {
  5094. var b = a.nodeName.toLowerCase();
  5095. return "input" === b && !!a.checked || "option" === b && !!a.selected
  5096. },
  5097. selected: function(a) {
  5098. return a.parentNode && a.parentNode.selectedIndex, a.selected === !0
  5099. },
  5100. parent: function(a) {
  5101. return !s.pseudos.empty(a)
  5102. },
  5103. empty: function(a) {
  5104. var b;
  5105. for (a = a.firstChild; a;) {
  5106. if (a.nodeName > "@" || 3 === (b = a.nodeType) || 4 === b) return !1;
  5107. a = a.nextSibling
  5108. }
  5109. return !0
  5110. },
  5111. contains: H(function(a) {
  5112. return function(b) {
  5113. return (b.textContent || b.innerText || t(b)).indexOf(a) > -1
  5114. }
  5115. }),
  5116. has: H(function(a) {
  5117. return function(b) {
  5118. return c(a, b).length > 0
  5119. }
  5120. }),
  5121. header: function(a) {
  5122. return _.test(a.nodeName)
  5123. },
  5124. text: function(a) {
  5125. var b, c;
  5126. return "input" === a.nodeName.toLowerCase() && "text" === (b = a.type) && (null == (c = a.getAttribute("type")) || c.toLowerCase() === b)
  5127. },
  5128. radio: d("radio"),
  5129. checkbox: d("checkbox"),
  5130. file: d("file"),
  5131. password: d("password"),
  5132. image: d("image"),
  5133. submit: e("submit"),
  5134. reset: e("reset"),
  5135. button: function(a) {
  5136. var b = a.nodeName.toLowerCase();
  5137. return "input" === b && "button" === a.type || "button" === b
  5138. },
  5139. input: function(a) {
  5140. return aa.test(a.nodeName)
  5141. },
  5142. focus: function(a) {
  5143. var b = a.ownerDocument;
  5144. return a === b.activeElement && (!b.hasFocus || b.hasFocus()) && (!!a.type || !!a.href)
  5145. },
  5146. active: function(a) {
  5147. return a === a.ownerDocument.activeElement
  5148. }
  5149. },
  5150. setFilters: {
  5151. first: function(a, b, c) {
  5152. return c ? a.slice(1) : [a[0]]
  5153. },
  5154. last: function(a, b, c) {
  5155. var d = a.pop();
  5156. return c ? a : [d]
  5157. },
  5158. even: function(a, b, c) {
  5159. for (var d = [], e = c ? 1 : 0, f = a.length; e < f; e += 2) d.push(a[e]);
  5160. return d
  5161. },
  5162. odd: function(a, b, c) {
  5163. for (var d = [], e = c ? 0 : 1, f = a.length; e < f; e += 2) d.push(a[e]);
  5164. return d
  5165. },
  5166. lt: function(a, b, c) {
  5167. return c ? a.slice(+b) : a.slice(0, +b)
  5168. },
  5169. gt: function(a, b, c) {
  5170. return c ? a.slice(0, +b + 1) : a.slice(+b + 1)
  5171. },
  5172. eq: function(a, b, c) {
  5173. var d = a.splice(+b, 1);
  5174. return c ? a : d
  5175. }
  5176. }
  5177. }, x = D.compareDocumentPosition ? function(a, b) {
  5178. return a === b ? (y = !0, 0) : (a.compareDocumentPosition && b.compareDocumentPosition ? 4 & a.compareDocumentPosition(b) : a.compareDocumentPosition) ? -1 : 1
  5179. } : function(a, b) {
  5180. if (a === b) return y = !0, 0;
  5181. if (a.sourceIndex && b.sourceIndex) return a.sourceIndex - b.sourceIndex;
  5182. var c, d, e = [],
  5183. g = [],
  5184. h = a.parentNode,
  5185. i = b.parentNode,
  5186. j = h;
  5187. if (h === i) return f(a, b);
  5188. if (!h) return -1;
  5189. if (!i) return 1;
  5190. for (; j;) e.unshift(j), j = j.parentNode;
  5191. for (j = i; j;) g.unshift(j), j = j.parentNode;
  5192. c = e.length, d = g.length;
  5193. for (var k = 0; k < c && k < d; k++)
  5194. if (e[k] !== g[k]) return f(e[k], g[k]);
  5195. return k === c ? f(a, g[k], -1) : f(e[k], b, 1)
  5196. }, [0, 0].sort(x), z = !y, c.uniqueSort = function(a) {
  5197. var b, c = 1;
  5198. if (y = z, a.sort(x), y)
  5199. for (; b = a[c]; c++) b === a[c - 1] && a.splice(c--, 1);
  5200. return a
  5201. }, c.error = function(a) {
  5202. throw new Error("Syntax error, unrecognized expression: " + a)
  5203. }, w = c.compile = function(a, b, c) {
  5204. var d, e, f, h = L[B][a];
  5205. if (h && h.context === b) return h;
  5206. for (d = g(a, b, c), e = 0, f = d.length; e < f; e++) d[e] = j(d[e], b, c);
  5207. return h = L(a, k(d)), h.context = b, h.runs = h.dirruns = 0, h
  5208. }, C.querySelectorAll && function() {
  5209. var a, b = o,
  5210. d = /'|\\/g,
  5211. e = /\=[\x20\t\r\n\f]*([^'"\]]*)[\x20\t\r\n\f]*\]/g,
  5212. f = [],
  5213. h = [":active"],
  5214. i = D.matchesSelector || D.mozMatchesSelector || D.webkitMatchesSelector || D.oMatchesSelector || D.msMatchesSelector;
  5215. da(function(a) {
  5216. a.innerHTML = "<select><option selected=''></option></select>", a.querySelectorAll("[selected]").length || f.push("\\[" + M + "*(?:checked|disabled|ismap|multiple|readonly|selected|value)"), a.querySelectorAll(":checked").length || f.push(":checked")
  5217. }), da(function(a) {
  5218. a.innerHTML = "<p test=''></p>", a.querySelectorAll("[test^='']").length && f.push("[*^$]=" + M + "*(?:\"\"|'')"), a.innerHTML = "<input type='hidden'/>", a.querySelectorAll(":enabled").length || f.push(":enabled", ":disabled")
  5219. }), f = f.length && new RegExp(f.join("|")), o = function(a, c, e, h, i) {
  5220. if (!(h || i || f && f.test(a)))
  5221. if (9 === c.nodeType) try {
  5222. return G.apply(e, F.call(c.querySelectorAll(a), 0)), e
  5223. } catch (a) {} else if (1 === c.nodeType && "object" !== c.nodeName.toLowerCase()) {
  5224. var j, k, l, m = c.getAttribute("id"),
  5225. n = m || B,
  5226. o = Y.test(a) && c.parentNode || c;
  5227. for (m ? n = n.replace(d, "\\$&") : c.setAttribute("id", n), j = g(a, c, i), n = "[id='" + n + "']", k = 0, l = j.length; k < l; k++) j[k] = n + j[k].selector;
  5228. try {
  5229. return G.apply(e, F.call(o.querySelectorAll(j.join(",")), 0)), e
  5230. } catch (a) {} finally {
  5231. m || c.removeAttribute("id")
  5232. }
  5233. }
  5234. return b(a, c, e, h, i)
  5235. }, i && (da(function(b) {
  5236. a = i.call(b, "div");
  5237. try {
  5238. i.call(b, "[test!='']:sizzle"), h.push(ca.PSEUDO.source, ca.POS.source, "!=")
  5239. } catch (a) {}
  5240. }), h = new RegExp(h.join("|")), c.matchesSelector = function(b, d) {
  5241. if (d = d.replace(e, "='$1']"), !(u(b) || h.test(d) || f && f.test(d))) try {
  5242. var g = i.call(b, d);
  5243. if (g || a || b.document && 11 !== b.document.nodeType) return g
  5244. } catch (a) {}
  5245. return c(d, null, null, [b]).length > 0
  5246. })
  5247. }(), s.setFilters.nth = s.setFilters.eq, s.filters = s.pseudos, c.attr = $.attr, $.find = c, $.expr = c.selectors, $.expr[":"] = $.expr.pseudos, $.unique = c.uniqueSort, $.text = c.getText, $.isXMLDoc = c.isXML, $.contains = c.contains
  5248. }(a);
  5249. var Ia = /Until$/,
  5250. Ja = /^(?:parents|prev(?:Until|All))/,
  5251. Ka = /^.[^:#\[\.,]*$/,
  5252. La = $.expr.match.needsContext,
  5253. Ma = {
  5254. children: !0,
  5255. contents: !0,
  5256. next: !0,
  5257. prev: !0
  5258. };
  5259. $.fn.extend({
  5260. find: function(a) {
  5261. var b, c, d, e, f, g, h = this;
  5262. if ("string" != typeof a) return $(a).filter(function() {
  5263. for (b = 0, c = h.length; b < c; b++)
  5264. if ($.contains(h[b], this)) return !0
  5265. });
  5266. for (g = this.pushStack("", "find", a), b = 0, c = this.length; b < c; b++)
  5267. if (d = g.length, $.find(a, this[b], g), b > 0)
  5268. for (e = d; e < g.length; e++)
  5269. for (f = 0; f < d; f++)
  5270. if (g[f] === g[e]) {
  5271. g.splice(e--, 1);
  5272. break
  5273. }
  5274. return g
  5275. },
  5276. has: function(a) {
  5277. var b, c = $(a, this),
  5278. d = c.length;
  5279. return this.filter(function() {
  5280. for (b = 0; b < d; b++)
  5281. if ($.contains(this, c[b])) return !0
  5282. })
  5283. },
  5284. not: function(a) {
  5285. return this.pushStack(j(this, a, !1), "not", a)
  5286. },
  5287. filter: function(a) {
  5288. return this.pushStack(j(this, a, !0), "filter", a)
  5289. },
  5290. is: function(a) {
  5291. return !!a && ("string" == typeof a ? La.test(a) ? $(a, this.context).index(this[0]) >= 0 : $.filter(a, this).length > 0 : this.filter(a).length > 0)
  5292. },
  5293. closest: function(a, b) {
  5294. for (var c, d = 0, e = this.length, f = [], g = La.test(a) || "string" != typeof a ? $(a, b || this.context) : 0; d < e; d++)
  5295. for (c = this[d]; c && c.ownerDocument && c !== b && 11 !== c.nodeType;) {
  5296. if (g ? g.index(c) > -1 : $.find.matchesSelector(c, a)) {
  5297. f.push(c);
  5298. break
  5299. }
  5300. c = c.parentNode
  5301. }
  5302. return f = f.length > 1 ? $.unique(f) : f, this.pushStack(f, "closest", a)
  5303. },
  5304. index: function(a) {
  5305. return a ? "string" == typeof a ? $.inArray(this[0], $(a)) : $.inArray(a.jquery ? a[0] : a, this) : this[0] && this[0].parentNode ? this.prevAll().length : -1
  5306. },
  5307. add: function(a, b) {
  5308. var c = "string" == typeof a ? $(a, b) : $.makeArray(a && a.nodeType ? [a] : a),
  5309. d = $.merge(this.get(), c);
  5310. return this.pushStack(h(c[0]) || h(d[0]) ? d : $.unique(d))
  5311. },
  5312. addBack: function(a) {
  5313. return this.add(null == a ? this.prevObject : this.prevObject.filter(a))
  5314. }
  5315. }), $.fn.andSelf = $.fn.addBack, $.each({
  5316. parent: function(a) {
  5317. var b = a.parentNode;
  5318. return b && 11 !== b.nodeType ? b : null
  5319. },
  5320. parents: function(a) {
  5321. return $.dir(a, "parentNode")
  5322. },
  5323. parentsUntil: function(a, b, c) {
  5324. return $.dir(a, "parentNode", c)
  5325. },
  5326. next: function(a) {
  5327. return i(a, "nextSibling")
  5328. },
  5329. prev: function(a) {
  5330. return i(a, "previousSibling")
  5331. },
  5332. nextAll: function(a) {
  5333. return $.dir(a, "nextSibling")
  5334. },
  5335. prevAll: function(a) {
  5336. return $.dir(a, "previousSibling")
  5337. },
  5338. nextUntil: function(a, b, c) {
  5339. return $.dir(a, "nextSibling", c)
  5340. },
  5341. prevUntil: function(a, b, c) {
  5342. return $.dir(a, "previousSibling", c)
  5343. },
  5344. siblings: function(a) {
  5345. return $.sibling((a.parentNode || {}).firstChild, a)
  5346. },
  5347. children: function(a) {
  5348. return $.sibling(a.firstChild)
  5349. },
  5350. contents: function(a) {
  5351. return $.nodeName(a, "iframe") ? a.contentDocument || a.contentWindow.document : $.merge([], a.childNodes)
  5352. }
  5353. }, function(a, b) {
  5354. $.fn[a] = function(c, d) {
  5355. var e = $.map(this, b, c);
  5356. return Ia.test(a) || (d = c), d && "string" == typeof d && (e = $.filter(d, e)), e = this.length > 1 && !Ma[a] ? $.unique(e) : e, this.length > 1 && Ja.test(a) && (e = e.reverse()), this.pushStack(e, a, V.call(arguments).join(","))
  5357. }
  5358. }), $.extend({
  5359. filter: function(a, b, c) {
  5360. return c && (a = ":not(" + a + ")"), 1 === b.length ? $.find.matchesSelector(b[0], a) ? [b[0]] : [] : $.find.matches(a, b)
  5361. },
  5362. dir: function(a, c, d) {
  5363. for (var e = [], f = a[c]; f && 9 !== f.nodeType && (d === b || 1 !== f.nodeType || !$(f).is(d));) 1 === f.nodeType && e.push(f), f = f[c];
  5364. return e
  5365. },
  5366. sibling: function(a, b) {
  5367. for (var c = []; a; a = a.nextSibling) 1 === a.nodeType && a !== b && c.push(a);
  5368. return c
  5369. }
  5370. });
  5371. var Na = "abbr|article|aside|audio|bdi|canvas|data|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",
  5372. Oa = / jQuery\d+="(?:null|\d+)"/g,
  5373. Pa = /^\s+/,
  5374. Qa = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  5375. Ra = /<([\w:]+)/,
  5376. Sa = /<tbody/i,
  5377. Ta = /<|&#?\w+;/,
  5378. Ua = /<(?:script|style|link)/i,
  5379. Va = /<(?:script|object|embed|option|style)/i,
  5380. Wa = new RegExp("<(?:" + Na + ")[\\s/>]", "i"),
  5381. Xa = /^(?:checkbox|radio)$/,
  5382. Ya = /checked\s*(?:[^=]|=\s*.checked.)/i,
  5383. Za = /\/(java|ecma)script/i,
  5384. $a = /^\s*<!(?:\[CDATA\[|\-\-)|[\]\-]{2}>\s*$/g,
  5385. _a = {
  5386. option: [1, "<select multiple='multiple'>", "</select>"],
  5387. legend: [1, "<fieldset>", "</fieldset>"],
  5388. thead: [1, "<table>", "</table>"],
  5389. tr: [2, "<table><tbody>", "</tbody></table>"],
  5390. td: [3, "<table><tbody><tr>", "</tr></tbody></table>"],
  5391. col: [2, "<table><tbody></tbody><colgroup>", "</colgroup></table>"],
  5392. area: [1, "<map>", "</map>"],
  5393. _default: [0, "", ""]
  5394. },
  5395. ab = k(P),
  5396. bb = ab.appendChild(P.createElement("div"));
  5397. _a.optgroup = _a.option, _a.tbody = _a.tfoot = _a.colgroup = _a.caption = _a.thead, _a.th = _a.td, $.support.htmlSerialize || (_a._default = [1, "X<div>", "</div>"]), $.fn.extend({
  5398. text: function(a) {
  5399. return $.access(this, function(a) {
  5400. return a === b ? $.text(this) : this.empty().append((this[0] && this[0].ownerDocument || P).createTextNode(a))
  5401. }, null, a, arguments.length)
  5402. },
  5403. wrapAll: function(a) {
  5404. if ($.isFunction(a)) return this.each(function(b) {
  5405. $(this).wrapAll(a.call(this, b))
  5406. });
  5407. if (this[0]) {
  5408. var b = $(a, this[0].ownerDocument).eq(0).clone(!0);
  5409. this[0].parentNode && b.insertBefore(this[0]), b.map(function() {
  5410. for (var a = this; a.firstChild && 1 === a.firstChild.nodeType;) a = a.firstChild;
  5411. return a
  5412. }).append(this)
  5413. }
  5414. return this
  5415. },
  5416. wrapInner: function(a) {
  5417. return $.isFunction(a) ? this.each(function(b) {
  5418. $(this).wrapInner(a.call(this, b))
  5419. }) : this.each(function() {
  5420. var b = $(this),
  5421. c = b.contents();
  5422. c.length ? c.wrapAll(a) : b.append(a)
  5423. })
  5424. },
  5425. wrap: function(a) {
  5426. var b = $.isFunction(a);
  5427. return this.each(function(c) {
  5428. $(this).wrapAll(b ? a.call(this, c) : a)
  5429. })
  5430. },
  5431. unwrap: function() {
  5432. return this.parent().each(function() {
  5433. $.nodeName(this, "body") || $(this).replaceWith(this.childNodes)
  5434. }).end()
  5435. },
  5436. append: function() {
  5437. return this.domManip(arguments, !0, function(a) {
  5438. (1 === this.nodeType || 11 === this.nodeType) && this.appendChild(a)
  5439. })
  5440. },
  5441. prepend: function() {
  5442. return this.domManip(arguments, !0, function(a) {
  5443. (1 === this.nodeType || 11 === this.nodeType) && this.insertBefore(a, this.firstChild)
  5444. })
  5445. },
  5446. before: function() {
  5447. if (!h(this[0])) return this.domManip(arguments, !1, function(a) {
  5448. this.parentNode.insertBefore(a, this)
  5449. });
  5450. if (arguments.length) {
  5451. var a = $.clean(arguments);
  5452. return this.pushStack($.merge(a, this), "before", this.selector)
  5453. }
  5454. },
  5455. after: function() {
  5456. if (!h(this[0])) return this.domManip(arguments, !1, function(a) {
  5457. this.parentNode.insertBefore(a, this.nextSibling)
  5458. });
  5459. if (arguments.length) {
  5460. var a = $.clean(arguments);
  5461. return this.pushStack($.merge(this, a), "after", this.selector)
  5462. }
  5463. },
  5464. remove: function(a, b) {
  5465. for (var c, d = 0; null != (c = this[d]); d++) a && !$.filter(a, [c]).length || (!b && 1 === c.nodeType && ($.cleanData(c.getElementsByTagName("*")), $.cleanData([c])), c.parentNode && c.parentNode.removeChild(c));
  5466. return this
  5467. },
  5468. empty: function() {
  5469. for (var a, b = 0; null != (a = this[b]); b++)
  5470. for (1 === a.nodeType && $.cleanData(a.getElementsByTagName("*")); a.firstChild;) a.removeChild(a.firstChild);
  5471. return this
  5472. },
  5473. clone: function(a, b) {
  5474. return a = null != a && a, b = null == b ? a : b, this.map(function() {
  5475. return $.clone(this, a, b)
  5476. })
  5477. },
  5478. html: function(a) {
  5479. return $.access(this, function(a) {
  5480. var c = this[0] || {},
  5481. d = 0,
  5482. e = this.length;
  5483. if (a === b) return 1 === c.nodeType ? c.innerHTML.replace(Oa, "") : b;
  5484. if ("string" == typeof a && !Ua.test(a) && ($.support.htmlSerialize || !Wa.test(a)) && ($.support.leadingWhitespace || !Pa.test(a)) && !_a[(Ra.exec(a) || ["", ""])[1].toLowerCase()]) {
  5485. a = a.replace(Qa, "<$1></$2>");
  5486. try {
  5487. for (; d < e; d++) c = this[d] || {}, 1 === c.nodeType && ($.cleanData(c.getElementsByTagName("*")), c.innerHTML = a);
  5488. c = 0
  5489. } catch (a) {}
  5490. }
  5491. c && this.empty().append(a)
  5492. }, null, a, arguments.length)
  5493. },
  5494. replaceWith: function(a) {
  5495. return h(this[0]) ? this.length ? this.pushStack($($.isFunction(a) ? a() : a), "replaceWith", a) : this : $.isFunction(a) ? this.each(function(b) {
  5496. var c = $(this),
  5497. d = c.html();
  5498. c.replaceWith(a.call(this, b, d))
  5499. }) : ("string" != typeof a && (a = $(a).detach()), this.each(function() {
  5500. var b = this.nextSibling,
  5501. c = this.parentNode;
  5502. $(this).remove(), b ? $(b).before(a) : $(c).append(a)
  5503. }))
  5504. },
  5505. detach: function(a) {
  5506. return this.remove(a, !0)
  5507. },
  5508. domManip: function(a, c, d) {
  5509. a = [].concat.apply([], a);
  5510. var e, f, g, h, i = 0,
  5511. j = a[0],
  5512. k = [],
  5513. m = this.length;
  5514. if (!$.support.checkClone && m > 1 && "string" == typeof j && Ya.test(j)) return this.each(function() {
  5515. $(this).domManip(a, c, d)
  5516. });
  5517. if ($.isFunction(j)) return this.each(function(e) {
  5518. var f = $(this);
  5519. a[0] = j.call(this, e, c ? f.html() : b), f.domManip(a, c, d)
  5520. });
  5521. if (this[0]) {
  5522. if (e = $.buildFragment(a, this, k), g = e.fragment, f = g.firstChild, 1 === g.childNodes.length && (g = f), f)
  5523. for (c = c && $.nodeName(f, "tr"), h = e.cacheable || m - 1; i < m; i++) d.call(c && $.nodeName(this[i], "table") ? l(this[i], "tbody") : this[i], i === h ? g : $.clone(g, !0, !0));
  5524. g = f = null, k.length && $.each(k, function(a, b) {
  5525. b.src ? $.ajax ? $.ajax({
  5526. url: b.src,
  5527. type: "GET",
  5528. dataType: "script",
  5529. async: !1,
  5530. global: !1,
  5531. throws: !0
  5532. }) : $.error("no ajax") : $.globalEval((b.text || b.textContent || b.innerHTML || "").replace($a, "")), b.parentNode && b.parentNode.removeChild(b)
  5533. })
  5534. }
  5535. return this
  5536. }
  5537. }), $.buildFragment = function(a, c, d) {
  5538. var e, f, g, h = a[0];
  5539. return c = c || P, c = !c.nodeType && c[0] || c, c = c.ownerDocument || c, 1 === a.length && "string" == typeof h && h.length < 512 && c === P && "<" === h.charAt(0) && !Va.test(h) && ($.support.checkClone || !Ya.test(h)) && ($.support.html5Clone || !Wa.test(h)) && (f = !0, e = $.fragments[h], g = e !== b), e || (e = c.createDocumentFragment(), $.clean(a, c, e, d), f && ($.fragments[h] = g && e)), {
  5540. fragment: e,
  5541. cacheable: f
  5542. }
  5543. }, $.fragments = {}, $.each({
  5544. appendTo: "append",
  5545. prependTo: "prepend",
  5546. insertBefore: "before",
  5547. insertAfter: "after",
  5548. replaceAll: "replaceWith"
  5549. }, function(a, b) {
  5550. $.fn[a] = function(c) {
  5551. var d, e = 0,
  5552. f = [],
  5553. g = $(c),
  5554. h = g.length,
  5555. i = 1 === this.length && this[0].parentNode;
  5556. if ((null == i || i && 11 === i.nodeType && 1 === i.childNodes.length) && 1 === h) return g[b](this[0]), this;
  5557. for (; e < h; e++) d = (e > 0 ? this.clone(!0) : this).get(), $(g[e])[b](d), f = f.concat(d);
  5558. return this.pushStack(f, a, g.selector)
  5559. }
  5560. }), $.extend({
  5561. clone: function(a, b, c) {
  5562. var d, e, f, g;
  5563. if ($.support.html5Clone || $.isXMLDoc(a) || !Wa.test("<" + a.nodeName + ">") ? g = a.cloneNode(!0) : (bb.innerHTML = a.outerHTML, bb.removeChild(g = bb.firstChild)), !($.support.noCloneEvent && $.support.noCloneChecked || 1 !== a.nodeType && 11 !== a.nodeType || $.isXMLDoc(a)))
  5564. for (n(a, g), d = o(a), e = o(g), f = 0; d[f]; ++f) e[f] && n(d[f], e[f]);
  5565. if (b && (m(a, g), c))
  5566. for (d = o(a), e = o(g), f = 0; d[f]; ++f) m(d[f], e[f]);
  5567. return d = e = null, g
  5568. },
  5569. clean: function(a, b, c, d) {
  5570. var e, f, g, h, i, j, l, m, n, o, q, r = b === P && ab,
  5571. s = [];
  5572. for (b && "undefined" != typeof b.createDocumentFragment || (b = P), e = 0; null != (g = a[e]); e++)
  5573. if ("number" == typeof g && (g += ""), g) {
  5574. if ("string" == typeof g)
  5575. if (Ta.test(g)) {
  5576. for (r = r || k(b), l = b.createElement("div"), r.appendChild(l), g = g.replace(Qa, "<$1></$2>"), h = (Ra.exec(g) || ["", ""])[1].toLowerCase(), i = _a[h] || _a._default, j = i[0], l.innerHTML = i[1] + g + i[2]; j--;) l = l.lastChild;
  5577. if (!$.support.tbody)
  5578. for (m = Sa.test(g), n = "table" !== h || m ? "<table>" !== i[1] || m ? [] : l.childNodes : l.firstChild && l.firstChild.childNodes, f = n.length - 1; f >= 0; --f) $.nodeName(n[f], "tbody") && !n[f].childNodes.length && n[f].parentNode.removeChild(n[f]);
  5579. !$.support.leadingWhitespace && Pa.test(g) && l.insertBefore(b.createTextNode(Pa.exec(g)[0]), l.firstChild), g = l.childNodes, l.parentNode.removeChild(l)
  5580. } else g = b.createTextNode(g);
  5581. g.nodeType ? s.push(g) : $.merge(s, g)
  5582. }
  5583. if (l && (g = l = r = null), !$.support.appendChecked)
  5584. for (e = 0; null != (g = s[e]); e++) $.nodeName(g, "input") ? p(g) : "undefined" != typeof g.getElementsByTagName && $.grep(g.getElementsByTagName("input"), p);
  5585. if (c)
  5586. for (o = function(a) {
  5587. if (!a.type || Za.test(a.type)) return d ? d.push(a.parentNode ? a.parentNode.removeChild(a) : a) : c.appendChild(a)
  5588. }, e = 0; null != (g = s[e]); e++) $.nodeName(g, "script") && o(g) || (c.appendChild(g), "undefined" != typeof g.getElementsByTagName && (q = $.grep($.merge([], g.getElementsByTagName("script")), o), s.splice.apply(s, [e + 1, 0].concat(q)), e += q.length));
  5589. return s
  5590. },
  5591. cleanData: function(a, b) {
  5592. for (var c, d, e, f, g = 0, h = $.expando, i = $.cache, j = $.support.deleteExpando, k = $.event.special; null != (e = a[g]); g++)
  5593. if ((b || $.acceptData(e)) && (d = e[h], c = d && i[d])) {
  5594. if (c.events)
  5595. for (f in c.events) k[f] ? $.event.remove(e, f) : $.removeEvent(e, f, c.handle);
  5596. i[d] && (delete i[d], j ? delete e[h] : e.removeAttribute ? e.removeAttribute(h) : e[h] = null, $.deletedIds.push(d))
  5597. }
  5598. }
  5599. }),
  5600. function() {
  5601. var a, b;
  5602. $.uaMatch = function(a) {
  5603. a = a.toLowerCase();
  5604. var b = /(chrome)[ \/]([\w.]+)/.exec(a) || /(webkit)[ \/]([\w.]+)/.exec(a) || /(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a) || /(msie) ([\w.]+)/.exec(a) || a.indexOf("compatible") < 0 && /(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a) || [];
  5605. return {
  5606. browser: b[1] || "",
  5607. version: b[2] || "0"
  5608. }
  5609. }, a = $.uaMatch(R.userAgent), b = {}, a.browser && (b[a.browser] = !0, b.version = a.version), b.chrome ? b.webkit = !0 : b.webkit && (b.safari = !0), $.browser = b, $.sub = function() {
  5610. function a(b, c) {
  5611. return new a.fn.init(b, c)
  5612. }
  5613. $.extend(!0, a, this), a.superclass = this, a.fn = a.prototype = this(), a.fn.constructor = a, a.sub = this.sub, a.fn.init = function c(c, d) {
  5614. return d && d instanceof $ && !(d instanceof a) && (d = a(d)), $.fn.init.call(this, c, d, b)
  5615. }, a.fn.init.prototype = a.fn;
  5616. var b = a(P);
  5617. return a
  5618. }
  5619. }();
  5620. var cb, db, eb, fb = /alpha\([^)]*\)/i,
  5621. gb = /opacity=([^)]*)/,
  5622. hb = /^(top|right|bottom|left)$/,
  5623. ib = /^(none|table(?!-c[ea]).+)/,
  5624. jb = /^margin/,
  5625. kb = new RegExp("^(" + _ + ")(.*)$", "i"),
  5626. lb = new RegExp("^(" + _ + ")(?!px)[a-z%]+$", "i"),
  5627. mb = new RegExp("^([-+])=(" + _ + ")", "i"),
  5628. nb = {},
  5629. ob = {
  5630. position: "absolute",
  5631. visibility: "hidden",
  5632. display: "block"
  5633. },
  5634. pb = {
  5635. letterSpacing: 0,
  5636. fontWeight: 400
  5637. },
  5638. qb = ["Top", "Right", "Bottom", "Left"],
  5639. rb = ["Webkit", "O", "Moz", "ms"],
  5640. sb = $.fn.toggle;
  5641. $.fn.extend({
  5642. css: function(a, c) {
  5643. return $.access(this, function(a, c, d) {
  5644. return d !== b ? $.style(a, c, d) : $.css(a, c)
  5645. }, a, c, arguments.length > 1)
  5646. },
  5647. show: function() {
  5648. return s(this, !0)
  5649. },
  5650. hide: function() {
  5651. return s(this)
  5652. },
  5653. toggle: function(a, b) {
  5654. var c = "boolean" == typeof a;
  5655. return $.isFunction(a) && $.isFunction(b) ? sb.apply(this, arguments) : this.each(function() {
  5656. (c ? a : r(this)) ? $(this).show(): $(this).hide()
  5657. })
  5658. }
  5659. }), $.extend({
  5660. cssHooks: {
  5661. opacity: {
  5662. get: function(a, b) {
  5663. if (b) {
  5664. var c = cb(a, "opacity");
  5665. return "" === c ? "1" : c
  5666. }
  5667. }
  5668. }
  5669. },
  5670. cssNumber: {
  5671. fillOpacity: !0,
  5672. fontWeight: !0,
  5673. lineHeight: !0,
  5674. opacity: !0,
  5675. orphans: !0,
  5676. widows: !0,
  5677. zIndex: !0,
  5678. zoom: !0
  5679. },
  5680. cssProps: {
  5681. float: $.support.cssFloat ? "cssFloat" : "styleFloat"
  5682. },
  5683. style: function(a, c, d, e) {
  5684. if (a && 3 !== a.nodeType && 8 !== a.nodeType && a.style) {
  5685. var f, g, h, i = $.camelCase(c),
  5686. j = a.style;
  5687. if (c = $.cssProps[i] || ($.cssProps[i] = q(j, i)), h = $.cssHooks[c] || $.cssHooks[i], d === b) return h && "get" in h && (f = h.get(a, !1, e)) !== b ? f : j[c];
  5688. if (g = typeof d, "string" === g && (f = mb.exec(d)) && (d = (f[1] + 1) * f[2] + parseFloat($.css(a, c)), g = "number"), !(null == d || "number" === g && isNaN(d) || ("number" === g && !$.cssNumber[i] && (d += "px"), h && "set" in h && (d = h.set(a, d, e)) === b))) try {
  5689. j[c] = d
  5690. } catch (a) {}
  5691. }
  5692. },
  5693. css: function(a, c, d, e) {
  5694. var f, g, h, i = $.camelCase(c);
  5695. return c = $.cssProps[i] || ($.cssProps[i] = q(a.style, i)), h = $.cssHooks[c] || $.cssHooks[i], h && "get" in h && (f = h.get(a, !0, e)), f === b && (f = cb(a, c)), "normal" === f && c in pb && (f = pb[c]), d || e !== b ? (g = parseFloat(f), d || $.isNumeric(g) ? g || 0 : f) : f
  5696. },
  5697. swap: function(a, b, c) {
  5698. var d, e, f = {};
  5699. for (e in b) f[e] = a.style[e], a.style[e] = b[e];
  5700. d = c.call(a);
  5701. for (e in b) a.style[e] = f[e];
  5702. return d
  5703. }
  5704. }), a.getComputedStyle ? cb = function(b, c) {
  5705. var d, e, f, g, h = a.getComputedStyle(b, null),
  5706. i = b.style;
  5707. return h && (d = h[c], "" === d && !$.contains(b.ownerDocument, b) && (d = $.style(b, c)), lb.test(d) && jb.test(c) && (e = i.width, f = i.minWidth, g = i.maxWidth, i.minWidth = i.maxWidth = i.width = d, d = h.width, i.width = e, i.minWidth = f, i.maxWidth = g)), d
  5708. } : P.documentElement.currentStyle && (cb = function(a, b) {
  5709. var c, d, e = a.currentStyle && a.currentStyle[b],
  5710. f = a.style;
  5711. return null == e && f && f[b] && (e = f[b]), lb.test(e) && !hb.test(b) && (c = f.left, d = a.runtimeStyle && a.runtimeStyle.left, d && (a.runtimeStyle.left = a.currentStyle.left), f.left = "fontSize" === b ? "1em" : e, e = f.pixelLeft + "px", f.left = c, d && (a.runtimeStyle.left = d)), "" === e ? "auto" : e
  5712. }), $.each(["height", "width"], function(a, b) {
  5713. $.cssHooks[b] = {
  5714. get: function(a, c, d) {
  5715. if (c) return 0 === a.offsetWidth && ib.test(cb(a, "display")) ? $.swap(a, ob, function() {
  5716. return v(a, b, d)
  5717. }) : v(a, b, d)
  5718. },
  5719. set: function(a, c, d) {
  5720. return t(a, c, d ? u(a, b, d, $.support.boxSizing && "border-box" === $.css(a, "boxSizing")) : 0)
  5721. }
  5722. }
  5723. }), $.support.opacity || ($.cssHooks.opacity = {
  5724. get: function(a, b) {
  5725. return gb.test((b && a.currentStyle ? a.currentStyle.filter : a.style.filter) || "") ? .01 * parseFloat(RegExp.$1) + "" : b ? "1" : ""
  5726. },
  5727. set: function(a, b) {
  5728. var c = a.style,
  5729. d = a.currentStyle,
  5730. e = $.isNumeric(b) ? "alpha(opacity=" + 100 * b + ")" : "",
  5731. f = d && d.filter || c.filter || "";
  5732. c.zoom = 1, b >= 1 && "" === $.trim(f.replace(fb, "")) && c.removeAttribute && (c.removeAttribute("filter"), d && !d.filter) || (c.filter = fb.test(f) ? f.replace(fb, e) : f + " " + e)
  5733. }
  5734. }), $(function() {
  5735. $.support.reliableMarginRight || ($.cssHooks.marginRight = {
  5736. get: function(a, b) {
  5737. return $.swap(a, {
  5738. display: "inline-block"
  5739. }, function() {
  5740. if (b) return cb(a, "marginRight")
  5741. })
  5742. }
  5743. }), !$.support.pixelPosition && $.fn.position && $.each(["top", "left"], function(a, b) {
  5744. $.cssHooks[b] = {
  5745. get: function(a, c) {
  5746. if (c) {
  5747. var d = cb(a, b);
  5748. return lb.test(d) ? $(a).position()[b] + "px" : d
  5749. }
  5750. }
  5751. }
  5752. })
  5753. }), $.expr && $.expr.filters && ($.expr.filters.hidden = function(a) {
  5754. return 0 === a.offsetWidth && 0 === a.offsetHeight || !$.support.reliableHiddenOffsets && "none" === (a.style && a.style.display || cb(a, "display"))
  5755. }, $.expr.filters.visible = function(a) {
  5756. return !$.expr.filters.hidden(a)
  5757. }), $.each({
  5758. margin: "",
  5759. padding: "",
  5760. border: "Width"
  5761. }, function(a, b) {
  5762. $.cssHooks[a + b] = {
  5763. expand: function(c) {
  5764. var d, e = "string" == typeof c ? c.split(" ") : [c],
  5765. f = {};
  5766. for (d = 0; d < 4; d++) f[a + qb[d] + b] = e[d] || e[d - 2] || e[0];
  5767. return f
  5768. }
  5769. }, jb.test(a) || ($.cssHooks[a + b].set = t)
  5770. });
  5771. var tb = /%20/g,
  5772. ub = /\[\]$/,
  5773. vb = /\r?\n/g,
  5774. wb = /^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,
  5775. xb = /^(?:select|textarea)/i;
  5776. $.fn.extend({
  5777. serialize: function() {
  5778. return $.param(this.serializeArray())
  5779. },
  5780. serializeArray: function() {
  5781. return this.map(function() {
  5782. return this.elements ? $.makeArray(this.elements) : this
  5783. }).filter(function() {
  5784. return this.name && !this.disabled && (this.checked || xb.test(this.nodeName) || wb.test(this.type))
  5785. }).map(function(a, b) {
  5786. var c = $(this).val();
  5787. return null == c ? null : $.isArray(c) ? $.map(c, function(a, c) {
  5788. return {
  5789. name: b.name,
  5790. value: a.replace(vb, "\r\n")
  5791. }
  5792. }) : {
  5793. name: b.name,
  5794. value: c.replace(vb, "\r\n")
  5795. }
  5796. }).get()
  5797. }
  5798. }), $.param = function(a, c) {
  5799. var d, e = [],
  5800. f = function(a, b) {
  5801. b = $.isFunction(b) ? b() : null == b ? "" : b, e[e.length] = encodeURIComponent(a) + "=" + encodeURIComponent(b)
  5802. };
  5803. if (c === b && (c = $.ajaxSettings && $.ajaxSettings.traditional), $.isArray(a) || a.jquery && !$.isPlainObject(a)) $.each(a, function() {
  5804. f(this.name, this.value)
  5805. });
  5806. else
  5807. for (d in a) x(d, a[d], c, f);
  5808. return e.join("&").replace(tb, "+")
  5809. };
  5810. var yb, zb, Ab = /#.*$/,
  5811. Bb = /^(.*?):[ \t]*([^\r\n]*)\r?$/gm,
  5812. Cb = /^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,
  5813. Db = /^(?:GET|HEAD)$/,
  5814. Eb = /^\/\//,
  5815. Fb = /\?/,
  5816. Gb = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  5817. Hb = /([?&])_=[^&]*/,
  5818. Ib = /^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+)|)|)/,
  5819. Jb = $.fn.load,
  5820. Kb = {},
  5821. Lb = {},
  5822. Mb = ["*/"] + ["*"];
  5823. try {
  5824. yb = Q.href
  5825. } catch (a) {
  5826. yb = P.createElement("a"), yb.href = "", yb = yb.href
  5827. }
  5828. zb = Ib.exec(yb.toLowerCase()) || [], $.fn.load = function(a, c, d) {
  5829. if ("string" != typeof a && Jb) return Jb.apply(this, arguments);
  5830. if (!this.length) return this;
  5831. var e, f, g, h = this,
  5832. i = a.indexOf(" ");
  5833. return i >= 0 && (e = a.slice(i, a.length), a = a.slice(0, i)), $.isFunction(c) ? (d = c, c = b) : c && "object" == typeof c && (f = "POST"), $.ajax({
  5834. url: a,
  5835. type: f,
  5836. dataType: "html",
  5837. data: c,
  5838. complete: function(a, b) {
  5839. d && h.each(d, g || [a.responseText, b, a])
  5840. }
  5841. }).done(function(a) {
  5842. g = arguments, h.html(e ? $("<div>").append(a.replace(Gb, "")).find(e) : a)
  5843. }), this
  5844. }, $.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "), function(a, b) {
  5845. $.fn[b] = function(a) {
  5846. return this.on(b, a)
  5847. }
  5848. }), $.each(["get", "post"], function(a, c) {
  5849. $[c] = function(a, d, e, f) {
  5850. return $.isFunction(d) && (f = f || e, e = d, d = b), $.ajax({
  5851. type: c,
  5852. url: a,
  5853. data: d,
  5854. success: e,
  5855. dataType: f
  5856. })
  5857. }
  5858. }), $.extend({
  5859. getScript: function(a, c) {
  5860. return $.get(a, b, c, "script")
  5861. },
  5862. getJSON: function(a, b, c) {
  5863. return $.get(a, b, c, "json")
  5864. },
  5865. ajaxSetup: function(a, b) {
  5866. return b ? A(a, $.ajaxSettings) : (b = a, a = $.ajaxSettings), A(a, b), a
  5867. },
  5868. ajaxSettings: {
  5869. url: yb,
  5870. isLocal: Cb.test(zb[1]),
  5871. global: !0,
  5872. type: "GET",
  5873. contentType: "application/x-www-form-urlencoded; charset=UTF-8",
  5874. processData: !0,
  5875. async: !0,
  5876. accepts: {
  5877. xml: "application/xml, text/xml",
  5878. html: "text/html",
  5879. text: "text/plain",
  5880. json: "application/json, text/javascript",
  5881. "*": Mb
  5882. },
  5883. contents: {
  5884. xml: /xml/,
  5885. html: /html/,
  5886. json: /json/
  5887. },
  5888. responseFields: {
  5889. xml: "responseXML",
  5890. text: "responseText"
  5891. },
  5892. converters: {
  5893. "* text": a.String,
  5894. "text html": !0,
  5895. "text json": $.parseJSON,
  5896. "text xml": $.parseXML
  5897. },
  5898. flatOptions: {
  5899. context: !0,
  5900. url: !0
  5901. }
  5902. },
  5903. ajaxPrefilter: y(Kb),
  5904. ajaxTransport: y(Lb),
  5905. ajax: function(a, c) {
  5906. function d(a, c, d, g) {
  5907. var j, l, s, t, v, x = c;
  5908. 2 !== u && (u = 2, i && clearTimeout(i), h = b, f = g || "", w.readyState = a > 0 ? 4 : 0, d && (t = B(m, w, d)), a >= 200 && a < 300 || 304 === a ? (m.ifModified && (v = w.getResponseHeader("Last-Modified"), v && ($.lastModified[e] = v), v = w.getResponseHeader("Etag"), v && ($.etag[e] = v)), 304 === a ? (x = "notmodified", j = !0) : (j = C(m, t), x = j.state, l = j.data, s = j.error, j = !s)) : (s = x, x && !a || (x = "error", a < 0 && (a = 0))), w.status = a, w.statusText = "" + (c || x), j ? p.resolveWith(n, [l, x, w]) : p.rejectWith(n, [w, x, s]), w.statusCode(r), r = b, k && o.trigger("ajax" + (j ? "Success" : "Error"), [w, m, j ? l : s]), q.fireWith(n, [w, x]), k && (o.trigger("ajaxComplete", [w, m]), --$.active || $.event.trigger("ajaxStop")))
  5909. }
  5910. "object" == typeof a && (c = a, a = b), c = c || {};
  5911. var e, f, g, h, i, j, k, l, m = $.ajaxSetup({}, c),
  5912. n = m.context || m,
  5913. o = n !== m && (n.nodeType || n instanceof $) ? $(n) : $.event,
  5914. p = $.Deferred(),
  5915. q = $.Callbacks("once memory"),
  5916. r = m.statusCode || {},
  5917. s = {},
  5918. t = {},
  5919. u = 0,
  5920. v = "canceled",
  5921. w = {
  5922. readyState: 0,
  5923. setRequestHeader: function(a, b) {
  5924. if (!u) {
  5925. var c = a.toLowerCase();
  5926. a = t[c] = t[c] || a, s[a] = b
  5927. }
  5928. return this
  5929. },
  5930. getAllResponseHeaders: function() {
  5931. return 2 === u ? f : null
  5932. },
  5933. getResponseHeader: function(a) {
  5934. var c;
  5935. if (2 === u) {
  5936. if (!g)
  5937. for (g = {}; c = Bb.exec(f);) g[c[1].toLowerCase()] = c[2];
  5938. c = g[a.toLowerCase()]
  5939. }
  5940. return c === b ? null : c
  5941. },
  5942. overrideMimeType: function(a) {
  5943. return u || (m.mimeType = a), this
  5944. },
  5945. abort: function(a) {
  5946. return a = a || v, h && h.abort(a), d(0, a), this
  5947. }
  5948. };
  5949. if (p.promise(w), w.success = w.done, w.error = w.fail, w.complete = q.add, w.statusCode = function(a) {
  5950. if (a) {
  5951. var b;
  5952. if (u < 2)
  5953. for (b in a) r[b] = [r[b], a[b]];
  5954. else b = a[w.status], w.always(b)
  5955. }
  5956. return this
  5957. }, m.url = ((a || m.url) + "").replace(Ab, "").replace(Eb, zb[1] + "//"), m.dataTypes = $.trim(m.dataType || "*").toLowerCase().split(ba), null == m.crossDomain && (j = Ib.exec(m.url.toLowerCase()), m.crossDomain = !(!j || j[1] == zb[1] && j[2] == zb[2] && (j[3] || ("http:" === j[1] ? 80 : 443)) == (zb[3] || ("http:" === zb[1] ? 80 : 443)))), m.data && m.processData && "string" != typeof m.data && (m.data = $.param(m.data, m.traditional)), z(Kb, m, c, w), 2 === u) return w;
  5958. if (k = m.global, m.type = m.type.toUpperCase(), m.hasContent = !Db.test(m.type), k && 0 === $.active++ && $.event.trigger("ajaxStart"), !m.hasContent && (m.data && (m.url += (Fb.test(m.url) ? "&" : "?") + m.data, delete m.data), e = m.url, m.cache === !1)) {
  5959. var x = $.now(),
  5960. y = m.url.replace(Hb, "$1_=" + x);
  5961. m.url = y + (y === m.url ? (Fb.test(m.url) ? "&" : "?") + "_=" + x : "")
  5962. }(m.data && m.hasContent && m.contentType !== !1 || c.contentType) && w.setRequestHeader("Content-Type", m.contentType), m.ifModified && (e = e || m.url, $.lastModified[e] && w.setRequestHeader("If-Modified-Since", $.lastModified[e]), $.etag[e] && w.setRequestHeader("If-None-Match", $.etag[e])), w.setRequestHeader("Accept", m.dataTypes[0] && m.accepts[m.dataTypes[0]] ? m.accepts[m.dataTypes[0]] + ("*" !== m.dataTypes[0] ? ", " + Mb + "; q=0.01" : "") : m.accepts["*"]);
  5963. for (l in m.headers) w.setRequestHeader(l, m.headers[l]);
  5964. if (!m.beforeSend || m.beforeSend.call(n, w, m) !== !1 && 2 !== u) {
  5965. v = "abort";
  5966. for (l in {
  5967. success: 1,
  5968. error: 1,
  5969. complete: 1
  5970. }) w[l](m[l]);
  5971. if (h = z(Lb, m, c, w)) {
  5972. w.readyState = 1, k && o.trigger("ajaxSend", [w, m]), m.async && m.timeout > 0 && (i = setTimeout(function() {
  5973. w.abort("timeout")
  5974. }, m.timeout));
  5975. try {
  5976. u = 1, h.send(s, d)
  5977. } catch (a) {
  5978. if (!(u < 2)) throw a;
  5979. d(-1, a)
  5980. }
  5981. } else d(-1, "No Transport");
  5982. return w
  5983. }
  5984. return w.abort()
  5985. },
  5986. active: 0,
  5987. lastModified: {},
  5988. etag: {}
  5989. });
  5990. var Nb = [],
  5991. Ob = /\?/,
  5992. Pb = /(=)\?(?=&|$)|\?\?/,
  5993. Qb = $.now();
  5994. $.ajaxSetup({
  5995. jsonp: "callback",
  5996. jsonpCallback: function() {
  5997. var a = Nb.pop() || $.expando + "_" + Qb++;
  5998. return this[a] = !0, a
  5999. }
  6000. }), $.ajaxPrefilter("json jsonp", function(c, d, e) {
  6001. var f, g, h, i = c.data,
  6002. j = c.url,
  6003. k = c.jsonp !== !1,
  6004. l = k && Pb.test(j),
  6005. m = k && !l && "string" == typeof i && !(c.contentType || "").indexOf("application/x-www-form-urlencoded") && Pb.test(i);
  6006. if ("jsonp" === c.dataTypes[0] || l || m) return f = c.jsonpCallback = $.isFunction(c.jsonpCallback) ? c.jsonpCallback() : c.jsonpCallback, g = a[f], l ? c.url = j.replace(Pb, "$1" + f) : m ? c.data = i.replace(Pb, "$1" + f) : k && (c.url += (Ob.test(j) ? "&" : "?") + c.jsonp + "=" + f), c.converters["script json"] = function() {
  6007. return h || $.error(f + " was not called"), h[0]
  6008. }, c.dataTypes[0] = "json", a[f] = function() {
  6009. h = arguments
  6010. }, e.always(function() {
  6011. a[f] = g, c[f] && (c.jsonpCallback = d.jsonpCallback, Nb.push(f)), h && $.isFunction(g) && g(h[0]), h = g = b
  6012. }), "script"
  6013. }), $.ajaxSetup({
  6014. accepts: {
  6015. script: "text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"
  6016. },
  6017. contents: {
  6018. script: /javascript|ecmascript/
  6019. },
  6020. converters: {
  6021. "text script": function(a) {
  6022. return $.globalEval(a), a
  6023. }
  6024. }
  6025. }), $.ajaxPrefilter("script", function(a) {
  6026. a.cache === b && (a.cache = !1), a.crossDomain && (a.type = "GET", a.global = !1)
  6027. }), $.ajaxTransport("script", function(a) {
  6028. if (a.crossDomain) {
  6029. var c, d = P.head || P.getElementsByTagName("head")[0] || P.documentElement;
  6030. return {
  6031. send: function(e, f) {
  6032. c = P.createElement("script"), c.async = "async", a.scriptCharset && (c.charset = a.scriptCharset), c.src = a.url, c.onload = c.onreadystatechange = function(a, e) {
  6033. (e || !c.readyState || /loaded|complete/.test(c.readyState)) && (c.onload = c.onreadystatechange = null, d && c.parentNode && d.removeChild(c), c = b, e || f(200, "success"))
  6034. }, d.insertBefore(c, d.firstChild)
  6035. },
  6036. abort: function() {
  6037. c && c.onload(0, 1)
  6038. }
  6039. }
  6040. }
  6041. });
  6042. var Rb, Sb = !!a.ActiveXObject && function() {
  6043. for (var a in Rb) Rb[a](0, 1)
  6044. },
  6045. Tb = 0;
  6046. $.ajaxSettings.xhr = a.ActiveXObject ? function() {
  6047. return !this.isLocal && D() || E();
  6048. } : D,
  6049. function(a) {
  6050. $.extend($.support, {
  6051. ajax: !!a,
  6052. cors: !!a && "withCredentials" in a
  6053. })
  6054. }($.ajaxSettings.xhr()), $.support.ajax && $.ajaxTransport(function(c) {
  6055. if (!c.crossDomain || $.support.cors) {
  6056. var d;
  6057. return {
  6058. send: function(e, f) {
  6059. var g, h, i = c.xhr();
  6060. if (c.username ? i.open(c.type, c.url, c.async, c.username, c.password) : i.open(c.type, c.url, c.async), c.xhrFields)
  6061. for (h in c.xhrFields) i[h] = c.xhrFields[h];
  6062. c.mimeType && i.overrideMimeType && i.overrideMimeType(c.mimeType), !c.crossDomain && !e["X-Requested-With"] && (e["X-Requested-With"] = "XMLHttpRequest");
  6063. try {
  6064. for (h in e) i.setRequestHeader(h, e[h])
  6065. } catch (a) {}
  6066. i.send(c.hasContent && c.data || null), d = function(a, e) {
  6067. var h, j, k, l, m;
  6068. try {
  6069. if (d && (e || 4 === i.readyState))
  6070. if (d = b, g && (i.onreadystatechange = $.noop, Sb && delete Rb[g]), e) 4 !== i.readyState && i.abort();
  6071. else {
  6072. h = i.status, k = i.getAllResponseHeaders(), l = {}, m = i.responseXML, m && m.documentElement && (l.xml = m);
  6073. try {
  6074. l.text = i.responseText
  6075. } catch (a) {}
  6076. try {
  6077. j = i.statusText
  6078. } catch (a) {
  6079. j = ""
  6080. }
  6081. h || !c.isLocal || c.crossDomain ? 1223 === h && (h = 204) : h = l.text ? 200 : 404
  6082. }
  6083. } catch (a) {
  6084. e || f(-1, a)
  6085. }
  6086. l && f(h, j, l, k)
  6087. }, c.async ? 4 === i.readyState ? setTimeout(d, 0) : (g = ++Tb, Sb && (Rb || (Rb = {}, $(a).unload(Sb)), Rb[g] = d), i.onreadystatechange = d) : d()
  6088. },
  6089. abort: function() {
  6090. d && d(0, 1)
  6091. }
  6092. }
  6093. }
  6094. });
  6095. var Ub, Vb, Wb = /^(?:toggle|show|hide)$/,
  6096. Xb = new RegExp("^(?:([-+])=|)(" + _ + ")([a-z%]*)$", "i"),
  6097. Yb = /queueHooks$/,
  6098. Zb = [J],
  6099. $b = {
  6100. "*": [function(a, b) {
  6101. var c, d, e, f = this.createTween(a, b),
  6102. g = Xb.exec(b),
  6103. h = f.cur(),
  6104. i = +h || 0,
  6105. j = 1;
  6106. if (g) {
  6107. if (c = +g[2], d = g[3] || ($.cssNumber[a] ? "" : "px"), "px" !== d && i) {
  6108. i = $.css(f.elem, a, !0) || c || 1;
  6109. do e = j = j || ".5", i /= j, $.style(f.elem, a, i + d), j = f.cur() / h; while (1 !== j && j !== e)
  6110. }
  6111. f.unit = d, f.start = i, f.end = g[1] ? i + (g[1] + 1) * c : c
  6112. }
  6113. return f
  6114. }]
  6115. };
  6116. $.Animation = $.extend(H, {
  6117. tweener: function(a, b) {
  6118. $.isFunction(a) ? (b = a, a = ["*"]) : a = a.split(" ");
  6119. for (var c, d = 0, e = a.length; d < e; d++) c = a[d], $b[c] = $b[c] || [], $b[c].unshift(b)
  6120. },
  6121. prefilter: function(a, b) {
  6122. b ? Zb.unshift(a) : Zb.push(a)
  6123. }
  6124. }), $.Tween = K, K.prototype = {
  6125. constructor: K,
  6126. init: function(a, b, c, d, e, f) {
  6127. this.elem = a, this.prop = c, this.easing = e || "swing", this.options = b, this.start = this.now = this.cur(), this.end = d, this.unit = f || ($.cssNumber[c] ? "" : "px")
  6128. },
  6129. cur: function() {
  6130. var a = K.propHooks[this.prop];
  6131. return a && a.get ? a.get(this) : K.propHooks._default.get(this)
  6132. },
  6133. run: function(a) {
  6134. var b, c = K.propHooks[this.prop];
  6135. return this.options.duration ? this.pos = b = $.easing[this.easing](a, this.options.duration * a, 0, 1, this.options.duration) : this.pos = b = a, this.now = (this.end - this.start) * b + this.start, this.options.step && this.options.step.call(this.elem, this.now, this), c && c.set ? c.set(this) : K.propHooks._default.set(this), this
  6136. }
  6137. }, K.prototype.init.prototype = K.prototype, K.propHooks = {
  6138. _default: {
  6139. get: function(a) {
  6140. var b;
  6141. return null == a.elem[a.prop] || a.elem.style && null != a.elem.style[a.prop] ? (b = $.css(a.elem, a.prop, !1, ""), b && "auto" !== b ? b : 0) : a.elem[a.prop]
  6142. },
  6143. set: function(a) {
  6144. $.fx.step[a.prop] ? $.fx.step[a.prop](a) : a.elem.style && (null != a.elem.style[$.cssProps[a.prop]] || $.cssHooks[a.prop]) ? $.style(a.elem, a.prop, a.now + a.unit) : a.elem[a.prop] = a.now
  6145. }
  6146. }
  6147. }, K.propHooks.scrollTop = K.propHooks.scrollLeft = {
  6148. set: function(a) {
  6149. a.elem.nodeType && a.elem.parentNode && (a.elem[a.prop] = a.now)
  6150. }
  6151. }, $.each(["toggle", "show", "hide"], function(a, b) {
  6152. var c = $.fn[b];
  6153. $.fn[b] = function(d, e, f) {
  6154. return null == d || "boolean" == typeof d || !a && $.isFunction(d) && $.isFunction(e) ? c.apply(this, arguments) : this.animate(L(b, !0), d, e, f)
  6155. }
  6156. }), $.fn.extend({
  6157. fadeTo: function(a, b, c, d) {
  6158. return this.filter(r).css("opacity", 0).show().end().animate({
  6159. opacity: b
  6160. }, a, c, d)
  6161. },
  6162. animate: function(a, b, c, d) {
  6163. var e = $.isEmptyObject(a),
  6164. f = $.speed(b, c, d),
  6165. g = function() {
  6166. var b = H(this, $.extend({}, a), f);
  6167. e && b.stop(!0)
  6168. };
  6169. return e || f.queue === !1 ? this.each(g) : this.queue(f.queue, g)
  6170. },
  6171. stop: function(a, c, d) {
  6172. var e = function(a) {
  6173. var b = a.stop;
  6174. delete a.stop, b(d)
  6175. };
  6176. return "string" != typeof a && (d = c, c = a, a = b), c && a !== !1 && this.queue(a || "fx", []), this.each(function() {
  6177. var b = !0,
  6178. c = null != a && a + "queueHooks",
  6179. f = $.timers,
  6180. g = $._data(this);
  6181. if (c) g[c] && g[c].stop && e(g[c]);
  6182. else
  6183. for (c in g) g[c] && g[c].stop && Yb.test(c) && e(g[c]);
  6184. for (c = f.length; c--;) f[c].elem === this && (null == a || f[c].queue === a) && (f[c].anim.stop(d), b = !1, f.splice(c, 1));
  6185. (b || !d) && $.dequeue(this, a)
  6186. })
  6187. }
  6188. }), $.each({
  6189. slideDown: L("show"),
  6190. slideUp: L("hide"),
  6191. slideToggle: L("toggle"),
  6192. fadeIn: {
  6193. opacity: "show"
  6194. },
  6195. fadeOut: {
  6196. opacity: "hide"
  6197. },
  6198. fadeToggle: {
  6199. opacity: "toggle"
  6200. }
  6201. }, function(a, b) {
  6202. $.fn[a] = function(a, c, d) {
  6203. return this.animate(b, a, c, d)
  6204. }
  6205. }), $.speed = function(a, b, c) {
  6206. var d = a && "object" == typeof a ? $.extend({}, a) : {
  6207. complete: c || !c && b || $.isFunction(a) && a,
  6208. duration: a,
  6209. easing: c && b || b && !$.isFunction(b) && b
  6210. };
  6211. return d.duration = $.fx.off ? 0 : "number" == typeof d.duration ? d.duration : d.duration in $.fx.speeds ? $.fx.speeds[d.duration] : $.fx.speeds._default, null != d.queue && d.queue !== !0 || (d.queue = "fx"), d.old = d.complete, d.complete = function() {
  6212. $.isFunction(d.old) && d.old.call(this), d.queue && $.dequeue(this, d.queue)
  6213. }, d
  6214. }, $.easing = {
  6215. linear: function(a) {
  6216. return a
  6217. },
  6218. swing: function(a) {
  6219. return .5 - Math.cos(a * Math.PI) / 2
  6220. }
  6221. }, $.timers = [], $.fx = K.prototype.init, $.fx.tick = function() {
  6222. for (var a, b = $.timers, c = 0; c < b.length; c++) a = b[c], !a() && b[c] === a && b.splice(c--, 1);
  6223. b.length || $.fx.stop()
  6224. }, $.fx.timer = function(a) {
  6225. a() && $.timers.push(a) && !Vb && (Vb = setInterval($.fx.tick, $.fx.interval))
  6226. }, $.fx.interval = 13, $.fx.stop = function() {
  6227. clearInterval(Vb), Vb = null
  6228. }, $.fx.speeds = {
  6229. slow: 600,
  6230. fast: 200,
  6231. _default: 400
  6232. }, $.fx.step = {}, $.expr && $.expr.filters && ($.expr.filters.animated = function(a) {
  6233. return $.grep($.timers, function(b) {
  6234. return a === b.elem
  6235. }).length
  6236. });
  6237. var _b = /^(?:body|html)$/i;
  6238. $.fn.offset = function(a) {
  6239. if (arguments.length) return a === b ? this : this.each(function(b) {
  6240. $.offset.setOffset(this, a, b)
  6241. });
  6242. var c, d, e, f, g, h, i, j, k, l, m = this[0],
  6243. n = m && m.ownerDocument;
  6244. if (n) return (e = n.body) === m ? $.offset.bodyOffset(m) : (d = n.documentElement, $.contains(d, m) ? (c = m.getBoundingClientRect(), f = M(n), g = d.clientTop || e.clientTop || 0, h = d.clientLeft || e.clientLeft || 0, i = f.pageYOffset || d.scrollTop, j = f.pageXOffset || d.scrollLeft, k = c.top + i - g, l = c.left + j - h, {
  6245. top: k,
  6246. left: l
  6247. }) : {
  6248. top: 0,
  6249. left: 0
  6250. })
  6251. }, $.offset = {
  6252. bodyOffset: function(a) {
  6253. var b = a.offsetTop,
  6254. c = a.offsetLeft;
  6255. return $.support.doesNotIncludeMarginInBodyOffset && (b += parseFloat($.css(a, "marginTop")) || 0, c += parseFloat($.css(a, "marginLeft")) || 0), {
  6256. top: b,
  6257. left: c
  6258. }
  6259. },
  6260. setOffset: function(a, b, c) {
  6261. var d = $.css(a, "position");
  6262. "static" === d && (a.style.position = "relative");
  6263. var e, f, g = $(a),
  6264. h = g.offset(),
  6265. i = $.css(a, "top"),
  6266. j = $.css(a, "left"),
  6267. k = ("absolute" === d || "fixed" === d) && $.inArray("auto", [i, j]) > -1,
  6268. l = {},
  6269. m = {};
  6270. k ? (m = g.position(), e = m.top, f = m.left) : (e = parseFloat(i) || 0, f = parseFloat(j) || 0), $.isFunction(b) && (b = b.call(a, c, h)), null != b.top && (l.top = b.top - h.top + e), null != b.left && (l.left = b.left - h.left + f), "using" in b ? b.using.call(a, l) : g.css(l)
  6271. }
  6272. }, $.fn.extend({
  6273. position: function() {
  6274. if (this[0]) {
  6275. var a = this[0],
  6276. b = this.offsetParent(),
  6277. c = this.offset(),
  6278. d = _b.test(b[0].nodeName) ? {
  6279. top: 0,
  6280. left: 0
  6281. } : b.offset();
  6282. return c.top -= parseFloat($.css(a, "marginTop")) || 0, c.left -= parseFloat($.css(a, "marginLeft")) || 0, d.top += parseFloat($.css(b[0], "borderTopWidth")) || 0, d.left += parseFloat($.css(b[0], "borderLeftWidth")) || 0, {
  6283. top: c.top - d.top,
  6284. left: c.left - d.left
  6285. }
  6286. }
  6287. },
  6288. offsetParent: function() {
  6289. return this.map(function() {
  6290. for (var a = this.offsetParent || P.body; a && !_b.test(a.nodeName) && "static" === $.css(a, "position");) a = a.offsetParent;
  6291. return a || P.body
  6292. })
  6293. }
  6294. }), $.each({
  6295. scrollLeft: "pageXOffset",
  6296. scrollTop: "pageYOffset"
  6297. }, function(a, c) {
  6298. var d = /Y/.test(c);
  6299. $.fn[a] = function(e) {
  6300. return $.access(this, function(a, e, f) {
  6301. var g = M(a);
  6302. return f === b ? g ? c in g ? g[c] : g.document.documentElement[e] : a[e] : void(g ? g.scrollTo(d ? $(g).scrollLeft() : f, d ? f : $(g).scrollTop()) : a[e] = f)
  6303. }, a, e, arguments.length, null)
  6304. }
  6305. }), $.each({
  6306. Height: "height",
  6307. Width: "width"
  6308. }, function(a, c) {
  6309. $.each({
  6310. padding: "inner" + a,
  6311. content: c,
  6312. "": "outer" + a
  6313. }, function(d, e) {
  6314. $.fn[e] = function(e, f) {
  6315. var g = arguments.length && (d || "boolean" != typeof e),
  6316. h = d || (e === !0 || f === !0 ? "margin" : "border");
  6317. return $.access(this, function(c, d, e) {
  6318. var f;
  6319. return $.isWindow(c) ? c.document.documentElement["client" + a] : 9 === c.nodeType ? (f = c.documentElement, Math.max(c.body["scroll" + a], f["scroll" + a], c.body["offset" + a], f["offset" + a], f["client" + a])) : e === b ? $.css(c, d, e, h) : $.style(c, d, e, h)
  6320. }, c, g ? e : b, g, null)
  6321. }
  6322. })
  6323. }), a.jQuery = a.$ = $, "function" == typeof define && define.amd && define.amd.jQuery && define("jquery", [], function() {
  6324. return $
  6325. })
  6326. }(window),
  6327. function(a, b) {
  6328. "object" == typeof module && "object" == typeof module.exports ? module.exports = b : a.CrossDomainLocalStorage = b
  6329. }(this, function() {
  6330. function a(a) {
  6331. a = a || {}, this.keyPrefix = a.prefix || "", this.lifetime = a.lifetime || null, this.storage = xdLocalStorage
  6332. }
  6333. var b = [],
  6334. c = !1;
  6335. return a.prototype.isStorageExists = function() {
  6336. return !!this.storage
  6337. }, a.prototype.getFullKey = function(a) {
  6338. return "" !== this.keyPrefix ? this.keyPrefix + "_" + a : a
  6339. }, a.prototype.updateTimestamp = function(a) {
  6340. this._getCachedObject(a, function(b) {
  6341. b && this.setItem(a, b.data)
  6342. }.bind(this))
  6343. }, a.prototype._getCachedObject = function(a, b) {
  6344. this.isStorageExists() && this.storage.getItem(this.getFullKey(a), function(c) {
  6345. var d;
  6346. try {
  6347. d = JSON.parse(c.value)
  6348. } catch (a) {
  6349. d = null
  6350. }
  6351. return d && d.data && d.timestamp ? b(d) : (this.removeItem(a), b(null))
  6352. }.bind(this), !0)
  6353. }, a.prototype.getItem = function(a, b, c) {
  6354. var d = 1e3 * (this.lifetime || 0);
  6355. void 0 === c && (c = !0), this._getCachedObject(a, function(e) {
  6356. if (!e) return b(null);
  6357. var f = (new Date).getTime() - new Date(e.timestamp).getTime();
  6358. return d && f > d ? (this.removeItem(a), b(null)) : (!c && this.updateTimestamp(a), b(e.data))
  6359. }.bind(this))
  6360. }, a.prototype.setItem = function(a, b) {
  6361. var c;
  6362. this.isStorageExists() && (c = {
  6363. data: b || "",
  6364. timestamp: new Date
  6365. }, this.storage.setItem(this.getFullKey(a), JSON.stringify(c)))
  6366. }, a.prototype.getObject = function(a, b, c) {
  6367. this.getItem(a, function(a) {
  6368. var c;
  6369. try {
  6370. c = JSON.parse(a)
  6371. } catch (a) {
  6372. c = null
  6373. }
  6374. b(c)
  6375. }, c)
  6376. }, a.prototype.setObject = function(a, b) {
  6377. this.setItem(a, JSON.stringify(b))
  6378. }, a.prototype.removeItem = function(a) {
  6379. this.isStorageExists() && this.storage.removeItem(this.getFullKey(a))
  6380. }, a.prototype.getFlash = function(a) {
  6381. var b = this.getItem(a);
  6382. return b && this.removeItem(a), b
  6383. }, a.addCallback = function(a) {
  6384. "function" == typeof a && (c ? a() : b.push(a))
  6385. }, $(function() {
  6386. xdLocalStorage.init({
  6387. iframeUrl: Onliner.secureProjectUrl("gc", "/views/cross-domain-local-storage.html"),
  6388. initCallback: function() {
  6389. for (; b.length;) b.shift()();
  6390. c = !0
  6391. }
  6392. })
  6393. }), a
  6394. }()),
  6395. function(a, b) {
  6396. "object" == typeof module && "object" == typeof module.exports ? module.exports = b : a.EventDispatcher = b
  6397. }(this, function() {
  6398. function a() {
  6399. this.subscriptions = {}
  6400. }
  6401. return a.prototype.subscribe = function(a, b) {
  6402. [].concat(a).forEach(function(a) {
  6403. var c = this.subscriptions[a];
  6404. "undefined" == typeof c && (c = this.subscriptions[a] = []), "function" == typeof b && c.push(b)
  6405. }.bind(this))
  6406. }, a.prototype.trigger = function(a) {
  6407. var b = Array.prototype.splice.call(arguments, 1);
  6408. [].concat(a).forEach(function(a) {
  6409. var c = this.subscriptions[a];
  6410. if ("undefined" != typeof c)
  6411. for (var d in c) c[d].apply(null, b)
  6412. }.bind(this))
  6413. }, a.prototype.unsubscribe = function(a) {
  6414. [].concat(a).forEach(function(a) {
  6415. "undefined" != typeof this.subscriptions[a] && delete this.subscriptions[a]
  6416. }.bind(this))
  6417. }, a
  6418. }()),
  6419. function(a, b) {
  6420. "object" == typeof module && "object" == typeof module.exports ? module.exports = b : a.URL = b
  6421. }(this, function() {
  6422. var a = {};
  6423. return a.baseDomain = function() {
  6424. return document.location.host.split(".").slice(-2).join(".")
  6425. }(), a.projectDomain = function(b) {
  6426. return b + "." + a.baseDomain
  6427. }, a.projectUrl = function(b, c, d) {
  6428. return c = c ? c.replace(/^\/*/, "/") : "", d = d || "http://", d + a.projectDomain(b) + c
  6429. }, a.secureProjectUrl = function(b, c) {
  6430. return a.projectUrl(b, c, "https://")
  6431. }, a.redirect = function(a) {
  6432. document.location.href = a
  6433. }, a
  6434. }()),
  6435. function(a, b) {
  6436. "object" == typeof module && "object" == typeof module.exports ? module.exports = b(window.jQuery) : a.Rest = b(window.jQuery)
  6437. }(this, function(a) {
  6438. function b(c) {
  6439. this.options = {
  6440. dataType: "json",
  6441. contentType: "application/json",
  6442. statusCode: {
  6443. 400: function() {
  6444. b.showErrorNotification("Что-то пошло не так")
  6445. },
  6446. 403: function() {
  6447. b.showErrorNotification("Доступ запрещен. Войдите на сайт")
  6448. },
  6449. 404: function() {
  6450. b.showErrorNotification("Что-то пошло не так")
  6451. },
  6452. 415: function() {
  6453. b.showErrorNotification("Неподдерживаемый тип данных")
  6454. },
  6455. 500: function() {
  6456. b.showErrorNotification("Ошибка сервера")
  6457. },
  6458. 501: function() {
  6459. b.showErrorNotification("Ошибка сервера")
  6460. },
  6461. 502: function() {
  6462. b.showErrorNotification("Ошибка сервера")
  6463. },
  6464. 503: function() {
  6465. b.showErrorNotification("Ошибка сервера")
  6466. },
  6467. 504: function() {
  6468. b.showErrorNotification("Ошибка сервера")
  6469. }
  6470. }
  6471. }, a.extend(!0, this.options, c || {})
  6472. }
  6473. return b.prototype.query = function(b) {
  6474. var c = {};
  6475. return a.extend(!0, c, this.options, b), a.ajax(c)
  6476. }, b.collectErrors = function(b, c) {
  6477. var d, e = [];
  6478. if (b.responseText) try {
  6479. d = JSON.parse(b.responseText).errors
  6480. } catch (a) {
  6481. d = b.responseText
  6482. } else d = b.errors;
  6483. return d = d || c, a.isPlainObject(d) ? a.each(d, function(a, b) {
  6484. e = e.concat(b)
  6485. }) : e = e.concat(d), e
  6486. }, b.showErrorNotification = function(b, c) {
  6487. a.notifications.error(b, c)
  6488. }, b
  6489. }),
  6490. function(a, b) {
  6491. "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("jquery"), require("./url.js"), require("cookies-js"), require("base-64")) : a.Credentials = b(window.jQuery, window.URL, window.Cookies, window.base64)
  6492. }(this, function(a, b, c, d) {
  6493. function e(a) {
  6494. this.dispatcher = a, this.token = null, this.tokenType = null, this.timer = null, this.functionsToExecute = [], this.request = null
  6495. }
  6496. return e.isAuth = function() {
  6497. var a = window.MODELS && window.MODELS.currentUser || null;
  6498. return !!c.get("onl_session") && !(!a || !a.id())
  6499. }, e.prototype.executeFunctions = function() {
  6500. for (var a = this.functionsToExecute || [], b = a.shift(); b;) "function" == typeof b && b(), b = a.shift()
  6501. }, e.prototype.query = function(e) {
  6502. var f = this,
  6503. g = this.dispatcher;
  6504. return this.token ? e && e() : (this.functionsToExecute.push(e), void(this.request || (this.request = a.ajax({
  6505. type: "POST",
  6506. url: b.secureProjectUrl("credentials.api", "/oauth/token"),
  6507. contentType: "application/x-www-form-urlencoded",
  6508. dataType: "json",
  6509. data: {
  6510. grant_type: "client_credentials"
  6511. },
  6512. headers: {
  6513. Authorization: "Basic " + d.encode("onliner_user:" + c.get("onl_session"))
  6514. }
  6515. }), this.request.done(function(a) {
  6516. var b = 1e3 * Math.max(a.expires_in - 60, 60);
  6517. clearTimeout(f.timer), f.token = a.access_token, f.tokenType = a.token_type, f.timer = setTimeout(function() {
  6518. f.token = null
  6519. }, b), f.executeFunctions(), g && g.trigger("credentials:success", f.token)
  6520. }), this.request.fail(function(a) {
  6521. f.functionsToExecute = [], g && g.trigger("credentials:error", a)
  6522. }), this.request.always(function() {
  6523. f.request = null
  6524. }))))
  6525. }, e
  6526. }),
  6527. function(a, b) {
  6528. "object" == typeof module && "object" == typeof module.exports ? (require("../../bower_components/growl/javascripts/jquery.growl.js"), b(window.jQuery)) : b(window.jQuery)
  6529. }(this, function(a) {
  6530. function b(b, d, e) {
  6531. var f = {
  6532. title: e || "",
  6533. message: d || ""
  6534. },
  6535. g = a.growl[b];
  6536. g && g(f, c)
  6537. }
  6538. var c = {
  6539. fixed: !1,
  6540. size: "medium",
  6541. style: "default",
  6542. delayOnHover: !0
  6543. };
  6544. a.notifications = {
  6545. success: function(a, c) {
  6546. b("notice", a, c)
  6547. },
  6548. error: function(a, c) {
  6549. b("error", a, c)
  6550. }
  6551. }
  6552. }),
  6553. function() {
  6554. window.Onliner = window.Onliner || {}, Onliner.documentCharset = function() {
  6555. var a = $("head").find("meta[http-equiv=Content-Type][content]");
  6556. return a && /windows-1251/.test(a.attr("content")) ? "windows-1251" : "utf-8"
  6557. }(), Onliner.domain = function() {
  6558. return document.location.host.split(".").pop()
  6559. }(), Onliner.isCredentialsProblemInCORS = function() {
  6560. return /^Opera.*Presto.*$/i.test(navigator.userAgent)
  6561. }(), Onliner.isMobile = function() {
  6562. return /Android|iPhone|iPad|iPod|IEMobile/i.test(navigator.userAgent)
  6563. }(), Onliner.isIEMobile = function() {
  6564. return "-ms-user-select" in document.documentElement.style && navigator.userAgent.match(/IEMobile/)
  6565. }(), Onliner.isRetina = function() {
  6566. return window.devicePixelRatio && window.devicePixelRatio >= 2
  6567. }(), Onliner.baseDomain = function() {
  6568. return document.location.host.split(".").slice(-2).join(".")
  6569. }(), Onliner.projectDomain = function(a) {
  6570. return a + "." + Onliner.baseDomain
  6571. }, Onliner.projectUrl = function(a, b, c) {
  6572. return b = b ? b.replace(/^\/*/, "/") : "", c = c || "http://", c + Onliner.projectDomain(a) + b
  6573. }, Onliner.secureProjectUrl = function(a, b) {
  6574. return Onliner.projectUrl(a, b, "https://")
  6575. }, Onliner.urls = {
  6576. profile: Onliner.secureProjectUrl("profile")
  6577. }, Onliner.apiUrls = {
  6578. user: Onliner.isCredentialsProblemInCORS ? "/sdapi/user.api" : Onliner.secureProjectUrl("user.api"),
  6579. credentials: Onliner.secureProjectUrl("credentials.api"),
  6580. upload: Onliner.secureProjectUrl("upload.api"),
  6581. ak: Onliner.secureProjectUrl("ak.api"),
  6582. catalog: Onliner.secureProjectUrl("catalog.api")
  6583. }, Onliner.redirect = function(a) {
  6584. a && (document.location.href = a)
  6585. }, Onliner.reloadAfterAuth = function() {
  6586. Onliner.dispatcher && Onliner.dispatcher.subscribe("auth:cart-merge:complete", function() {
  6587. location.reload()
  6588. })
  6589. }, Onliner.redirectAfterAuth = function(a) {
  6590. Onliner.dispatcher && Onliner.dispatcher.subscribe("auth:cart-merge:complete", function() {
  6591. Onliner.redirect(a)
  6592. })
  6593. }, Onliner.executeAfterAuth = function(a) {
  6594. Onliner.dispatcher && Onliner.dispatcher.subscribe("auth:cart-merge:complete", function() {
  6595. a()
  6596. })
  6597. }, Onliner.inherit = function(a, b) {
  6598. var c = function() {};
  6599. c.prototype = b.prototype, a.prototype = new c, a.prototype.constructor = a, a.superclass = b.prototype
  6600. }, window.EventDispatcher && (Onliner.dispatcher = new EventDispatcher)
  6601. }(),
  6602. function() {
  6603. function a(a) {
  6604. var b = this;
  6605. this.fields = a, this.data = {}, $.each(a, function(a, c) {
  6606. b.data[c] = ko.observable()
  6607. }), this.errors = ko.observable({}), this.errorsArray = ko.computed(function() {
  6608. var a = [];
  6609. return $.each(b.errors(), function(b, c) {
  6610. a = a.concat(c)
  6611. }), a
  6612. }), this.isProcessing = ko.observable(!1)
  6613. }
  6614. window.CLASSES = window.CLASSES || {}, a.prototype.clearData = function() {
  6615. var a = this;
  6616. $.each(this.fields, function(b, c) {
  6617. a.data[c]("")
  6618. })
  6619. }, a.prototype.clearErrors = function(a) {
  6620. if (!a) return void this.errors({});
  6621. var b = this.errors();
  6622. delete b[a], this.errors(b)
  6623. }, CLASSES.AuthForm = a
  6624. }(),
  6625. function() {
  6626. function a(a) {
  6627. a = a || {};
  6628. var b = a.driver || "sessionStorage";
  6629. this.keyPrefix = a.prefix || "", this.lifetime = a.lifetime || null, this.storage = b in window ? window[b] : null
  6630. }
  6631. window.CLASSES = window.CLASSES || {}, a.prototype.isStorageExists = function() {
  6632. return !!this.storage
  6633. }, a.prototype.getFullKey = function(a) {
  6634. return "" !== this.keyPrefix ? this.keyPrefix + "_" + a : a
  6635. }, a.prototype.getItem = function(a) {
  6636. var b, c, d, e;
  6637. if (this.isStorageExists()) {
  6638. b = this.storage.getItem(this.getFullKey(a)), e = this.lifetime;
  6639. try {
  6640. c = JSON.parse(b)
  6641. } catch (a) {
  6642. return null
  6643. }
  6644. return c && c.data && c.timestamp ? e ? (d = (new Date).getTime() - new Date(c.timestamp).getTime(), d < 1e3 * e ? c.data : null) : c.data : null
  6645. }
  6646. }, a.prototype.setItem = function(a, b) {
  6647. var c;
  6648. this.isStorageExists() && (c = {
  6649. data: b || "",
  6650. timestamp: new Date
  6651. }, this.storage.setItem(this.getFullKey(a), JSON.stringify(c)))
  6652. }, a.prototype.getObject = function(a) {
  6653. try {
  6654. return JSON.parse(this.getItem(a))
  6655. } catch (a) {
  6656. return null
  6657. }
  6658. }, a.prototype.setObject = function(a, b) {
  6659. this.setItem(a, JSON.stringify(b))
  6660. }, a.prototype.removeItem = function(a) {
  6661. this.isStorageExists() && this.storage.removeItem(this.getFullKey(a))
  6662. }, a.prototype.clear = function() {
  6663. this.isStorageExists() && this.storage.clear()
  6664. }, a.prototype.length = function() {
  6665. return this.isStorageExists() ? this.storage.length : null
  6666. }, a.prototype.getFlash = function(a) {
  6667. var b = this.getItem(a);
  6668. return b && this.removeItem(a), b
  6669. }, CLASSES.Cache = a
  6670. }(),
  6671. function(a) {
  6672. function b(e, f) {
  6673. var g = b.instances[e];
  6674. if (g) return g.open(), g;
  6675. var h = {
  6676. autoOpen: !0,
  6677. closeButton: !0,
  6678. closeOverlay: !1
  6679. };
  6680. a.extend(h, f || {}), this.$container = a('<div id="' + e + '" class="modal" role="dialog" aria-hidden="true"></div>'), this.$container.html('<div class="modal-dialog"><div class="modal-content"></div>' + (h.closeButton ? '<div class="modal-close" data-dismiss="modal"></div>' : "") + "</div>"), a("body").append(this.$container), h.autoOpen && this.open(), b.instances[e] = this, h.closeOverlay && this.$container.on("click", function() {
  6681. b.closeAll()
  6682. }), Onliner.isIEMobile && !a("#ms-viewport-style").length && (c.originalValue !== c.newValue ? d.$newTag.html(d.originalValue) : d.$newTag.html(d.newValue), a("head").append(d.$newTag))
  6683. }
  6684. window.CLASSES = window.CLASSES || {};
  6685. var c = {},
  6686. d = {};
  6687. c.$metaTag = a("head").find("meta[name=viewport]:first"), c.newValue = "width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no", c.originalValue = c.$metaTag.length ? c.$metaTag.attr("content") : null, d.$newTag = a("<style/>", {
  6688. id: "ms-viewport-style"
  6689. }), d.newValue = "@-ms-viewport{width:device-width!important;}", d.originalValue = "@-ms-viewport{width:1150px!important;}", b.instances = {}, b.prototype.open = function(a) {
  6690. b.setViewport(), this.$container.trigger("modal:open", a || {}).fadeIn(300)
  6691. }, b.prototype.appendContent = function(a) {
  6692. this.$container.find(".modal-content").append(a)
  6693. }, b.closeAll = function() {
  6694. b.restoreViewport(), a(".modal:visible").trigger("modal:close").hide()
  6695. }, b.setViewport = function() {
  6696. c.originalValue !== c.newValue && (c.$metaTag.length ? c.$metaTag.attr("content", c.newValue) : (c.$metaTag = a('<meta name="viewport" content="' + c.newValue + '"/>'), a("head").append(c.$metaTag)), Onliner.isIEMobile && d.$newTag.html(d.newValue)), a("body").addClass("modal-visible")
  6697. }, b.restoreViewport = function() {
  6698. a("body").removeClass("modal-visible"), c.originalValue !== c.newValue && (c.$metaTag && c.$metaTag.length && (c.originalValue ? c.$metaTag.attr("content", c.originalValue) : c.$metaTag.remove()), Onliner.isIEMobile && d.$newTag.html(d.originalValue))
  6699. }, a(function() {
  6700. a("body").on("click", "[data-dismiss=modal]", function() {
  6701. b.closeAll()
  6702. }), a("body").bind("keyup", function(a) {
  6703. var c = a.keyCode || a.which;
  6704. 27 === c && b.closeAll()
  6705. })
  6706. }), CLASSES.Modal = b
  6707. }(jQuery),
  6708. function() {
  6709. function a() {
  6710. var a = this;
  6711. this.data = {
  6712. token: ko.observable(),
  6713. login: ko.observable(),
  6714. password: ko.observable()
  6715. }, this.errors = ko.observable({}), this.errorsArray = ko.computed(function() {
  6716. var b = [];
  6717. return $.each(a.errors(), function(a, c) {
  6718. b = b.concat(c)
  6719. }), b
  6720. }), this.isProcessing = ko.observable(!1), this.data.login.subscribe(function(b) {
  6721. b && a.clearErrors("login")
  6722. }), this.data.password.subscribe(function(b) {
  6723. b && a.clearErrors("password")
  6724. }), this.callbacks = {
  6725. success: function(a) {
  6726. MODELS.AuthController.updateCurrentUserData(a.user), MODELS.AuthController.closeModals()
  6727. }
  6728. }
  6729. }
  6730. window.CLASSES = window.CLASSES || {}, a.prototype.isCaptchaVisible = ko.observable(!1), a.prototype.clearData = function(a) {
  6731. return a ? void this.data[a]("") : (this.data.login(""), void this.data.password(""))
  6732. }, a.prototype.clearErrors = function(a) {
  6733. if (!a) return void this.errors({});
  6734. var b = this.errors();
  6735. delete b[a], this.errors(b)
  6736. }, a.prototype.query = function() {
  6737. var a, b = this;
  6738. this.clearErrors(), this.isProcessing(!0), a = $.ajax({
  6739. type: "POST",
  6740. url: Onliner.apiUrls.user + "/login",
  6741. data: JSON.stringify({
  6742. token: this.data.token(),
  6743. login: this.data.login(),
  6744. password: this.data.password(),
  6745. session_id: this.data.session_id || null,
  6746. recaptcha_challenge_field: window.Recaptcha && Recaptcha.get_challenge(),
  6747. recaptcha_response_field: window.Recaptcha && Recaptcha.get_response()
  6748. }),
  6749. dataType: "json",
  6750. contentType: "application/json",
  6751. xhrFields: {
  6752. withCredentials: !0
  6753. },
  6754. headers: {
  6755. "X-Accept-Charset": Onliner.documentCharset
  6756. }
  6757. }), a.done(function(a) {
  6758. b.callbacks.success(a), Onliner.dispatcher && Onliner.dispatcher.trigger("auth:success", a)
  6759. }), a.fail(function(a, c, d) {
  6760. var e;
  6761. b.isCaptchaVisible() && window.Recaptcha && Recaptcha.reload();
  6762. try {
  6763. e = JSON.parse(a.responseText)
  6764. } catch (a) {}
  6765. $.isPlainObject(e) && (e.captcha && b.isCaptchaVisible(e.captcha.show_at_login), b.errors(e.errors || {})), b.data.password(""), MODELS.AuthController.fieldFocus("login", "#auth"), MODELS.AuthController.fieldFocus("password", "#auth-additional-container__password"), Onliner.dispatcher && Onliner.dispatcher.trigger("auth:error")
  6766. }), a.always(function() {
  6767. b.isProcessing(!1), Onliner.dispatcher && Onliner.dispatcher.trigger("auth:complete")
  6768. })
  6769. }, CLASSES.OnlinerLogin = a
  6770. }(),
  6771. function() {
  6772. function a() {
  6773. var a = this;
  6774. this.data = {
  6775. token: ko.observable(),
  6776. email: ko.observable(),
  6777. password: ko.observable(),
  6778. password_confirmation: ko.observable()
  6779. }, this.errors = ko.observable({}), this.errorsArray = ko.computed(function() {
  6780. var b = [];
  6781. return $.each(a.errors(), function(a, c) {
  6782. b = b.concat(c)
  6783. }), b
  6784. }), this.isProcessing = ko.observable(!1), this.data.email.subscribe(function(b) {
  6785. b && a.clearErrors("email")
  6786. }), this.data.password.subscribe(function(b) {
  6787. b && a.clearErrors("password"), b && a.clearErrors("password_confirmation")
  6788. }), this.data.password_confirmation.subscribe(function(b) {
  6789. b && a.clearErrors("password"), b && a.clearErrors("password_confirmation")
  6790. })
  6791. }
  6792. window.CLASSES = window.CLASSES || {}, a.prototype.clearData = function() {
  6793. this.data.email(""), this.data.password(""), this.data.password_confirmation("")
  6794. }, a.prototype.clearErrors = function(a) {
  6795. if (!a) return void this.errors({});
  6796. var b = this.errors();
  6797. delete b[a], this.errors(b)
  6798. }, a.prototype.query = function() {
  6799. var a, b = this;
  6800. this.clearErrors(), this.isProcessing(!0), a = $.ajax({
  6801. type: "POST",
  6802. url: Onliner.apiUrls.user + "/users",
  6803. data: JSON.stringify({
  6804. token: this.data.token(),
  6805. email: this.data.email(),
  6806. password: this.data.password(),
  6807. password_confirmation: this.data.password_confirmation(),
  6808. recaptcha_challenge_field: Recaptcha.get_challenge(),
  6809. recaptcha_response_field: Recaptcha.get_response()
  6810. }),
  6811. dataType: "json",
  6812. contentType: "application/json",
  6813. xhrFields: {
  6814. withCredentials: !0
  6815. },
  6816. headers: {
  6817. "X-Accept-Charset": Onliner.documentCharset
  6818. }
  6819. }), a.done(function() {
  6820. $("#auth-container__social, #auth-container__forms").hide(), $("#auth-container__msg").show()
  6821. }), a.fail(function(a, c, d) {
  6822. var e;
  6823. try {
  6824. e = JSON.parse(a.responseText)
  6825. } catch (a) {}
  6826. $.isPlainObject(e) && b.errors(e.errors || {}), Recaptcha && Recaptcha.reload(), MODELS.AuthController.fieldFocus("registration", "#auth")
  6827. }), a.always(function() {
  6828. b.isProcessing(!1)
  6829. })
  6830. }, CLASSES.OnlinerRegistration = a
  6831. }(),
  6832. function() {
  6833. function a(a) {
  6834. this.name = a, this.sessionId = null, this.url = ""
  6835. }
  6836.  
  6837. function b() {
  6838. this.networks = {
  6839. facebook: new a("facebook"),
  6840. vkontakte: new a("vkontakte"),
  6841. twitter: new a("twitter")
  6842. }, this.user = {
  6843. nickname: ko.observable(),
  6844. email: ko.observable()
  6845. }, this.currentNetwork = null, this.popupWindow = null, this.processStatusCallbacks = {
  6846. logged_in: function(a) {
  6847. MODELS.AuthController.updateCurrentUserData(a.user), MODELS.AuthController.closeModals()
  6848. },
  6849. email_required: function(a) {
  6850. MODELS.AuthController.showModalAuthAdditional()
  6851. },
  6852. errors: function(a) {
  6853. MODELS.AuthController.closeModals()
  6854. },
  6855. linked: function(a) {
  6856. MODELS.AuthController.updateCurrentUserData(a.user), MODELS.AuthController.closeModals()
  6857. },
  6858. default: function(a) {}
  6859. }
  6860. }
  6861. window.CLASSES = window.CLASSES || {}, b.prototype.auth = function(a, b) {
  6862. var c, d = this,
  6863. e = this.networks[a];
  6864. if (e) {
  6865. if (this.popupWindow && !this.popupWindow.closed) {
  6866. if (this.currentNetwork && this.currentNetwork.name === e.name) return void this.popupWindow.focus();
  6867. this.popupWindow.close(), clearInterval(c)
  6868. }
  6869. this.currentNetwork = e, this.popupWindow = window.open(e.url, "auth " + e.name, "width=656,height=377,menubar=no,toolbar=no,location=no,directories=no,status=no"), c = setInterval(function() {
  6870. d.popupWindow.closed && (d.statusQuery(), clearInterval(c))
  6871. }, 500)
  6872. }
  6873. }, b.prototype.statusQuery = function() {
  6874. var a = this,
  6875. b = $.ajax({
  6876. url: Onliner.apiUrls.user + "/sessions/" + this.currentNetwork.sessionId,
  6877. type: "GET",
  6878. dataType: "json",
  6879. contentType: "application/json",
  6880. xhrFields: {
  6881. withCredentials: !0
  6882. },
  6883. headers: {
  6884. "X-Accept-Charset": Onliner.documentCharset
  6885. }
  6886. });
  6887. b.done(function(b) {
  6888. var c;
  6889. b && (c = a.processStatusCallbacks[b.status] || a.processStatusCallbacks.default, c && c(b), "logged_in" !== b.status && "linked" !== b.status || Onliner.dispatcher && Onliner.dispatcher.trigger("networks-auth:success", b))
  6890. }), b.fail(function(a) {
  6891. 401 === a.status && window.location.reload(), Onliner.dispatcher && Onliner.dispatcher.trigger("networks-auth:error")
  6892. }), b.always(function() {
  6893. Onliner.dispatcher && Onliner.dispatcher.trigger("networks-auth:complete")
  6894. })
  6895. }, b.prototype.link = function(a) {
  6896. if (this.currentNetwork) {
  6897. var b = $.ajax({
  6898. type: "GET",
  6899. xhrFields: {
  6900. withCredentials: !0
  6901. },
  6902. url: Onliner.apiUrls.user + "/sessions/" + this.currentNetwork.sessionId + "/link"
  6903. });
  6904. b.done(function() {
  6905. a && a()
  6906. })
  6907. }
  6908. }, b.prototype.sendEmail = function() {
  6909. var a, b = this,
  6910. c = this.emailForm;
  6911. c && (c.clearErrors(), c.isProcessing(!0), a = $.ajax({
  6912. type: "POST",
  6913. url: Onliner.apiUrls.user + "/users/sessions/" + this.currentNetwork.sessionId,
  6914. data: JSON.stringify({
  6915. token: c.data.token,
  6916. email: c.data.email()
  6917. }),
  6918. dataType: "json",
  6919. contentType: "application/json",
  6920. xhrFields: {
  6921. withCredentials: !0
  6922. },
  6923. headers: {
  6924. "X-Accept-Charset": Onliner.documentCharset
  6925. }
  6926. }), a.done(function() {
  6927. $("#auth-additional-container__email").hide(), $("#auth-additional-container__password").hide(), $("#auth-additional-container__msg").show()
  6928. }), a.fail(function(a) {
  6929. var d;
  6930. if (409 === a.status) {
  6931. var d;
  6932. b.user.email(c.data.email());
  6933. try {
  6934. d = JSON.parse(a.responseText)
  6935. } catch (a) {}
  6936. return $.isPlainObject(d) && b.user.nickname(d.nickname), $("#auth-additional-container__email").hide(), $("#auth-additional-container__password").show(), $("#auth-additional-container__msg").hide(), void MODELS.AuthController.fieldFocus("password", "#auth-additional-container__password")
  6937. }
  6938. try {
  6939. d = JSON.parse(a.responseText)
  6940. } catch (a) {}
  6941. $.isPlainObject(d) && c.errors(d.errors || {}), MODELS.AuthController.fieldFocus("email", "#auth-additional-container__email")
  6942. }), a.always(function() {
  6943. c.isProcessing(!1)
  6944. }))
  6945. }, CLASSES.SocialNetworksAuth = b
  6946. }(),
  6947. function() {
  6948. function a() {
  6949. this.id = ko.observable(null), this.nickname = ko.observable(""), this.money = ko.observable(""), this.logout_key = ko.observable(""), this.newMessages = ko.observable(0), this.isSmsValidated = ko.observable(null)
  6950. }
  6951. window.CLASSES = window.CLASSES || {}, a.prototype.setData = function(a) {
  6952. var b = this;
  6953. a && ($.each(["id", "nickname", "money", "logout_key", "isSmsValidated"], function(c, d) {
  6954. var e = a[d];
  6955. void 0 !== e && b[d](e)
  6956. }), this.getNewMessagesCount())
  6957. }, a.prototype.getNewMessagesCount = function() {
  6958. var a = this;
  6959. $.ajax({
  6960. type: "GET",
  6961. url: "/sdapi/api/messages/unread",
  6962. dataType: "text",
  6963. success: function(b) {
  6964. a.newMessages(parseInt(b))
  6965. },
  6966. error: function() {
  6967. a.newMessages(0)
  6968. }
  6969. })
  6970. }, CLASSES.User = a
  6971. }(),
  6972. function() {
  6973. window.MODELS = window.MODELS || {};
  6974. var a = {},
  6975. b = null;
  6976. a.showModalAuth = function() {
  6977. return Onliner.isCredentialsProblemInCORS ? void Onliner.redirect(Onliner.urls.profile + "/login?redirect=" + encodeURIComponent(document.location.href)) : (b = new CLASSES.Modal("modal-auth"), b.appendContent('<div id="auth-container"></div>'), this.getAuthTemplate("#auth-container"), void(this.showModalAuth = function(c) {
  6978. b.open(), MODELS.onlinerAuth && a.fieldFocus(MODELS.onlinerAuth.openedTab(), "#auth"), c && MODELS.onlinerAuth.openedTab(c)
  6979. }))
  6980. }, a.showModalAuthAdditional = function() {
  6981. b = new CLASSES.Modal("modal-auth"), b.appendContent('<div id="auth-additional-container"></div>'), this.getAdditionalTemplate("#auth-additional-container"), $("#auth-container").hide(), this.showModalAuthAdditional = function() {
  6982. $("#auth-container").hide(), $("#auth-additional-container").show(), this.showPasswordCaptcha && this.showPasswordCaptcha(), b.open(), a.fieldFocus("email", "#auth-additional-container__email")
  6983. }
  6984. }, a.getAuthTemplate = function(a, b) {
  6985. this.getTemplate(Onliner.apiUrls.user + "/login", a, b)
  6986. }, a.getAdditionalTemplate = function(a, b) {
  6987. var c = MODELS.socialNetworksAuth.currentNetwork.sessionId;
  6988. this.getTemplate(Onliner.apiUrls.user + "/users/sessions/" + c, a, b)
  6989. }, a.getTemplate = function(a, b, c) {
  6990. var d, e = $('<div class="auth__loader"></div>'),
  6991. f = $(b);
  6992. f.append(e), d = $.ajax({
  6993. type: "GET",
  6994. url: a,
  6995. dataType: "html",
  6996. xhrFields: {
  6997. withCredentials: !0
  6998. },
  6999. headers: {
  7000. "X-Accept-Charset": Onliner.documentCharset
  7001. }
  7002. }), d.done(function(a) {
  7003. e.hide(), f.append(a), c && c()
  7004. })
  7005. }, a.updateCurrentUserData = function(a) {
  7006. MODELS.currentUser.setData(a)
  7007. }, a.closeModals = function() {
  7008. CLASSES.Modal.closeAll()
  7009. }, a.fieldFocus = function(a, b) {
  7010. if (!Onliner.isMobile) {
  7011. var c = $((b || "") + ' [data-field="' + a + '"]'),
  7012. d = c.filter(".is-error"),
  7013. e = $("#recaptcha_response_field");
  7014. (d.length ? d : c).first().trigger("focus"), e.hasClass("is-error") && e.trigger("focus")
  7015. }
  7016. }, a.showCaptcha = function(a, b) {
  7017. function c(a, b) {
  7018. $(".auth-box__captcha-primary").parent().empty(), $("#" + b).html(d), Recaptcha.create(a, b, {
  7019. theme: "custom",
  7020. custom_theme_widget: b
  7021. })
  7022. }
  7023. var d = this.recaptchaTemplate || "";
  7024. window.Recaptcha ? c(a, b) : $.getScript("https://www.google.com/recaptcha/api/js/recaptcha_ajax.js").done(function() {
  7025. Recaptcha.focus_response_field = function() {}, c(a, b)
  7026. })
  7027. }, MODELS.AuthController = a
  7028. }(),
  7029. function() {
  7030. window.MODELS = window.MODELS || {}, MODELS.currentUser = new CLASSES.User
  7031. }(),
  7032. function() {
  7033. window.MODELS = window.MODELS || {}, MODELS.onlinerLogin = new CLASSES.OnlinerLogin
  7034. }(),
  7035. function() {
  7036. window.MODELS = window.MODELS || {}, MODELS.onlinerRegistration = new CLASSES.OnlinerRegistration
  7037. }(),
  7038. function() {
  7039. window.MODELS = window.MODELS || {}, MODELS.socialNetworksAuth = new CLASSES.SocialNetworksAuth
  7040. }(),
  7041. function(a, b) {
  7042. "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("knockout"), require("underscore"), require("../modules/CrossDomainLocalStorage.js")) : a.CartPositionsCache = b(window.ko, window._, window.CrossDomainLocalStorage)
  7043. }(this, function(a, b, c) {
  7044. function d() {
  7045. this.cache = new c({
  7046. prefix: "cart",
  7047. lifetime: 2592e3
  7048. }), this.maxPositions = 50, this.maxQuantity = 10
  7049. }
  7050. return d.prototype.getPositionsSummary = function(a) {
  7051. var a = a || {};
  7052. this.getPositions({
  7053. success: function(b) {
  7054. var c = {};
  7055. c.total = {
  7056. quantity: b && b.length || 0
  7057. }, a.success && a.success(c)
  7058. }
  7059. })
  7060. }, d.prototype.clearPositions = function() {
  7061. this.cache.removeItem("positions")
  7062. }, d.prototype.getPositions = function(a, b) {
  7063. var a = a || {};
  7064. a.success = a.success || function() {}, this.cache.getObject("positions", a.success, b)
  7065. }, d
  7066. }),
  7067. function(a, b) {
  7068. "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("knockout"), require("../modules/Credentials.js"), require("../modules/url.js")) : a.CartPositionsServer = b(window.ko, window.Credentials, window.URL)
  7069. }(this, function(a, b, c) {
  7070. function d() {
  7071. this.credentials = new b, this.url = c.secureProjectUrl("cart.api");
  7072. }
  7073. var e = MODELS && MODELS.currentUser || null;
  7074. return d.prototype.getPositionsSummary = function(a) {
  7075. return this._getPositionsSummary(a)
  7076. }, d.prototype.mergePositions = function(a, b) {
  7077. return this.credentials.query(this._mergePositions.bind(this, a, b))
  7078. }, d.prototype._getPositionsSummary = function(a) {
  7079. var b = e && e.id() || null;
  7080. return this._query({
  7081. type: "GET",
  7082. path: "/users/" + b + "/positions/summary",
  7083. authorization: !1
  7084. }, a)
  7085. }, d.prototype._mergePositions = function(a, b) {
  7086. return this._query({
  7087. data: JSON.stringify({
  7088. positions: a
  7089. }),
  7090. type: "POST",
  7091. path: "/positions/merge",
  7092. authorization: !0
  7093. }, b)
  7094. }, d.prototype._query = function(a, b) {
  7095. var c, a = a || {},
  7096. b = b || {};
  7097. return c = $.ajax({
  7098. url: this.url + (a.path || ""),
  7099. type: a.type,
  7100. data: a.data || {},
  7101. dataType: "json",
  7102. contentType: "application/json",
  7103. headers: {
  7104. Authorization: a.authorization ? this.credentials.tokenType + " " + this.credentials.token : null
  7105. }
  7106. }), c.done(function() {
  7107. b.success && b.success.apply(null, arguments)
  7108. }), c.fail(function() {
  7109. b.error && b.error.apply(null, arguments)
  7110. }), c.always(function() {
  7111. b.complete && b.complete.apply(null, arguments)
  7112. }), c
  7113. }, d
  7114. }),
  7115. function(a, b) {
  7116. "object" == typeof module && "object" == typeof module.exports ? module.exports = b(require("./CartPositionsCache.js"), require("./CartPositionsServer.js"), require("../modules/Credentials.js")) : a.CartPositions = b(window.CartPositionsCache, window.CartPositionsServer, window.Credentials)
  7117. }(this, function(a, b, c) {
  7118. function d() {
  7119. this.cartPositionsCache = new a, this.cartPositionsServer = new b
  7120. }
  7121. return d.prototype._getInstance = function() {
  7122. return c.isAuth() ? this.cartPositionsServer : this.cartPositionsCache
  7123. }, d.prototype.getPositionsSummary = function(a) {
  7124. return this._getInstance().getPositionsSummary(a)
  7125. }, d.prototype.mergePositions = function(a) {
  7126. this.cartPositionsCache.getPositions({
  7127. success: function(b) {
  7128. return Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:start"), b && b.length ? void this.cartPositionsServer.mergePositions(b, {
  7129. success: function() {
  7130. this.cartPositionsCache.clearPositions(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:success")
  7131. }.bind(this),
  7132. error: function(a) {
  7133. 422 === a.status && this.cartPositionsCache.clearPositions(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:error")
  7134. }.bind(this),
  7135. complete: function() {
  7136. a && a(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:complete")
  7137. }
  7138. }) : (a && a(), Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:success"), void(Onliner.dispatcher && Onliner.dispatcher.trigger("cart:merge:complete")))
  7139. }.bind(this)
  7140. })
  7141. }, d
  7142. }),
  7143. function() {
  7144. Onliner.dispatcher && Onliner.dispatcher.subscribe(["auth:success", "networks-auth:success"], function() {
  7145. var a = new CartPositions;
  7146. a.mergePositions(function() {
  7147. Onliner.dispatcher && Onliner.dispatcher.trigger("auth:cart-merge:complete")
  7148. })
  7149. })
  7150. }();
Add Comment
Please, Sign In to add comment